From 52a21b415ad95b2c4649254447388cb329cee1a4 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 28 Apr 2012 23:25:57 -0400 Subject: [PATCH 01/90] initial commit. not currently in a working state. --- nexgb/AUTHORS | 18 ++ nexgb/CONTRIBUTORS | 39 +++ nexgb/LICENSE | 42 +++ nexgb/Makefile | 19 ++ nexgb/README | 33 +++ nexgb/auth.go | 111 ++++++++ nexgb/xgb.go | 484 +++++++++++++++++++++++++++++++++ nexgb/xgb_help.go | 103 +++++++ nexgb/xgbgen/context.go | 89 ++++++ nexgb/xgbgen/go.go | 255 +++++++++++++++++ nexgb/xgbgen/main.go | 64 +++++ nexgb/xgbgen/misc.go | 44 +++ nexgb/xgbgen/xgbgen | Bin 0 -> 2318165 bytes nexgb/xgbgen/xml.go | 298 ++++++++++++++++++++ nexgb/xgbgen/xml_expression.go | 160 +++++++++++ nexgb/xgbgen/xml_fields.go | 147 ++++++++++ 16 files changed, 1906 insertions(+) create mode 100644 nexgb/AUTHORS create mode 100644 nexgb/CONTRIBUTORS create mode 100644 nexgb/LICENSE create mode 100644 nexgb/Makefile create mode 100644 nexgb/README create mode 100644 nexgb/auth.go create mode 100644 nexgb/xgb.go create mode 100644 nexgb/xgb_help.go create mode 100644 nexgb/xgbgen/context.go create mode 100644 nexgb/xgbgen/go.go create mode 100644 nexgb/xgbgen/main.go create mode 100644 nexgb/xgbgen/misc.go create mode 100755 nexgb/xgbgen/xgbgen create mode 100644 nexgb/xgbgen/xml.go create mode 100644 nexgb/xgbgen/xml_expression.go create mode 100644 nexgb/xgbgen/xml_fields.go diff --git a/nexgb/AUTHORS b/nexgb/AUTHORS new file mode 100644 index 0000000..08fc0cd --- /dev/null +++ b/nexgb/AUTHORS @@ -0,0 +1,18 @@ +Andrew Gallant is the maintainer of this fork. What follows is the original +list of authors for the x-go-binding. + +# This is the official list of XGB authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +Anthony Martin +Firmansyah Adiputra +Google Inc. +Scott Lawrence +Tor Andersson diff --git a/nexgb/CONTRIBUTORS b/nexgb/CONTRIBUTORS new file mode 100644 index 0000000..46dc4b0 --- /dev/null +++ b/nexgb/CONTRIBUTORS @@ -0,0 +1,39 @@ +Andrew Gallant is the maintainer of this fork. What follows is the original +list of contributors for the x-go-binding. + +# This is the official list of people who can contribute +# (and typically have contributed) code to the XGB repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name + +# Please keep the list sorted. + +Anthony Martin +Firmansyah Adiputra +Ian Lance Taylor +Nigel Tao +Robert Griesemer +Russ Cox +Scott Lawrence +Tor Andersson diff --git a/nexgb/LICENSE b/nexgb/LICENSE new file mode 100644 index 0000000..d99cd90 --- /dev/null +++ b/nexgb/LICENSE @@ -0,0 +1,42 @@ +// Copyright (c) 2009 The XGB Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Subject to the terms and conditions of this License, Google hereby +// grants to You a perpetual, worldwide, non-exclusive, no-charge, +// royalty-free, irrevocable (except as stated in this section) patent +// license to make, have made, use, offer to sell, sell, import, and +// otherwise transfer this implementation of XGB, where such license +// applies only to those patent claims licensable by Google that are +// necessarily infringed by use of this implementation of XGB. If You +// institute patent litigation against any entity (including a +// cross-claim or counterclaim in a lawsuit) alleging that this +// implementation of XGB or a Contribution incorporated within this +// implementation of XGB constitutes direct or contributory patent +// infringement, then any patent licenses granted to You under this +// License for this implementation of XGB shall terminate as of the date +// such litigation is filed. diff --git a/nexgb/Makefile b/nexgb/Makefile new file mode 100644 index 0000000..041d20c --- /dev/null +++ b/nexgb/Makefile @@ -0,0 +1,19 @@ +XPROTO=/usr/share/xcb +all: xproto xinerama + +xproto: + python2 go_client.py $(XPROTO)/xproto.xml + gofmt -w xproto.go + +xinerama: + python2 go_client.py $(XPROTO)/xinerama.xml + gofmt -w xinerama.go + +randr: + python2 go_client.py $(XPROTO)/randr.xml + gofmt -w randr.go + +render: + python2 go_client.py $(XPROTO)/render.xml + gofmt -w render.go + diff --git a/nexgb/README b/nexgb/README new file mode 100644 index 0000000..f659e32 --- /dev/null +++ b/nexgb/README @@ -0,0 +1,33 @@ +BurntSushi's Fork +================= +I've forked the XGB repository from Google Code due to inactivty upstream. + +Much of the code has been rewritten in an effort to support thread safety +and multiple extensions. Namely, go_client.py has been thrown away in favor +of an xgbgen package. + +The biggest parts that *haven't* been rewritten by me are the connection and +authentication handshakes. They're inherently messy, and there's really no +reason to re-work them. + +I like to release my code under the WTFPL, but since I'm starting with someone +else's work, I'm leaving the original license/contributor/author information +in tact. + +I suppose I can legitimately release xgbgen under the WTFPL. + +What follows is the original README: + +XGB README +========== +XGB is the X protocol Go language Binding. + +It is the Go equivalent of XCB, the X protocol C-language Binding +(http://xcb.freedesktop.org/). + +Unless otherwise noted, the XGB source files are distributed +under the BSD-style license found in the LICENSE file. + +Contributions should follow the same procedure as for the Go project: +http://golang.org/doc/contribute.html + diff --git a/nexgb/auth.go b/nexgb/auth.go new file mode 100644 index 0000000..355afeb --- /dev/null +++ b/nexgb/auth.go @@ -0,0 +1,111 @@ +// Copyright 2009 The XGB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xgb + +import ( + "bufio" + "errors" + "io" + "os" +) + +func getU16BE(r io.Reader, b []byte) (uint16, error) { + _, err := io.ReadFull(r, b[0:2]) + if err != nil { + return 0, err + } + return uint16(b[0])<<8 + uint16(b[1]), nil +} + +func getBytes(r io.Reader, b []byte) ([]byte, error) { + n, err := getU16BE(r, b) + if err != nil { + return nil, err + } + if int(n) > len(b) { + return nil, errors.New("bytes too long for buffer") + } + _, err = io.ReadFull(r, b[0:n]) + if err != nil { + return nil, err + } + return b[0:n], nil +} + +func getString(r io.Reader, b []byte) (string, error) { + b, err := getBytes(r, b) + if err != nil { + return "", err + } + return string(b), nil +} + +// readAuthority reads the X authority file for the DISPLAY. +// If hostname == "" or hostname == "localhost", +// readAuthority uses the system's hostname (as returned by os.Hostname) instead. +func readAuthority(hostname, display string) (name string, data []byte, err error) { + // b is a scratch buffer to use and should be at least 256 bytes long + // (i.e. it should be able to hold a hostname). + var b [256]byte + + // As per /usr/include/X11/Xauth.h. + const familyLocal = 256 + + if len(hostname) == 0 || hostname == "localhost" { + hostname, err = os.Hostname() + if err != nil { + return "", nil, err + } + } + + fname := os.Getenv("XAUTHORITY") + if len(fname) == 0 { + home := os.Getenv("HOME") + if len(home) == 0 { + err = errors.New("Xauthority not found: $XAUTHORITY, $HOME not set") + return "", nil, err + } + fname = home + "/.Xauthority" + } + + r, err := os.Open(fname) + if err != nil { + return "", nil, err + } + defer r.Close() + + br := bufio.NewReader(r) + for { + family, err := getU16BE(br, b[0:2]) + if err != nil { + return "", nil, err + } + + addr, err := getString(br, b[0:]) + if err != nil { + return "", nil, err + } + + disp, err := getString(br, b[0:]) + if err != nil { + return "", nil, err + } + + name0, err := getString(br, b[0:]) + if err != nil { + return "", nil, err + } + + data0, err := getBytes(br, b[0:]) + if err != nil { + return "", nil, err + } + + if family == familyLocal && addr == hostname && disp == display { + return name0, data0, nil + } + } + panic("unreachable") +} diff --git a/nexgb/xgb.go b/nexgb/xgb.go new file mode 100644 index 0000000..7e209a7 --- /dev/null +++ b/nexgb/xgb.go @@ -0,0 +1,484 @@ +// Copyright 2009 The XGB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The XGB package implements the X11 core protocol. +// It is based on XCB: http://xcb.freedesktop.org/ +package xgb + +import ( + "errors" + "fmt" + "io" + "net" + "os" + "strconv" + "strings" + "sync" +) + +const ( + readBuffer = 100 + writeBuffer = 100 +) + +// A Conn represents a connection to an X server. +// Only one goroutine should use a Conn's methods at a time. +type Conn struct { + host string + conn net.Conn + nextId Id + nextCookie uint16 + cookies map[uint16]*Cookie + events queue + err error + display string + defaultScreen int + scratch [32]byte + Setup SetupInfo + extensions map[string]byte + + requestChan chan *Request + requestCookieChan chan *Cookie + replyChan chan bool + eventChan chan bool + errorChan chan bool + + newIdLock sync.Mutex + writeLock sync.Mutex + dequeueLock sync.Mutex + cookieLock sync.Mutex + extLock sync.Mutex +} + +// Id is used for all X identifiers, such as windows, pixmaps, and GCs. +type Id uint32 + +// Request is used to abstract the difference between a request +// that expects a reply and a request that doesn't expect a reply. +type Request struct { + buf []byte + cookieChan chan *Cookie +} + +func newRequest(buf []byte, needsReply bool) *Request { + req := &Request{ + buf: buf, + cookieChan: nil, + } + if needsReply { + req.cookieChan = make(chan *Cookie) + } + return req +} + +// Cookies are the sequence numbers used to pair replies up with their requests +type Cookie struct { + id uint16 + replyChan chan []byte + errorChan chan error +} + +func newCookie(id uint16) *Cookie { + return &Cookie{ + id: id, + replyChan: make(chan []byte, 1), + errorChan: make(chan error, 1), + } +} + +// Event is an interface that can contain any of the events returned by the server. +// Use a type assertion switch to extract the Event structs. +type Event interface{} + +// Error contains protocol errors returned to us by the X server. +type Error struct { + Detail uint8 + Major uint8 + Minor uint16 + Cookie uint16 + Id Id +} + +func (e *Error) Error() string { + return fmt.Sprintf("Bad%s (major=%d minor=%d cookie=%d id=0x%x)", + errorNames[e.Detail], e.Major, e.Minor, e.Cookie, e.Id) +} + +// NewID generates a new unused ID for use with requests like CreateWindow. +func (c *Conn) NewId() Id { + c.newIdLock.Lock() + defer c.newIdLock.Unlock() + + id := c.nextId + // TODO: handle ID overflow + c.nextId++ + return id +} + +// RegisterExtension adds the respective extension's major op code to +// the extensions map. +func (c *Conn) RegisterExtension(name string) error { + nameUpper := strings.ToUpper(name) + reply, err := c.QueryExtension(nameUpper) + + switch { + case err != nil: + return err + case !reply.Present: + return errors.New(fmt.Sprintf("No extension named '%s' is present.", + nameUpper)) + } + + c.extLock.Lock() + c.extensions[nameUpper] = reply.MajorOpcode + c.extLock.Unlock() + + return nil +} + +// A simple queue used to stow away events. +type queue struct { + data [][]byte + a, b int +} + +func (q *queue) queue(item []byte) { + if q.b == len(q.data) { + if q.a > 0 { + copy(q.data, q.data[q.a:q.b]) + q.a, q.b = 0, q.b-q.a + } else { + newData := make([][]byte, (len(q.data)*3)/2) + copy(newData, q.data) + q.data = newData + } + } + q.data[q.b] = item + q.b++ +} + +func (q *queue) dequeue(c *Conn) []byte { + c.dequeueLock.Lock() + defer c.dequeueLock.Unlock() + + if q.a < q.b { + item := q.data[q.a] + q.a++ + return item + } + return nil +} + +// newWriteChan creates the channel required for writing to the net.Conn. +func (c *Conn) newRequestChannels() { + c.requestChan = make(chan *Request, writeBuffer) + c.requestCookieChan = make(chan *Cookie, 1) + + go func() { + for request := range c.requestChan { + cookieNum := c.nextCookie + c.nextCookie++ + + if request.cookieChan != nil { + cookie := newCookie(cookieNum) + c.cookies[cookieNum] = cookie + request.cookieChan <- cookie + } + if _, err := c.conn.Write(request.buf); err != nil { + fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) + close(c.requestChan) + return + } + } + }() +} + +// request is a buffered write to net.Conn. +func (c *Conn) request(buf []byte, needsReply bool) *Cookie { + req := newRequest(buf, needsReply) + c.requestChan <- req + + if req.cookieChan != nil { + cookie := <-req.cookieChan + close(req.cookieChan) + return cookie + } + return nil +} + +func (c *Conn) sendRequest(needsReply bool, bufs ...[]byte) *Cookie { + if len(bufs) == 1 { + return c.request(bufs[0], needsReply) + } + + total := make([]byte, 0) + for _, buf := range bufs { + total = append(total, buf...) + } + return c.request(total, needsReply) +} + +func (c *Conn) newReadChannels() { + c.eventChan = make(chan bool, readBuffer) + + onError := func() { + panic("read error") + } + + go func() { + for { + buf := make([]byte, 32) + if _, err := io.ReadFull(c.conn, buf); err != nil { + fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) + onError() + return + } + + switch buf[0] { + case 0: + err := &Error{ + Detail: buf[1], + Cookie: uint16(get16(buf[2:])), + Id: Id(get32(buf[4:])), + Minor: get16(buf[8:]), + Major: buf[10], + } + if cookie, ok := c.cookies[err.Cookie]; ok { + cookie.errorChan <- err + } else { + fmt.Fprintf(os.Stderr, "x protocol error: %s\n", err) + } + case 1: + seq := uint16(get16(buf[2:])) + if _, ok := c.cookies[seq]; !ok { + continue + } + + size := get32(buf[4:]) + if size > 0 { + bigbuf := make([]byte, 32+size*4, 32+size*4) + copy(bigbuf[0:32], buf) + if _, err := io.ReadFull(c.conn, bigbuf[32:]); err != nil { + fmt.Fprintf(os.Stderr, + "x protocol read error: %s\n", err) + onError() + return + } + c.cookies[seq].replyChan <- bigbuf + } else { + c.cookies[seq].replyChan <- buf + } + default: + c.events.queue(buf) + select { + case c.eventChan <- true: + default: + } + } + } + }() +} + +func (c *Conn) waitForReply(cookie *Cookie) ([]byte, error) { + if cookie == nil { + panic("nil cookie") + } + if _, ok := c.cookies[cookie.id]; !ok { + panic("waiting for a cookie that will never come") + } + select { + case reply := <-cookie.replyChan: + return reply, nil + case err := <-cookie.errorChan: + return nil, err + } + panic("unreachable") +} + +// WaitForEvent returns the next event from the server. +// It will block until an event is available. +func (c *Conn) WaitForEvent() (Event, error) { + for { + if reply := c.events.dequeue(c); reply != nil { + return parseEvent(reply) + } + if !<-c.eventChan { + return nil, errors.New("Event channel has been closed.") + } + } + panic("unreachable") +} + +// PollForEvent returns the next event from the server if one is available in the internal queue. +// It will not read from the connection, so you must call WaitForEvent to receive new events. +// Only use this function to empty the queue without blocking. +func (c *Conn) PollForEvent() (Event, error) { + if reply := c.events.dequeue(c); reply != nil { + return parseEvent(reply) + } + return nil, nil +} + +// Dial connects to the X server given in the 'display' string. +// If 'display' is empty it will be taken from os.Getenv("DISPLAY"). +// +// Examples: +// Dial(":1") // connect to net.Dial("unix", "", "/tmp/.X11-unix/X1") +// Dial("/tmp/launch-123/:0") // connect to net.Dial("unix", "", "/tmp/launch-123/:0") +// Dial("hostname:2.1") // connect to net.Dial("tcp", "", "hostname:6002") +// Dial("tcp/hostname:1.0") // connect to net.Dial("tcp", "", "hostname:6001") +func Dial(display string) (*Conn, error) { + c, err := connect(display) + if err != nil { + return nil, err + } + + // Get authentication data + authName, authData, err := readAuthority(c.host, c.display) + noauth := false + if err != nil { + fmt.Fprintf(os.Stderr, "Could not get authority info: %v\n", err) + fmt.Fprintf(os.Stderr, "Trying connection without authority info...\n") + authName = "" + authData = []byte{} + noauth = true + } + + // Assume that the authentication protocol is "MIT-MAGIC-COOKIE-1". + if !noauth && (authName != "MIT-MAGIC-COOKIE-1" || len(authData) != 16) { + return nil, errors.New("unsupported auth protocol " + authName) + } + + buf := make([]byte, 12+pad(len(authName))+pad(len(authData))) + buf[0] = 0x6c + buf[1] = 0 + put16(buf[2:], 11) + put16(buf[4:], 0) + put16(buf[6:], uint16(len(authName))) + put16(buf[8:], uint16(len(authData))) + put16(buf[10:], 0) + copy(buf[12:], []byte(authName)) + copy(buf[12+pad(len(authName)):], authData) + if _, err = c.conn.Write(buf); err != nil { + return nil, err + } + + head := make([]byte, 8) + if _, err = io.ReadFull(c.conn, head[0:8]); err != nil { + return nil, err + } + code := head[0] + reasonLen := head[1] + major := get16(head[2:]) + minor := get16(head[4:]) + dataLen := get16(head[6:]) + + if major != 11 || minor != 0 { + return nil, errors.New(fmt.Sprintf("x protocol version mismatch: %d.%d", major, minor)) + } + + buf = make([]byte, int(dataLen)*4+8, int(dataLen)*4+8) + copy(buf, head) + if _, err = io.ReadFull(c.conn, buf[8:]); err != nil { + return nil, err + } + + if code == 0 { + reason := buf[8 : 8+reasonLen] + return nil, errors.New(fmt.Sprintf("x protocol authentication refused: %s", string(reason))) + } + + getSetupInfo(buf, &c.Setup) + + if c.defaultScreen >= len(c.Setup.Roots) { + c.defaultScreen = 0 + } + + c.nextId = Id(c.Setup.ResourceIdBase) + c.nextCookie = 1 + c.cookies = make(map[uint16]*Cookie) + c.events = queue{make([][]byte, 100), 0, 0} + c.extensions = make(map[string]byte) + + c.newReadChannels() + c.newRequestChannels() + return c, nil +} + +// Close closes the connection to the X server. +func (c *Conn) Close() { c.conn.Close() } + +func connect(display string) (*Conn, error) { + if len(display) == 0 { + display = os.Getenv("DISPLAY") + } + + display0 := display + if len(display) == 0 { + return nil, errors.New("empty display string") + } + + colonIdx := strings.LastIndex(display, ":") + if colonIdx < 0 { + return nil, errors.New("bad display string: " + display0) + } + + var protocol, socket string + c := new(Conn) + + if display[0] == '/' { + socket = display[0:colonIdx] + } else { + slashIdx := strings.LastIndex(display, "/") + if slashIdx >= 0 { + protocol = display[0:slashIdx] + c.host = display[slashIdx+1 : colonIdx] + } else { + c.host = display[0:colonIdx] + } + } + + display = display[colonIdx+1 : len(display)] + if len(display) == 0 { + return nil, errors.New("bad display string: " + display0) + } + + var scr string + dotIdx := strings.LastIndex(display, ".") + if dotIdx < 0 { + c.display = display[0:] + } else { + c.display = display[0:dotIdx] + scr = display[dotIdx+1:] + } + + dispnum, err := strconv.Atoi(c.display) + if err != nil || dispnum < 0 { + return nil, errors.New("bad display string: " + display0) + } + + if len(scr) != 0 { + c.defaultScreen, err = strconv.Atoi(scr) + if err != nil { + return nil, errors.New("bad display string: " + display0) + } + } + + // Connect to server + if len(socket) != 0 { + c.conn, err = net.Dial("unix", socket+":"+c.display) + } else if len(c.host) != 0 { + if protocol == "" { + protocol = "tcp" + } + c.conn, err = net.Dial(protocol, c.host+":"+strconv.Itoa(6000+dispnum)) + } else { + c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) + } + + if err != nil { + return nil, errors.New("cannot connect to " + display0 + ": " + err.Error()) + } + return c, nil +} diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go new file mode 100644 index 0000000..adb97e0 --- /dev/null +++ b/nexgb/xgb_help.go @@ -0,0 +1,103 @@ +package xgb + +// getExtensionOpcode retrieves the extension opcode from the extensions map. +// If one doesn't exist, just return 0. An X error will likely result. +func (c *Conn) getExtensionOpcode(name string) byte { + return c.extensions[name] +} + +func (c *Conn) bytesPadding(buf []byte) []byte { + return append(buf, make([]byte, pad(len(buf))-len(buf))...) +} + +func (c *Conn) bytesString(str string) []byte { + return c.bytesPadding([]byte(str)) +} + +func (c *Conn) bytesStrList(list []Str, length int) []byte { + buf := make([]byte, 0) + for _, str := range list { + buf = append(buf, []byte(str.Name)...) + } + return c.bytesPadding(buf) +} + +func (c *Conn) bytesUInt32List(list []uint32) []byte { + buf := make([]byte, len(list)*4) + for i, item := range list { + put32(buf[i*4:], item) + } + return c.bytesPadding(buf) +} + +func (c *Conn) bytesIdList(list []Id, length int) []byte { + buf := make([]byte, length*4) + for i, item := range list { + put32(buf[i*4:], uint32(item)) + } + return c.bytesPadding(buf) +} + +// Pad a length to align on 4 bytes. +func pad(n int) int { return (n + 3) & ^3 } + +func put16(buf []byte, v uint16) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) +} + +func put32(buf []byte, v uint32) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) + buf[2] = byte(v >> 16) + buf[3] = byte(v >> 24) +} + +func get16(buf []byte) uint16 { + v := uint16(buf[0]) + v |= uint16(buf[1]) << 8 + return v +} + +func get32(buf []byte) uint32 { + v := uint32(buf[0]) + v |= uint32(buf[1]) << 8 + v |= uint32(buf[2]) << 16 + v |= uint32(buf[3]) << 24 + return v +} + +// Voodoo to count the number of bits set in a value list mask. +func popCount(mask0 int) int { + mask := uint32(mask0) + n := 0 + for i := uint32(0); i < 32; i++ { + if mask&(1< -1 { + namespace := t[:colon] + rest := t[colon+1:] + return splitAndTitle(namespace) + splitAndTitle(rest) + } + + // Since there is no namespace, we need to look for a namespace + // in the current context. + return c.TypePrefix(typ) + splitAndTitle(t) +} + +// Morph changes every identifier (NOT type) into something suitable +// for your language. +func (name Name) Morph(c *Context) string { + n := string(name) + + // If it's in the name map, use that translation. + if newn, ok := NameMap[n]; ok { + return newn + } + + return splitAndTitle(n) +} + +/******************************************************************************/ +// Per element morphing. +// Below are functions that morph a single unit. +/******************************************************************************/ + +// Import morphing. +func (imp *Import) Morph(c *Context) { + c.Putln("// import \"%s\"", imp.Name) +} + +// Enum morphing. +func (enum *Enum) Morph(c *Context) { + c.Putln("const (") + for _, item := range enum.Items { + c.Putln("%s%s = %d", enum.Name.Morph(c), item.Name.Morph(c), + item.Expr.Eval()) + } + c.Putln(")\n") +} + +// Xid morphing. +func (xid *Xid) Morph(c *Context) { + // Don't emit anything for xid types for now. + // We're going to force them all to simply be 'Id' + // to avoid excessive type converting. + // c.Putln("type %s Id", xid.Name.Morph(c)) +} + +// TypeDef morphing. +func (typedef *TypeDef) Morph(c *Context) { + c.Putln("type %s %s", typedef.Old.Morph(c), typedef.New.Morph(c)) +} + +// Struct morphing. +func (strct *Struct) Morph(c *Context) { +} + +// Union morphing. +func (union *Union) Morph(c *Context) { +} + +// Request morphing. +func (request *Request) Morph(c *Context) { +} + +// Event morphing. +func (ev *Event) Morph(c *Context) { +} + +// EventCopy morphing. +func (evcopy *EventCopy) Morph(c *Context) { +} + +// Error morphing. +func (err *Error) Morph(c *Context) { +} + +// ErrorCopy morphing. +func (errcopy *ErrorCopy) Morph(c *Context) { +} + +/******************************************************************************/ +// Collection morphing. +// Below are functions that morph a collections of units. +// Most of these can probably remain unchanged, but they are useful if you +// need to group all of some "unit" in a single block or something. +/******************************************************************************/ +func (imports Imports) Morph(c *Context) { + if len(imports) == 0 { + return + } + + c.Putln("// Imports are not required for XGB since everything is in") + c.Putln("// a single package. Still these may be useful for ") + c.Putln("// reference purposes.") + for _, imp := range imports { + imp.Morph(c) + } +} + +func (enums Enums) Morph(c *Context) { + c.Putln("// Enums\n") + for _, enum := range enums { + enum.Morph(c) + } +} + +func (xids Xids) Morph(c *Context) { + c.Putln("// Xids\n") + for _, xid := range xids { + xid.Morph(c) + } +} + +func (typedefs TypeDefs) Morph(c *Context) { + c.Putln("// TypeDefs\n") + for _, typedef := range typedefs { + typedef.Morph(c) + } +} + +func (strct Structs) Morph(c *Context) { + c.Putln("// Structs\n") + for _, typedef := range strct { + typedef.Morph(c) + } +} + +func (union Unions) Morph(c *Context) { + c.Putln("// Unions\n") + for _, typedef := range union { + typedef.Morph(c) + } +} + +func (request Requests) Morph(c *Context) { + c.Putln("// Requests\n") + for _, typedef := range request { + typedef.Morph(c) + } +} + +func (event Events) Morph(c *Context) { + c.Putln("// Events\n") + for _, typedef := range event { + typedef.Morph(c) + } +} + +func (evcopy EventCopies) Morph(c *Context) { + c.Putln("// Event Copies\n") + for _, typedef := range evcopy { + typedef.Morph(c) + } +} + +func (err Errors) Morph(c *Context) { + c.Putln("// Errors\n") + for _, typedef := range err { + typedef.Morph(c) + } +} + +func (errcopy ErrorCopies) Morph(c *Context) { + c.Putln("// Error copies\n") + for _, typedef := range errcopy { + typedef.Morph(c) + } +} + diff --git a/nexgb/xgbgen/main.go b/nexgb/xgbgen/main.go new file mode 100644 index 0000000..69579a4 --- /dev/null +++ b/nexgb/xgbgen/main.go @@ -0,0 +1,64 @@ +package main + +import ( + "flag" + "io/ioutil" + "log" + "os" + "os/exec" + "strings" +) + +var ( + protoPath = flag.String("proto-path", + "/usr/share/xcb", "path to directory of X protocol XML files") + gofmt = flag.Bool("gofmt", true, + "When disabled, gofmt will not be run before outputting Go code") +) + +func usage() { + basename := os.Args[0] + if lastSlash := strings.LastIndex(basename, "/"); lastSlash > -1 { + basename = basename[lastSlash+1:] + } + log.Printf("Usage: %s [flags] xml-file", basename) + flag.PrintDefaults() + os.Exit(1) +} + +func init() { + log.SetFlags(0) +} + +func main() { + flag.Usage = usage + flag.Parse() + + if flag.NArg() != 1 { + log.Printf("A single XML protocol file can be processed at once.") + flag.Usage() + } + + // Read the single XML file into []byte + xmlBytes, err := ioutil.ReadFile(flag.Arg(0)) + if err != nil { + log.Fatal(err) + } + + // Initialize the buffer, parse it, and filter it through gofmt. + c := newContext() + c.Translate(xmlBytes) + + if !*gofmt { + c.out.WriteTo(os.Stdout) + } else { + cmdGofmt := exec.Command("gofmt") + cmdGofmt.Stdin = c.out + cmdGofmt.Stdout = os.Stdout + err = cmdGofmt.Run() + if err != nil { + log.Fatal(err) + } + } +} + diff --git a/nexgb/xgbgen/misc.go b/nexgb/xgbgen/misc.go new file mode 100644 index 0000000..9adcf5d --- /dev/null +++ b/nexgb/xgbgen/misc.go @@ -0,0 +1,44 @@ +package main + +import ( + "regexp" + "strings" +) + +// AllCaps is a regex to test if a string identifier is made of +// all upper case letters. +var AllCaps = regexp.MustCompile("^[A-Z0-9]+$") + +// popCount counts number of bits 'set' in mask. +func popCount(mask uint) uint { + m := uint32(mask) + n := uint(0) + for i := uint32(0); i < 32; i++ { + if m&(1<>vMo0v0(4<2& z$00(kZLvj*R$EkBX-hFEYC?d7dMQe^c#qcVi9y9X=x6i4@7nvEIp@qwi2d6C`Jex3 zD>=8l_qwmW_S%=Zc3Sx<*;!cu`+wPilLCC2_QGU&71JLg$s&PRpg53&zhh8x7`_k1 zKf7E^-`Uq5eB=Lmr+1J=->apP7>}KJW8yaGxaxS70az9g?o7rZ42;D~tIa<(cms+;d|r76|03OW>sa^o_ds z@h-$`)>q8H&Ga%=aJs6u`hkJ#7yIh3&N)l!ug)1Q*Na}rQSIr!e)v=H-VHze$~jUp z{K}W)`sS^=qQ3a+5664fcX;T?TggA~_JQjk;H#fE@m#5pH}N337R(;FKA{jN8-A=+ z)sMBR`fKxvUGjf^{13q=cm3UWpC^TP-+i!Li+_|94PW@{&%`@Nc2YzCS+3wO|C)k7 zQopwAEA9jW-@y>?a^Sxl`2U0hbBsjpxZVBz{l*Dn7Y?!q@FwAI_z2yw zc_7=480Pl?v@Tj~#5Wgq`e-^x(Nv5k8A%zfpoX;!!#oO?3UhAIXe}DoxbAd(Yl!9< zcNuqC&ujwSt%QqLLB1jvVuqO?WdnI^pi(tZg$D36$DEsMaYzFkiv2kJW9Rt>`n^5JP!1k|-rBW=Cs`1kg4o2sXGG zX-*AVqY8qmG!hq}P$wuEnV1@k?-^EqiqQ&c&6xpnn#e0}UWL#RCOqrIj;sLK z5{Z8rsLu!D;#6#?1sA}LMF3jSN#>z-@W?5%N$h!E{v?U{-d}dm;O`8ba$$6&%ifFkg za?o0UK-$qd5xK3ME>i+^4b-sxUndJ-Erys2I13dnby-1O?f=FC=3&s|;F7ceW!Y&I ze#~0(K&Uwm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ag*DvF8kX#2ygr5qo%@N9-YU9d=g;qz|JDJpDnHOe{#F>4-D)|lFxQn`7doz z{)@+iEdN{evz1oG7A48&kwy7?|6BRpx%JQEj`BCq6j3)I zxBhulQvPMfDF55J_0MCL@+Y65{1bBPlSee=pFL6ei+2x8>3?f`;PFoRkIz(o>Cv7O z{!%`VhRT1UUHQ{<+cS@q${*aN{E2&nTK#X;&m*bw=bWef2Xos4kF&}jxIy_)kou?k zWfT_ql@}`i#b7)MBPyTAXw|=lzt6$nh}{0pBe?QEf0Ob*vumi;|5p7xzAOK*FDZX( zuD#;XU-=(=UHKbw+YkE&%0HLC7{cEdbK5_A4$2?$sPZYdf3aVo{DXh0{5?y28N**% zUiLbaU;Z=YKbl)!_DPig=Vz7wc5Z&yV^RJKTa~{$%tY{8^TYm(@@KrD{EY5m>@#~i z%Aared^<$ipXz5{Ncs2uR`u5h-bxrx`RpkvfB*NC|4c{CDYekz|mH0A&KA?5FPU_c6fDxdu~<@b9* z`DYy$kbx+=H-vhSz-=MPf;#(9C#;HT{_=uXvtUq**f{p{;1|DOAlf8?mt?3n(=p0M&?cvJaT zA_d;*WXy`DPyFU;2jfAKWRA&px*DXa8CG<+jS#gJCF7Kg?Ck0p d+0r?(*xfj?YfZ~Yv&3Wn9nsRXvJ$Ts{~sZ{Oxyqf literal 0 HcmV?d00001 diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go new file mode 100644 index 0000000..0f632b4 --- /dev/null +++ b/nexgb/xgbgen/xml.go @@ -0,0 +1,298 @@ +package main + +import ( + "encoding/xml" + "io/ioutil" + "log" + "time" +) + +type XML struct { + // Root 'xcb' element properties. + XMLName xml.Name `xml:"xcb"` + Header string `xml:"header,attr"` + ExtensionXName string `xml:"extension-xname,attr"` + ExtensionName string `xml:"extension-name,attr"` + MajorVersion string `xml:"major-version,attr"` + MinorVersion string `xml:"minor-version,attr"` + + // Types for all top-level elements. + // First are the simple ones. + Imports Imports `xml:"import"` + Enums Enums `xml:"enum"` + Xids Xids `xml:"xidtype"` + XidUnions Xids `xml:"xidunion"` + TypeDefs TypeDefs `xml:"typedef"` + EventCopies EventCopies `xml:"eventcopy"` + ErrorCopies ErrorCopies `xml:"errorcopy"` + + // Here are the complex ones, i.e., anything with "structure contents" + Structs Structs `xml:"struct"` + Unions Unions `xml:"union"` + Requests Requests `xml:"request"` + Events Events `xml:"event"` + Errors Errors `xml:"error"` +} + +// Morph cascades down all of the XML and calls each type's corresponding +// Morph function with itself as an argument (the context). +func (x *XML) Morph(c *Context) { + // Start the header... + c.Putln("package xgb") + c.Putln("/*") + c.Putln("\tX protocol API for '%s.xml'.", c.xml.Header) + c.Putln("\tThis file is automatically generated. Edit at your own peril!") + c.Putln("\tGenerated on %s", + time.Now().Format("Jan 2, 2006 at 3:04:05pm MST")) + c.Putln("*/") + c.Putln("") + + x.Imports.Morph(c) + c.Putln("") + + x.Enums.Morph(c) + c.Putln("") + + x.Xids.Morph(c) + c.Putln("") + + x.XidUnions.Morph(c) + c.Putln("") + + x.TypeDefs.Morph(c) + c.Putln("") + + x.Structs.Morph(c) + c.Putln("") + + x.Unions.Morph(c) + c.Putln("") + + x.Requests.Morph(c) + c.Putln("") + + x.Events.Morph(c) + c.Putln("") + + x.Errors.Morph(c) + c.Putln("") + + x.EventCopies.Morph(c) + c.Putln("") + + x.ErrorCopies.Morph(c) + c.Putln("") +} + +// IsResource returns true if the 'needle' type is a resource type. +// i.e., an "xid" +func (x *XML) IsResource(needle Type) bool { + for _, xid := range x.Xids { + if needle == xid.Name { + return true + } + } + for _, xidunion := range x.XidUnions { + if needle == xidunion.Name { + return true + } + } + for _, imp := range x.Imports { + if imp.xml.IsResource(needle) { + return true + } + } + return false +} + +// HasType returns true if the 'needle' type can be found in the protocol +// description represented by 'x'. +func (x *XML) HasType(needle Type) bool { + for _, enum := range x.Enums { + if needle == enum.Name { + return true + } + } + for _, xid := range x.Xids { + if needle == xid.Name { + return true + } + } + for _, xidunion := range x.XidUnions { + if needle == xidunion.Name { + return true + } + } + for _, typedef := range x.TypeDefs { + if needle == typedef.New { + return true + } + } + for _, evcopy := range x.EventCopies { + if needle == evcopy.Name { + return true + } + } + for _, errcopy := range x.ErrorCopies { + if needle == errcopy.Name { + return true + } + } + for _, strct := range x.Structs { + if needle == strct.Name { + return true + } + } + for _, union := range x.Unions { + if needle == union.Name { + return true + } + } + for _, ev := range x.Events { + if needle == ev.Name { + return true + } + } + for _, err := range x.Errors { + if needle == err.Name { + return true + } + } + + return false +} + +type Name string + +type Type string + +type Imports []*Import + +func (imports Imports) Eval() { + for _, imp := range imports { + xmlBytes, err := ioutil.ReadFile(*protoPath + "/" + imp.Name + ".xml") + if err != nil { + log.Fatalf("Could not read X protocol description for import " + + "'%s' because: %s", imp.Name, err) + } + + imp.xml = &XML{} + err = xml.Unmarshal(xmlBytes, imp.xml) + if err != nil { + log.Fatal("Could not parse X protocol description for import " + + "'%s' because: %s", imp.Name, err) + } + } +} + +type Import struct { + Name string `xml:",chardata"` + xml *XML `xml:"-"` +} + +type Enums []Enum + +// Eval on the list of all enum types goes through and forces every enum +// item to have a valid expression. +// This is necessary because when an item is empty, it is defined to have +// the value of "one more than that of the previous item, or 0 for the first +// item". +func (enums Enums) Eval() { + for _, enum := range enums { + nextValue := uint(0) + for _, item := range enum.Items { + if item.Expr == nil { + item.Expr = newValueExpression(nextValue) + nextValue++ + } else { + nextValue = item.Expr.Eval() + 1 + } + } + } +} + +type Enum struct { + Name Type `xml:"name,attr"` + Items []*EnumItem `xml:"item"` +} + +type EnumItem struct { + Name Name `xml:"name,attr"` + Expr *Expression `xml:",any"` +} + +type Xids []*Xid + +type Xid struct { + XMLName xml.Name + Name Type `xml:"name,attr"` +} + +type TypeDefs []*TypeDef + +type TypeDef struct { + Old Type `xml:"oldname,attr"` + New Type `xml:"newname,attr"` +} + +type EventCopies []*EventCopy + +type EventCopy struct { + Name Type `xml:"name,attr"` + Number string `xml:"number,attr"` + Ref Type `xml:"ref,attr"` +} + +type ErrorCopies []*ErrorCopy + +type ErrorCopy struct { + Name Type `xml:"name,attr"` + Number string `xml:"number,attr"` + Ref Type `xml:"ref,attr"` +} + +type Structs []*Struct + +type Struct struct { + Name Type `xml:"name,attr"` + Fields []*Field `xml:",any"` +} + +type Unions []*Union + +type Union struct { + Name Type `xml:"name,attr"` + Fields []*Field `xml:",any"` +} + +type Requests []*Request + +type Request struct { + Name Type `xml:"name,attr"` + Opcode int `xml:"opcode,attr"` + Combine bool `xml:"combine-adjacent,attr"` + Fields []*Field `xml:",any"` + Reply *Reply `xml:"reply"` +} + +type Reply struct { + Fields []*Field `xml:",any"` +} + +type Events []*Event + +type Event struct { + Name Type `xml:"name,attr"` + Number int `xml:"number,attr"` + NoSequence bool `xml:"no-sequence-number,true"` + Fields []*Field `xml:",any"` +} + +type Errors []*Error + +type Error struct { + Name Type `xml:"name,attr"` + Number int `xml:"number,attr"` + Fields []*Field `xml:",any"` +} + diff --git a/nexgb/xgbgen/xml_expression.go b/nexgb/xgbgen/xml_expression.go new file mode 100644 index 0000000..dd32512 --- /dev/null +++ b/nexgb/xgbgen/xml_expression.go @@ -0,0 +1,160 @@ +package main + +import ( + "encoding/xml" + "fmt" + "log" + "strconv" +) + +type Expression struct { + XMLName xml.Name + + Exprs []*Expression `xml:",any"` + + Data string `xml:",chardata"` + Op string `xml:"op,attr"` + Ref string `xml:"ref,attr"` +} + +func newValueExpression(v uint) *Expression { + return &Expression{ + XMLName: xml.Name{Local: "value"}, + Data: fmt.Sprintf("%d", v), + } +} + +// String is for debugging. For actual use, please use 'Morph'. +func (e *Expression) String() string { + switch e.XMLName.Local { + case "op": + return fmt.Sprintf("(%s %s %s)", e.Exprs[0], e.Op, e.Exprs[1]) + case "unop": + return fmt.Sprintf("(%s (%s))", e.Op, e.Exprs[0]) + case "popcount": + return fmt.Sprintf("popcount(%s)", e.Exprs[0]) + case "fieldref": + fallthrough + case "value": + return fmt.Sprintf("%s", e.Data) + case "bit": + return fmt.Sprintf("(1 << %s)", e.Data) + case "enumref": + return fmt.Sprintf("%s%s", e.Ref, e.Data) + case "sumof": + return fmt.Sprintf("sum(%s)", e.Ref) + default: + log.Panicf("Unrecognized expression element: %s", e.XMLName.Local) + } + + panic("unreachable") +} + +// Eval is used to *attempt* to compute a concrete value for a particular +// expression. This is used in the initial setup to instantiate values for +// empty items in enums. +// We can't compute a concrete value for expressions that rely on a context, +// i.e., some field value. +func (e *Expression) Eval() uint { + switch e.XMLName.Local { + case "op": + if len(e.Exprs) != 2 { + log.Panicf("'op' found %d expressions; expected 2.", len(e.Exprs)) + } + return e.BinaryOp(e.Exprs[0], e.Exprs[1]).Eval() + case "unop": + if len(e.Exprs) != 1 { + log.Panicf("'unop' found %d expressions; expected 1.", len(e.Exprs)) + } + return e.UnaryOp(e.Exprs[0]).Eval() + case "popcount": + if len(e.Exprs) != 1 { + log.Panicf("'popcount' found %d expressions; expected 1.", + len(e.Exprs)) + } + return popCount(e.Exprs[0].Eval()) + case "value": + val, err := strconv.Atoi(e.Data) + if err != nil { + log.Panicf("Could not convert '%s' in 'value' expression to int.", + e.Data) + } + return uint(val) + case "bit": + bit, err := strconv.Atoi(e.Data) + if err != nil { + log.Panicf("Could not convert '%s' in 'bit' expression to int.", + e.Data) + } + if bit < 0 || bit > 31 { + log.Panicf("A 'bit' literal must be in the range [0, 31], but " + + " is %d", bit) + } + return 1 << uint(bit) + case "fieldref": + log.Panicf("Cannot compute concrete value of 'fieldref' in " + + "expression '%s'.", e) + case "enumref": + log.Panicf("Cannot compute concrete value of 'enumref' in " + + "expression '%s'.", e) + case "sumof": + log.Panicf("Cannot compute concrete value of 'sumof' in " + + "expression '%s'.", e) + } + + log.Panicf("Unrecognized tag '%s' in expression context. Expected one of " + + "op, fieldref, value, bit, enumref, unop, sumof or popcount.", + e.XMLName.Local) + panic("unreachable") +} + +func (e *Expression) BinaryOp(operand1, operand2 *Expression) *Expression { + if e.XMLName.Local != "op" { + log.Panicf("Cannot perform binary operation on non-op expression: %s", + e.XMLName.Local) + } + if len(e.Op) == 0 { + log.Panicf("Cannot perform binary operation without operator for: %s", + e.XMLName.Local) + } + + wrap := newValueExpression + switch e.Op { + case "+": + return wrap(operand1.Eval() + operand2.Eval()) + case "-": + return wrap(operand1.Eval() + operand2.Eval()) + case "*": + return wrap(operand1.Eval() * operand2.Eval()) + case "/": + return wrap(operand1.Eval() / operand2.Eval()) + case "&": + return wrap(operand1.Eval() & operand2.Eval()) + case "<<": + return wrap(operand1.Eval() << operand2.Eval()) + } + + log.Panicf("Invalid binary operator '%s' for '%s' expression.", + e.Op, e.XMLName.Local) + panic("unreachable") +} + +func (e *Expression) UnaryOp(operand *Expression) *Expression { + if e.XMLName.Local != "unop" { + log.Panicf("Cannot perform unary operation on non-unop expression: %s", + e.XMLName.Local) + } + if len(e.Op) == 0 { + log.Panicf("Cannot perform unary operation without operator for: %s", + e.XMLName.Local) + } + + switch e.Op { + case "~": + return newValueExpression(^operand.Eval()) + } + + log.Panicf("Invalid unary operator '%s' for '%s' expression.", + e.Op, e.XMLName.Local) + panic("unreachable") +} diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go new file mode 100644 index 0000000..18be6e3 --- /dev/null +++ b/nexgb/xgbgen/xml_fields.go @@ -0,0 +1,147 @@ +package main +/* + A series of fields should be taken as "structure contents", and *not* + just the single 'field' elements. Namely, 'fields' subsumes 'field' + elements. + + More particularly, 'fields' corresponds to list, in order, of any of the + follow elements: pad, field, list, localfield, exprfield, valueparm + and switch. + + Thus, the 'Field' type must contain the union of information corresponding + to all aforementioned fields. + + This would ideally be a better job for interfaces, but I could not figure + out how to make them jive with Go's XML package. (And I don't really feel + up to type translation.) +*/ + +import ( + "encoding/xml" + "fmt" + "log" + "strings" +) + +type Field struct { + XMLName xml.Name + + // For 'pad' element + Bytes int `xml:"bytes,attr"` + + // For 'field', 'list', 'localfield', 'exprfield' and 'switch' elements. + Name string `xml:"name,attr"` + + // For 'field', 'list', 'localfield', and 'exprfield' elements. + Type Type `xml:"type,attr"` + + // For 'list', 'exprfield' and 'switch' elements. + Expr *Expression `xml:",any"` + + // For 'valueparm' element. + ValueMaskType Type `xml:"value-mask-type,attr"` + ValueMaskName string `xml:"value-mask-name,attr"` + ValueListName string `xml:"value-list-name,attr"` + + // For 'switch' element. + Bitcases []*Bitcase `xml:"bitcase"` + + // I don't know which elements these are for. The documentation is vague. + // They also seem to be completely optional. + OptEnum Type `xml:"enum,attr"` + OptMask Type `xml:"mask,attr"` + OptAltEnum Type `xml:"altenum,attr"` +} + +// String is for debugging purposes. +func (f *Field) String() string { + switch f.XMLName.Local { + case "pad": + return fmt.Sprintf("pad (%d bytes)", f.Bytes) + case "field": + return fmt.Sprintf("field (type = '%s', name = '%s')", f.Type, f.Name) + case "list": + return fmt.Sprintf("list (type = '%s', name = '%s', length = '%s')", + f.Type, f.Name, f.Expr) + case "localfield": + return fmt.Sprintf("localfield (type = '%s', name = '%s')", + f.Type, f.Name) + case "exprfield": + return fmt.Sprintf("exprfield (type = '%s', name = '%s', expr = '%s')", + f.Type, f.Name, f.Expr) + case "valueparam": + return fmt.Sprintf("valueparam (type = '%s', name = '%s', list = '%s')", + f.ValueMaskType, f.ValueMaskName, f.ValueListName) + case "switch": + bitcases := make([]string, len(f.Bitcases)) + for i, bitcase := range f.Bitcases { + bitcases[i] = bitcase.StringPrefix("\t") + } + return fmt.Sprintf("switch (name = '%s', expr = '%s')\n\t%s", + f.Name, f.Expr, strings.Join(bitcases, "\n\t")) + default: + log.Panicf("Unrecognized field element: %s", f.XMLName.Local) + } + + panic("unreachable") +} + +// Bitcase represents a single expression followed by any number of fields. +// Namely, if the switch's expression (all bitcases are inside a switch), +// and'd with the bitcase's expression is equal to the bitcase expression, +// then the fields should be included in its parent structure. +// Note that since a bitcase is unique in that expressions and fields are +// siblings, we must exhaustively search for one of them. Essentially, +// it's the closest thing to a Union I can get to in Go without interfaces. +// Would an '' tag have been too much to ask? :-( +type Bitcase struct { + Fields []*Field `xml:",any"` + + // All the different expressions. + // When it comes time to choose one, use the 'Expr' method. + ExprOp *Expression `xml:"op"` + ExprUnOp *Expression `xml:"unop"` + ExprField *Expression `xml:"fieldref"` + ExprValue *Expression `xml:"value"` + ExprBit *Expression `xml:"bit"` + ExprEnum *Expression `xml:"enumref"` + ExprSum *Expression `xml:"sumof"` + ExprPop *Expression `xml:"popcount"` +} + +// StringPrefix is for debugging purposes only. +// StringPrefix takes a string to prefix to every extra line for formatting. +func (b *Bitcase) StringPrefix(prefix string) string { + fields := make([]string, len(b.Fields)) + for i, field := range b.Fields { + fields[i] = fmt.Sprintf("%s%s", prefix, field) + } + return fmt.Sprintf("%s\n\t%s%s", b.Expr(), prefix, + strings.Join(fields, "\n\t")) +} + +// Expr chooses the only non-nil Expr* field from Bitcase. +// Panic if there is more than one non-nil expression. +func (b *Bitcase) Expr() *Expression { + choices := []*Expression{ + b.ExprOp, b.ExprUnOp, b.ExprField, b.ExprValue, + b.ExprBit, b.ExprEnum, b.ExprSum, b.ExprPop, + } + + var choice *Expression = nil + numNonNil := 0 + for _, c := range choices { + if c != nil { + numNonNil++ + choice = c + } + } + + if choice == nil { + log.Panicf("No top level expression found in a bitcase.") + } + if numNonNil > 1 { + log.Panicf("More than one top-level expression was found in a bitcase.") + } + return choice +} From 6bf0191fb01f4c0b65bcd444bb5381013c627f95 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 29 Apr 2012 03:38:29 -0400 Subject: [PATCH 02/90] progress. still not working. this is incredibly difficult. --- nexgb/.gitignore | 2 + nexgb/xgb.go | 22 ++- nexgb/xgb_help.go | 32 ++-- nexgb/xgbgen/context.go | 36 ----- nexgb/xgbgen/go.go | 291 ++++++++++++++++++++++++++++++++++++- nexgb/xgbgen/main.go | 1 + nexgb/xgbgen/misc.go | 9 +- nexgb/xgbgen/xgbgen | Bin 2318165 -> 0 bytes nexgb/xgbgen/xml.go | 58 ++++++-- nexgb/xgbgen/xml_fields.go | 14 +- 10 files changed, 385 insertions(+), 80 deletions(-) create mode 100644 nexgb/.gitignore delete mode 100755 nexgb/xgbgen/xgbgen diff --git a/nexgb/.gitignore b/nexgb/.gitignore new file mode 100644 index 0000000..1c0248d --- /dev/null +++ b/nexgb/.gitignore @@ -0,0 +1,2 @@ +xgbgen +.*.swp diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 7e209a7..ce2cc54 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -87,9 +87,15 @@ func newCookie(id uint16) *Cookie { } } -// Event is an interface that can contain any of the events returned by the server. -// Use a type assertion switch to extract the Event structs. -type Event interface{} +// Event is an interface that can contain any of the events returned by the +// server. Use a type assertion switch to extract the Event structs. +type Event interface { + ImplementsEvent() +} + +// newEventFuncs is a map from event numbers to functions that create +// the corresponding event. +var newEventFuncs map[int]func(buf []byte) Event // Error contains protocol errors returned to us by the X server. type Error struct { @@ -100,6 +106,16 @@ type Error struct { Id Id } +// Error2 is an interface that can contain any of the errors returned by +// the server. Use a type assertion switch to extract the Error structs. +type Error2 interface { + ImplementsError() +} + +// newErrorFuncs is a map from error numbers to functions that create +// the corresponding error. +var newErrorFuncs map[int]func(buf []byte) Error2 + func (e *Error) Error() string { return fmt.Sprintf("Bad%s (major=%d minor=%d cookie=%d id=0x%x)", errorNames[e.Detail], e.Major, e.Minor, e.Cookie, e.Id) diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index adb97e0..acb35de 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -85,19 +85,19 @@ func (c *Conn) DefaultScreen() *ScreenInfo { return &c.Setup.Roots[c.defaultScre // ClientMessageData holds the data from a client message, // duplicated in three forms because Go doesn't have unions. -type ClientMessageData struct { - Data8 [20]byte - Data16 [10]uint16 - Data32 [5]uint32 -} - -func getClientMessageData(b []byte, v *ClientMessageData) int { - copy(v.Data8[:], b) - for i := 0; i < 10; i++ { - v.Data16[i] = get16(b[i*2:]) - } - for i := 0; i < 5; i++ { - v.Data32[i] = get32(b[i*4:]) - } - return 20 -} +// type ClientMessageData struct { + // Data8 [20]byte + // Data16 [10]uint16 + // Data32 [5]uint32 +// } +// +// func getClientMessageData(b []byte, v *ClientMessageData) int { + // copy(v.Data8[:], b) + // for i := 0; i < 10; i++ { + // v.Data16[i] = get16(b[i*2:]) + // } + // for i := 0; i < 5; i++ { + // v.Data32[i] = get32(b[i*4:]) + // } + // return 20 +// } diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index e5acb12..712cad4 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -5,7 +5,6 @@ import ( "encoding/xml" "fmt" "log" - "strings" ) type Context struct { @@ -33,31 +32,6 @@ func (c *Context) Put(format string, v ...interface{}) { } } -// TypePrefix searches the parsed XML for a type matching 'needle'. -// It then returns the appropriate prefix to be used in source code. -// Note that the core X protocol *is* a namespace, but does not have a prefix. -// Also note that you should probably check the BaseTypeMap and TypeMap -// before calling this function. -func (c *Context) TypePrefix(needle Type) string { - // If this is xproto, quit. No prefixes needed. - if c.xml.Header == "xproto" { - return "" - } - - // First check for the type in the current namespace. - if c.xml.HasType(needle) { - return strings.Title(c.xml.Header) - } - - // Now check each of the imports... - for _, imp := range c.xml.Imports { - if imp.xml.Header != "xproto" && imp.xml.HasType(needle) { - return strings.Title(imp.xml.Header) - } - } - - return "" -} // Translate is the big daddy of them all. It takes in an XML byte slice // and writes Go code to the 'out' buffer. @@ -76,14 +50,4 @@ func (c *Context) Translate(xmlBytes []byte) { // It's Morphin' Time! c.xml.Morph(c) - - // for _, req := range c.xml.Requests { - // if req.Name != "CreateContext" && req.Name != "MakeCurrent" { - // continue - // } - // log.Println(req.Name) - // for _, field := range req.Fields { - // log.Println("\t", field.XMLName.Local, field.Type.Morph(c)) - // } - // } } diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index eb3f0fb..bfc54dd 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -8,12 +8,22 @@ package main * Imports and helper variables. * Manual type and name override maps. + * Constants for tweaking various morphing functions. * Helper morphing functions. + * Morphing functions for each "sub-unit." * Morphing functions for each "unit". * Morphing functions for collections of "units". + + Units can be thought of as the top-level elements in an XML protocol + description file. Namely, structs, xidtypes, imports, enums, unions, etc. + Collections of units are simply "all of the UNIT in the XML file." + Sub-units can be thought of as recurring bits like struct contents (which + is used in events, replies, requests, errors, etc.) and expression + evaluation. */ import ( + "log" "strings" ) @@ -38,6 +48,24 @@ var BaseTypeMap = map[string]string{ "BOOL": "bool", "float": "float64", "double": "float64", + "char": "byte", +} + +// BaseTypeSizes should have precisely the same keys as in BaseTypeMap, +// and the values should correspond to the size of the type in bytes. +var BaseTypeSizes = map[string]uint{ + "CARD8": 1, + "CARD16": 2, + "CARD32": 4, + "INT8": 1, + "INT16": 2, + "INT32": 4, + "BYTE": 1, + "BOOL": 1, + "float": 4, + "double": 8, + "char": 1, + "Id": 4, } // TypeMap is a map from types in the XML to type names that is used @@ -54,12 +82,26 @@ var TypeMap = map[string]string{ var NameMap = map[string]string{ } /******************************************************************************/ -// Helper functions that aide in morphing repetive constructs. -// i.e., "structure contents", expressions, type and identifier names, etc. +// Constants for changing the semantics of morphing functions. +// These are mainly used to tweaking the writing of fields. +// Namely, reading/writing is not exactly the same across events, +// requests/replies and errors. +/******************************************************************************/ +const ( + FieldsEvent = iota + FieldsRequestReply + FieldsError +) + +/******************************************************************************/ +// Helper functions that aide in morphing repetitive constructs. +// i.e., type and identifier names, etc. /******************************************************************************/ // Morph changes every TYPE (not names) into something suitable -// for your language. +// for your language. It also handles adding suffixes like 'Event' +// and 'Union'. (A 'Union' suffix is used in Go because unions aren't +// supported at the language level.) func (typ Type) Morph(c *Context) string { t := string(typ) @@ -87,7 +129,33 @@ func (typ Type) Morph(c *Context) string { // Since there is no namespace, we need to look for a namespace // in the current context. - return c.TypePrefix(typ) + splitAndTitle(t) + return typ.Prefix(c) + splitAndTitle(t) +} + +// Prefix searches the parsed XML for a type matching 'typ'. +// It then returns the appropriate prefix to be used in source code. +// Note that the core X protocol *is* a namespace, but does not have a prefix. +// Also note that you should probably check the BaseTypeMap and TypeMap +// before calling this function. +func (typ Type) Prefix(c *Context) string { + // If this is xproto, quit. No prefixes needed. + if c.xml.Header == "xproto" { + return "" + } + + // First check for the type in the current namespace. + if c.xml.HasType(typ) { + return strings.Title(c.xml.Header) + } + + // Now check each of the imports... + for _, imp := range c.xml.Imports { + if imp.xml.Header != "xproto" && imp.xml.HasType(typ) { + return strings.Title(imp.xml.Header) + } + } + + return "" } // Morph changes every identifier (NOT type) into something suitable @@ -103,6 +171,147 @@ func (name Name) Morph(c *Context) string { return splitAndTitle(n) } +/******************************************************************************/ +// Sub-unit morphing. +// Below are functions that morph sub-units. Like collections of fields, +// expressions, etc. +// Note that collections of fields can be used in three different contexts: +// definitions, reading from the wire and writing to the wire. Thus, there +// exists 'MorphDefine', 'MorphRead', 'MorphWrite' defined on Fields. +/******************************************************************************/ +func (fields Fields) MorphDefine(c *Context) { + for _, field := range fields { + field.MorphDefine(c) + } +} + +func (field *Field) MorphDefine(c *Context) { + // We omit 'pad' and 'exprfield' + switch field.XMLName.Local { + case "field": + c.Putln("%s %s", field.Name.Morph(c), field.Type.Morph(c)) + case "list": + c.Putln("%s []%s", field.Name.Morph(c), field.Type.Morph(c)) + case "localfield": + c.Putln("%s %s", field.Name.Morph(c), field.Type.Morph(c)) + case "valueparam": + c.Putln("%s %s", field.ValueMaskName.Morph(c), + field.ValueMaskType.Morph(c)) + c.Putln("%s []%s", field.ValueListName.Morph(c), + field.ValueMaskType.Morph(c)) + case "switch": + field.Bitcases.MorphDefine(c) + } +} + +func (bitcases Bitcases) MorphDefine(c *Context) { + for _, bitcase := range bitcases { + bitcase.MorphDefine(c) + } +} + +func (bitcase *Bitcase) MorphDefine(c *Context) { + bitcase.Fields.MorphDefine(c) +} + +func (fields Fields) MorphRead(c *Context, kind int, evNoSeq bool) { + var nextByte uint + + switch kind { + case FieldsEvent: + nextByte = 1 + } + + for _, field := range fields { + nextByte = field.MorphRead(c, kind, nextByte) + switch kind { + case FieldsEvent: + // Skip the sequence id + if !evNoSeq && (nextByte == 2 || nextByte == 3) { + nextByte = 4 + } + } + } +} + +func (field *Field) MorphRead(c *Context, kind int, byt uint) uint { + consumed := uint(0) + switch field.XMLName.Local { + case "pad": + consumed = uint(field.Bytes) + case "field": + if field.Type == "ClientMessageData" { + break + } + size := field.Type.Size(c) + typ := field.Type.Morph(c) + name := field.Name.Morph(c) + _, isBase := BaseTypeMap[string(field.Type)] + + c.Put("v.%s = ", name) + if !isBase { + c.Put("%s(", typ) + } + switch size { + case 1: c.Put("buf[%d]", byt) + case 2: c.Put("get16(buf[%d:])", byt) + case 4: c.Put("get32(buf[%d:])", byt) + case 8: c.Put("get64(buf[%d:])", byt) + default: + log.Fatalf("Unsupported field size '%d' for field '%s'.", + size, field) + } + if !isBase { + c.Put(")") + } + c.Putln("") + + consumed = size + case "list": + c.Putln("") + } + return byt + consumed +} + +func (fields Fields) MorphWrite(c *Context, kind int) { + var nextByte uint + + switch kind { + case FieldsEvent: + nextByte = 1 + } + + for _, field := range fields { + nextByte = field.MorphWrite(c, kind, nextByte) + } +} + +func (field *Field) MorphWrite(c *Context, kind int, byt uint) uint { + consumed := uint(0) + switch field.XMLName.Local { + case "pad": + consumed = uint(field.Bytes) + case "field": + size := field.Type.Size(c) + typ := field.Type.Morph(c) + name := field.Name.Morph(c) + switch size { + case 1: + c.Putln("v.%s = %s(buf[%d])", name, typ, byt) + case 2: + c.Putln("v.%s = %s(get16(buf[%d:]))", name, typ, byt) + case 4: + c.Putln("v.%s = %s(get32(buf[%d:]))", name, typ, byt) + case 8: + c.Putln("v.%s = %s(get64(buf[%d:]))", name, typ, byt) + } + consumed = size + case "list": + c.Putln("IDK") + } + return byt + consumed +} + /******************************************************************************/ // Per element morphing. // Below are functions that morph a single unit. @@ -133,15 +342,23 @@ func (xid *Xid) Morph(c *Context) { // TypeDef morphing. func (typedef *TypeDef) Morph(c *Context) { - c.Putln("type %s %s", typedef.Old.Morph(c), typedef.New.Morph(c)) + c.Putln("type %s %s", typedef.New.Morph(c), typedef.Old.Morph(c)) } // Struct morphing. func (strct *Struct) Morph(c *Context) { + c.Putln("type %s struct {", strct.Name.Morph(c)) + strct.Fields.MorphDefine(c) + c.Putln("}") + c.Putln("\n") } // Union morphing. func (union *Union) Morph(c *Context) { + c.Putln("type %s struct {", union.Name.Morph(c)) + union.Fields.MorphDefine(c) + c.Putln("}") + c.Putln("\n") } // Request morphing. @@ -150,10 +367,54 @@ func (request *Request) Morph(c *Context) { // Event morphing. func (ev *Event) Morph(c *Context) { + name := ev.Name.Morph(c) + + c.Putln("const %s = %d", name, ev.Number) + c.Putln("") + c.Putln("type %sEvent struct {", name) + ev.Fields.MorphDefine(c) + c.Putln("}") + c.Putln("") + c.Putln("func New%s(buf []byte) %sEvent {", name, name) + c.Putln("var v %sEvent", name) + ev.Fields.MorphRead(c, FieldsEvent, ev.NoSequence) + c.Putln("return v") + c.Putln("}") + c.Putln("") + c.Putln("func (err %sEvent) ImplementsEvent() { }", name) + c.Putln("") + c.Putln("func (ev %sEvent) Bytes() []byte {", name) + // ev.Fields.MorphWrite(c, FieldsEvent) + c.Putln("}") + c.Putln("") + c.Putln("func init() {") + c.Putln("newEventFuncs[%d] = New%s", ev.Number, name) + c.Putln("}") + c.Putln("") } // EventCopy morphing. func (evcopy *EventCopy) Morph(c *Context) { + oldName, newName := evcopy.Ref.Morph(c), evcopy.Name.Morph(c) + + c.Putln("const %s = %d", newName, evcopy.Number) + c.Putln("") + c.Putln("type %sEvent %sEvent", newName, oldName) + c.Putln("") + c.Putln("func New%s(buf []byte) %sEvent {", newName, newName) + c.Putln("return (%sEvent)(New%s(buf))", newName, oldName) + c.Putln("}") + c.Putln("") + c.Putln("func (err %sEvent) ImplementsEvent() { }", newName) + c.Putln("") + c.Putln("func (ev %sEvent) Bytes() []byte {", newName) + c.Putln("return (%sEvent)(ev).Bytes()", oldName) + c.Putln("}") + c.Putln("") + c.Putln("func init() {") + c.Putln("newEventFuncs[%d] = New%s", evcopy.Number, newName) + c.Putln("}") + c.Putln("") } // Error morphing. @@ -162,6 +423,26 @@ func (err *Error) Morph(c *Context) { // ErrorCopy morphing. func (errcopy *ErrorCopy) Morph(c *Context) { + oldName, newName := errcopy.Ref.Morph(c), errcopy.Name.Morph(c) + + c.Putln("const Bad%s = %d", newName, errcopy.Number) + c.Putln("") + c.Putln("type %sError %sError", newName, oldName) + c.Putln("") + c.Putln("func New%sError(buf []byte) %sError {", newName, newName) + c.Putln("return (%sError)(New%sError(buf))", newName, oldName) + c.Putln("}") + c.Putln("") + c.Putln("func (err %sError) ImplementsError() { }", newName) + c.Putln("") + c.Putln("func (err %sError) Bytes() []byte {", newName) + c.Putln("return (%sError)(err).Bytes()", oldName) + c.Putln("}") + c.Putln("") + c.Putln("func init() {") + c.Putln("newErrorFuncs[%d] = New%sError", errcopy.Number, newName) + c.Putln("}") + c.Putln("") } /******************************************************************************/ diff --git a/nexgb/xgbgen/main.go b/nexgb/xgbgen/main.go index 69579a4..c69c8aa 100644 --- a/nexgb/xgbgen/main.go +++ b/nexgb/xgbgen/main.go @@ -55,6 +55,7 @@ func main() { cmdGofmt := exec.Command("gofmt") cmdGofmt.Stdin = c.out cmdGofmt.Stdout = os.Stdout + cmdGofmt.Stderr = os.Stderr err = cmdGofmt.Run() if err != nil { log.Fatal(err) diff --git a/nexgb/xgbgen/misc.go b/nexgb/xgbgen/misc.go index 9adcf5d..13c4cc2 100644 --- a/nexgb/xgbgen/misc.go +++ b/nexgb/xgbgen/misc.go @@ -21,6 +21,11 @@ func popCount(mask uint) uint { return n } +// pad makes sure 'n' aligns on 4 bytes. +func pad(n int) int { + return (n + 3) & ^3 +} + // splitAndTitle takes a string, splits it by underscores, capitalizes the // first letter of each chunk, and smushes'em back together. func splitAndTitle(s string) string { @@ -29,9 +34,9 @@ func splitAndTitle(s string) string { return strings.Title(strings.ToLower(s)) } - // If the string has no underscores, leave it be. + // If the string has no underscores, capitalize it and leave it be. if i := strings.Index(s, "_"); i == -1 { - return s + return strings.Title(s) } // Now split the name at underscores, capitalize the first diff --git a/nexgb/xgbgen/xgbgen b/nexgb/xgbgen/xgbgen deleted file mode 100755 index ef33abc7388e26599afc0037c38c8cb44d8abfea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2318165 zcmeEv3wTu3)%GL=7$Idwp*GrB2OVrsv_aFFRMY{2o>vMo0v0(4<2& z$00(kZLvj*R$EkBX-hFEYC?d7dMQe^c#qcVi9y9X=x6i4@7nvEIp@qwi2d6C`Jex3 zD>=8l_qwmW_S%=Zc3Sx<*;!cu`+wPilLCC2_QGU&71JLg$s&PRpg53&zhh8x7`_k1 zKf7E^-`Uq5eB=Lmr+1J=->apP7>}KJW8yaGxaxS70az9g?o7rZ42;D~tIa<(cms+;d|r76|03OW>sa^o_ds z@h-$`)>q8H&Ga%=aJs6u`hkJ#7yIh3&N)l!ug)1Q*Na}rQSIr!e)v=H-VHze$~jUp z{K}W)`sS^=qQ3a+5664fcX;T?TggA~_JQjk;H#fE@m#5pH}N337R(;FKA{jN8-A=+ z)sMBR`fKxvUGjf^{13q=cm3UWpC^TP-+i!Li+_|94PW@{&%`@Nc2YzCS+3wO|C)k7 zQopwAEA9jW-@y>?a^Sxl`2U0hbBsjpxZVBz{l*Dn7Y?!q@FwAI_z2yw zc_7=480Pl?v@Tj~#5Wgq`e-^x(Nv5k8A%zfpoX;!!#oO?3UhAIXe}DoxbAd(Yl!9< zcNuqC&ujwSt%QqLLB1jvVuqO?WdnI^pi(tZg$D36$DEsMaYzFkiv2kJW9Rt>`n^5JP!1k|-rBW=Cs`1kg4o2sXGG zX-*AVqY8qmG!hq}P$wuEnV1@k?-^EqiqQ&c&6xpnn#e0}UWL#RCOqrIj;sLK z5{Z8rsLu!D;#6#?1sA}LMF3jSN#>z-@W?5%N$h!E{v?U{-d}dm;O`8ba$$6&%ifFkg za?o0UK-$qd5xK3ME>i+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QbbMLVHz)$UFUzUL=Q)4=AP5 z$WwlDpHiB54w2%rQkr^XhXld(^Z??Ag*DvF8kX#2ygr5qo%@N9-YU9d=g;qz|JDJpDnHOe{#F>4-D)|lFxQn`7doz z{)@+iEdN{evz1oG7A48&kwy7?|6BRpx%JQEj`BCq6j3)I zxBhulQvPMfDF55J_0MCL@+Y65{1bBPlSee=pFL6ei+2x8>3?f`;PFoRkIz(o>Cv7O z{!%`VhRT1UUHQ{<+cS@q${*aN{E2&nTK#X;&m*bw=bWef2Xos4kF&}jxIy_)kou?k zWfT_ql@}`i#b7)MBPyTAXw|=lzt6$nh}{0pBe?QEf0Ob*vumi;|5p7xzAOK*FDZX( zuD#;XU-=(=UHKbw+YkE&%0HLC7{cEdbK5_A4$2?$sPZYdf3aVo{DXh0{5?y28N**% zUiLbaU;Z=YKbl)!_DPig=Vz7wc5Z&yV^RJKTa~{$%tY{8^TYm(@@KrD{EY5m>@#~i z%Aared^<$ipXz5{Ncs2uR`u5h-bxrx`RpkvfB*NC|4c{CDYekz|mH0A&KA?5FPU_c6fDxdu~<@b9* z`DYy$kbx+=H-vhSz-=MPf;#(9C#;HT{_=uXvtUq**f{p{;1|DOAlf8?mt?3n(=p0M&?cvJaT zA_d;*WXy`DPyFU;2jfAKWRA&px*DXa8CG<+jS#gJCF7Kg?Ck0p d+0r?(*xfj?YfZ~Yv&3Wn9nsRXvJ$Ts{~sZ{Oxyqf diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index 0f632b4..12932b2 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -71,16 +71,16 @@ func (x *XML) Morph(c *Context) { x.Requests.Morph(c) c.Putln("") - x.Events.Morph(c) - c.Putln("") - x.Errors.Morph(c) c.Putln("") - x.EventCopies.Morph(c) + x.ErrorCopies.Morph(c) c.Putln("") - x.ErrorCopies.Morph(c) + x.Events.Morph(c) + c.Putln("") + + x.EventCopies.Morph(c) c.Putln("") } @@ -166,6 +166,38 @@ type Name string type Type string +// Size is a nifty function that takes any type and digs until it finds +// its underlying base type. At which point, the size can be determined. +func (typ Type) Size(c *Context) uint { + // If this is a base type, we're done. + if size, ok := BaseTypeSizes[string(typ)]; ok { + return size + } + + // If it's a resource, we're also done. + if c.xml.IsResource(typ) { + return BaseTypeSizes["Id"] + } + + // It's not, so that implies there is *some* typedef declaring it + // in terms of another type. Just follow that chain until we get to + // a base type. We also need to check imported stuff. + for _, typedef := range c.xml.TypeDefs { + if typ == typedef.New { + return typedef.Old.Size(c) + } + } + for _, imp := range c.xml.Imports { + for _, typedef := range imp.xml.TypeDefs { + if typ == typedef.New { + return typedef.Old.Size(c) + } + } + } + log.Panicf("Could not find base size of type '%s'.", typ) + panic("unreachable") +} + type Imports []*Import func (imports Imports) Eval() { @@ -239,7 +271,7 @@ type EventCopies []*EventCopy type EventCopy struct { Name Type `xml:"name,attr"` - Number string `xml:"number,attr"` + Number int `xml:"number,attr"` Ref Type `xml:"ref,attr"` } @@ -247,7 +279,7 @@ type ErrorCopies []*ErrorCopy type ErrorCopy struct { Name Type `xml:"name,attr"` - Number string `xml:"number,attr"` + Number int `xml:"number,attr"` Ref Type `xml:"ref,attr"` } @@ -255,14 +287,14 @@ type Structs []*Struct type Struct struct { Name Type `xml:"name,attr"` - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` } type Unions []*Union type Union struct { Name Type `xml:"name,attr"` - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` } type Requests []*Request @@ -271,12 +303,12 @@ type Request struct { Name Type `xml:"name,attr"` Opcode int `xml:"opcode,attr"` Combine bool `xml:"combine-adjacent,attr"` - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` Reply *Reply `xml:"reply"` } type Reply struct { - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` } type Events []*Event @@ -285,7 +317,7 @@ type Event struct { Name Type `xml:"name,attr"` Number int `xml:"number,attr"` NoSequence bool `xml:"no-sequence-number,true"` - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` } type Errors []*Error @@ -293,6 +325,6 @@ type Errors []*Error type Error struct { Name Type `xml:"name,attr"` Number int `xml:"number,attr"` - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` } diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go index 18be6e3..c1a7240 100644 --- a/nexgb/xgbgen/xml_fields.go +++ b/nexgb/xgbgen/xml_fields.go @@ -23,6 +23,8 @@ import ( "strings" ) +type Fields []*Field + type Field struct { XMLName xml.Name @@ -30,7 +32,7 @@ type Field struct { Bytes int `xml:"bytes,attr"` // For 'field', 'list', 'localfield', 'exprfield' and 'switch' elements. - Name string `xml:"name,attr"` + Name Name `xml:"name,attr"` // For 'field', 'list', 'localfield', and 'exprfield' elements. Type Type `xml:"type,attr"` @@ -40,11 +42,11 @@ type Field struct { // For 'valueparm' element. ValueMaskType Type `xml:"value-mask-type,attr"` - ValueMaskName string `xml:"value-mask-name,attr"` - ValueListName string `xml:"value-list-name,attr"` + ValueMaskName Name `xml:"value-mask-name,attr"` + ValueListName Name `xml:"value-list-name,attr"` // For 'switch' element. - Bitcases []*Bitcase `xml:"bitcase"` + Bitcases Bitcases `xml:"bitcase"` // I don't know which elements these are for. The documentation is vague. // They also seem to be completely optional. @@ -86,6 +88,8 @@ func (f *Field) String() string { panic("unreachable") } +type Bitcases []*Bitcase + // Bitcase represents a single expression followed by any number of fields. // Namely, if the switch's expression (all bitcases are inside a switch), // and'd with the bitcase's expression is equal to the bitcase expression, @@ -95,7 +99,7 @@ func (f *Field) String() string { // it's the closest thing to a Union I can get to in Go without interfaces. // Would an '' tag have been too much to ask? :-( type Bitcase struct { - Fields []*Field `xml:",any"` + Fields Fields `xml:",any"` // All the different expressions. // When it comes time to choose one, use the 'Expr' method. From 3115c13e88badfd3b6b1762f2239edbf9d0b8951 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 29 Apr 2012 14:09:03 -0400 Subject: [PATCH 03/90] last commit before i tear everything down --- nexgb/.gitignore | 2 +- nexgb/xgbgen/COPYING | 13 +++++ nexgb/xgbgen/bufcount.go | 15 ++++++ nexgb/xgbgen/go.go | 110 ++++++++++++++++++++++++--------------- nexgb/xgbgen/xml.go | 42 +++++++++++++++ 5 files changed, 140 insertions(+), 42 deletions(-) create mode 100644 nexgb/xgbgen/COPYING create mode 100644 nexgb/xgbgen/bufcount.go diff --git a/nexgb/.gitignore b/nexgb/.gitignore index 1c0248d..179f830 100644 --- a/nexgb/.gitignore +++ b/nexgb/.gitignore @@ -1,2 +1,2 @@ -xgbgen +xgbgen/xgbgen .*.swp diff --git a/nexgb/xgbgen/COPYING b/nexgb/xgbgen/COPYING new file mode 100644 index 0000000..5c93f45 --- /dev/null +++ b/nexgb/xgbgen/COPYING @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/nexgb/xgbgen/bufcount.go b/nexgb/xgbgen/bufcount.go new file mode 100644 index 0000000..c3a5645 --- /dev/null +++ b/nexgb/xgbgen/bufcount.go @@ -0,0 +1,15 @@ +package main + +/* + A buffer count is a mechanism by which to keep track of which byte one + is reading or writing to/from the wire. + + It's an abstraction over the fact that while such a counter is usually + fixed, it can be made variable based on values at run-time. +*/ + +type BufCount struct { + Fixed int + Exprs []*Expression +} + diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index bfc54dd..b939b3a 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -23,6 +23,7 @@ package main */ import ( + "fmt" "log" "strings" ) @@ -214,16 +215,12 @@ func (bitcase *Bitcase) MorphDefine(c *Context) { bitcase.Fields.MorphDefine(c) } -func (fields Fields) MorphRead(c *Context, kind int, evNoSeq bool) { - var nextByte uint - - switch kind { - case FieldsEvent: - nextByte = 1 - } +func (fields Fields) MorphRead(c *Context, kind int, evNoSeq bool, + prefix string, byt uint) uint { + nextByte := byt for _, field := range fields { - nextByte = field.MorphRead(c, kind, nextByte) + nextByte = field.MorphRead(c, kind, nextByte, prefix) switch kind { case FieldsEvent: // Skip the sequence id @@ -232,45 +229,76 @@ func (fields Fields) MorphRead(c *Context, kind int, evNoSeq bool) { } } } + return nextByte } -func (field *Field) MorphRead(c *Context, kind int, byt uint) uint { - consumed := uint(0) +func (field *Field) MorphRead(c *Context, kind int, byt uint, + prefix string) uint { + + nextByte := byt switch field.XMLName.Local { case "pad": - consumed = uint(field.Bytes) + nextByte += uint(field.Bytes) case "field": - if field.Type == "ClientMessageData" { - break - } - size := field.Type.Size(c) - typ := field.Type.Morph(c) - name := field.Name.Morph(c) - _, isBase := BaseTypeMap[string(field.Type)] - - c.Put("v.%s = ", name) - if !isBase { - c.Put("%s(", typ) - } - switch size { - case 1: c.Put("buf[%d]", byt) - case 2: c.Put("get16(buf[%d:])", byt) - case 4: c.Put("get32(buf[%d:])", byt) - case 8: c.Put("get64(buf[%d:])", byt) - default: - log.Fatalf("Unsupported field size '%d' for field '%s'.", - size, field) - } - if !isBase { - c.Put(")") - } - c.Putln("") - - consumed = size + nextByte = field.MorphReadField(c, kind, nextByte, prefix) case "list": - c.Putln("") + typ := field.Type.Morph(c) + + // Create a temporary Field so we can use MorphReadField. + // temp := &Field{ + // XMLName: xml.Name{Local: "field"}, + // Name: field.Name, + // Type: field.Type, + // } + + // Special case: if the list is just raw bytes, use copy! + if typ == "byte" { + c.Putln("copy(%s%s, buf[%d:])", prefix, field.Name.Morph(c), + byt) + nextByte = byt + 20 + } else { + c.Putln("//list!") + } } - return byt + consumed + return nextByte +} + +func (field *Field) MorphReadField(c *Context, kind int, byt uint, + prefix string) uint { + + if union := field.Type.Union(c); union != nil { + c.Putln("") + c.Putln("%s%s = %s{}", prefix, field.Name.Morph(c), field.Type.Morph(c)) + union.Fields.MorphRead(c, kind, false, + fmt.Sprintf("%s%s.", prefix, field.Name.Morph(c)), byt) + c.Putln("") + return byt + } + + size := field.Type.Size(c) + typ := field.Type.Morph(c) + name := field.Name.Morph(c) + _, isBase := BaseTypeMap[string(field.Type)] + + c.Put("%s%s = ", prefix, name) + if !isBase { + c.Put("%s(", typ) + } + switch size { + case 1: c.Put("buf[%d]", byt) + case 2: c.Put("get16(buf[%d:])", byt) + case 4: c.Put("get32(buf[%d:])", byt) + case 8: c.Put("get64(buf[%d:])", byt) + default: + log.Fatalf("Unsupported field size '%d' for field '%s'.", + size, field) + } + if !isBase { + c.Put(")") + } + c.Putln("") + + return byt + size } func (fields Fields) MorphWrite(c *Context, kind int) { @@ -377,7 +405,7 @@ func (ev *Event) Morph(c *Context) { c.Putln("") c.Putln("func New%s(buf []byte) %sEvent {", name, name) c.Putln("var v %sEvent", name) - ev.Fields.MorphRead(c, FieldsEvent, ev.NoSequence) + ev.Fields.MorphRead(c, FieldsEvent, ev.NoSequence, "v.", 1) c.Putln("return v") c.Putln("}") c.Putln("") diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index 12932b2..e4202d0 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -166,6 +166,48 @@ type Name string type Type string +// Union returns the 'Union' struct corresponding to this type, if +// one exists. +func (typ Type) Union(c *Context) *Union { + // If this is a typedef, use that instead. + if oldTyp, ok := typ.TypeDef(c); ok { + return oldTyp.Union(c) + } + + // Otherwise, just look for a union type with 'typ' name. + for _, union := range c.xml.Unions { + if typ == union.Name { + return union + } + } + for _, imp := range c.xml.Imports { + for _, union := range imp.xml.Unions { + if typ == union.Name { + return union + } + } + } + return nil +} + +// TypeDef returns the 'old' type corresponding to this type, if it's found +// in a type def. If not found, the second return value is false. +func (typ Type) TypeDef(c *Context) (Type, bool) { + for _, typedef := range c.xml.TypeDefs { + if typ == typedef.New { + return typedef.Old, true + } + } + for _, imp := range c.xml.Imports { + for _, typedef := range imp.xml.TypeDefs { + if typ == typedef.New { + return typedef.Old, true + } + } + } + return "", false +} + // Size is a nifty function that takes any type and digs until it finds // its underlying base type. At which point, the size can be determined. func (typ Type) Size(c *Context) uint { From 05d8ec6a16acf88c5ae7521d86131f5ea7f9b4e4 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 30 Apr 2012 02:40:55 -0400 Subject: [PATCH 04/90] complete and total overhaul like i promised. things are much easier to reason about. still not working yet though. --- nexgb/xgbgen/context.go | 25 +- nexgb/xgbgen/expression.go | 276 +++++++++++++ nexgb/xgbgen/field.go | 170 ++++++++ nexgb/xgbgen/go.go | 735 +++++++++++++-------------------- nexgb/xgbgen/main.go | 2 +- nexgb/xgbgen/morph.go | 50 +++ nexgb/xgbgen/representation.go | 56 +++ nexgb/xgbgen/size.go | 22 + nexgb/xgbgen/translation.go | 426 +++++++++++++++++++ nexgb/xgbgen/type.go | 365 ++++++++++++++++ nexgb/xgbgen/xml.go | 349 +++------------- nexgb/xgbgen/xml_expression.go | 30 +- nexgb/xgbgen/xml_fields.go | 58 +-- 13 files changed, 1777 insertions(+), 787 deletions(-) create mode 100644 nexgb/xgbgen/expression.go create mode 100644 nexgb/xgbgen/field.go create mode 100644 nexgb/xgbgen/morph.go create mode 100644 nexgb/xgbgen/representation.go create mode 100644 nexgb/xgbgen/size.go create mode 100644 nexgb/xgbgen/translation.go create mode 100644 nexgb/xgbgen/type.go diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 712cad4..d3cbb81 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -8,13 +8,12 @@ import ( ) type Context struct { - xml *XML + protocol *Protocol out *bytes.Buffer } func newContext() *Context { return &Context{ - xml: &XML{}, out: bytes.NewBuffer([]byte{}), } } @@ -32,22 +31,24 @@ func (c *Context) Put(format string, v ...interface{}) { } } - -// Translate is the big daddy of them all. It takes in an XML byte slice +// Morph is the big daddy of them all. It takes in an XML byte slice, +// parse it, transforms the XML types into more usable types, // and writes Go code to the 'out' buffer. -func (c *Context) Translate(xmlBytes []byte) { - err := xml.Unmarshal(xmlBytes, c.xml) +func (c *Context) Morph(xmlBytes []byte) { + parsedXml := &XML{} + err := xml.Unmarshal(xmlBytes, parsedXml) if err != nil { log.Fatal(err) } // Parse all imports - c.xml.Imports.Eval() + parsedXml.Imports.Eval() - // Make sure all top level enumerations have expressions - // (For when there are empty items.) - c.xml.Enums.Eval() + // Translate XML types to nice types + c.protocol = parsedXml.Translate() - // It's Morphin' Time! - c.xml.Morph(c) + // Now write Go source code + for _, typ := range c.protocol.Types { + typ.Define(c) + } } diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go new file mode 100644 index 0000000..a163692 --- /dev/null +++ b/nexgb/xgbgen/expression.go @@ -0,0 +1,276 @@ +package main + +import ( + "fmt" + "log" +) + +type Expression interface { + Concrete() bool + Eval() uint + Reduce(prefix, fun string) string + String() string + Initialize(p *Protocol) +} + +type BinaryOp struct { + Op string + Expr1 Expression + Expr2 Expression +} + +func newBinaryOp(op string, expr1, expr2 Expression) Expression { + switch { + case expr1 != nil && expr2 != nil: + return &BinaryOp{ + Op: op, + Expr1: expr1, + Expr2: expr2, + } + case expr1 != nil && expr2 == nil: + return expr1 + case expr1 == nil && expr2 != nil: + return expr2 + case expr1 == nil && expr2 == nil: + return nil + } + panic("unreachable") +} + +func (e *BinaryOp) Concrete() bool { + return e.Expr1.Concrete() && e.Expr2.Concrete() +} + +func (e *BinaryOp) Eval() uint { + switch e.Op { + case "+": + return e.Expr1.Eval() + e.Expr2.Eval() + case "-": + return e.Expr1.Eval() - e.Expr2.Eval() + case "*": + return e.Expr1.Eval() * e.Expr2.Eval() + case "/": + return e.Expr1.Eval() / e.Expr2.Eval() + case "&": + return e.Expr1.Eval() & e.Expr2.Eval() + case "<<": + return e.Expr1.Eval() << e.Expr2.Eval() + } + + log.Fatalf("Invalid binary operator '%s' for expression.", e.Op) + panic("unreachable") +} + +func (e *BinaryOp) Reduce(prefix, fun string) string { + if e.Concrete() { + return fmt.Sprintf("%d", e.Eval()) + } + return fmt.Sprintf("(%s %s %s)", + e.Expr1.Reduce(prefix, fun), e.Op, e.Expr2.Reduce(prefix, fun)) +} + +func (e *BinaryOp) String() string { + return e.Reduce("", "") +} + +func (e *BinaryOp) Initialize(p *Protocol) { + e.Expr1.Initialize(p) + e.Expr2.Initialize(p) +} + +type UnaryOp struct { + Op string + Expr Expression +} + +func (e *UnaryOp) Concrete() bool { + return e.Expr.Concrete() +} + +func (e *UnaryOp) Eval() uint { + switch e.Op { + case "~": + return ^e.Expr.Eval() + } + + log.Fatalf("Invalid unary operator '%s' for expression.", e.Op) + panic("unreachable") +} + +func (e *UnaryOp) Reduce(prefix, fun string) string { + if e.Concrete() { + return fmt.Sprintf("%d", e.Eval()) + } + return fmt.Sprintf("(%s (%s))", e.Op, e.Expr.Reduce(prefix, fun)) +} + +func (e *UnaryOp) String() string { + return e.Reduce("", "") +} + +func (e *UnaryOp) Initialize(p *Protocol) { + e.Expr.Initialize(p) +} + +type PopCount struct { + Expr Expression +} + +func (e *PopCount) Concrete() bool { + return e.Expr.Concrete() +} + +func (e *PopCount) Eval() uint { + return popCount(e.Expr.Eval()) +} + +func (e *PopCount) Reduce(prefix, fun string) string { + if e.Concrete() { + return fmt.Sprintf("%d", e.Eval()) + } + return fmt.Sprintf("popCount(%s)", e.Expr.Reduce(prefix, fun)) +} + +func (e *PopCount) String() string { + return e.Reduce("", "") +} + +func (e *PopCount) Initialize(p *Protocol) { + e.Expr.Initialize(p) +} + +type Value struct { + v uint +} + +func (e *Value) Concrete() bool { + return true +} + +func (e *Value) Eval() uint { + return e.v +} + +func (e *Value) Reduce(prefix, fun string) string { + return fmt.Sprintf("%d", e.v) +} + +func (e *Value) String() string { + return e.Reduce("", "") +} + +func (e *Value) Initialize(p *Protocol) { } + +type Bit struct { + b uint +} + +func (e *Bit) Concrete() bool { + return true +} + +func (e *Bit) Eval() uint { + return 1 << e.b +} + +func (e *Bit) Reduce(prefix, fun string) string { + return fmt.Sprintf("%d", e.Eval()) +} + +func (e *Bit) String() string { + return e.Reduce("", "") +} + +func (e *Bit) Initialize(p *Protocol) { } + +type FieldRef struct { + Name string +} + +func (e *FieldRef) Concrete() bool { + return false +} + +func (e *FieldRef) Eval() uint { + log.Fatalf("Cannot evaluate a 'FieldRef'. It is not concrete.") + panic("unreachable") +} + +func (e *FieldRef) Reduce(prefix, fun string) string { + val := e.Name + if len(prefix) > 0 { + val = fmt.Sprintf("%s%s", prefix, val) + } + if len(fun) > 0 { + val = fmt.Sprintf("%s(%s)", fun, val) + } + return val +} + +func (e *FieldRef) String() string { + return e.Reduce("", "") +} + +func (e *FieldRef) Initialize(p *Protocol) { + e.Name = SrcName(e.Name) +} + +type EnumRef struct { + EnumKind Type + EnumItem string +} + +func (e *EnumRef) Concrete() bool { + return false +} + +func (e *EnumRef) Eval() uint { + log.Fatalf("Cannot evaluate an 'EnumRef'. It is not concrete.") + panic("unreachable") +} + +func (e *EnumRef) Reduce(prefix, fun string) string { + val := fmt.Sprintf("%s%s", e.EnumKind, e.EnumItem) + if len(fun) > 0 { + val = fmt.Sprintf("%s(%s)", fun, val) + } + return val +} + +func (e *EnumRef) String() string { + return e.Reduce("", "") +} + +func (e *EnumRef) Initialize(p *Protocol) { + e.EnumKind = e.EnumKind.(*Translation).RealType(p) + e.EnumItem = SrcName(e.EnumItem) +} + +type SumOf struct { + Name string +} + +func (e *SumOf) Concrete() bool { + return false +} + +func (e *SumOf) Eval() uint { + log.Fatalf("Cannot evaluate a 'SumOf'. It is not concrete.") + panic("unreachable") +} + +func (e *SumOf) Reduce(prefix, fun string) string { + if len(prefix) > 0 { + return fmt.Sprintf("sum(%s%s)", prefix, e.Name) + } + return fmt.Sprintf("sum(%s)", e.Name) +} + +func (e *SumOf) String() string { + return e.Reduce("", "") +} + +func (e *SumOf) Initialize(p *Protocol) { + e.Name = SrcName(e.Name) +} + diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go new file mode 100644 index 0000000..a659e6e --- /dev/null +++ b/nexgb/xgbgen/field.go @@ -0,0 +1,170 @@ +package main + +type Field interface { + Initialize(p *Protocol) + SrcName() string + XmlName() string + Size() Size + + Define(c *Context) + Read(c *Context) +} + +func (pad *PadField) Initialize(p *Protocol) {} + +type PadField struct { + Bytes uint +} + +func (p *PadField) SrcName() string { + panic("illegal to take source name of a pad field") +} + +func (p *PadField) XmlName() string { + panic("illegal to take XML name of a pad field") +} + +func (p *PadField) Size() Size { + return newFixedSize(p.Bytes) +} + +type SingleField struct { + srcName string + xmlName string + Type Type +} + +func (f *SingleField) Initialize(p *Protocol) { + f.srcName = SrcName(f.XmlName()) + f.Type = f.Type.(*Translation).RealType(p) +} + +func (f *SingleField) SrcName() string { + return f.srcName +} + +func (f *SingleField) XmlName() string { + return f.xmlName +} + +func (f *SingleField) Size() Size { + return f.Type.Size() +} + +type ListField struct { + srcName string + xmlName string + Type Type + LengthExpr Expression +} + +func (f *ListField) SrcName() string { + return f.srcName +} + +func (f *ListField) XmlName() string { + return f.xmlName +} + +func (f *ListField) Size() Size { + return newExpressionSize(f.LengthExpr).Multiply(f.Type.Size()) +} + +func (f *ListField) Initialize(p *Protocol) { + f.srcName = SrcName(f.XmlName()) + f.Type = f.Type.(*Translation).RealType(p) + if f.LengthExpr != nil { + f.LengthExpr.Initialize(p) + } +} + +type LocalField struct { + *SingleField +} + +type ExprField struct { + srcName string + xmlName string + Type Type + Expr Expression +} + +func (f *ExprField) SrcName() string { + return f.srcName +} + +func (f *ExprField) XmlName() string { + return f.xmlName +} + +func (f *ExprField) Size() Size { + return f.Type.Size() +} + +func (f *ExprField) Initialize(p *Protocol) { + f.srcName = SrcName(f.XmlName()) + f.Type = f.Type.(*Translation).RealType(p) + f.Expr.Initialize(p) +} + +type ValueField struct { + MaskType Type + MaskName string + ListName string +} + +func (f *ValueField) SrcName() string { + panic("it is illegal to call SrcName on a ValueField field") +} + +func (f *ValueField) XmlName() string { + panic("it is illegal to call XmlName on a ValueField field") +} + +func (f *ValueField) Size() Size { + return f.MaskType.Size() +} + +func (f *ValueField) Initialize(p *Protocol) { + f.MaskType = f.MaskType.(*Translation).RealType(p) + f.MaskName = SrcName(f.MaskName) + f.ListName = SrcName(f.ListName) +} + +type SwitchField struct { + Name string + Expr Expression + Bitcases []*Bitcase +} + +func (f *SwitchField) SrcName() string { + panic("it is illegal to call SrcName on a SwitchField field") +} + +func (f *SwitchField) XmlName() string { + panic("it is illegal to call XmlName on a SwitchField field") +} + +// XXX: This is a bit tricky. The size has to be represented as a non-concrete +// expression that finds *which* bitcase fields are included, and sums the +// sizes of those fields. +func (f *SwitchField) Size() Size { + return newFixedSize(0) +} + +func (f *SwitchField) Initialize(p *Protocol) { + f.Name = SrcName(f.Name) + f.Expr.Initialize(p) + for _, bitcase := range f.Bitcases { + bitcase.Expr.Initialize(p) + for _, field := range bitcase.Fields { + field.Initialize(p) + } + } +} + +type Bitcase struct { + Fields []Field + Expr Expression +} + diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index b939b3a..ac3ed2c 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -1,36 +1,13 @@ package main -/* - To the best of my ability, these are all of the Go specific formatting - functions. If I've designed xgbgen correctly, this should be only the - place that you change things to generate code for a new language. - - This file is organized as follows: - - * Imports and helper variables. - * Manual type and name override maps. - * Constants for tweaking various morphing functions. - * Helper morphing functions. - * Morphing functions for each "sub-unit." - * Morphing functions for each "unit". - * Morphing functions for collections of "units". - - Units can be thought of as the top-level elements in an XML protocol - description file. Namely, structs, xidtypes, imports, enums, unions, etc. - Collections of units are simply "all of the UNIT in the XML file." - Sub-units can be thought of as recurring bits like struct contents (which - is used in events, replies, requests, errors, etc.) and expression - evaluation. -*/ import ( "fmt" "log" - "strings" ) -/******************************************************************************/ -// Manual type and name overrides. -/******************************************************************************/ +// xgbResourceIdName is the name of the type used for all resource identifiers. +// As of right now, it needs to be declared somewhere manually. +var xgbGenResourceIdName = "Id" // BaseTypeMap is a map from X base types to Go types. // X base types should correspond to the smallest set of X types @@ -50,6 +27,8 @@ var BaseTypeMap = map[string]string{ "float": "float64", "double": "float64", "char": "byte", + "void": "byte", + "Id": "Id", } // BaseTypeSizes should have precisely the same keys as in BaseTypeMap, @@ -66,6 +45,7 @@ var BaseTypeSizes = map[string]uint{ "float": 4, "double": 8, "char": 1, + "void": 1, "Id": 4, } @@ -82,483 +62,350 @@ var TypeMap = map[string]string{ // NameMap is the same as TypeMap, but for names. var NameMap = map[string]string{ } -/******************************************************************************/ -// Constants for changing the semantics of morphing functions. -// These are mainly used to tweaking the writing of fields. -// Namely, reading/writing is not exactly the same across events, -// requests/replies and errors. -/******************************************************************************/ -const ( - FieldsEvent = iota - FieldsRequestReply - FieldsError -) +// Reading, writing and defining... -/******************************************************************************/ -// Helper functions that aide in morphing repetitive constructs. -// i.e., type and identifier names, etc. -/******************************************************************************/ - -// Morph changes every TYPE (not names) into something suitable -// for your language. It also handles adding suffixes like 'Event' -// and 'Union'. (A 'Union' suffix is used in Go because unions aren't -// supported at the language level.) -func (typ Type) Morph(c *Context) string { - t := string(typ) - - // If this is a base type, then write the raw Go type. - if newt, ok := BaseTypeMap[t]; ok { - return newt - } - - // If it's in the type map, use that translation. - if newt, ok := TypeMap[t]; ok { - return newt - } - - // If it's a resource type, just use 'Id'. - if c.xml.IsResource(typ) { - return "Id" - } - - // If there's a namespace to this type, just use it and be done. - if colon := strings.Index(t, ":"); colon > -1 { - namespace := t[:colon] - rest := t[colon+1:] - return splitAndTitle(namespace) + splitAndTitle(rest) - } - - // Since there is no namespace, we need to look for a namespace - // in the current context. - return typ.Prefix(c) + splitAndTitle(t) -} - -// Prefix searches the parsed XML for a type matching 'typ'. -// It then returns the appropriate prefix to be used in source code. -// Note that the core X protocol *is* a namespace, but does not have a prefix. -// Also note that you should probably check the BaseTypeMap and TypeMap -// before calling this function. -func (typ Type) Prefix(c *Context) string { - // If this is xproto, quit. No prefixes needed. - if c.xml.Header == "xproto" { - return "" - } - - // First check for the type in the current namespace. - if c.xml.HasType(typ) { - return strings.Title(c.xml.Header) - } - - // Now check each of the imports... - for _, imp := range c.xml.Imports { - if imp.xml.Header != "xproto" && imp.xml.HasType(typ) { - return strings.Title(imp.xml.Header) - } - } - - return "" -} - -// Morph changes every identifier (NOT type) into something suitable -// for your language. -func (name Name) Morph(c *Context) string { - n := string(name) - - // If it's in the name map, use that translation. - if newn, ok := NameMap[n]; ok { - return newn - } - - return splitAndTitle(n) -} - -/******************************************************************************/ -// Sub-unit morphing. -// Below are functions that morph sub-units. Like collections of fields, -// expressions, etc. -// Note that collections of fields can be used in three different contexts: -// definitions, reading from the wire and writing to the wire. Thus, there -// exists 'MorphDefine', 'MorphRead', 'MorphWrite' defined on Fields. -/******************************************************************************/ -func (fields Fields) MorphDefine(c *Context) { - for _, field := range fields { - field.MorphDefine(c) - } -} - -func (field *Field) MorphDefine(c *Context) { - // We omit 'pad' and 'exprfield' - switch field.XMLName.Local { - case "field": - c.Putln("%s %s", field.Name.Morph(c), field.Type.Morph(c)) - case "list": - c.Putln("%s []%s", field.Name.Morph(c), field.Type.Morph(c)) - case "localfield": - c.Putln("%s %s", field.Name.Morph(c), field.Type.Morph(c)) - case "valueparam": - c.Putln("%s %s", field.ValueMaskName.Morph(c), - field.ValueMaskType.Morph(c)) - c.Putln("%s []%s", field.ValueListName.Morph(c), - field.ValueMaskType.Morph(c)) - case "switch": - field.Bitcases.MorphDefine(c) - } -} - -func (bitcases Bitcases) MorphDefine(c *Context) { - for _, bitcase := range bitcases { - bitcase.MorphDefine(c) - } -} - -func (bitcase *Bitcase) MorphDefine(c *Context) { - bitcase.Fields.MorphDefine(c) -} - -func (fields Fields) MorphRead(c *Context, kind int, evNoSeq bool, - prefix string, byt uint) uint { - - nextByte := byt - for _, field := range fields { - nextByte = field.MorphRead(c, kind, nextByte, prefix) - switch kind { - case FieldsEvent: - // Skip the sequence id - if !evNoSeq && (nextByte == 2 || nextByte == 3) { - nextByte = 4 - } - } - } - return nextByte -} - -func (field *Field) MorphRead(c *Context, kind int, byt uint, - prefix string) uint { - - nextByte := byt - switch field.XMLName.Local { - case "pad": - nextByte += uint(field.Bytes) - case "field": - nextByte = field.MorphReadField(c, kind, nextByte, prefix) - case "list": - typ := field.Type.Morph(c) - - // Create a temporary Field so we can use MorphReadField. - // temp := &Field{ - // XMLName: xml.Name{Local: "field"}, - // Name: field.Name, - // Type: field.Type, - // } - - // Special case: if the list is just raw bytes, use copy! - if typ == "byte" { - c.Putln("copy(%s%s, buf[%d:])", prefix, field.Name.Morph(c), - byt) - nextByte = byt + 20 - } else { - c.Putln("//list!") - } - } - return nextByte -} - -func (field *Field) MorphReadField(c *Context, kind int, byt uint, - prefix string) uint { - - if union := field.Type.Union(c); union != nil { - c.Putln("") - c.Putln("%s%s = %s{}", prefix, field.Name.Morph(c), field.Type.Morph(c)) - union.Fields.MorphRead(c, kind, false, - fmt.Sprintf("%s%s.", prefix, field.Name.Morph(c)), byt) - c.Putln("") - return byt - } - - size := field.Type.Size(c) - typ := field.Type.Morph(c) - name := field.Name.Morph(c) - _, isBase := BaseTypeMap[string(field.Type)] - - c.Put("%s%s = ", prefix, name) - if !isBase { - c.Put("%s(", typ) - } - switch size { - case 1: c.Put("buf[%d]", byt) - case 2: c.Put("get16(buf[%d:])", byt) - case 4: c.Put("get32(buf[%d:])", byt) - case 8: c.Put("get64(buf[%d:])", byt) - default: - log.Fatalf("Unsupported field size '%d' for field '%s'.", - size, field) - } - if !isBase { - c.Put(")") - } +// Base types +func (b *Base) Define(c *Context) { + c.Putln("// Skipping definition for base type '%s'", SrcName(b.XmlName())) c.Putln("") - - return byt + size } -func (fields Fields) MorphWrite(c *Context, kind int) { - var nextByte uint - - switch kind { - case FieldsEvent: - nextByte = 1 - } - - for _, field := range fields { - nextByte = field.MorphWrite(c, kind, nextByte) - } -} - -func (field *Field) MorphWrite(c *Context, kind int, byt uint) uint { - consumed := uint(0) - switch field.XMLName.Local { - case "pad": - consumed = uint(field.Bytes) - case "field": - size := field.Type.Size(c) - typ := field.Type.Morph(c) - name := field.Name.Morph(c) - switch size { - case 1: - c.Putln("v.%s = %s(buf[%d])", name, typ, byt) - case 2: - c.Putln("v.%s = %s(get16(buf[%d:]))", name, typ, byt) - case 4: - c.Putln("v.%s = %s(get32(buf[%d:]))", name, typ, byt) - case 8: - c.Putln("v.%s = %s(get64(buf[%d:]))", name, typ, byt) - } - consumed = size - case "list": - c.Putln("IDK") - } - return byt + consumed -} - -/******************************************************************************/ -// Per element morphing. -// Below are functions that morph a single unit. -/******************************************************************************/ - -// Import morphing. -func (imp *Import) Morph(c *Context) { - c.Putln("// import \"%s\"", imp.Name) -} - -// Enum morphing. -func (enum *Enum) Morph(c *Context) { +// Enum types +func (enum *Enum) Define(c *Context) { c.Putln("const (") for _, item := range enum.Items { - c.Putln("%s%s = %d", enum.Name.Morph(c), item.Name.Morph(c), - item.Expr.Eval()) + c.Putln("%s%s = %d", enum.SrcName(), item.srcName, item.Expr.Eval()) } - c.Putln(")\n") -} - -// Xid morphing. -func (xid *Xid) Morph(c *Context) { - // Don't emit anything for xid types for now. - // We're going to force them all to simply be 'Id' - // to avoid excessive type converting. - // c.Putln("type %s Id", xid.Name.Morph(c)) -} - -// TypeDef morphing. -func (typedef *TypeDef) Morph(c *Context) { - c.Putln("type %s %s", typedef.New.Morph(c), typedef.Old.Morph(c)) -} - -// Struct morphing. -func (strct *Struct) Morph(c *Context) { - c.Putln("type %s struct {", strct.Name.Morph(c)) - strct.Fields.MorphDefine(c) - c.Putln("}") - c.Putln("\n") -} - -// Union morphing. -func (union *Union) Morph(c *Context) { - c.Putln("type %s struct {", union.Name.Morph(c)) - union.Fields.MorphDefine(c) - c.Putln("}") - c.Putln("\n") -} - -// Request morphing. -func (request *Request) Morph(c *Context) { -} - -// Event morphing. -func (ev *Event) Morph(c *Context) { - name := ev.Name.Morph(c) - - c.Putln("const %s = %d", name, ev.Number) + c.Putln(")") c.Putln("") - c.Putln("type %sEvent struct {", name) - ev.Fields.MorphDefine(c) +} + +// Resource types +func (res *Resource) Define(c *Context) { + c.Putln("// Skipping resource definition of '%s'", SrcName(res.XmlName())) + c.Putln("") +} + +// TypeDef types +func (td *TypeDef) Define(c *Context) { + c.Putln("type %s %s", td.srcName, td.Old.SrcName()) + c.Putln("") +} + +// Struct types +func (s *Struct) Define(c *Context) { + c.Putln("// '%s' struct definition", s.SrcName()) + c.Putln("// Size: %s", s.Size()) + c.Putln("type %s struct {", s.SrcName()) + for _, field := range s.Fields { + field.Define(c) + } c.Putln("}") c.Putln("") - c.Putln("func New%s(buf []byte) %sEvent {", name, name) - c.Putln("var v %sEvent", name) - ev.Fields.MorphRead(c, FieldsEvent, ev.NoSequence, "v.", 1) - c.Putln("return v") + + // Write function that reads bytes and produces this struct. + s.Read(c) + + // Write function that reads a list of this structs. + s.ReadList(c) + + // Write function that writes bytes given this struct. + s.Write(c) + + // Write function that writes a list of this struct. + s.WriteList(c) +} + +// Read for a struct creates a function 'NewStructName' that takes a byte +// slice and produces TWO values: an instance of 'StructName' and the number +// of bytes read from the byte slice. +// 'NewStructName' should only be used to read raw reply data from the wire. +func (s *Struct) Read(c *Context) { + c.Putln("// Struct read %s", s.SrcName()) + c.Putln("func New%s(buf []byte) (%s, int) {", s.SrcName(), s.SrcName()) + + c.Putln("v := %s{}", s.SrcName()) + c.Putln("b := 0") + c.Putln("consumed := 0") + c.Putln("consumed = 0 + consumed // no-op") // dirty hack for a no-op + c.Putln("") + for _, field := range s.Fields { + field.Read(c) + } + c.Putln("return v, b") + c.Putln("}") c.Putln("") - c.Putln("func (err %sEvent) ImplementsEvent() { }", name) +} + +// ReadList for a struct creates a function 'ReadStructNameList' that takes +// a byte slice and a length and produces TWO values: an slice of StructName +// and the number of bytes read from the byte slice. +func (s *Struct) ReadList(c *Context) { + c.Putln("// Struct list read %s", s.SrcName()) + c.Putln("func Read%sList(buf []byte, length int) ([]%s, int) {", + s.SrcName(), s.SrcName()) + + c.Putln("v := make([]%s, length)", s.SrcName()) + c.Putln("b := 0") + c.Putln("consumed := 0") + c.Putln("consumed = 0 + consumed // no-op") // dirty hack for a no-op + c.Putln("for i := 0; i < length; i++ {") + c.Putln("v[i], consumed = New%s(buf[b:])", s.SrcName()) + c.Putln("b += consumed") + c.Putln("}") + + c.Putln("return v, pad(b)") + + c.Putln("}") c.Putln("") - c.Putln("func (ev %sEvent) Bytes() []byte {", name) - // ev.Fields.MorphWrite(c, FieldsEvent) +} + +func (s *Struct) Write(c *Context) { + c.Putln("// Struct write %s", s.SrcName()) + c.Putln("") +} + +func (s *Struct) WriteList(c *Context) { + c.Putln("// Write struct list %s", s.SrcName()) + c.Putln("") +} + +// Union types +func (u *Union) Define(c *Context) { + c.Putln("// Union definition %s", u.SrcName()) +} + +func (u *Union) Read(c *Context, prefix string) { + c.Putln("// Union read %s", u.SrcName()) +} + +func (u *Union) Write(c *Context, prefix string) { + c.Putln("// Union write %s", u.SrcName()) +} + +// Event types +func (e *Event) Define(c *Context) { + c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) +} + +func (e *Event) Read(c *Context, prefix string) { + c.Putln("// Event read %s", e.SrcName()) +} + +func (e *Event) Write(c *Context, prefix string) { + c.Putln("// Event write %s", e.SrcName()) +} + +// EventCopy types +func (e *EventCopy) Define(c *Context) { + c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number) + c.Putln("") + c.Putln("const %s = %d", e.SrcName(), e.Number) + c.Putln("") + c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType()) + c.Putln("") + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) + c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) + c.Putln("}") + c.Putln("") + c.Putln("func (ev %s) ImplementsEvent() { }", e.EvType()) + c.Putln("") + c.Putln("func (ev %s) Bytes() []byte {", e.EvType()) + c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", ev.Number, name) + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) c.Putln("}") c.Putln("") } -// EventCopy morphing. -func (evcopy *EventCopy) Morph(c *Context) { - oldName, newName := evcopy.Ref.Morph(c), evcopy.Name.Morph(c) +// Error types +func (e *Error) Define(c *Context) { + c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) + c.Putln("") +} - c.Putln("const %s = %d", newName, evcopy.Number) +func (e *Error) Read(c *Context, prefix string) { + c.Putln("// Error read %s", e.SrcName()) +} + +func (e *Error) Write(c *Context, prefix string) { + c.Putln("// Error write %s", e.SrcName()) +} + +// ErrorCopy types +func (e *ErrorCopy) Define(c *Context) { + c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number) c.Putln("") - c.Putln("type %sEvent %sEvent", newName, oldName) + c.Putln("const %s = %d", e.ErrConst(), e.Number) c.Putln("") - c.Putln("func New%s(buf []byte) %sEvent {", newName, newName) - c.Putln("return (%sEvent)(New%s(buf))", newName, oldName) + c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType()) + c.Putln("") + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) + c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) c.Putln("}") c.Putln("") - c.Putln("func (err %sEvent) ImplementsEvent() { }", newName) + c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) c.Putln("") - c.Putln("func (ev %sEvent) Bytes() []byte {", newName) - c.Putln("return (%sEvent)(ev).Bytes()", oldName) + c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) + c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) c.Putln("}") c.Putln("") c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", evcopy.Number, newName) + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.SrcName()) c.Putln("}") c.Putln("") } -// Error morphing. -func (err *Error) Morph(c *Context) { +// Field definitions, reads and writes. + +// Pad fields +func (f *PadField) Define(c *Context) { + c.Putln("// padding: %d bytes", f.Bytes) } -// ErrorCopy morphing. -func (errcopy *ErrorCopy) Morph(c *Context) { - oldName, newName := errcopy.Ref.Morph(c), errcopy.Name.Morph(c) - - c.Putln("const Bad%s = %d", newName, errcopy.Number) - c.Putln("") - c.Putln("type %sError %sError", newName, oldName) - c.Putln("") - c.Putln("func New%sError(buf []byte) %sError {", newName, newName) - c.Putln("return (%sError)(New%sError(buf))", newName, oldName) - c.Putln("}") - c.Putln("") - c.Putln("func (err %sError) ImplementsError() { }", newName) - c.Putln("") - c.Putln("func (err %sError) Bytes() []byte {", newName) - c.Putln("return (%sError)(err).Bytes()", oldName) - c.Putln("}") - c.Putln("") - c.Putln("func init() {") - c.Putln("newErrorFuncs[%d] = New%sError", errcopy.Number, newName) - c.Putln("}") +func (f *PadField) Read(c *Context) { + c.Putln("b += %s // padding", f.Size()) c.Putln("") } -/******************************************************************************/ -// Collection morphing. -// Below are functions that morph a collections of units. -// Most of these can probably remain unchanged, but they are useful if you -// need to group all of some "unit" in a single block or something. -/******************************************************************************/ -func (imports Imports) Morph(c *Context) { - if len(imports) == 0 { - return +// Single fields +func (f *SingleField) Define(c *Context) { + c.Putln("%s %s", f.SrcName(), f.Type.SrcName()) +} + +func ReadSimpleSingleField(c *Context, name string, typ Type) { + switch t := typ.(type) { + case *Resource: + c.Putln("%s = get32(buf[b:])", name) + case *TypeDef: + switch t.Size().Eval() { + case 1: + c.Putln("%s = %s(buf[b])", name, t.SrcName()) + case 2: + c.Putln("%s = %s(get16(buf[b:]))", name, t.SrcName()) + case 4: + c.Putln("%s = %s(get32(buf[b:]))", name, t.SrcName()) + case 8: + c.Putln("%s = %s(get64(buf[b:]))", name, t.SrcName()) + } + case *Base: + var val string + switch t.Size().Eval() { + case 1: + val = fmt.Sprintf("buf[b]") + case 2: + val = fmt.Sprintf("get16(buf[b:])") + case 4: + val = fmt.Sprintf("get32(buf[b:])") + case 8: + val = fmt.Sprintf("get64(buf[b:])") + } + + // We need to convert base types if they aren't uintXX or byte + ty := t.SrcName() + if ty != "byte" && ty != "uint16" && ty != "uint32" && ty != "uint64" { + val = fmt.Sprintf("%s(%s)", ty, val) + } + c.Putln("%s = %s", name, val) + default: + log.Fatalf("Cannot read field '%s' as a simple field with %T type.", + name, typ) } - c.Putln("// Imports are not required for XGB since everything is in") - c.Putln("// a single package. Still these may be useful for ") - c.Putln("// reference purposes.") - for _, imp := range imports { - imp.Morph(c) + c.Putln("b += %s", typ.Size()) +} + +func (f *SingleField) Read(c *Context) { + switch t := f.Type.(type) { + case *Resource: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *TypeDef: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Base: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Struct: + c.Putln("v.%s, consumed = New%s(buf[b:])", f.SrcName(), t.SrcName()) + c.Putln("b += consumed") + c.Putln("") + default: + log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) } } -func (enums Enums) Morph(c *Context) { - c.Putln("// Enums\n") - for _, enum := range enums { - enum.Morph(c) +// List fields +func (f *ListField) Define(c *Context) { + c.Putln("%s []%s // length: %s", + f.SrcName(), f.Type.SrcName(), f.Size()) +} + +func (f *ListField) Read(c *Context) { + switch t := f.Type.(type) { + case *Resource: + length := f.LengthExpr.Reduce("v.", "") + c.Putln("v.%s = make([]Id, %s)", f.SrcName(), length) + c.Putln("for i := 0; i < %s; i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("") + case *Base: + length := f.LengthExpr.Reduce("v.", "") + c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), length) + c.Putln("for i := 0; i < %s; i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("") + case *Struct: + c.Putln("v.%s, consumed = Read%sList(buf[b:], %s)", + f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) + c.Putln("b += consumed") + c.Putln("") + default: + log.Fatalf("Cannot read list field '%s' with %T type.", + f.XmlName(), f.Type) } } -func (xids Xids) Morph(c *Context) { - c.Putln("// Xids\n") - for _, xid := range xids { - xid.Morph(c) - } +// Local fields +func (f *LocalField) Define(c *Context) { + c.Putln("// local field: %s %s", f.SrcName(), f.Type.SrcName()) } -func (typedefs TypeDefs) Morph(c *Context) { - c.Putln("// TypeDefs\n") - for _, typedef := range typedefs { - typedef.Morph(c) - } +func (f *LocalField) Read(c *Context) { + c.Putln("// reading local field: %s (%s) :: %s", + f.SrcName(), f.Size(), f.Type.SrcName()) } -func (strct Structs) Morph(c *Context) { - c.Putln("// Structs\n") - for _, typedef := range strct { - typedef.Morph(c) - } +// Expr fields +func (f *ExprField) Define(c *Context) { + c.Putln("// expression field: %s %s (%s)", + f.SrcName(), f.Type.SrcName(), f.Expr) } -func (union Unions) Morph(c *Context) { - c.Putln("// Unions\n") - for _, typedef := range union { - typedef.Morph(c) - } +func (f *ExprField) Read(c *Context) { + c.Putln("// reading expression field: %s (%s) (%s) :: %s", + f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) } -func (request Requests) Morph(c *Context) { - c.Putln("// Requests\n") - for _, typedef := range request { - typedef.Morph(c) - } +// Value field +func (f *ValueField) Define(c *Context) { + c.Putln("// valueparam field: type: %s, mask name: %s, list name: %s", + f.MaskType.SrcName(), f.MaskName, f.ListName) } -func (event Events) Morph(c *Context) { - c.Putln("// Events\n") - for _, typedef := range event { - typedef.Morph(c) - } +func (f *ValueField) Read(c *Context) { + c.Putln("// reading valueparam: type: %s, mask name: %s, list name: %s", + f.MaskType.SrcName(), f.MaskName, f.ListName) } -func (evcopy EventCopies) Morph(c *Context) { - c.Putln("// Event Copies\n") - for _, typedef := range evcopy { - typedef.Morph(c) - } +// Switch field +func (f *SwitchField) Define(c *Context) { + c.Putln("// switch field: %s (%s)", f.Name, f.Expr) } -func (err Errors) Morph(c *Context) { - c.Putln("// Errors\n") - for _, typedef := range err { - typedef.Morph(c) - } -} - -func (errcopy ErrorCopies) Morph(c *Context) { - c.Putln("// Error copies\n") - for _, typedef := range errcopy { - typedef.Morph(c) - } +func (f *SwitchField) Read(c *Context) { + c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) } diff --git a/nexgb/xgbgen/main.go b/nexgb/xgbgen/main.go index c69c8aa..33f7971 100644 --- a/nexgb/xgbgen/main.go +++ b/nexgb/xgbgen/main.go @@ -47,7 +47,7 @@ func main() { // Initialize the buffer, parse it, and filter it through gofmt. c := newContext() - c.Translate(xmlBytes) + c.Morph(xmlBytes) if !*gofmt { c.out.WriteTo(os.Stdout) diff --git a/nexgb/xgbgen/morph.go b/nexgb/xgbgen/morph.go new file mode 100644 index 0000000..c39b333 --- /dev/null +++ b/nexgb/xgbgen/morph.go @@ -0,0 +1,50 @@ + +// Morph cascades down all of the XML and calls each type's corresponding +// Morph function with itself as an argument (the context). +func (x *XML) Morph(c *Context) { + // Start the header... + c.Putln("package xgb") + c.Putln("/*") + c.Putln("\tX protocol API for '%s.xml'.", c.xml.Header) + c.Putln("\tThis file is automatically generated. Edit at your own peril!") + c.Putln("\tGenerated on %s", + time.Now().Format("Jan 2, 2006 at 3:04:05pm MST")) + c.Putln("*/") + c.Putln("") + + x.Imports.Morph(c) + c.Putln("") + + x.Enums.Morph(c) + c.Putln("") + + x.Xids.Morph(c) + c.Putln("") + + x.XidUnions.Morph(c) + c.Putln("") + + x.TypeDefs.Morph(c) + c.Putln("") + + x.Structs.Morph(c) + c.Putln("") + + x.Unions.Morph(c) + c.Putln("") + + x.Requests.Morph(c) + c.Putln("") + + x.Errors.Morph(c) + c.Putln("") + + x.ErrorCopies.Morph(c) + c.Putln("") + + x.Events.Morph(c) + c.Putln("") + + x.EventCopies.Morph(c) + c.Putln("") +} diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go new file mode 100644 index 0000000..928e219 --- /dev/null +++ b/nexgb/xgbgen/representation.go @@ -0,0 +1,56 @@ +package main + +type Protocol struct { + Name string + ExtXName string + ExtName string + MajorVersion string + MinorVersion string + + Imports []*Protocol + Types []Type + Requests []*Request +} + +// Initialize traverses all structures, looks for 'Translation' type, +// and looks up the real type in the namespace. It also sets the source +// name for all relevant fields/structures. +// This is necessary because we don't traverse the XML in order initially. +func (p *Protocol) Initialize() { + for _, typ := range p.Types { + typ.Initialize(p) + } + for _, req := range p.Requests { + req.Initialize(p) + } +} + +type Request struct { + srcName string + xmlName string + Opcode int + Combine bool + Fields []Field + Reply *Reply +} + +func (r *Request) Initialize(p *Protocol) { + r.srcName = SrcName(r.xmlName) + if r.Reply != nil { + r.Reply.Initialize(p) + } + for _, field := range r.Fields { + field.Initialize(p) + } +} + +type Reply struct { + Fields []Field +} + +func (r *Reply) Initialize(p *Protocol) { + for _, field := range r.Fields { + field.Initialize(p) + } +} + diff --git a/nexgb/xgbgen/size.go b/nexgb/xgbgen/size.go new file mode 100644 index 0000000..d00e297 --- /dev/null +++ b/nexgb/xgbgen/size.go @@ -0,0 +1,22 @@ +package main + +type Size struct { + Expression +} + +func newFixedSize(fixed uint) Size { + return Size{&Value{v: fixed}} +} + +func newExpressionSize(variable Expression) Size { + return Size{variable} +} + +func (s1 Size) Add(s2 Size) Size { + return Size{newBinaryOp("+", s1, s2)} +} + +func (s1 Size) Multiply(s2 Size) Size { + return Size{newBinaryOp("*", s1, s2)} +} + diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go new file mode 100644 index 0000000..85e756d --- /dev/null +++ b/nexgb/xgbgen/translation.go @@ -0,0 +1,426 @@ +package main +/* + translation.go provides a 'Translate' method on every XML type that converts + the XML type into our "better" representation. + + i.e., the representation of Fields and Expressions is just too general. + We end up losing a lot of the advantages of static typing if we keep + the types that encoding/xml forces us into. + + Please see 'representation.go' for the type definitions that we're + translating to. +*/ + +import ( + "log" + "strconv" + "strings" +) + +func (xml *XML) Translate() *Protocol { + protocol := &Protocol{ + Name: xml.Header, + ExtXName: xml.ExtensionXName, + ExtName: xml.ExtensionName, + MajorVersion: xml.MajorVersion, + MinorVersion: xml.MinorVersion, + + Imports: make([]*Protocol, 0), + Types: make([]Type, 0), + Requests: make([]*Request, len(xml.Requests)), + } + + for _, imp := range xml.Imports { + if imp.xml != nil { + protocol.Imports = append(protocol.Imports, imp.xml.Translate()) + } + } + + for xmlName, srcName := range BaseTypeMap { + newBaseType := &Base{ + srcName: srcName, + xmlName: xmlName, + size: newFixedSize(BaseTypeSizes[xmlName]), + } + protocol.Types = append(protocol.Types, newBaseType) + } + for _, enum := range xml.Enums { + protocol.Types = append(protocol.Types, enum.Translate()) + } + for _, xid := range xml.Xids { + protocol.Types = append(protocol.Types, xid.Translate()) + } + for _, xidunion := range xml.XidUnions { + protocol.Types = append(protocol.Types, xidunion.Translate()) + } + for _, typedef := range xml.TypeDefs { + protocol.Types = append(protocol.Types, typedef.Translate()) + } + for _, s := range xml.Structs { + protocol.Types = append(protocol.Types, s.Translate()) + } + for _, union := range xml.Unions { + protocol.Types = append(protocol.Types, union.Translate()) + } + for _, ev := range xml.Events { + protocol.Types = append(protocol.Types, ev.Translate()) + } + for _, evcopy := range xml.EventCopies { + protocol.Types = append(protocol.Types, evcopy.Translate()) + } + for _, err := range xml.Errors { + protocol.Types = append(protocol.Types, err.Translate()) + } + for _, errcopy := range xml.ErrorCopies { + protocol.Types = append(protocol.Types, errcopy.Translate()) + } + + for i, request := range xml.Requests { + protocol.Requests[i] = request.Translate() + } + + // Now load all of the type and source name information. + protocol.Initialize() + + // Make sure all enums have concrete values. + for _, typ := range protocol.Types { + enum, ok := typ.(*Enum) + if !ok { + continue + } + nextValue := uint(0) + for _, item := range enum.Items { + if item.Expr == nil { + item.Expr = &Value{v: nextValue} + nextValue++ + } else { + nextValue = item.Expr.Eval() + 1 + } + } + } + + return protocol +} + +func (x *XMLEnum) Translate() *Enum { + enum := &Enum{ + xmlName: x.Name, + Items: make([]*EnumItem, len(x.Items)), + } + for i, item := range x.Items { + enum.Items[i] = &EnumItem{ + xmlName: item.Name, + Expr: item.Expr.Translate(), + } + } + return enum +} + +func (x *XMLXid) Translate() *Resource { + return &Resource{ + xmlName: x.Name, + } +} + +func (x *XMLTypeDef) Translate() *TypeDef { + return &TypeDef{ + xmlName: x.New, + Old: newTranslation(x.Old), + } +} + +func (x *XMLEvent) Translate() *Event { + ev := &Event{ + xmlName: x.Name, + Number: x.Number, + NoSequence: x.NoSequence, + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + ev.Fields[i] = field.Translate() + } + return ev +} + +func (x *XMLEventCopy) Translate() *EventCopy { + return &EventCopy{ + xmlName: x.Name, + Number: x.Number, + Old: newTranslation(x.Ref), + } +} + +func (x *XMLError) Translate() *Error { + err := &Error{ + xmlName: x.Name, + Number: x.Number, + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + err.Fields[i] = field.Translate() + } + return err +} + +func (x *XMLErrorCopy) Translate() *ErrorCopy { + return &ErrorCopy{ + xmlName: x.Name, + Number: x.Number, + Old: newTranslation(x.Ref), + } +} + +func (x *XMLStruct) Translate() *Struct { + s := &Struct{ + xmlName: x.Name, + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + s.Fields[i] = field.Translate() + } + return s +} + +func (x *XMLUnion) Translate() *Union { + u := &Union{ + xmlName: x.Name, + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + u.Fields[i] = field.Translate() + } + return u +} + +func (x *XMLRequest) Translate() *Request { + r := &Request{ + xmlName: x.Name, + Opcode: x.Opcode, + Combine: x.Combine, + Fields: make([]Field, len(x.Fields)), + Reply: x.Reply.Translate(), + } + for i, field := range x.Fields { + r.Fields[i] = field.Translate() + } + + // Address bug (or legacy code) in QueryTextExtents. + // The XML protocol description references 'string_len' in the + // computation of the 'odd_length' field. However, 'string_len' is not + // defined. Therefore, let's forcefully add it as a 'local field'. + // (i.e., a parameter in the caller but does not get send over the wire.) + stringLenLocal := &LocalField{&SingleField{ + xmlName: "string_len", + Type: newTranslation("CARD16"), + }} + r.Fields = append(r.Fields, stringLenLocal) + + return r +} + +func (x *XMLReply) Translate() *Reply { + if x == nil { + return nil + } + + r := &Reply{ + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + r.Fields[i] = field.Translate() + } + return r +} + +func (x *XMLExpression) Translate() Expression { + if x == nil { + return nil + } + + switch x.XMLName.Local { + case "op": + if len(x.Exprs) != 2 { + log.Panicf("'op' found %d expressions; expected 2.", len(x.Exprs)) + } + return &BinaryOp{ + Op: x.Op, + Expr1: x.Exprs[0].Translate(), + Expr2: x.Exprs[1].Translate(), + } + case "unop": + if len(x.Exprs) != 1 { + log.Panicf("'unop' found %d expressions; expected 1.", len(x.Exprs)) + } + return &UnaryOp{ + Op: x.Op, + Expr: x.Exprs[0].Translate(), + } + case "popcount": + if len(x.Exprs) != 1 { + log.Panicf("'popcount' found %d expressions; expected 1.", + len(x.Exprs)) + } + return &PopCount{ + Expr: x.Exprs[0].Translate(), + } + case "value": + val, err := strconv.Atoi(x.Data) + if err != nil { + log.Panicf("Could not convert '%s' in 'value' expression to int.", + x.Data) + } + return &Value{ + v: uint(val), + } + case "bit": + bit, err := strconv.Atoi(x.Data) + if err != nil { + log.Panicf("Could not convert '%s' in 'bit' expression to int.", + x.Data) + } + if bit < 0 || bit > 31 { + log.Panicf("A 'bit' literal must be in the range [0, 31], but " + + " is %d", bit) + } + return &Bit{ + b: uint(bit), + } + case "fieldref": + return &FieldRef{ + Name: x.Data, + } + case "enumref": + return &EnumRef{ + EnumKind: newTranslation(x.Ref), + EnumItem: x.Data, + } + case "sumof": + return &SumOf{ + Name: x.Ref, + } + } + + log.Panicf("Unrecognized tag '%s' in expression context. Expected one of " + + "op, fieldref, value, bit, enumref, unop, sumof or popcount.", + x.XMLName.Local) + panic("unreachable") +} + +func (x *XMLField) Translate() Field { + switch x.XMLName.Local { + case "pad": + return &PadField{ + Bytes: x.Bytes, + } + case "field": + return &SingleField{ + xmlName: x.Name, + Type: newTranslation(x.Type), + } + case "list": + return &ListField{ + xmlName: x.Name, + Type: newTranslation(x.Type), + LengthExpr: x.Expr.Translate(), + } + case "localfield": + return &LocalField{&SingleField{ + xmlName: x.Name, + Type: newTranslation(x.Type), + }} + case "exprfield": + return &ExprField{ + xmlName: x.Name, + Type: newTranslation(x.Type), + Expr: x.Expr.Translate(), + } + case "valueparam": + return &ValueField{ + MaskType: newTranslation(x.ValueMaskType), + MaskName: x.ValueMaskName, + ListName: x.ValueListName, + } + case "switch": + swtch := &SwitchField{ + Name: x.Name, + Expr: x.Expr.Translate(), + Bitcases: make([]*Bitcase, len(x.Bitcases)), + } + for i, bitcase := range x.Bitcases { + swtch.Bitcases[i] = bitcase.Translate() + } + return swtch + } + + log.Panicf("Unrecognized field element: %s", x.XMLName.Local) + panic("unreachable") +} + +func (x *XMLBitcase) Translate() *Bitcase { + b := &Bitcase{ + Expr: x.Expr().Translate(), + Fields: make([]Field, len(x.Fields)), + } + for i, field := range x.Fields { + b.Fields[i] = field.Translate() + } + return b +} + +// SrcName is used to translate any identifier into a Go name. +// Mostly used for fields, but used in a couple other places too (enum items). +func SrcName(name string) string { + // If it's in the name map, use that translation. + if newn, ok := NameMap[name]; ok { + return newn + } + + return splitAndTitle(name) +} + +func TypeSrcName(p *Protocol, typ Type) string { + t := typ.XmlName() + + // If this is a base type, then write the raw Go type. + if baseType, ok := typ.(*Base); ok { + return baseType.SrcName() + } + + // If it's in the type map, use that translation. + if newt, ok := TypeMap[t]; ok { + return newt + } + + // If it's a resource type, just use 'Id'. + if _, ok := typ.(*Resource); ok { + return xgbGenResourceIdName + } + + // If there's a namespace to this type, just use it and be done. + if colon := strings.Index(t, ":"); colon > -1 { + namespace := t[:colon] + rest := t[colon+1:] + return splitAndTitle(namespace) + splitAndTitle(rest) + } + + // Since there is no namespace, we need to look for a namespace + // in the current context. + niceType := splitAndTitle(t) + if p.Name != "xproto" { + for _, typ2 := range p.Types { + if t == typ2.XmlName() { + return strings.Title(p.Name) + niceType + } + } + for _, imp := range p.Imports { + for _, typ2 := range imp.Types { + if t == typ2.XmlName() { + return strings.Title(imp.Name) + niceType + } + } + } + } + + // We couldn't find one, so return it without a prefix. + return niceType +} diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go new file mode 100644 index 0000000..1574922 --- /dev/null +++ b/nexgb/xgbgen/type.go @@ -0,0 +1,365 @@ +package main + +import ( + "fmt" + "strings" +) + +type Type interface { + Initialize(p *Protocol) + SrcName() string + XmlName() string + Size() Size + + Define(c *Context) +} + +// Translation is used *only* when transitioning from XML types to +// our better representation. They are placeholders for the real types (below) +// that will replace them. +type Translation struct { + xmlName string +} + +func newTranslation(name string) *Translation { + return &Translation{xmlName: name} +} + +// RealType takes 'XmlName' and finds its real concrete type in our Protocol. +// It is an error if we can't find such a type. +func (t *Translation) RealType(p *Protocol) Type { + // Check to see if there is a namespace. If so, strip it and use it to + // make sure we only look for a type in that protocol. + namespace, typeName := "", t.XmlName() + if ni := strings.Index(t.XmlName(), ":"); ni > -1 { + namespace, typeName = strings.ToLower(typeName[:ni]), typeName[ni+1:] + } + + if len(namespace) == 0 || namespace == strings.ToLower(p.Name) { + for _, typ := range p.Types { + if typeName == typ.XmlName() { + return typ + } + } + } + for _, imp := range p.Imports { + if len(namespace) == 0 || namespace == strings.ToLower(imp.Name) { + for _, typ := range imp.Types { + if typeName == typ.XmlName() { + return typ + } + } + } + } + panic("Could not find real type for translation type: " + t.XmlName()) +} + +func (t *Translation) SrcName() string { + panic("it is illegal to call SrcName on a translation type") +} + +func (t *Translation) XmlName() string { + return t.xmlName +} + +func (t *Translation) Size() Size { + panic("it is illegal to call Size on a translation type") +} + +func (t *Translation) Define(c *Context) { + panic("it is illegal to call Define on a translation type") +} + +func (t *Translation) Initialize(p *Protocol) { + panic("it is illegal to call Initialize on a translation type") +} + +type Base struct { + srcName string + xmlName string + size Size +} + +func (b *Base) SrcName() string { + return b.srcName +} + +func (b *Base) XmlName() string { + return b.xmlName +} + +func (b *Base) Size() Size { + return b.size +} + +func (b *Base) Initialize(p *Protocol) { + b.srcName = TypeSrcName(p, b) +} + +type Enum struct { + srcName string + xmlName string + Items []*EnumItem +} + +type EnumItem struct { + srcName string + xmlName string + Expr Expression +} + +func (enum *Enum) SrcName() string { + return enum.srcName +} + +func (enum *Enum) XmlName() string { + return enum.xmlName +} + +func (enum *Enum) Size() Size { + panic("Cannot take size of enum") +} + +func (enum *Enum) Initialize(p *Protocol) { + enum.srcName = TypeSrcName(p, enum) + for _, item := range enum.Items { + item.srcName = SrcName(item.xmlName) + if item.Expr != nil { + item.Expr.Initialize(p) + } + } +} + +type Resource struct { + srcName string + xmlName string +} + +func (r *Resource) SrcName() string { + return r.srcName +} + +func (r *Resource) XmlName() string { + return r.xmlName +} + +func (r *Resource) Size() Size { + return newFixedSize(BaseTypeSizes["Id"]) +} + +func (r *Resource) Initialize(p *Protocol) { + r.srcName = TypeSrcName(p, r) +} + +type TypeDef struct { + srcName string + xmlName string + Old Type +} + +func (t *TypeDef) SrcName() string { + return t.srcName +} + +func (t *TypeDef) XmlName() string { + return t.xmlName +} + +func (t *TypeDef) Size() Size { + return t.Old.Size() +} + +func (t *TypeDef) Initialize(p *Protocol) { + t.Old = t.Old.(*Translation).RealType(p) + t.srcName = TypeSrcName(p, t) +} + +type Event struct { + srcName string + xmlName string + Number int + NoSequence bool + Fields []Field +} + +func (e *Event) SrcName() string { + return e.srcName +} + +func (e *Event) XmlName() string { + return e.xmlName +} + +func (e *Event) Size() Size { + panic("Cannot take size of Event type.") +} + +func (e *Event) Initialize(p *Protocol) { + e.srcName = TypeSrcName(p, e) + for _, field := range e.Fields { + field.Initialize(p) + } +} + +func (e *Event) EvType() string { + return fmt.Sprintf("%sEvent", e.srcName) +} + +type EventCopy struct { + srcName string + xmlName string + Old Type + Number int +} + +func (e *EventCopy) SrcName() string { + return e.srcName +} + +func (e *EventCopy) XmlName() string { + return e.xmlName +} + +func (e *EventCopy) Size() Size { + panic("Cannot take size of EventCopy type.") +} + +func (e *EventCopy) Initialize(p *Protocol) { + e.srcName = TypeSrcName(p, e) + e.Old = e.Old.(*Translation).RealType(p) + if _, ok := e.Old.(*Event); !ok { + panic("an EventCopy's old type *must* be *Event") + } +} + +func (e *EventCopy) EvType() string { + return fmt.Sprintf("%sEvent", e.srcName) +} + +type Error struct { + srcName string + xmlName string + Number int + Fields []Field +} + +func (e *Error) SrcName() string { + return e.srcName +} + +func (e *Error) XmlName() string { + return e.xmlName +} + +func (e *Error) Size() Size { + panic("Cannot take size of Error type.") +} + +func (e *Error) Initialize(p *Protocol) { + e.srcName = TypeSrcName(p, e) +} + +func (e *Error) ErrConst() string { + return fmt.Sprintf("Bad%s", e.srcName) +} + +func (e *Error) ErrType() string { + return fmt.Sprintf("%sError", e.srcName) +} + +type ErrorCopy struct { + srcName string + xmlName string + Old Type + Number int +} + +func (e *ErrorCopy) SrcName() string { + return e.srcName +} + +func (e *ErrorCopy) XmlName() string { + return e.xmlName +} + +func (e *ErrorCopy) Size() Size { + panic("Cannot take size of ErrorCopy type.") +} + +func (e *ErrorCopy) Initialize(p *Protocol) { + e.srcName = TypeSrcName(p, e) + e.Old = e.Old.(*Translation).RealType(p) + if _, ok := e.Old.(*Error); !ok { + panic("an ErrorCopy's old type *must* be *Event") + } +} + +func (e *ErrorCopy) ErrConst() string { + return fmt.Sprintf("Bad%s", e.srcName) +} + +func (e *ErrorCopy) ErrType() string { + return fmt.Sprintf("%sError", e.srcName) +} + +type Struct struct { + srcName string + xmlName string + Fields []Field +} + +func (s *Struct) SrcName() string { + return s.srcName +} + +func (s *Struct) XmlName() string { + return s.xmlName +} + +func (s *Struct) Size() Size { + size := newFixedSize(0) + for _, field := range s.Fields { + size = size.Add(field.Size()) + } + return size +} + +func (s *Struct) Initialize(p *Protocol) { + s.srcName = TypeSrcName(p, s) + for _, field := range s.Fields { + field.Initialize(p) + } +} + +type Union struct { + srcName string + xmlName string + Fields []Field +} + +func (u *Union) SrcName() string { + return u.srcName +} + +func (u *Union) XmlName() string { + return u.xmlName +} + +// Size for Union is broken. At least, it's broken for XKB. +// It *looks* like the protocol inherently relies on some amount of +// memory unsafety, since some members of unions in XKB are *variable* in +// length! The only thing I can come up with, maybe, is when a union has +// variable size, simply return the raw bytes. Then it's up to the user to +// pass those raw bytes into the appropriate New* constructor. GROSS! +// As of now, just pluck out the first field and return that size. This +// should work for union elements in randr.xml and xproto.xml. +func (u *Union) Size() Size { + return u.Fields[0].Size() +} + +func (u *Union) Initialize(p *Protocol) { + u.srcName = TypeSrcName(p, u) + for _, field := range u.Fields { + field.Initialize(p) + } +} diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index e4202d0..7e50831 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -4,7 +4,6 @@ import ( "encoding/xml" "io/ioutil" "log" - "time" ) type XML struct { @@ -18,231 +17,25 @@ type XML struct { // Types for all top-level elements. // First are the simple ones. - Imports Imports `xml:"import"` - Enums Enums `xml:"enum"` - Xids Xids `xml:"xidtype"` - XidUnions Xids `xml:"xidunion"` - TypeDefs TypeDefs `xml:"typedef"` - EventCopies EventCopies `xml:"eventcopy"` - ErrorCopies ErrorCopies `xml:"errorcopy"` + Imports XMLImports `xml:"import"` + Enums XMLEnums `xml:"enum"` + Xids XMLXids `xml:"xidtype"` + XidUnions XMLXids `xml:"xidunion"` + TypeDefs XMLTypeDefs `xml:"typedef"` + EventCopies XMLEventCopies `xml:"eventcopy"` + ErrorCopies XMLErrorCopies `xml:"errorcopy"` // Here are the complex ones, i.e., anything with "structure contents" - Structs Structs `xml:"struct"` - Unions Unions `xml:"union"` - Requests Requests `xml:"request"` - Events Events `xml:"event"` - Errors Errors `xml:"error"` + Structs XMLStructs `xml:"struct"` + Unions XMLUnions `xml:"union"` + Requests XMLRequests `xml:"request"` + Events XMLEvents `xml:"event"` + Errors XMLErrors `xml:"error"` } -// Morph cascades down all of the XML and calls each type's corresponding -// Morph function with itself as an argument (the context). -func (x *XML) Morph(c *Context) { - // Start the header... - c.Putln("package xgb") - c.Putln("/*") - c.Putln("\tX protocol API for '%s.xml'.", c.xml.Header) - c.Putln("\tThis file is automatically generated. Edit at your own peril!") - c.Putln("\tGenerated on %s", - time.Now().Format("Jan 2, 2006 at 3:04:05pm MST")) - c.Putln("*/") - c.Putln("") +type XMLImports []*XMLImport - x.Imports.Morph(c) - c.Putln("") - - x.Enums.Morph(c) - c.Putln("") - - x.Xids.Morph(c) - c.Putln("") - - x.XidUnions.Morph(c) - c.Putln("") - - x.TypeDefs.Morph(c) - c.Putln("") - - x.Structs.Morph(c) - c.Putln("") - - x.Unions.Morph(c) - c.Putln("") - - x.Requests.Morph(c) - c.Putln("") - - x.Errors.Morph(c) - c.Putln("") - - x.ErrorCopies.Morph(c) - c.Putln("") - - x.Events.Morph(c) - c.Putln("") - - x.EventCopies.Morph(c) - c.Putln("") -} - -// IsResource returns true if the 'needle' type is a resource type. -// i.e., an "xid" -func (x *XML) IsResource(needle Type) bool { - for _, xid := range x.Xids { - if needle == xid.Name { - return true - } - } - for _, xidunion := range x.XidUnions { - if needle == xidunion.Name { - return true - } - } - for _, imp := range x.Imports { - if imp.xml.IsResource(needle) { - return true - } - } - return false -} - -// HasType returns true if the 'needle' type can be found in the protocol -// description represented by 'x'. -func (x *XML) HasType(needle Type) bool { - for _, enum := range x.Enums { - if needle == enum.Name { - return true - } - } - for _, xid := range x.Xids { - if needle == xid.Name { - return true - } - } - for _, xidunion := range x.XidUnions { - if needle == xidunion.Name { - return true - } - } - for _, typedef := range x.TypeDefs { - if needle == typedef.New { - return true - } - } - for _, evcopy := range x.EventCopies { - if needle == evcopy.Name { - return true - } - } - for _, errcopy := range x.ErrorCopies { - if needle == errcopy.Name { - return true - } - } - for _, strct := range x.Structs { - if needle == strct.Name { - return true - } - } - for _, union := range x.Unions { - if needle == union.Name { - return true - } - } - for _, ev := range x.Events { - if needle == ev.Name { - return true - } - } - for _, err := range x.Errors { - if needle == err.Name { - return true - } - } - - return false -} - -type Name string - -type Type string - -// Union returns the 'Union' struct corresponding to this type, if -// one exists. -func (typ Type) Union(c *Context) *Union { - // If this is a typedef, use that instead. - if oldTyp, ok := typ.TypeDef(c); ok { - return oldTyp.Union(c) - } - - // Otherwise, just look for a union type with 'typ' name. - for _, union := range c.xml.Unions { - if typ == union.Name { - return union - } - } - for _, imp := range c.xml.Imports { - for _, union := range imp.xml.Unions { - if typ == union.Name { - return union - } - } - } - return nil -} - -// TypeDef returns the 'old' type corresponding to this type, if it's found -// in a type def. If not found, the second return value is false. -func (typ Type) TypeDef(c *Context) (Type, bool) { - for _, typedef := range c.xml.TypeDefs { - if typ == typedef.New { - return typedef.Old, true - } - } - for _, imp := range c.xml.Imports { - for _, typedef := range imp.xml.TypeDefs { - if typ == typedef.New { - return typedef.Old, true - } - } - } - return "", false -} - -// Size is a nifty function that takes any type and digs until it finds -// its underlying base type. At which point, the size can be determined. -func (typ Type) Size(c *Context) uint { - // If this is a base type, we're done. - if size, ok := BaseTypeSizes[string(typ)]; ok { - return size - } - - // If it's a resource, we're also done. - if c.xml.IsResource(typ) { - return BaseTypeSizes["Id"] - } - - // It's not, so that implies there is *some* typedef declaring it - // in terms of another type. Just follow that chain until we get to - // a base type. We also need to check imported stuff. - for _, typedef := range c.xml.TypeDefs { - if typ == typedef.New { - return typedef.Old.Size(c) - } - } - for _, imp := range c.xml.Imports { - for _, typedef := range imp.xml.TypeDefs { - if typ == typedef.New { - return typedef.Old.Size(c) - } - } - } - log.Panicf("Could not find base size of type '%s'.", typ) - panic("unreachable") -} - -type Imports []*Import - -func (imports Imports) Eval() { +func (imports XMLImports) Eval() { for _, imp := range imports { xmlBytes, err := ioutil.ReadFile(*protoPath + "/" + imp.Name + ".xml") if err != nil { @@ -256,117 +49,101 @@ func (imports Imports) Eval() { log.Fatal("Could not parse X protocol description for import " + "'%s' because: %s", imp.Name, err) } + + // recursive imports... + imp.xml.Imports.Eval() } } -type Import struct { +type XMLImport struct { Name string `xml:",chardata"` xml *XML `xml:"-"` } -type Enums []Enum +type XMLEnums []XMLEnum -// Eval on the list of all enum types goes through and forces every enum -// item to have a valid expression. -// This is necessary because when an item is empty, it is defined to have -// the value of "one more than that of the previous item, or 0 for the first -// item". -func (enums Enums) Eval() { - for _, enum := range enums { - nextValue := uint(0) - for _, item := range enum.Items { - if item.Expr == nil { - item.Expr = newValueExpression(nextValue) - nextValue++ - } else { - nextValue = item.Expr.Eval() + 1 - } - } - } +type XMLEnum struct { + Name string `xml:"name,attr"` + Items []*XMLEnumItem `xml:"item"` } -type Enum struct { - Name Type `xml:"name,attr"` - Items []*EnumItem `xml:"item"` +type XMLEnumItem struct { + Name string `xml:"name,attr"` + Expr *XMLExpression `xml:",any"` } -type EnumItem struct { - Name Name `xml:"name,attr"` - Expr *Expression `xml:",any"` -} +type XMLXids []*XMLXid -type Xids []*Xid - -type Xid struct { +type XMLXid struct { XMLName xml.Name - Name Type `xml:"name,attr"` + Name string `xml:"name,attr"` } -type TypeDefs []*TypeDef +type XMLTypeDefs []*XMLTypeDef -type TypeDef struct { - Old Type `xml:"oldname,attr"` - New Type `xml:"newname,attr"` +type XMLTypeDef struct { + Old string `xml:"oldname,attr"` + New string `xml:"newname,attr"` } -type EventCopies []*EventCopy +type XMLEventCopies []*XMLEventCopy -type EventCopy struct { - Name Type `xml:"name,attr"` +type XMLEventCopy struct { + Name string `xml:"name,attr"` Number int `xml:"number,attr"` - Ref Type `xml:"ref,attr"` + Ref string `xml:"ref,attr"` } -type ErrorCopies []*ErrorCopy +type XMLErrorCopies []*XMLErrorCopy -type ErrorCopy struct { - Name Type `xml:"name,attr"` +type XMLErrorCopy struct { + Name string `xml:"name,attr"` Number int `xml:"number,attr"` - Ref Type `xml:"ref,attr"` + Ref string `xml:"ref,attr"` } -type Structs []*Struct +type XMLStructs []*XMLStruct -type Struct struct { - Name Type `xml:"name,attr"` - Fields Fields `xml:",any"` +type XMLStruct struct { + Name string `xml:"name,attr"` + Fields XMLFields `xml:",any"` } -type Unions []*Union +type XMLUnions []*XMLUnion -type Union struct { - Name Type `xml:"name,attr"` - Fields Fields `xml:",any"` +type XMLUnion struct { + Name string `xml:"name,attr"` + Fields XMLFields `xml:",any"` } -type Requests []*Request +type XMLRequests []*XMLRequest -type Request struct { - Name Type `xml:"name,attr"` +type XMLRequest struct { + Name string `xml:"name,attr"` Opcode int `xml:"opcode,attr"` Combine bool `xml:"combine-adjacent,attr"` - Fields Fields `xml:",any"` - Reply *Reply `xml:"reply"` + Fields XMLFields `xml:",any"` + Reply *XMLReply `xml:"reply"` } -type Reply struct { - Fields Fields `xml:",any"` +type XMLReply struct { + Fields XMLFields `xml:",any"` } -type Events []*Event +type XMLEvents []*XMLEvent -type Event struct { - Name Type `xml:"name,attr"` +type XMLEvent struct { + Name string `xml:"name,attr"` Number int `xml:"number,attr"` NoSequence bool `xml:"no-sequence-number,true"` - Fields Fields `xml:",any"` + Fields XMLFields `xml:",any"` } -type Errors []*Error +type XMLErrors []*XMLError -type Error struct { - Name Type `xml:"name,attr"` +type XMLError struct { + Name string `xml:"name,attr"` Number int `xml:"number,attr"` - Fields Fields `xml:",any"` + Fields XMLFields `xml:",any"` } diff --git a/nexgb/xgbgen/xml_expression.go b/nexgb/xgbgen/xml_expression.go index dd32512..57ff62e 100644 --- a/nexgb/xgbgen/xml_expression.go +++ b/nexgb/xgbgen/xml_expression.go @@ -7,25 +7,25 @@ import ( "strconv" ) -type Expression struct { +type XMLExpression struct { XMLName xml.Name - Exprs []*Expression `xml:",any"` + Exprs []*XMLExpression `xml:",any"` Data string `xml:",chardata"` Op string `xml:"op,attr"` Ref string `xml:"ref,attr"` } -func newValueExpression(v uint) *Expression { - return &Expression{ +func newValueExpression(v uint) *XMLExpression { + return &XMLExpression{ XMLName: xml.Name{Local: "value"}, Data: fmt.Sprintf("%d", v), } } // String is for debugging. For actual use, please use 'Morph'. -func (e *Expression) String() string { +func (e *XMLExpression) String() string { switch e.XMLName.Local { case "op": return fmt.Sprintf("(%s %s %s)", e.Exprs[0], e.Op, e.Exprs[1]) @@ -55,7 +55,7 @@ func (e *Expression) String() string { // empty items in enums. // We can't compute a concrete value for expressions that rely on a context, // i.e., some field value. -func (e *Expression) Eval() uint { +func (e *XMLExpression) Eval() uint { switch e.XMLName.Local { case "op": if len(e.Exprs) != 2 { @@ -108,7 +108,7 @@ func (e *Expression) Eval() uint { panic("unreachable") } -func (e *Expression) BinaryOp(operand1, operand2 *Expression) *Expression { +func (e *XMLExpression) BinaryOp(oprnd1, oprnd2 *XMLExpression) *XMLExpression { if e.XMLName.Local != "op" { log.Panicf("Cannot perform binary operation on non-op expression: %s", e.XMLName.Local) @@ -121,17 +121,17 @@ func (e *Expression) BinaryOp(operand1, operand2 *Expression) *Expression { wrap := newValueExpression switch e.Op { case "+": - return wrap(operand1.Eval() + operand2.Eval()) + return wrap(oprnd1.Eval() + oprnd2.Eval()) case "-": - return wrap(operand1.Eval() + operand2.Eval()) + return wrap(oprnd1.Eval() + oprnd2.Eval()) case "*": - return wrap(operand1.Eval() * operand2.Eval()) + return wrap(oprnd1.Eval() * oprnd2.Eval()) case "/": - return wrap(operand1.Eval() / operand2.Eval()) + return wrap(oprnd1.Eval() / oprnd2.Eval()) case "&": - return wrap(operand1.Eval() & operand2.Eval()) + return wrap(oprnd1.Eval() & oprnd2.Eval()) case "<<": - return wrap(operand1.Eval() << operand2.Eval()) + return wrap(oprnd1.Eval() << oprnd2.Eval()) } log.Panicf("Invalid binary operator '%s' for '%s' expression.", @@ -139,7 +139,7 @@ func (e *Expression) BinaryOp(operand1, operand2 *Expression) *Expression { panic("unreachable") } -func (e *Expression) UnaryOp(operand *Expression) *Expression { +func (e *XMLExpression) UnaryOp(oprnd *XMLExpression) *XMLExpression { if e.XMLName.Local != "unop" { log.Panicf("Cannot perform unary operation on non-unop expression: %s", e.XMLName.Local) @@ -151,7 +151,7 @@ func (e *Expression) UnaryOp(operand *Expression) *Expression { switch e.Op { case "~": - return newValueExpression(^operand.Eval()) + return newValueExpression(^oprnd.Eval()) } log.Panicf("Invalid unary operator '%s' for '%s' expression.", diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go index c1a7240..d6d99c5 100644 --- a/nexgb/xgbgen/xml_fields.go +++ b/nexgb/xgbgen/xml_fields.go @@ -23,40 +23,40 @@ import ( "strings" ) -type Fields []*Field +type XMLFields []*XMLField -type Field struct { +type XMLField struct { XMLName xml.Name // For 'pad' element - Bytes int `xml:"bytes,attr"` + Bytes uint `xml:"bytes,attr"` // For 'field', 'list', 'localfield', 'exprfield' and 'switch' elements. - Name Name `xml:"name,attr"` + Name string `xml:"name,attr"` // For 'field', 'list', 'localfield', and 'exprfield' elements. - Type Type `xml:"type,attr"` + Type string `xml:"type,attr"` // For 'list', 'exprfield' and 'switch' elements. - Expr *Expression `xml:",any"` + Expr *XMLExpression `xml:",any"` // For 'valueparm' element. - ValueMaskType Type `xml:"value-mask-type,attr"` - ValueMaskName Name `xml:"value-mask-name,attr"` - ValueListName Name `xml:"value-list-name,attr"` + ValueMaskType string `xml:"value-mask-type,attr"` + ValueMaskName string `xml:"value-mask-name,attr"` + ValueListName string `xml:"value-list-name,attr"` // For 'switch' element. - Bitcases Bitcases `xml:"bitcase"` + Bitcases XMLBitcases `xml:"bitcase"` // I don't know which elements these are for. The documentation is vague. // They also seem to be completely optional. - OptEnum Type `xml:"enum,attr"` - OptMask Type `xml:"mask,attr"` - OptAltEnum Type `xml:"altenum,attr"` + OptEnum string `xml:"enum,attr"` + OptMask string `xml:"mask,attr"` + OptAltEnum string `xml:"altenum,attr"` } // String is for debugging purposes. -func (f *Field) String() string { +func (f *XMLField) String() string { switch f.XMLName.Local { case "pad": return fmt.Sprintf("pad (%d bytes)", f.Bytes) @@ -88,7 +88,7 @@ func (f *Field) String() string { panic("unreachable") } -type Bitcases []*Bitcase +type XMLBitcases []*XMLBitcase // Bitcase represents a single expression followed by any number of fields. // Namely, if the switch's expression (all bitcases are inside a switch), @@ -98,24 +98,24 @@ type Bitcases []*Bitcase // siblings, we must exhaustively search for one of them. Essentially, // it's the closest thing to a Union I can get to in Go without interfaces. // Would an '' tag have been too much to ask? :-( -type Bitcase struct { - Fields Fields `xml:",any"` +type XMLBitcase struct { + Fields XMLFields `xml:",any"` // All the different expressions. // When it comes time to choose one, use the 'Expr' method. - ExprOp *Expression `xml:"op"` - ExprUnOp *Expression `xml:"unop"` - ExprField *Expression `xml:"fieldref"` - ExprValue *Expression `xml:"value"` - ExprBit *Expression `xml:"bit"` - ExprEnum *Expression `xml:"enumref"` - ExprSum *Expression `xml:"sumof"` - ExprPop *Expression `xml:"popcount"` + ExprOp *XMLExpression `xml:"op"` + ExprUnOp *XMLExpression `xml:"unop"` + ExprField *XMLExpression `xml:"fieldref"` + ExprValue *XMLExpression `xml:"value"` + ExprBit *XMLExpression `xml:"bit"` + ExprEnum *XMLExpression `xml:"enumref"` + ExprSum *XMLExpression `xml:"sumof"` + ExprPop *XMLExpression `xml:"popcount"` } // StringPrefix is for debugging purposes only. // StringPrefix takes a string to prefix to every extra line for formatting. -func (b *Bitcase) StringPrefix(prefix string) string { +func (b *XMLBitcase) StringPrefix(prefix string) string { fields := make([]string, len(b.Fields)) for i, field := range b.Fields { fields[i] = fmt.Sprintf("%s%s", prefix, field) @@ -126,13 +126,13 @@ func (b *Bitcase) StringPrefix(prefix string) string { // Expr chooses the only non-nil Expr* field from Bitcase. // Panic if there is more than one non-nil expression. -func (b *Bitcase) Expr() *Expression { - choices := []*Expression{ +func (b *XMLBitcase) Expr() *XMLExpression { + choices := []*XMLExpression{ b.ExprOp, b.ExprUnOp, b.ExprField, b.ExprValue, b.ExprBit, b.ExprEnum, b.ExprSum, b.ExprPop, } - var choice *Expression = nil + var choice *XMLExpression = nil numNonNil := 0 for _, c := range choices { if c != nil { From 2a2d8653b3a7918dfb00dcca8937b0e878279c70 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 30 Apr 2012 02:44:31 -0400 Subject: [PATCH 05/90] gofmt --- nexgb/xgbgen/bufcount.go | 15 ------- nexgb/xgbgen/context.go | 4 +- nexgb/xgbgen/expression.go | 11 +++-- nexgb/xgbgen/field.go | 19 ++++---- nexgb/xgbgen/go.go | 57 ++++++++++++------------ nexgb/xgbgen/main.go | 1 - nexgb/xgbgen/morph.go | 50 --------------------- nexgb/xgbgen/representation.go | 17 ++++--- nexgb/xgbgen/size.go | 1 - nexgb/xgbgen/translation.go | 75 +++++++++++++++---------------- nexgb/xgbgen/type.go | 32 +++++++------- nexgb/xgbgen/xml.go | 81 +++++++++++++++++----------------- nexgb/xgbgen/xml_expression.go | 16 +++---- nexgb/xgbgen/xml_fields.go | 17 +++---- 14 files changed, 163 insertions(+), 233 deletions(-) delete mode 100644 nexgb/xgbgen/bufcount.go delete mode 100644 nexgb/xgbgen/morph.go diff --git a/nexgb/xgbgen/bufcount.go b/nexgb/xgbgen/bufcount.go deleted file mode 100644 index c3a5645..0000000 --- a/nexgb/xgbgen/bufcount.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -/* - A buffer count is a mechanism by which to keep track of which byte one - is reading or writing to/from the wire. - - It's an abstraction over the fact that while such a counter is usually - fixed, it can be made variable based on values at run-time. -*/ - -type BufCount struct { - Fixed int - Exprs []*Expression -} - diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index d3cbb81..67801c7 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -9,7 +9,7 @@ import ( type Context struct { protocol *Protocol - out *bytes.Buffer + out *bytes.Buffer } func newContext() *Context { @@ -20,7 +20,7 @@ func newContext() *Context { // Putln calls put and adds a new line to the end of 'format'. func (c *Context) Putln(format string, v ...interface{}) { - c.Put(format + "\n", v...) + c.Put(format+"\n", v...) } // Put is a short alias to write to 'out'. diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index a163692..7099c25 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -14,7 +14,7 @@ type Expression interface { } type BinaryOp struct { - Op string + Op string Expr1 Expression Expr2 Expression } @@ -23,7 +23,7 @@ func newBinaryOp(op string, expr1, expr2 Expression) Expression { switch { case expr1 != nil && expr2 != nil: return &BinaryOp{ - Op: op, + Op: op, Expr1: expr1, Expr2: expr2, } @@ -79,7 +79,7 @@ func (e *BinaryOp) Initialize(p *Protocol) { } type UnaryOp struct { - Op string + Op string Expr Expression } @@ -159,7 +159,7 @@ func (e *Value) String() string { return e.Reduce("", "") } -func (e *Value) Initialize(p *Protocol) { } +func (e *Value) Initialize(p *Protocol) {} type Bit struct { b uint @@ -181,7 +181,7 @@ func (e *Bit) String() string { return e.Reduce("", "") } -func (e *Bit) Initialize(p *Protocol) { } +func (e *Bit) Initialize(p *Protocol) {} type FieldRef struct { Name string @@ -273,4 +273,3 @@ func (e *SumOf) String() string { func (e *SumOf) Initialize(p *Protocol) { e.Name = SrcName(e.Name) } - diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index a659e6e..ed113e0 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -31,7 +31,7 @@ func (p *PadField) Size() Size { type SingleField struct { srcName string xmlName string - Type Type + Type Type } func (f *SingleField) Initialize(p *Protocol) { @@ -52,9 +52,9 @@ func (f *SingleField) Size() Size { } type ListField struct { - srcName string - xmlName string - Type Type + srcName string + xmlName string + Type Type LengthExpr Expression } @@ -85,8 +85,8 @@ type LocalField struct { type ExprField struct { srcName string xmlName string - Type Type - Expr Expression + Type Type + Expr Expression } func (f *ExprField) SrcName() string { @@ -132,8 +132,8 @@ func (f *ValueField) Initialize(p *Protocol) { } type SwitchField struct { - Name string - Expr Expression + Name string + Expr Expression Bitcases []*Bitcase } @@ -165,6 +165,5 @@ func (f *SwitchField) Initialize(p *Protocol) { type Bitcase struct { Fields []Field - Expr Expression + Expr Expression } - diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index ac3ed2c..014b76b 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -16,37 +16,37 @@ var xgbGenResourceIdName = "Id" // XML protocol description will produce an invalid Go program. // The types on the left *never* show themselves in the source. var BaseTypeMap = map[string]string{ - "CARD8": "byte", + "CARD8": "byte", "CARD16": "uint16", "CARD32": "uint32", - "INT8": "int8", - "INT16": "int16", - "INT32": "int32", - "BYTE": "byte", - "BOOL": "bool", - "float": "float64", + "INT8": "int8", + "INT16": "int16", + "INT32": "int32", + "BYTE": "byte", + "BOOL": "bool", + "float": "float64", "double": "float64", - "char": "byte", - "void": "byte", - "Id": "Id", + "char": "byte", + "void": "byte", + "Id": "Id", } // BaseTypeSizes should have precisely the same keys as in BaseTypeMap, // and the values should correspond to the size of the type in bytes. var BaseTypeSizes = map[string]uint{ - "CARD8": 1, + "CARD8": 1, "CARD16": 2, "CARD32": 4, - "INT8": 1, - "INT16": 2, - "INT32": 4, - "BYTE": 1, - "BOOL": 1, - "float": 4, + "INT8": 1, + "INT16": 2, + "INT32": 4, + "BYTE": 1, + "BOOL": 1, + "float": 4, "double": 8, - "char": 1, - "void": 1, - "Id": 4, + "char": 1, + "void": 1, + "Id": 4, } // TypeMap is a map from types in the XML to type names that is used @@ -54,13 +54,13 @@ var BaseTypeSizes = map[string]uint{ // type is replaced with the value type. var TypeMap = map[string]string{ "VISUALTYPE": "VisualInfo", - "DEPTH": "DepthInfo", - "SCREEN": "ScreenInfo", - "Setup": "SetupInfo", + "DEPTH": "DepthInfo", + "SCREEN": "ScreenInfo", + "Setup": "SetupInfo", } // NameMap is the same as TypeMap, but for names. -var NameMap = map[string]string{ } +var NameMap = map[string]string{} // Reading, writing and defining... @@ -151,8 +151,8 @@ func (s *Struct) ReadList(c *Context) { c.Putln("consumed := 0") c.Putln("consumed = 0 + consumed // no-op") // dirty hack for a no-op c.Putln("for i := 0; i < length; i++ {") - c.Putln("v[i], consumed = New%s(buf[b:])", s.SrcName()) - c.Putln("b += consumed") + c.Putln("v[i], consumed = New%s(buf[b:])", s.SrcName()) + c.Putln("b += consumed") c.Putln("}") c.Putln("return v, pad(b)") @@ -347,14 +347,14 @@ func (f *ListField) Read(c *Context) { length := f.LengthExpr.Reduce("v.", "") c.Putln("v.%s = make([]Id, %s)", f.SrcName(), length) c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) c.Putln("}") c.Putln("") case *Base: length := f.LengthExpr.Reduce("v.", "") c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), length) c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) c.Putln("}") c.Putln("") case *Struct: @@ -408,4 +408,3 @@ func (f *SwitchField) Define(c *Context) { func (f *SwitchField) Read(c *Context) { c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) } - diff --git a/nexgb/xgbgen/main.go b/nexgb/xgbgen/main.go index 33f7971..fd5eac7 100644 --- a/nexgb/xgbgen/main.go +++ b/nexgb/xgbgen/main.go @@ -62,4 +62,3 @@ func main() { } } } - diff --git a/nexgb/xgbgen/morph.go b/nexgb/xgbgen/morph.go deleted file mode 100644 index c39b333..0000000 --- a/nexgb/xgbgen/morph.go +++ /dev/null @@ -1,50 +0,0 @@ - -// Morph cascades down all of the XML and calls each type's corresponding -// Morph function with itself as an argument (the context). -func (x *XML) Morph(c *Context) { - // Start the header... - c.Putln("package xgb") - c.Putln("/*") - c.Putln("\tX protocol API for '%s.xml'.", c.xml.Header) - c.Putln("\tThis file is automatically generated. Edit at your own peril!") - c.Putln("\tGenerated on %s", - time.Now().Format("Jan 2, 2006 at 3:04:05pm MST")) - c.Putln("*/") - c.Putln("") - - x.Imports.Morph(c) - c.Putln("") - - x.Enums.Morph(c) - c.Putln("") - - x.Xids.Morph(c) - c.Putln("") - - x.XidUnions.Morph(c) - c.Putln("") - - x.TypeDefs.Morph(c) - c.Putln("") - - x.Structs.Morph(c) - c.Putln("") - - x.Unions.Morph(c) - c.Putln("") - - x.Requests.Morph(c) - c.Putln("") - - x.Errors.Morph(c) - c.Putln("") - - x.ErrorCopies.Morph(c) - c.Putln("") - - x.Events.Morph(c) - c.Putln("") - - x.EventCopies.Morph(c) - c.Putln("") -} diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go index 928e219..2d33a45 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/representation.go @@ -1,14 +1,14 @@ package main type Protocol struct { - Name string - ExtXName string - ExtName string + Name string + ExtXName string + ExtName string MajorVersion string MinorVersion string - Imports []*Protocol - Types []Type + Imports []*Protocol + Types []Type Requests []*Request } @@ -28,10 +28,10 @@ func (p *Protocol) Initialize() { type Request struct { srcName string xmlName string - Opcode int + Opcode int Combine bool - Fields []Field - Reply *Reply + Fields []Field + Reply *Reply } func (r *Request) Initialize(p *Protocol) { @@ -53,4 +53,3 @@ func (r *Reply) Initialize(p *Protocol) { field.Initialize(p) } } - diff --git a/nexgb/xgbgen/size.go b/nexgb/xgbgen/size.go index d00e297..70edb8f 100644 --- a/nexgb/xgbgen/size.go +++ b/nexgb/xgbgen/size.go @@ -19,4 +19,3 @@ func (s1 Size) Add(s2 Size) Size { func (s1 Size) Multiply(s2 Size) Size { return Size{newBinaryOp("*", s1, s2)} } - diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 85e756d..36daa8b 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -1,4 +1,5 @@ package main + /* translation.go provides a 'Translate' method on every XML type that converts the XML type into our "better" representation. @@ -19,14 +20,14 @@ import ( func (xml *XML) Translate() *Protocol { protocol := &Protocol{ - Name: xml.Header, - ExtXName: xml.ExtensionXName, - ExtName: xml.ExtensionName, + Name: xml.Header, + ExtXName: xml.ExtensionXName, + ExtName: xml.ExtensionName, MajorVersion: xml.MajorVersion, MinorVersion: xml.MinorVersion, - Imports: make([]*Protocol, 0), - Types: make([]Type, 0), + Imports: make([]*Protocol, 0), + Types: make([]Type, 0), Requests: make([]*Request, len(xml.Requests)), } @@ -40,7 +41,7 @@ func (xml *XML) Translate() *Protocol { newBaseType := &Base{ srcName: srcName, xmlName: xmlName, - size: newFixedSize(BaseTypeSizes[xmlName]), + size: newFixedSize(BaseTypeSizes[xmlName]), } protocol.Types = append(protocol.Types, newBaseType) } @@ -105,12 +106,12 @@ func (xml *XML) Translate() *Protocol { func (x *XMLEnum) Translate() *Enum { enum := &Enum{ xmlName: x.Name, - Items: make([]*EnumItem, len(x.Items)), + Items: make([]*EnumItem, len(x.Items)), } for i, item := range x.Items { enum.Items[i] = &EnumItem{ xmlName: item.Name, - Expr: item.Expr.Translate(), + Expr: item.Expr.Translate(), } } return enum @@ -125,16 +126,16 @@ func (x *XMLXid) Translate() *Resource { func (x *XMLTypeDef) Translate() *TypeDef { return &TypeDef{ xmlName: x.New, - Old: newTranslation(x.Old), + Old: newTranslation(x.Old), } } func (x *XMLEvent) Translate() *Event { ev := &Event{ - xmlName: x.Name, - Number: x.Number, + xmlName: x.Name, + Number: x.Number, NoSequence: x.NoSequence, - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { ev.Fields[i] = field.Translate() @@ -145,16 +146,16 @@ func (x *XMLEvent) Translate() *Event { func (x *XMLEventCopy) Translate() *EventCopy { return &EventCopy{ xmlName: x.Name, - Number: x.Number, - Old: newTranslation(x.Ref), + Number: x.Number, + Old: newTranslation(x.Ref), } } func (x *XMLError) Translate() *Error { err := &Error{ xmlName: x.Name, - Number: x.Number, - Fields: make([]Field, len(x.Fields)), + Number: x.Number, + Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { err.Fields[i] = field.Translate() @@ -165,15 +166,15 @@ func (x *XMLError) Translate() *Error { func (x *XMLErrorCopy) Translate() *ErrorCopy { return &ErrorCopy{ xmlName: x.Name, - Number: x.Number, - Old: newTranslation(x.Ref), + Number: x.Number, + Old: newTranslation(x.Ref), } } func (x *XMLStruct) Translate() *Struct { s := &Struct{ xmlName: x.Name, - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { s.Fields[i] = field.Translate() @@ -184,7 +185,7 @@ func (x *XMLStruct) Translate() *Struct { func (x *XMLUnion) Translate() *Union { u := &Union{ xmlName: x.Name, - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { u.Fields[i] = field.Translate() @@ -195,10 +196,10 @@ func (x *XMLUnion) Translate() *Union { func (x *XMLRequest) Translate() *Request { r := &Request{ xmlName: x.Name, - Opcode: x.Opcode, + Opcode: x.Opcode, Combine: x.Combine, - Fields: make([]Field, len(x.Fields)), - Reply: x.Reply.Translate(), + Fields: make([]Field, len(x.Fields)), + Reply: x.Reply.Translate(), } for i, field := range x.Fields { r.Fields[i] = field.Translate() @@ -211,7 +212,7 @@ func (x *XMLRequest) Translate() *Request { // (i.e., a parameter in the caller but does not get send over the wire.) stringLenLocal := &LocalField{&SingleField{ xmlName: "string_len", - Type: newTranslation("CARD16"), + Type: newTranslation("CARD16"), }} r.Fields = append(r.Fields, stringLenLocal) @@ -243,7 +244,7 @@ func (x *XMLExpression) Translate() Expression { log.Panicf("'op' found %d expressions; expected 2.", len(x.Exprs)) } return &BinaryOp{ - Op: x.Op, + Op: x.Op, Expr1: x.Exprs[0].Translate(), Expr2: x.Exprs[1].Translate(), } @@ -252,7 +253,7 @@ func (x *XMLExpression) Translate() Expression { log.Panicf("'unop' found %d expressions; expected 1.", len(x.Exprs)) } return &UnaryOp{ - Op: x.Op, + Op: x.Op, Expr: x.Exprs[0].Translate(), } case "popcount": @@ -279,7 +280,7 @@ func (x *XMLExpression) Translate() Expression { x.Data) } if bit < 0 || bit > 31 { - log.Panicf("A 'bit' literal must be in the range [0, 31], but " + + log.Panicf("A 'bit' literal must be in the range [0, 31], but "+ " is %d", bit) } return &Bit{ @@ -300,7 +301,7 @@ func (x *XMLExpression) Translate() Expression { } } - log.Panicf("Unrecognized tag '%s' in expression context. Expected one of " + + log.Panicf("Unrecognized tag '%s' in expression context. Expected one of "+ "op, fieldref, value, bit, enumref, unop, sumof or popcount.", x.XMLName.Local) panic("unreachable") @@ -315,24 +316,24 @@ func (x *XMLField) Translate() Field { case "field": return &SingleField{ xmlName: x.Name, - Type: newTranslation(x.Type), + Type: newTranslation(x.Type), } case "list": return &ListField{ - xmlName: x.Name, - Type: newTranslation(x.Type), + xmlName: x.Name, + Type: newTranslation(x.Type), LengthExpr: x.Expr.Translate(), } case "localfield": return &LocalField{&SingleField{ xmlName: x.Name, - Type: newTranslation(x.Type), + Type: newTranslation(x.Type), }} case "exprfield": return &ExprField{ xmlName: x.Name, - Type: newTranslation(x.Type), - Expr: x.Expr.Translate(), + Type: newTranslation(x.Type), + Expr: x.Expr.Translate(), } case "valueparam": return &ValueField{ @@ -342,8 +343,8 @@ func (x *XMLField) Translate() Field { } case "switch": swtch := &SwitchField{ - Name: x.Name, - Expr: x.Expr.Translate(), + Name: x.Name, + Expr: x.Expr.Translate(), Bitcases: make([]*Bitcase, len(x.Bitcases)), } for i, bitcase := range x.Bitcases { @@ -358,7 +359,7 @@ func (x *XMLField) Translate() Field { func (x *XMLBitcase) Translate() *Bitcase { b := &Bitcase{ - Expr: x.Expr().Translate(), + Expr: x.Expr().Translate(), Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index 1574922..9fbef65 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -77,7 +77,7 @@ func (t *Translation) Initialize(p *Protocol) { type Base struct { srcName string xmlName string - size Size + size Size } func (b *Base) SrcName() string { @@ -99,13 +99,13 @@ func (b *Base) Initialize(p *Protocol) { type Enum struct { srcName string xmlName string - Items []*EnumItem + Items []*EnumItem } type EnumItem struct { srcName string xmlName string - Expr Expression + Expr Expression } func (enum *Enum) SrcName() string { @@ -154,7 +154,7 @@ func (r *Resource) Initialize(p *Protocol) { type TypeDef struct { srcName string xmlName string - Old Type + Old Type } func (t *TypeDef) SrcName() string { @@ -175,11 +175,11 @@ func (t *TypeDef) Initialize(p *Protocol) { } type Event struct { - srcName string - xmlName string - Number int + srcName string + xmlName string + Number int NoSequence bool - Fields []Field + Fields []Field } func (e *Event) SrcName() string { @@ -208,8 +208,8 @@ func (e *Event) EvType() string { type EventCopy struct { srcName string xmlName string - Old Type - Number int + Old Type + Number int } func (e *EventCopy) SrcName() string { @@ -239,8 +239,8 @@ func (e *EventCopy) EvType() string { type Error struct { srcName string xmlName string - Number int - Fields []Field + Number int + Fields []Field } func (e *Error) SrcName() string { @@ -270,8 +270,8 @@ func (e *Error) ErrType() string { type ErrorCopy struct { srcName string xmlName string - Old Type - Number int + Old Type + Number int } func (e *ErrorCopy) SrcName() string { @@ -305,7 +305,7 @@ func (e *ErrorCopy) ErrType() string { type Struct struct { srcName string xmlName string - Fields []Field + Fields []Field } func (s *Struct) SrcName() string { @@ -334,7 +334,7 @@ func (s *Struct) Initialize(p *Protocol) { type Union struct { srcName string xmlName string - Fields []Field + Fields []Field } func (u *Union) SrcName() string { diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index 7e50831..f219c2d 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -8,29 +8,29 @@ import ( type XML struct { // Root 'xcb' element properties. - XMLName xml.Name `xml:"xcb"` - Header string `xml:"header,attr"` - ExtensionXName string `xml:"extension-xname,attr"` - ExtensionName string `xml:"extension-name,attr"` - MajorVersion string `xml:"major-version,attr"` - MinorVersion string `xml:"minor-version,attr"` + XMLName xml.Name `xml:"xcb"` + Header string `xml:"header,attr"` + ExtensionXName string `xml:"extension-xname,attr"` + ExtensionName string `xml:"extension-name,attr"` + MajorVersion string `xml:"major-version,attr"` + MinorVersion string `xml:"minor-version,attr"` // Types for all top-level elements. // First are the simple ones. - Imports XMLImports `xml:"import"` - Enums XMLEnums `xml:"enum"` - Xids XMLXids `xml:"xidtype"` - XidUnions XMLXids `xml:"xidunion"` - TypeDefs XMLTypeDefs `xml:"typedef"` + Imports XMLImports `xml:"import"` + Enums XMLEnums `xml:"enum"` + Xids XMLXids `xml:"xidtype"` + XidUnions XMLXids `xml:"xidunion"` + TypeDefs XMLTypeDefs `xml:"typedef"` EventCopies XMLEventCopies `xml:"eventcopy"` ErrorCopies XMLErrorCopies `xml:"errorcopy"` // Here are the complex ones, i.e., anything with "structure contents" - Structs XMLStructs `xml:"struct"` - Unions XMLUnions `xml:"union"` + Structs XMLStructs `xml:"struct"` + Unions XMLUnions `xml:"union"` Requests XMLRequests `xml:"request"` - Events XMLEvents `xml:"event"` - Errors XMLErrors `xml:"error"` + Events XMLEvents `xml:"event"` + Errors XMLErrors `xml:"error"` } type XMLImports []*XMLImport @@ -39,14 +39,14 @@ func (imports XMLImports) Eval() { for _, imp := range imports { xmlBytes, err := ioutil.ReadFile(*protoPath + "/" + imp.Name + ".xml") if err != nil { - log.Fatalf("Could not read X protocol description for import " + + log.Fatalf("Could not read X protocol description for import "+ "'%s' because: %s", imp.Name, err) } imp.xml = &XML{} err = xml.Unmarshal(xmlBytes, imp.xml) if err != nil { - log.Fatal("Could not parse X protocol description for import " + + log.Fatal("Could not parse X protocol description for import "+ "'%s' because: %s", imp.Name, err) } @@ -57,18 +57,18 @@ func (imports XMLImports) Eval() { type XMLImport struct { Name string `xml:",chardata"` - xml *XML `xml:"-"` + xml *XML `xml:"-"` } type XMLEnums []XMLEnum type XMLEnum struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Items []*XMLEnumItem `xml:"item"` } type XMLEnumItem struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Expr *XMLExpression `xml:",any"` } @@ -76,7 +76,7 @@ type XMLXids []*XMLXid type XMLXid struct { XMLName xml.Name - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` } type XMLTypeDefs []*XMLTypeDef @@ -89,41 +89,41 @@ type XMLTypeDef struct { type XMLEventCopies []*XMLEventCopy type XMLEventCopy struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` - Ref string `xml:"ref,attr"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` + Ref string `xml:"ref,attr"` } type XMLErrorCopies []*XMLErrorCopy type XMLErrorCopy struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` - Ref string `xml:"ref,attr"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` + Ref string `xml:"ref,attr"` } type XMLStructs []*XMLStruct type XMLStruct struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Fields XMLFields `xml:",any"` } type XMLUnions []*XMLUnion type XMLUnion struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Fields XMLFields `xml:",any"` } type XMLRequests []*XMLRequest type XMLRequest struct { - Name string `xml:"name,attr"` - Opcode int `xml:"opcode,attr"` - Combine bool `xml:"combine-adjacent,attr"` - Fields XMLFields `xml:",any"` - Reply *XMLReply `xml:"reply"` + Name string `xml:"name,attr"` + Opcode int `xml:"opcode,attr"` + Combine bool `xml:"combine-adjacent,attr"` + Fields XMLFields `xml:",any"` + Reply *XMLReply `xml:"reply"` } type XMLReply struct { @@ -133,17 +133,16 @@ type XMLReply struct { type XMLEvents []*XMLEvent type XMLEvent struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` - NoSequence bool `xml:"no-sequence-number,true"` - Fields XMLFields `xml:",any"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` + NoSequence bool `xml:"no-sequence-number,true"` + Fields XMLFields `xml:",any"` } type XMLErrors []*XMLError type XMLError struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` Fields XMLFields `xml:",any"` } - diff --git a/nexgb/xgbgen/xml_expression.go b/nexgb/xgbgen/xml_expression.go index 57ff62e..2989668 100644 --- a/nexgb/xgbgen/xml_expression.go +++ b/nexgb/xgbgen/xml_expression.go @@ -13,14 +13,14 @@ type XMLExpression struct { Exprs []*XMLExpression `xml:",any"` Data string `xml:",chardata"` - Op string `xml:"op,attr"` - Ref string `xml:"ref,attr"` + Op string `xml:"op,attr"` + Ref string `xml:"ref,attr"` } func newValueExpression(v uint) *XMLExpression { return &XMLExpression{ XMLName: xml.Name{Local: "value"}, - Data: fmt.Sprintf("%d", v), + Data: fmt.Sprintf("%d", v), } } @@ -87,22 +87,22 @@ func (e *XMLExpression) Eval() uint { e.Data) } if bit < 0 || bit > 31 { - log.Panicf("A 'bit' literal must be in the range [0, 31], but " + + log.Panicf("A 'bit' literal must be in the range [0, 31], but "+ " is %d", bit) } return 1 << uint(bit) case "fieldref": - log.Panicf("Cannot compute concrete value of 'fieldref' in " + + log.Panicf("Cannot compute concrete value of 'fieldref' in "+ "expression '%s'.", e) case "enumref": - log.Panicf("Cannot compute concrete value of 'enumref' in " + + log.Panicf("Cannot compute concrete value of 'enumref' in "+ "expression '%s'.", e) case "sumof": - log.Panicf("Cannot compute concrete value of 'sumof' in " + + log.Panicf("Cannot compute concrete value of 'sumof' in "+ "expression '%s'.", e) } - log.Panicf("Unrecognized tag '%s' in expression context. Expected one of " + + log.Panicf("Unrecognized tag '%s' in expression context. Expected one of "+ "op, fieldref, value, bit, enumref, unop, sumof or popcount.", e.XMLName.Local) panic("unreachable") diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go index d6d99c5..991141b 100644 --- a/nexgb/xgbgen/xml_fields.go +++ b/nexgb/xgbgen/xml_fields.go @@ -1,4 +1,5 @@ package main + /* A series of fields should be taken as "structure contents", and *not* just the single 'field' elements. Namely, 'fields' subsumes 'field' @@ -50,8 +51,8 @@ type XMLField struct { // I don't know which elements these are for. The documentation is vague. // They also seem to be completely optional. - OptEnum string `xml:"enum,attr"` - OptMask string `xml:"mask,attr"` + OptEnum string `xml:"enum,attr"` + OptMask string `xml:"mask,attr"` OptAltEnum string `xml:"altenum,attr"` } @@ -103,14 +104,14 @@ type XMLBitcase struct { // All the different expressions. // When it comes time to choose one, use the 'Expr' method. - ExprOp *XMLExpression `xml:"op"` - ExprUnOp *XMLExpression `xml:"unop"` + ExprOp *XMLExpression `xml:"op"` + ExprUnOp *XMLExpression `xml:"unop"` ExprField *XMLExpression `xml:"fieldref"` ExprValue *XMLExpression `xml:"value"` - ExprBit *XMLExpression `xml:"bit"` - ExprEnum *XMLExpression `xml:"enumref"` - ExprSum *XMLExpression `xml:"sumof"` - ExprPop *XMLExpression `xml:"popcount"` + ExprBit *XMLExpression `xml:"bit"` + ExprEnum *XMLExpression `xml:"enumref"` + ExprSum *XMLExpression `xml:"sumof"` + ExprPop *XMLExpression `xml:"popcount"` } // StringPrefix is for debugging purposes only. From 73154769b3eba60fe48a7c08882e8e64b1545e3f Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 30 Apr 2012 16:18:17 -0400 Subject: [PATCH 06/90] splitting up go specific code. too much for one file IMO. more progress. almost done with structs. --- nexgb/xgbgen/expression.go | 28 +++ nexgb/xgbgen/field.go | 31 +++- nexgb/xgbgen/go.go | 301 ++++---------------------------- nexgb/xgbgen/go_error.go | 39 +++++ nexgb/xgbgen/go_event.go | 38 ++++ nexgb/xgbgen/go_list.go | 75 ++++++++ nexgb/xgbgen/go_single_field.go | 138 +++++++++++++++ nexgb/xgbgen/go_struct.go | 107 ++++++++++++ nexgb/xgbgen/go_union.go | 15 ++ 9 files changed, 503 insertions(+), 269 deletions(-) create mode 100644 nexgb/xgbgen/go_error.go create mode 100644 nexgb/xgbgen/go_event.go create mode 100644 nexgb/xgbgen/go_list.go create mode 100644 nexgb/xgbgen/go_single_field.go create mode 100644 nexgb/xgbgen/go_struct.go create mode 100644 nexgb/xgbgen/go_union.go diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 7099c25..a975320 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -13,6 +13,34 @@ type Expression interface { Initialize(p *Protocol) } +// Function is a custom expression not found in the XML. It's simply used +// to apply a function named in 'Name' to the Expr expression. +type Function struct { + Name string + Expr Expression +} + +func (e *Function) Concrete() bool { + return false +} + +func (e *Function) Eval() uint { + log.Fatalf("Cannot evaluate a 'Function'. It is not concrete.") + panic("unreachable") +} + +func (e *Function) Reduce(prefix, fun string) string { + return fmt.Sprintf("%s(%s)", e.Name, e.Expr.Reduce(prefix, fun)) +} + +func (e *Function) String() string { + return e.Reduce("", "") +} + +func (e *Function) Initialize(p *Protocol) { + e.Expr.Initialize(p) +} + type BinaryOp struct { Op string Expr1 Expression diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index ed113e0..0f2323e 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -1,5 +1,10 @@ package main +import ( + "fmt" + "log" +) + type Field interface { Initialize(p *Protocol) SrcName() string @@ -8,6 +13,7 @@ type Field interface { Define(c *Context) Read(c *Context) + Write(c *Context) } func (pad *PadField) Initialize(p *Protocol) {} @@ -66,8 +72,31 @@ func (f *ListField) XmlName() string { return f.xmlName } +// func (f *ListField) Size() Size { + // return newExpressionSize(f.LengthExpr).Multiply(f.Type.Size()) +// } + func (f *ListField) Size() Size { - return newExpressionSize(f.LengthExpr).Multiply(f.Type.Size()) + simpleLen := &Function{ + Name: "pad", + Expr: newBinaryOp("*", f.LengthExpr, f.Type.Size().Expression), + } + + switch f.Type.(type) { + case *Struct: + sizeFun := &Function{ + Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), + Expr: &FieldRef{Name: f.SrcName()}, + } + return newExpressionSize(sizeFun) + case *Base: + return newExpressionSize(simpleLen) + case *Resource: + return newExpressionSize(simpleLen) + default: + log.Fatalf("Cannot compute list size with type '%T'.", f.Type) + } + panic("unreachable") } func (f *ListField) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index 014b76b..11e413b 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -1,10 +1,5 @@ package main -import ( - "fmt" - "log" -) - // xgbResourceIdName is the name of the type used for all resource identifiers. // As of right now, it needs to be declared somewhere manually. var xgbGenResourceIdName = "Id" @@ -92,173 +87,6 @@ func (td *TypeDef) Define(c *Context) { c.Putln("") } -// Struct types -func (s *Struct) Define(c *Context) { - c.Putln("// '%s' struct definition", s.SrcName()) - c.Putln("// Size: %s", s.Size()) - c.Putln("type %s struct {", s.SrcName()) - for _, field := range s.Fields { - field.Define(c) - } - c.Putln("}") - c.Putln("") - - // Write function that reads bytes and produces this struct. - s.Read(c) - - // Write function that reads a list of this structs. - s.ReadList(c) - - // Write function that writes bytes given this struct. - s.Write(c) - - // Write function that writes a list of this struct. - s.WriteList(c) -} - -// Read for a struct creates a function 'NewStructName' that takes a byte -// slice and produces TWO values: an instance of 'StructName' and the number -// of bytes read from the byte slice. -// 'NewStructName' should only be used to read raw reply data from the wire. -func (s *Struct) Read(c *Context) { - c.Putln("// Struct read %s", s.SrcName()) - c.Putln("func New%s(buf []byte) (%s, int) {", s.SrcName(), s.SrcName()) - - c.Putln("v := %s{}", s.SrcName()) - c.Putln("b := 0") - c.Putln("consumed := 0") - c.Putln("consumed = 0 + consumed // no-op") // dirty hack for a no-op - c.Putln("") - for _, field := range s.Fields { - field.Read(c) - } - c.Putln("return v, b") - - c.Putln("}") - c.Putln("") -} - -// ReadList for a struct creates a function 'ReadStructNameList' that takes -// a byte slice and a length and produces TWO values: an slice of StructName -// and the number of bytes read from the byte slice. -func (s *Struct) ReadList(c *Context) { - c.Putln("// Struct list read %s", s.SrcName()) - c.Putln("func Read%sList(buf []byte, length int) ([]%s, int) {", - s.SrcName(), s.SrcName()) - - c.Putln("v := make([]%s, length)", s.SrcName()) - c.Putln("b := 0") - c.Putln("consumed := 0") - c.Putln("consumed = 0 + consumed // no-op") // dirty hack for a no-op - c.Putln("for i := 0; i < length; i++ {") - c.Putln("v[i], consumed = New%s(buf[b:])", s.SrcName()) - c.Putln("b += consumed") - c.Putln("}") - - c.Putln("return v, pad(b)") - - c.Putln("}") - c.Putln("") -} - -func (s *Struct) Write(c *Context) { - c.Putln("// Struct write %s", s.SrcName()) - c.Putln("") -} - -func (s *Struct) WriteList(c *Context) { - c.Putln("// Write struct list %s", s.SrcName()) - c.Putln("") -} - -// Union types -func (u *Union) Define(c *Context) { - c.Putln("// Union definition %s", u.SrcName()) -} - -func (u *Union) Read(c *Context, prefix string) { - c.Putln("// Union read %s", u.SrcName()) -} - -func (u *Union) Write(c *Context, prefix string) { - c.Putln("// Union write %s", u.SrcName()) -} - -// Event types -func (e *Event) Define(c *Context) { - c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) -} - -func (e *Event) Read(c *Context, prefix string) { - c.Putln("// Event read %s", e.SrcName()) -} - -func (e *Event) Write(c *Context, prefix string) { - c.Putln("// Event write %s", e.SrcName()) -} - -// EventCopy types -func (e *EventCopy) Define(c *Context) { - c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number) - c.Putln("") - c.Putln("const %s = %d", e.SrcName(), e.Number) - c.Putln("") - c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType()) - c.Putln("") - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) - c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) - c.Putln("}") - c.Putln("") - c.Putln("func (ev %s) ImplementsEvent() { }", e.EvType()) - c.Putln("") - c.Putln("func (ev %s) Bytes() []byte {", e.EvType()) - c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) - c.Putln("}") - c.Putln("") - c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) - c.Putln("}") - c.Putln("") -} - -// Error types -func (e *Error) Define(c *Context) { - c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) - c.Putln("") -} - -func (e *Error) Read(c *Context, prefix string) { - c.Putln("// Error read %s", e.SrcName()) -} - -func (e *Error) Write(c *Context, prefix string) { - c.Putln("// Error write %s", e.SrcName()) -} - -// ErrorCopy types -func (e *ErrorCopy) Define(c *Context) { - c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number) - c.Putln("") - c.Putln("const %s = %d", e.ErrConst(), e.Number) - c.Putln("") - c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType()) - c.Putln("") - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) - c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) - c.Putln("}") - c.Putln("") - c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) - c.Putln("") - c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) - c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) - c.Putln("}") - c.Putln("") - c.Putln("func init() {") - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.SrcName()) - c.Putln("}") - c.Putln("") -} - // Field definitions, reads and writes. // Pad fields @@ -268,143 +96,80 @@ func (f *PadField) Define(c *Context) { func (f *PadField) Read(c *Context) { c.Putln("b += %s // padding", f.Size()) - c.Putln("") } -// Single fields -func (f *SingleField) Define(c *Context) { - c.Putln("%s %s", f.SrcName(), f.Type.SrcName()) -} - -func ReadSimpleSingleField(c *Context, name string, typ Type) { - switch t := typ.(type) { - case *Resource: - c.Putln("%s = get32(buf[b:])", name) - case *TypeDef: - switch t.Size().Eval() { - case 1: - c.Putln("%s = %s(buf[b])", name, t.SrcName()) - case 2: - c.Putln("%s = %s(get16(buf[b:]))", name, t.SrcName()) - case 4: - c.Putln("%s = %s(get32(buf[b:]))", name, t.SrcName()) - case 8: - c.Putln("%s = %s(get64(buf[b:]))", name, t.SrcName()) - } - case *Base: - var val string - switch t.Size().Eval() { - case 1: - val = fmt.Sprintf("buf[b]") - case 2: - val = fmt.Sprintf("get16(buf[b:])") - case 4: - val = fmt.Sprintf("get32(buf[b:])") - case 8: - val = fmt.Sprintf("get64(buf[b:])") - } - - // We need to convert base types if they aren't uintXX or byte - ty := t.SrcName() - if ty != "byte" && ty != "uint16" && ty != "uint32" && ty != "uint64" { - val = fmt.Sprintf("%s(%s)", ty, val) - } - c.Putln("%s = %s", name, val) - default: - log.Fatalf("Cannot read field '%s' as a simple field with %T type.", - name, typ) - } - - c.Putln("b += %s", typ.Size()) -} - -func (f *SingleField) Read(c *Context) { - switch t := f.Type.(type) { - case *Resource: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) - case *TypeDef: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) - case *Base: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) - case *Struct: - c.Putln("v.%s, consumed = New%s(buf[b:])", f.SrcName(), t.SrcName()) - c.Putln("b += consumed") - c.Putln("") - default: - log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) - } -} - -// List fields -func (f *ListField) Define(c *Context) { - c.Putln("%s []%s // length: %s", - f.SrcName(), f.Type.SrcName(), f.Size()) -} - -func (f *ListField) Read(c *Context) { - switch t := f.Type.(type) { - case *Resource: - length := f.LengthExpr.Reduce("v.", "") - c.Putln("v.%s = make([]Id, %s)", f.SrcName(), length) - c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) - c.Putln("}") - c.Putln("") - case *Base: - length := f.LengthExpr.Reduce("v.", "") - c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), length) - c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) - c.Putln("}") - c.Putln("") - case *Struct: - c.Putln("v.%s, consumed = Read%sList(buf[b:], %s)", - f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) - c.Putln("b += consumed") - c.Putln("") - default: - log.Fatalf("Cannot read list field '%s' with %T type.", - f.XmlName(), f.Type) - } +func (f *PadField) Write(c *Context) { + c.Putln("b += %s // padding", f.Size()) } // Local fields func (f *LocalField) Define(c *Context) { c.Putln("// local field: %s %s", f.SrcName(), f.Type.SrcName()) + panic("todo") } func (f *LocalField) Read(c *Context) { c.Putln("// reading local field: %s (%s) :: %s", f.SrcName(), f.Size(), f.Type.SrcName()) + panic("todo") +} + +func (f *LocalField) Write(c *Context) { + c.Putln("// writing local field: %s (%s) :: %s", + f.SrcName(), f.Size(), f.Type.SrcName()) + panic("todo") } // Expr fields func (f *ExprField) Define(c *Context) { c.Putln("// expression field: %s %s (%s)", f.SrcName(), f.Type.SrcName(), f.Expr) + panic("todo") } func (f *ExprField) Read(c *Context) { c.Putln("// reading expression field: %s (%s) (%s) :: %s", f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) + panic("todo") +} + +func (f *ExprField) Write(c *Context) { + c.Putln("// writing expression field: %s (%s) (%s) :: %s", + f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) + panic("todo") } // Value field func (f *ValueField) Define(c *Context) { c.Putln("// valueparam field: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) + panic("todo") } func (f *ValueField) Read(c *Context) { c.Putln("// reading valueparam: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) + panic("todo") +} + +func (f *ValueField) Write(c *Context) { + c.Putln("// writing valueparam: type: %s, mask name: %s, list name: %s", + f.MaskType.SrcName(), f.MaskName, f.ListName) + panic("todo") } // Switch field func (f *SwitchField) Define(c *Context) { c.Putln("// switch field: %s (%s)", f.Name, f.Expr) + panic("todo") } func (f *SwitchField) Read(c *Context) { c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) + panic("todo") +} + +func (f *SwitchField) Write(c *Context) { + c.Putln("// writing switch field: %s (%s)", f.Name, f.Expr) + panic("todo") } diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go new file mode 100644 index 0000000..0cb77cc --- /dev/null +++ b/nexgb/xgbgen/go_error.go @@ -0,0 +1,39 @@ +package main + +// Error types +func (e *Error) Define(c *Context) { + c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) + c.Putln("") +} + +func (e *Error) Read(c *Context, prefix string) { + c.Putln("// Error read %s", e.SrcName()) +} + +func (e *Error) Write(c *Context, prefix string) { + c.Putln("// Error write %s", e.SrcName()) +} + +// ErrorCopy types +func (e *ErrorCopy) Define(c *Context) { + c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number) + c.Putln("") + c.Putln("const %s = %d", e.ErrConst(), e.Number) + c.Putln("") + c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType()) + c.Putln("") + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) + c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) + c.Putln("}") + c.Putln("") + c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) + c.Putln("") + c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) + c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) + c.Putln("}") + c.Putln("") + c.Putln("func init() {") + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("}") + c.Putln("") +} diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go new file mode 100644 index 0000000..d91fd7a --- /dev/null +++ b/nexgb/xgbgen/go_event.go @@ -0,0 +1,38 @@ +package main + +// Event types +func (e *Event) Define(c *Context) { + c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) +} + +func (e *Event) Read(c *Context, prefix string) { + c.Putln("// Event read %s", e.SrcName()) +} + +func (e *Event) Write(c *Context, prefix string) { + c.Putln("// Event write %s", e.SrcName()) +} + +// EventCopy types +func (e *EventCopy) Define(c *Context) { + c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number) + c.Putln("") + c.Putln("const %s = %d", e.SrcName(), e.Number) + c.Putln("") + c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType()) + c.Putln("") + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) + c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) + c.Putln("}") + c.Putln("") + c.Putln("func (ev %s) ImplementsEvent() { }", e.EvType()) + c.Putln("") + c.Putln("func (ev %s) Bytes() []byte {", e.EvType()) + c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) + c.Putln("}") + c.Putln("") + c.Putln("func init() {") + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("}") + c.Putln("") +} diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go new file mode 100644 index 0000000..03da22e --- /dev/null +++ b/nexgb/xgbgen/go_list.go @@ -0,0 +1,75 @@ +package main + +import ( + "fmt" + "log" +) + +// List fields +func (f *ListField) Define(c *Context) { + c.Putln("%s []%s // size: %s", + f.SrcName(), f.Type.SrcName(), f.Size()) +} + +func (f *ListField) Read(c *Context) { + c.Putln("") + + switch t := f.Type.(type) { + case *Resource: + length := f.LengthExpr.Reduce("v.", "") + c.Putln("v.%s = make([]Id, %s)", f.SrcName(), length) + c.Putln("for i := 0; i < %s; i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") + case *Base: + length := f.LengthExpr.Reduce("v.", "") + c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), length) + if t.SrcName() == "byte" { + c.Putln("copy(v.%s[:%s], buf[b:])", f.SrcName(), length) + c.Putln("b += pad(%s)", length) + } else { + c.Putln("for i := 0; i < %s; i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") + } + case *Struct: + c.Putln("v.%s = make([]%s, %s)", + f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) + c.Putln("b += Read%sList(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + default: + log.Fatalf("Cannot read list field '%s' with %T type.", + f.XmlName(), f.Type) + } +} + +func (f *ListField) Write(c *Context) { + c.Putln("") + + switch t := f.Type.(type) { + case *Resource: + length := f.LengthExpr.Reduce("v.", "") + c.Putln("for i := 0; i < %s; i++", length) + WriteSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") + case *Base: + length := f.LengthExpr.Reduce("v.", "") + if t.SrcName() == "byte" { + c.Putln("copy(buf[b:], v.%s[:%s])", f.SrcName(), length) + c.Putln("b += pad(%s)", length) + } else { + c.Putln("for i := 0; i < %s; i++ {", length) + WriteSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") + } + case *Struct: + c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + default: + log.Fatalf("Cannot read list field '%s' with %T type.", + f.XmlName(), f.Type) + } +} + diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go new file mode 100644 index 0000000..3c354e7 --- /dev/null +++ b/nexgb/xgbgen/go_single_field.go @@ -0,0 +1,138 @@ +package main + +import ( + "fmt" + "log" +) + +func (f *SingleField) Define(c *Context) { + c.Putln("%s %s", f.SrcName(), f.Type.SrcName()) +} + +func ReadSimpleSingleField(c *Context, name string, typ Type) { + switch t := typ.(type) { + case *Resource: + c.Putln("%s = get32(buf[b:])", name) + case *TypeDef: + switch t.Size().Eval() { + case 1: + c.Putln("%s = %s(buf[b])", name, t.SrcName()) + case 2: + c.Putln("%s = %s(get16(buf[b:]))", name, t.SrcName()) + case 4: + c.Putln("%s = %s(get32(buf[b:]))", name, t.SrcName()) + case 8: + c.Putln("%s = %s(get64(buf[b:]))", name, t.SrcName()) + } + case *Base: + var val string + switch t.Size().Eval() { + case 1: + val = fmt.Sprintf("buf[b]") + case 2: + val = fmt.Sprintf("get16(buf[b:])") + case 4: + val = fmt.Sprintf("get32(buf[b:])") + case 8: + val = fmt.Sprintf("get64(buf[b:])") + } + + // We need to convert base types if they aren't uintXX or byte + ty := t.SrcName() + if ty != "byte" && ty != "uint16" && ty != "uint32" && ty != "uint64" { + val = fmt.Sprintf("%s(%s)", ty, val) + } + c.Putln("%s = %s", name, val) + default: + log.Fatalf("Cannot read field '%s' as a simple field with %T type.", + name, typ) + } + + c.Putln("b += %s", typ.Size()) +} + +func (f *SingleField) Read(c *Context) { + switch t := f.Type.(type) { + case *Resource: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *TypeDef: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Base: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Struct: + c.Putln("v.%s = %s{}", f.SrcName(), t.SrcName()) + c.Putln("b += Read%s(buf[b:], &v.%s)", t.SrcName(), f.SrcName()) + c.Putln("") + default: + log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) + } +} + +func WriteSimpleSingleField(c *Context, name string, typ Type) { + switch t := typ.(type) { + case *Resource: + c.Putln("put32(buf[b:], uint32(%s))", name) + case *TypeDef: + switch t.Size().Eval() { + case 1: + c.Putln("buf[b] = byte(%s)", name) + case 2: + c.Putln("put16(buf[b:], uint16(%s))", name) + case 4: + c.Putln("put32(buf[b:], uint32(%s))", name) + case 8: + c.Putln("put64(buf[b:], uint64(%s))", name) + } + case *Base: + switch t.Size().Eval() { + case 1: + if t.SrcName() != "byte" { + c.Putln("buf[b] = byte(%s)", name) + } else { + c.Putln("buf[b] = %s", name) + } + case 2: + if t.SrcName() != "uint16" { + c.Putln("put16(buf[b:], uint16(%s))", name) + } else { + c.Putln("put16(buf[b:], %s)", name) + } + case 4: + if t.SrcName() != "uint32" { + c.Putln("put32(buf[b:], uint32(%s))", name) + } else { + c.Putln("put32(buf[b:], %s)", name) + } + case 8: + if t.SrcName() != "uint64" { + c.Putln("put64(buf[b:], uint64(%s))", name) + } else { + c.Putln("put64(buf[b:], %s)", name) + } + } + default: + log.Fatalf("Cannot read field '%s' as a simple field with %T type.", + name, typ) + } + + c.Putln("b += %s", typ.Size()) +} + +func (f *SingleField) Write(c *Context) { + switch t := f.Type.(type) { + case *Resource: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *TypeDef: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Base: + ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Struct: + c.Putln("{") + c.Putln("structBytes := v.%s.Bytes()", f.SrcName()) + c.Putln("copy(buf[b:], structBytes)") + c.Putln("b += len(structBytes)") + c.Putln("}") + default: + log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) + } +} diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go new file mode 100644 index 0000000..6925c88 --- /dev/null +++ b/nexgb/xgbgen/go_struct.go @@ -0,0 +1,107 @@ +package main + +func (s *Struct) Define(c *Context) { + c.Putln("// '%s' struct definition", s.SrcName()) + c.Putln("// Size: %s", s.Size()) + c.Putln("type %s struct {", s.SrcName()) + for _, field := range s.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + + // Write function that reads bytes and produces this struct. + s.Read(c) + + // Write function that reads a list of this structs. + s.ReadList(c) + + // Write function that writes bytes given this struct. + s.Write(c) + + // Write function that writes a list of this struct. + s.WriteList(c) + + // Write function that computes the size of a list of these structs. + s.WriteListSize(c) +} + +// Read for a struct creates a function 'ReadStructName' that takes a source +// byte slice (i.e., the buffer) and a destination struct, and returns +// the number of bytes read off the buffer. +// 'ReadStructName' should only be used to read raw reply data from the wire. +func (s *Struct) Read(c *Context) { + c.Putln("// Struct read %s", s.SrcName()) + c.Putln("func Read%s(buf []byte, v *%s) int {", s.SrcName(), s.SrcName()) + + c.Putln("b := 0") + c.Putln("") + for _, field := range s.Fields { + field.Read(c) + } + c.Putln("return b") + + c.Putln("}") + c.Putln("") +} + +// ReadList for a struct creates a function 'ReadStructNameList' that takes +// a source (i.e., the buffer) byte slice, and a destination slice and returns +// the number of bytes read from the byte slice. +func (s *Struct) ReadList(c *Context) { + c.Putln("// Struct list read %s", s.SrcName()) + c.Putln("func Read%sList(buf []byte, dest []%s) int {", + s.SrcName(), s.SrcName()) + + c.Putln("b := 0") + c.Putln("for i := 0; i < len(dest); i++ {") + c.Putln("dest[i] = %s{}", s.SrcName()) + c.Putln("b += Read%s(buf[b:], &dest[i])", s.SrcName()) + c.Putln("}") + + c.Putln("return pad(b)") + + c.Putln("}") + c.Putln("") +} + +func (s *Struct) Write(c *Context) { + c.Putln("// Struct write %s", s.SrcName()) + c.Putln("func (v %s) Bytes() []byte {", s.SrcName()) + c.Putln("buf := make([]byte, %s)", s.Size().Reduce("s.", "")) + c.Putln("b := 0") + c.Putln("") + for _, field := range s.Fields { + field.Write(c) + } + c.Putln("return buf") + c.Putln("}") + c.Putln("") +} + +func (s *Struct) WriteList(c *Context) { + c.Putln("// Write struct list %s", s.SrcName()) + c.Putln("func %sListBytes(buf []byte, list []%s) int {", + s.SrcName(), s.SrcName()) + c.Putln("b := 0") + c.Putln("var structBytes []byte") + c.Putln("for _, item := range list {") + c.Putln("structBytes = item.Bytes()") + c.Putln("copy(buf[b:], len(structBytes))") + c.Putln("b += len(structBytes)") + c.Putln("}") + c.Putln("return b") + c.Putln("}") +} + +func (s *Struct) WriteListSize(c *Context) { + c.Putln("// Struct list size %s", s.SrcName()) + c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName()) + c.Putln("size := 0") + c.Putln("for _, item := range list {") + c.Putln("size += %s", s.Size().Reduce("item.", "")) + c.Putln("}") + c.Putln("return pad(size)") + c.Putln("}") + c.Putln("") +} diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go new file mode 100644 index 0000000..5721c49 --- /dev/null +++ b/nexgb/xgbgen/go_union.go @@ -0,0 +1,15 @@ +package main + +// Union types +func (u *Union) Define(c *Context) { + c.Putln("// Union definition %s", u.SrcName()) +} + +func (u *Union) Read(c *Context, prefix string) { + c.Putln("// Union read %s", u.SrcName()) +} + +func (u *Union) Write(c *Context, prefix string) { + c.Putln("// Union write %s", u.SrcName()) +} + From 83a71d464887f4b6cf9124d2f8c565e6f17f2bd3 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 1 May 2012 01:08:03 -0400 Subject: [PATCH 07/90] unions, events and errors... oh my --- nexgb/xgbgen/field.go | 27 ++++++- nexgb/xgbgen/go_error.go | 34 ++++++-- nexgb/xgbgen/go_event.go | 101 +++++++++++++++++++++--- nexgb/xgbgen/go_list.go | 10 ++- nexgb/xgbgen/go_single_field.go | 36 ++++++++- nexgb/xgbgen/go_struct.go | 9 ++- nexgb/xgbgen/go_union.go | 134 +++++++++++++++++++++++++++++++- nexgb/xgbgen/type.go | 4 +- 8 files changed, 317 insertions(+), 38 deletions(-) diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 0f2323e..6d39af2 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -9,6 +9,7 @@ type Field interface { Initialize(p *Protocol) SrcName() string XmlName() string + SrcType() string Size() Size Define(c *Context) @@ -30,6 +31,10 @@ func (p *PadField) XmlName() string { panic("illegal to take XML name of a pad field") } +func (f *PadField) SrcType() string { + panic("it is illegal to call SrcType on a SwitchField field") +} + func (p *PadField) Size() Size { return newFixedSize(p.Bytes) } @@ -53,6 +58,10 @@ func (f *SingleField) XmlName() string { return f.xmlName } +func (f *SingleField) SrcType() string { + return f.Type.SrcName() +} + func (f *SingleField) Size() Size { return f.Type.Size() } @@ -72,9 +81,9 @@ func (f *ListField) XmlName() string { return f.xmlName } -// func (f *ListField) Size() Size { - // return newExpressionSize(f.LengthExpr).Multiply(f.Type.Size()) -// } +func (f *ListField) SrcType() string { + return fmt.Sprintf("[]%s", f.Type.SrcName()) +} func (f *ListField) Size() Size { simpleLen := &Function{ @@ -126,6 +135,10 @@ func (f *ExprField) XmlName() string { return f.xmlName } +func (f *ExprField) SrcType() string { + return f.Type.SrcName() +} + func (f *ExprField) Size() Size { return f.Type.Size() } @@ -150,6 +163,10 @@ func (f *ValueField) XmlName() string { panic("it is illegal to call XmlName on a ValueField field") } +func (f *ValueField) SrcType() string { + return f.MaskType.SrcName() +} + func (f *ValueField) Size() Size { return f.MaskType.Size() } @@ -174,6 +191,10 @@ func (f *SwitchField) XmlName() string { panic("it is illegal to call XmlName on a SwitchField field") } +func (f *SwitchField) SrcType() string { + panic("it is illegal to call SrcType on a SwitchField field") +} + // XXX: This is a bit tricky. The size has to be represented as a non-concrete // expression that finds *which* bitcase fields are included, and sums the // sizes of those fields. diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 0cb77cc..493a8b9 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -22,18 +22,36 @@ func (e *ErrorCopy) Define(c *Context) { c.Putln("") c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType()) c.Putln("") - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) - c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) - c.Putln("}") - c.Putln("") + + // Read defines a function that transforms a byte slice into this + // error struct. + e.Read(c) + + // Write defines a function that transoforms this error struct into + // a byte slice. + e.Write(c) + + // Makes sure that this error type is an Error interface. c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) c.Putln("") - c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) - c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) - c.Putln("}") - c.Putln("") + + // Let's the XGB know how to read this error. c.Putln("func init() {") c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.SrcName()) c.Putln("}") c.Putln("") } + +func (e *ErrorCopy) Read(c *Context) { + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) + c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) + c.Putln("}") + c.Putln("") +} + +func (e *ErrorCopy) Write(c *Context) { + c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) + c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) + c.Putln("}") + c.Putln("") +} diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index d91fd7a..e6d40b0 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -3,14 +3,75 @@ package main // Event types func (e *Event) Define(c *Context) { c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) + c.Putln("// Size: %s", e.Size()) + c.Putln("type %s struct {", e.EvType()) + c.Putln("Sequence uint16") + for _, field := range e.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + + // Read defines a function that transforms a byte slice into this + // event struct. + e.Read(c) + + // Write defines a function that transoforms this event struct into + // a byte slice. + e.Write(c) + + // Makes sure that this event type is an Event interface. + c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) + c.Putln("") + + // Let's the XGB event loop read this event. + c.Putln("func init() {") + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("}") + c.Putln("") } -func (e *Event) Read(c *Context, prefix string) { +func (e *Event) Read(c *Context) { c.Putln("// Event read %s", e.SrcName()) + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) + c.Putln("v := %s{}", e.EvType()) + c.Putln("b := 1 // don't read event number") + c.Putln("") + for i, field := range e.Fields { + if i == 1 && !e.NoSequence { + c.Putln("v.Sequence = get16(buf[b:])") + c.Putln("b += 2") + c.Putln("") + } + field.Read(c) + c.Putln("") + } + c.Putln("return v") + c.Putln("}") + c.Putln("") } -func (e *Event) Write(c *Context, prefix string) { +func (e *Event) Write(c *Context) { c.Putln("// Event write %s", e.SrcName()) + c.Putln("func (v %s) Bytes() []byte {", e.EvType()) + c.Putln("buf := make([]byte, %s)", e.Size()) + c.Putln("b := 0") + c.Putln("") + c.Putln("// write event number") + c.Putln("buf[b] = %d", e.Number) + c.Putln("b += 1") + c.Putln("") + for i, field := range e.Fields { + if i == 1 && !e.NoSequence { + c.Putln("b += 2 // skip sequence number") + c.Putln("") + } + field.Write(c) + c.Putln("") + } + c.Putln("return buf") + c.Putln("}") + c.Putln("") } // EventCopy types @@ -21,18 +82,36 @@ func (e *EventCopy) Define(c *Context) { c.Putln("") c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType()) c.Putln("") - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) - c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) - c.Putln("}") - c.Putln("") - c.Putln("func (ev %s) ImplementsEvent() { }", e.EvType()) - c.Putln("") - c.Putln("func (ev %s) Bytes() []byte {", e.EvType()) - c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) - c.Putln("}") + + // Read defines a function that transforms a byte slice into this + // event struct. + e.Read(c) + + // Write defines a function that transoforms this event struct into + // a byte slice. + e.Write(c) + + // Makes sure that this event type is an Event interface. + c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + + // Let's the XGB event loop read this event. c.Putln("func init() {") c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) c.Putln("}") c.Putln("") } + +func (e *EventCopy) Read(c *Context) { + c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) + c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) + c.Putln("}") + c.Putln("") +} + +func (e *EventCopy) Write(c *Context) { + c.Putln("func (v %s) Bytes() []byte {", e.EvType()) + c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) + c.Putln("}") + c.Putln("") +} diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index 03da22e..a95ba71 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -12,8 +12,6 @@ func (f *ListField) Define(c *Context) { } func (f *ListField) Read(c *Context) { - c.Putln("") - switch t := f.Type.(type) { case *Resource: length := f.LengthExpr.Reduce("v.", "") @@ -34,6 +32,10 @@ func (f *ListField) Read(c *Context) { c.Putln("}") c.Putln("b = pad(b)") } + case *Union: + c.Putln("v.%s = make([]%s, %s)", + f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) + c.Putln("b += Read%sList(buf[b:], v.%s)", t.SrcName(), f.SrcName()) case *Struct: c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) @@ -45,8 +47,6 @@ func (f *ListField) Read(c *Context) { } func (f *ListField) Write(c *Context) { - c.Putln("") - switch t := f.Type.(type) { case *Resource: length := f.LengthExpr.Reduce("v.", "") @@ -65,6 +65,8 @@ func (f *ListField) Write(c *Context) { c.Putln("}") c.Putln("b = pad(b)") } + case *Union: + c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) case *Struct: c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) default: diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go index 3c354e7..bf31259 100644 --- a/nexgb/xgbgen/go_single_field.go +++ b/nexgb/xgbgen/go_single_field.go @@ -25,6 +25,16 @@ func ReadSimpleSingleField(c *Context, name string, typ Type) { c.Putln("%s = %s(get64(buf[b:]))", name, t.SrcName()) } case *Base: + // If this is a bool, stop short and do something special. + if t.SrcName() == "bool" { + c.Putln("if buf[b] == 1 {") + c.Putln("%s = true", name) + c.Putln("} else {") + c.Putln("%s = false", name) + c.Putln("}") + break + } + var val string switch t.Size().Eval() { case 1: @@ -44,7 +54,7 @@ func ReadSimpleSingleField(c *Context, name string, typ Type) { } c.Putln("%s = %s", name, val) default: - log.Fatalf("Cannot read field '%s' as a simple field with %T type.", + log.Panicf("Cannot read field '%s' as a simple field with %T type.", name, typ) } @@ -62,9 +72,11 @@ func (f *SingleField) Read(c *Context) { case *Struct: c.Putln("v.%s = %s{}", f.SrcName(), t.SrcName()) c.Putln("b += Read%s(buf[b:], &v.%s)", t.SrcName(), f.SrcName()) - c.Putln("") + case *Union: + c.Putln("v.%s = %s{}", f.SrcName(), t.SrcName()) + c.Putln("b += Read%s(buf[b:], &v.%s)", t.SrcName(), f.SrcName()) default: - log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) + log.Panicf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) } } @@ -84,6 +96,16 @@ func WriteSimpleSingleField(c *Context, name string, typ Type) { c.Putln("put64(buf[b:], uint64(%s))", name) } case *Base: + // If this is a bool, stop short and do something special. + if t.SrcName() == "bool" { + c.Putln("if %s {", name) + c.Putln("buf[b] = 1") + c.Putln("} else {") + c.Putln("buf[b] = 0") + c.Putln("}") + break + } + switch t.Size().Eval() { case 1: if t.SrcName() != "byte" { @@ -126,11 +148,17 @@ func (f *SingleField) Write(c *Context) { ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) case *Base: ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + case *Union: + c.Putln("{") + c.Putln("unionBytes := v.%s.Bytes()", f.SrcName()) + c.Putln("copy(buf[b:], unionBytes)") + c.Putln("b += pad(len(unionBytes))") + c.Putln("}") case *Struct: c.Putln("{") c.Putln("structBytes := v.%s.Bytes()", f.SrcName()) c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += len(structBytes)") + c.Putln("b += pad(len(structBytes))") c.Putln("}") default: log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 6925c88..600ebaf 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -13,7 +13,7 @@ func (s *Struct) Define(c *Context) { // Write function that reads bytes and produces this struct. s.Read(c) - // Write function that reads a list of this structs. + // Write function that reads bytes and produces a list of this struct. s.ReadList(c) // Write function that writes bytes given this struct. @@ -68,7 +68,7 @@ func (s *Struct) ReadList(c *Context) { func (s *Struct) Write(c *Context) { c.Putln("// Struct write %s", s.SrcName()) c.Putln("func (v %s) Bytes() []byte {", s.SrcName()) - c.Putln("buf := make([]byte, %s)", s.Size().Reduce("s.", "")) + c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v.", "")) c.Putln("b := 0") c.Putln("") for _, field := range s.Fields { @@ -88,10 +88,11 @@ func (s *Struct) WriteList(c *Context) { c.Putln("for _, item := range list {") c.Putln("structBytes = item.Bytes()") c.Putln("copy(buf[b:], len(structBytes))") - c.Putln("b += len(structBytes)") + c.Putln("b += pad(len(structBytes))") c.Putln("}") c.Putln("return b") c.Putln("}") + c.Putln("") } func (s *Struct) WriteListSize(c *Context) { @@ -101,7 +102,7 @@ func (s *Struct) WriteListSize(c *Context) { c.Putln("for _, item := range list {") c.Putln("size += %s", s.Size().Reduce("item.", "")) c.Putln("}") - c.Putln("return pad(size)") + c.Putln("return size") c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 5721c49..3b7365d 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -3,13 +3,143 @@ package main // Union types func (u *Union) Define(c *Context) { c.Putln("// Union definition %s", u.SrcName()) + c.Putln("// Note that to *create* a Union, you should *never* create") + c.Putln("// this struct directly (unless you know what you're doing).") + c.Putln("// Instead use one of the following constructors for '%s':", + u.SrcName()) + for _, field := range u.Fields { + c.Putln("// New%s%s(%s %s) %s", u.SrcName(), field.SrcName(), + field.SrcName(), field.SrcType(), u.SrcName()) + } + + c.Putln("type %s struct {", u.SrcName()) + for _, field := range u.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + + // Write functions for each field that create instances of this + // union using the corresponding field. + u.New(c) + + // Write function that reads bytes and produces this union. + u.Read(c) + + // Write function that reads bytes and produces a list of this union. + u.ReadList(c) + + // Write function that writes bytes given this union. + u.Write(c) + + // Write function that writes a list of this union. + u.WriteList(c) + + // Write function that computes the size of a list of these unions. + u.WriteListSize(c) } -func (u *Union) Read(c *Context, prefix string) { +func (u *Union) New(c *Context) { + for _, field := range u.Fields { + c.Putln("// Union constructor for %s for field %s.", + u.SrcName(), field.SrcName()) + c.Putln("func New%s%s(%s %s) %s {", + u.SrcName(), field.SrcName(), field.SrcName(), + field.SrcType(), u.SrcName()) + c.Putln("var b int") + c.Putln("buf := make([]byte, %s)", u.Size()) + c.Putln("") + field.Write(c) + c.Putln("") + c.Putln("// Create the Union type") + c.Putln("v := %s{}", u.SrcName()) + c.Putln("") + c.Putln("// Now copy buf into all fields") + c.Putln("") + for _, field2 := range u.Fields { + c.Putln("b = 0 // always read the same bytes") + field2.Read(c) + c.Putln("") + } + c.Putln("return v") + c.Putln("}") + c.Putln("") + } +} + +func (u *Union) Read(c *Context) { c.Putln("// Union read %s", u.SrcName()) + c.Putln("func Read%s(buf []byte, v *%s) int {", u.SrcName(), u.SrcName()) + c.Putln("var b int") + c.Putln("") + for _, field := range u.Fields { + c.Putln("b = 0 // re-read the same bytes") + field.Read(c) + c.Putln("") + } + c.Putln("return %s", u.Size()) + c.Putln("}") + c.Putln("") } -func (u *Union) Write(c *Context, prefix string) { +func (u *Union) ReadList(c *Context) { + c.Putln("// Union list read %s", u.SrcName()) + c.Putln("func Read%sList(buf []byte, dest []%s) int {", + u.SrcName(), u.SrcName()) + c.Putln("b := 0") + c.Putln("for i := 0; i < len(dest); i++ {") + c.Putln("dest[i] = %s{}", u.SrcName()) + c.Putln("b += Read%s(buf[b:], &dest[i])", u.SrcName()) + c.Putln("}") + c.Putln("return pad(b)") + c.Putln("}") + c.Putln("") +} + +// This is a bit tricky since writing from a Union implies that only +// the data inside ONE of the elements is actually written. +// However, we only currently support unions where every field has the +// *same* *fixed* size. Thus, we make sure to always read bytes into +// every field which allows us to simply pick the first field and write it. +func (u *Union) Write(c *Context) { c.Putln("// Union write %s", u.SrcName()) + c.Putln("// Each field in a union must contain the same data.") + c.Putln("// So simply pick the first field and write that to the wire.") + c.Putln("func (v %s) Bytes() []byte {", u.SrcName()) + c.Putln("buf := make([]byte, %s)", u.Size().Reduce("v.", "")) + c.Putln("b := 0") + c.Putln("") + u.Fields[0].Write(c) + c.Putln("return buf") + c.Putln("}") + c.Putln("") +} + +func (u *Union) WriteList(c *Context) { + c.Putln("// Union list write %s", u.SrcName()) + c.Putln("func %sListBytes(buf []byte, list []%s) int {", + u.SrcName(), u.SrcName()) + c.Putln("b := 0") + c.Putln("var unionBytes []byte") + c.Putln("for _, item := range list {") + c.Putln("unionBytes = item.Bytes()") + c.Putln("copy(buf[b:], len(unionBytes))") + c.Putln("b += pad(len(unionBytes))") + c.Putln("}") + c.Putln("return b") + c.Putln("}") + c.Putln("") +} + +func (u *Union) WriteListSize(c *Context) { + c.Putln("// Union list size %s", u.SrcName()) + c.Putln("func %sListSize(list []%s) int {", u.SrcName(), u.SrcName()) + c.Putln("size := 0") + c.Putln("for _, item := range list {") + c.Putln("size += %s", u.Size().Reduce("item.", "")) + c.Putln("}") + c.Putln("return size") + c.Putln("}") + c.Putln("") } diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index 9fbef65..1e06bda 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -191,7 +191,7 @@ func (e *Event) XmlName() string { } func (e *Event) Size() Size { - panic("Cannot take size of Event type.") + return newExpressionSize(&Value{v: 32}) } func (e *Event) Initialize(p *Protocol) { @@ -358,7 +358,7 @@ func (u *Union) Size() Size { } func (u *Union) Initialize(p *Protocol) { - u.srcName = TypeSrcName(p, u) + u.srcName = fmt.Sprintf("%sUnion", TypeSrcName(p, u)) for _, field := range u.Fields { field.Initialize(p) } From f48b6fafc6d96527a554876e13fc5a0b548005af Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 1 May 2012 01:09:45 -0400 Subject: [PATCH 08/90] float my boat --- nexgb/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nexgb/README b/nexgb/README index f659e32..989e5c8 100644 --- a/nexgb/README +++ b/nexgb/README @@ -14,7 +14,8 @@ I like to release my code under the WTFPL, but since I'm starting with someone else's work, I'm leaving the original license/contributor/author information in tact. -I suppose I can legitimately release xgbgen under the WTFPL. +I suppose I can legitimately release xgbgen under the WTFPL. To be fair, it is +at least as complex as XGB itself. *sigh* What follows is the original README: From 39507f86ab0468292c24081a80f41c1799d6b477 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Wed, 2 May 2012 01:46:30 -0400 Subject: [PATCH 09/90] finally starting on the crescendo: requests and replies. --- nexgb/xgbgen/context.go | 3 ++ nexgb/xgbgen/field.go | 4 ++- nexgb/xgbgen/go.go | 9 ----- nexgb/xgbgen/go_error.go | 65 ++++++++++++++++++++++++---------- nexgb/xgbgen/go_event.go | 21 ++++++----- nexgb/xgbgen/go_list.go | 4 +-- nexgb/xgbgen/go_reply.go | 19 ++++++++++ nexgb/xgbgen/representation.go | 53 +++++++++++++++++++++++++++ nexgb/xgbgen/translation.go | 12 ++++--- nexgb/xgbgen/type.go | 9 +++-- nexgb/xgbgen/xml.go | 2 +- 11 files changed, 153 insertions(+), 48 deletions(-) create mode 100644 nexgb/xgbgen/go_reply.go diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 67801c7..33641b3 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -51,4 +51,7 @@ func (c *Context) Morph(xmlBytes []byte) { for _, typ := range c.protocol.Types { typ.Define(c) } + for _, req := range c.protocol.Requests { + req.Define(c) + } } diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 6d39af2..8d8412c 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -102,8 +102,10 @@ func (f *ListField) Size() Size { return newExpressionSize(simpleLen) case *Resource: return newExpressionSize(simpleLen) + case *TypeDef: + return newExpressionSize(simpleLen) default: - log.Fatalf("Cannot compute list size with type '%T'.", f.Type) + log.Panicf("Cannot compute list size with type '%T'.", f.Type) } panic("unreachable") } diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index 11e413b..b7b153e 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -105,57 +105,48 @@ func (f *PadField) Write(c *Context) { // Local fields func (f *LocalField) Define(c *Context) { c.Putln("// local field: %s %s", f.SrcName(), f.Type.SrcName()) - panic("todo") } func (f *LocalField) Read(c *Context) { c.Putln("// reading local field: %s (%s) :: %s", f.SrcName(), f.Size(), f.Type.SrcName()) - panic("todo") } func (f *LocalField) Write(c *Context) { c.Putln("// writing local field: %s (%s) :: %s", f.SrcName(), f.Size(), f.Type.SrcName()) - panic("todo") } // Expr fields func (f *ExprField) Define(c *Context) { c.Putln("// expression field: %s %s (%s)", f.SrcName(), f.Type.SrcName(), f.Expr) - panic("todo") } func (f *ExprField) Read(c *Context) { c.Putln("// reading expression field: %s (%s) (%s) :: %s", f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) - panic("todo") } func (f *ExprField) Write(c *Context) { c.Putln("// writing expression field: %s (%s) (%s) :: %s", f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) - panic("todo") } // Value field func (f *ValueField) Define(c *Context) { c.Putln("// valueparam field: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) - panic("todo") } func (f *ValueField) Read(c *Context) { c.Putln("// reading valueparam: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) - panic("todo") } func (f *ValueField) Write(c *Context) { c.Putln("// writing valueparam: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) - panic("todo") } // Switch field diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 493a8b9..17c0db5 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -3,15 +3,53 @@ package main // Error types func (e *Error) Define(c *Context) { c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) + c.Putln("// Size: %s", e.Size()) + c.Putln("") + c.Putln("const %s = %d", e.ErrConst(), e.Number) + c.Putln("") + c.Putln("type %s struct {", e.ErrType()) + c.Putln("Sequence uint16") + c.Putln("NiceName string") + for _, field := range e.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + + // Read defines a function that transforms a byte slice into this + // error struct. + e.Read(c) + + // Makes sure that this error type is an Error interface. + c.Putln("func (v %s) ImplementsError() { }", e.ErrType()) + c.Putln("") + + // Let's the XGB event loop read this error. + c.Putln("func init() {") + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + c.Putln("}") c.Putln("") } -func (e *Error) Read(c *Context, prefix string) { +func (e *Error) Read(c *Context) { c.Putln("// Error read %s", e.SrcName()) -} - -func (e *Error) Write(c *Context, prefix string) { - c.Putln("// Error write %s", e.SrcName()) + c.Putln("func New%s(buf []byte) %s {", e.ErrType(), e.ErrType()) + c.Putln("v := %s{}", e.ErrType()) + c.Putln("v.NiceName = \"%s\"", e.SrcName()) + c.Putln("") + c.Putln("b := 1 // skip error determinant") + c.Putln("b += 1 // don't read error number") + c.Putln("") + c.Putln("v.Sequence = get16(buf[b:])") + c.Putln("b += 2") + c.Putln("") + for _, field := range e.Fields { + field.Read(c) + c.Putln("") + } + c.Putln("return v") + c.Putln("}") + c.Putln("") } // ErrorCopy types @@ -27,31 +65,20 @@ func (e *ErrorCopy) Define(c *Context) { // error struct. e.Read(c) - // Write defines a function that transoforms this error struct into - // a byte slice. - e.Write(c) - // Makes sure that this error type is an Error interface. c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) c.Putln("") // Let's the XGB know how to read this error. c.Putln("func init() {") - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) c.Putln("}") c.Putln("") } func (e *ErrorCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.ErrType()) - c.Putln("return (%s)(New%s(buf))", e.ErrType(), e.Old.SrcName()) - c.Putln("}") - c.Putln("") -} - -func (e *ErrorCopy) Write(c *Context) { - c.Putln("func (err %s) Bytes() []byte {", e.ErrType()) - c.Putln("return (%s)(err).Bytes()", e.Old.(*Error).ErrType()) + c.Putln("func New%s(buf []byte) %s {", e.ErrType(), e.ErrType()) + c.Putln("return %s(New%s(buf))", e.ErrType(), e.Old.(*Error).ErrType()) c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index e6d40b0..fe2a77e 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -4,8 +4,13 @@ package main func (e *Event) Define(c *Context) { c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) c.Putln("// Size: %s", e.Size()) + c.Putln("") + c.Putln("const %s = %d", e.SrcName(), e.Number) + c.Putln("") c.Putln("type %s struct {", e.EvType()) - c.Putln("Sequence uint16") + if !e.NoSequence { + c.Putln("Sequence uint16") + } for _, field := range e.Fields { field.Define(c) } @@ -16,7 +21,7 @@ func (e *Event) Define(c *Context) { // event struct. e.Read(c) - // Write defines a function that transoforms this event struct into + // Write defines a function that transforms this event struct into // a byte slice. e.Write(c) @@ -26,14 +31,14 @@ func (e *Event) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) c.Putln("}") c.Putln("") } func (e *Event) Read(c *Context) { c.Putln("// Event read %s", e.SrcName()) - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) + c.Putln("func New%s(buf []byte) %s {", e.EvType(), e.EvType()) c.Putln("v := %s{}", e.EvType()) c.Putln("b := 1 // don't read event number") c.Putln("") @@ -97,21 +102,21 @@ func (e *EventCopy) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.SrcName()) + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) c.Putln("}") c.Putln("") } func (e *EventCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) %s {", e.SrcName(), e.EvType()) - c.Putln("return (%s)(New%s(buf))", e.EvType(), e.Old.SrcName()) + c.Putln("func New%s(buf []byte) %s {", e.EvType(), e.EvType()) + c.Putln("return %s(New%s(buf))", e.EvType(), e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") } func (e *EventCopy) Write(c *Context) { c.Putln("func (v %s) Bytes() []byte {", e.EvType()) - c.Putln("return (%s)(ev).Bytes()", e.Old.(*Event).EvType()) + c.Putln("return %s(ev).Bytes()", e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index a95ba71..67ecd34 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -41,7 +41,7 @@ func (f *ListField) Read(c *Context) { f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) c.Putln("b += Read%sList(buf[b:], v.%s)", t.SrcName(), f.SrcName()) default: - log.Fatalf("Cannot read list field '%s' with %T type.", + log.Panicf("Cannot read list field '%s' with %T type.", f.XmlName(), f.Type) } } @@ -70,7 +70,7 @@ func (f *ListField) Write(c *Context) { case *Struct: c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) default: - log.Fatalf("Cannot read list field '%s' with %T type.", + log.Panicf("Cannot read list field '%s' with %T type.", f.XmlName(), f.Type) } } diff --git a/nexgb/xgbgen/go_reply.go b/nexgb/xgbgen/go_reply.go new file mode 100644 index 0000000..e561d9c --- /dev/null +++ b/nexgb/xgbgen/go_reply.go @@ -0,0 +1,19 @@ +package main + +func (r *Request) Define(c *Context) { + c.Putln("// Request %s", r.SrcName()) + c.Putln("// size: %s", r.Size(c)) + c.Putln("") + if r.Reply != nil { + c.Putln("// Request reply for %s", r.SrcName()) + c.Putln("// size: %s", r.Reply.Size()) + c.Putln("type %s struct {", r.ReplyName()) + c.Putln("Sequence uint16") + for _, field := range r.Reply.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + } +} + diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go index 2d33a45..e5d2202 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/representation.go @@ -1,5 +1,10 @@ package main +import ( + "fmt" + "log" +) + type Protocol struct { Name string ExtXName string @@ -44,10 +49,58 @@ func (r *Request) Initialize(p *Protocol) { } } +func (r *Request) SrcName() string { + return r.srcName +} + +func (r *Request) XmlName() string { + return r.xmlName +} + +func (r *Request) ReplyName() string { + if r.Reply == nil { + log.Panicf("Cannot call 'ReplyName' on request %s, which has no reply.", + r.SrcName()) + } + return fmt.Sprintf("%sReply", r.SrcName()) +} + +// Size for Request needs a context. +// Namely, if this is an extension, we need to account for *four* bytes +// of a header (extension opcode, request opcode, and the sequence number). +// If it's a core protocol request, then we only account for *three* +// bytes of the header (remove the extension opcode). +func (r *Request) Size(c *Context) Size { + size := newFixedSize(0) + + if c.protocol.Name == "xproto" { + size = size.Add(newFixedSize(3)) + } else { + size = size.Add(newFixedSize(4)) + } + + for _, field := range r.Fields { + size = size.Add(field.Size()) + } + return size +} + type Reply struct { Fields []Field } +func (r *Reply) Size() Size { + size := newFixedSize(0) + + // Account for reply discriminant, sequence number and reply length + size = size.Add(newFixedSize(7)) + + for _, field := range r.Fields { + size = size.Add(field.Size()) + } + return size +} + func (r *Reply) Initialize(p *Protocol) { for _, field := range r.Fields { field.Initialize(p) diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 36daa8b..9c7603b 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -210,11 +210,13 @@ func (x *XMLRequest) Translate() *Request { // computation of the 'odd_length' field. However, 'string_len' is not // defined. Therefore, let's forcefully add it as a 'local field'. // (i.e., a parameter in the caller but does not get send over the wire.) - stringLenLocal := &LocalField{&SingleField{ - xmlName: "string_len", - Type: newTranslation("CARD16"), - }} - r.Fields = append(r.Fields, stringLenLocal) + if x.Name == "QueryTextExtents" { + stringLenLocal := &LocalField{&SingleField{ + xmlName: "string_len", + Type: newTranslation("CARD16"), + }} + r.Fields = append(r.Fields, stringLenLocal) + } return r } diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index 1e06bda..d8e76a2 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -221,7 +221,7 @@ func (e *EventCopy) XmlName() string { } func (e *EventCopy) Size() Size { - panic("Cannot take size of EventCopy type.") + return newExpressionSize(&Value{v: 32}) } func (e *EventCopy) Initialize(p *Protocol) { @@ -252,11 +252,14 @@ func (e *Error) XmlName() string { } func (e *Error) Size() Size { - panic("Cannot take size of Error type.") + return newExpressionSize(&Value{v: 32}) } func (e *Error) Initialize(p *Protocol) { e.srcName = TypeSrcName(p, e) + for _, field := range e.Fields { + field.Initialize(p) + } } func (e *Error) ErrConst() string { @@ -283,7 +286,7 @@ func (e *ErrorCopy) XmlName() string { } func (e *ErrorCopy) Size() Size { - panic("Cannot take size of ErrorCopy type.") + return newExpressionSize(&Value{v: 32}) } func (e *ErrorCopy) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index f219c2d..1b2f89a 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -135,7 +135,7 @@ type XMLEvents []*XMLEvent type XMLEvent struct { Name string `xml:"name,attr"` Number int `xml:"number,attr"` - NoSequence bool `xml:"no-sequence-number,true"` + NoSequence bool `xml:"no-sequence-number,attr"` Fields XMLFields `xml:",any"` } From 5cdae5950c357564300c0ee3fb4dc9e7bbf4946b Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 3 May 2012 01:00:01 -0400 Subject: [PATCH 10/90] holy toldeo... things might actually be working --- nexgb/xgb.go | 72 +- nexgb/xgb_help.go | 82 +- nexgb/xgbgen/context.go | 21 + nexgb/xgbgen/expression.go | 73 +- nexgb/xgbgen/field.go | 75 +- nexgb/xgbgen/go.go | 53 +- nexgb/xgbgen/go_error.go | 88 +- nexgb/xgbgen/go_event.go | 15 +- nexgb/xgbgen/go_list.go | 97 +- nexgb/xgbgen/go_reply.go | 19 - nexgb/xgbgen/go_request_reply.go | 140 + nexgb/xgbgen/go_single_field.go | 62 +- nexgb/xgbgen/go_struct.go | 19 +- nexgb/xgbgen/go_union.go | 17 +- nexgb/xgbgen/representation.go | 19 +- nexgb/xgbgen/translation.go | 17 +- nexgb/xgbgen/type.go | 12 + nexgb/xproto.go | 11215 +++++++++++++++++++++++++++++ 18 files changed, 11831 insertions(+), 265 deletions(-) delete mode 100644 nexgb/xgbgen/go_reply.go create mode 100644 nexgb/xgbgen/go_request_reply.go create mode 100644 nexgb/xproto.go diff --git a/nexgb/xgb.go b/nexgb/xgb.go index ce2cc54..0dd8163 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -95,31 +95,20 @@ type Event interface { // newEventFuncs is a map from event numbers to functions that create // the corresponding event. -var newEventFuncs map[int]func(buf []byte) Event +var newEventFuncs = map[int]func(buf []byte) Event{} -// Error contains protocol errors returned to us by the X server. -type Error struct { - Detail uint8 - Major uint8 - Minor uint16 - Cookie uint16 - Id Id -} - -// Error2 is an interface that can contain any of the errors returned by +// Error is an interface that can contain any of the errors returned by // the server. Use a type assertion switch to extract the Error structs. -type Error2 interface { +type Error interface { ImplementsError() + SequenceId() uint16 + BadId() Id + Error() string } // newErrorFuncs is a map from error numbers to functions that create // the corresponding error. -var newErrorFuncs map[int]func(buf []byte) Error2 - -func (e *Error) Error() string { - return fmt.Sprintf("Bad%s (major=%d minor=%d cookie=%d id=0x%x)", - errorNames[e.Detail], e.Major, e.Minor, e.Cookie, e.Id) -} +var newErrorFuncs = map[int]func(buf []byte) Error{} // NewID generates a new unused ID for use with requests like CreateWindow. func (c *Conn) NewId() Id { @@ -136,7 +125,7 @@ func (c *Conn) NewId() Id { // the extensions map. func (c *Conn) RegisterExtension(name string) error { nameUpper := strings.ToUpper(name) - reply, err := c.QueryExtension(nameUpper) + reply, err := c.QueryExtension(uint16(len(nameUpper)), nameUpper) switch { case err != nil: @@ -253,25 +242,26 @@ func (c *Conn) newReadChannels() { switch buf[0] { case 0: - err := &Error{ - Detail: buf[1], - Cookie: uint16(get16(buf[2:])), - Id: Id(get32(buf[4:])), - Minor: get16(buf[8:]), - Major: buf[10], - } - if cookie, ok := c.cookies[err.Cookie]; ok { + // err := &Error{ + // Detail: buf[1], + // Cookie: uint16(get16(buf[2:])), + // Id: Id(get32(buf[4:])), + // Minor: get16(buf[8:]), + // Major: buf[10], + // } + err := newErrorFuncs[int(buf[1])](buf) + if cookie, ok := c.cookies[err.SequenceId()]; ok { cookie.errorChan <- err } else { fmt.Fprintf(os.Stderr, "x protocol error: %s\n", err) } case 1: - seq := uint16(get16(buf[2:])) + seq := uint16(Get16(buf[2:])) if _, ok := c.cookies[seq]; !ok { continue } - size := get32(buf[4:]) + size := Get32(buf[4:]) if size > 0 { bigbuf := make([]byte, 32+size*4, 32+size*4) copy(bigbuf[0:32], buf) @@ -317,7 +307,8 @@ func (c *Conn) waitForReply(cookie *Cookie) ([]byte, error) { func (c *Conn) WaitForEvent() (Event, error) { for { if reply := c.events.dequeue(c); reply != nil { - return parseEvent(reply) + evCode := reply[0] & 0x7f + return newEventFuncs[int(evCode)](reply), nil } if !<-c.eventChan { return nil, errors.New("Event channel has been closed.") @@ -331,7 +322,8 @@ func (c *Conn) WaitForEvent() (Event, error) { // Only use this function to empty the queue without blocking. func (c *Conn) PollForEvent() (Event, error) { if reply := c.events.dequeue(c); reply != nil { - return parseEvent(reply) + evCode := reply[0] & 0x7f + return newEventFuncs[int(evCode)](reply), nil } return nil, nil } @@ -369,11 +361,11 @@ func Dial(display string) (*Conn, error) { buf := make([]byte, 12+pad(len(authName))+pad(len(authData))) buf[0] = 0x6c buf[1] = 0 - put16(buf[2:], 11) - put16(buf[4:], 0) - put16(buf[6:], uint16(len(authName))) - put16(buf[8:], uint16(len(authData))) - put16(buf[10:], 0) + Put16(buf[2:], 11) + Put16(buf[4:], 0) + Put16(buf[6:], uint16(len(authName))) + Put16(buf[8:], uint16(len(authData))) + Put16(buf[10:], 0) copy(buf[12:], []byte(authName)) copy(buf[12+pad(len(authName)):], authData) if _, err = c.conn.Write(buf); err != nil { @@ -386,9 +378,9 @@ func Dial(display string) (*Conn, error) { } code := head[0] reasonLen := head[1] - major := get16(head[2:]) - minor := get16(head[4:]) - dataLen := get16(head[6:]) + major := Get16(head[2:]) + minor := Get16(head[4:]) + dataLen := Get16(head[6:]) if major != 11 || minor != 0 { return nil, errors.New(fmt.Sprintf("x protocol version mismatch: %d.%d", major, minor)) @@ -405,7 +397,7 @@ func Dial(display string) (*Conn, error) { return nil, errors.New(fmt.Sprintf("x protocol authentication refused: %s", string(reason))) } - getSetupInfo(buf, &c.Setup) + ReadSetupInfo(buf, &c.Setup) if c.defaultScreen >= len(c.Setup.Roots) { c.defaultScreen = 0 diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index acb35de..f7b4948 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -1,5 +1,10 @@ package xgb +import ( + "fmt" + "strings" +) + // getExtensionOpcode retrieves the extension opcode from the extensions map. // If one doesn't exist, just return 0. An X error will likely result. func (c *Conn) getExtensionOpcode(name string) byte { @@ -14,52 +19,50 @@ func (c *Conn) bytesString(str string) []byte { return c.bytesPadding([]byte(str)) } -func (c *Conn) bytesStrList(list []Str, length int) []byte { - buf := make([]byte, 0) - for _, str := range list { - buf = append(buf, []byte(str.Name)...) - } - return c.bytesPadding(buf) +// stringsJoin is an alias to strings.Join. It allows us to avoid having to +// import 'strings' in each of the generated Go files. +func stringsJoin(ss []string, sep string) string { + return strings.Join(ss, sep) } -func (c *Conn) bytesUInt32List(list []uint32) []byte { - buf := make([]byte, len(list)*4) - for i, item := range list { - put32(buf[i*4:], item) - } - return c.bytesPadding(buf) -} - -func (c *Conn) bytesIdList(list []Id, length int) []byte { - buf := make([]byte, length*4) - for i, item := range list { - put32(buf[i*4:], uint32(item)) - } - return c.bytesPadding(buf) +// sprintf is so we don't need to import 'fmt' in the generated Go files. +func sprintf(format string, v ...interface{}) string { + return fmt.Sprintf(format, v...) } // Pad a length to align on 4 bytes. func pad(n int) int { return (n + 3) & ^3 } -func put16(buf []byte, v uint16) { +func Put16(buf []byte, v uint16) { buf[0] = byte(v) buf[1] = byte(v >> 8) } -func put32(buf []byte, v uint32) { +func Put32(buf []byte, v uint32) { buf[0] = byte(v) buf[1] = byte(v >> 8) buf[2] = byte(v >> 16) buf[3] = byte(v >> 24) } -func get16(buf []byte) uint16 { +func Put64(buf []byte, v uint64) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) + buf[2] = byte(v >> 16) + buf[3] = byte(v >> 24) + buf[4] = byte(v >> 32) + buf[5] = byte(v >> 40) + buf[6] = byte(v >> 48) + buf[7] = byte(v >> 56) +} + +func Get16(buf []byte) uint16 { v := uint16(buf[0]) v |= uint16(buf[1]) << 8 return v } -func get32(buf []byte) uint32 { +func Get32(buf []byte) uint32 { v := uint32(buf[0]) v |= uint32(buf[1]) << 8 v |= uint32(buf[2]) << 16 @@ -67,6 +70,18 @@ func get32(buf []byte) uint32 { return v } +func Get64(buf []byte) uint64 { + v := uint64(buf[0]) + v |= uint64(buf[1]) << 8 + v |= uint64(buf[2]) << 16 + v |= uint64(buf[3]) << 24 + v |= uint64(buf[4]) << 32 + v |= uint64(buf[5]) << 40 + v |= uint64(buf[6]) << 48 + v |= uint64(buf[7]) << 56 + return v +} + // Voodoo to count the number of bits set in a value list mask. func popCount(mask0 int) int { mask := uint32(mask0) @@ -82,22 +97,3 @@ func popCount(mask0 int) int { // DefaultScreen returns the Screen info for the default screen, which is // 0 or the one given in the display argument to Dial. func (c *Conn) DefaultScreen() *ScreenInfo { return &c.Setup.Roots[c.defaultScreen] } - -// ClientMessageData holds the data from a client message, -// duplicated in three forms because Go doesn't have unions. -// type ClientMessageData struct { - // Data8 [20]byte - // Data16 [10]uint16 - // Data32 [5]uint32 -// } -// -// func getClientMessageData(b []byte, v *ClientMessageData) int { - // copy(v.Data8[:], b) - // for i := 0; i < 10; i++ { - // v.Data16[i] = get16(b[i*2:]) - // } - // for i := 0; i < 5; i++ { - // v.Data32[i] = get32(b[i*4:]) - // } - // return 20 -// } diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 33641b3..3e484f3 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -5,6 +5,7 @@ import ( "encoding/xml" "fmt" "log" + "time" ) type Context struct { @@ -47,6 +48,26 @@ func (c *Context) Morph(xmlBytes []byte) { // Translate XML types to nice types c.protocol = parsedXml.Translate() + // Start with Go header. + c.Putln("package xgb") + c.Putln("") + c.Putln("/*") + c.Putln("\tThis file was generated by %s.xml on %s.", + c.protocol.Name, time.Now().Format("Jan 2 2006 3:04:05pm MST")) + c.Putln("\tThis file is automatically generated. Edit at your peril!") + c.Putln("*/") + c.Putln("") + + // Write imports in comments + if len(c.protocol.Imports) > 0 { + c.Putln("// Imports are not necessary for XGB because everything is ") + c.Putln("// in one package. They are still listed here for reference.") + for _, imp := range c.protocol.Imports { + c.Putln("// import \"%s\"", imp.Name) + } + c.Putln("") + } + // Now write Go source code for _, typ := range c.protocol.Types { typ.Define(c) diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index a975320..12bcb19 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -8,7 +8,7 @@ import ( type Expression interface { Concrete() bool Eval() uint - Reduce(prefix, fun string) string + Reduce(prefix string) string String() string Initialize(p *Protocol) } @@ -29,12 +29,12 @@ func (e *Function) Eval() uint { panic("unreachable") } -func (e *Function) Reduce(prefix, fun string) string { - return fmt.Sprintf("%s(%s)", e.Name, e.Expr.Reduce(prefix, fun)) +func (e *Function) Reduce(prefix string) string { + return fmt.Sprintf("%s(%s)", e.Name, e.Expr.Reduce(prefix)) } func (e *Function) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *Function) Initialize(p *Protocol) { @@ -89,16 +89,34 @@ func (e *BinaryOp) Eval() uint { panic("unreachable") } -func (e *BinaryOp) Reduce(prefix, fun string) string { +func (e *BinaryOp) Reduce(prefix string) string { if e.Concrete() { return fmt.Sprintf("%d", e.Eval()) } + + // An incredibly dirty hack to make sure any time we perform an operation + // on a field, we're dealing with ints... + expr1, expr2 := e.Expr1, e.Expr2 + switch expr1.(type) { + case *FieldRef: + expr1 = &Function{ + Name: "int", + Expr: expr1, + } + } + switch expr2.(type) { + case *FieldRef: + expr2 = &Function{ + Name: "int", + Expr: expr2, + } + } return fmt.Sprintf("(%s %s %s)", - e.Expr1.Reduce(prefix, fun), e.Op, e.Expr2.Reduce(prefix, fun)) + expr1.Reduce(prefix), e.Op, expr2.Reduce(prefix)) } func (e *BinaryOp) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *BinaryOp) Initialize(p *Protocol) { @@ -125,15 +143,15 @@ func (e *UnaryOp) Eval() uint { panic("unreachable") } -func (e *UnaryOp) Reduce(prefix, fun string) string { +func (e *UnaryOp) Reduce(prefix string) string { if e.Concrete() { return fmt.Sprintf("%d", e.Eval()) } - return fmt.Sprintf("(%s (%s))", e.Op, e.Expr.Reduce(prefix, fun)) + return fmt.Sprintf("(%s (%s))", e.Op, e.Expr.Reduce(prefix)) } func (e *UnaryOp) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *UnaryOp) Initialize(p *Protocol) { @@ -152,15 +170,15 @@ func (e *PopCount) Eval() uint { return popCount(e.Expr.Eval()) } -func (e *PopCount) Reduce(prefix, fun string) string { +func (e *PopCount) Reduce(prefix string) string { if e.Concrete() { return fmt.Sprintf("%d", e.Eval()) } - return fmt.Sprintf("popCount(%s)", e.Expr.Reduce(prefix, fun)) + return fmt.Sprintf("popCount(%s)", e.Expr.Reduce(prefix)) } func (e *PopCount) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *PopCount) Initialize(p *Protocol) { @@ -179,12 +197,12 @@ func (e *Value) Eval() uint { return e.v } -func (e *Value) Reduce(prefix, fun string) string { +func (e *Value) Reduce(prefix string) string { return fmt.Sprintf("%d", e.v) } func (e *Value) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *Value) Initialize(p *Protocol) {} @@ -201,12 +219,12 @@ func (e *Bit) Eval() uint { return 1 << e.b } -func (e *Bit) Reduce(prefix, fun string) string { +func (e *Bit) Reduce(prefix string) string { return fmt.Sprintf("%d", e.Eval()) } func (e *Bit) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *Bit) Initialize(p *Protocol) {} @@ -224,19 +242,16 @@ func (e *FieldRef) Eval() uint { panic("unreachable") } -func (e *FieldRef) Reduce(prefix, fun string) string { +func (e *FieldRef) Reduce(prefix string) string { val := e.Name if len(prefix) > 0 { val = fmt.Sprintf("%s%s", prefix, val) } - if len(fun) > 0 { - val = fmt.Sprintf("%s(%s)", fun, val) - } return val } func (e *FieldRef) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *FieldRef) Initialize(p *Protocol) { @@ -257,16 +272,12 @@ func (e *EnumRef) Eval() uint { panic("unreachable") } -func (e *EnumRef) Reduce(prefix, fun string) string { - val := fmt.Sprintf("%s%s", e.EnumKind, e.EnumItem) - if len(fun) > 0 { - val = fmt.Sprintf("%s(%s)", fun, val) - } - return val +func (e *EnumRef) Reduce(prefix string) string { + return fmt.Sprintf("%s%s", e.EnumKind, e.EnumItem) } func (e *EnumRef) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *EnumRef) Initialize(p *Protocol) { @@ -287,7 +298,7 @@ func (e *SumOf) Eval() uint { panic("unreachable") } -func (e *SumOf) Reduce(prefix, fun string) string { +func (e *SumOf) Reduce(prefix string) string { if len(prefix) > 0 { return fmt.Sprintf("sum(%s%s)", prefix, e.Name) } @@ -295,7 +306,7 @@ func (e *SumOf) Reduce(prefix, fun string) string { } func (e *SumOf) String() string { - return e.Reduce("", "") + return e.Reduce("") } func (e *SumOf) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 8d8412c..ddc2028 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -3,6 +3,7 @@ package main import ( "fmt" "log" + "strings" ) type Field interface { @@ -13,8 +14,8 @@ type Field interface { Size() Size Define(c *Context) - Read(c *Context) - Write(c *Context) + Read(c *Context, prefix string) + Write(c *Context, prefix string) } func (pad *PadField) Initialize(p *Protocol) {} @@ -32,7 +33,7 @@ func (p *PadField) XmlName() string { } func (f *PadField) SrcType() string { - panic("it is illegal to call SrcType on a SwitchField field") + panic("it is illegal to call SrcType on a PadField field") } func (p *PadField) Size() Size { @@ -82,22 +83,48 @@ func (f *ListField) XmlName() string { } func (f *ListField) SrcType() string { + if strings.ToLower(f.Type.XmlName()) == "char" { + return fmt.Sprintf("string") + } return fmt.Sprintf("[]%s", f.Type.SrcName()) } +func (f *ListField) Length() Size { + if f.LengthExpr == nil { + return newExpressionSize(&Function{ + Name: "len", + Expr: &FieldRef{ + Name: f.SrcName(), + }, + }) + } + return newExpressionSize(f.LengthExpr) +} + func (f *ListField) Size() Size { simpleLen := &Function{ Name: "pad", - Expr: newBinaryOp("*", f.LengthExpr, f.Type.Size().Expression), + Expr: newBinaryOp("*", f.Length().Expression, f.Type.Size().Expression), } - switch f.Type.(type) { + switch field := f.Type.(type) { case *Struct: - sizeFun := &Function{ - Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), - Expr: &FieldRef{Name: f.SrcName()}, + if field.HasList() { + sizeFun := &Function{ + Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), + Expr: &FieldRef{Name: f.SrcName()}, + } + return newExpressionSize(sizeFun) + } else { + return newExpressionSize(simpleLen) } - return newExpressionSize(sizeFun) + case *Union: + return newExpressionSize(simpleLen) + // sizeFun := &Function{ + // Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), + // Expr: &FieldRef{Name: f.SrcName()}, + // } + // return newExpressionSize(sizeFun) case *Base: return newExpressionSize(simpleLen) case *Resource: @@ -152,6 +179,7 @@ func (f *ExprField) Initialize(p *Protocol) { } type ValueField struct { + Parent interface{} MaskType Type MaskName string ListName string @@ -170,7 +198,34 @@ func (f *ValueField) SrcType() string { } func (f *ValueField) Size() Size { - return f.MaskType.Size() + maskSize := f.MaskType.Size() + listSize := newExpressionSize(&Function{ + Name: "pad", + Expr: &BinaryOp{ + Op: "*", + Expr1: &Value{v: 4}, + Expr2: &PopCount{ + Expr: &Function{ + Name: "int", + Expr: &FieldRef{ + Name: f.MaskName, + }, + }, + }, + }, + }) + return maskSize.Add(listSize) +} + +func (f *ValueField) ListLength() Size { + return newExpressionSize(&PopCount{ + Expr: &Function{ + Name: "int", + Expr: &FieldRef{ + Name: f.MaskName, + }, + }, + }) } func (f *ValueField) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index b7b153e..771cfcf 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -1,5 +1,9 @@ package main +import ( + "fmt" +) + // xgbResourceIdName is the name of the type used for all resource identifiers. // As of right now, it needs to be declared somewhere manually. var xgbGenResourceIdName = "Id" @@ -94,26 +98,28 @@ func (f *PadField) Define(c *Context) { c.Putln("// padding: %d bytes", f.Bytes) } -func (f *PadField) Read(c *Context) { +func (f *PadField) Read(c *Context, prefix string) { c.Putln("b += %s // padding", f.Size()) } -func (f *PadField) Write(c *Context) { +func (f *PadField) Write(c *Context, prefix string) { c.Putln("b += %s // padding", f.Size()) } // Local fields func (f *LocalField) Define(c *Context) { c.Putln("// local field: %s %s", f.SrcName(), f.Type.SrcName()) + panic("unreachable") } -func (f *LocalField) Read(c *Context) { +func (f *LocalField) Read(c *Context, prefix string) { c.Putln("// reading local field: %s (%s) :: %s", f.SrcName(), f.Size(), f.Type.SrcName()) + panic("unreachable") } -func (f *LocalField) Write(c *Context) { - c.Putln("// writing local field: %s (%s) :: %s", +func (f *LocalField) Write(c *Context, prefix string) { + c.Putln("// skip writing local field: %s (%s) :: %s", f.SrcName(), f.Size(), f.Type.SrcName()) } @@ -121,32 +127,49 @@ func (f *LocalField) Write(c *Context) { func (f *ExprField) Define(c *Context) { c.Putln("// expression field: %s %s (%s)", f.SrcName(), f.Type.SrcName(), f.Expr) + panic("unreachable") } -func (f *ExprField) Read(c *Context) { +func (f *ExprField) Read(c *Context, prefix string) { c.Putln("// reading expression field: %s (%s) (%s) :: %s", f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) + panic("unreachable") } -func (f *ExprField) Write(c *Context) { - c.Putln("// writing expression field: %s (%s) (%s) :: %s", - f.SrcName(), f.Size(), f.Expr, f.Type.SrcName()) +func (f *ExprField) Write(c *Context, prefix string) { + // Special case for bools, grrr. + if f.Type.SrcName() == "bool" { + c.Putln("buf[b] = byte(%s)", f.Expr.Reduce(prefix)) + c.Putln("b += 1") + } else { + WriteSimpleSingleField(c, f.Expr.Reduce(prefix), f.Type) + } } // Value field func (f *ValueField) Define(c *Context) { c.Putln("// valueparam field: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) + panic("todo") } -func (f *ValueField) Read(c *Context) { +func (f *ValueField) Read(c *Context, prefix string) { c.Putln("// reading valueparam: type: %s, mask name: %s, list name: %s", f.MaskType.SrcName(), f.MaskName, f.ListName) + panic("todo") } -func (f *ValueField) Write(c *Context) { - c.Putln("// writing valueparam: type: %s, mask name: %s, list name: %s", - f.MaskType.SrcName(), f.MaskName, f.ListName) +func (f *ValueField) Write(c *Context, prefix string) { + // big time mofos + if rq, ok := f.Parent.(*Request); !ok || rq.SrcName() != "ConfigureWindow" { + WriteSimpleSingleField(c, + fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType) + } + c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) + c.Putln("Put32(buf[b:], %s%s[i])", prefix, f.ListName) + c.Putln("b += 4") + c.Putln("}") + c.Putln("b = pad(b)") } // Switch field @@ -155,12 +178,12 @@ func (f *SwitchField) Define(c *Context) { panic("todo") } -func (f *SwitchField) Read(c *Context) { +func (f *SwitchField) Read(c *Context, prefix string) { c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) panic("todo") } -func (f *SwitchField) Write(c *Context) { +func (f *SwitchField) Write(c *Context, prefix string) { c.Putln("// writing switch field: %s (%s)", f.Name, f.Expr) panic("todo") } diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 17c0db5..5a51064 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -1,5 +1,9 @@ package main +import ( + "fmt" +) + // Error types func (e *Error) Define(c *Context) { c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) @@ -20,9 +24,8 @@ func (e *Error) Define(c *Context) { // error struct. e.Read(c) - // Makes sure that this error type is an Error interface. - c.Putln("func (v %s) ImplementsError() { }", e.ErrType()) - c.Putln("") + // Makes sure this error type implements the xgb.Error interface. + e.ImplementsError(c) // Let's the XGB event loop read this error. c.Putln("func init() {") @@ -33,18 +36,18 @@ func (e *Error) Define(c *Context) { func (e *Error) Read(c *Context) { c.Putln("// Error read %s", e.SrcName()) - c.Putln("func New%s(buf []byte) %s {", e.ErrType(), e.ErrType()) + c.Putln("func New%s(buf []byte) Error {", e.ErrType()) c.Putln("v := %s{}", e.ErrType()) c.Putln("v.NiceName = \"%s\"", e.SrcName()) c.Putln("") c.Putln("b := 1 // skip error determinant") c.Putln("b += 1 // don't read error number") c.Putln("") - c.Putln("v.Sequence = get16(buf[b:])") + c.Putln("v.Sequence = Get16(buf[b:])") c.Putln("b += 2") c.Putln("") for _, field := range e.Fields { - field.Read(c) + field.Read(c, "v.") c.Putln("") } c.Putln("return v") @@ -52,6 +55,24 @@ func (e *Error) Read(c *Context) { c.Putln("") } +// ImplementsError writes functions to implement the XGB Error interface. +func (e *Error) ImplementsError(c *Context) { + c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) + c.Putln("") + c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType()) + c.Putln("return err.Sequence") + c.Putln("}") + c.Putln("") + c.Putln("func (err %s) BadId() Id {", e.ErrType()) + c.Putln("return Id(err.BadValue)") + c.Putln("}") + c.Putln("") + c.Putln("func (err %s) Error() string {", e.ErrType()) + FieldString(c, e.Fields, e.ErrConst()) + c.Putln("}") + c.Putln("") +} + // ErrorCopy types func (e *ErrorCopy) Define(c *Context) { c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number) @@ -65,9 +86,8 @@ func (e *ErrorCopy) Define(c *Context) { // error struct. e.Read(c) - // Makes sure that this error type is an Error interface. - c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) - c.Putln("") + // Makes sure this error type implements the xgb.Error interface. + e.ImplementsError(c) // Let's the XGB know how to read this error. c.Putln("func init() {") @@ -77,8 +97,54 @@ func (e *ErrorCopy) Define(c *Context) { } func (e *ErrorCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) %s {", e.ErrType(), e.ErrType()) - c.Putln("return %s(New%s(buf))", e.ErrType(), e.Old.(*Error).ErrType()) + c.Putln("func New%s(buf []byte) Error {", e.ErrType()) + c.Putln("v := %s(New%s(buf).(%s))", + e.ErrType(), e.Old.(*Error).ErrType(), e.Old.(*Error).ErrType()) + c.Putln("v.NiceName = \"%s\"", e.SrcName()) + c.Putln("return v") c.Putln("}") c.Putln("") } + +// ImplementsError writes functions to implement the XGB Error interface. +func (e *ErrorCopy) ImplementsError(c *Context) { + c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) + c.Putln("") + c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType()) + c.Putln("return err.Sequence") + c.Putln("}") + c.Putln("") + c.Putln("func (err %s) BadId() Id {", e.ErrType()) + c.Putln("return Id(err.BadValue)") + c.Putln("}") + c.Putln("") + c.Putln("func (err %s) Error() string {", e.ErrType()) + FieldString(c, e.Old.(*Error).Fields, e.ErrConst()) + c.Putln("}") + c.Putln("") +} + +// FieldString works for both Error and ErrorCopy. It assembles all of the +// fields in an error and formats them into a single string. +func FieldString(c *Context, fields []Field, errName string) { + c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) + c.Putln("fieldVals = append(fieldVals, \"NiceName: \" + err.NiceName)") + c.Putln("fieldVals = append(fieldVals, " + + "sprintf(\"Sequence: %s\", err.Sequence))", "%d") + for _, field := range fields { + switch field.(type) { + case *PadField: + continue + default: + if field.SrcType() == "string" { + c.Putln("fieldVals = append(fieldVals, \"%s: \" + err.%s)", + field.SrcName(), field.SrcName()) + } else { + format := fmt.Sprintf("sprintf(\"%s: %s\", err.%s)", + field.SrcName(), "%d", field.SrcName()) + c.Putln("fieldVals = append(fieldVals, %s)", format) + } + } + } + c.Putln("return \"%s {\" + stringsJoin(fieldVals, \", \") + \"}\"", errName) +} diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index fe2a77e..71252a7 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -38,17 +38,17 @@ func (e *Event) Define(c *Context) { func (e *Event) Read(c *Context) { c.Putln("// Event read %s", e.SrcName()) - c.Putln("func New%s(buf []byte) %s {", e.EvType(), e.EvType()) + c.Putln("func New%s(buf []byte) Event {", e.EvType()) c.Putln("v := %s{}", e.EvType()) c.Putln("b := 1 // don't read event number") c.Putln("") for i, field := range e.Fields { if i == 1 && !e.NoSequence { - c.Putln("v.Sequence = get16(buf[b:])") + c.Putln("v.Sequence = Get16(buf[b:])") c.Putln("b += 2") c.Putln("") } - field.Read(c) + field.Read(c, "v.") c.Putln("") } c.Putln("return v") @@ -71,7 +71,7 @@ func (e *Event) Write(c *Context) { c.Putln("b += 2 // skip sequence number") c.Putln("") } - field.Write(c) + field.Write(c, "v.") c.Putln("") } c.Putln("return buf") @@ -108,15 +108,16 @@ func (e *EventCopy) Define(c *Context) { } func (e *EventCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) %s {", e.EvType(), e.EvType()) - c.Putln("return %s(New%s(buf))", e.EvType(), e.Old.(*Event).EvType()) + c.Putln("func New%s(buf []byte) Event {", e.EvType()) + c.Putln("return %s(New%s(buf).(%s))", + e.EvType(), e.Old.(*Event).EvType(), e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") } func (e *EventCopy) Write(c *Context) { c.Putln("func (v %s) Bytes() []byte {", e.EvType()) - c.Putln("return %s(ev).Bytes()", e.Old.(*Event).EvType()) + c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index 67ecd34..41cfb76 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -3,74 +3,107 @@ package main import ( "fmt" "log" + "strings" ) // List fields func (f *ListField) Define(c *Context) { - c.Putln("%s []%s // size: %s", - f.SrcName(), f.Type.SrcName(), f.Size()) + c.Putln("%s %s // size: %s", + f.SrcName(), f.SrcType(), f.Size()) } -func (f *ListField) Read(c *Context) { +func (f *ListField) Read(c *Context, prefix string) { switch t := f.Type.(type) { case *Resource: - length := f.LengthExpr.Reduce("v.", "") - c.Putln("v.%s = make([]Id, %s)", f.SrcName(), length) - c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + length := f.LengthExpr.Reduce(prefix) + c.Putln("%s%s = make([]Id, %s)", prefix, f.SrcName(), length) + c.Putln("for i := 0; i < int(%s); i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") c.Putln("b = pad(b)") case *Base: - length := f.LengthExpr.Reduce("v.", "") - c.Putln("v.%s = make([]%s, %s)", f.SrcName(), t.SrcName(), length) - if t.SrcName() == "byte" { - c.Putln("copy(v.%s[:%s], buf[b:])", f.SrcName(), length) - c.Putln("b += pad(%s)", length) + length := f.LengthExpr.Reduce(prefix) + if strings.ToLower(t.XmlName()) == "char" { + c.Putln("{") + c.Putln("byteString := make([]%s, %s)", t.SrcName(), length) + c.Putln("copy(byteString[:%s], buf[b:])", length) + c.Putln("%s%s = string(byteString)", prefix, f.SrcName()) + c.Putln("b += pad(int(%s))", length) + c.Putln("}") + } else if t.SrcName() == "byte" { + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), length) + c.Putln("copy(%s%s[:%s], buf[b:])", prefix, f.SrcName(), length) + c.Putln("b += pad(int(%s))", length) } else { - c.Putln("for i := 0; i < %s; i++ {", length) - ReadSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), length) + c.Putln("for i := 0; i < int(%s); i++ {", length) + ReadSimpleSingleField(c, + fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") c.Putln("b = pad(b)") } + case *TypeDef: + length := f.LengthExpr.Reduce(prefix) + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), length) + c.Putln("for i := 0; i < int(%s); i++ {", length) + ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") case *Union: - c.Putln("v.%s = make([]%s, %s)", - f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) - c.Putln("b += Read%sList(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), f.LengthExpr.Reduce(prefix)) + c.Putln("b += Read%sList(buf[b:], %s%s)", + t.SrcName(), prefix, f.SrcName()) case *Struct: - c.Putln("v.%s = make([]%s, %s)", - f.SrcName(), t.SrcName(), f.LengthExpr.Reduce("v.", "")) - c.Putln("b += Read%sList(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), f.LengthExpr.Reduce(prefix)) + c.Putln("b += Read%sList(buf[b:], %s%s)", + t.SrcName(), prefix, f.SrcName()) default: log.Panicf("Cannot read list field '%s' with %T type.", f.XmlName(), f.Type) } } -func (f *ListField) Write(c *Context) { +func (f *ListField) Write(c *Context, prefix string) { switch t := f.Type.(type) { case *Resource: - length := f.LengthExpr.Reduce("v.", "") - c.Putln("for i := 0; i < %s; i++", length) - WriteSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + length := f.Length().Reduce(prefix) + c.Putln("for i := 0; i < int(%s); i++ {", length) + WriteSimpleSingleField(c, + fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") c.Putln("b = pad(b)") case *Base: - length := f.LengthExpr.Reduce("v.", "") + length := f.Length().Reduce(prefix) if t.SrcName() == "byte" { - c.Putln("copy(buf[b:], v.%s[:%s])", f.SrcName(), length) - c.Putln("b += pad(%s)", length) + c.Putln("copy(buf[b:], %s%s[:%s])", prefix, f.SrcName(), length) + c.Putln("b += pad(int(%s))", length) } else { - c.Putln("for i := 0; i < %s; i++ {", length) - WriteSimpleSingleField(c, fmt.Sprintf("v.%s[i]", f.SrcName()), t) + c.Putln("for i := 0; i < int(%s); i++ {", length) + WriteSimpleSingleField(c, + fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") c.Putln("b = pad(b)") } + case *TypeDef: + length := f.Length().Reduce(prefix) + c.Putln("for i := 0; i < int(%s); i++ {", length) + WriteSimpleSingleField(c, + fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) + c.Putln("}") + c.Putln("b = pad(b)") case *Union: - c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + c.Putln("b += %sListBytes(buf[b:], %s%s)", + t.SrcName(), prefix, f.SrcName()) case *Struct: - c.Putln("b += %sListBytes(buf[b:], v.%s)", t.SrcName(), f.SrcName()) + c.Putln("b += %sListBytes(buf[b:], %s%s)", + t.SrcName(), prefix, f.SrcName()) default: - log.Panicf("Cannot read list field '%s' with %T type.", + log.Panicf("Cannot write list field '%s' with %T type.", f.XmlName(), f.Type) } } diff --git a/nexgb/xgbgen/go_reply.go b/nexgb/xgbgen/go_reply.go deleted file mode 100644 index e561d9c..0000000 --- a/nexgb/xgbgen/go_reply.go +++ /dev/null @@ -1,19 +0,0 @@ -package main - -func (r *Request) Define(c *Context) { - c.Putln("// Request %s", r.SrcName()) - c.Putln("// size: %s", r.Size(c)) - c.Putln("") - if r.Reply != nil { - c.Putln("// Request reply for %s", r.SrcName()) - c.Putln("// size: %s", r.Reply.Size()) - c.Putln("type %s struct {", r.ReplyName()) - c.Putln("Sequence uint16") - for _, field := range r.Reply.Fields { - field.Define(c) - } - c.Putln("}") - c.Putln("") - } -} - diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go new file mode 100644 index 0000000..e6180a1 --- /dev/null +++ b/nexgb/xgbgen/go_request_reply.go @@ -0,0 +1,140 @@ +package main + +import ( + "fmt" + "strings" +) + +func (r *Request) Define(c *Context) { + c.Putln("// Request %s", r.SrcName()) + c.Putln("// size: %s", r.Size(c)) + if r.Reply != nil { + c.Putln("func (c *Conn) %s(%s) (*%s, error) {", + r.SrcName(), r.ParamNameTypes(), r.ReplyName()) + c.Putln("return c.%s(c.%s(%s))", + r.ReplyName(), r.ReqName(), r.ParamNames()) + c.Putln("}") + c.Putln("") + + r.WriteRequest(c) + r.ReadReply(c) + } else { + c.Putln("// Write request to wire for %s", r.SrcName()) + c.Putln("func (c *Conn) %s(%s) {", r.SrcName(), r.ParamNameTypes()) + r.WriteRequestFields(c) + c.Putln("c.sendRequest(false, buf)") + c.Putln("}") + c.Putln("") + } +} + +func (r *Request) ReadReply(c *Context) { + c.Putln("// Request reply for %s", r.SrcName()) + c.Putln("// size: %s", r.Reply.Size()) + c.Putln("type %s struct {", r.ReplyName()) + c.Putln("Sequence uint16") + c.Putln("Length uint32") + for _, field := range r.Reply.Fields { + field.Define(c) + } + c.Putln("}") + c.Putln("") + + c.Putln("// Read reply %s", r.SrcName()) + c.Putln("func (c *Conn) %s(cook *Cookie) (*%s, error) {", + r.ReplyName(), r.ReplyName()) + c.Putln("buf, err := c.waitForReply(cook)") + c.Putln("if err != nil {") + c.Putln("return nil, err") + c.Putln("}") + c.Putln("") + c.Putln("v := new(%s)", r.ReplyName()) + c.Putln("b := 1 // skip reply determinant") + c.Putln("") + for i, field := range r.Reply.Fields { + if i == 1 { + c.Putln("v.Sequence = Get16(buf[b:])") + c.Putln("b += 2") + c.Putln("") + c.Putln("v.Length = Get32(buf[b:]) // 4-byte units") + c.Putln("b += 4") + c.Putln("") + } + field.Read(c, "v.") + c.Putln("") + } + c.Putln("return v, nil") + c.Putln("}") + c.Putln("") +} + +func (r *Request) WriteRequest(c *Context) { + c.Putln("// Write request to wire for %s", r.SrcName()) + c.Putln("func (c *Conn) %s(%s) *Cookie {", r.ReqName(), r.ParamNameTypes()) + r.WriteRequestFields(c) + c.Putln("return c.sendRequest(true, buf)") + c.Putln("}") + c.Putln("") +} + +func (r *Request) WriteRequestFields(c *Context) { + c.Putln("size := %s", r.Size(c)) + c.Putln("b := 0") + c.Putln("buf := make([]byte, size)") + c.Putln("") + c.Putln("buf[b] = %d // request opcode", r.Opcode) + c.Putln("b += 1") + c.Putln("") + for i, field := range r.Fields { + if i == 1 { + c.Putln("Put16(buf[b:], uint16(size / 4)) "+ + "// write request size in 4-byte units") + c.Putln("b += 2") + c.Putln("") + } + field.Write(c, "") + c.Putln("") + } +} + +func (r *Request) ParamNames() string { + names := make([]string, 0, len(r.Fields)) + for _, field := range r.Fields { + switch f := field.(type) { + case *ValueField: + names = append(names, f.MaskName) + names = append(names, f.ListName) + case *PadField: + continue + case *ExprField: + continue + default: + names = append(names, fmt.Sprintf("%s", field.SrcName())) + } + } + return strings.Join(names, ",") +} + +func (r *Request) ParamNameTypes() string { + nameTypes := make([]string, 0, len(r.Fields)) + for _, field := range r.Fields { + switch f := field.(type) { + case *ValueField: + // mofos... + if r.SrcName() != "ConfigureWindow" { + nameTypes = append(nameTypes, + fmt.Sprintf("%s %s", f.MaskName, f.MaskType.SrcName())) + } + nameTypes = append(nameTypes, + fmt.Sprintf("%s []uint32", f.ListName)) + case *PadField: + continue + case *ExprField: + continue + default: + nameTypes = append(nameTypes, + fmt.Sprintf("%s %s", field.SrcName(), field.SrcType())) + } + } + return strings.Join(nameTypes, ",") +} diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go index bf31259..ea43d55 100644 --- a/nexgb/xgbgen/go_single_field.go +++ b/nexgb/xgbgen/go_single_field.go @@ -12,17 +12,17 @@ func (f *SingleField) Define(c *Context) { func ReadSimpleSingleField(c *Context, name string, typ Type) { switch t := typ.(type) { case *Resource: - c.Putln("%s = get32(buf[b:])", name) + c.Putln("%s = Id(Get32(buf[b:]))", name) case *TypeDef: switch t.Size().Eval() { case 1: c.Putln("%s = %s(buf[b])", name, t.SrcName()) case 2: - c.Putln("%s = %s(get16(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(Get16(buf[b:]))", name, t.SrcName()) case 4: - c.Putln("%s = %s(get32(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(Get32(buf[b:]))", name, t.SrcName()) case 8: - c.Putln("%s = %s(get64(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(Get64(buf[b:]))", name, t.SrcName()) } case *Base: // If this is a bool, stop short and do something special. @@ -40,11 +40,11 @@ func ReadSimpleSingleField(c *Context, name string, typ Type) { case 1: val = fmt.Sprintf("buf[b]") case 2: - val = fmt.Sprintf("get16(buf[b:])") + val = fmt.Sprintf("Get16(buf[b:])") case 4: - val = fmt.Sprintf("get32(buf[b:])") + val = fmt.Sprintf("Get32(buf[b:])") case 8: - val = fmt.Sprintf("get64(buf[b:])") + val = fmt.Sprintf("Get64(buf[b:])") } // We need to convert base types if they aren't uintXX or byte @@ -61,20 +61,20 @@ func ReadSimpleSingleField(c *Context, name string, typ Type) { c.Putln("b += %s", typ.Size()) } -func (f *SingleField) Read(c *Context) { +func (f *SingleField) Read(c *Context, prefix string) { switch t := f.Type.(type) { case *Resource: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + ReadSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *TypeDef: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + ReadSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *Base: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + ReadSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *Struct: - c.Putln("v.%s = %s{}", f.SrcName(), t.SrcName()) - c.Putln("b += Read%s(buf[b:], &v.%s)", t.SrcName(), f.SrcName()) + c.Putln("%s%s = %s{}", prefix, f.SrcName(), t.SrcName()) + c.Putln("b += Read%s(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) case *Union: - c.Putln("v.%s = %s{}", f.SrcName(), t.SrcName()) - c.Putln("b += Read%s(buf[b:], &v.%s)", t.SrcName(), f.SrcName()) + c.Putln("%s%s = %s{}", prefix, f.SrcName(), t.SrcName()) + c.Putln("b += Read%s(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) default: log.Panicf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) } @@ -83,17 +83,17 @@ func (f *SingleField) Read(c *Context) { func WriteSimpleSingleField(c *Context, name string, typ Type) { switch t := typ.(type) { case *Resource: - c.Putln("put32(buf[b:], uint32(%s))", name) + c.Putln("Put32(buf[b:], uint32(%s))", name) case *TypeDef: switch t.Size().Eval() { case 1: c.Putln("buf[b] = byte(%s)", name) case 2: - c.Putln("put16(buf[b:], uint16(%s))", name) + c.Putln("Put16(buf[b:], uint16(%s))", name) case 4: - c.Putln("put32(buf[b:], uint32(%s))", name) + c.Putln("Put32(buf[b:], uint32(%s))", name) case 8: - c.Putln("put64(buf[b:], uint64(%s))", name) + c.Putln("Put64(buf[b:], uint64(%s))", name) } case *Base: // If this is a bool, stop short and do something special. @@ -115,21 +115,21 @@ func WriteSimpleSingleField(c *Context, name string, typ Type) { } case 2: if t.SrcName() != "uint16" { - c.Putln("put16(buf[b:], uint16(%s))", name) + c.Putln("Put16(buf[b:], uint16(%s))", name) } else { - c.Putln("put16(buf[b:], %s)", name) + c.Putln("Put16(buf[b:], %s)", name) } case 4: if t.SrcName() != "uint32" { - c.Putln("put32(buf[b:], uint32(%s))", name) + c.Putln("Put32(buf[b:], uint32(%s))", name) } else { - c.Putln("put32(buf[b:], %s)", name) + c.Putln("Put32(buf[b:], %s)", name) } case 8: if t.SrcName() != "uint64" { - c.Putln("put64(buf[b:], uint64(%s))", name) + c.Putln("Put64(buf[b:], uint64(%s))", name) } else { - c.Putln("put64(buf[b:], %s)", name) + c.Putln("Put64(buf[b:], %s)", name) } } default: @@ -140,23 +140,23 @@ func WriteSimpleSingleField(c *Context, name string, typ Type) { c.Putln("b += %s", typ.Size()) } -func (f *SingleField) Write(c *Context) { +func (f *SingleField) Write(c *Context, prefix string) { switch t := f.Type.(type) { case *Resource: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + WriteSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *TypeDef: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + WriteSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *Base: - ReadSimpleSingleField(c, fmt.Sprintf("v.%s", f.SrcName()), t) + WriteSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *Union: c.Putln("{") - c.Putln("unionBytes := v.%s.Bytes()", f.SrcName()) + c.Putln("unionBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], unionBytes)") c.Putln("b += pad(len(unionBytes))") c.Putln("}") case *Struct: c.Putln("{") - c.Putln("structBytes := v.%s.Bytes()", f.SrcName()) + c.Putln("structBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], structBytes)") c.Putln("b += pad(len(structBytes))") c.Putln("}") diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 600ebaf..1e43199 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -22,8 +22,11 @@ func (s *Struct) Define(c *Context) { // Write function that writes a list of this struct. s.WriteList(c) - // Write function that computes the size of a list of these structs. - s.WriteListSize(c) + // Write function that computes the size of a list of these structs, + // IF there is a list field in this struct. + if s.HasList() { + s.WriteListSize(c) + } } // Read for a struct creates a function 'ReadStructName' that takes a source @@ -37,7 +40,8 @@ func (s *Struct) Read(c *Context) { c.Putln("b := 0") c.Putln("") for _, field := range s.Fields { - field.Read(c) + field.Read(c, "v.") + c.Putln("") } c.Putln("return b") @@ -68,11 +72,12 @@ func (s *Struct) ReadList(c *Context) { func (s *Struct) Write(c *Context) { c.Putln("// Struct write %s", s.SrcName()) c.Putln("func (v %s) Bytes() []byte {", s.SrcName()) - c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v.", "")) + c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v.")) c.Putln("b := 0") c.Putln("") for _, field := range s.Fields { - field.Write(c) + field.Write(c, "v.") + c.Putln("") } c.Putln("return buf") c.Putln("}") @@ -87,7 +92,7 @@ func (s *Struct) WriteList(c *Context) { c.Putln("var structBytes []byte") c.Putln("for _, item := range list {") c.Putln("structBytes = item.Bytes()") - c.Putln("copy(buf[b:], len(structBytes))") + c.Putln("copy(buf[b:], structBytes)") c.Putln("b += pad(len(structBytes))") c.Putln("}") c.Putln("return b") @@ -100,7 +105,7 @@ func (s *Struct) WriteListSize(c *Context) { c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName()) c.Putln("size := 0") c.Putln("for _, item := range list {") - c.Putln("size += %s", s.Size().Reduce("item.", "")) + c.Putln("size += %s", s.Size().Reduce("item.")) c.Putln("}") c.Putln("return size") c.Putln("}") diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 3b7365d..9f339af 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -34,9 +34,6 @@ func (u *Union) Define(c *Context) { // Write function that writes a list of this union. u.WriteList(c) - - // Write function that computes the size of a list of these unions. - u.WriteListSize(c) } func (u *Union) New(c *Context) { @@ -49,7 +46,7 @@ func (u *Union) New(c *Context) { c.Putln("var b int") c.Putln("buf := make([]byte, %s)", u.Size()) c.Putln("") - field.Write(c) + field.Write(c, "") c.Putln("") c.Putln("// Create the Union type") c.Putln("v := %s{}", u.SrcName()) @@ -58,7 +55,7 @@ func (u *Union) New(c *Context) { c.Putln("") for _, field2 := range u.Fields { c.Putln("b = 0 // always read the same bytes") - field2.Read(c) + field2.Read(c, "v.") c.Putln("") } c.Putln("return v") @@ -74,7 +71,7 @@ func (u *Union) Read(c *Context) { c.Putln("") for _, field := range u.Fields { c.Putln("b = 0 // re-read the same bytes") - field.Read(c) + field.Read(c, "v.") c.Putln("") } c.Putln("return %s", u.Size()) @@ -106,10 +103,10 @@ func (u *Union) Write(c *Context) { c.Putln("// Each field in a union must contain the same data.") c.Putln("// So simply pick the first field and write that to the wire.") c.Putln("func (v %s) Bytes() []byte {", u.SrcName()) - c.Putln("buf := make([]byte, %s)", u.Size().Reduce("v.", "")) + c.Putln("buf := make([]byte, %s)", u.Size().Reduce("v.")) c.Putln("b := 0") c.Putln("") - u.Fields[0].Write(c) + u.Fields[0].Write(c, "v.") c.Putln("return buf") c.Putln("}") c.Putln("") @@ -123,7 +120,7 @@ func (u *Union) WriteList(c *Context) { c.Putln("var unionBytes []byte") c.Putln("for _, item := range list {") c.Putln("unionBytes = item.Bytes()") - c.Putln("copy(buf[b:], len(unionBytes))") + c.Putln("copy(buf[b:], unionBytes)") c.Putln("b += pad(len(unionBytes))") c.Putln("}") c.Putln("return b") @@ -136,7 +133,7 @@ func (u *Union) WriteListSize(c *Context) { c.Putln("func %sListSize(list []%s) int {", u.SrcName(), u.SrcName()) c.Putln("size := 0") c.Putln("for _, item := range list {") - c.Putln("size += %s", u.Size().Reduce("item.", "")) + c.Putln("size += %s", u.Size().Reduce("item.")) c.Putln("}") c.Putln("return size") c.Putln("}") diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go index e5d2202..ef62157 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/representation.go @@ -65,6 +65,10 @@ func (r *Request) ReplyName() string { return fmt.Sprintf("%sReply", r.SrcName()) } +func (r *Request) ReqName() string { + return fmt.Sprintf("%sRequest", r.SrcName()) +} + // Size for Request needs a context. // Namely, if this is an extension, we need to account for *four* bytes // of a header (extension opcode, request opcode, and the sequence number). @@ -80,7 +84,20 @@ func (r *Request) Size(c *Context) Size { } for _, field := range r.Fields { - size = size.Add(field.Size()) + switch field.(type) { + case *LocalField: + continue + case *SingleField: + // mofos!!! + if r.SrcName() == "ConfigureWindow" && + field.SrcName() == "ValueMask" { + + continue + } + size = size.Add(field.Size()) + default: + size = size.Add(field.Size()) + } } return size } diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 9c7603b..fe5a52b 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -138,7 +138,7 @@ func (x *XMLEvent) Translate() *Event { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - ev.Fields[i] = field.Translate() + ev.Fields[i] = field.Translate(ev) } return ev } @@ -158,7 +158,7 @@ func (x *XMLError) Translate() *Error { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - err.Fields[i] = field.Translate() + err.Fields[i] = field.Translate(err) } return err } @@ -177,7 +177,7 @@ func (x *XMLStruct) Translate() *Struct { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - s.Fields[i] = field.Translate() + s.Fields[i] = field.Translate(s) } return s } @@ -188,7 +188,7 @@ func (x *XMLUnion) Translate() *Union { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - u.Fields[i] = field.Translate() + u.Fields[i] = field.Translate(u) } return u } @@ -202,7 +202,7 @@ func (x *XMLRequest) Translate() *Request { Reply: x.Reply.Translate(), } for i, field := range x.Fields { - r.Fields[i] = field.Translate() + r.Fields[i] = field.Translate(r) } // Address bug (or legacy code) in QueryTextExtents. @@ -230,7 +230,7 @@ func (x *XMLReply) Translate() *Reply { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - r.Fields[i] = field.Translate() + r.Fields[i] = field.Translate(r) } return r } @@ -309,7 +309,7 @@ func (x *XMLExpression) Translate() Expression { panic("unreachable") } -func (x *XMLField) Translate() Field { +func (x *XMLField) Translate(parent interface{}) Field { switch x.XMLName.Local { case "pad": return &PadField{ @@ -339,6 +339,7 @@ func (x *XMLField) Translate() Field { } case "valueparam": return &ValueField{ + Parent: parent, MaskType: newTranslation(x.ValueMaskType), MaskName: x.ValueMaskName, ListName: x.ValueListName, @@ -365,7 +366,7 @@ func (x *XMLBitcase) Translate() *Bitcase { Fields: make([]Field, len(x.Fields)), } for i, field := range x.Fields { - b.Fields[i] = field.Translate() + b.Fields[i] = field.Translate(b) } return b } diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index d8e76a2..3498463 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -334,6 +334,18 @@ func (s *Struct) Initialize(p *Protocol) { } } +// HasList returns whether there is a field in this struct that is a list. +// When true, a more involved calculation is necessary to compute this struct's +// size. +func (s *Struct) HasList() bool { + for _, field := range s.Fields { + if _, ok := field.(*ListField); ok { + return true + } + } + return false +} + type Union struct { srcName string xmlName string diff --git a/nexgb/xproto.go b/nexgb/xproto.go new file mode 100644 index 0000000..3317b51 --- /dev/null +++ b/nexgb/xproto.go @@ -0,0 +1,11215 @@ +package xgb + +/* + This file was generated by xproto.xml on May 3 2012 12:48:47am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + VisualClassStaticGray = 0 + VisualClassGrayScale = 1 + VisualClassStaticColor = 2 + VisualClassPseudoColor = 3 + VisualClassTrueColor = 4 + VisualClassDirectColor = 5 +) + +const ( + EventMaskNoEvent = 0 + EventMaskKeyPress = 1 + EventMaskKeyRelease = 2 + EventMaskButtonPress = 4 + EventMaskButtonRelease = 8 + EventMaskEnterWindow = 16 + EventMaskLeaveWindow = 32 + EventMaskPointerMotion = 64 + EventMaskPointerMotionHint = 128 + EventMaskButton1Motion = 256 + EventMaskButton2Motion = 512 + EventMaskButton3Motion = 1024 + EventMaskButton4Motion = 2048 + EventMaskButton5Motion = 4096 + EventMaskButtonMotion = 8192 + EventMaskKeymapState = 16384 + EventMaskExposure = 32768 + EventMaskVisibilityChange = 65536 + EventMaskStructureNotify = 131072 + EventMaskResizeRedirect = 262144 + EventMaskSubstructureNotify = 524288 + EventMaskSubstructureRedirect = 1048576 + EventMaskFocusChange = 2097152 + EventMaskPropertyChange = 4194304 + EventMaskColorMapChange = 8388608 + EventMaskOwnerGrabButton = 16777216 +) + +const ( + BackingStoreNotUseful = 0 + BackingStoreWhenMapped = 1 + BackingStoreAlways = 2 +) + +const ( + ImageOrderLSBFirst = 0 + ImageOrderMSBFirst = 1 +) + +const ( + ModMaskShift = 1 + ModMaskLock = 2 + ModMaskControl = 4 + ModMask1 = 8 + ModMask2 = 16 + ModMask3 = 32 + ModMask4 = 64 + ModMask5 = 128 + ModMaskAny = 32768 +) + +const ( + KeyButMaskShift = 1 + KeyButMaskLock = 2 + KeyButMaskControl = 4 + KeyButMaskMod1 = 8 + KeyButMaskMod2 = 16 + KeyButMaskMod3 = 32 + KeyButMaskMod4 = 64 + KeyButMaskMod5 = 128 + KeyButMaskButton1 = 256 + KeyButMaskButton2 = 512 + KeyButMaskButton3 = 1024 + KeyButMaskButton4 = 2048 + KeyButMaskButton5 = 4096 +) + +const ( + WindowNone = 0 +) + +const ( + ButtonMask1 = 256 + ButtonMask2 = 512 + ButtonMask3 = 1024 + ButtonMask4 = 2048 + ButtonMask5 = 4096 + ButtonMaskAny = 32768 +) + +const ( + MotionNormal = 0 + MotionHint = 1 +) + +const ( + NotifyDetailAncestor = 0 + NotifyDetailVirtual = 1 + NotifyDetailInferior = 2 + NotifyDetailNonlinear = 3 + NotifyDetailNonlinearVirtual = 4 + NotifyDetailPointer = 5 + NotifyDetailPointerRoot = 6 + NotifyDetailNone = 7 +) + +const ( + NotifyModeNormal = 0 + NotifyModeGrab = 1 + NotifyModeUngrab = 2 + NotifyModeWhileGrabbed = 3 +) + +const ( + VisibilityUnobscured = 0 + VisibilityPartiallyObscured = 1 + VisibilityFullyObscured = 2 +) + +const ( + PlaceOnTop = 0 + PlaceOnBottom = 1 +) + +const ( + PropertyNewValue = 0 + PropertyDelete = 1 +) + +const ( + TimeCurrentTime = 0 +) + +const ( + AtomNone = 0 + AtomAny = 0 + AtomPrimary = 1 + AtomSecondary = 2 + AtomArc = 3 + AtomAtom = 4 + AtomBitmap = 5 + AtomCardinal = 6 + AtomColormap = 7 + AtomCursor = 8 + AtomCutBuffer0 = 9 + AtomCutBuffer1 = 10 + AtomCutBuffer2 = 11 + AtomCutBuffer3 = 12 + AtomCutBuffer4 = 13 + AtomCutBuffer5 = 14 + AtomCutBuffer6 = 15 + AtomCutBuffer7 = 16 + AtomDrawable = 17 + AtomFont = 18 + AtomInteger = 19 + AtomPixmap = 20 + AtomPoint = 21 + AtomRectangle = 22 + AtomResourceManager = 23 + AtomRgbColorMap = 24 + AtomRgbBestMap = 25 + AtomRgbBlueMap = 26 + AtomRgbDefaultMap = 27 + AtomRgbGrayMap = 28 + AtomRgbGreenMap = 29 + AtomRgbRedMap = 30 + AtomString = 31 + AtomVisualid = 32 + AtomWindow = 33 + AtomWmCommand = 34 + AtomWmHints = 35 + AtomWmClientMachine = 36 + AtomWmIconName = 37 + AtomWmIconSize = 38 + AtomWmName = 39 + AtomWmNormalHints = 40 + AtomWmSizeHints = 41 + AtomWmZoomHints = 42 + AtomMinSpace = 43 + AtomNormSpace = 44 + AtomMaxSpace = 45 + AtomEndSpace = 46 + AtomSuperscriptX = 47 + AtomSuperscriptY = 48 + AtomSubscriptX = 49 + AtomSubscriptY = 50 + AtomUnderlinePosition = 51 + AtomUnderlineThickness = 52 + AtomStrikeoutAscent = 53 + AtomStrikeoutDescent = 54 + AtomItalicAngle = 55 + AtomXHeight = 56 + AtomQuadWidth = 57 + AtomWeight = 58 + AtomPointSize = 59 + AtomResolution = 60 + AtomCopyright = 61 + AtomNotice = 62 + AtomFontName = 63 + AtomFamilyName = 64 + AtomFullName = 65 + AtomCapHeight = 66 + AtomWmClass = 67 + AtomWmTransientFor = 68 +) + +const ( + ColormapStateUninstalled = 0 + ColormapStateInstalled = 1 +) + +const ( + ColormapNone = 0 +) + +const ( + MappingModifier = 0 + MappingKeyboard = 1 + MappingPointer = 2 +) + +const ( + WindowClassCopyFromParent = 0 + WindowClassInputOutput = 1 + WindowClassInputOnly = 2 +) + +const ( + CwBackPixmap = 1 + CwBackPixel = 2 + CwBorderPixmap = 4 + CwBorderPixel = 8 + CwBitGravity = 16 + CwWinGravity = 32 + CwBackingStore = 64 + CwBackingPlanes = 128 + CwBackingPixel = 256 + CwOverrideRedirect = 512 + CwSaveUnder = 1024 + CwEventMask = 2048 + CwDontPropagate = 4096 + CwColormap = 8192 + CwCursor = 16384 +) + +const ( + BackPixmapNone = 0 + BackPixmapParentRelative = 1 +) + +const ( + GravityBitForget = 0 + GravityWinUnmap = 0 + GravityNorthWest = 1 + GravityNorth = 2 + GravityNorthEast = 3 + GravityWest = 4 + GravityCenter = 5 + GravityEast = 6 + GravitySouthWest = 7 + GravitySouth = 8 + GravitySouthEast = 9 + GravityStatic = 10 +) + +const ( + MapStateUnmapped = 0 + MapStateUnviewable = 1 + MapStateViewable = 2 +) + +const ( + SetModeInsert = 0 + SetModeDelete = 1 +) + +const ( + ConfigWindowX = 1 + ConfigWindowY = 2 + ConfigWindowWidth = 4 + ConfigWindowHeight = 8 + ConfigWindowBorderWidth = 16 + ConfigWindowSibling = 32 + ConfigWindowStackMode = 64 +) + +const ( + StackModeAbove = 0 + StackModeBelow = 1 + StackModeTopIf = 2 + StackModeBottomIf = 3 + StackModeOpposite = 4 +) + +const ( + CirculateRaiseLowest = 0 + CirculateLowerHighest = 1 +) + +const ( + PropModeReplace = 0 + PropModePrepend = 1 + PropModeAppend = 2 +) + +const ( + GetPropertyTypeAny = 0 +) + +const ( + SendEventDestPointerWindow = 0 + SendEventDestItemFocus = 1 +) + +const ( + GrabModeSync = 0 + GrabModeAsync = 1 +) + +const ( + GrabStatusSuccess = 0 + GrabStatusAlreadyGrabbed = 1 + GrabStatusInvalidTime = 2 + GrabStatusNotViewable = 3 + GrabStatusFrozen = 4 +) + +const ( + CursorNone = 0 +) + +const ( + ButtonIndexAny = 0 + ButtonIndex1 = 1 + ButtonIndex2 = 2 + ButtonIndex3 = 3 + ButtonIndex4 = 4 + ButtonIndex5 = 5 +) + +const ( + GrabAny = 0 +) + +const ( + AllowAsyncPointer = 0 + AllowSyncPointer = 1 + AllowReplayPointer = 2 + AllowAsyncKeyboard = 3 + AllowSyncKeyboard = 4 + AllowReplayKeyboard = 5 + AllowAsyncBoth = 6 + AllowSyncBoth = 7 +) + +const ( + InputFocusNone = 0 + InputFocusPointerRoot = 1 + InputFocusParent = 2 + InputFocusFollowKeyboard = 3 +) + +const ( + FontDrawLeftToRight = 0 + FontDrawRightToLeft = 1 +) + +const ( + GcFunction = 1 + GcPlaneMask = 2 + GcForeground = 4 + GcBackground = 8 + GcLineWidth = 16 + GcLineStyle = 32 + GcCapStyle = 64 + GcJoinStyle = 128 + GcFillStyle = 256 + GcFillRule = 512 + GcTile = 1024 + GcStipple = 2048 + GcTileStippleOriginX = 4096 + GcTileStippleOriginY = 8192 + GcFont = 16384 + GcSubwindowMode = 32768 + GcGraphicsExposures = 65536 + GcClipOriginX = 131072 + GcClipOriginY = 262144 + GcClipMask = 524288 + GcDashOffset = 1048576 + GcDashList = 2097152 + GcArcMode = 4194304 +) + +const ( + GxClear = 0 + GxAnd = 1 + GxAndReverse = 2 + GxCopy = 3 + GxAndInverted = 4 + GxNoop = 5 + GxXor = 6 + GxOr = 7 + GxNor = 8 + GxEquiv = 9 + GxInvert = 10 + GxOrReverse = 11 + GxCopyInverted = 12 + GxOrInverted = 13 + GxNand = 14 + GxSet = 15 +) + +const ( + LineStyleSolid = 0 + LineStyleOnOffDash = 1 + LineStyleDoubleDash = 2 +) + +const ( + CapStyleNotLast = 0 + CapStyleButt = 1 + CapStyleRound = 2 + CapStyleProjecting = 3 +) + +const ( + JoinStyleMiter = 0 + JoinStyleRound = 1 + JoinStyleBevel = 2 +) + +const ( + FillStyleSolid = 0 + FillStyleTiled = 1 + FillStyleStippled = 2 + FillStyleOpaqueStippled = 3 +) + +const ( + FillRuleEvenOdd = 0 + FillRuleWinding = 1 +) + +const ( + SubwindowModeClipByChildren = 0 + SubwindowModeIncludeInferiors = 1 +) + +const ( + ArcModeChord = 0 + ArcModePieSlice = 1 +) + +const ( + ClipOrderingUnsorted = 0 + ClipOrderingYSorted = 1 + ClipOrderingYXSorted = 2 + ClipOrderingYXBanded = 3 +) + +const ( + CoordModeOrigin = 0 + CoordModePrevious = 1 +) + +const ( + PolyShapeComplex = 0 + PolyShapeNonconvex = 1 + PolyShapeConvex = 2 +) + +const ( + ImageFormatXYBitmap = 0 + ImageFormatXYPixmap = 1 + ImageFormatZPixmap = 2 +) + +const ( + ColormapAllocNone = 0 + ColormapAllocAll = 1 +) + +const ( + ColorFlagRed = 1 + ColorFlagGreen = 2 + ColorFlagBlue = 4 +) + +const ( + PixmapNone = 0 +) + +const ( + FontNone = 0 +) + +const ( + QueryShapeOfLargestCursor = 0 + QueryShapeOfFastestTile = 1 + QueryShapeOfFastestStipple = 2 +) + +const ( + KbKeyClickPercent = 1 + KbBellPercent = 2 + KbBellPitch = 4 + KbBellDuration = 8 + KbLed = 16 + KbLedMode = 32 + KbKey = 64 + KbAutoRepeatMode = 128 +) + +const ( + LedModeOff = 0 + LedModeOn = 1 +) + +const ( + AutoRepeatModeOff = 0 + AutoRepeatModeOn = 1 + AutoRepeatModeDefault = 2 +) + +const ( + BlankingNotPreferred = 0 + BlankingPreferred = 1 + BlankingDefault = 2 +) + +const ( + ExposuresNotAllowed = 0 + ExposuresAllowed = 1 + ExposuresDefault = 2 +) + +const ( + HostModeInsert = 0 + HostModeDelete = 1 +) + +const ( + FamilyInternet = 0 + FamilyDECnet = 1 + FamilyChaos = 2 + FamilyServerInterpreted = 5 + FamilyInternet6 = 6 +) + +const ( + AccessControlDisable = 0 + AccessControlEnable = 1 +) + +const ( + CloseDownDestroyAll = 0 + CloseDownRetainPermanent = 1 + CloseDownRetainTemporary = 2 +) + +const ( + KillAllTemporary = 0 +) + +const ( + ScreenSaverReset = 0 + ScreenSaverActive = 1 +) + +const ( + MappingStatusSuccess = 0 + MappingStatusBusy = 1 + MappingStatusFailure = 2 +) + +const ( + MapIndexShift = 0 + MapIndexLock = 1 + MapIndexControl = 2 + MapIndex1 = 3 + MapIndex2 = 4 + MapIndex3 = 5 + MapIndex4 = 6 + MapIndex5 = 7 +) + +// Skipping resource definition of 'Window' + +// Skipping resource definition of 'Pixmap' + +// Skipping resource definition of 'Cursor' + +// Skipping resource definition of 'Font' + +// Skipping resource definition of 'Gcontext' + +// Skipping resource definition of 'Colormap' + +// Skipping resource definition of 'Atom' + +// Skipping resource definition of 'Drawable' + +// Skipping resource definition of 'Fontable' + +type Visualid uint32 + +type Timestamp uint32 + +type Keysym uint32 + +type Keycode byte + +type Button byte + +// 'Char2b' struct definition +// Size: 2 +type Char2b struct { + Byte1 byte + Byte2 byte +} + +// Struct read Char2b +func ReadChar2b(buf []byte, v *Char2b) int { + b := 0 + + v.Byte1 = buf[b] + b += 1 + + v.Byte2 = buf[b] + b += 1 + + return b +} + +// Struct list read Char2b +func ReadChar2bList(buf []byte, dest []Char2b) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Char2b{} + b += ReadChar2b(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Char2b +func (v Char2b) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.Byte1 + b += 1 + + buf[b] = v.Byte2 + b += 1 + + return buf +} + +// Write struct list Char2b +func Char2bListBytes(buf []byte, list []Char2b) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Point' struct definition +// Size: 4 +type Point struct { + X int16 + Y int16 +} + +// Struct read Point +func ReadPoint(buf []byte, v *Point) int { + b := 0 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Point +func ReadPointList(buf []byte, dest []Point) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Point{} + b += ReadPoint(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Point +func (v Point) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + return buf +} + +// Write struct list Point +func PointListBytes(buf []byte, list []Point) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Rectangle' struct definition +// Size: 8 +type Rectangle struct { + X int16 + Y int16 + Width uint16 + Height uint16 +} + +// Struct read Rectangle +func ReadRectangle(buf []byte, v *Rectangle) int { + b := 0 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Rectangle +func ReadRectangleList(buf []byte, dest []Rectangle) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rectangle{} + b += ReadRectangle(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Rectangle +func (v Rectangle) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// Write struct list Rectangle +func RectangleListBytes(buf []byte, list []Rectangle) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Arc' struct definition +// Size: 12 +type Arc struct { + X int16 + Y int16 + Width uint16 + Height uint16 + Angle1 int16 + Angle2 int16 +} + +// Struct read Arc +func ReadArc(buf []byte, v *Arc) int { + b := 0 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Angle1 = int16(Get16(buf[b:])) + b += 2 + + v.Angle2 = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Arc +func ReadArcList(buf []byte, dest []Arc) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Arc{} + b += ReadArc(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Arc +func (v Arc) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], uint16(v.Angle1)) + b += 2 + + Put16(buf[b:], uint16(v.Angle2)) + b += 2 + + return buf +} + +// Write struct list Arc +func ArcListBytes(buf []byte, list []Arc) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Format' struct definition +// Size: 8 +type Format struct { + Depth byte + BitsPerPixel byte + ScanlinePad byte + // padding: 5 bytes +} + +// Struct read Format +func ReadFormat(buf []byte, v *Format) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + v.BitsPerPixel = buf[b] + b += 1 + + v.ScanlinePad = buf[b] + b += 1 + + b += 5 // padding + + return b +} + +// Struct list read Format +func ReadFormatList(buf []byte, dest []Format) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Format{} + b += ReadFormat(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Format +func (v Format) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.Depth + b += 1 + + buf[b] = v.BitsPerPixel + b += 1 + + buf[b] = v.ScanlinePad + b += 1 + + b += 5 // padding + + return buf +} + +// Write struct list Format +func FormatListBytes(buf []byte, list []Format) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'VisualInfo' struct definition +// Size: 24 +type VisualInfo struct { + VisualId Visualid + Class byte + BitsPerRgbValue byte + ColormapEntries uint16 + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + // padding: 4 bytes +} + +// Struct read VisualInfo +func ReadVisualInfo(buf []byte, v *VisualInfo) int { + b := 0 + + v.VisualId = Visualid(Get32(buf[b:])) + b += 4 + + v.Class = buf[b] + b += 1 + + v.BitsPerRgbValue = buf[b] + b += 1 + + v.ColormapEntries = Get16(buf[b:]) + b += 2 + + v.RedMask = Get32(buf[b:]) + b += 4 + + v.GreenMask = Get32(buf[b:]) + b += 4 + + v.BlueMask = Get32(buf[b:]) + b += 4 + + b += 4 // padding + + return b +} + +// Struct list read VisualInfo +func ReadVisualInfoList(buf []byte, dest []VisualInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = VisualInfo{} + b += ReadVisualInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write VisualInfo +func (v VisualInfo) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + Put32(buf[b:], uint32(v.VisualId)) + b += 4 + + buf[b] = v.Class + b += 1 + + buf[b] = v.BitsPerRgbValue + b += 1 + + Put16(buf[b:], v.ColormapEntries) + b += 2 + + Put32(buf[b:], v.RedMask) + b += 4 + + Put32(buf[b:], v.GreenMask) + b += 4 + + Put32(buf[b:], v.BlueMask) + b += 4 + + b += 4 // padding + + return buf +} + +// Write struct list VisualInfo +func VisualInfoListBytes(buf []byte, list []VisualInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'DepthInfo' struct definition +// Size: (8 + pad((int(VisualsLen) * 24))) +type DepthInfo struct { + Depth byte + // padding: 1 bytes + VisualsLen uint16 + // padding: 4 bytes + Visuals []VisualInfo // size: pad((int(VisualsLen) * 24)) +} + +// Struct read DepthInfo +func ReadDepthInfo(buf []byte, v *DepthInfo) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + b += 1 // padding + + v.VisualsLen = Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Visuals = make([]VisualInfo, v.VisualsLen) + b += ReadVisualInfoList(buf[b:], v.Visuals) + + return b +} + +// Struct list read DepthInfo +func ReadDepthInfoList(buf []byte, dest []DepthInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DepthInfo{} + b += ReadDepthInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write DepthInfo +func (v DepthInfo) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.VisualsLen) * 24)))) + b := 0 + + buf[b] = v.Depth + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.VisualsLen) + b += 2 + + b += 4 // padding + + b += VisualInfoListBytes(buf[b:], v.Visuals) + + return buf +} + +// Write struct list DepthInfo +func DepthInfoListBytes(buf []byte, list []DepthInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size DepthInfo +func DepthInfoListSize(list []DepthInfo) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.VisualsLen) * 24))) + } + return size +} + +// 'ScreenInfo' struct definition +// Size: (40 + DepthInfoListSize(AllowedDepths)) +type ScreenInfo struct { + Root Id + DefaultColormap Id + WhitePixel uint32 + BlackPixel uint32 + CurrentInputMasks uint32 + WidthInPixels uint16 + HeightInPixels uint16 + WidthInMillimeters uint16 + HeightInMillimeters uint16 + MinInstalledMaps uint16 + MaxInstalledMaps uint16 + RootVisual Visualid + BackingStores byte + SaveUnders bool + RootDepth byte + AllowedDepthsLen byte + AllowedDepths []DepthInfo // size: DepthInfoListSize(AllowedDepths) +} + +// Struct read ScreenInfo +func ReadScreenInfo(buf []byte, v *ScreenInfo) int { + b := 0 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.DefaultColormap = Id(Get32(buf[b:])) + b += 4 + + v.WhitePixel = Get32(buf[b:]) + b += 4 + + v.BlackPixel = Get32(buf[b:]) + b += 4 + + v.CurrentInputMasks = Get32(buf[b:]) + b += 4 + + v.WidthInPixels = Get16(buf[b:]) + b += 2 + + v.HeightInPixels = Get16(buf[b:]) + b += 2 + + v.WidthInMillimeters = Get16(buf[b:]) + b += 2 + + v.HeightInMillimeters = Get16(buf[b:]) + b += 2 + + v.MinInstalledMaps = Get16(buf[b:]) + b += 2 + + v.MaxInstalledMaps = Get16(buf[b:]) + b += 2 + + v.RootVisual = Visualid(Get32(buf[b:])) + b += 4 + + v.BackingStores = buf[b] + b += 1 + + if buf[b] == 1 { + v.SaveUnders = true + } else { + v.SaveUnders = false + } + b += 1 + + v.RootDepth = buf[b] + b += 1 + + v.AllowedDepthsLen = buf[b] + b += 1 + + v.AllowedDepths = make([]DepthInfo, v.AllowedDepthsLen) + b += ReadDepthInfoList(buf[b:], v.AllowedDepths) + + return b +} + +// Struct list read ScreenInfo +func ReadScreenInfoList(buf []byte, dest []ScreenInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ScreenInfo{} + b += ReadScreenInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write ScreenInfo +func (v ScreenInfo) Bytes() []byte { + buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) + b := 0 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.DefaultColormap)) + b += 4 + + Put32(buf[b:], v.WhitePixel) + b += 4 + + Put32(buf[b:], v.BlackPixel) + b += 4 + + Put32(buf[b:], v.CurrentInputMasks) + b += 4 + + Put16(buf[b:], v.WidthInPixels) + b += 2 + + Put16(buf[b:], v.HeightInPixels) + b += 2 + + Put16(buf[b:], v.WidthInMillimeters) + b += 2 + + Put16(buf[b:], v.HeightInMillimeters) + b += 2 + + Put16(buf[b:], v.MinInstalledMaps) + b += 2 + + Put16(buf[b:], v.MaxInstalledMaps) + b += 2 + + Put32(buf[b:], uint32(v.RootVisual)) + b += 4 + + buf[b] = v.BackingStores + b += 1 + + if v.SaveUnders { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.RootDepth + b += 1 + + buf[b] = v.AllowedDepthsLen + b += 1 + + b += DepthInfoListBytes(buf[b:], v.AllowedDepths) + + return buf +} + +// Write struct list ScreenInfo +func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size ScreenInfo +func ScreenInfoListSize(list []ScreenInfo) int { + size := 0 + for _, item := range list { + size += (40 + DepthInfoListSize(item.AllowedDepths)) + } + return size +} + +// 'SetupRequest' struct definition +// Size: ((12 + pad((int(AuthorizationProtocolNameLen) * 1))) + pad((int(AuthorizationProtocolDataLen) * 1))) +type SetupRequest struct { + ByteOrder byte + // padding: 1 bytes + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + AuthorizationProtocolNameLen uint16 + AuthorizationProtocolDataLen uint16 + // padding: 2 bytes + AuthorizationProtocolName string // size: pad((int(AuthorizationProtocolNameLen) * 1)) + AuthorizationProtocolData string // size: pad((int(AuthorizationProtocolDataLen) * 1)) +} + +// Struct read SetupRequest +func ReadSetupRequest(buf []byte, v *SetupRequest) int { + b := 0 + + v.ByteOrder = buf[b] + b += 1 + + b += 1 // padding + + v.ProtocolMajorVersion = Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = Get16(buf[b:]) + b += 2 + + v.AuthorizationProtocolNameLen = Get16(buf[b:]) + b += 2 + + v.AuthorizationProtocolDataLen = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + { + byteString := make([]byte, v.AuthorizationProtocolNameLen) + copy(byteString[:v.AuthorizationProtocolNameLen], buf[b:]) + v.AuthorizationProtocolName = string(byteString) + b += pad(int(v.AuthorizationProtocolNameLen)) + } + + { + byteString := make([]byte, v.AuthorizationProtocolDataLen) + copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) + v.AuthorizationProtocolData = string(byteString) + b += pad(int(v.AuthorizationProtocolDataLen)) + } + + return b +} + +// Struct list read SetupRequest +func ReadSetupRequestList(buf []byte, dest []SetupRequest) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupRequest{} + b += ReadSetupRequest(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SetupRequest +func (v SetupRequest) Bytes() []byte { + buf := make([]byte, ((12 + pad((int(v.AuthorizationProtocolNameLen) * 1))) + pad((int(v.AuthorizationProtocolDataLen) * 1)))) + b := 0 + + buf[b] = v.ByteOrder + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + Put16(buf[b:], v.AuthorizationProtocolNameLen) + b += 2 + + Put16(buf[b:], v.AuthorizationProtocolDataLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) + b += pad(int(v.AuthorizationProtocolNameLen)) + + copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) + b += pad(int(v.AuthorizationProtocolDataLen)) + + return buf +} + +// Write struct list SetupRequest +func SetupRequestListBytes(buf []byte, list []SetupRequest) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size SetupRequest +func SetupRequestListSize(list []SetupRequest) int { + size := 0 + for _, item := range list { + size += ((12 + pad((int(item.AuthorizationProtocolNameLen) * 1))) + pad((int(item.AuthorizationProtocolDataLen) * 1))) + } + return size +} + +// 'SetupFailed' struct definition +// Size: (8 + pad((int(ReasonLen) * 1))) +type SetupFailed struct { + Status byte + ReasonLen byte + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + Length uint16 + Reason string // size: pad((int(ReasonLen) * 1)) +} + +// Struct read SetupFailed +func ReadSetupFailed(buf []byte, v *SetupFailed) int { + b := 0 + + v.Status = buf[b] + b += 1 + + v.ReasonLen = buf[b] + b += 1 + + v.ProtocolMajorVersion = Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = Get16(buf[b:]) + b += 2 + + v.Length = Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.ReasonLen) + copy(byteString[:v.ReasonLen], buf[b:]) + v.Reason = string(byteString) + b += pad(int(v.ReasonLen)) + } + + return b +} + +// Struct list read SetupFailed +func ReadSetupFailedList(buf []byte, dest []SetupFailed) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupFailed{} + b += ReadSetupFailed(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SetupFailed +func (v SetupFailed) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.ReasonLen) * 1)))) + b := 0 + + buf[b] = v.Status + b += 1 + + buf[b] = v.ReasonLen + b += 1 + + Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + Put16(buf[b:], v.Length) + b += 2 + + copy(buf[b:], v.Reason[:v.ReasonLen]) + b += pad(int(v.ReasonLen)) + + return buf +} + +// Write struct list SetupFailed +func SetupFailedListBytes(buf []byte, list []SetupFailed) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size SetupFailed +func SetupFailedListSize(list []SetupFailed) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.ReasonLen) * 1))) + } + return size +} + +// 'SetupAuthenticate' struct definition +// Size: (8 + pad(((int(Length) * 4) * 1))) +type SetupAuthenticate struct { + Status byte + // padding: 5 bytes + Length uint16 + Reason string // size: pad(((int(Length) * 4) * 1)) +} + +// Struct read SetupAuthenticate +func ReadSetupAuthenticate(buf []byte, v *SetupAuthenticate) int { + b := 0 + + v.Status = buf[b] + b += 1 + + b += 5 // padding + + v.Length = Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, (int(v.Length) * 4)) + copy(byteString[:(int(v.Length)*4)], buf[b:]) + v.Reason = string(byteString) + b += pad(int((int(v.Length) * 4))) + } + + return b +} + +// Struct list read SetupAuthenticate +func ReadSetupAuthenticateList(buf []byte, dest []SetupAuthenticate) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupAuthenticate{} + b += ReadSetupAuthenticate(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SetupAuthenticate +func (v SetupAuthenticate) Bytes() []byte { + buf := make([]byte, (8 + pad(((int(v.Length) * 4) * 1)))) + b := 0 + + buf[b] = v.Status + b += 1 + + b += 5 // padding + + Put16(buf[b:], v.Length) + b += 2 + + copy(buf[b:], v.Reason[:(int(v.Length)*4)]) + b += pad(int((int(v.Length) * 4))) + + return buf +} + +// Write struct list SetupAuthenticate +func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size SetupAuthenticate +func SetupAuthenticateListSize(list []SetupAuthenticate) int { + size := 0 + for _, item := range list { + size += (8 + pad(((int(item.Length) * 4) * 1))) + } + return size +} + +// 'SetupInfo' struct definition +// Size: (((40 + pad((int(VendorLen) * 1))) + pad((int(PixmapFormatsLen) * 8))) + ScreenInfoListSize(Roots)) +type SetupInfo struct { + Status byte + // padding: 1 bytes + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + Length uint16 + ReleaseNumber uint32 + ResourceIdBase uint32 + ResourceIdMask uint32 + MotionBufferSize uint32 + VendorLen uint16 + MaximumRequestLength uint16 + RootsLen byte + PixmapFormatsLen byte + ImageByteOrder byte + BitmapFormatBitOrder byte + BitmapFormatScanlineUnit byte + BitmapFormatScanlinePad byte + MinKeycode Keycode + MaxKeycode Keycode + // padding: 4 bytes + Vendor string // size: pad((int(VendorLen) * 1)) + PixmapFormats []Format // size: pad((int(PixmapFormatsLen) * 8)) + Roots []ScreenInfo // size: ScreenInfoListSize(Roots) +} + +// Struct read SetupInfo +func ReadSetupInfo(buf []byte, v *SetupInfo) int { + b := 0 + + v.Status = buf[b] + b += 1 + + b += 1 // padding + + v.ProtocolMajorVersion = Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = Get16(buf[b:]) + b += 2 + + v.Length = Get16(buf[b:]) + b += 2 + + v.ReleaseNumber = Get32(buf[b:]) + b += 4 + + v.ResourceIdBase = Get32(buf[b:]) + b += 4 + + v.ResourceIdMask = Get32(buf[b:]) + b += 4 + + v.MotionBufferSize = Get32(buf[b:]) + b += 4 + + v.VendorLen = Get16(buf[b:]) + b += 2 + + v.MaximumRequestLength = Get16(buf[b:]) + b += 2 + + v.RootsLen = buf[b] + b += 1 + + v.PixmapFormatsLen = buf[b] + b += 1 + + v.ImageByteOrder = buf[b] + b += 1 + + v.BitmapFormatBitOrder = buf[b] + b += 1 + + v.BitmapFormatScanlineUnit = buf[b] + b += 1 + + v.BitmapFormatScanlinePad = buf[b] + b += 1 + + v.MinKeycode = Keycode(buf[b]) + b += 1 + + v.MaxKeycode = Keycode(buf[b]) + b += 1 + + b += 4 // padding + + { + byteString := make([]byte, v.VendorLen) + copy(byteString[:v.VendorLen], buf[b:]) + v.Vendor = string(byteString) + b += pad(int(v.VendorLen)) + } + + v.PixmapFormats = make([]Format, v.PixmapFormatsLen) + b += ReadFormatList(buf[b:], v.PixmapFormats) + + v.Roots = make([]ScreenInfo, v.RootsLen) + b += ReadScreenInfoList(buf[b:], v.Roots) + + return b +} + +// Struct list read SetupInfo +func ReadSetupInfoList(buf []byte, dest []SetupInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupInfo{} + b += ReadSetupInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SetupInfo +func (v SetupInfo) Bytes() []byte { + buf := make([]byte, (((40 + pad((int(v.VendorLen) * 1))) + pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) + b := 0 + + buf[b] = v.Status + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + Put16(buf[b:], v.Length) + b += 2 + + Put32(buf[b:], v.ReleaseNumber) + b += 4 + + Put32(buf[b:], v.ResourceIdBase) + b += 4 + + Put32(buf[b:], v.ResourceIdMask) + b += 4 + + Put32(buf[b:], v.MotionBufferSize) + b += 4 + + Put16(buf[b:], v.VendorLen) + b += 2 + + Put16(buf[b:], v.MaximumRequestLength) + b += 2 + + buf[b] = v.RootsLen + b += 1 + + buf[b] = v.PixmapFormatsLen + b += 1 + + buf[b] = v.ImageByteOrder + b += 1 + + buf[b] = v.BitmapFormatBitOrder + b += 1 + + buf[b] = v.BitmapFormatScanlineUnit + b += 1 + + buf[b] = v.BitmapFormatScanlinePad + b += 1 + + buf[b] = byte(v.MinKeycode) + b += 1 + + buf[b] = byte(v.MaxKeycode) + b += 1 + + b += 4 // padding + + copy(buf[b:], v.Vendor[:v.VendorLen]) + b += pad(int(v.VendorLen)) + + b += FormatListBytes(buf[b:], v.PixmapFormats) + + b += ScreenInfoListBytes(buf[b:], v.Roots) + + return buf +} + +// Write struct list SetupInfo +func SetupInfoListBytes(buf []byte, list []SetupInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size SetupInfo +func SetupInfoListSize(list []SetupInfo) int { + size := 0 + for _, item := range list { + size += (((40 + pad((int(item.VendorLen) * 1))) + pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) + } + return size +} + +// 'Timecoord' struct definition +// Size: 8 +type Timecoord struct { + Time Timestamp + X int16 + Y int16 +} + +// Struct read Timecoord +func ReadTimecoord(buf []byte, v *Timecoord) int { + b := 0 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Timecoord +func ReadTimecoordList(buf []byte, dest []Timecoord) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Timecoord{} + b += ReadTimecoord(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Timecoord +func (v Timecoord) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + return buf +} + +// Write struct list Timecoord +func TimecoordListBytes(buf []byte, list []Timecoord) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Fontprop' struct definition +// Size: 8 +type Fontprop struct { + Name Id + Value uint32 +} + +// Struct read Fontprop +func ReadFontprop(buf []byte, v *Fontprop) int { + b := 0 + + v.Name = Id(Get32(buf[b:])) + b += 4 + + v.Value = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Fontprop +func ReadFontpropList(buf []byte, dest []Fontprop) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Fontprop{} + b += ReadFontprop(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Fontprop +func (v Fontprop) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Name)) + b += 4 + + Put32(buf[b:], v.Value) + b += 4 + + return buf +} + +// Write struct list Fontprop +func FontpropListBytes(buf []byte, list []Fontprop) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Charinfo' struct definition +// Size: 12 +type Charinfo struct { + LeftSideBearing int16 + RightSideBearing int16 + CharacterWidth int16 + Ascent int16 + Descent int16 + Attributes uint16 +} + +// Struct read Charinfo +func ReadCharinfo(buf []byte, v *Charinfo) int { + b := 0 + + v.LeftSideBearing = int16(Get16(buf[b:])) + b += 2 + + v.RightSideBearing = int16(Get16(buf[b:])) + b += 2 + + v.CharacterWidth = int16(Get16(buf[b:])) + b += 2 + + v.Ascent = int16(Get16(buf[b:])) + b += 2 + + v.Descent = int16(Get16(buf[b:])) + b += 2 + + v.Attributes = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Charinfo +func ReadCharinfoList(buf []byte, dest []Charinfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Charinfo{} + b += ReadCharinfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Charinfo +func (v Charinfo) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put16(buf[b:], uint16(v.LeftSideBearing)) + b += 2 + + Put16(buf[b:], uint16(v.RightSideBearing)) + b += 2 + + Put16(buf[b:], uint16(v.CharacterWidth)) + b += 2 + + Put16(buf[b:], uint16(v.Ascent)) + b += 2 + + Put16(buf[b:], uint16(v.Descent)) + b += 2 + + Put16(buf[b:], v.Attributes) + b += 2 + + return buf +} + +// Write struct list Charinfo +func CharinfoListBytes(buf []byte, list []Charinfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Str' struct definition +// Size: (1 + pad((int(NameLen) * 1))) +type Str struct { + NameLen byte + Name string // size: pad((int(NameLen) * 1)) +} + +// Struct read Str +func ReadStr(buf []byte, v *Str) int { + b := 0 + + v.NameLen = buf[b] + b += 1 + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameLen)) + } + + return b +} + +// Struct list read Str +func ReadStrList(buf []byte, dest []Str) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Str{} + b += ReadStr(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Str +func (v Str) Bytes() []byte { + buf := make([]byte, (1 + pad((int(v.NameLen) * 1)))) + b := 0 + + buf[b] = v.NameLen + b += 1 + + copy(buf[b:], v.Name[:v.NameLen]) + b += pad(int(v.NameLen)) + + return buf +} + +// Write struct list Str +func StrListBytes(buf []byte, list []Str) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size Str +func StrListSize(list []Str) int { + size := 0 + for _, item := range list { + size += (1 + pad((int(item.NameLen) * 1))) + } + return size +} + +// 'Segment' struct definition +// Size: 8 +type Segment struct { + X1 int16 + Y1 int16 + X2 int16 + Y2 int16 +} + +// Struct read Segment +func ReadSegment(buf []byte, v *Segment) int { + b := 0 + + v.X1 = int16(Get16(buf[b:])) + b += 2 + + v.Y1 = int16(Get16(buf[b:])) + b += 2 + + v.X2 = int16(Get16(buf[b:])) + b += 2 + + v.Y2 = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Segment +func ReadSegmentList(buf []byte, dest []Segment) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Segment{} + b += ReadSegment(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Segment +func (v Segment) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], uint16(v.X1)) + b += 2 + + Put16(buf[b:], uint16(v.Y1)) + b += 2 + + Put16(buf[b:], uint16(v.X2)) + b += 2 + + Put16(buf[b:], uint16(v.Y2)) + b += 2 + + return buf +} + +// Write struct list Segment +func SegmentListBytes(buf []byte, list []Segment) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Coloritem' struct definition +// Size: 12 +type Coloritem struct { + Pixel uint32 + Red uint16 + Green uint16 + Blue uint16 + Flags byte + // padding: 1 bytes +} + +// Struct read Coloritem +func ReadColoritem(buf []byte, v *Coloritem) int { + b := 0 + + v.Pixel = Get32(buf[b:]) + b += 4 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + v.Flags = buf[b] + b += 1 + + b += 1 // padding + + return b +} + +// Struct list read Coloritem +func ReadColoritemList(buf []byte, dest []Coloritem) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Coloritem{} + b += ReadColoritem(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Coloritem +func (v Coloritem) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put32(buf[b:], v.Pixel) + b += 4 + + Put16(buf[b:], v.Red) + b += 2 + + Put16(buf[b:], v.Green) + b += 2 + + Put16(buf[b:], v.Blue) + b += 2 + + buf[b] = v.Flags + b += 1 + + b += 1 // padding + + return buf +} + +// Write struct list Coloritem +func ColoritemListBytes(buf []byte, list []Coloritem) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Rgb' struct definition +// Size: 8 +type Rgb struct { + Red uint16 + Green uint16 + Blue uint16 + // padding: 2 bytes +} + +// Struct read Rgb +func ReadRgb(buf []byte, v *Rgb) int { + b := 0 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return b +} + +// Struct list read Rgb +func ReadRgbList(buf []byte, dest []Rgb) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rgb{} + b += ReadRgb(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Rgb +func (v Rgb) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.Red) + b += 2 + + Put16(buf[b:], v.Green) + b += 2 + + Put16(buf[b:], v.Blue) + b += 2 + + b += 2 // padding + + return buf +} + +// Write struct list Rgb +func RgbListBytes(buf []byte, list []Rgb) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Host' struct definition +// Size: (4 + pad((int(AddressLen) * 1))) +type Host struct { + Family byte + // padding: 1 bytes + AddressLen uint16 + Address []byte // size: pad((int(AddressLen) * 1)) +} + +// Struct read Host +func ReadHost(buf []byte, v *Host) int { + b := 0 + + v.Family = buf[b] + b += 1 + + b += 1 // padding + + v.AddressLen = Get16(buf[b:]) + b += 2 + + v.Address = make([]byte, v.AddressLen) + copy(v.Address[:v.AddressLen], buf[b:]) + b += pad(int(v.AddressLen)) + + return b +} + +// Struct list read Host +func ReadHostList(buf []byte, dest []Host) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Host{} + b += ReadHost(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Host +func (v Host) Bytes() []byte { + buf := make([]byte, (4 + pad((int(v.AddressLen) * 1)))) + b := 0 + + buf[b] = v.Family + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.AddressLen) + b += 2 + + copy(buf[b:], v.Address[:v.AddressLen]) + b += pad(int(v.AddressLen)) + + return buf +} + +// Write struct list Host +func HostListBytes(buf []byte, list []Host) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size Host +func HostListSize(list []Host) int { + size := 0 + for _, item := range list { + size += (4 + pad((int(item.AddressLen) * 1))) + } + return size +} + +// Union definition ClientMessageDataUnion +// Note that to *create* a Union, you should *never* create +// this struct directly (unless you know what you're doing). +// Instead use one of the following constructors for 'ClientMessageDataUnion': +// NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion +// NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion +// NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion +type ClientMessageDataUnion struct { + Data8 []byte // size: pad(20) + Data16 []uint16 // size: pad(20) + Data32 []uint32 // size: pad(20) +} + +// Union constructor for ClientMessageDataUnion for field Data8. +func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion { + var b int + buf := make([]byte, pad(20)) + + copy(buf[b:], Data8[:20]) + b += pad(int(20)) + + // Create the Union type + v := ClientMessageDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Data8 = make([]byte, 20) + copy(v.Data8[:20], buf[b:]) + b += pad(int(20)) + + b = 0 // always read the same bytes + v.Data16 = make([]uint16, 10) + for i := 0; i < int(10); i++ { + v.Data16[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + b = 0 // always read the same bytes + v.Data32 = make([]uint32, 5) + for i := 0; i < int(5); i++ { + v.Data32[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +// Union constructor for ClientMessageDataUnion for field Data16. +func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion { + var b int + buf := make([]byte, pad(20)) + + for i := 0; i < int(10); i++ { + Put16(buf[b:], Data16[i]) + b += 2 + } + b = pad(b) + + // Create the Union type + v := ClientMessageDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Data8 = make([]byte, 20) + copy(v.Data8[:20], buf[b:]) + b += pad(int(20)) + + b = 0 // always read the same bytes + v.Data16 = make([]uint16, 10) + for i := 0; i < int(10); i++ { + v.Data16[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + b = 0 // always read the same bytes + v.Data32 = make([]uint32, 5) + for i := 0; i < int(5); i++ { + v.Data32[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +// Union constructor for ClientMessageDataUnion for field Data32. +func NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion { + var b int + buf := make([]byte, pad(20)) + + for i := 0; i < int(5); i++ { + Put32(buf[b:], Data32[i]) + b += 4 + } + b = pad(b) + + // Create the Union type + v := ClientMessageDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Data8 = make([]byte, 20) + copy(v.Data8[:20], buf[b:]) + b += pad(int(20)) + + b = 0 // always read the same bytes + v.Data16 = make([]uint16, 10) + for i := 0; i < int(10); i++ { + v.Data16[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + b = 0 // always read the same bytes + v.Data32 = make([]uint32, 5) + for i := 0; i < int(5); i++ { + v.Data32[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +// Union read ClientMessageDataUnion +func ReadClientMessageDataUnion(buf []byte, v *ClientMessageDataUnion) int { + var b int + + b = 0 // re-read the same bytes + v.Data8 = make([]byte, 20) + copy(v.Data8[:20], buf[b:]) + b += pad(int(20)) + + b = 0 // re-read the same bytes + v.Data16 = make([]uint16, 10) + for i := 0; i < int(10); i++ { + v.Data16[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + b = 0 // re-read the same bytes + v.Data32 = make([]uint32, 5) + for i := 0; i < int(5); i++ { + v.Data32[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return pad(20) +} + +// Union list read ClientMessageDataUnion +func ReadClientMessageDataUnionList(buf []byte, dest []ClientMessageDataUnion) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ClientMessageDataUnion{} + b += ReadClientMessageDataUnion(buf[b:], &dest[i]) + } + return pad(b) +} + +// Union write ClientMessageDataUnion +// Each field in a union must contain the same data. +// So simply pick the first field and write that to the wire. +func (v ClientMessageDataUnion) Bytes() []byte { + buf := make([]byte, pad(20)) + b := 0 + + copy(buf[b:], v.Data8[:20]) + b += pad(int(20)) + return buf +} + +// Union list write ClientMessageDataUnion +func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) int { + b := 0 + var unionBytes []byte + for _, item := range list { + unionBytes = item.Bytes() + copy(buf[b:], unionBytes) + b += pad(len(unionBytes)) + } + return b +} + +// Event definition KeyPress (2) +// Size: 32 + +const KeyPress = 2 + +type KeyPressEvent struct { + Sequence uint16 + Detail Keycode + Time Timestamp + Root Id + Event Id + Child Id + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + // padding: 1 bytes +} + +// Event read KeyPress +func NewKeyPressEvent(buf []byte) Event { + v := KeyPressEvent{} + b := 1 // don't read event number + + v.Detail = Keycode(buf[b]) + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.EventX = int16(Get16(buf[b:])) + b += 2 + + v.EventY = int16(Get16(buf[b:])) + b += 2 + + v.State = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write KeyPress +func (v KeyPressEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 2 + b += 1 + + buf[b] = byte(v.Detail) + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Child)) + b += 4 + + Put16(buf[b:], uint16(v.RootX)) + b += 2 + + Put16(buf[b:], uint16(v.RootY)) + b += 2 + + Put16(buf[b:], uint16(v.EventX)) + b += 2 + + Put16(buf[b:], uint16(v.EventY)) + b += 2 + + Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v KeyPressEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[2] = NewKeyPressEvent +} + +// Event definition ButtonPress (4) +// Size: 32 + +const ButtonPress = 4 + +type ButtonPressEvent struct { + Sequence uint16 + Detail Button + Time Timestamp + Root Id + Event Id + Child Id + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + // padding: 1 bytes +} + +// Event read ButtonPress +func NewButtonPressEvent(buf []byte) Event { + v := ButtonPressEvent{} + b := 1 // don't read event number + + v.Detail = Button(buf[b]) + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.EventX = int16(Get16(buf[b:])) + b += 2 + + v.EventY = int16(Get16(buf[b:])) + b += 2 + + v.State = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write ButtonPress +func (v ButtonPressEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 4 + b += 1 + + buf[b] = byte(v.Detail) + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Child)) + b += 4 + + Put16(buf[b:], uint16(v.RootX)) + b += 2 + + Put16(buf[b:], uint16(v.RootY)) + b += 2 + + Put16(buf[b:], uint16(v.EventX)) + b += 2 + + Put16(buf[b:], uint16(v.EventY)) + b += 2 + + Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v ButtonPressEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[4] = NewButtonPressEvent +} + +// Event definition MotionNotify (6) +// Size: 32 + +const MotionNotify = 6 + +type MotionNotifyEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Root Id + Event Id + Child Id + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + // padding: 1 bytes +} + +// Event read MotionNotify +func NewMotionNotifyEvent(buf []byte) Event { + v := MotionNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.EventX = int16(Get16(buf[b:])) + b += 2 + + v.EventY = int16(Get16(buf[b:])) + b += 2 + + v.State = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write MotionNotify +func (v MotionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 6 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Child)) + b += 4 + + Put16(buf[b:], uint16(v.RootX)) + b += 2 + + Put16(buf[b:], uint16(v.RootY)) + b += 2 + + Put16(buf[b:], uint16(v.EventX)) + b += 2 + + Put16(buf[b:], uint16(v.EventY)) + b += 2 + + Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v MotionNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[6] = NewMotionNotifyEvent +} + +// Event definition EnterNotify (7) +// Size: 32 + +const EnterNotify = 7 + +type EnterNotifyEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Root Id + Event Id + Child Id + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + Mode byte + SameScreenFocus byte +} + +// Event read EnterNotify +func NewEnterNotifyEvent(buf []byte) Event { + v := EnterNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.EventX = int16(Get16(buf[b:])) + b += 2 + + v.EventY = int16(Get16(buf[b:])) + b += 2 + + v.State = Get16(buf[b:]) + b += 2 + + v.Mode = buf[b] + b += 1 + + v.SameScreenFocus = buf[b] + b += 1 + + return v +} + +// Event write EnterNotify +func (v EnterNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 7 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Child)) + b += 4 + + Put16(buf[b:], uint16(v.RootX)) + b += 2 + + Put16(buf[b:], uint16(v.RootY)) + b += 2 + + Put16(buf[b:], uint16(v.EventX)) + b += 2 + + Put16(buf[b:], uint16(v.EventY)) + b += 2 + + Put16(buf[b:], v.State) + b += 2 + + buf[b] = v.Mode + b += 1 + + buf[b] = v.SameScreenFocus + b += 1 + + return buf +} + +func (v EnterNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[7] = NewEnterNotifyEvent +} + +// Event definition FocusIn (9) +// Size: 32 + +const FocusIn = 9 + +type FocusInEvent struct { + Sequence uint16 + Detail byte + Event Id + Mode byte + // padding: 3 bytes +} + +// Event read FocusIn +func NewFocusInEvent(buf []byte) Event { + v := FocusInEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Mode = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write FocusIn +func (v FocusInEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 9 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + buf[b] = v.Mode + b += 1 + + b += 3 // padding + + return buf +} + +func (v FocusInEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[9] = NewFocusInEvent +} + +// Event definition KeymapNotify (11) +// Size: 32 + +const KeymapNotify = 11 + +type KeymapNotifyEvent struct { + Keys []byte // size: pad(31) +} + +// Event read KeymapNotify +func NewKeymapNotifyEvent(buf []byte) Event { + v := KeymapNotifyEvent{} + b := 1 // don't read event number + + v.Keys = make([]byte, 31) + copy(v.Keys[:31], buf[b:]) + b += pad(int(31)) + + return v +} + +// Event write KeymapNotify +func (v KeymapNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 11 + b += 1 + + copy(buf[b:], v.Keys[:31]) + b += pad(int(31)) + + return buf +} + +func (v KeymapNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[11] = NewKeymapNotifyEvent +} + +// Event definition Expose (12) +// Size: 32 + +const Expose = 12 + +type ExposeEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Id + X uint16 + Y uint16 + Width uint16 + Height uint16 + Count uint16 + // padding: 2 bytes +} + +// Event read Expose +func NewExposeEvent(buf []byte) Event { + v := ExposeEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.X = Get16(buf[b:]) + b += 2 + + v.Y = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Count = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v +} + +// Event write Expose +func (v ExposeEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 12 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put16(buf[b:], v.X) + b += 2 + + Put16(buf[b:], v.Y) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.Count) + b += 2 + + b += 2 // padding + + return buf +} + +func (v ExposeEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[12] = NewExposeEvent +} + +// Event definition GraphicsExposure (13) +// Size: 32 + +const GraphicsExposure = 13 + +type GraphicsExposureEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Id + X uint16 + Y uint16 + Width uint16 + Height uint16 + MinorOpcode uint16 + Count uint16 + MajorOpcode byte + // padding: 3 bytes +} + +// Event read GraphicsExposure +func NewGraphicsExposureEvent(buf []byte) Event { + v := GraphicsExposureEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.X = Get16(buf[b:]) + b += 2 + + v.Y = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.Count = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write GraphicsExposure +func (v GraphicsExposureEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 13 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put16(buf[b:], v.X) + b += 2 + + Put16(buf[b:], v.Y) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.MinorOpcode) + b += 2 + + Put16(buf[b:], v.Count) + b += 2 + + buf[b] = v.MajorOpcode + b += 1 + + b += 3 // padding + + return buf +} + +func (v GraphicsExposureEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[13] = NewGraphicsExposureEvent +} + +// Event definition NoExposure (14) +// Size: 32 + +const NoExposure = 14 + +type NoExposureEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Id + MinorOpcode uint16 + MajorOpcode byte + // padding: 1 bytes +} + +// Event read NoExposure +func NewNoExposureEvent(buf []byte) Event { + v := NoExposureEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +// Event write NoExposure +func (v NoExposureEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 14 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put16(buf[b:], v.MinorOpcode) + b += 2 + + buf[b] = v.MajorOpcode + b += 1 + + b += 1 // padding + + return buf +} + +func (v NoExposureEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[14] = NewNoExposureEvent +} + +// Event definition VisibilityNotify (15) +// Size: 32 + +const VisibilityNotify = 15 + +type VisibilityNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Id + State byte + // padding: 3 bytes +} + +// Event read VisibilityNotify +func NewVisibilityNotifyEvent(buf []byte) Event { + v := VisibilityNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write VisibilityNotify +func (v VisibilityNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 15 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +func (v VisibilityNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[15] = NewVisibilityNotifyEvent +} + +// Event definition CreateNotify (16) +// Size: 32 + +const CreateNotify = 16 + +type CreateNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Parent Id + Window Id + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + OverrideRedirect bool + // padding: 1 bytes +} + +// Event read CreateNotify +func NewCreateNotifyEvent(buf []byte) Event { + v := CreateNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Parent = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.BorderWidth = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write CreateNotify +func (v CreateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 16 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Parent)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.BorderWidth) + b += 2 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v CreateNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[16] = NewCreateNotifyEvent +} + +// Event definition DestroyNotify (17) +// Size: 32 + +const DestroyNotify = 17 + +type DestroyNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id +} + +// Event read DestroyNotify +func NewDestroyNotifyEvent(buf []byte) Event { + v := DestroyNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write DestroyNotify +func (v DestroyNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 17 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + return buf +} + +func (v DestroyNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[17] = NewDestroyNotifyEvent +} + +// Event definition UnmapNotify (18) +// Size: 32 + +const UnmapNotify = 18 + +type UnmapNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + FromConfigure bool + // padding: 3 bytes +} + +// Event read UnmapNotify +func NewUnmapNotifyEvent(buf []byte) Event { + v := UnmapNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.FromConfigure = true + } else { + v.FromConfigure = false + } + b += 1 + + b += 3 // padding + + return v +} + +// Event write UnmapNotify +func (v UnmapNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 18 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + if v.FromConfigure { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +func (v UnmapNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[18] = NewUnmapNotifyEvent +} + +// Event definition MapNotify (19) +// Size: 32 + +const MapNotify = 19 + +type MapNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + OverrideRedirect bool + // padding: 3 bytes +} + +// Event read MapNotify +func NewMapNotifyEvent(buf []byte) Event { + v := MapNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 3 // padding + + return v +} + +// Event write MapNotify +func (v MapNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 19 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +func (v MapNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[19] = NewMapNotifyEvent +} + +// Event definition MapRequest (20) +// Size: 32 + +const MapRequest = 20 + +type MapRequestEvent struct { + Sequence uint16 + // padding: 1 bytes + Parent Id + Window Id +} + +// Event read MapRequest +func NewMapRequestEvent(buf []byte) Event { + v := MapRequestEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Parent = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write MapRequest +func (v MapRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 20 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Parent)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + return buf +} + +func (v MapRequestEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[20] = NewMapRequestEvent +} + +// Event definition ReparentNotify (21) +// Size: 32 + +const ReparentNotify = 21 + +type ReparentNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + Parent Id + X int16 + Y int16 + OverrideRedirect bool + // padding: 3 bytes +} + +// Event read ReparentNotify +func NewReparentNotifyEvent(buf []byte) Event { + v := ReparentNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Parent = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 3 // padding + + return v +} + +// Event write ReparentNotify +func (v ReparentNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 21 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Parent)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +func (v ReparentNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[21] = NewReparentNotifyEvent +} + +// Event definition ConfigureNotify (22) +// Size: 32 + +const ConfigureNotify = 22 + +type ConfigureNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + AboveSibling Id + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + OverrideRedirect bool + // padding: 1 bytes +} + +// Event read ConfigureNotify +func NewConfigureNotifyEvent(buf []byte) Event { + v := ConfigureNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.AboveSibling = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.BorderWidth = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write ConfigureNotify +func (v ConfigureNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 22 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.AboveSibling)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.BorderWidth) + b += 2 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v ConfigureNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[22] = NewConfigureNotifyEvent +} + +// Event definition ConfigureRequest (23) +// Size: 32 + +const ConfigureRequest = 23 + +type ConfigureRequestEvent struct { + Sequence uint16 + StackMode byte + Parent Id + Window Id + Sibling Id + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + ValueMask uint16 +} + +// Event read ConfigureRequest +func NewConfigureRequestEvent(buf []byte) Event { + v := ConfigureRequestEvent{} + b := 1 // don't read event number + + v.StackMode = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Parent = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Sibling = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.BorderWidth = Get16(buf[b:]) + b += 2 + + v.ValueMask = Get16(buf[b:]) + b += 2 + + return v +} + +// Event write ConfigureRequest +func (v ConfigureRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 23 + b += 1 + + buf[b] = v.StackMode + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Parent)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Sibling)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.BorderWidth) + b += 2 + + Put16(buf[b:], v.ValueMask) + b += 2 + + return buf +} + +func (v ConfigureRequestEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[23] = NewConfigureRequestEvent +} + +// Event definition GravityNotify (24) +// Size: 32 + +const GravityNotify = 24 + +type GravityNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + X int16 + Y int16 +} + +// Event read GravityNotify +func NewGravityNotifyEvent(buf []byte) Event { + v := GravityNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + return v +} + +// Event write GravityNotify +func (v GravityNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 24 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + return buf +} + +func (v GravityNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[24] = NewGravityNotifyEvent +} + +// Event definition ResizeRequest (25) +// Size: 32 + +const ResizeRequest = 25 + +type ResizeRequestEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Id + Width uint16 + Height uint16 +} + +// Event read ResizeRequest +func NewResizeRequestEvent(buf []byte) Event { + v := ResizeRequestEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return v +} + +// Event write ResizeRequest +func (v ResizeRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 25 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +func (v ResizeRequestEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[25] = NewResizeRequestEvent +} + +// Event definition CirculateNotify (26) +// Size: 32 + +const CirculateNotify = 26 + +type CirculateNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Id + Window Id + // padding: 4 bytes + Place byte + // padding: 3 bytes +} + +// Event read CirculateNotify +func NewCirculateNotifyEvent(buf []byte) Event { + v := CirculateNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + b += 4 // padding + + v.Place = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write CirculateNotify +func (v CirculateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 26 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + b += 4 // padding + + buf[b] = v.Place + b += 1 + + b += 3 // padding + + return buf +} + +func (v CirculateNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[26] = NewCirculateNotifyEvent +} + +// Event definition PropertyNotify (28) +// Size: 32 + +const PropertyNotify = 28 + +type PropertyNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Id + Atom Id + Time Timestamp + State byte + // padding: 3 bytes +} + +// Event read PropertyNotify +func NewPropertyNotifyEvent(buf []byte) Event { + v := PropertyNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Atom = Id(Get32(buf[b:])) + b += 4 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write PropertyNotify +func (v PropertyNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 28 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Atom)) + b += 4 + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +func (v PropertyNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[28] = NewPropertyNotifyEvent +} + +// Event definition SelectionClear (29) +// Size: 32 + +const SelectionClear = 29 + +type SelectionClearEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Owner Id + Selection Id +} + +// Event read SelectionClear +func NewSelectionClearEvent(buf []byte) Event { + v := SelectionClearEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Owner = Id(Get32(buf[b:])) + b += 4 + + v.Selection = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write SelectionClear +func (v SelectionClearEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 29 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Owner)) + b += 4 + + Put32(buf[b:], uint32(v.Selection)) + b += 4 + + return buf +} + +func (v SelectionClearEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[29] = NewSelectionClearEvent +} + +// Event definition SelectionRequest (30) +// Size: 32 + +const SelectionRequest = 30 + +type SelectionRequestEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Owner Id + Requestor Id + Selection Id + Target Id + Property Id +} + +// Event read SelectionRequest +func NewSelectionRequestEvent(buf []byte) Event { + v := SelectionRequestEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Owner = Id(Get32(buf[b:])) + b += 4 + + v.Requestor = Id(Get32(buf[b:])) + b += 4 + + v.Selection = Id(Get32(buf[b:])) + b += 4 + + v.Target = Id(Get32(buf[b:])) + b += 4 + + v.Property = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write SelectionRequest +func (v SelectionRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 30 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Owner)) + b += 4 + + Put32(buf[b:], uint32(v.Requestor)) + b += 4 + + Put32(buf[b:], uint32(v.Selection)) + b += 4 + + Put32(buf[b:], uint32(v.Target)) + b += 4 + + Put32(buf[b:], uint32(v.Property)) + b += 4 + + return buf +} + +func (v SelectionRequestEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[30] = NewSelectionRequestEvent +} + +// Event definition SelectionNotify (31) +// Size: 32 + +const SelectionNotify = 31 + +type SelectionNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Requestor Id + Selection Id + Target Id + Property Id +} + +// Event read SelectionNotify +func NewSelectionNotifyEvent(buf []byte) Event { + v := SelectionNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Requestor = Id(Get32(buf[b:])) + b += 4 + + v.Selection = Id(Get32(buf[b:])) + b += 4 + + v.Target = Id(Get32(buf[b:])) + b += 4 + + v.Property = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write SelectionNotify +func (v SelectionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 31 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Requestor)) + b += 4 + + Put32(buf[b:], uint32(v.Selection)) + b += 4 + + Put32(buf[b:], uint32(v.Target)) + b += 4 + + Put32(buf[b:], uint32(v.Property)) + b += 4 + + return buf +} + +func (v SelectionNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[31] = NewSelectionNotifyEvent +} + +// Event definition ColormapNotify (32) +// Size: 32 + +const ColormapNotify = 32 + +type ColormapNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Id + Colormap Id + New bool + State byte + // padding: 2 bytes +} + +// Event read ColormapNotify +func NewColormapNotifyEvent(buf []byte) Event { + v := ColormapNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Colormap = Id(Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.New = true + } else { + v.New = false + } + b += 1 + + v.State = buf[b] + b += 1 + + b += 2 // padding + + return v +} + +// Event write ColormapNotify +func (v ColormapNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 32 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Colormap)) + b += 4 + + if v.New { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.State + b += 1 + + b += 2 // padding + + return buf +} + +func (v ColormapNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[32] = NewColormapNotifyEvent +} + +// Event definition ClientMessage (33) +// Size: 32 + +const ClientMessage = 33 + +type ClientMessageEvent struct { + Sequence uint16 + Format byte + Window Id + Type Id + Data ClientMessageDataUnion +} + +// Event read ClientMessage +func NewClientMessageEvent(buf []byte) Event { + v := ClientMessageEvent{} + b := 1 // don't read event number + + v.Format = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Type = Id(Get32(buf[b:])) + b += 4 + + v.Data = ClientMessageDataUnion{} + b += ReadClientMessageDataUnion(buf[b:], &v.Data) + + return v +} + +// Event write ClientMessage +func (v ClientMessageEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 33 + b += 1 + + buf[b] = v.Format + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Type)) + b += 4 + + { + unionBytes := v.Data.Bytes() + copy(buf[b:], unionBytes) + b += pad(len(unionBytes)) + } + + return buf +} + +func (v ClientMessageEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[33] = NewClientMessageEvent +} + +// Event definition MappingNotify (34) +// Size: 32 + +const MappingNotify = 34 + +type MappingNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Request byte + FirstKeycode Keycode + Count byte + // padding: 1 bytes +} + +// Event read MappingNotify +func NewMappingNotifyEvent(buf []byte) Event { + v := MappingNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Request = buf[b] + b += 1 + + v.FirstKeycode = Keycode(buf[b]) + b += 1 + + v.Count = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +// Event write MappingNotify +func (v MappingNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 34 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + buf[b] = v.Request + b += 1 + + buf[b] = byte(v.FirstKeycode) + b += 1 + + buf[b] = v.Count + b += 1 + + b += 1 // padding + + return buf +} + +func (v MappingNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[34] = NewMappingNotifyEvent +} + +// EventCopy definition KeyRelease (3) + +const KeyRelease = 3 + +type KeyReleaseEvent KeyPressEvent + +func NewKeyReleaseEvent(buf []byte) Event { + return KeyReleaseEvent(NewKeyPressEvent(buf).(KeyPressEvent)) +} + +func (v KeyReleaseEvent) Bytes() []byte { + return KeyPressEvent(v).Bytes() +} + +func (v KeyReleaseEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[3] = NewKeyReleaseEvent +} + +// EventCopy definition ButtonRelease (5) + +const ButtonRelease = 5 + +type ButtonReleaseEvent ButtonPressEvent + +func NewButtonReleaseEvent(buf []byte) Event { + return ButtonReleaseEvent(NewButtonPressEvent(buf).(ButtonPressEvent)) +} + +func (v ButtonReleaseEvent) Bytes() []byte { + return ButtonPressEvent(v).Bytes() +} + +func (v ButtonReleaseEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[5] = NewButtonReleaseEvent +} + +// EventCopy definition LeaveNotify (8) + +const LeaveNotify = 8 + +type LeaveNotifyEvent EnterNotifyEvent + +func NewLeaveNotifyEvent(buf []byte) Event { + return LeaveNotifyEvent(NewEnterNotifyEvent(buf).(EnterNotifyEvent)) +} + +func (v LeaveNotifyEvent) Bytes() []byte { + return EnterNotifyEvent(v).Bytes() +} + +func (v LeaveNotifyEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[8] = NewLeaveNotifyEvent +} + +// EventCopy definition FocusOut (10) + +const FocusOut = 10 + +type FocusOutEvent FocusInEvent + +func NewFocusOutEvent(buf []byte) Event { + return FocusOutEvent(NewFocusInEvent(buf).(FocusInEvent)) +} + +func (v FocusOutEvent) Bytes() []byte { + return FocusInEvent(v).Bytes() +} + +func (v FocusOutEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[10] = NewFocusOutEvent +} + +// EventCopy definition CirculateRequest (27) + +const CirculateRequest = 27 + +type CirculateRequestEvent CirculateNotifyEvent + +func NewCirculateRequestEvent(buf []byte) Event { + return CirculateRequestEvent(NewCirculateNotifyEvent(buf).(CirculateNotifyEvent)) +} + +func (v CirculateRequestEvent) Bytes() []byte { + return CirculateNotifyEvent(v).Bytes() +} + +func (v CirculateRequestEvent) ImplementsEvent() {} + +func init() { + newEventFuncs[27] = NewCirculateRequestEvent +} + +// Error definition Request (1) +// Size: 32 + +const BadRequest = 1 + +type RequestError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 1 bytes +} + +// Error read Request +func NewRequestError(buf []byte) Error { + v := RequestError{} + v.NiceName = "Request" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.BadValue = Get32(buf[b:]) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +func (err RequestError) ImplementsError() {} + +func (err RequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err RequestError) BadId() Id { + return Id(err.BadValue) +} + +func (err RequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewRequestError +} + +// Error definition Value (2) +// Size: 32 + +const BadValue = 2 + +type ValueError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 1 bytes +} + +// Error read Value +func NewValueError(buf []byte) Error { + v := ValueError{} + v.NiceName = "Value" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.BadValue = Get32(buf[b:]) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +func (err ValueError) ImplementsError() {} + +func (err ValueError) SequenceId() uint16 { + return err.Sequence +} + +func (err ValueError) BadId() Id { + return Id(err.BadValue) +} + +func (err ValueError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadValue {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewValueError +} + +// ErrorCopy definition Window (3) + +const BadWindow = 3 + +type WindowError ValueError + +func NewWindowError(buf []byte) Error { + v := WindowError(NewValueError(buf).(ValueError)) + v.NiceName = "Window" + return v +} + +func (err WindowError) ImplementsError() {} + +func (err WindowError) SequenceId() uint16 { + return err.Sequence +} + +func (err WindowError) BadId() Id { + return Id(err.BadValue) +} + +func (err WindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadWindow {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[3] = NewWindowError +} + +// ErrorCopy definition Pixmap (4) + +const BadPixmap = 4 + +type PixmapError ValueError + +func NewPixmapError(buf []byte) Error { + v := PixmapError(NewValueError(buf).(ValueError)) + v.NiceName = "Pixmap" + return v +} + +func (err PixmapError) ImplementsError() {} + +func (err PixmapError) SequenceId() uint16 { + return err.Sequence +} + +func (err PixmapError) BadId() Id { + return Id(err.BadValue) +} + +func (err PixmapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadPixmap {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[4] = NewPixmapError +} + +// ErrorCopy definition Atom (5) + +const BadAtom = 5 + +type AtomError ValueError + +func NewAtomError(buf []byte) Error { + v := AtomError(NewValueError(buf).(ValueError)) + v.NiceName = "Atom" + return v +} + +func (err AtomError) ImplementsError() {} + +func (err AtomError) SequenceId() uint16 { + return err.Sequence +} + +func (err AtomError) BadId() Id { + return Id(err.BadValue) +} + +func (err AtomError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAtom {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[5] = NewAtomError +} + +// ErrorCopy definition Cursor (6) + +const BadCursor = 6 + +type CursorError ValueError + +func NewCursorError(buf []byte) Error { + v := CursorError(NewValueError(buf).(ValueError)) + v.NiceName = "Cursor" + return v +} + +func (err CursorError) ImplementsError() {} + +func (err CursorError) SequenceId() uint16 { + return err.Sequence +} + +func (err CursorError) BadId() Id { + return Id(err.BadValue) +} + +func (err CursorError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadCursor {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[6] = NewCursorError +} + +// ErrorCopy definition Font (7) + +const BadFont = 7 + +type FontError ValueError + +func NewFontError(buf []byte) Error { + v := FontError(NewValueError(buf).(ValueError)) + v.NiceName = "Font" + return v +} + +func (err FontError) ImplementsError() {} + +func (err FontError) SequenceId() uint16 { + return err.Sequence +} + +func (err FontError) BadId() Id { + return Id(err.BadValue) +} + +func (err FontError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadFont {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[7] = NewFontError +} + +// ErrorCopy definition Match (8) + +const BadMatch = 8 + +type MatchError RequestError + +func NewMatchError(buf []byte) Error { + v := MatchError(NewRequestError(buf).(RequestError)) + v.NiceName = "Match" + return v +} + +func (err MatchError) ImplementsError() {} + +func (err MatchError) SequenceId() uint16 { + return err.Sequence +} + +func (err MatchError) BadId() Id { + return Id(err.BadValue) +} + +func (err MatchError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadMatch {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[8] = NewMatchError +} + +// ErrorCopy definition Drawable (9) + +const BadDrawable = 9 + +type DrawableError ValueError + +func NewDrawableError(buf []byte) Error { + v := DrawableError(NewValueError(buf).(ValueError)) + v.NiceName = "Drawable" + return v +} + +func (err DrawableError) ImplementsError() {} + +func (err DrawableError) SequenceId() uint16 { + return err.Sequence +} + +func (err DrawableError) BadId() Id { + return Id(err.BadValue) +} + +func (err DrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadDrawable {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[9] = NewDrawableError +} + +// ErrorCopy definition Access (10) + +const BadAccess = 10 + +type AccessError RequestError + +func NewAccessError(buf []byte) Error { + v := AccessError(NewRequestError(buf).(RequestError)) + v.NiceName = "Access" + return v +} + +func (err AccessError) ImplementsError() {} + +func (err AccessError) SequenceId() uint16 { + return err.Sequence +} + +func (err AccessError) BadId() Id { + return Id(err.BadValue) +} + +func (err AccessError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAccess {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[10] = NewAccessError +} + +// ErrorCopy definition Alloc (11) + +const BadAlloc = 11 + +type AllocError RequestError + +func NewAllocError(buf []byte) Error { + v := AllocError(NewRequestError(buf).(RequestError)) + v.NiceName = "Alloc" + return v +} + +func (err AllocError) ImplementsError() {} + +func (err AllocError) SequenceId() uint16 { + return err.Sequence +} + +func (err AllocError) BadId() Id { + return Id(err.BadValue) +} + +func (err AllocError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAlloc {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[11] = NewAllocError +} + +// ErrorCopy definition Colormap (12) + +const BadColormap = 12 + +type ColormapError ValueError + +func NewColormapError(buf []byte) Error { + v := ColormapError(NewValueError(buf).(ValueError)) + v.NiceName = "Colormap" + return v +} + +func (err ColormapError) ImplementsError() {} + +func (err ColormapError) SequenceId() uint16 { + return err.Sequence +} + +func (err ColormapError) BadId() Id { + return Id(err.BadValue) +} + +func (err ColormapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadColormap {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[12] = NewColormapError +} + +// ErrorCopy definition GContext (13) + +const BadGContext = 13 + +type GContextError ValueError + +func NewGContextError(buf []byte) Error { + v := GContextError(NewValueError(buf).(ValueError)) + v.NiceName = "GContext" + return v +} + +func (err GContextError) ImplementsError() {} + +func (err GContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err GContextError) BadId() Id { + return Id(err.BadValue) +} + +func (err GContextError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGContext {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[13] = NewGContextError +} + +// ErrorCopy definition IDChoice (14) + +const BadIDChoice = 14 + +type IDChoiceError ValueError + +func NewIDChoiceError(buf []byte) Error { + v := IDChoiceError(NewValueError(buf).(ValueError)) + v.NiceName = "IDChoice" + return v +} + +func (err IDChoiceError) ImplementsError() {} + +func (err IDChoiceError) SequenceId() uint16 { + return err.Sequence +} + +func (err IDChoiceError) BadId() Id { + return Id(err.BadValue) +} + +func (err IDChoiceError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadIDChoice {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[14] = NewIDChoiceError +} + +// ErrorCopy definition Name (15) + +const BadName = 15 + +type NameError RequestError + +func NewNameError(buf []byte) Error { + v := NameError(NewRequestError(buf).(RequestError)) + v.NiceName = "Name" + return v +} + +func (err NameError) ImplementsError() {} + +func (err NameError) SequenceId() uint16 { + return err.Sequence +} + +func (err NameError) BadId() Id { + return Id(err.BadValue) +} + +func (err NameError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadName {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[15] = NewNameError +} + +// ErrorCopy definition Length (16) + +const BadLength = 16 + +type LengthError RequestError + +func NewLengthError(buf []byte) Error { + v := LengthError(NewRequestError(buf).(RequestError)) + v.NiceName = "Length" + return v +} + +func (err LengthError) ImplementsError() {} + +func (err LengthError) SequenceId() uint16 { + return err.Sequence +} + +func (err LengthError) BadId() Id { + return Id(err.BadValue) +} + +func (err LengthError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadLength {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[16] = NewLengthError +} + +// ErrorCopy definition Implementation (17) + +const BadImplementation = 17 + +type ImplementationError RequestError + +func NewImplementationError(buf []byte) Error { + v := ImplementationError(NewRequestError(buf).(RequestError)) + v.NiceName = "Implementation" + return v +} + +func (err ImplementationError) ImplementsError() {} + +func (err ImplementationError) SequenceId() uint16 { + return err.Sequence +} + +func (err ImplementationError) BadId() Id { + return Id(err.BadValue) +} + +func (err ImplementationError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadImplementation {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[17] = NewImplementationError +} + +// Request CreateWindow +// size: (28 + (4 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for CreateWindow +func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) { + size := (28 + (4 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 1 // request opcode + b += 1 + + buf[b] = Depth + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Wid)) + b += 4 + + Put32(buf[b:], uint32(Parent)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put16(buf[b:], BorderWidth) + b += 2 + + Put16(buf[b:], Class) + b += 2 + + Put32(buf[b:], uint32(Visual)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request ChangeWindowAttributes +// size: (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for ChangeWindowAttributes +func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []uint32) { + size := (8 + (4 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 2 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request GetWindowAttributes +// size: 8 +func (c *Conn) GetWindowAttributes(Window Id) (*GetWindowAttributesReply, error) { + return c.GetWindowAttributesReply(c.GetWindowAttributesRequest(Window)) +} + +// Write request to wire for GetWindowAttributes +func (c *Conn) GetWindowAttributesRequest(Window Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 3 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetWindowAttributes +// size: 44 +type GetWindowAttributesReply struct { + Sequence uint16 + Length uint32 + BackingStore byte + Visual Visualid + Class uint16 + BitGravity byte + WinGravity byte + BackingPlanes uint32 + BackingPixel uint32 + SaveUnder bool + MapIsInstalled bool + MapState byte + OverrideRedirect bool + Colormap Id + AllEventMasks uint32 + YourEventMask uint32 + DoNotPropagateMask uint16 + // padding: 2 bytes +} + +// Read reply GetWindowAttributes +func (c *Conn) GetWindowAttributesReply(cook *Cookie) (*GetWindowAttributesReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetWindowAttributesReply) + b := 1 // skip reply determinant + + v.BackingStore = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + v.Class = Get16(buf[b:]) + b += 2 + + v.BitGravity = buf[b] + b += 1 + + v.WinGravity = buf[b] + b += 1 + + v.BackingPlanes = Get32(buf[b:]) + b += 4 + + v.BackingPixel = Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.SaveUnder = true + } else { + v.SaveUnder = false + } + b += 1 + + if buf[b] == 1 { + v.MapIsInstalled = true + } else { + v.MapIsInstalled = false + } + b += 1 + + v.MapState = buf[b] + b += 1 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + v.Colormap = Id(Get32(buf[b:])) + b += 4 + + v.AllEventMasks = Get32(buf[b:]) + b += 4 + + v.YourEventMask = Get32(buf[b:]) + b += 4 + + v.DoNotPropagateMask = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v, nil +} + +// Request DestroyWindow +// size: 8 +// Write request to wire for DestroyWindow +func (c *Conn) DestroyWindow(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 4 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request DestroySubwindows +// size: 8 +// Write request to wire for DestroySubwindows +func (c *Conn) DestroySubwindows(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 5 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request ChangeSaveSet +// size: 8 +// Write request to wire for ChangeSaveSet +func (c *Conn) ChangeSaveSet(Mode byte, Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 6 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request ReparentWindow +// size: 16 +// Write request to wire for ReparentWindow +func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 7 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Parent)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + c.sendRequest(false, buf) +} + +// Request MapWindow +// size: 8 +// Write request to wire for MapWindow +func (c *Conn) MapWindow(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 8 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request MapSubwindows +// size: 8 +// Write request to wire for MapSubwindows +func (c *Conn) MapSubwindows(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 9 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request UnmapWindow +// size: 8 +// Write request to wire for UnmapWindow +func (c *Conn) UnmapWindow(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 10 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request UnmapSubwindows +// size: 8 +// Write request to wire for UnmapSubwindows +func (c *Conn) UnmapSubwindows(Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 11 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request ConfigureWindow +// size: (10 + (2 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for ConfigureWindow +func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) { + size := (10 + (2 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 12 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], ValueMask) + b += 2 + + b += 2 // padding + + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request CirculateWindow +// size: 8 +// Write request to wire for CirculateWindow +func (c *Conn) CirculateWindow(Direction byte, Window Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 13 // request opcode + b += 1 + + buf[b] = Direction + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GetGeometry +// size: 8 +func (c *Conn) GetGeometry(Drawable Id) (*GetGeometryReply, error) { + return c.GetGeometryReply(c.GetGeometryRequest(Drawable)) +} + +// Write request to wire for GetGeometry +func (c *Conn) GetGeometryRequest(Drawable Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 14 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetGeometry +// size: 24 +type GetGeometryReply struct { + Sequence uint16 + Length uint32 + Depth byte + Root Id + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + // padding: 2 bytes +} + +// Read reply GetGeometry +func (c *Conn) GetGeometryReply(cook *Cookie) (*GetGeometryReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetGeometryReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.BorderWidth = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v, nil +} + +// Request QueryTree +// size: 8 +func (c *Conn) QueryTree(Window Id) (*QueryTreeReply, error) { + return c.QueryTreeReply(c.QueryTreeRequest(Window)) +} + +// Write request to wire for QueryTree +func (c *Conn) QueryTreeRequest(Window Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 15 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryTree +// size: (32 + pad((int(ChildrenLen) * 4))) +type QueryTreeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Root Id + Parent Id + ChildrenLen uint16 + // padding: 14 bytes + Children []Id // size: pad((int(ChildrenLen) * 4)) +} + +// Read reply QueryTree +func (c *Conn) QueryTreeReply(cook *Cookie) (*QueryTreeReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryTreeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Parent = Id(Get32(buf[b:])) + b += 4 + + v.ChildrenLen = Get16(buf[b:]) + b += 2 + + b += 14 // padding + + v.Children = make([]Id, v.ChildrenLen) + for i := 0; i < int(v.ChildrenLen); i++ { + v.Children[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request InternAtom +// size: (8 + pad((int(NameLen) * 1))) +func (c *Conn) InternAtom(OnlyIfExists bool, NameLen uint16, Name string) (*InternAtomReply, error) { + return c.InternAtomReply(c.InternAtomRequest(OnlyIfExists, NameLen, Name)) +} + +// Write request to wire for InternAtom +func (c *Conn) InternAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) *Cookie { + size := (8 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 16 // request opcode + b += 1 + + if OnlyIfExists { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for InternAtom +// size: 12 +type InternAtomReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Atom Id +} + +// Read reply InternAtom +func (c *Conn) InternAtomReply(cook *Cookie) (*InternAtomReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(InternAtomReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Atom = Id(Get32(buf[b:])) + b += 4 + + return v, nil +} + +// Request GetAtomName +// size: 8 +func (c *Conn) GetAtomName(Atom Id) (*GetAtomNameReply, error) { + return c.GetAtomNameReply(c.GetAtomNameRequest(Atom)) +} + +// Write request to wire for GetAtomName +func (c *Conn) GetAtomNameRequest(Atom Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 17 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Atom)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetAtomName +// size: (32 + pad((int(NameLen) * 1))) +type GetAtomNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NameLen uint16 + // padding: 22 bytes + Name string // size: pad((int(NameLen) * 1)) +} + +// Read reply GetAtomName +func (c *Conn) GetAtomNameReply(cook *Cookie) (*GetAtomNameReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetAtomNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NameLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameLen)) + } + + return v, nil +} + +// Request ChangeProperty +// size: (24 + pad((((int(DataLen) * int(Format)) / 8) * 1))) +// Write request to wire for ChangeProperty +func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) { + size := (24 + pad((((int(DataLen) * int(Format)) / 8) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 18 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + b += 3 // padding + + Put32(buf[b:], DataLen) + b += 4 + + copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) + b += pad(int(((int(DataLen) * int(Format)) / 8))) + + c.sendRequest(false, buf) +} + +// Request DeleteProperty +// size: 12 +// Write request to wire for DeleteProperty +func (c *Conn) DeleteProperty(Window Id, Property Id) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 19 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GetProperty +// size: 24 +func (c *Conn) GetProperty(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) (*GetPropertyReply, error) { + return c.GetPropertyReply(c.GetPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength)) +} + +// Write request to wire for GetProperty +func (c *Conn) GetPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) *Cookie { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 20 // request opcode + b += 1 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + Put32(buf[b:], uint32(Type)) + b += 4 + + Put32(buf[b:], LongOffset) + b += 4 + + Put32(buf[b:], LongLength) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetProperty +// size: (32 + pad(((int(ValueLen) * (int(Format) / 8)) * 1))) +type GetPropertyReply struct { + Sequence uint16 + Length uint32 + Format byte + Type Id + BytesAfter uint32 + ValueLen uint32 + // padding: 12 bytes + Value []byte // size: pad(((int(ValueLen) * (int(Format) / 8)) * 1)) +} + +// Read reply GetProperty +func (c *Conn) GetPropertyReply(cook *Cookie) (*GetPropertyReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = Id(Get32(buf[b:])) + b += 4 + + v.BytesAfter = Get32(buf[b:]) + b += 4 + + v.ValueLen = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) + copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) + b += pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) + + return v, nil +} + +// Request ListProperties +// size: 8 +func (c *Conn) ListProperties(Window Id) (*ListPropertiesReply, error) { + return c.ListPropertiesReply(c.ListPropertiesRequest(Window)) +} + +// Write request to wire for ListProperties +func (c *Conn) ListPropertiesRequest(Window Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 21 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for ListProperties +// size: (32 + pad((int(AtomsLen) * 4))) +type ListPropertiesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + AtomsLen uint16 + // padding: 22 bytes + Atoms []Id // size: pad((int(AtomsLen) * 4)) +} + +// Read reply ListProperties +func (c *Conn) ListPropertiesReply(cook *Cookie) (*ListPropertiesReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.AtomsLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Atoms = make([]Id, v.AtomsLen) + for i := 0; i < int(v.AtomsLen); i++ { + v.Atoms[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request SetSelectionOwner +// size: 16 +// Write request to wire for SetSelectionOwner +func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 22 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Owner)) + b += 4 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GetSelectionOwner +// size: 8 +func (c *Conn) GetSelectionOwner(Selection Id) (*GetSelectionOwnerReply, error) { + return c.GetSelectionOwnerReply(c.GetSelectionOwnerRequest(Selection)) +} + +// Write request to wire for GetSelectionOwner +func (c *Conn) GetSelectionOwnerRequest(Selection Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 23 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetSelectionOwner +// size: 12 +type GetSelectionOwnerReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Owner Id +} + +// Read reply GetSelectionOwner +func (c *Conn) GetSelectionOwnerReply(cook *Cookie) (*GetSelectionOwnerReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetSelectionOwnerReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Owner = Id(Get32(buf[b:])) + b += 4 + + return v, nil +} + +// Request ConvertSelection +// size: 24 +// Write request to wire for ConvertSelection +func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 24 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Requestor)) + b += 4 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + Put32(buf[b:], uint32(Target)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request SendEvent +// size: (12 + pad(32)) +// Write request to wire for SendEvent +func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event string) { + size := (12 + pad(32)) + b := 0 + buf := make([]byte, size) + + buf[b] = 25 // request opcode + b += 1 + + if Propagate { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + Put32(buf[b:], EventMask) + b += 4 + + copy(buf[b:], Event[:32]) + b += pad(int(32)) + + c.sendRequest(false, buf) +} + +// Request GrabPointer +// size: 24 +func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) (*GrabPointerReply, error) { + return c.GrabPointerReply(c.GrabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time)) +} + +// Write request to wire for GrabPointer +func (c *Conn) GrabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) *Cookie { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 26 // request opcode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], EventMask) + b += 2 + + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode + b += 1 + + Put32(buf[b:], uint32(ConfineTo)) + b += 4 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GrabPointer +// size: 8 +type GrabPointerReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Read reply GrabPointer +func (c *Conn) GrabPointerReply(cook *Cookie) (*GrabPointerReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GrabPointerReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v, nil +} + +// Request UngrabPointer +// size: 8 +// Write request to wire for UngrabPointer +func (c *Conn) UngrabPointer(Time Timestamp) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 27 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GrabButton +// size: 24 +// Write request to wire for GrabButton +func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 28 // request opcode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], EventMask) + b += 2 + + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode + b += 1 + + Put32(buf[b:], uint32(ConfineTo)) + b += 4 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + buf[b] = Button + b += 1 + + b += 1 // padding + + Put16(buf[b:], Modifiers) + b += 2 + + c.sendRequest(false, buf) +} + +// Request UngrabButton +// size: 12 +// Write request to wire for UngrabButton +func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 29 // request opcode + b += 1 + + buf[b] = Button + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], Modifiers) + b += 2 + + b += 2 // padding + + c.sendRequest(false, buf) +} + +// Request ChangeActivePointerGrab +// size: 16 +// Write request to wire for ChangeActivePointerGrab +func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint16) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 30 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + Put16(buf[b:], EventMask) + b += 2 + + b += 2 // padding + + c.sendRequest(false, buf) +} + +// Request GrabKeyboard +// size: 16 +func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) (*GrabKeyboardReply, error) { + return c.GrabKeyboardReply(c.GrabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode)) +} + +// Write request to wire for GrabKeyboard +func (c *Conn) GrabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) *Cookie { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 31 // request opcode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode + b += 1 + + b += 2 // padding + + return c.sendRequest(true, buf) +} + +// Request reply for GrabKeyboard +// size: 8 +type GrabKeyboardReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Read reply GrabKeyboard +func (c *Conn) GrabKeyboardReply(cook *Cookie) (*GrabKeyboardReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GrabKeyboardReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v, nil +} + +// Request UngrabKeyboard +// size: 8 +// Write request to wire for UngrabKeyboard +func (c *Conn) UngrabKeyboard(Time Timestamp) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 32 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GrabKey +// size: 16 +// Write request to wire for GrabKey +func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 33 // request opcode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = byte(Key) + b += 1 + + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode + b += 1 + + b += 3 // padding + + c.sendRequest(false, buf) +} + +// Request UngrabKey +// size: 12 +// Write request to wire for UngrabKey +func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 34 // request opcode + b += 1 + + buf[b] = byte(Key) + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], Modifiers) + b += 2 + + b += 2 // padding + + c.sendRequest(false, buf) +} + +// Request AllowEvents +// size: 8 +// Write request to wire for AllowEvents +func (c *Conn) AllowEvents(Mode byte, Time Timestamp) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 35 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GrabServer +// size: 3 +// Write request to wire for GrabServer +func (c *Conn) GrabServer() { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 36 // request opcode + b += 1 + + c.sendRequest(false, buf) +} + +// Request UngrabServer +// size: 3 +// Write request to wire for UngrabServer +func (c *Conn) UngrabServer() { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 37 // request opcode + b += 1 + + c.sendRequest(false, buf) +} + +// Request QueryPointer +// size: 8 +func (c *Conn) QueryPointer(Window Id) (*QueryPointerReply, error) { + return c.QueryPointerReply(c.QueryPointerRequest(Window)) +} + +// Write request to wire for QueryPointer +func (c *Conn) QueryPointerRequest(Window Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 38 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryPointer +// size: 28 +type QueryPointerReply struct { + Sequence uint16 + Length uint32 + SameScreen bool + Root Id + Child Id + RootX int16 + RootY int16 + WinX int16 + WinY int16 + Mask uint16 + // padding: 2 bytes +} + +// Read reply QueryPointer +func (c *Conn) QueryPointerReply(cook *Cookie) (*QueryPointerReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryPointerReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.WinX = int16(Get16(buf[b:])) + b += 2 + + v.WinY = int16(Get16(buf[b:])) + b += 2 + + v.Mask = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v, nil +} + +// Request GetMotionEvents +// size: 16 +func (c *Conn) GetMotionEvents(Window Id, Start Timestamp, Stop Timestamp) (*GetMotionEventsReply, error) { + return c.GetMotionEventsReply(c.GetMotionEventsRequest(Window, Start, Stop)) +} + +// Write request to wire for GetMotionEvents +func (c *Conn) GetMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) *Cookie { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 39 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Start)) + b += 4 + + Put32(buf[b:], uint32(Stop)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetMotionEvents +// size: (32 + pad((int(EventsLen) * 8))) +type GetMotionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + EventsLen uint32 + // padding: 20 bytes + Events []Timecoord // size: pad((int(EventsLen) * 8)) +} + +// Read reply GetMotionEvents +func (c *Conn) GetMotionEventsReply(cook *Cookie) (*GetMotionEventsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventsLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Events = make([]Timecoord, v.EventsLen) + b += ReadTimecoordList(buf[b:], v.Events) + + return v, nil +} + +// Request TranslateCoordinates +// size: 16 +func (c *Conn) TranslateCoordinates(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) (*TranslateCoordinatesReply, error) { + return c.TranslateCoordinatesReply(c.TranslateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY)) +} + +// Write request to wire for TranslateCoordinates +func (c *Conn) TranslateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) *Cookie { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 40 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcWindow)) + b += 4 + + Put32(buf[b:], uint32(DstWindow)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + return c.sendRequest(true, buf) +} + +// Request reply for TranslateCoordinates +// size: 16 +type TranslateCoordinatesReply struct { + Sequence uint16 + Length uint32 + SameScreen bool + Child Id + DstX int16 + DstY int16 +} + +// Read reply TranslateCoordinates +func (c *Conn) TranslateCoordinatesReply(cook *Cookie) (*TranslateCoordinatesReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(TranslateCoordinatesReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.DstX = int16(Get16(buf[b:])) + b += 2 + + v.DstY = int16(Get16(buf[b:])) + b += 2 + + return v, nil +} + +// Request WarpPointer +// size: 24 +// Write request to wire for WarpPointer +func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 41 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcWindow)) + b += 4 + + Put32(buf[b:], uint32(DstWindow)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], SrcWidth) + b += 2 + + Put16(buf[b:], SrcHeight) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + c.sendRequest(false, buf) +} + +// Request SetInputFocus +// size: 12 +// Write request to wire for SetInputFocus +func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 42 // request opcode + b += 1 + + buf[b] = RevertTo + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Focus)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request GetInputFocus +// size: 3 +func (c *Conn) GetInputFocus() (*GetInputFocusReply, error) { + return c.GetInputFocusReply(c.GetInputFocusRequest()) +} + +// Write request to wire for GetInputFocus +func (c *Conn) GetInputFocusRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 43 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetInputFocus +// size: 12 +type GetInputFocusReply struct { + Sequence uint16 + Length uint32 + RevertTo byte + Focus Id +} + +// Read reply GetInputFocus +func (c *Conn) GetInputFocusReply(cook *Cookie) (*GetInputFocusReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetInputFocusReply) + b := 1 // skip reply determinant + + v.RevertTo = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Focus = Id(Get32(buf[b:])) + b += 4 + + return v, nil +} + +// Request QueryKeymap +// size: 3 +func (c *Conn) QueryKeymap() (*QueryKeymapReply, error) { + return c.QueryKeymapReply(c.QueryKeymapRequest()) +} + +// Write request to wire for QueryKeymap +func (c *Conn) QueryKeymapRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 44 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryKeymap +// size: (8 + pad(32)) +type QueryKeymapReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Keys []byte // size: pad(32) +} + +// Read reply QueryKeymap +func (c *Conn) QueryKeymapReply(cook *Cookie) (*QueryKeymapReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryKeymapReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Keys = make([]byte, 32) + copy(v.Keys[:32], buf[b:]) + b += pad(int(32)) + + return v, nil +} + +// Request OpenFont +// size: (12 + pad((int(NameLen) * 1))) +// Write request to wire for OpenFont +func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) { + size := (12 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 45 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Fid)) + b += 4 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + c.sendRequest(false, buf) +} + +// Request CloseFont +// size: 8 +// Write request to wire for CloseFont +func (c *Conn) CloseFont(Font Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 46 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Font)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request QueryFont +// size: 8 +func (c *Conn) QueryFont(Font Id) (*QueryFontReply, error) { + return c.QueryFontReply(c.QueryFontRequest(Font)) +} + +// Write request to wire for QueryFont +func (c *Conn) QueryFontRequest(Font Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 47 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Font)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryFont +// size: ((60 + pad((int(PropertiesLen) * 8))) + pad((int(CharInfosLen) * 12))) +type QueryFontReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MinBounds Charinfo + // padding: 4 bytes + MaxBounds Charinfo + // padding: 4 bytes + MinCharOrByte2 uint16 + MaxCharOrByte2 uint16 + DefaultChar uint16 + PropertiesLen uint16 + DrawDirection byte + MinByte1 byte + MaxByte1 byte + AllCharsExist bool + FontAscent int16 + FontDescent int16 + CharInfosLen uint32 + Properties []Fontprop // size: pad((int(PropertiesLen) * 8)) + CharInfos []Charinfo // size: pad((int(CharInfosLen) * 12)) +} + +// Read reply QueryFont +func (c *Conn) QueryFontReply(cook *Cookie) (*QueryFontReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryFontReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinBounds = Charinfo{} + b += ReadCharinfo(buf[b:], &v.MinBounds) + + b += 4 // padding + + v.MaxBounds = Charinfo{} + b += ReadCharinfo(buf[b:], &v.MaxBounds) + + b += 4 // padding + + v.MinCharOrByte2 = Get16(buf[b:]) + b += 2 + + v.MaxCharOrByte2 = Get16(buf[b:]) + b += 2 + + v.DefaultChar = Get16(buf[b:]) + b += 2 + + v.PropertiesLen = Get16(buf[b:]) + b += 2 + + v.DrawDirection = buf[b] + b += 1 + + v.MinByte1 = buf[b] + b += 1 + + v.MaxByte1 = buf[b] + b += 1 + + if buf[b] == 1 { + v.AllCharsExist = true + } else { + v.AllCharsExist = false + } + b += 1 + + v.FontAscent = int16(Get16(buf[b:])) + b += 2 + + v.FontDescent = int16(Get16(buf[b:])) + b += 2 + + v.CharInfosLen = Get32(buf[b:]) + b += 4 + + v.Properties = make([]Fontprop, v.PropertiesLen) + b += ReadFontpropList(buf[b:], v.Properties) + + v.CharInfos = make([]Charinfo, v.CharInfosLen) + b += ReadCharinfoList(buf[b:], v.CharInfos) + + return v, nil +} + +// Request QueryTextExtents +// size: (8 + pad((len(String) * 2))) +func (c *Conn) QueryTextExtents(Font Id, String []Char2b, StringLen uint16) (*QueryTextExtentsReply, error) { + return c.QueryTextExtentsReply(c.QueryTextExtentsRequest(Font, String, StringLen)) +} + +// Write request to wire for QueryTextExtents +func (c *Conn) QueryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) *Cookie { + size := (8 + pad((len(String) * 2))) + b := 0 + buf := make([]byte, size) + + buf[b] = 48 // request opcode + b += 1 + + buf[b] = byte((int(StringLen) & 1)) + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Font)) + b += 4 + + b += Char2bListBytes(buf[b:], String) + + // skip writing local field: StringLen (2) :: uint16 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryTextExtents +// size: 28 +type QueryTextExtentsReply struct { + Sequence uint16 + Length uint32 + DrawDirection byte + FontAscent int16 + FontDescent int16 + OverallAscent int16 + OverallDescent int16 + OverallWidth int32 + OverallLeft int32 + OverallRight int32 +} + +// Read reply QueryTextExtents +func (c *Conn) QueryTextExtentsReply(cook *Cookie) (*QueryTextExtentsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryTextExtentsReply) + b := 1 // skip reply determinant + + v.DrawDirection = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.FontAscent = int16(Get16(buf[b:])) + b += 2 + + v.FontDescent = int16(Get16(buf[b:])) + b += 2 + + v.OverallAscent = int16(Get16(buf[b:])) + b += 2 + + v.OverallDescent = int16(Get16(buf[b:])) + b += 2 + + v.OverallWidth = int32(Get32(buf[b:])) + b += 4 + + v.OverallLeft = int32(Get32(buf[b:])) + b += 4 + + v.OverallRight = int32(Get32(buf[b:])) + b += 4 + + return v, nil +} + +// Request ListFonts +// size: (8 + pad((int(PatternLen) * 1))) +func (c *Conn) ListFonts(MaxNames uint16, PatternLen uint16, Pattern string) (*ListFontsReply, error) { + return c.ListFontsReply(c.ListFontsRequest(MaxNames, PatternLen, Pattern)) +} + +// Write request to wire for ListFonts +func (c *Conn) ListFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) *Cookie { + size := (8 + pad((int(PatternLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 49 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], MaxNames) + b += 2 + + Put16(buf[b:], PatternLen) + b += 2 + + copy(buf[b:], Pattern[:PatternLen]) + b += pad(int(PatternLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for ListFonts +// size: (32 + StrListSize(Names)) +type ListFontsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NamesLen uint16 + // padding: 22 bytes + Names []Str // size: StrListSize(Names) +} + +// Read reply ListFonts +func (c *Conn) ListFontsReply(cook *Cookie) (*ListFontsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListFontsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NamesLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Names = make([]Str, v.NamesLen) + b += ReadStrList(buf[b:], v.Names) + + return v, nil +} + +// Request ListFontsWithInfo +// size: (8 + pad((int(PatternLen) * 1))) +func (c *Conn) ListFontsWithInfo(MaxNames uint16, PatternLen uint16, Pattern string) (*ListFontsWithInfoReply, error) { + return c.ListFontsWithInfoReply(c.ListFontsWithInfoRequest(MaxNames, PatternLen, Pattern)) +} + +// Write request to wire for ListFontsWithInfo +func (c *Conn) ListFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) *Cookie { + size := (8 + pad((int(PatternLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 50 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], MaxNames) + b += 2 + + Put16(buf[b:], PatternLen) + b += 2 + + copy(buf[b:], Pattern[:PatternLen]) + b += pad(int(PatternLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for ListFontsWithInfo +// size: ((60 + pad((int(PropertiesLen) * 8))) + pad((int(NameLen) * 1))) +type ListFontsWithInfoReply struct { + Sequence uint16 + Length uint32 + NameLen byte + MinBounds Charinfo + // padding: 4 bytes + MaxBounds Charinfo + // padding: 4 bytes + MinCharOrByte2 uint16 + MaxCharOrByte2 uint16 + DefaultChar uint16 + PropertiesLen uint16 + DrawDirection byte + MinByte1 byte + MaxByte1 byte + AllCharsExist bool + FontAscent int16 + FontDescent int16 + RepliesHint uint32 + Properties []Fontprop // size: pad((int(PropertiesLen) * 8)) + Name string // size: pad((int(NameLen) * 1)) +} + +// Read reply ListFontsWithInfo +func (c *Conn) ListFontsWithInfoReply(cook *Cookie) (*ListFontsWithInfoReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListFontsWithInfoReply) + b := 1 // skip reply determinant + + v.NameLen = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinBounds = Charinfo{} + b += ReadCharinfo(buf[b:], &v.MinBounds) + + b += 4 // padding + + v.MaxBounds = Charinfo{} + b += ReadCharinfo(buf[b:], &v.MaxBounds) + + b += 4 // padding + + v.MinCharOrByte2 = Get16(buf[b:]) + b += 2 + + v.MaxCharOrByte2 = Get16(buf[b:]) + b += 2 + + v.DefaultChar = Get16(buf[b:]) + b += 2 + + v.PropertiesLen = Get16(buf[b:]) + b += 2 + + v.DrawDirection = buf[b] + b += 1 + + v.MinByte1 = buf[b] + b += 1 + + v.MaxByte1 = buf[b] + b += 1 + + if buf[b] == 1 { + v.AllCharsExist = true + } else { + v.AllCharsExist = false + } + b += 1 + + v.FontAscent = int16(Get16(buf[b:])) + b += 2 + + v.FontDescent = int16(Get16(buf[b:])) + b += 2 + + v.RepliesHint = Get32(buf[b:]) + b += 4 + + v.Properties = make([]Fontprop, v.PropertiesLen) + b += ReadFontpropList(buf[b:], v.Properties) + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameLen)) + } + + return v, nil +} + +// Request SetFontPath +// size: (8 + StrListSize(Font)) +// Write request to wire for SetFontPath +func (c *Conn) SetFontPath(FontQty uint16, Font []Str) { + size := (8 + StrListSize(Font)) + b := 0 + buf := make([]byte, size) + + buf[b] = 51 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], FontQty) + b += 2 + + b += 2 // padding + + b += StrListBytes(buf[b:], Font) + + c.sendRequest(false, buf) +} + +// Request GetFontPath +// size: 3 +func (c *Conn) GetFontPath() (*GetFontPathReply, error) { + return c.GetFontPathReply(c.GetFontPathRequest()) +} + +// Write request to wire for GetFontPath +func (c *Conn) GetFontPathRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 52 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetFontPath +// size: (32 + StrListSize(Path)) +type GetFontPathReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PathLen uint16 + // padding: 22 bytes + Path []Str // size: StrListSize(Path) +} + +// Read reply GetFontPath +func (c *Conn) GetFontPathReply(cook *Cookie) (*GetFontPathReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetFontPathReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PathLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Path = make([]Str, v.PathLen) + b += ReadStrList(buf[b:], v.Path) + + return v, nil +} + +// Request CreatePixmap +// size: 16 +// Write request to wire for CreatePixmap +func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 53 // request opcode + b += 1 + + buf[b] = Depth + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Pid)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + c.sendRequest(false, buf) +} + +// Request FreePixmap +// size: 8 +// Write request to wire for FreePixmap +func (c *Conn) FreePixmap(Pixmap Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 54 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Pixmap)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request CreateGC +// size: (12 + (4 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for CreateGC +func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) { + size := (12 + (4 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 55 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cid)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request ChangeGC +// size: (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for ChangeGC +func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) { + size := (8 + (4 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 56 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request CopyGC +// size: 16 +// Write request to wire for CopyGC +func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 57 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcGc)) + b += 4 + + Put32(buf[b:], uint32(DstGc)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + + c.sendRequest(false, buf) +} + +// Request SetDashes +// size: (12 + pad((int(DashesLen) * 1))) +// Write request to wire for SetDashes +func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) { + size := (12 + pad((int(DashesLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 58 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], DashOffset) + b += 2 + + Put16(buf[b:], DashesLen) + b += 2 + + copy(buf[b:], Dashes[:DashesLen]) + b += pad(int(DashesLen)) + + c.sendRequest(false, buf) +} + +// Request SetClipRectangles +// size: (12 + pad((len(Rectangles) * 8))) +// Write request to wire for SetClipRectangles +func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) { + size := (12 + pad((len(Rectangles) * 8))) + b := 0 + buf := make([]byte, size) + + buf[b] = 59 // request opcode + b += 1 + + buf[b] = Ordering + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(ClipXOrigin)) + b += 2 + + Put16(buf[b:], uint16(ClipYOrigin)) + b += 2 + + b += RectangleListBytes(buf[b:], Rectangles) + + c.sendRequest(false, buf) +} + +// Request FreeGC +// size: 8 +// Write request to wire for FreeGC +func (c *Conn) FreeGC(Gc Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 60 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request ClearArea +// size: 16 +// Write request to wire for ClearArea +func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 61 // request opcode + b += 1 + + if Exposures { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + c.sendRequest(false, buf) +} + +// Request CopyArea +// size: 28 +// Write request to wire for CopyArea +func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = 62 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcDrawable)) + b += 4 + + Put32(buf[b:], uint32(DstDrawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + c.sendRequest(false, buf) +} + +// Request CopyPlane +// size: 32 +// Write request to wire for CopyPlane +func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 63 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcDrawable)) + b += 4 + + Put32(buf[b:], uint32(DstDrawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put32(buf[b:], BitPlane) + b += 4 + + c.sendRequest(false, buf) +} + +// Request PolyPoint +// size: (12 + pad((len(Points) * 4))) +// Write request to wire for PolyPoint +func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) { + size := (12 + pad((len(Points) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 64 // request opcode + b += 1 + + buf[b] = CoordinateMode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += PointListBytes(buf[b:], Points) + + c.sendRequest(false, buf) +} + +// Request PolyLine +// size: (12 + pad((len(Points) * 4))) +// Write request to wire for PolyLine +func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) { + size := (12 + pad((len(Points) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 65 // request opcode + b += 1 + + buf[b] = CoordinateMode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += PointListBytes(buf[b:], Points) + + c.sendRequest(false, buf) +} + +// Request PolySegment +// size: (12 + pad((len(Segments) * 8))) +// Write request to wire for PolySegment +func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) { + size := (12 + pad((len(Segments) * 8))) + b := 0 + buf := make([]byte, size) + + buf[b] = 66 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += SegmentListBytes(buf[b:], Segments) + + c.sendRequest(false, buf) +} + +// Request PolyRectangle +// size: (12 + pad((len(Rectangles) * 8))) +// Write request to wire for PolyRectangle +func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { + size := (12 + pad((len(Rectangles) * 8))) + b := 0 + buf := make([]byte, size) + + buf[b] = 67 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + c.sendRequest(false, buf) +} + +// Request PolyArc +// size: (12 + pad((len(Arcs) * 12))) +// Write request to wire for PolyArc +func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) { + size := (12 + pad((len(Arcs) * 12))) + b := 0 + buf := make([]byte, size) + + buf[b] = 68 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += ArcListBytes(buf[b:], Arcs) + + c.sendRequest(false, buf) +} + +// Request FillPoly +// size: (16 + pad((len(Points) * 4))) +// Write request to wire for FillPoly +func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) { + size := (16 + pad((len(Points) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 69 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + buf[b] = Shape + b += 1 + + buf[b] = CoordinateMode + b += 1 + + b += 2 // padding + + b += PointListBytes(buf[b:], Points) + + c.sendRequest(false, buf) +} + +// Request PolyFillRectangle +// size: (12 + pad((len(Rectangles) * 8))) +// Write request to wire for PolyFillRectangle +func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { + size := (12 + pad((len(Rectangles) * 8))) + b := 0 + buf := make([]byte, size) + + buf[b] = 70 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + c.sendRequest(false, buf) +} + +// Request PolyFillArc +// size: (12 + pad((len(Arcs) * 12))) +// Write request to wire for PolyFillArc +func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) { + size := (12 + pad((len(Arcs) * 12))) + b := 0 + buf := make([]byte, size) + + buf[b] = 71 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + b += ArcListBytes(buf[b:], Arcs) + + c.sendRequest(false, buf) +} + +// Request PutImage +// size: (24 + pad((len(Data) * 1))) +// Write request to wire for PutImage +func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) { + size := (24 + pad((len(Data) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 72 // request opcode + b += 1 + + buf[b] = Format + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + buf[b] = LeftPad + b += 1 + + buf[b] = Depth + b += 1 + + b += 2 // padding + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + c.sendRequest(false, buf) +} + +// Request GetImage +// size: 20 +func (c *Conn) GetImage(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) (*GetImageReply, error) { + return c.GetImageReply(c.GetImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask)) +} + +// Write request to wire for GetImage +func (c *Conn) GetImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) *Cookie { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = 73 // request opcode + b += 1 + + buf[b] = Format + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put32(buf[b:], PlaneMask) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for GetImage +// size: (32 + pad(((int(Length) * 4) * 1))) +type GetImageReply struct { + Sequence uint16 + Length uint32 + Depth byte + Visual Visualid + // padding: 20 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Read reply GetImage +func (c *Conn) GetImageReply(cook *Cookie) (*GetImageReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetImageReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v, nil +} + +// Request PolyText8 +// size: (16 + pad((len(Items) * 1))) +// Write request to wire for PolyText8 +func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { + size := (16 + pad((len(Items) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 74 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + copy(buf[b:], Items[:len(Items)]) + b += pad(int(len(Items))) + + c.sendRequest(false, buf) +} + +// Request PolyText16 +// size: (16 + pad((len(Items) * 1))) +// Write request to wire for PolyText16 +func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { + size := (16 + pad((len(Items) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 75 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + copy(buf[b:], Items[:len(Items)]) + b += pad(int(len(Items))) + + c.sendRequest(false, buf) +} + +// Request ImageText8 +// size: (16 + pad((int(StringLen) * 1))) +// Write request to wire for ImageText8 +func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) { + size := (16 + pad((int(StringLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 76 // request opcode + b += 1 + + buf[b] = StringLen + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + copy(buf[b:], String[:StringLen]) + b += pad(int(StringLen)) + + c.sendRequest(false, buf) +} + +// Request ImageText16 +// size: (16 + pad((int(StringLen) * 2))) +// Write request to wire for ImageText16 +func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) { + size := (16 + pad((int(StringLen) * 2))) + b := 0 + buf := make([]byte, size) + + buf[b] = 77 // request opcode + b += 1 + + buf[b] = StringLen + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + b += Char2bListBytes(buf[b:], String) + + c.sendRequest(false, buf) +} + +// Request CreateColormap +// size: 16 +// Write request to wire for CreateColormap +func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 78 // request opcode + b += 1 + + buf[b] = Alloc + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Mid)) + b += 4 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Visual)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request FreeColormap +// size: 8 +// Write request to wire for FreeColormap +func (c *Conn) FreeColormap(Cmap Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 79 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request CopyColormapAndFree +// size: 12 +// Write request to wire for CopyColormapAndFree +func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 80 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Mid)) + b += 4 + + Put32(buf[b:], uint32(SrcCmap)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request InstallColormap +// size: 8 +// Write request to wire for InstallColormap +func (c *Conn) InstallColormap(Cmap Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 81 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request UninstallColormap +// size: 8 +// Write request to wire for UninstallColormap +func (c *Conn) UninstallColormap(Cmap Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 82 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request ListInstalledColormaps +// size: 8 +func (c *Conn) ListInstalledColormaps(Window Id) (*ListInstalledColormapsReply, error) { + return c.ListInstalledColormapsReply(c.ListInstalledColormapsRequest(Window)) +} + +// Write request to wire for ListInstalledColormaps +func (c *Conn) ListInstalledColormapsRequest(Window Id) *Cookie { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 83 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return c.sendRequest(true, buf) +} + +// Request reply for ListInstalledColormaps +// size: (32 + pad((int(CmapsLen) * 4))) +type ListInstalledColormapsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + CmapsLen uint16 + // padding: 22 bytes + Cmaps []Id // size: pad((int(CmapsLen) * 4)) +} + +// Read reply ListInstalledColormaps +func (c *Conn) ListInstalledColormapsReply(cook *Cookie) (*ListInstalledColormapsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListInstalledColormapsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.CmapsLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Cmaps = make([]Id, v.CmapsLen) + for i := 0; i < int(v.CmapsLen); i++ { + v.Cmaps[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request AllocColor +// size: 16 +func (c *Conn) AllocColor(Cmap Id, Red uint16, Green uint16, Blue uint16) (*AllocColorReply, error) { + return c.AllocColorReply(c.AllocColorRequest(Cmap, Red, Green, Blue)) +} + +// Write request to wire for AllocColor +func (c *Conn) AllocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) *Cookie { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 84 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], Red) + b += 2 + + Put16(buf[b:], Green) + b += 2 + + Put16(buf[b:], Blue) + b += 2 + + b += 2 // padding + + return c.sendRequest(true, buf) +} + +// Request reply for AllocColor +// size: 20 +type AllocColorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Red uint16 + Green uint16 + Blue uint16 + // padding: 2 bytes + Pixel uint32 +} + +// Read reply AllocColor +func (c *Conn) AllocColorReply(cook *Cookie) (*AllocColorReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(AllocColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Pixel = Get32(buf[b:]) + b += 4 + + return v, nil +} + +// Request AllocNamedColor +// size: (12 + pad((int(NameLen) * 1))) +func (c *Conn) AllocNamedColor(Cmap Id, NameLen uint16, Name string) (*AllocNamedColorReply, error) { + return c.AllocNamedColorReply(c.AllocNamedColorRequest(Cmap, NameLen, Name)) +} + +// Write request to wire for AllocNamedColor +func (c *Conn) AllocNamedColorRequest(Cmap Id, NameLen uint16, Name string) *Cookie { + size := (12 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 85 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for AllocNamedColor +// size: 24 +type AllocNamedColorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Pixel uint32 + ExactRed uint16 + ExactGreen uint16 + ExactBlue uint16 + VisualRed uint16 + VisualGreen uint16 + VisualBlue uint16 +} + +// Read reply AllocNamedColor +func (c *Conn) AllocNamedColorReply(cook *Cookie) (*AllocNamedColorReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(AllocNamedColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Pixel = Get32(buf[b:]) + b += 4 + + v.ExactRed = Get16(buf[b:]) + b += 2 + + v.ExactGreen = Get16(buf[b:]) + b += 2 + + v.ExactBlue = Get16(buf[b:]) + b += 2 + + v.VisualRed = Get16(buf[b:]) + b += 2 + + v.VisualGreen = Get16(buf[b:]) + b += 2 + + v.VisualBlue = Get16(buf[b:]) + b += 2 + + return v, nil +} + +// Request AllocColorCells +// size: 12 +func (c *Conn) AllocColorCells(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) (*AllocColorCellsReply, error) { + return c.AllocColorCellsReply(c.AllocColorCellsRequest(Contiguous, Cmap, Colors, Planes)) +} + +// Write request to wire for AllocColorCells +func (c *Conn) AllocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) *Cookie { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 86 // request opcode + b += 1 + + if Contiguous { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], Colors) + b += 2 + + Put16(buf[b:], Planes) + b += 2 + + return c.sendRequest(true, buf) +} + +// Request reply for AllocColorCells +// size: ((32 + pad((int(PixelsLen) * 4))) + pad((int(MasksLen) * 4))) +type AllocColorCellsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PixelsLen uint16 + MasksLen uint16 + // padding: 20 bytes + Pixels []uint32 // size: pad((int(PixelsLen) * 4)) + Masks []uint32 // size: pad((int(MasksLen) * 4)) +} + +// Read reply AllocColorCells +func (c *Conn) AllocColorCellsReply(cook *Cookie) (*AllocColorCellsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(AllocColorCellsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PixelsLen = Get16(buf[b:]) + b += 2 + + v.MasksLen = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + v.Pixels = make([]uint32, v.PixelsLen) + for i := 0; i < int(v.PixelsLen); i++ { + v.Pixels[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.Masks = make([]uint32, v.MasksLen) + for i := 0; i < int(v.MasksLen); i++ { + v.Masks[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request AllocColorPlanes +// size: 16 +func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) (*AllocColorPlanesReply, error) { + return c.AllocColorPlanesReply(c.AllocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues)) +} + +// Write request to wire for AllocColorPlanes +func (c *Conn) AllocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) *Cookie { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 87 // request opcode + b += 1 + + if Contiguous { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], Colors) + b += 2 + + Put16(buf[b:], Reds) + b += 2 + + Put16(buf[b:], Greens) + b += 2 + + Put16(buf[b:], Blues) + b += 2 + + return c.sendRequest(true, buf) +} + +// Request reply for AllocColorPlanes +// size: (32 + pad((int(PixelsLen) * 4))) +type AllocColorPlanesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PixelsLen uint16 + // padding: 2 bytes + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + // padding: 8 bytes + Pixels []uint32 // size: pad((int(PixelsLen) * 4)) +} + +// Read reply AllocColorPlanes +func (c *Conn) AllocColorPlanesReply(cook *Cookie) (*AllocColorPlanesReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(AllocColorPlanesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PixelsLen = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.RedMask = Get32(buf[b:]) + b += 4 + + v.GreenMask = Get32(buf[b:]) + b += 4 + + v.BlueMask = Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.Pixels = make([]uint32, v.PixelsLen) + for i := 0; i < int(v.PixelsLen); i++ { + v.Pixels[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request FreeColors +// size: (12 + pad((len(Pixels) * 4))) +// Write request to wire for FreeColors +func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) { + size := (12 + pad((len(Pixels) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 88 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put32(buf[b:], PlaneMask) + b += 4 + + for i := 0; i < int(len(Pixels)); i++ { + Put32(buf[b:], Pixels[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request StoreColors +// size: (8 + pad((len(Items) * 12))) +// Write request to wire for StoreColors +func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) { + size := (8 + pad((len(Items) * 12))) + b := 0 + buf := make([]byte, size) + + buf[b] = 89 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + b += ColoritemListBytes(buf[b:], Items) + + c.sendRequest(false, buf) +} + +// Request StoreNamedColor +// size: (16 + pad((int(NameLen) * 1))) +// Write request to wire for StoreNamedColor +func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) { + size := (16 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 90 // request opcode + b += 1 + + buf[b] = Flags + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put32(buf[b:], Pixel) + b += 4 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + c.sendRequest(false, buf) +} + +// Request QueryColors +// size: (8 + pad((len(Pixels) * 4))) +func (c *Conn) QueryColors(Cmap Id, Pixels []uint32) (*QueryColorsReply, error) { + return c.QueryColorsReply(c.QueryColorsRequest(Cmap, Pixels)) +} + +// Write request to wire for QueryColors +func (c *Conn) QueryColorsRequest(Cmap Id, Pixels []uint32) *Cookie { + size := (8 + pad((len(Pixels) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 91 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + for i := 0; i < int(len(Pixels)); i++ { + Put32(buf[b:], Pixels[i]) + b += 4 + } + b = pad(b) + + return c.sendRequest(true, buf) +} + +// Request reply for QueryColors +// size: (32 + pad((int(ColorsLen) * 8))) +type QueryColorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ColorsLen uint16 + // padding: 22 bytes + Colors []Rgb // size: pad((int(ColorsLen) * 8)) +} + +// Read reply QueryColors +func (c *Conn) QueryColorsReply(cook *Cookie) (*QueryColorsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryColorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ColorsLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Colors = make([]Rgb, v.ColorsLen) + b += ReadRgbList(buf[b:], v.Colors) + + return v, nil +} + +// Request LookupColor +// size: (12 + pad((int(NameLen) * 1))) +func (c *Conn) LookupColor(Cmap Id, NameLen uint16, Name string) (*LookupColorReply, error) { + return c.LookupColorReply(c.LookupColorRequest(Cmap, NameLen, Name)) +} + +// Write request to wire for LookupColor +func (c *Conn) LookupColorRequest(Cmap Id, NameLen uint16, Name string) *Cookie { + size := (12 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 92 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for LookupColor +// size: 20 +type LookupColorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ExactRed uint16 + ExactGreen uint16 + ExactBlue uint16 + VisualRed uint16 + VisualGreen uint16 + VisualBlue uint16 +} + +// Read reply LookupColor +func (c *Conn) LookupColorReply(cook *Cookie) (*LookupColorReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(LookupColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ExactRed = Get16(buf[b:]) + b += 2 + + v.ExactGreen = Get16(buf[b:]) + b += 2 + + v.ExactBlue = Get16(buf[b:]) + b += 2 + + v.VisualRed = Get16(buf[b:]) + b += 2 + + v.VisualGreen = Get16(buf[b:]) + b += 2 + + v.VisualBlue = Get16(buf[b:]) + b += 2 + + return v, nil +} + +// Request CreateCursor +// size: 32 +// Write request to wire for CreateCursor +func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 93 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cid)) + b += 4 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put32(buf[b:], uint32(Mask)) + b += 4 + + Put16(buf[b:], ForeRed) + b += 2 + + Put16(buf[b:], ForeGreen) + b += 2 + + Put16(buf[b:], ForeBlue) + b += 2 + + Put16(buf[b:], BackRed) + b += 2 + + Put16(buf[b:], BackGreen) + b += 2 + + Put16(buf[b:], BackBlue) + b += 2 + + Put16(buf[b:], X) + b += 2 + + Put16(buf[b:], Y) + b += 2 + + c.sendRequest(false, buf) +} + +// Request CreateGlyphCursor +// size: 32 +// Write request to wire for CreateGlyphCursor +func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 94 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cid)) + b += 4 + + Put32(buf[b:], uint32(SourceFont)) + b += 4 + + Put32(buf[b:], uint32(MaskFont)) + b += 4 + + Put16(buf[b:], SourceChar) + b += 2 + + Put16(buf[b:], MaskChar) + b += 2 + + Put16(buf[b:], ForeRed) + b += 2 + + Put16(buf[b:], ForeGreen) + b += 2 + + Put16(buf[b:], ForeBlue) + b += 2 + + Put16(buf[b:], BackRed) + b += 2 + + Put16(buf[b:], BackGreen) + b += 2 + + Put16(buf[b:], BackBlue) + b += 2 + + c.sendRequest(false, buf) +} + +// Request FreeCursor +// size: 8 +// Write request to wire for FreeCursor +func (c *Conn) FreeCursor(Cursor Id) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 95 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + c.sendRequest(false, buf) +} + +// Request RecolorCursor +// size: 20 +// Write request to wire for RecolorCursor +func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = 96 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + Put16(buf[b:], ForeRed) + b += 2 + + Put16(buf[b:], ForeGreen) + b += 2 + + Put16(buf[b:], ForeBlue) + b += 2 + + Put16(buf[b:], BackRed) + b += 2 + + Put16(buf[b:], BackGreen) + b += 2 + + Put16(buf[b:], BackBlue) + b += 2 + + c.sendRequest(false, buf) +} + +// Request QueryBestSize +// size: 12 +func (c *Conn) QueryBestSize(Class byte, Drawable Id, Width uint16, Height uint16) (*QueryBestSizeReply, error) { + return c.QueryBestSizeReply(c.QueryBestSizeRequest(Class, Drawable, Width, Height)) +} + +// Write request to wire for QueryBestSize +func (c *Conn) QueryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) *Cookie { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 97 // request opcode + b += 1 + + buf[b] = Class + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + return c.sendRequest(true, buf) +} + +// Request reply for QueryBestSize +// size: 12 +type QueryBestSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint16 + Height uint16 +} + +// Read reply QueryBestSize +func (c *Conn) QueryBestSizeReply(cook *Cookie) (*QueryBestSizeReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryBestSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return v, nil +} + +// Request QueryExtension +// size: (8 + pad((int(NameLen) * 1))) +func (c *Conn) QueryExtension(NameLen uint16, Name string) (*QueryExtensionReply, error) { + return c.QueryExtensionReply(c.QueryExtensionRequest(NameLen, Name)) +} + +// Write request to wire for QueryExtension +func (c *Conn) QueryExtensionRequest(NameLen uint16, Name string) *Cookie { + size := (8 + pad((int(NameLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 98 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for QueryExtension +// size: 12 +type QueryExtensionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Present bool + MajorOpcode byte + FirstEvent byte + FirstError byte +} + +// Read reply QueryExtension +func (c *Conn) QueryExtensionReply(cook *Cookie) (*QueryExtensionReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(QueryExtensionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Present = true + } else { + v.Present = false + } + b += 1 + + v.MajorOpcode = buf[b] + b += 1 + + v.FirstEvent = buf[b] + b += 1 + + v.FirstError = buf[b] + b += 1 + + return v, nil +} + +// Request ListExtensions +// size: 3 +func (c *Conn) ListExtensions() (*ListExtensionsReply, error) { + return c.ListExtensionsReply(c.ListExtensionsRequest()) +} + +// Write request to wire for ListExtensions +func (c *Conn) ListExtensionsRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 99 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for ListExtensions +// size: (32 + StrListSize(Names)) +type ListExtensionsReply struct { + Sequence uint16 + Length uint32 + NamesLen byte + // padding: 24 bytes + Names []Str // size: StrListSize(Names) +} + +// Read reply ListExtensions +func (c *Conn) ListExtensionsReply(cook *Cookie) (*ListExtensionsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListExtensionsReply) + b := 1 // skip reply determinant + + v.NamesLen = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Names = make([]Str, v.NamesLen) + b += ReadStrList(buf[b:], v.Names) + + return v, nil +} + +// Request ChangeKeyboardMapping +// size: (8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4))) +// Write request to wire for ChangeKeyboardMapping +func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) { + size := (8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 100 // request opcode + b += 1 + + buf[b] = KeycodeCount + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = KeysymsPerKeycode + b += 1 + + b += 2 // padding + + for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { + Put32(buf[b:], uint32(Keysyms[i])) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request GetKeyboardMapping +// size: 6 +func (c *Conn) GetKeyboardMapping(FirstKeycode Keycode, Count byte) (*GetKeyboardMappingReply, error) { + return c.GetKeyboardMappingReply(c.GetKeyboardMappingRequest(FirstKeycode, Count)) +} + +// Write request to wire for GetKeyboardMapping +func (c *Conn) GetKeyboardMappingRequest(FirstKeycode Keycode, Count byte) *Cookie { + size := 6 + b := 0 + buf := make([]byte, size) + + buf[b] = 101 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetKeyboardMapping +// size: (32 + pad((int(Length) * 4))) +type GetKeyboardMappingReply struct { + Sequence uint16 + Length uint32 + KeysymsPerKeycode byte + // padding: 24 bytes + Keysyms []Keysym // size: pad((int(Length) * 4)) +} + +// Read reply GetKeyboardMapping +func (c *Conn) GetKeyboardMappingReply(cook *Cookie) (*GetKeyboardMappingReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetKeyboardMappingReply) + b := 1 // skip reply determinant + + v.KeysymsPerKeycode = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Keysyms = make([]Keysym, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Keysyms[i] = Keysym(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v, nil +} + +// Request ChangeKeyboardControl +// size: (4 + (4 + pad((4 * popCount(int(ValueMask)))))) +// Write request to wire for ChangeKeyboardControl +func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) { + size := (4 + (4 + pad((4 * popCount(int(ValueMask)))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 102 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request GetKeyboardControl +// size: 3 +func (c *Conn) GetKeyboardControl() (*GetKeyboardControlReply, error) { + return c.GetKeyboardControlReply(c.GetKeyboardControlRequest()) +} + +// Write request to wire for GetKeyboardControl +func (c *Conn) GetKeyboardControlRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 103 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetKeyboardControl +// size: (20 + pad(32)) +type GetKeyboardControlReply struct { + Sequence uint16 + Length uint32 + GlobalAutoRepeat byte + LedMask uint32 + KeyClickPercent byte + BellPercent byte + BellPitch uint16 + BellDuration uint16 + // padding: 2 bytes + AutoRepeats []byte // size: pad(32) +} + +// Read reply GetKeyboardControl +func (c *Conn) GetKeyboardControlReply(cook *Cookie) (*GetKeyboardControlReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetKeyboardControlReply) + b := 1 // skip reply determinant + + v.GlobalAutoRepeat = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.LedMask = Get32(buf[b:]) + b += 4 + + v.KeyClickPercent = buf[b] + b += 1 + + v.BellPercent = buf[b] + b += 1 + + v.BellPitch = Get16(buf[b:]) + b += 2 + + v.BellDuration = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.AutoRepeats = make([]byte, 32) + copy(v.AutoRepeats[:32], buf[b:]) + b += pad(int(32)) + + return v, nil +} + +// Request Bell +// size: 4 +// Write request to wire for Bell +func (c *Conn) Bell(Percent int8) { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 104 // request opcode + b += 1 + + buf[b] = byte(Percent) + b += 1 + + c.sendRequest(false, buf) +} + +// Request ChangePointerControl +// size: 12 +// Write request to wire for ChangePointerControl +func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 105 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], uint16(AccelerationNumerator)) + b += 2 + + Put16(buf[b:], uint16(AccelerationDenominator)) + b += 2 + + Put16(buf[b:], uint16(Threshold)) + b += 2 + + if DoAcceleration { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if DoThreshold { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + c.sendRequest(false, buf) +} + +// Request GetPointerControl +// size: 3 +func (c *Conn) GetPointerControl() (*GetPointerControlReply, error) { + return c.GetPointerControlReply(c.GetPointerControlRequest()) +} + +// Write request to wire for GetPointerControl +func (c *Conn) GetPointerControlRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 106 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetPointerControl +// size: 32 +type GetPointerControlReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + AccelerationNumerator uint16 + AccelerationDenominator uint16 + Threshold uint16 + // padding: 18 bytes +} + +// Read reply GetPointerControl +func (c *Conn) GetPointerControlReply(cook *Cookie) (*GetPointerControlReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetPointerControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.AccelerationNumerator = Get16(buf[b:]) + b += 2 + + v.AccelerationDenominator = Get16(buf[b:]) + b += 2 + + v.Threshold = Get16(buf[b:]) + b += 2 + + b += 18 // padding + + return v, nil +} + +// Request SetScreenSaver +// size: 10 +// Write request to wire for SetScreenSaver +func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) { + size := 10 + b := 0 + buf := make([]byte, size) + + buf[b] = 107 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], uint16(Timeout)) + b += 2 + + Put16(buf[b:], uint16(Interval)) + b += 2 + + buf[b] = PreferBlanking + b += 1 + + buf[b] = AllowExposures + b += 1 + + c.sendRequest(false, buf) +} + +// Request GetScreenSaver +// size: 3 +func (c *Conn) GetScreenSaver() (*GetScreenSaverReply, error) { + return c.GetScreenSaverReply(c.GetScreenSaverRequest()) +} + +// Write request to wire for GetScreenSaver +func (c *Conn) GetScreenSaverRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 108 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetScreenSaver +// size: 32 +type GetScreenSaverReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Timeout uint16 + Interval uint16 + PreferBlanking byte + AllowExposures byte + // padding: 18 bytes +} + +// Read reply GetScreenSaver +func (c *Conn) GetScreenSaverReply(cook *Cookie) (*GetScreenSaverReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetScreenSaverReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timeout = Get16(buf[b:]) + b += 2 + + v.Interval = Get16(buf[b:]) + b += 2 + + v.PreferBlanking = buf[b] + b += 1 + + v.AllowExposures = buf[b] + b += 1 + + b += 18 // padding + + return v, nil +} + +// Request ChangeHosts +// size: (8 + pad((int(AddressLen) * 1))) +// Write request to wire for ChangeHosts +func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address []byte) { + size := (8 + pad((int(AddressLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 109 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Family + b += 1 + + b += 1 // padding + + Put16(buf[b:], AddressLen) + b += 2 + + copy(buf[b:], Address[:AddressLen]) + b += pad(int(AddressLen)) + + c.sendRequest(false, buf) +} + +// Request ListHosts +// size: 3 +func (c *Conn) ListHosts() (*ListHostsReply, error) { + return c.ListHostsReply(c.ListHostsRequest()) +} + +// Write request to wire for ListHosts +func (c *Conn) ListHostsRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 110 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for ListHosts +// size: (32 + HostListSize(Hosts)) +type ListHostsReply struct { + Sequence uint16 + Length uint32 + Mode byte + HostsLen uint16 + // padding: 22 bytes + Hosts []Host // size: HostListSize(Hosts) +} + +// Read reply ListHosts +func (c *Conn) ListHostsReply(cook *Cookie) (*ListHostsReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(ListHostsReply) + b := 1 // skip reply determinant + + v.Mode = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.HostsLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Hosts = make([]Host, v.HostsLen) + b += ReadHostList(buf[b:], v.Hosts) + + return v, nil +} + +// Request SetAccessControl +// size: 4 +// Write request to wire for SetAccessControl +func (c *Conn) SetAccessControl(Mode byte) { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 111 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + c.sendRequest(false, buf) +} + +// Request SetCloseDownMode +// size: 4 +// Write request to wire for SetCloseDownMode +func (c *Conn) SetCloseDownMode(Mode byte) { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 112 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + c.sendRequest(false, buf) +} + +// Request KillClient +// size: 8 +// Write request to wire for KillClient +func (c *Conn) KillClient(Resource uint32) { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 113 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Resource) + b += 4 + + c.sendRequest(false, buf) +} + +// Request RotateProperties +// size: (12 + pad((int(AtomsLen) * 4))) +// Write request to wire for RotateProperties +func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) { + size := (12 + pad((int(AtomsLen) * 4))) + b := 0 + buf := make([]byte, size) + + buf[b] = 114 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], AtomsLen) + b += 2 + + Put16(buf[b:], uint16(Delta)) + b += 2 + + for i := 0; i < int(AtomsLen); i++ { + Put32(buf[b:], uint32(Atoms[i])) + b += 4 + } + b = pad(b) + + c.sendRequest(false, buf) +} + +// Request ForceScreenSaver +// size: 4 +// Write request to wire for ForceScreenSaver +func (c *Conn) ForceScreenSaver(Mode byte) { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 115 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + c.sendRequest(false, buf) +} + +// Request SetPointerMapping +// size: (4 + pad((int(MapLen) * 1))) +func (c *Conn) SetPointerMapping(MapLen byte, Map []byte) (*SetPointerMappingReply, error) { + return c.SetPointerMappingReply(c.SetPointerMappingRequest(MapLen, Map)) +} + +// Write request to wire for SetPointerMapping +func (c *Conn) SetPointerMappingRequest(MapLen byte, Map []byte) *Cookie { + size := (4 + pad((int(MapLen) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 116 // request opcode + b += 1 + + buf[b] = MapLen + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + copy(buf[b:], Map[:MapLen]) + b += pad(int(MapLen)) + + return c.sendRequest(true, buf) +} + +// Request reply for SetPointerMapping +// size: 8 +type SetPointerMappingReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Read reply SetPointerMapping +func (c *Conn) SetPointerMappingReply(cook *Cookie) (*SetPointerMappingReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(SetPointerMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v, nil +} + +// Request GetPointerMapping +// size: 3 +func (c *Conn) GetPointerMapping() (*GetPointerMappingReply, error) { + return c.GetPointerMappingReply(c.GetPointerMappingRequest()) +} + +// Write request to wire for GetPointerMapping +func (c *Conn) GetPointerMappingRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 117 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetPointerMapping +// size: (32 + pad((int(MapLen) * 1))) +type GetPointerMappingReply struct { + Sequence uint16 + Length uint32 + MapLen byte + // padding: 24 bytes + Map []byte // size: pad((int(MapLen) * 1)) +} + +// Read reply GetPointerMapping +func (c *Conn) GetPointerMappingReply(cook *Cookie) (*GetPointerMappingReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetPointerMappingReply) + b := 1 // skip reply determinant + + v.MapLen = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Map = make([]byte, v.MapLen) + copy(v.Map[:v.MapLen], buf[b:]) + b += pad(int(v.MapLen)) + + return v, nil +} + +// Request SetModifierMapping +// size: (4 + pad(((int(KeycodesPerModifier) * 8) * 1))) +func (c *Conn) SetModifierMapping(KeycodesPerModifier byte, Keycodes []Keycode) (*SetModifierMappingReply, error) { + return c.SetModifierMappingReply(c.SetModifierMappingRequest(KeycodesPerModifier, Keycodes)) +} + +// Write request to wire for SetModifierMapping +func (c *Conn) SetModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) *Cookie { + size := (4 + pad(((int(KeycodesPerModifier) * 8) * 1))) + b := 0 + buf := make([]byte, size) + + buf[b] = 118 // request opcode + b += 1 + + buf[b] = KeycodesPerModifier + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + for i := 0; i < int((int(KeycodesPerModifier) * 8)); i++ { + buf[b] = byte(Keycodes[i]) + b += 1 + } + b = pad(b) + + return c.sendRequest(true, buf) +} + +// Request reply for SetModifierMapping +// size: 8 +type SetModifierMappingReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Read reply SetModifierMapping +func (c *Conn) SetModifierMappingReply(cook *Cookie) (*SetModifierMappingReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(SetModifierMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v, nil +} + +// Request GetModifierMapping +// size: 3 +func (c *Conn) GetModifierMapping() (*GetModifierMappingReply, error) { + return c.GetModifierMappingReply(c.GetModifierMappingRequest()) +} + +// Write request to wire for GetModifierMapping +func (c *Conn) GetModifierMappingRequest() *Cookie { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 119 // request opcode + b += 1 + + return c.sendRequest(true, buf) +} + +// Request reply for GetModifierMapping +// size: (32 + pad(((int(KeycodesPerModifier) * 8) * 1))) +type GetModifierMappingReply struct { + Sequence uint16 + Length uint32 + KeycodesPerModifier byte + // padding: 24 bytes + Keycodes []Keycode // size: pad(((int(KeycodesPerModifier) * 8) * 1)) +} + +// Read reply GetModifierMapping +func (c *Conn) GetModifierMappingReply(cook *Cookie) (*GetModifierMappingReply, error) { + buf, err := c.waitForReply(cook) + if err != nil { + return nil, err + } + + v := new(GetModifierMappingReply) + b := 1 // skip reply determinant + + v.KeycodesPerModifier = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Keycodes = make([]Keycode, (int(v.KeycodesPerModifier) * 8)) + for i := 0; i < int((int(v.KeycodesPerModifier) * 8)); i++ { + v.Keycodes[i] = Keycode(buf[b]) + b += 1 + } + b = pad(b) + + return v, nil +} + +// Request NoOperation +// size: 3 +// Write request to wire for NoOperation +func (c *Conn) NoOperation() { + size := 3 + b := 0 + buf := make([]byte, size) + + buf[b] = 127 // request opcode + b += 1 + + c.sendRequest(false, buf) +} From a5d4ad6c9d763b3d3f797075038023756c38bb28 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 3 May 2012 22:47:50 -0400 Subject: [PATCH 11/90] reworking xgb. cleaned up connection stuff a little. making new xid generation cleaner and use goroutines for it. --- nexgb/auth.go | 6 +- nexgb/conn.go | 161 +++++++++++++++++++++++ nexgb/examples/atom.go | 27 ++++ nexgb/examples/property.go | 39 ++++++ nexgb/xgb.go | 257 ++++++++++++------------------------- 5 files changed, 316 insertions(+), 174 deletions(-) create mode 100644 nexgb/conn.go create mode 100644 nexgb/examples/atom.go create mode 100644 nexgb/examples/property.go diff --git a/nexgb/auth.go b/nexgb/auth.go index 355afeb..ac43e07 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -44,8 +44,10 @@ func getString(r io.Reader, b []byte) (string, error) { // readAuthority reads the X authority file for the DISPLAY. // If hostname == "" or hostname == "localhost", -// readAuthority uses the system's hostname (as returned by os.Hostname) instead. -func readAuthority(hostname, display string) (name string, data []byte, err error) { +// then use the system's hostname (as returned by os.Hostname) instead. +func readAuthority(hostname, display string) ( + name string, data []byte, err error) { + // b is a scratch buffer to use and should be at least 256 bytes long // (i.e. it should be able to hold a hostname). var b [256]byte diff --git a/nexgb/conn.go b/nexgb/conn.go new file mode 100644 index 0000000..235402d --- /dev/null +++ b/nexgb/conn.go @@ -0,0 +1,161 @@ +package xgb + +import ( + "errors" + "fmt" + "io" + "net" + "os" + "strconv" + "strings" +) + +// connect connects to the X server given in the 'display' string. +// If 'display' is empty it will be taken from os.Getenv("DISPLAY"). +// Note that you should read and understand the "Connection Setup" of the +// X Protocol Reference Manual before changing this function: +// http://goo.gl/4zGQg +func (c *Conn) connect(display string) error { + err := c.dial(display) + if err != nil { + return err + } + + // Get authentication data + authName, authData, err := readAuthority(c.host, c.display) + noauth := false + if err != nil { + fmt.Fprintf(os.Stderr, "Could not get authority info: %v\n", err) + fmt.Fprintf(os.Stderr, "Trying connection without authority info...\n") + authName = "" + authData = []byte{} + noauth = true + } + + // Assume that the authentication protocol is "MIT-MAGIC-COOKIE-1". + if !noauth && (authName != "MIT-MAGIC-COOKIE-1" || len(authData) != 16) { + return errors.New("unsupported auth protocol " + authName) + } + + buf := make([]byte, 12+pad(len(authName))+pad(len(authData))) + buf[0] = 0x6c + buf[1] = 0 + Put16(buf[2:], 11) + Put16(buf[4:], 0) + Put16(buf[6:], uint16(len(authName))) + Put16(buf[8:], uint16(len(authData))) + Put16(buf[10:], 0) + copy(buf[12:], []byte(authName)) + copy(buf[12+pad(len(authName)):], authData) + if _, err = c.conn.Write(buf); err != nil { + return err + } + + head := make([]byte, 8) + if _, err = io.ReadFull(c.conn, head[0:8]); err != nil { + return err + } + code := head[0] + reasonLen := head[1] + major := Get16(head[2:]) + minor := Get16(head[4:]) + dataLen := Get16(head[6:]) + + if major != 11 || minor != 0 { + return errors.New(fmt.Sprintf("x protocol version mismatch: %d.%d", + major, minor)) + } + + buf = make([]byte, int(dataLen)*4+8, int(dataLen)*4+8) + copy(buf, head) + if _, err = io.ReadFull(c.conn, buf[8:]); err != nil { + return err + } + + if code == 0 { + reason := buf[8 : 8+reasonLen] + return errors.New(fmt.Sprintf("x protocol authentication refused: %s", + string(reason))) + } + + ReadSetupInfo(buf, &c.Setup) + + if c.defaultScreen >= len(c.Setup.Roots) { + c.defaultScreen = 0 + } + + return nil +} + +func (c *Conn) dial(display string) error { + if len(display) == 0 { + display = os.Getenv("DISPLAY") + } + + display0 := display + if len(display) == 0 { + return errors.New("empty display string") + } + + colonIdx := strings.LastIndex(display, ":") + if colonIdx < 0 { + return errors.New("bad display string: " + display0) + } + + var protocol, socket string + + if display[0] == '/' { + socket = display[0:colonIdx] + } else { + slashIdx := strings.LastIndex(display, "/") + if slashIdx >= 0 { + protocol = display[0:slashIdx] + c.host = display[slashIdx+1 : colonIdx] + } else { + c.host = display[0:colonIdx] + } + } + + display = display[colonIdx+1 : len(display)] + if len(display) == 0 { + return errors.New("bad display string: " + display0) + } + + var scr string + dotIdx := strings.LastIndex(display, ".") + if dotIdx < 0 { + c.display = display[0:] + } else { + c.display = display[0:dotIdx] + scr = display[dotIdx+1:] + } + + dispnum, err := strconv.Atoi(c.display) + if err != nil || dispnum < 0 { + return errors.New("bad display string: " + display0) + } + + if len(scr) != 0 { + c.defaultScreen, err = strconv.Atoi(scr) + if err != nil { + return errors.New("bad display string: " + display0) + } + } + + // Connect to server + if len(socket) != 0 { + c.conn, err = net.Dial("unix", socket+":"+c.display) + } else if len(c.host) != 0 { + if protocol == "" { + protocol = "tcp" + } + c.conn, err = net.Dial(protocol, c.host+":"+strconv.Itoa(6000+dispnum)) + } else { + c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) + } + + if err != nil { + return errors.New("cannot connect to " + display0 + ": " + err.Error()) + } + return nil +} diff --git a/nexgb/examples/atom.go b/nexgb/examples/atom.go new file mode 100644 index 0000000..c64acee --- /dev/null +++ b/nexgb/examples/atom.go @@ -0,0 +1,27 @@ +package main + +import ( + // "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func init() { + log.SetFlags(0) +} + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + aname := "_NET_ACTIVE_WINDOW" + atom, err := X.InternAtom(true, uint16(len(aname)), aname) + if err != nil { + log.Fatal(err) + } + log.Printf("%d", atom.Atom) +} + diff --git a/nexgb/examples/property.go b/nexgb/examples/property.go new file mode 100644 index 0000000..2477df4 --- /dev/null +++ b/nexgb/examples/property.go @@ -0,0 +1,39 @@ +package main + +import ( + "log" + + "github.com/BurntSushi/xgb" +) + +func init() { + log.SetFlags(0) +} + +func get32(buf []byte) uint32 { + v := uint32(buf[0]) + v |= uint32(buf[1]) << 8 + v |= uint32(buf[2]) << 16 + v |= uint32(buf[3]) << 24 + return v +} + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + root := X.DefaultScreen().Root + + aname := "_NET_ACTIVE_WINDOW" + atom, err := X.InternAtom(true, uint16(len(aname)), aname) + if err != nil { + log.Fatal(err) + } + + reply, err := X.GetProperty(false, root, atom.Atom, xgb.GetPropertyTypeAny, + 0, (1<<32)-1) + log.Printf("%X", get32(reply.Value)) +} + diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 0dd8163..1a4ada1 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -12,7 +12,6 @@ import ( "io" "net" "os" - "strconv" "strings" "sync" ) @@ -23,11 +22,9 @@ const ( ) // A Conn represents a connection to an X server. -// Only one goroutine should use a Conn's methods at a time. type Conn struct { host string conn net.Conn - nextId Id nextCookie uint16 cookies map[uint16]*Cookie events queue @@ -44,6 +41,7 @@ type Conn struct { eventChan chan bool errorChan chan bool + xidChan chan xid newIdLock sync.Mutex writeLock sync.Mutex dequeueLock sync.Mutex @@ -51,6 +49,51 @@ type Conn struct { extLock sync.Mutex } +// NewConn creates a new connection instance. It initializes locks, data +// structures, and performs the initial handshake. (The code for the handshake +// has been relegated to conn.go.) +func NewConn() (*Conn, error) { + return NewConnDisplay("") +} + +// NewConnDisplay is just like NewConn, but allows a specific DISPLAY +// string to be used. +// If 'display' is empty it will be taken from os.Getenv("DISPLAY"). +// +// Examples: +// NewConn(":1") -> net.Dial("unix", "", "/tmp/.X11-unix/X1") +// NewConn("/tmp/launch-123/:0") -> net.Dial("unix", "", "/tmp/launch-123/:0") +// NewConn("hostname:2.1") -> net.Dial("tcp", "", "hostname:6002") +// NewConn("tcp/hostname:1.0") -> net.Dial("tcp", "", "hostname:6001") +func NewConnDisplay(display string) (*Conn, error) { + conn := &Conn{} + + // First connect. This reads authority, checks DISPLAY environment + // variable, and loads the initial Setup info. + err := conn.connect(display) + if err != nil { + return nil, err + } + + conn.xidChan = make(chan xid, 5) + go conn.generateXids() + + conn.nextCookie = 1 + conn.cookies = make(map[uint16]*Cookie) + conn.events = queue{make([][]byte, 100), 0, 0} + conn.extensions = make(map[string]byte) + + conn.newReadChannels() + conn.newRequestChannels() + + return conn, nil +} + +// Close closes the connection to the X server. +func (c *Conn) Close() { + c.conn.Close() +} + // Id is used for all X identifiers, such as windows, pixmaps, and GCs. type Id uint32 @@ -111,14 +154,46 @@ type Error interface { var newErrorFuncs = map[int]func(buf []byte) Error{} // NewID generates a new unused ID for use with requests like CreateWindow. -func (c *Conn) NewId() Id { - c.newIdLock.Lock() - defer c.newIdLock.Unlock() +// If no new ids can be generated, the id returned is 0 and error is non-nil. +func (c *Conn) NewId() (Id, error) { + xid := <-c.xidChan + if xid.err != nil { + return 0, xid.err + } + return xid.id, nil +} - id := c.nextId - // TODO: handle ID overflow - c.nextId++ - return id +// xid encapsulates a resource identifier being sent over the Conn.xidChan +// channel. If no new resource id can be generated, id is set to -1 and a +// non-nil error is set in xid.err. +type xid struct { + id Id + err error +} + +// generateXids sends new Ids down the channel for NewId to use. +// This needs to be updated to use the XC Misc extension once we run out of +// new ids. +func (conn *Conn) generateXids() { + inc := conn.Setup.ResourceIdMask & -conn.Setup.ResourceIdMask + max := conn.Setup.ResourceIdMask + last := uint32(0) + for { + // TODO: Use the XC Misc extension to look for released ids. + if last > 0 && last >= max - inc + 1 { + conn.xidChan <- xid{ + id: Id(0), + err: errors.New("There are no more available resource" + + "identifiers."), + } + } + + last += inc + conn.xidChan <- xid{ + id: Id(last | conn.Setup.ResourceIdBase), + err: nil, + } + } } // RegisterExtension adds the respective extension's major op code to @@ -328,165 +403,3 @@ func (c *Conn) PollForEvent() (Event, error) { return nil, nil } -// Dial connects to the X server given in the 'display' string. -// If 'display' is empty it will be taken from os.Getenv("DISPLAY"). -// -// Examples: -// Dial(":1") // connect to net.Dial("unix", "", "/tmp/.X11-unix/X1") -// Dial("/tmp/launch-123/:0") // connect to net.Dial("unix", "", "/tmp/launch-123/:0") -// Dial("hostname:2.1") // connect to net.Dial("tcp", "", "hostname:6002") -// Dial("tcp/hostname:1.0") // connect to net.Dial("tcp", "", "hostname:6001") -func Dial(display string) (*Conn, error) { - c, err := connect(display) - if err != nil { - return nil, err - } - - // Get authentication data - authName, authData, err := readAuthority(c.host, c.display) - noauth := false - if err != nil { - fmt.Fprintf(os.Stderr, "Could not get authority info: %v\n", err) - fmt.Fprintf(os.Stderr, "Trying connection without authority info...\n") - authName = "" - authData = []byte{} - noauth = true - } - - // Assume that the authentication protocol is "MIT-MAGIC-COOKIE-1". - if !noauth && (authName != "MIT-MAGIC-COOKIE-1" || len(authData) != 16) { - return nil, errors.New("unsupported auth protocol " + authName) - } - - buf := make([]byte, 12+pad(len(authName))+pad(len(authData))) - buf[0] = 0x6c - buf[1] = 0 - Put16(buf[2:], 11) - Put16(buf[4:], 0) - Put16(buf[6:], uint16(len(authName))) - Put16(buf[8:], uint16(len(authData))) - Put16(buf[10:], 0) - copy(buf[12:], []byte(authName)) - copy(buf[12+pad(len(authName)):], authData) - if _, err = c.conn.Write(buf); err != nil { - return nil, err - } - - head := make([]byte, 8) - if _, err = io.ReadFull(c.conn, head[0:8]); err != nil { - return nil, err - } - code := head[0] - reasonLen := head[1] - major := Get16(head[2:]) - minor := Get16(head[4:]) - dataLen := Get16(head[6:]) - - if major != 11 || minor != 0 { - return nil, errors.New(fmt.Sprintf("x protocol version mismatch: %d.%d", major, minor)) - } - - buf = make([]byte, int(dataLen)*4+8, int(dataLen)*4+8) - copy(buf, head) - if _, err = io.ReadFull(c.conn, buf[8:]); err != nil { - return nil, err - } - - if code == 0 { - reason := buf[8 : 8+reasonLen] - return nil, errors.New(fmt.Sprintf("x protocol authentication refused: %s", string(reason))) - } - - ReadSetupInfo(buf, &c.Setup) - - if c.defaultScreen >= len(c.Setup.Roots) { - c.defaultScreen = 0 - } - - c.nextId = Id(c.Setup.ResourceIdBase) - c.nextCookie = 1 - c.cookies = make(map[uint16]*Cookie) - c.events = queue{make([][]byte, 100), 0, 0} - c.extensions = make(map[string]byte) - - c.newReadChannels() - c.newRequestChannels() - return c, nil -} - -// Close closes the connection to the X server. -func (c *Conn) Close() { c.conn.Close() } - -func connect(display string) (*Conn, error) { - if len(display) == 0 { - display = os.Getenv("DISPLAY") - } - - display0 := display - if len(display) == 0 { - return nil, errors.New("empty display string") - } - - colonIdx := strings.LastIndex(display, ":") - if colonIdx < 0 { - return nil, errors.New("bad display string: " + display0) - } - - var protocol, socket string - c := new(Conn) - - if display[0] == '/' { - socket = display[0:colonIdx] - } else { - slashIdx := strings.LastIndex(display, "/") - if slashIdx >= 0 { - protocol = display[0:slashIdx] - c.host = display[slashIdx+1 : colonIdx] - } else { - c.host = display[0:colonIdx] - } - } - - display = display[colonIdx+1 : len(display)] - if len(display) == 0 { - return nil, errors.New("bad display string: " + display0) - } - - var scr string - dotIdx := strings.LastIndex(display, ".") - if dotIdx < 0 { - c.display = display[0:] - } else { - c.display = display[0:dotIdx] - scr = display[dotIdx+1:] - } - - dispnum, err := strconv.Atoi(c.display) - if err != nil || dispnum < 0 { - return nil, errors.New("bad display string: " + display0) - } - - if len(scr) != 0 { - c.defaultScreen, err = strconv.Atoi(scr) - if err != nil { - return nil, errors.New("bad display string: " + display0) - } - } - - // Connect to server - if len(socket) != 0 { - c.conn, err = net.Dial("unix", socket+":"+c.display) - } else if len(c.host) != 0 { - if protocol == "" { - protocol = "tcp" - } - c.conn, err = net.Dial(protocol, c.host+":"+strconv.Itoa(6000+dispnum)) - } else { - c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) - } - - if err != nil { - return nil, errors.New("cannot connect to " + display0 + ": " + err.Error()) - } - return c, nil -} From c222d406b09de529388fcd248476e9ae258895b8 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 02:55:38 -0400 Subject: [PATCH 12/90] converting to new reply/cookie scheme --- nexgb/xgbgen/expression.go | 27 ++++++++++ nexgb/xgbgen/go_event.go | 16 ++++++ nexgb/xgbgen/go_request_reply.go | 84 ++++++++++++++++++++++---------- nexgb/xgbgen/representation.go | 23 ++++++++- 4 files changed, 122 insertions(+), 28 deletions(-) diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 12bcb19..6a8aa52 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -158,6 +158,33 @@ func (e *UnaryOp) Initialize(p *Protocol) { e.Expr.Initialize(p) } +type Padding struct { + Expr Expression +} + +func (e *Padding) Concrete() bool { + return e.Expr.Concrete() +} + +func (e *Padding) Eval() uint { + return uint(pad(int(e.Expr.Eval()))) +} + +func (e *Padding) Reduce(prefix string) string { + if e.Concrete() { + return fmt.Sprintf("%d", e.Eval()) + } + return fmt.Sprintf("pad(%s)", e.Expr.Reduce(prefix)) +} + +func (e *Padding) String() string { + return e.Reduce("") +} + +func (e *Padding) Initialize(p *Protocol) { + e.Expr.Initialize(p) +} + type PopCount struct { Expr Expression } diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index 71252a7..41f9320 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -28,6 +28,14 @@ func (e *Event) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") @@ -99,6 +107,14 @@ func (e *EventCopy) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.Old.(*Event).NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index e6180a1..00c48f9 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -8,30 +8,51 @@ import ( func (r *Request) Define(c *Context) { c.Putln("// Request %s", r.SrcName()) c.Putln("// size: %s", r.Size(c)) + c.Putln("type %s cookie", r.CookieName()) if r.Reply != nil { - c.Putln("func (c *Conn) %s(%s) (*%s, error) {", - r.SrcName(), r.ParamNameTypes(), r.ReplyName()) - c.Putln("return c.%s(c.%s(%s))", - r.ReplyName(), r.ReqName(), r.ParamNames()) + c.Putln("func (c *Conn) %s(%s) %s {", + r.SrcName(), r.ParamNameTypes(), r.CookieName()) + c.Putln("cookie := c.newCookie(true, true)") + c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("}") + c.Putln("") + + c.Putln("func (c *Conn) %sUnchecked(%s) %s {", + r.SrcName(), r.ParamNameTypes(), r.CookieName()) + c.Putln("cookie := c.newCookie(false, true)") + c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s(cookie)", r.CookieName()) c.Putln("}") c.Putln("") - r.WriteRequest(c) r.ReadReply(c) } else { c.Putln("// Write request to wire for %s", r.SrcName()) - c.Putln("func (c *Conn) %s(%s) {", r.SrcName(), r.ParamNameTypes()) - r.WriteRequestFields(c) - c.Putln("c.sendRequest(false, buf)") + c.Putln("func (c *Conn) %s(%s) %s {", + r.SrcName(), r.ParamNameTypes(), r.CookieName()) + c.Putln("cookie := c.newCookie(false, false)") + c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("}") + c.Putln("") + + c.Putln("func (c *Conn) %sChecked(%s) %s {", + r.SrcName(), r.ParamNameTypes(), r.CookieName()) + c.Putln("cookie := c.newCookie(true, false)") + c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s(cookie)", r.CookieName()) c.Putln("}") c.Putln("") } + + r.WriteRequest(c) } func (r *Request) ReadReply(c *Context) { c.Putln("// Request reply for %s", r.SrcName()) c.Putln("// size: %s", r.Reply.Size()) - c.Putln("type %s struct {", r.ReplyName()) + c.Putln("type %s struct {", r.ReplyTypeName()) c.Putln("Sequence uint16") c.Putln("Length uint32") for _, field := range r.Reply.Fields { @@ -40,15 +61,21 @@ func (r *Request) ReadReply(c *Context) { c.Putln("}") c.Putln("") - c.Putln("// Read reply %s", r.SrcName()) - c.Putln("func (c *Conn) %s(cook *Cookie) (*%s, error) {", - r.ReplyName(), r.ReplyName()) - c.Putln("buf, err := c.waitForReply(cook)") - c.Putln("if err != nil {") - c.Putln("return nil, err") + c.Putln("// Waits and reads reply data from request %s", r.SrcName()) + c.Putln("func (cook %s) Reply() (*%s, error) {", + r.CookieName(), r.ReplyTypeName()) + c.Putln("buf, err := cookie(cook).reply()") + c.Putln("if err != nil {") + c.Putln("return nil, err") + c.Putln("}") + c.Putln("return %s(buf), nil", r.ReplyName()) c.Putln("}") c.Putln("") - c.Putln("v := new(%s)", r.ReplyName()) + + c.Putln("// Read reply into structure from buffer for %s", r.SrcName()) + c.Putln("func %s(buf []byte) *%s {", + r.ReplyName(), r.ReplyTypeName()) + c.Putln("v := new(%s)", r.ReplyTypeName()) c.Putln("b := 1 // skip reply determinant") c.Putln("") for i, field := range r.Reply.Fields { @@ -63,21 +90,14 @@ func (r *Request) ReadReply(c *Context) { field.Read(c, "v.") c.Putln("") } - c.Putln("return v, nil") + c.Putln("return v") c.Putln("}") c.Putln("") } func (r *Request) WriteRequest(c *Context) { c.Putln("// Write request to wire for %s", r.SrcName()) - c.Putln("func (c *Conn) %s(%s) *Cookie {", r.ReqName(), r.ParamNameTypes()) - r.WriteRequestFields(c) - c.Putln("return c.sendRequest(true, buf)") - c.Putln("}") - c.Putln("") -} - -func (r *Request) WriteRequestFields(c *Context) { + c.Putln("func %s(%s) []byte {", r.ReqName(), r.ParamNameTypes()) c.Putln("size := %s", r.Size(c)) c.Putln("b := 0") c.Putln("buf := make([]byte, size)") @@ -85,6 +105,12 @@ func (r *Request) WriteRequestFields(c *Context) { c.Putln("buf[b] = %d // request opcode", r.Opcode) c.Putln("b += 1") c.Putln("") + if strings.ToLower(c.protocol.Name) != "xproto" { + c.Putln("buf[b] = c.extensions[\"%s\"]", + strings.ToUpper(c.protocol.ExtXName)) + c.Putln("b += 1") + c.Putln("") + } for i, field := range r.Fields { if i == 1 { c.Putln("Put16(buf[b:], uint16(size / 4)) "+ @@ -95,6 +121,9 @@ func (r *Request) WriteRequestFields(c *Context) { field.Write(c, "") c.Putln("") } + c.Putln("return buf") + c.Putln("}") + c.Putln("") } func (r *Request) ParamNames() string { @@ -102,7 +131,10 @@ func (r *Request) ParamNames() string { for _, field := range r.Fields { switch f := field.(type) { case *ValueField: - names = append(names, f.MaskName) + // mofos... + if r.SrcName() != "ConfigureWindow" { + names = append(names, f.MaskName) + } names = append(names, f.ListName) case *PadField: continue diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go index ef62157..be7accd 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/representation.go @@ -3,6 +3,7 @@ package main import ( "fmt" "log" + "unicode" ) type Protocol struct { @@ -58,6 +59,16 @@ func (r *Request) XmlName() string { } func (r *Request) ReplyName() string { + if r.Reply == nil { + log.Panicf("Cannot call 'ReplyName' on request %s, which has no reply.", + r.SrcName()) + } + name := r.SrcName() + lower := string(unicode.ToLower(rune(name[0]))) + name[1:] + return fmt.Sprintf("%sReply", lower) +} + +func (r *Request) ReplyTypeName() string { if r.Reply == nil { log.Panicf("Cannot call 'ReplyName' on request %s, which has no reply.", r.SrcName()) @@ -66,7 +77,13 @@ func (r *Request) ReplyName() string { } func (r *Request) ReqName() string { - return fmt.Sprintf("%sRequest", r.SrcName()) + name := r.SrcName() + lower := string(unicode.ToLower(rune(name[0]))) + name[1:] + return fmt.Sprintf("%sRequest", lower) +} + +func (r *Request) CookieName() string { + return fmt.Sprintf("%sCookie", r.SrcName()) } // Size for Request needs a context. @@ -99,7 +116,9 @@ func (r *Request) Size(c *Context) Size { size = size.Add(field.Size()) } } - return size + return newExpressionSize(&Padding{ + Expr: size.Expression, + }) } type Reply struct { From 4a7b05be36b96134b4dae3ca385e9bfbb797d531 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 02:56:15 -0400 Subject: [PATCH 13/90] oh momma. a lot of modifications and it appears to be working. w00t. --- nexgb/cookie.go | 111 ++ nexgb/xgb.go | 498 ++--- nexgb/xproto.go | 4620 +++++++++++++++++++++++++++++++++-------------- 3 files changed, 3620 insertions(+), 1609 deletions(-) create mode 100644 nexgb/cookie.go diff --git a/nexgb/cookie.go b/nexgb/cookie.go new file mode 100644 index 0000000..502ccbf --- /dev/null +++ b/nexgb/cookie.go @@ -0,0 +1,111 @@ +package xgb + +import ( + "errors" +) + +type cookie struct { + Sequence uint16 + replyChan chan []byte + errorChan chan error + pingChan chan bool +} + +func (c *Conn) newCookie(checked, reply bool) cookie { + cookie := cookie{ + Sequence: c.newSequenceId(), + replyChan: nil, + errorChan: nil, + pingChan: nil, + } + + // There are four different kinds of cookies: + // Checked requests with replies get a reply channel and an error channel. + // Unchecked requests with replies get a reply channel and a ping channel. + // Checked requests w/o replies get a ping channel and an error channel. + // Unchecked requests w/o replies get no channels. + // The reply channel is used to send reply data. + // The error channel is used to send error data. + // The ping channel is used when one of the 'reply' or 'error' channels + // is missing but the other is present. The ping channel is way to force + // the blocking to stop and basically say "the error has been received + // in the main event loop" (when the ping channel is coupled with a reply + // channel) or "the request you made that has no reply was successful" + // (when the ping channel is coupled with an error channel). + if checked { + cookie.errorChan = make(chan error, 1) + if !reply { + cookie.pingChan = make(chan bool, 1) + } + } + if reply { + cookie.replyChan = make(chan []byte, 1) + if !checked { + cookie.pingChan = make(chan bool, 1) + } + } + + return cookie +} + +func (c cookie) reply() ([]byte, error) { + // checked + if c.errorChan != nil { + return c.replyChecked() + } + return c.replyUnchecked() +} + +func (c cookie) replyChecked() ([]byte, error) { + if c.replyChan == nil { + return nil, errors.New("Cannot call 'replyChecked' on a cookie that " + + "is not expecting a *reply* or an error.") + } + if c.errorChan == nil { + return nil, errors.New("Cannot call 'replyChecked' on a cookie that " + + "is not expecting a reply or an *error*.") + } + + select { + case reply := <-c.replyChan: + return reply, nil + case err := <-c.errorChan: + return nil, err + } + panic("unreachable") +} + +func (c cookie) replyUnchecked() ([]byte, error) { + if c.replyChan == nil { + return nil, errors.New("Cannot call 'replyUnchecked' on a cookie " + + "that is not expecting a *reply*.") + } + + select { + case reply := <-c.replyChan: + return reply, nil + case <-c.pingChan: + return nil, nil + } + panic("unreachable") +} + +func (c cookie) Check() error { + if c.replyChan != nil { + return errors.New("Cannot call 'Check' on a cookie that is " + + "expecting a *reply*. Use 'Reply' instead.") + } + if c.errorChan == nil { + return errors.New("Cannot call 'Check' on a cookie that is " + + "not expecting a possible *error*.") + } + + select { + case err := <-c.errorChan: + return err + case <-c.pingChan: + return nil + } + panic("unreachable") +} + diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 1a4ada1..b453427 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -25,27 +25,18 @@ const ( type Conn struct { host string conn net.Conn - nextCookie uint16 - cookies map[uint16]*Cookie - events queue err error display string defaultScreen int - scratch [32]byte Setup SetupInfo extensions map[string]byte - requestChan chan *Request - requestCookieChan chan *Cookie - replyChan chan bool - eventChan chan bool - errorChan chan bool - + eventChan chan eventOrError + cookieChan chan cookie xidChan chan xid - newIdLock sync.Mutex - writeLock sync.Mutex - dequeueLock sync.Mutex - cookieLock sync.Mutex + seqChan chan uint16 + reqChan chan *request + extLock sync.Mutex } @@ -75,16 +66,18 @@ func NewConnDisplay(display string) (*Conn, error) { return nil, err } - conn.xidChan = make(chan xid, 5) - go conn.generateXids() - - conn.nextCookie = 1 - conn.cookies = make(map[uint16]*Cookie) - conn.events = queue{make([][]byte, 100), 0, 0} conn.extensions = make(map[string]byte) - conn.newReadChannels() - conn.newRequestChannels() + conn.cookieChan = make(chan cookie, 100) + conn.xidChan = make(chan xid, 5) + conn.seqChan = make(chan uint16, 20) + conn.reqChan = make(chan *request, 100) + conn.eventChan = make(chan eventOrError, 100) + + go conn.generateXIds() + go conn.generateSeqIds() + go conn.sendRequests() + go conn.readResponses() return conn, nil } @@ -97,43 +90,11 @@ func (c *Conn) Close() { // Id is used for all X identifiers, such as windows, pixmaps, and GCs. type Id uint32 -// Request is used to abstract the difference between a request -// that expects a reply and a request that doesn't expect a reply. -type Request struct { - buf []byte - cookieChan chan *Cookie -} - -func newRequest(buf []byte, needsReply bool) *Request { - req := &Request{ - buf: buf, - cookieChan: nil, - } - if needsReply { - req.cookieChan = make(chan *Cookie) - } - return req -} - -// Cookies are the sequence numbers used to pair replies up with their requests -type Cookie struct { - id uint16 - replyChan chan []byte - errorChan chan error -} - -func newCookie(id uint16) *Cookie { - return &Cookie{ - id: id, - replyChan: make(chan []byte, 1), - errorChan: make(chan error, 1), - } -} - // Event is an interface that can contain any of the events returned by the // server. Use a type assertion switch to extract the Event structs. type Event interface { ImplementsEvent() + Bytes() []byte } // newEventFuncs is a map from event numbers to functions that create @@ -153,6 +114,10 @@ type Error interface { // the corresponding error. var newErrorFuncs = map[int]func(buf []byte) Error{} +// eventOrError corresponds to values that can be either an event or an +// error. +type eventOrError interface{} + // NewID generates a new unused ID for use with requests like CreateWindow. // If no new ids can be generated, the id returned is 0 and error is non-nil. func (c *Conn) NewId() (Id, error) { @@ -164,7 +129,7 @@ func (c *Conn) NewId() (Id, error) { } // xid encapsulates a resource identifier being sent over the Conn.xidChan -// channel. If no new resource id can be generated, id is set to -1 and a +// channel. If no new resource id can be generated, id is set to 0 and a // non-nil error is set in xid.err. type xid struct { id Id @@ -174,7 +139,24 @@ type xid struct { // generateXids sends new Ids down the channel for NewId to use. // This needs to be updated to use the XC Misc extension once we run out of // new ids. -func (conn *Conn) generateXids() { +// Thanks to libxcb/src/xcb_xid.c. This code is greatly inspired by it. +func (conn *Conn) generateXIds() { + // This requires some explanation. From the horse's mouth: + // "The resource-id-mask contains a single contiguous set of bits (at least + // 18). The client allocates resource IDs for types WINDOW, PIXMAP, + // CURSOR, FONT, GCONTEXT, and COLORMAP by choosing a value with only some + // subset of these bits set and ORing it with resource-id-base. Only values + // constructed in this way can be used to name newly created resources over + // this connection." + // So for example (using 8 bit integers), the mask might look like: + // 00111000 + // So that valid values would be 00101000, 00110000, 00001000, and so on. + // Thus, the idea is to increment it by the place of the last least + // significant '1'. In this case, that value would be 00001000. To get + // that value, we can AND the original mask with its two's complement: + // 00111000 & 11001000 = 00001000. + // And we use that value to increment the last resource id to get a new one. + // (And then, of course, we OR it with resource-id-base.) inc := conn.Setup.ResourceIdMask & -conn.Setup.ResourceIdMask max := conn.Setup.ResourceIdMask last := uint32(0) @@ -196,11 +178,224 @@ func (conn *Conn) generateXids() { } } +// newSeqId fetches the next sequence id from the Conn.seqChan channel. +func (c *Conn) newSequenceId() uint16 { + return <-c.seqChan +} + +// generateSeqIds returns new sequence ids. +// A sequence id is generated for *every* request. It's the identifier used +// to match up replies with requests. +// Since sequence ids can only be 16 bit integers we start over at zero when it +// comes time to wrap. +// FIXME: 65,536 requests without replies cannot be made in a single sequence. +func (c *Conn) generateSeqIds() { + seqid := uint16(1) + for { + c.seqChan <- seqid + if seqid == uint16((1 << 16) - 1) { + seqid = 0 + } else { + seqid++ + } + } +} + +// request encapsulates a buffer of raw bytes (containing the request data) +// and a cookie, which when combined represents a single request. +// The cookie is used to match up the reply/error. +type request struct { + buf []byte + cookie cookie +} + +// newRequest takes the bytes an a cookie, constructs a request type, +// and sends it over the Conn.reqChan channel. It then returns the cookie +// (for convenience). +func (c *Conn) newRequest(buf []byte, cookie cookie) { + c.reqChan <- &request{buf: buf, cookie: cookie} +} + +// sendRequests is run as a single goroutine that takes requests and writes +// the bytes to the wire and adds the cookie to the cookie queue. +func (c *Conn) sendRequests() { + for req := range c.reqChan { + c.cookieChan <- req.cookie + if _, err := c.conn.Write(req.buf); err != nil { + fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) + close(c.reqChan) + return + } + } +} + +// readResponses is a goroutine that reads events, errors and +// replies off the wire. +// When an event is read, it is always added to the event channel. +// When an error is read, if it corresponds to an existing checked cookie, +// it is sent to that cookie's error channel. Otherwise it is added to the +// event channel. +// When a reply is read, it is added to the corresponding cookie's reply +// channel. (It is an error if no such cookie exists in this case.) +// Finally, cookies that came "before" this reply are always cleaned up. +func (c *Conn) readResponses() { + var ( + err Error + event Event + seq uint16 + replyBytes []byte + ) + + buf := make([]byte, 32) + for { + err, event, seq = nil, nil, 0 + + if _, err := io.ReadFull(c.conn, buf); err != nil { + fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) + close(c.eventChan) + break + } + + switch buf[0] { + case 0: // This is an error + // Use the constructor function for this error (that is auto + // generated) by looking it up by the error number. + err = newErrorFuncs[int(buf[1])](buf) + seq = err.SequenceId() + + // This error is either sent to the event channel or a specific + // cookie's error channel below. + case 1: // This is a reply + seq = Get16(buf[2:]) + + // check to see if this reply has more bytes to be read + size := Get32(buf[4:]) + if size > 0 { + byteCount := 32 + size * 4 + biggerBuf := make([]byte, byteCount) + copy(biggerBuf[:32], buf) + if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { + fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) + close(c.eventChan) + break + } + replyBytes = biggerBuf + } else { + replyBytes = buf + } + + // This reply is sent to its corresponding cookie below. + default: // This is an event + // Use the constructor function for this event (like for errors, + // and is also auto generated) by looking it up by the event number. + // Note that we AND the event number with 127 so that we ignore + // the most significant bit (which is set when it was sent from + // a SendEvent request). + event = newEventFuncs[int(buf[0] & 127)](buf) + // seq = event.SequenceId() // 0 for KeymapNotify + + // Put the event into the queue. + c.eventChan <- event + + // No more processing for events. + continue + + // If this was a KeymapNotify event, then we don't do any more + // processing since we don't have any sequence id. + // if event != nil { + // if _, ok := event.(KeymapNotifyEvent); ok { + // continue + // } + // } + } + + // At this point, we have a sequence number and we're either + // processing an error or a reply, which are both responses to + // requests. So all we have to do is find the cookie corresponding + // to this error/reply, and send the appropriate data to it. + // In doing so, we make sure that any cookies that came before it + // are marked as successful if they are void and checked. + // If there's a cookie that requires a reply that is before this + // reply, then something is wrong. + for cookie := range c.cookieChan { + // This is the cookie we're looking for. Process and break. + if cookie.Sequence == seq { + if err != nil { // this is an error to a request + // synchronous processing + if cookie.errorChan != nil { + cookie.errorChan <- err + } else { // asynchronous processing + c.eventChan <- err + } + } else { // this is a reply + if cookie.replyChan == nil { + fmt.Fprintf(os.Stderr, + "Reply with sequence id %d does not have a " + + "cookie with a valid reply channel.\n", seq) + } else { + cookie.replyChan <- replyBytes + } + } + break + } + + switch { + // Checked requests with replies + case cookie.replyChan != nil && cookie.errorChan != nil: + fmt.Fprintf(os.Stderr, + "Found cookie with sequence id %d that is expecting a " + + "reply but will never get it.\n", cookie.Sequence) + // Unchecked requests with replies + case cookie.replyChan != nil && cookie.pingChan != nil: + cookie.pingChan <- true + // Checked requests without replies + case cookie.pingChan != nil && cookie.errorChan != nil: + cookie.pingChan <- true + // Unchecked requests without replies don't have any channels, + // so we can't do anything with them except let them pass by. + } + } + } +} + +// processEventOrError takes an eventOrError, type switches on it, +// and returns it in Go idiomatic style. +func processEventOrError(everr eventOrError) (Event, Error) { + switch ee := everr.(type) { + case Event: + return ee, nil + case Error: + return nil, ee + default: + fmt.Fprintf(os.Stderr, "Invalid event/error type: %T\n", everr) + } + panic("unreachable") +} + +// WaitForEvent returns the next event from the server. +// It will block until an event is available. +func (c *Conn) WaitForEvent() (Event, Error) { + return processEventOrError(<-c.eventChan) +} + +// PollForEvent returns the next event from the server if one is available in +// the internal queue. +// It will not block. +func (c *Conn) PollForEvent() (Event, Error) { + select { + case everr := <-c.eventChan: + return processEventOrError(everr) + default: + return nil, nil + } + panic("unreachable") +} + // RegisterExtension adds the respective extension's major op code to // the extensions map. func (c *Conn) RegisterExtension(name string) error { nameUpper := strings.ToUpper(name) - reply, err := c.QueryExtension(uint16(len(nameUpper)), nameUpper) + reply, err := c.QueryExtension(uint16(len(nameUpper)), nameUpper).Reply() switch { case err != nil: @@ -216,190 +411,3 @@ func (c *Conn) RegisterExtension(name string) error { return nil } - -// A simple queue used to stow away events. -type queue struct { - data [][]byte - a, b int -} - -func (q *queue) queue(item []byte) { - if q.b == len(q.data) { - if q.a > 0 { - copy(q.data, q.data[q.a:q.b]) - q.a, q.b = 0, q.b-q.a - } else { - newData := make([][]byte, (len(q.data)*3)/2) - copy(newData, q.data) - q.data = newData - } - } - q.data[q.b] = item - q.b++ -} - -func (q *queue) dequeue(c *Conn) []byte { - c.dequeueLock.Lock() - defer c.dequeueLock.Unlock() - - if q.a < q.b { - item := q.data[q.a] - q.a++ - return item - } - return nil -} - -// newWriteChan creates the channel required for writing to the net.Conn. -func (c *Conn) newRequestChannels() { - c.requestChan = make(chan *Request, writeBuffer) - c.requestCookieChan = make(chan *Cookie, 1) - - go func() { - for request := range c.requestChan { - cookieNum := c.nextCookie - c.nextCookie++ - - if request.cookieChan != nil { - cookie := newCookie(cookieNum) - c.cookies[cookieNum] = cookie - request.cookieChan <- cookie - } - if _, err := c.conn.Write(request.buf); err != nil { - fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) - close(c.requestChan) - return - } - } - }() -} - -// request is a buffered write to net.Conn. -func (c *Conn) request(buf []byte, needsReply bool) *Cookie { - req := newRequest(buf, needsReply) - c.requestChan <- req - - if req.cookieChan != nil { - cookie := <-req.cookieChan - close(req.cookieChan) - return cookie - } - return nil -} - -func (c *Conn) sendRequest(needsReply bool, bufs ...[]byte) *Cookie { - if len(bufs) == 1 { - return c.request(bufs[0], needsReply) - } - - total := make([]byte, 0) - for _, buf := range bufs { - total = append(total, buf...) - } - return c.request(total, needsReply) -} - -func (c *Conn) newReadChannels() { - c.eventChan = make(chan bool, readBuffer) - - onError := func() { - panic("read error") - } - - go func() { - for { - buf := make([]byte, 32) - if _, err := io.ReadFull(c.conn, buf); err != nil { - fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) - onError() - return - } - - switch buf[0] { - case 0: - // err := &Error{ - // Detail: buf[1], - // Cookie: uint16(get16(buf[2:])), - // Id: Id(get32(buf[4:])), - // Minor: get16(buf[8:]), - // Major: buf[10], - // } - err := newErrorFuncs[int(buf[1])](buf) - if cookie, ok := c.cookies[err.SequenceId()]; ok { - cookie.errorChan <- err - } else { - fmt.Fprintf(os.Stderr, "x protocol error: %s\n", err) - } - case 1: - seq := uint16(Get16(buf[2:])) - if _, ok := c.cookies[seq]; !ok { - continue - } - - size := Get32(buf[4:]) - if size > 0 { - bigbuf := make([]byte, 32+size*4, 32+size*4) - copy(bigbuf[0:32], buf) - if _, err := io.ReadFull(c.conn, bigbuf[32:]); err != nil { - fmt.Fprintf(os.Stderr, - "x protocol read error: %s\n", err) - onError() - return - } - c.cookies[seq].replyChan <- bigbuf - } else { - c.cookies[seq].replyChan <- buf - } - default: - c.events.queue(buf) - select { - case c.eventChan <- true: - default: - } - } - } - }() -} - -func (c *Conn) waitForReply(cookie *Cookie) ([]byte, error) { - if cookie == nil { - panic("nil cookie") - } - if _, ok := c.cookies[cookie.id]; !ok { - panic("waiting for a cookie that will never come") - } - select { - case reply := <-cookie.replyChan: - return reply, nil - case err := <-cookie.errorChan: - return nil, err - } - panic("unreachable") -} - -// WaitForEvent returns the next event from the server. -// It will block until an event is available. -func (c *Conn) WaitForEvent() (Event, error) { - for { - if reply := c.events.dequeue(c); reply != nil { - evCode := reply[0] & 0x7f - return newEventFuncs[int(evCode)](reply), nil - } - if !<-c.eventChan { - return nil, errors.New("Event channel has been closed.") - } - } - panic("unreachable") -} - -// PollForEvent returns the next event from the server if one is available in the internal queue. -// It will not read from the connection, so you must call WaitForEvent to receive new events. -// Only use this function to empty the queue without blocking. -func (c *Conn) PollForEvent() (Event, error) { - if reply := c.events.dequeue(c); reply != nil { - evCode := reply[0] & 0x7f - return newEventFuncs[int(evCode)](reply), nil - } - return nil, nil -} - diff --git a/nexgb/xproto.go b/nexgb/xproto.go index 3317b51..d56f0a1 100644 --- a/nexgb/xproto.go +++ b/nexgb/xproto.go @@ -1,10 +1,22 @@ package xgb /* - This file was generated by xproto.xml on May 3 2012 12:48:47am EDT. + This file was generated by xproto.xml on May 5 2012 2:50:11am EDT. This file is automatically generated. Edit at your peril! */ +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -19,18 +31,6 @@ package xgb // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -2727,6 +2727,10 @@ func (v KeyPressEvent) Bytes() []byte { func (v KeyPressEvent) ImplementsEvent() {} +func (v KeyPressEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[2] = NewKeyPressEvent } @@ -2857,6 +2861,10 @@ func (v ButtonPressEvent) Bytes() []byte { func (v ButtonPressEvent) ImplementsEvent() {} +func (v ButtonPressEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[4] = NewButtonPressEvent } @@ -2987,6 +2995,10 @@ func (v MotionNotifyEvent) Bytes() []byte { func (v MotionNotifyEvent) ImplementsEvent() {} +func (v MotionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[6] = NewMotionNotifyEvent } @@ -3111,6 +3123,10 @@ func (v EnterNotifyEvent) Bytes() []byte { func (v EnterNotifyEvent) ImplementsEvent() {} +func (v EnterNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[7] = NewEnterNotifyEvent } @@ -3177,6 +3193,10 @@ func (v FocusInEvent) Bytes() []byte { func (v FocusInEvent) ImplementsEvent() {} +func (v FocusInEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[9] = NewFocusInEvent } @@ -3219,6 +3239,10 @@ func (v KeymapNotifyEvent) Bytes() []byte { func (v KeymapNotifyEvent) ImplementsEvent() {} +func (v KeymapNotifyEvent) SequenceId() uint16 { + return uint16(0) +} + func init() { newEventFuncs[11] = NewKeymapNotifyEvent } @@ -3311,6 +3335,10 @@ func (v ExposeEvent) Bytes() []byte { func (v ExposeEvent) ImplementsEvent() {} +func (v ExposeEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[12] = NewExposeEvent } @@ -3417,6 +3445,10 @@ func (v GraphicsExposureEvent) Bytes() []byte { func (v GraphicsExposureEvent) ImplementsEvent() {} +func (v GraphicsExposureEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[13] = NewGraphicsExposureEvent } @@ -3488,6 +3520,10 @@ func (v NoExposureEvent) Bytes() []byte { func (v NoExposureEvent) ImplementsEvent() {} +func (v NoExposureEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[14] = NewNoExposureEvent } @@ -3552,6 +3588,10 @@ func (v VisibilityNotifyEvent) Bytes() []byte { func (v VisibilityNotifyEvent) ImplementsEvent() {} +func (v VisibilityNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[15] = NewVisibilityNotifyEvent } @@ -3666,6 +3706,10 @@ func (v CreateNotifyEvent) Bytes() []byte { func (v CreateNotifyEvent) ImplementsEvent() {} +func (v CreateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[16] = NewCreateNotifyEvent } @@ -3725,6 +3769,10 @@ func (v DestroyNotifyEvent) Bytes() []byte { func (v DestroyNotifyEvent) ImplementsEvent() {} +func (v DestroyNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[17] = NewDestroyNotifyEvent } @@ -3804,6 +3852,10 @@ func (v UnmapNotifyEvent) Bytes() []byte { func (v UnmapNotifyEvent) ImplementsEvent() {} +func (v UnmapNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[18] = NewUnmapNotifyEvent } @@ -3883,6 +3935,10 @@ func (v MapNotifyEvent) Bytes() []byte { func (v MapNotifyEvent) ImplementsEvent() {} +func (v MapNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[19] = NewMapNotifyEvent } @@ -3942,6 +3998,10 @@ func (v MapRequestEvent) Bytes() []byte { func (v MapRequestEvent) ImplementsEvent() {} +func (v MapRequestEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[20] = NewMapRequestEvent } @@ -4042,6 +4102,10 @@ func (v ReparentNotifyEvent) Bytes() []byte { func (v ReparentNotifyEvent) ImplementsEvent() {} +func (v ReparentNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[21] = NewReparentNotifyEvent } @@ -4163,6 +4227,10 @@ func (v ConfigureNotifyEvent) Bytes() []byte { func (v ConfigureNotifyEvent) ImplementsEvent() {} +func (v ConfigureNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[22] = NewConfigureNotifyEvent } @@ -4273,6 +4341,10 @@ func (v ConfigureRequestEvent) Bytes() []byte { func (v ConfigureRequestEvent) ImplementsEvent() {} +func (v ConfigureRequestEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[23] = NewConfigureRequestEvent } @@ -4346,6 +4418,10 @@ func (v GravityNotifyEvent) Bytes() []byte { func (v GravityNotifyEvent) ImplementsEvent() {} +func (v GravityNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[24] = NewGravityNotifyEvent } @@ -4412,6 +4488,10 @@ func (v ResizeRequestEvent) Bytes() []byte { func (v ResizeRequestEvent) ImplementsEvent() {} +func (v ResizeRequestEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[25] = NewResizeRequestEvent } @@ -4488,6 +4568,10 @@ func (v CirculateNotifyEvent) Bytes() []byte { func (v CirculateNotifyEvent) ImplementsEvent() {} +func (v CirculateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[26] = NewCirculateNotifyEvent } @@ -4566,6 +4650,10 @@ func (v PropertyNotifyEvent) Bytes() []byte { func (v PropertyNotifyEvent) ImplementsEvent() {} +func (v PropertyNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[28] = NewPropertyNotifyEvent } @@ -4632,6 +4720,10 @@ func (v SelectionClearEvent) Bytes() []byte { func (v SelectionClearEvent) ImplementsEvent() {} +func (v SelectionClearEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[29] = NewSelectionClearEvent } @@ -4719,6 +4811,10 @@ func (v SelectionRequestEvent) Bytes() []byte { func (v SelectionRequestEvent) ImplementsEvent() {} +func (v SelectionRequestEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[30] = NewSelectionRequestEvent } @@ -4799,6 +4895,10 @@ func (v SelectionNotifyEvent) Bytes() []byte { func (v SelectionNotifyEvent) ImplementsEvent() {} +func (v SelectionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[31] = NewSelectionNotifyEvent } @@ -4885,6 +4985,10 @@ func (v ColormapNotifyEvent) Bytes() []byte { func (v ColormapNotifyEvent) ImplementsEvent() {} +func (v ColormapNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[32] = NewColormapNotifyEvent } @@ -4956,6 +5060,10 @@ func (v ClientMessageEvent) Bytes() []byte { func (v ClientMessageEvent) ImplementsEvent() {} +func (v ClientMessageEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[33] = NewClientMessageEvent } @@ -5027,6 +5135,10 @@ func (v MappingNotifyEvent) Bytes() []byte { func (v MappingNotifyEvent) ImplementsEvent() {} +func (v MappingNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[34] = NewMappingNotifyEvent } @@ -5047,6 +5159,10 @@ func (v KeyReleaseEvent) Bytes() []byte { func (v KeyReleaseEvent) ImplementsEvent() {} +func (v KeyReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[3] = NewKeyReleaseEvent } @@ -5067,6 +5183,10 @@ func (v ButtonReleaseEvent) Bytes() []byte { func (v ButtonReleaseEvent) ImplementsEvent() {} +func (v ButtonReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[5] = NewButtonReleaseEvent } @@ -5087,6 +5207,10 @@ func (v LeaveNotifyEvent) Bytes() []byte { func (v LeaveNotifyEvent) ImplementsEvent() {} +func (v LeaveNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[8] = NewLeaveNotifyEvent } @@ -5107,6 +5231,10 @@ func (v FocusOutEvent) Bytes() []byte { func (v FocusOutEvent) ImplementsEvent() {} +func (v FocusOutEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[10] = NewFocusOutEvent } @@ -5127,6 +5255,10 @@ func (v CirculateRequestEvent) Bytes() []byte { func (v CirculateRequestEvent) ImplementsEvent() {} +func (v CirculateRequestEvent) SequenceId() uint16 { + return v.Sequence +} + func init() { newEventFuncs[27] = NewCirculateRequestEvent } @@ -5798,10 +5930,25 @@ func init() { } // Request CreateWindow -// size: (28 + (4 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) +type CreateWindowCookie cookie + // Write request to wire for CreateWindow -func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) { - size := (28 + (4 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) + return CreateWindowCookie(cookie) +} + +func (c *Conn) CreateWindowChecked(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) + return CreateWindowCookie(cookie) +} + +// Write request to wire for CreateWindow +func createWindowRequest(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { + size := pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -5849,14 +5996,29 @@ func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Wid } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request ChangeWindowAttributes -// size: (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +type ChangeWindowAttributesCookie cookie + // Write request to wire for ChangeWindowAttributes -func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []uint32) { - size := (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie(cookie) +} + +func (c *Conn) ChangeWindowAttributesChecked(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie(cookie) +} + +// Write request to wire for ChangeWindowAttributes +func changeWindowAttributesRequest(Window Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -5879,33 +6041,23 @@ func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []u } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request GetWindowAttributes // size: 8 -func (c *Conn) GetWindowAttributes(Window Id) (*GetWindowAttributesReply, error) { - return c.GetWindowAttributesReply(c.GetWindowAttributesRequest(Window)) +type GetWindowAttributesCookie cookie + +func (c *Conn) GetWindowAttributes(Window Id) GetWindowAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(getWindowAttributesRequest(Window), cookie) + return GetWindowAttributesCookie(cookie) } -// Write request to wire for GetWindowAttributes -func (c *Conn) GetWindowAttributesRequest(Window Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 3 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) GetWindowAttributesUnchecked(Window Id) GetWindowAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(getWindowAttributesRequest(Window), cookie) + return GetWindowAttributesCookie(cookie) } // Request reply for GetWindowAttributes @@ -5931,13 +6083,17 @@ type GetWindowAttributesReply struct { // padding: 2 bytes } -// Read reply GetWindowAttributes -func (c *Conn) GetWindowAttributesReply(cook *Cookie) (*GetWindowAttributesReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetWindowAttributes +func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getWindowAttributesReply(buf), nil +} +// Read reply into structure from buffer for GetWindowAttributes +func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { v := new(GetWindowAttributesReply) b := 1 // skip reply determinant @@ -6006,13 +6162,48 @@ func (c *Conn) GetWindowAttributesReply(cook *Cookie) (*GetWindowAttributesReply b += 2 // padding - return v, nil + return v +} + +// Write request to wire for GetWindowAttributes +func getWindowAttributesRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 3 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } // Request DestroyWindow // size: 8 +type DestroyWindowCookie cookie + // Write request to wire for DestroyWindow -func (c *Conn) DestroyWindow(Window Id) { +func (c *Conn) DestroyWindow(Window Id) DestroyWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(destroyWindowRequest(Window), cookie) + return DestroyWindowCookie(cookie) +} + +func (c *Conn) DestroyWindowChecked(Window Id) DestroyWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(destroyWindowRequest(Window), cookie) + return DestroyWindowCookie(cookie) +} + +// Write request to wire for DestroyWindow +func destroyWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6028,13 +6219,28 @@ func (c *Conn) DestroyWindow(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request DestroySubwindows // size: 8 +type DestroySubwindowsCookie cookie + // Write request to wire for DestroySubwindows -func (c *Conn) DestroySubwindows(Window Id) { +func (c *Conn) DestroySubwindows(Window Id) DestroySubwindowsCookie { + cookie := c.newCookie(false, false) + c.newRequest(destroySubwindowsRequest(Window), cookie) + return DestroySubwindowsCookie(cookie) +} + +func (c *Conn) DestroySubwindowsChecked(Window Id) DestroySubwindowsCookie { + cookie := c.newCookie(true, false) + c.newRequest(destroySubwindowsRequest(Window), cookie) + return DestroySubwindowsCookie(cookie) +} + +// Write request to wire for DestroySubwindows +func destroySubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6050,13 +6256,28 @@ func (c *Conn) DestroySubwindows(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request ChangeSaveSet // size: 8 +type ChangeSaveSetCookie cookie + // Write request to wire for ChangeSaveSet -func (c *Conn) ChangeSaveSet(Mode byte, Window Id) { +func (c *Conn) ChangeSaveSet(Mode byte, Window Id) ChangeSaveSetCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeSaveSetRequest(Mode, Window), cookie) + return ChangeSaveSetCookie(cookie) +} + +func (c *Conn) ChangeSaveSetChecked(Mode byte, Window Id) ChangeSaveSetCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeSaveSetRequest(Mode, Window), cookie) + return ChangeSaveSetCookie(cookie) +} + +// Write request to wire for ChangeSaveSet +func changeSaveSetRequest(Mode byte, Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6073,13 +6294,28 @@ func (c *Conn) ChangeSaveSet(Mode byte, Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request ReparentWindow // size: 16 +type ReparentWindowCookie cookie + // Write request to wire for ReparentWindow -func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) { +func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(reparentWindowRequest(Window, Parent, X, Y), cookie) + return ReparentWindowCookie(cookie) +} + +func (c *Conn) ReparentWindowChecked(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(reparentWindowRequest(Window, Parent, X, Y), cookie) + return ReparentWindowCookie(cookie) +} + +// Write request to wire for ReparentWindow +func reparentWindowRequest(Window Id, Parent Id, X int16, Y int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6104,13 +6340,28 @@ func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) { Put16(buf[b:], uint16(Y)) b += 2 - c.sendRequest(false, buf) + return buf } // Request MapWindow // size: 8 +type MapWindowCookie cookie + // Write request to wire for MapWindow -func (c *Conn) MapWindow(Window Id) { +func (c *Conn) MapWindow(Window Id) MapWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(mapWindowRequest(Window), cookie) + return MapWindowCookie(cookie) +} + +func (c *Conn) MapWindowChecked(Window Id) MapWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(mapWindowRequest(Window), cookie) + return MapWindowCookie(cookie) +} + +// Write request to wire for MapWindow +func mapWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6126,13 +6377,28 @@ func (c *Conn) MapWindow(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request MapSubwindows // size: 8 +type MapSubwindowsCookie cookie + // Write request to wire for MapSubwindows -func (c *Conn) MapSubwindows(Window Id) { +func (c *Conn) MapSubwindows(Window Id) MapSubwindowsCookie { + cookie := c.newCookie(false, false) + c.newRequest(mapSubwindowsRequest(Window), cookie) + return MapSubwindowsCookie(cookie) +} + +func (c *Conn) MapSubwindowsChecked(Window Id) MapSubwindowsCookie { + cookie := c.newCookie(true, false) + c.newRequest(mapSubwindowsRequest(Window), cookie) + return MapSubwindowsCookie(cookie) +} + +// Write request to wire for MapSubwindows +func mapSubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6148,13 +6414,28 @@ func (c *Conn) MapSubwindows(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request UnmapWindow // size: 8 +type UnmapWindowCookie cookie + // Write request to wire for UnmapWindow -func (c *Conn) UnmapWindow(Window Id) { +func (c *Conn) UnmapWindow(Window Id) UnmapWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(unmapWindowRequest(Window), cookie) + return UnmapWindowCookie(cookie) +} + +func (c *Conn) UnmapWindowChecked(Window Id) UnmapWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(unmapWindowRequest(Window), cookie) + return UnmapWindowCookie(cookie) +} + +// Write request to wire for UnmapWindow +func unmapWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6170,13 +6451,28 @@ func (c *Conn) UnmapWindow(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request UnmapSubwindows // size: 8 +type UnmapSubwindowsCookie cookie + // Write request to wire for UnmapSubwindows -func (c *Conn) UnmapSubwindows(Window Id) { +func (c *Conn) UnmapSubwindows(Window Id) UnmapSubwindowsCookie { + cookie := c.newCookie(false, false) + c.newRequest(unmapSubwindowsRequest(Window), cookie) + return UnmapSubwindowsCookie(cookie) +} + +func (c *Conn) UnmapSubwindowsChecked(Window Id) UnmapSubwindowsCookie { + cookie := c.newCookie(true, false) + c.newRequest(unmapSubwindowsRequest(Window), cookie) + return UnmapSubwindowsCookie(cookie) +} + +// Write request to wire for UnmapSubwindows +func unmapSubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6192,14 +6488,29 @@ func (c *Conn) UnmapSubwindows(Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request ConfigureWindow -// size: (10 + (2 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) +type ConfigureWindowCookie cookie + // Write request to wire for ConfigureWindow -func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) { - size := (10 + (2 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(configureWindowRequest(Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie(cookie) +} + +func (c *Conn) ConfigureWindowChecked(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(configureWindowRequest(Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie(cookie) +} + +// Write request to wire for ConfigureWindow +func configureWindowRequest(Window Id, ValueMask uint16, ValueList []uint32) []byte { + size := pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6225,13 +6536,28 @@ func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request CirculateWindow // size: 8 +type CirculateWindowCookie cookie + // Write request to wire for CirculateWindow -func (c *Conn) CirculateWindow(Direction byte, Window Id) { +func (c *Conn) CirculateWindow(Direction byte, Window Id) CirculateWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(circulateWindowRequest(Direction, Window), cookie) + return CirculateWindowCookie(cookie) +} + +func (c *Conn) CirculateWindowChecked(Direction byte, Window Id) CirculateWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(circulateWindowRequest(Direction, Window), cookie) + return CirculateWindowCookie(cookie) +} + +// Write request to wire for CirculateWindow +func circulateWindowRequest(Direction byte, Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6248,33 +6574,23 @@ func (c *Conn) CirculateWindow(Direction byte, Window Id) { Put32(buf[b:], uint32(Window)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GetGeometry // size: 8 -func (c *Conn) GetGeometry(Drawable Id) (*GetGeometryReply, error) { - return c.GetGeometryReply(c.GetGeometryRequest(Drawable)) +type GetGeometryCookie cookie + +func (c *Conn) GetGeometry(Drawable Id) GetGeometryCookie { + cookie := c.newCookie(true, true) + c.newRequest(getGeometryRequest(Drawable), cookie) + return GetGeometryCookie(cookie) } -// Write request to wire for GetGeometry -func (c *Conn) GetGeometryRequest(Drawable Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 14 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) GetGeometryUnchecked(Drawable Id) GetGeometryCookie { + cookie := c.newCookie(false, true) + c.newRequest(getGeometryRequest(Drawable), cookie) + return GetGeometryCookie(cookie) } // Request reply for GetGeometry @@ -6292,13 +6608,17 @@ type GetGeometryReply struct { // padding: 2 bytes } -// Read reply GetGeometry -func (c *Conn) GetGeometryReply(cook *Cookie) (*GetGeometryReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetGeometry +func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getGeometryReply(buf), nil +} +// Read reply into structure from buffer for GetGeometry +func getGeometryReply(buf []byte) *GetGeometryReply { v := new(GetGeometryReply) b := 1 // skip reply determinant @@ -6331,22 +6651,16 @@ func (c *Conn) GetGeometryReply(cook *Cookie) (*GetGeometryReply, error) { b += 2 // padding - return v, nil + return v } -// Request QueryTree -// size: 8 -func (c *Conn) QueryTree(Window Id) (*QueryTreeReply, error) { - return c.QueryTreeReply(c.QueryTreeRequest(Window)) -} - -// Write request to wire for QueryTree -func (c *Conn) QueryTreeRequest(Window Id) *Cookie { +// Write request to wire for GetGeometry +func getGeometryRequest(Drawable Id) []byte { size := 8 b := 0 buf := make([]byte, size) - buf[b] = 15 // request opcode + buf[b] = 14 // request opcode b += 1 b += 1 // padding @@ -6354,10 +6668,26 @@ func (c *Conn) QueryTreeRequest(Window Id) *Cookie { Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + Put32(buf[b:], uint32(Drawable)) b += 4 - return c.sendRequest(true, buf) + return buf +} + +// Request QueryTree +// size: 8 +type QueryTreeCookie cookie + +func (c *Conn) QueryTree(Window Id) QueryTreeCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryTreeRequest(Window), cookie) + return QueryTreeCookie(cookie) +} + +func (c *Conn) QueryTreeUnchecked(Window Id) QueryTreeCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryTreeRequest(Window), cookie) + return QueryTreeCookie(cookie) } // Request reply for QueryTree @@ -6373,13 +6703,17 @@ type QueryTreeReply struct { Children []Id // size: pad((int(ChildrenLen) * 4)) } -// Read reply QueryTree -func (c *Conn) QueryTreeReply(cook *Cookie) (*QueryTreeReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryTree +func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryTreeReply(buf), nil +} +// Read reply into structure from buffer for QueryTree +func queryTreeReply(buf []byte) *QueryTreeReply { v := new(QueryTreeReply) b := 1 // skip reply determinant @@ -6409,18 +6743,85 @@ func (c *Conn) QueryTreeReply(cook *Cookie) (*QueryTreeReply, error) { } b = pad(b) - return v, nil + return v +} + +// Write request to wire for QueryTree +func queryTreeRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 15 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } // Request InternAtom -// size: (8 + pad((int(NameLen) * 1))) -func (c *Conn) InternAtom(OnlyIfExists bool, NameLen uint16, Name string) (*InternAtomReply, error) { - return c.InternAtomReply(c.InternAtomRequest(OnlyIfExists, NameLen, Name)) +// size: pad((8 + pad((int(NameLen) * 1)))) +type InternAtomCookie cookie + +func (c *Conn) InternAtom(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { + cookie := c.newCookie(true, true) + c.newRequest(internAtomRequest(OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie(cookie) +} + +func (c *Conn) InternAtomUnchecked(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { + cookie := c.newCookie(false, true) + c.newRequest(internAtomRequest(OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie(cookie) +} + +// Request reply for InternAtom +// size: 12 +type InternAtomReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Atom Id +} + +// Waits and reads reply data from request InternAtom +func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return internAtomReply(buf), nil +} + +// Read reply into structure from buffer for InternAtom +func internAtomReply(buf []byte) *InternAtomReply { + v := new(InternAtomReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Atom = Id(Get32(buf[b:])) + b += 4 + + return v } // Write request to wire for InternAtom -func (c *Conn) InternAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) *Cookie { - size := (8 + pad((int(NameLen) * 1))) +func internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) []byte { + size := pad((8 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -6445,66 +6846,23 @@ func (c *Conn) InternAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) copy(buf[b:], Name[:NameLen]) b += pad(int(NameLen)) - return c.sendRequest(true, buf) -} - -// Request reply for InternAtom -// size: 12 -type InternAtomReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Atom Id -} - -// Read reply InternAtom -func (c *Conn) InternAtomReply(cook *Cookie) (*InternAtomReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(InternAtomReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Atom = Id(Get32(buf[b:])) - b += 4 - - return v, nil + return buf } // Request GetAtomName // size: 8 -func (c *Conn) GetAtomName(Atom Id) (*GetAtomNameReply, error) { - return c.GetAtomNameReply(c.GetAtomNameRequest(Atom)) +type GetAtomNameCookie cookie + +func (c *Conn) GetAtomName(Atom Id) GetAtomNameCookie { + cookie := c.newCookie(true, true) + c.newRequest(getAtomNameRequest(Atom), cookie) + return GetAtomNameCookie(cookie) } -// Write request to wire for GetAtomName -func (c *Conn) GetAtomNameRequest(Atom Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 17 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Atom)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) GetAtomNameUnchecked(Atom Id) GetAtomNameCookie { + cookie := c.newCookie(false, true) + c.newRequest(getAtomNameRequest(Atom), cookie) + return GetAtomNameCookie(cookie) } // Request reply for GetAtomName @@ -6518,13 +6876,17 @@ type GetAtomNameReply struct { Name string // size: pad((int(NameLen) * 1)) } -// Read reply GetAtomName -func (c *Conn) GetAtomNameReply(cook *Cookie) (*GetAtomNameReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetAtomName +func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getAtomNameReply(buf), nil +} +// Read reply into structure from buffer for GetAtomName +func getAtomNameReply(buf []byte) *GetAtomNameReply { v := new(GetAtomNameReply) b := 1 // skip reply determinant @@ -6548,14 +6910,49 @@ func (c *Conn) GetAtomNameReply(cook *Cookie) (*GetAtomNameReply, error) { b += pad(int(v.NameLen)) } - return v, nil + return v +} + +// Write request to wire for GetAtomName +func getAtomNameRequest(Atom Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 17 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Atom)) + b += 4 + + return buf } // Request ChangeProperty -// size: (24 + pad((((int(DataLen) * int(Format)) / 8) * 1))) +// size: pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) +type ChangePropertyCookie cookie + // Write request to wire for ChangeProperty -func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) { - size := (24 + pad((((int(DataLen) * int(Format)) / 8) * 1))) +func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.newCookie(false, false) + c.newRequest(changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie(cookie) +} + +func (c *Conn) ChangePropertyChecked(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.newCookie(true, false) + c.newRequest(changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie(cookie) +} + +// Write request to wire for ChangeProperty +func changePropertyRequest(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) []byte { + size := pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 buf := make([]byte, size) @@ -6588,13 +6985,28 @@ func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) b += pad(int(((int(DataLen) * int(Format)) / 8))) - c.sendRequest(false, buf) + return buf } // Request DeleteProperty // size: 12 +type DeletePropertyCookie cookie + // Write request to wire for DeleteProperty -func (c *Conn) DeleteProperty(Window Id, Property Id) { +func (c *Conn) DeleteProperty(Window Id, Property Id) DeletePropertyCookie { + cookie := c.newCookie(false, false) + c.newRequest(deletePropertyRequest(Window, Property), cookie) + return DeletePropertyCookie(cookie) +} + +func (c *Conn) DeletePropertyChecked(Window Id, Property Id) DeletePropertyCookie { + cookie := c.newCookie(true, false) + c.newRequest(deletePropertyRequest(Window, Property), cookie) + return DeletePropertyCookie(cookie) +} + +// Write request to wire for DeleteProperty +func deletePropertyRequest(Window Id, Property Id) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -6613,17 +7025,81 @@ func (c *Conn) DeleteProperty(Window Id, Property Id) { Put32(buf[b:], uint32(Property)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GetProperty // size: 24 -func (c *Conn) GetProperty(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) (*GetPropertyReply, error) { - return c.GetPropertyReply(c.GetPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength)) +type GetPropertyCookie cookie + +func (c *Conn) GetProperty(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.newCookie(true, true) + c.newRequest(getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie(cookie) +} + +func (c *Conn) GetPropertyUnchecked(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.newCookie(false, true) + c.newRequest(getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie(cookie) +} + +// Request reply for GetProperty +// size: (32 + pad(((int(ValueLen) * (int(Format) / 8)) * 1))) +type GetPropertyReply struct { + Sequence uint16 + Length uint32 + Format byte + Type Id + BytesAfter uint32 + ValueLen uint32 + // padding: 12 bytes + Value []byte // size: pad(((int(ValueLen) * (int(Format) / 8)) * 1)) +} + +// Waits and reads reply data from request GetProperty +func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return getPropertyReply(buf), nil +} + +// Read reply into structure from buffer for GetProperty +func getPropertyReply(buf []byte) *GetPropertyReply { + v := new(GetPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = Id(Get32(buf[b:])) + b += 4 + + v.BytesAfter = Get32(buf[b:]) + b += 4 + + v.ValueLen = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) + copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) + b += pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) + + return v } // Write request to wire for GetProperty -func (c *Conn) GetPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) *Cookie { +func getPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -6656,83 +7132,23 @@ func (c *Conn) GetPropertyRequest(Delete bool, Window Id, Property Id, Type Id, Put32(buf[b:], LongLength) b += 4 - return c.sendRequest(true, buf) -} - -// Request reply for GetProperty -// size: (32 + pad(((int(ValueLen) * (int(Format) / 8)) * 1))) -type GetPropertyReply struct { - Sequence uint16 - Length uint32 - Format byte - Type Id - BytesAfter uint32 - ValueLen uint32 - // padding: 12 bytes - Value []byte // size: pad(((int(ValueLen) * (int(Format) / 8)) * 1)) -} - -// Read reply GetProperty -func (c *Conn) GetPropertyReply(cook *Cookie) (*GetPropertyReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GetPropertyReply) - b := 1 // skip reply determinant - - v.Format = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Type = Id(Get32(buf[b:])) - b += 4 - - v.BytesAfter = Get32(buf[b:]) - b += 4 - - v.ValueLen = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) - copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) - b += pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) - - return v, nil + return buf } // Request ListProperties // size: 8 -func (c *Conn) ListProperties(Window Id) (*ListPropertiesReply, error) { - return c.ListPropertiesReply(c.ListPropertiesRequest(Window)) +type ListPropertiesCookie cookie + +func (c *Conn) ListProperties(Window Id) ListPropertiesCookie { + cookie := c.newCookie(true, true) + c.newRequest(listPropertiesRequest(Window), cookie) + return ListPropertiesCookie(cookie) } -// Write request to wire for ListProperties -func (c *Conn) ListPropertiesRequest(Window Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 21 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) ListPropertiesUnchecked(Window Id) ListPropertiesCookie { + cookie := c.newCookie(false, true) + c.newRequest(listPropertiesRequest(Window), cookie) + return ListPropertiesCookie(cookie) } // Request reply for ListProperties @@ -6746,13 +7162,17 @@ type ListPropertiesReply struct { Atoms []Id // size: pad((int(AtomsLen) * 4)) } -// Read reply ListProperties -func (c *Conn) ListPropertiesReply(cook *Cookie) (*ListPropertiesReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request ListProperties +func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return listPropertiesReply(buf), nil +} +// Read reply into structure from buffer for ListProperties +func listPropertiesReply(buf []byte) *ListPropertiesReply { v := new(ListPropertiesReply) b := 1 // skip reply determinant @@ -6776,13 +7196,48 @@ func (c *Conn) ListPropertiesReply(cook *Cookie) (*ListPropertiesReply, error) { } b = pad(b) - return v, nil + return v +} + +// Write request to wire for ListProperties +func listPropertiesRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 21 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } // Request SetSelectionOwner // size: 16 +type SetSelectionOwnerCookie cookie + // Write request to wire for SetSelectionOwner -func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) { +func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.newCookie(false, false) + c.newRequest(setSelectionOwnerRequest(Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie(cookie) +} + +func (c *Conn) SetSelectionOwnerChecked(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.newCookie(true, false) + c.newRequest(setSelectionOwnerRequest(Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie(cookie) +} + +// Write request to wire for SetSelectionOwner +func setSelectionOwnerRequest(Owner Id, Selection Id, Time Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6804,17 +7259,64 @@ func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) { Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GetSelectionOwner // size: 8 -func (c *Conn) GetSelectionOwner(Selection Id) (*GetSelectionOwnerReply, error) { - return c.GetSelectionOwnerReply(c.GetSelectionOwnerRequest(Selection)) +type GetSelectionOwnerCookie cookie + +func (c *Conn) GetSelectionOwner(Selection Id) GetSelectionOwnerCookie { + cookie := c.newCookie(true, true) + c.newRequest(getSelectionOwnerRequest(Selection), cookie) + return GetSelectionOwnerCookie(cookie) +} + +func (c *Conn) GetSelectionOwnerUnchecked(Selection Id) GetSelectionOwnerCookie { + cookie := c.newCookie(false, true) + c.newRequest(getSelectionOwnerRequest(Selection), cookie) + return GetSelectionOwnerCookie(cookie) +} + +// Request reply for GetSelectionOwner +// size: 12 +type GetSelectionOwnerReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Owner Id +} + +// Waits and reads reply data from request GetSelectionOwner +func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return getSelectionOwnerReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectionOwner +func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { + v := new(GetSelectionOwnerReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Owner = Id(Get32(buf[b:])) + b += 4 + + return v } // Write request to wire for GetSelectionOwner -func (c *Conn) GetSelectionOwnerRequest(Selection Id) *Cookie { +func getSelectionOwnerRequest(Selection Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6830,46 +7332,28 @@ func (c *Conn) GetSelectionOwnerRequest(Selection Id) *Cookie { Put32(buf[b:], uint32(Selection)) b += 4 - return c.sendRequest(true, buf) -} - -// Request reply for GetSelectionOwner -// size: 12 -type GetSelectionOwnerReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Owner Id -} - -// Read reply GetSelectionOwner -func (c *Conn) GetSelectionOwnerReply(cook *Cookie) (*GetSelectionOwnerReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GetSelectionOwnerReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Owner = Id(Get32(buf[b:])) - b += 4 - - return v, nil + return buf } // Request ConvertSelection // size: 24 +type ConvertSelectionCookie cookie + // Write request to wire for ConvertSelection -func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) { +func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { + cookie := c.newCookie(false, false) + c.newRequest(convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie(cookie) +} + +func (c *Conn) ConvertSelectionChecked(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { + cookie := c.newCookie(true, false) + c.newRequest(convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie(cookie) +} + +// Write request to wire for ConvertSelection +func convertSelectionRequest(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -6897,14 +7381,29 @@ func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request SendEvent -// size: (12 + pad(32)) +// size: pad((12 + pad(32))) +type SendEventCookie cookie + // Write request to wire for SendEvent -func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event string) { - size := (12 + pad(32)) +func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { + cookie := c.newCookie(false, false) + c.newRequest(sendEventRequest(Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie(cookie) +} + +func (c *Conn) SendEventChecked(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { + cookie := c.newCookie(true, false) + c.newRequest(sendEventRequest(Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie(cookie) +} + +// Write request to wire for SendEvent +func sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte { + size := pad((12 + pad(32))) b := 0 buf := make([]byte, size) @@ -6930,17 +7429,55 @@ func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event copy(buf[b:], Event[:32]) b += pad(int(32)) - c.sendRequest(false, buf) + return buf } // Request GrabPointer // size: 24 -func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) (*GrabPointerReply, error) { - return c.GrabPointerReply(c.GrabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time)) +type GrabPointerCookie cookie + +func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { + cookie := c.newCookie(true, true) + c.newRequest(grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) + return GrabPointerCookie(cookie) +} + +func (c *Conn) GrabPointerUnchecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { + cookie := c.newCookie(false, true) + c.newRequest(grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) + return GrabPointerCookie(cookie) +} + +// Request reply for GrabPointer +// size: 8 +type GrabPointerReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Waits and reads reply data from request GrabPointer +func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return grabPointerReply(buf), nil +} + +// Read reply into structure from buffer for GrabPointer +func grabPointerReply(buf []byte) *GrabPointerReply { + v := new(GrabPointerReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v } // Write request to wire for GrabPointer -func (c *Conn) GrabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) *Cookie { +func grabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -6979,37 +7516,28 @@ func (c *Conn) GrabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uin Put32(buf[b:], uint32(Time)) b += 4 - return c.sendRequest(true, buf) -} - -// Request reply for GrabPointer -// size: 8 -type GrabPointerReply struct { - Sequence uint16 - Length uint32 - Status byte -} - -// Read reply GrabPointer -func (c *Conn) GrabPointerReply(cook *Cookie) (*GrabPointerReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GrabPointerReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - return v, nil + return buf } // Request UngrabPointer // size: 8 +type UngrabPointerCookie cookie + // Write request to wire for UngrabPointer -func (c *Conn) UngrabPointer(Time Timestamp) { +func (c *Conn) UngrabPointer(Time Timestamp) UngrabPointerCookie { + cookie := c.newCookie(false, false) + c.newRequest(ungrabPointerRequest(Time), cookie) + return UngrabPointerCookie(cookie) +} + +func (c *Conn) UngrabPointerChecked(Time Timestamp) UngrabPointerCookie { + cookie := c.newCookie(true, false) + c.newRequest(ungrabPointerRequest(Time), cookie) + return UngrabPointerCookie(cookie) +} + +// Write request to wire for UngrabPointer +func ungrabPointerRequest(Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7025,13 +7553,28 @@ func (c *Conn) UngrabPointer(Time Timestamp) { Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GrabButton // size: 24 +type GrabButtonCookie cookie + // Write request to wire for GrabButton -func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) { +func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { + cookie := c.newCookie(false, false) + c.newRequest(grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie(cookie) +} + +func (c *Conn) GrabButtonChecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { + cookie := c.newCookie(true, false) + c.newRequest(grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie(cookie) +} + +// Write request to wire for GrabButton +func grabButtonRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7075,13 +7618,28 @@ func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, Poi Put16(buf[b:], Modifiers) b += 2 - c.sendRequest(false, buf) + return buf } // Request UngrabButton // size: 12 +type UngrabButtonCookie cookie + // Write request to wire for UngrabButton -func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) { +func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { + cookie := c.newCookie(false, false) + c.newRequest(ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie(cookie) +} + +func (c *Conn) UngrabButtonChecked(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { + cookie := c.newCookie(true, false) + c.newRequest(ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie(cookie) +} + +// Write request to wire for UngrabButton +func ungrabButtonRequest(Button byte, GrabWindow Id, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7103,13 +7661,28 @@ func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) { b += 2 // padding - c.sendRequest(false, buf) + return buf } // Request ChangeActivePointerGrab // size: 16 +type ChangeActivePointerGrabCookie cookie + // Write request to wire for ChangeActivePointerGrab -func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint16) { +func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie(cookie) +} + +func (c *Conn) ChangeActivePointerGrabChecked(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie(cookie) +} + +// Write request to wire for ChangeActivePointerGrab +func changeActivePointerGrabRequest(Cursor Id, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7133,17 +7706,55 @@ func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint b += 2 // padding - c.sendRequest(false, buf) + return buf } // Request GrabKeyboard // size: 16 -func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) (*GrabKeyboardReply, error) { - return c.GrabKeyboardReply(c.GrabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode)) +type GrabKeyboardCookie cookie + +func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { + cookie := c.newCookie(true, true) + c.newRequest(grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie(cookie) +} + +func (c *Conn) GrabKeyboardUnchecked(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { + cookie := c.newCookie(false, true) + c.newRequest(grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie(cookie) +} + +// Request reply for GrabKeyboard +// size: 8 +type GrabKeyboardReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Waits and reads reply data from request GrabKeyboard +func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return grabKeyboardReply(buf), nil +} + +// Read reply into structure from buffer for GrabKeyboard +func grabKeyboardReply(buf []byte) *GrabKeyboardReply { + v := new(GrabKeyboardReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v } // Write request to wire for GrabKeyboard -func (c *Conn) GrabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) *Cookie { +func grabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7175,37 +7786,28 @@ func (c *Conn) GrabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timesta b += 2 // padding - return c.sendRequest(true, buf) -} - -// Request reply for GrabKeyboard -// size: 8 -type GrabKeyboardReply struct { - Sequence uint16 - Length uint32 - Status byte -} - -// Read reply GrabKeyboard -func (c *Conn) GrabKeyboardReply(cook *Cookie) (*GrabKeyboardReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GrabKeyboardReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - return v, nil + return buf } // Request UngrabKeyboard // size: 8 +type UngrabKeyboardCookie cookie + // Write request to wire for UngrabKeyboard -func (c *Conn) UngrabKeyboard(Time Timestamp) { +func (c *Conn) UngrabKeyboard(Time Timestamp) UngrabKeyboardCookie { + cookie := c.newCookie(false, false) + c.newRequest(ungrabKeyboardRequest(Time), cookie) + return UngrabKeyboardCookie(cookie) +} + +func (c *Conn) UngrabKeyboardChecked(Time Timestamp) UngrabKeyboardCookie { + cookie := c.newCookie(true, false) + c.newRequest(ungrabKeyboardRequest(Time), cookie) + return UngrabKeyboardCookie(cookie) +} + +// Write request to wire for UngrabKeyboard +func ungrabKeyboardRequest(Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7221,13 +7823,28 @@ func (c *Conn) UngrabKeyboard(Time Timestamp) { Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GrabKey // size: 16 +type GrabKeyCookie cookie + // Write request to wire for GrabKey -func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) { +func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { + cookie := c.newCookie(false, false) + c.newRequest(grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie(cookie) +} + +func (c *Conn) GrabKeyChecked(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { + cookie := c.newCookie(true, false) + c.newRequest(grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie(cookie) +} + +// Write request to wire for GrabKey +func grabKeyRequest(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7262,13 +7879,28 @@ func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Ke b += 3 // padding - c.sendRequest(false, buf) + return buf } // Request UngrabKey // size: 12 +type UngrabKeyCookie cookie + // Write request to wire for UngrabKey -func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) { +func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { + cookie := c.newCookie(false, false) + c.newRequest(ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie(cookie) +} + +func (c *Conn) UngrabKeyChecked(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { + cookie := c.newCookie(true, false) + c.newRequest(ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie(cookie) +} + +// Write request to wire for UngrabKey +func ungrabKeyRequest(Key Keycode, GrabWindow Id, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7290,13 +7922,28 @@ func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) { b += 2 // padding - c.sendRequest(false, buf) + return buf } // Request AllowEvents // size: 8 +type AllowEventsCookie cookie + // Write request to wire for AllowEvents -func (c *Conn) AllowEvents(Mode byte, Time Timestamp) { +func (c *Conn) AllowEvents(Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.newCookie(false, false) + c.newRequest(allowEventsRequest(Mode, Time), cookie) + return AllowEventsCookie(cookie) +} + +func (c *Conn) AllowEventsChecked(Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.newCookie(true, false) + c.newRequest(allowEventsRequest(Mode, Time), cookie) + return AllowEventsCookie(cookie) +} + +// Write request to wire for AllowEvents +func allowEventsRequest(Mode byte, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7313,61 +7960,81 @@ func (c *Conn) AllowEvents(Mode byte, Time Timestamp) { Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GrabServer -// size: 3 +// size: 4 +type GrabServerCookie cookie + // Write request to wire for GrabServer -func (c *Conn) GrabServer() { - size := 3 +func (c *Conn) GrabServer() GrabServerCookie { + cookie := c.newCookie(false, false) + c.newRequest(grabServerRequest(), cookie) + return GrabServerCookie(cookie) +} + +func (c *Conn) GrabServerChecked() GrabServerCookie { + cookie := c.newCookie(true, false) + c.newRequest(grabServerRequest(), cookie) + return GrabServerCookie(cookie) +} + +// Write request to wire for GrabServer +func grabServerRequest() []byte { + size := 4 b := 0 buf := make([]byte, size) buf[b] = 36 // request opcode b += 1 - c.sendRequest(false, buf) + return buf } // Request UngrabServer -// size: 3 +// size: 4 +type UngrabServerCookie cookie + // Write request to wire for UngrabServer -func (c *Conn) UngrabServer() { - size := 3 +func (c *Conn) UngrabServer() UngrabServerCookie { + cookie := c.newCookie(false, false) + c.newRequest(ungrabServerRequest(), cookie) + return UngrabServerCookie(cookie) +} + +func (c *Conn) UngrabServerChecked() UngrabServerCookie { + cookie := c.newCookie(true, false) + c.newRequest(ungrabServerRequest(), cookie) + return UngrabServerCookie(cookie) +} + +// Write request to wire for UngrabServer +func ungrabServerRequest() []byte { + size := 4 b := 0 buf := make([]byte, size) buf[b] = 37 // request opcode b += 1 - c.sendRequest(false, buf) + return buf } // Request QueryPointer // size: 8 -func (c *Conn) QueryPointer(Window Id) (*QueryPointerReply, error) { - return c.QueryPointerReply(c.QueryPointerRequest(Window)) +type QueryPointerCookie cookie + +func (c *Conn) QueryPointer(Window Id) QueryPointerCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryPointerRequest(Window), cookie) + return QueryPointerCookie(cookie) } -// Write request to wire for QueryPointer -func (c *Conn) QueryPointerRequest(Window Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 38 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) QueryPointerUnchecked(Window Id) QueryPointerCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryPointerRequest(Window), cookie) + return QueryPointerCookie(cookie) } // Request reply for QueryPointer @@ -7386,13 +8053,17 @@ type QueryPointerReply struct { // padding: 2 bytes } -// Read reply QueryPointer -func (c *Conn) QueryPointerReply(cook *Cookie) (*QueryPointerReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryPointer +func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryPointerReply(buf), nil +} +// Read reply into structure from buffer for QueryPointer +func queryPointerReply(buf []byte) *QueryPointerReply { v := new(QueryPointerReply) b := 1 // skip reply determinant @@ -7432,17 +8103,91 @@ func (c *Conn) QueryPointerReply(cook *Cookie) (*QueryPointerReply, error) { b += 2 // padding - return v, nil + return v +} + +// Write request to wire for QueryPointer +func queryPointerRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 38 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } // Request GetMotionEvents // size: 16 -func (c *Conn) GetMotionEvents(Window Id, Start Timestamp, Stop Timestamp) (*GetMotionEventsReply, error) { - return c.GetMotionEventsReply(c.GetMotionEventsRequest(Window, Start, Stop)) +type GetMotionEventsCookie cookie + +func (c *Conn) GetMotionEvents(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.newCookie(true, true) + c.newRequest(getMotionEventsRequest(Window, Start, Stop), cookie) + return GetMotionEventsCookie(cookie) +} + +func (c *Conn) GetMotionEventsUnchecked(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.newCookie(false, true) + c.newRequest(getMotionEventsRequest(Window, Start, Stop), cookie) + return GetMotionEventsCookie(cookie) +} + +// Request reply for GetMotionEvents +// size: (32 + pad((int(EventsLen) * 8))) +type GetMotionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + EventsLen uint32 + // padding: 20 bytes + Events []Timecoord // size: pad((int(EventsLen) * 8)) +} + +// Waits and reads reply data from request GetMotionEvents +func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return getMotionEventsReply(buf), nil +} + +// Read reply into structure from buffer for GetMotionEvents +func getMotionEventsReply(buf []byte) *GetMotionEventsReply { + v := new(GetMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventsLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Events = make([]Timecoord, v.EventsLen) + b += ReadTimecoordList(buf[b:], v.Events) + + return v } // Write request to wire for GetMotionEvents -func (c *Conn) GetMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) *Cookie { +func getMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7464,82 +8209,23 @@ func (c *Conn) GetMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp Put32(buf[b:], uint32(Stop)) b += 4 - return c.sendRequest(true, buf) -} - -// Request reply for GetMotionEvents -// size: (32 + pad((int(EventsLen) * 8))) -type GetMotionEventsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - EventsLen uint32 - // padding: 20 bytes - Events []Timecoord // size: pad((int(EventsLen) * 8)) -} - -// Read reply GetMotionEvents -func (c *Conn) GetMotionEventsReply(cook *Cookie) (*GetMotionEventsReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GetMotionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.EventsLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Events = make([]Timecoord, v.EventsLen) - b += ReadTimecoordList(buf[b:], v.Events) - - return v, nil + return buf } // Request TranslateCoordinates // size: 16 -func (c *Conn) TranslateCoordinates(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) (*TranslateCoordinatesReply, error) { - return c.TranslateCoordinatesReply(c.TranslateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY)) +type TranslateCoordinatesCookie cookie + +func (c *Conn) TranslateCoordinates(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { + cookie := c.newCookie(true, true) + c.newRequest(translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie(cookie) } -// Write request to wire for TranslateCoordinates -func (c *Conn) TranslateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) *Cookie { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 40 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(SrcWindow)) - b += 4 - - Put32(buf[b:], uint32(DstWindow)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - return c.sendRequest(true, buf) +func (c *Conn) TranslateCoordinatesUnchecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { + cookie := c.newCookie(false, true) + c.newRequest(translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie(cookie) } // Request reply for TranslateCoordinates @@ -7553,13 +8239,17 @@ type TranslateCoordinatesReply struct { DstY int16 } -// Read reply TranslateCoordinates -func (c *Conn) TranslateCoordinatesReply(cook *Cookie) (*TranslateCoordinatesReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request TranslateCoordinates +func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return translateCoordinatesReply(buf), nil +} +// Read reply into structure from buffer for TranslateCoordinates +func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { v := new(TranslateCoordinatesReply) b := 1 // skip reply determinant @@ -7585,13 +8275,57 @@ func (c *Conn) TranslateCoordinatesReply(cook *Cookie) (*TranslateCoordinatesRep v.DstY = int16(Get16(buf[b:])) b += 2 - return v, nil + return v +} + +// Write request to wire for TranslateCoordinates +func translateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 40 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SrcWindow)) + b += 4 + + Put32(buf[b:], uint32(DstWindow)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + return buf } // Request WarpPointer // size: 24 +type WarpPointerCookie cookie + // Write request to wire for WarpPointer -func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) { +func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { + cookie := c.newCookie(false, false) + c.newRequest(warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie(cookie) +} + +func (c *Conn) WarpPointerChecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { + cookie := c.newCookie(true, false) + c.newRequest(warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie(cookie) +} + +// Write request to wire for WarpPointer +func warpPointerRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7628,13 +8362,28 @@ func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, S Put16(buf[b:], uint16(DstY)) b += 2 - c.sendRequest(false, buf) + return buf } // Request SetInputFocus // size: 12 +type SetInputFocusCookie cookie + // Write request to wire for SetInputFocus -func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) { +func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { + cookie := c.newCookie(false, false) + c.newRequest(setInputFocusRequest(RevertTo, Focus, Time), cookie) + return SetInputFocusCookie(cookie) +} + +func (c *Conn) SetInputFocusChecked(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { + cookie := c.newCookie(true, false) + c.newRequest(setInputFocusRequest(RevertTo, Focus, Time), cookie) + return SetInputFocusCookie(cookie) +} + +// Write request to wire for SetInputFocus +func setInputFocusRequest(RevertTo byte, Focus Id, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7654,25 +8403,23 @@ func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) { Put32(buf[b:], uint32(Time)) b += 4 - c.sendRequest(false, buf) + return buf } // Request GetInputFocus -// size: 3 -func (c *Conn) GetInputFocus() (*GetInputFocusReply, error) { - return c.GetInputFocusReply(c.GetInputFocusRequest()) +// size: 4 +type GetInputFocusCookie cookie + +func (c *Conn) GetInputFocus() GetInputFocusCookie { + cookie := c.newCookie(true, true) + c.newRequest(getInputFocusRequest(), cookie) + return GetInputFocusCookie(cookie) } -// Write request to wire for GetInputFocus -func (c *Conn) GetInputFocusRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 43 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetInputFocusUnchecked() GetInputFocusCookie { + cookie := c.newCookie(false, true) + c.newRequest(getInputFocusRequest(), cookie) + return GetInputFocusCookie(cookie) } // Request reply for GetInputFocus @@ -7684,13 +8431,17 @@ type GetInputFocusReply struct { Focus Id } -// Read reply GetInputFocus -func (c *Conn) GetInputFocusReply(cook *Cookie) (*GetInputFocusReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetInputFocus +func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getInputFocusReply(buf), nil +} +// Read reply into structure from buffer for GetInputFocus +func getInputFocusReply(buf []byte) *GetInputFocusReply { v := new(GetInputFocusReply) b := 1 // skip reply determinant @@ -7706,25 +8457,35 @@ func (c *Conn) GetInputFocusReply(cook *Cookie) (*GetInputFocusReply, error) { v.Focus = Id(Get32(buf[b:])) b += 4 - return v, nil + return v } -// Request QueryKeymap -// size: 3 -func (c *Conn) QueryKeymap() (*QueryKeymapReply, error) { - return c.QueryKeymapReply(c.QueryKeymapRequest()) -} - -// Write request to wire for QueryKeymap -func (c *Conn) QueryKeymapRequest() *Cookie { - size := 3 +// Write request to wire for GetInputFocus +func getInputFocusRequest() []byte { + size := 4 b := 0 buf := make([]byte, size) - buf[b] = 44 // request opcode + buf[b] = 43 // request opcode b += 1 - return c.sendRequest(true, buf) + return buf +} + +// Request QueryKeymap +// size: 4 +type QueryKeymapCookie cookie + +func (c *Conn) QueryKeymap() QueryKeymapCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryKeymapRequest(), cookie) + return QueryKeymapCookie(cookie) +} + +func (c *Conn) QueryKeymapUnchecked() QueryKeymapCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryKeymapRequest(), cookie) + return QueryKeymapCookie(cookie) } // Request reply for QueryKeymap @@ -7736,13 +8497,17 @@ type QueryKeymapReply struct { Keys []byte // size: pad(32) } -// Read reply QueryKeymap -func (c *Conn) QueryKeymapReply(cook *Cookie) (*QueryKeymapReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryKeymap +func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryKeymapReply(buf), nil +} +// Read reply into structure from buffer for QueryKeymap +func queryKeymapReply(buf []byte) *QueryKeymapReply { v := new(QueryKeymapReply) b := 1 // skip reply determinant @@ -7758,14 +8523,41 @@ func (c *Conn) QueryKeymapReply(cook *Cookie) (*QueryKeymapReply, error) { copy(v.Keys[:32], buf[b:]) b += pad(int(32)) - return v, nil + return v +} + +// Write request to wire for QueryKeymap +func queryKeymapRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 44 // request opcode + b += 1 + + return buf } // Request OpenFont -// size: (12 + pad((int(NameLen) * 1))) +// size: pad((12 + pad((int(NameLen) * 1)))) +type OpenFontCookie cookie + // Write request to wire for OpenFont -func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) { - size := (12 + pad((int(NameLen) * 1))) +func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) OpenFontCookie { + cookie := c.newCookie(false, false) + c.newRequest(openFontRequest(Fid, NameLen, Name), cookie) + return OpenFontCookie(cookie) +} + +func (c *Conn) OpenFontChecked(Fid Id, NameLen uint16, Name string) OpenFontCookie { + cookie := c.newCookie(true, false) + c.newRequest(openFontRequest(Fid, NameLen, Name), cookie) + return OpenFontCookie(cookie) +} + +// Write request to wire for OpenFont +func openFontRequest(Fid Id, NameLen uint16, Name string) []byte { + size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -7788,13 +8580,28 @@ func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) { copy(buf[b:], Name[:NameLen]) b += pad(int(NameLen)) - c.sendRequest(false, buf) + return buf } // Request CloseFont // size: 8 +type CloseFontCookie cookie + // Write request to wire for CloseFont -func (c *Conn) CloseFont(Font Id) { +func (c *Conn) CloseFont(Font Id) CloseFontCookie { + cookie := c.newCookie(false, false) + c.newRequest(closeFontRequest(Font), cookie) + return CloseFontCookie(cookie) +} + +func (c *Conn) CloseFontChecked(Font Id) CloseFontCookie { + cookie := c.newCookie(true, false) + c.newRequest(closeFontRequest(Font), cookie) + return CloseFontCookie(cookie) +} + +// Write request to wire for CloseFont +func closeFontRequest(Font Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7810,33 +8617,23 @@ func (c *Conn) CloseFont(Font Id) { Put32(buf[b:], uint32(Font)) b += 4 - c.sendRequest(false, buf) + return buf } // Request QueryFont // size: 8 -func (c *Conn) QueryFont(Font Id) (*QueryFontReply, error) { - return c.QueryFontReply(c.QueryFontRequest(Font)) +type QueryFontCookie cookie + +func (c *Conn) QueryFont(Font Id) QueryFontCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryFontRequest(Font), cookie) + return QueryFontCookie(cookie) } -// Write request to wire for QueryFont -func (c *Conn) QueryFontRequest(Font Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 47 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Font)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) QueryFontUnchecked(Font Id) QueryFontCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryFontRequest(Font), cookie) + return QueryFontCookie(cookie) } // Request reply for QueryFont @@ -7864,13 +8661,17 @@ type QueryFontReply struct { CharInfos []Charinfo // size: pad((int(CharInfosLen) * 12)) } -// Read reply QueryFont -func (c *Conn) QueryFontReply(cook *Cookie) (*QueryFontReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryFont +func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryFontReply(buf), nil +} +// Read reply into structure from buffer for QueryFont +func queryFontReply(buf []byte) *QueryFontReply { v := new(QueryFontReply) b := 1 // skip reply determinant @@ -7935,26 +8736,19 @@ func (c *Conn) QueryFontReply(cook *Cookie) (*QueryFontReply, error) { v.CharInfos = make([]Charinfo, v.CharInfosLen) b += ReadCharinfoList(buf[b:], v.CharInfos) - return v, nil + return v } -// Request QueryTextExtents -// size: (8 + pad((len(String) * 2))) -func (c *Conn) QueryTextExtents(Font Id, String []Char2b, StringLen uint16) (*QueryTextExtentsReply, error) { - return c.QueryTextExtentsReply(c.QueryTextExtentsRequest(Font, String, StringLen)) -} - -// Write request to wire for QueryTextExtents -func (c *Conn) QueryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) *Cookie { - size := (8 + pad((len(String) * 2))) +// Write request to wire for QueryFont +func queryFontRequest(Font Id) []byte { + size := 8 b := 0 buf := make([]byte, size) - buf[b] = 48 // request opcode + buf[b] = 47 // request opcode b += 1 - buf[b] = byte((int(StringLen) & 1)) - b += 1 + b += 1 // padding Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 @@ -7962,11 +8756,23 @@ func (c *Conn) QueryTextExtentsRequest(Font Id, String []Char2b, StringLen uint1 Put32(buf[b:], uint32(Font)) b += 4 - b += Char2bListBytes(buf[b:], String) + return buf +} - // skip writing local field: StringLen (2) :: uint16 +// Request QueryTextExtents +// size: pad((8 + pad((len(String) * 2)))) +type QueryTextExtentsCookie cookie - return c.sendRequest(true, buf) +func (c *Conn) QueryTextExtents(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryTextExtentsRequest(Font, String, StringLen), cookie) + return QueryTextExtentsCookie(cookie) +} + +func (c *Conn) QueryTextExtentsUnchecked(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryTextExtentsRequest(Font, String, StringLen), cookie) + return QueryTextExtentsCookie(cookie) } // Request reply for QueryTextExtents @@ -7984,13 +8790,17 @@ type QueryTextExtentsReply struct { OverallRight int32 } -// Read reply QueryTextExtents -func (c *Conn) QueryTextExtentsReply(cook *Cookie) (*QueryTextExtentsReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryTextExtents +func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryTextExtentsReply(buf), nil +} +// Read reply into structure from buffer for QueryTextExtents +func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { v := new(QueryTextExtentsReply) b := 1 // skip reply determinant @@ -8024,18 +8834,97 @@ func (c *Conn) QueryTextExtentsReply(cook *Cookie) (*QueryTextExtentsReply, erro v.OverallRight = int32(Get32(buf[b:])) b += 4 - return v, nil + return v +} + +// Write request to wire for QueryTextExtents +func queryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) []byte { + size := pad((8 + pad((len(String) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 48 // request opcode + b += 1 + + buf[b] = byte((int(StringLen) & 1)) + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Font)) + b += 4 + + b += Char2bListBytes(buf[b:], String) + + // skip writing local field: StringLen (2) :: uint16 + + return buf } // Request ListFonts -// size: (8 + pad((int(PatternLen) * 1))) -func (c *Conn) ListFonts(MaxNames uint16, PatternLen uint16, Pattern string) (*ListFontsReply, error) { - return c.ListFontsReply(c.ListFontsRequest(MaxNames, PatternLen, Pattern)) +// size: pad((8 + pad((int(PatternLen) * 1)))) +type ListFontsCookie cookie + +func (c *Conn) ListFonts(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { + cookie := c.newCookie(true, true) + c.newRequest(listFontsRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsCookie(cookie) +} + +func (c *Conn) ListFontsUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { + cookie := c.newCookie(false, true) + c.newRequest(listFontsRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsCookie(cookie) +} + +// Request reply for ListFonts +// size: (32 + StrListSize(Names)) +type ListFontsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NamesLen uint16 + // padding: 22 bytes + Names []Str // size: StrListSize(Names) +} + +// Waits and reads reply data from request ListFonts +func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return listFontsReply(buf), nil +} + +// Read reply into structure from buffer for ListFonts +func listFontsReply(buf []byte) *ListFontsReply { + v := new(ListFontsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NamesLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Names = make([]Str, v.NamesLen) + b += ReadStrList(buf[b:], v.Names) + + return v } // Write request to wire for ListFonts -func (c *Conn) ListFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) *Cookie { - size := (8 + pad((int(PatternLen) * 1))) +func listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { + size := pad((8 + pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -8056,79 +8945,23 @@ func (c *Conn) ListFontsRequest(MaxNames uint16, PatternLen uint16, Pattern stri copy(buf[b:], Pattern[:PatternLen]) b += pad(int(PatternLen)) - return c.sendRequest(true, buf) -} - -// Request reply for ListFonts -// size: (32 + StrListSize(Names)) -type ListFontsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NamesLen uint16 - // padding: 22 bytes - Names []Str // size: StrListSize(Names) -} - -// Read reply ListFonts -func (c *Conn) ListFontsReply(cook *Cookie) (*ListFontsReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(ListFontsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NamesLen = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Names = make([]Str, v.NamesLen) - b += ReadStrList(buf[b:], v.Names) - - return v, nil + return buf } // Request ListFontsWithInfo -// size: (8 + pad((int(PatternLen) * 1))) -func (c *Conn) ListFontsWithInfo(MaxNames uint16, PatternLen uint16, Pattern string) (*ListFontsWithInfoReply, error) { - return c.ListFontsWithInfoReply(c.ListFontsWithInfoRequest(MaxNames, PatternLen, Pattern)) +// size: pad((8 + pad((int(PatternLen) * 1)))) +type ListFontsWithInfoCookie cookie + +func (c *Conn) ListFontsWithInfo(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsWithInfoCookie(cookie) } -// Write request to wire for ListFontsWithInfo -func (c *Conn) ListFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) *Cookie { - size := (8 + pad((int(PatternLen) * 1))) - b := 0 - buf := make([]byte, size) - - buf[b] = 50 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], MaxNames) - b += 2 - - Put16(buf[b:], PatternLen) - b += 2 - - copy(buf[b:], Pattern[:PatternLen]) - b += pad(int(PatternLen)) - - return c.sendRequest(true, buf) +func (c *Conn) ListFontsWithInfoUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsWithInfoCookie(cookie) } // Request reply for ListFontsWithInfo @@ -8156,13 +8989,17 @@ type ListFontsWithInfoReply struct { Name string // size: pad((int(NameLen) * 1)) } -// Read reply ListFontsWithInfo -func (c *Conn) ListFontsWithInfoReply(cook *Cookie) (*ListFontsWithInfoReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request ListFontsWithInfo +func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return listFontsWithInfoReply(buf), nil +} +// Read reply into structure from buffer for ListFontsWithInfo +func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { v := new(ListFontsWithInfoReply) b := 1 // skip reply determinant @@ -8232,14 +9069,55 @@ func (c *Conn) ListFontsWithInfoReply(cook *Cookie) (*ListFontsWithInfoReply, er b += pad(int(v.NameLen)) } - return v, nil + return v +} + +// Write request to wire for ListFontsWithInfo +func listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { + size := pad((8 + pad((int(PatternLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 50 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], MaxNames) + b += 2 + + Put16(buf[b:], PatternLen) + b += 2 + + copy(buf[b:], Pattern[:PatternLen]) + b += pad(int(PatternLen)) + + return buf } // Request SetFontPath -// size: (8 + StrListSize(Font)) +// size: pad((8 + StrListSize(Font))) +type SetFontPathCookie cookie + // Write request to wire for SetFontPath -func (c *Conn) SetFontPath(FontQty uint16, Font []Str) { - size := (8 + StrListSize(Font)) +func (c *Conn) SetFontPath(FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.newCookie(false, false) + c.newRequest(setFontPathRequest(FontQty, Font), cookie) + return SetFontPathCookie(cookie) +} + +func (c *Conn) SetFontPathChecked(FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.newCookie(true, false) + c.newRequest(setFontPathRequest(FontQty, Font), cookie) + return SetFontPathCookie(cookie) +} + +// Write request to wire for SetFontPath +func setFontPathRequest(FontQty uint16, Font []Str) []byte { + size := pad((8 + StrListSize(Font))) b := 0 buf := make([]byte, size) @@ -8258,25 +9136,23 @@ func (c *Conn) SetFontPath(FontQty uint16, Font []Str) { b += StrListBytes(buf[b:], Font) - c.sendRequest(false, buf) + return buf } // Request GetFontPath -// size: 3 -func (c *Conn) GetFontPath() (*GetFontPathReply, error) { - return c.GetFontPathReply(c.GetFontPathRequest()) +// size: 4 +type GetFontPathCookie cookie + +func (c *Conn) GetFontPath() GetFontPathCookie { + cookie := c.newCookie(true, true) + c.newRequest(getFontPathRequest(), cookie) + return GetFontPathCookie(cookie) } -// Write request to wire for GetFontPath -func (c *Conn) GetFontPathRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 52 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetFontPathUnchecked() GetFontPathCookie { + cookie := c.newCookie(false, true) + c.newRequest(getFontPathRequest(), cookie) + return GetFontPathCookie(cookie) } // Request reply for GetFontPath @@ -8290,13 +9166,17 @@ type GetFontPathReply struct { Path []Str // size: StrListSize(Path) } -// Read reply GetFontPath -func (c *Conn) GetFontPathReply(cook *Cookie) (*GetFontPathReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetFontPath +func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getFontPathReply(buf), nil +} +// Read reply into structure from buffer for GetFontPath +func getFontPathReply(buf []byte) *GetFontPathReply { v := new(GetFontPathReply) b := 1 // skip reply determinant @@ -8316,13 +9196,40 @@ func (c *Conn) GetFontPathReply(cook *Cookie) (*GetFontPathReply, error) { v.Path = make([]Str, v.PathLen) b += ReadStrList(buf[b:], v.Path) - return v, nil + return v +} + +// Write request to wire for GetFontPath +func getFontPathRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 52 // request opcode + b += 1 + + return buf } // Request CreatePixmap // size: 16 +type CreatePixmapCookie cookie + // Write request to wire for CreatePixmap -func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) { +func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie(cookie) +} + +func (c *Conn) CreatePixmapChecked(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie(cookie) +} + +// Write request to wire for CreatePixmap +func createPixmapRequest(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8348,13 +9255,28 @@ func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Heigh Put16(buf[b:], Height) b += 2 - c.sendRequest(false, buf) + return buf } // Request FreePixmap // size: 8 +type FreePixmapCookie cookie + // Write request to wire for FreePixmap -func (c *Conn) FreePixmap(Pixmap Id) { +func (c *Conn) FreePixmap(Pixmap Id) FreePixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(freePixmapRequest(Pixmap), cookie) + return FreePixmapCookie(cookie) +} + +func (c *Conn) FreePixmapChecked(Pixmap Id) FreePixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(freePixmapRequest(Pixmap), cookie) + return FreePixmapCookie(cookie) +} + +// Write request to wire for FreePixmap +func freePixmapRequest(Pixmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8370,14 +9292,29 @@ func (c *Conn) FreePixmap(Pixmap Id) { Put32(buf[b:], uint32(Pixmap)) b += 4 - c.sendRequest(false, buf) + return buf } // Request CreateGC -// size: (12 + (4 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) +type CreateGCCookie cookie + // Write request to wire for CreateGC -func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) { - size := (12 + (4 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.newCookie(false, false) + c.newRequest(createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie(cookie) +} + +func (c *Conn) CreateGCChecked(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.newCookie(true, false) + c.newRequest(createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie(cookie) +} + +// Write request to wire for CreateGC +func createGCRequest(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -8403,14 +9340,29 @@ func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint3 } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request ChangeGC -// size: (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +type ChangeGCCookie cookie + // Write request to wire for ChangeGC -func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) { - size := (8 + (4 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeGCRequest(Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie(cookie) +} + +func (c *Conn) ChangeGCChecked(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeGCRequest(Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie(cookie) +} + +// Write request to wire for ChangeGC +func changeGCRequest(Gc Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -8433,13 +9385,28 @@ func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) { } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request CopyGC // size: 16 +type CopyGCCookie cookie + // Write request to wire for CopyGC -func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) { +func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { + cookie := c.newCookie(false, false) + c.newRequest(copyGCRequest(SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie(cookie) +} + +func (c *Conn) CopyGCChecked(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { + cookie := c.newCookie(true, false) + c.newRequest(copyGCRequest(SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie(cookie) +} + +// Write request to wire for CopyGC +func copyGCRequest(SrcGc Id, DstGc Id, ValueMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8461,14 +9428,29 @@ func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) { Put32(buf[b:], ValueMask) b += 4 - c.sendRequest(false, buf) + return buf } // Request SetDashes -// size: (12 + pad((int(DashesLen) * 1))) +// size: pad((12 + pad((int(DashesLen) * 1)))) +type SetDashesCookie cookie + // Write request to wire for SetDashes -func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) { - size := (12 + pad((int(DashesLen) * 1))) +func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.newCookie(false, false) + c.newRequest(setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie(cookie) +} + +func (c *Conn) SetDashesChecked(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.newCookie(true, false) + c.newRequest(setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie(cookie) +} + +// Write request to wire for SetDashes +func setDashesRequest(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { + size := pad((12 + pad((int(DashesLen) * 1)))) b := 0 buf := make([]byte, size) @@ -8492,14 +9474,29 @@ func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []by copy(buf[b:], Dashes[:DashesLen]) b += pad(int(DashesLen)) - c.sendRequest(false, buf) + return buf } // Request SetClipRectangles -// size: (12 + pad((len(Rectangles) * 8))) +// size: pad((12 + pad((len(Rectangles) * 8)))) +type SetClipRectanglesCookie cookie + // Write request to wire for SetClipRectangles -func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) { - size := (12 + pad((len(Rectangles) * 8))) +func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.newCookie(false, false) + c.newRequest(setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie(cookie) +} + +func (c *Conn) SetClipRectanglesChecked(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.newCookie(true, false) + c.newRequest(setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie(cookie) +} + +// Write request to wire for SetClipRectangles +func setClipRectanglesRequest(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { + size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -8523,13 +9520,28 @@ func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYO b += RectangleListBytes(buf[b:], Rectangles) - c.sendRequest(false, buf) + return buf } // Request FreeGC // size: 8 +type FreeGCCookie cookie + // Write request to wire for FreeGC -func (c *Conn) FreeGC(Gc Id) { +func (c *Conn) FreeGC(Gc Id) FreeGCCookie { + cookie := c.newCookie(false, false) + c.newRequest(freeGCRequest(Gc), cookie) + return FreeGCCookie(cookie) +} + +func (c *Conn) FreeGCChecked(Gc Id) FreeGCCookie { + cookie := c.newCookie(true, false) + c.newRequest(freeGCRequest(Gc), cookie) + return FreeGCCookie(cookie) +} + +// Write request to wire for FreeGC +func freeGCRequest(Gc Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8545,13 +9557,28 @@ func (c *Conn) FreeGC(Gc Id) { Put32(buf[b:], uint32(Gc)) b += 4 - c.sendRequest(false, buf) + return buf } // Request ClearArea // size: 16 +type ClearAreaCookie cookie + // Write request to wire for ClearArea -func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) { +func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.newCookie(false, false) + c.newRequest(clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie(cookie) +} + +func (c *Conn) ClearAreaChecked(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.newCookie(true, false) + c.newRequest(clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie(cookie) +} + +// Write request to wire for ClearArea +func clearAreaRequest(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8584,13 +9611,28 @@ func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint Put16(buf[b:], Height) b += 2 - c.sendRequest(false, buf) + return buf } // Request CopyArea // size: 28 +type CopyAreaCookie cookie + // Write request to wire for CopyArea -func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) { +func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.newCookie(false, false) + c.newRequest(copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie(cookie) +} + +func (c *Conn) CopyAreaChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.newCookie(true, false) + c.newRequest(copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie(cookie) +} + +// Write request to wire for CopyArea +func copyAreaRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -8630,13 +9672,28 @@ func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY Put16(buf[b:], Height) b += 2 - c.sendRequest(false, buf) + return buf } // Request CopyPlane // size: 32 +type CopyPlaneCookie cookie + // Write request to wire for CopyPlane -func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) { +func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.newCookie(false, false) + c.newRequest(copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie(cookie) +} + +func (c *Conn) CopyPlaneChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.newCookie(true, false) + c.newRequest(copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie(cookie) +} + +// Write request to wire for CopyPlane +func copyPlaneRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -8679,14 +9736,29 @@ func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY Put32(buf[b:], BitPlane) b += 4 - c.sendRequest(false, buf) + return buf } // Request PolyPoint -// size: (12 + pad((len(Points) * 4))) +// size: pad((12 + pad((len(Points) * 4)))) +type PolyPointCookie cookie + // Write request to wire for PolyPoint -func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) { - size := (12 + pad((len(Points) * 4))) +func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie(cookie) +} + +func (c *Conn) PolyPointChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie(cookie) +} + +// Write request to wire for PolyPoint +func polyPointRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { + size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -8707,14 +9779,29 @@ func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point b += PointListBytes(buf[b:], Points) - c.sendRequest(false, buf) + return buf } // Request PolyLine -// size: (12 + pad((len(Points) * 4))) +// size: pad((12 + pad((len(Points) * 4)))) +type PolyLineCookie cookie + // Write request to wire for PolyLine -func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) { - size := (12 + pad((len(Points) * 4))) +func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie(cookie) +} + +func (c *Conn) PolyLineChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie(cookie) +} + +// Write request to wire for PolyLine +func polyLineRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { + size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -8735,14 +9822,29 @@ func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) b += PointListBytes(buf[b:], Points) - c.sendRequest(false, buf) + return buf } // Request PolySegment -// size: (12 + pad((len(Segments) * 8))) +// size: pad((12 + pad((len(Segments) * 8)))) +type PolySegmentCookie cookie + // Write request to wire for PolySegment -func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) { - size := (12 + pad((len(Segments) * 8))) +func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { + cookie := c.newCookie(false, false) + c.newRequest(polySegmentRequest(Drawable, Gc, Segments), cookie) + return PolySegmentCookie(cookie) +} + +func (c *Conn) PolySegmentChecked(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { + cookie := c.newCookie(true, false) + c.newRequest(polySegmentRequest(Drawable, Gc, Segments), cookie) + return PolySegmentCookie(cookie) +} + +// Write request to wire for PolySegment +func polySegmentRequest(Drawable Id, Gc Id, Segments []Segment) []byte { + size := pad((12 + pad((len(Segments) * 8)))) b := 0 buf := make([]byte, size) @@ -8762,14 +9864,29 @@ func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) { b += SegmentListBytes(buf[b:], Segments) - c.sendRequest(false, buf) + return buf } // Request PolyRectangle -// size: (12 + pad((len(Rectangles) * 8))) +// size: pad((12 + pad((len(Rectangles) * 8)))) +type PolyRectangleCookie cookie + // Write request to wire for PolyRectangle -func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { - size := (12 + pad((len(Rectangles) * 8))) +func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie(cookie) +} + +func (c *Conn) PolyRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie(cookie) +} + +// Write request to wire for PolyRectangle +func polyRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { + size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -8789,14 +9906,29 @@ func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { b += RectangleListBytes(buf[b:], Rectangles) - c.sendRequest(false, buf) + return buf } // Request PolyArc -// size: (12 + pad((len(Arcs) * 12))) +// size: pad((12 + pad((len(Arcs) * 12)))) +type PolyArcCookie cookie + // Write request to wire for PolyArc -func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) { - size := (12 + pad((len(Arcs) * 12))) +func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyArcRequest(Drawable, Gc, Arcs), cookie) + return PolyArcCookie(cookie) +} + +func (c *Conn) PolyArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyArcRequest(Drawable, Gc, Arcs), cookie) + return PolyArcCookie(cookie) +} + +// Write request to wire for PolyArc +func polyArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { + size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -8816,14 +9948,29 @@ func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) { b += ArcListBytes(buf[b:], Arcs) - c.sendRequest(false, buf) + return buf } // Request FillPoly -// size: (16 + pad((len(Points) * 4))) +// size: pad((16 + pad((len(Points) * 4)))) +type FillPolyCookie cookie + // Write request to wire for FillPoly -func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) { - size := (16 + pad((len(Points) * 4))) +func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.newCookie(false, false) + c.newRequest(fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie(cookie) +} + +func (c *Conn) FillPolyChecked(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.newCookie(true, false) + c.newRequest(fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie(cookie) +} + +// Write request to wire for FillPoly +func fillPolyRequest(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) []byte { + size := pad((16 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -8851,14 +9998,29 @@ func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Poi b += PointListBytes(buf[b:], Points) - c.sendRequest(false, buf) + return buf } // Request PolyFillRectangle -// size: (12 + pad((len(Rectangles) * 8))) +// size: pad((12 + pad((len(Rectangles) * 8)))) +type PolyFillRectangleCookie cookie + // Write request to wire for PolyFillRectangle -func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { - size := (12 + pad((len(Rectangles) * 8))) +func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie(cookie) +} + +func (c *Conn) PolyFillRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie(cookie) +} + +// Write request to wire for PolyFillRectangle +func polyFillRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { + size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -8878,14 +10040,29 @@ func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) { b += RectangleListBytes(buf[b:], Rectangles) - c.sendRequest(false, buf) + return buf } // Request PolyFillArc -// size: (12 + pad((len(Arcs) * 12))) +// size: pad((12 + pad((len(Arcs) * 12)))) +type PolyFillArcCookie cookie + // Write request to wire for PolyFillArc -func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) { - size := (12 + pad((len(Arcs) * 12))) +func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { + cookie := c.newCookie(false, false) + c.newRequest(polyFillArcRequest(Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie(cookie) +} + +func (c *Conn) PolyFillArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { + cookie := c.newCookie(true, false) + c.newRequest(polyFillArcRequest(Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie(cookie) +} + +// Write request to wire for PolyFillArc +func polyFillArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { + size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -8905,14 +10082,29 @@ func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) { b += ArcListBytes(buf[b:], Arcs) - c.sendRequest(false, buf) + return buf } // Request PutImage -// size: (24 + pad((len(Data) * 1))) +// size: pad((24 + pad((len(Data) * 1)))) +type PutImageCookie cookie + // Write request to wire for PutImage -func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) { - size := (24 + pad((len(Data) * 1))) +func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.newCookie(false, false) + c.newRequest(putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie(cookie) +} + +func (c *Conn) PutImageChecked(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.newCookie(true, false) + c.newRequest(putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie(cookie) +} + +// Write request to wire for PutImage +func putImageRequest(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { + size := pad((24 + pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -8954,17 +10146,73 @@ func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height ui copy(buf[b:], Data[:len(Data)]) b += pad(int(len(Data))) - c.sendRequest(false, buf) + return buf } // Request GetImage // size: 20 -func (c *Conn) GetImage(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) (*GetImageReply, error) { - return c.GetImageReply(c.GetImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask)) +type GetImageCookie cookie + +func (c *Conn) GetImage(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.newCookie(true, true) + c.newRequest(getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie(cookie) +} + +func (c *Conn) GetImageUnchecked(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.newCookie(false, true) + c.newRequest(getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie(cookie) +} + +// Request reply for GetImage +// size: (32 + pad(((int(Length) * 4) * 1))) +type GetImageReply struct { + Sequence uint16 + Length uint32 + Depth byte + Visual Visualid + // padding: 20 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetImage +func (cook GetImageCookie) Reply() (*GetImageReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return getImageReply(buf), nil +} + +// Read reply into structure from buffer for GetImage +func getImageReply(buf []byte) *GetImageReply { + v := new(GetImageReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v } // Write request to wire for GetImage -func (c *Conn) GetImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) *Cookie { +func getImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -8996,56 +10244,29 @@ func (c *Conn) GetImageRequest(Format byte, Drawable Id, X int16, Y int16, Width Put32(buf[b:], PlaneMask) b += 4 - return c.sendRequest(true, buf) -} - -// Request reply for GetImage -// size: (32 + pad(((int(Length) * 4) * 1))) -type GetImageReply struct { - Sequence uint16 - Length uint32 - Depth byte - Visual Visualid - // padding: 20 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Read reply GetImage -func (c *Conn) GetImageReply(cook *Cookie) (*GetImageReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(GetImageReply) - b := 1 // skip reply determinant - - v.Depth = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Visual = Visualid(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v, nil + return buf } // Request PolyText8 -// size: (16 + pad((len(Items) * 1))) +// size: pad((16 + pad((len(Items) * 1)))) +type PolyText8Cookie cookie + // Write request to wire for PolyText8 -func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { - size := (16 + pad((len(Items) * 1))) +func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.newCookie(false, false) + c.newRequest(polyText8Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie(cookie) +} + +func (c *Conn) PolyText8Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.newCookie(true, false) + c.newRequest(polyText8Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie(cookie) +} + +// Write request to wire for PolyText8 +func polyText8Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { + size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -9072,14 +10293,29 @@ func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { copy(buf[b:], Items[:len(Items)]) b += pad(int(len(Items))) - c.sendRequest(false, buf) + return buf } // Request PolyText16 -// size: (16 + pad((len(Items) * 1))) +// size: pad((16 + pad((len(Items) * 1)))) +type PolyText16Cookie cookie + // Write request to wire for PolyText16 -func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { - size := (16 + pad((len(Items) * 1))) +func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.newCookie(false, false) + c.newRequest(polyText16Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie(cookie) +} + +func (c *Conn) PolyText16Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.newCookie(true, false) + c.newRequest(polyText16Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie(cookie) +} + +// Write request to wire for PolyText16 +func polyText16Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { + size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -9106,14 +10342,29 @@ func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) { copy(buf[b:], Items[:len(Items)]) b += pad(int(len(Items))) - c.sendRequest(false, buf) + return buf } // Request ImageText8 -// size: (16 + pad((int(StringLen) * 1))) +// size: pad((16 + pad((int(StringLen) * 1)))) +type ImageText8Cookie cookie + // Write request to wire for ImageText8 -func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) { - size := (16 + pad((int(StringLen) * 1))) +func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.newCookie(false, false) + c.newRequest(imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie(cookie) +} + +func (c *Conn) ImageText8Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.newCookie(true, false) + c.newRequest(imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie(cookie) +} + +// Write request to wire for ImageText8 +func imageText8Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) []byte { + size := pad((16 + pad((int(StringLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9141,14 +10392,29 @@ func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, copy(buf[b:], String[:StringLen]) b += pad(int(StringLen)) - c.sendRequest(false, buf) + return buf } // Request ImageText16 -// size: (16 + pad((int(StringLen) * 2))) +// size: pad((16 + pad((int(StringLen) * 2)))) +type ImageText16Cookie cookie + // Write request to wire for ImageText16 -func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) { - size := (16 + pad((int(StringLen) * 2))) +func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { + cookie := c.newCookie(false, false) + c.newRequest(imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie(cookie) +} + +func (c *Conn) ImageText16Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { + cookie := c.newCookie(true, false) + c.newRequest(imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie(cookie) +} + +// Write request to wire for ImageText16 +func imageText16Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) []byte { + size := pad((16 + pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) @@ -9175,13 +10441,28 @@ func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, b += Char2bListBytes(buf[b:], String) - c.sendRequest(false, buf) + return buf } // Request CreateColormap // size: 16 +type CreateColormapCookie cookie + // Write request to wire for CreateColormap -func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) { +func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { + cookie := c.newCookie(false, false) + c.newRequest(createColormapRequest(Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie(cookie) +} + +func (c *Conn) CreateColormapChecked(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { + cookie := c.newCookie(true, false) + c.newRequest(createColormapRequest(Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie(cookie) +} + +// Write request to wire for CreateColormap +func createColormapRequest(Alloc byte, Mid Id, Window Id, Visual Visualid) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9204,13 +10485,28 @@ func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) { Put32(buf[b:], uint32(Visual)) b += 4 - c.sendRequest(false, buf) + return buf } // Request FreeColormap // size: 8 +type FreeColormapCookie cookie + // Write request to wire for FreeColormap -func (c *Conn) FreeColormap(Cmap Id) { +func (c *Conn) FreeColormap(Cmap Id) FreeColormapCookie { + cookie := c.newCookie(false, false) + c.newRequest(freeColormapRequest(Cmap), cookie) + return FreeColormapCookie(cookie) +} + +func (c *Conn) FreeColormapChecked(Cmap Id) FreeColormapCookie { + cookie := c.newCookie(true, false) + c.newRequest(freeColormapRequest(Cmap), cookie) + return FreeColormapCookie(cookie) +} + +// Write request to wire for FreeColormap +func freeColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9226,13 +10522,28 @@ func (c *Conn) FreeColormap(Cmap Id) { Put32(buf[b:], uint32(Cmap)) b += 4 - c.sendRequest(false, buf) + return buf } // Request CopyColormapAndFree // size: 12 +type CopyColormapAndFreeCookie cookie + // Write request to wire for CopyColormapAndFree -func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) { +func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { + cookie := c.newCookie(false, false) + c.newRequest(copyColormapAndFreeRequest(Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie(cookie) +} + +func (c *Conn) CopyColormapAndFreeChecked(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { + cookie := c.newCookie(true, false) + c.newRequest(copyColormapAndFreeRequest(Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie(cookie) +} + +// Write request to wire for CopyColormapAndFree +func copyColormapAndFreeRequest(Mid Id, SrcCmap Id) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -9251,13 +10562,28 @@ func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) { Put32(buf[b:], uint32(SrcCmap)) b += 4 - c.sendRequest(false, buf) + return buf } // Request InstallColormap // size: 8 +type InstallColormapCookie cookie + // Write request to wire for InstallColormap -func (c *Conn) InstallColormap(Cmap Id) { +func (c *Conn) InstallColormap(Cmap Id) InstallColormapCookie { + cookie := c.newCookie(false, false) + c.newRequest(installColormapRequest(Cmap), cookie) + return InstallColormapCookie(cookie) +} + +func (c *Conn) InstallColormapChecked(Cmap Id) InstallColormapCookie { + cookie := c.newCookie(true, false) + c.newRequest(installColormapRequest(Cmap), cookie) + return InstallColormapCookie(cookie) +} + +// Write request to wire for InstallColormap +func installColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9273,13 +10599,28 @@ func (c *Conn) InstallColormap(Cmap Id) { Put32(buf[b:], uint32(Cmap)) b += 4 - c.sendRequest(false, buf) + return buf } // Request UninstallColormap // size: 8 +type UninstallColormapCookie cookie + // Write request to wire for UninstallColormap -func (c *Conn) UninstallColormap(Cmap Id) { +func (c *Conn) UninstallColormap(Cmap Id) UninstallColormapCookie { + cookie := c.newCookie(false, false) + c.newRequest(uninstallColormapRequest(Cmap), cookie) + return UninstallColormapCookie(cookie) +} + +func (c *Conn) UninstallColormapChecked(Cmap Id) UninstallColormapCookie { + cookie := c.newCookie(true, false) + c.newRequest(uninstallColormapRequest(Cmap), cookie) + return UninstallColormapCookie(cookie) +} + +// Write request to wire for UninstallColormap +func uninstallColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9295,33 +10636,23 @@ func (c *Conn) UninstallColormap(Cmap Id) { Put32(buf[b:], uint32(Cmap)) b += 4 - c.sendRequest(false, buf) + return buf } // Request ListInstalledColormaps // size: 8 -func (c *Conn) ListInstalledColormaps(Window Id) (*ListInstalledColormapsReply, error) { - return c.ListInstalledColormapsReply(c.ListInstalledColormapsRequest(Window)) +type ListInstalledColormapsCookie cookie + +func (c *Conn) ListInstalledColormaps(Window Id) ListInstalledColormapsCookie { + cookie := c.newCookie(true, true) + c.newRequest(listInstalledColormapsRequest(Window), cookie) + return ListInstalledColormapsCookie(cookie) } -// Write request to wire for ListInstalledColormaps -func (c *Conn) ListInstalledColormapsRequest(Window Id) *Cookie { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 83 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return c.sendRequest(true, buf) +func (c *Conn) ListInstalledColormapsUnchecked(Window Id) ListInstalledColormapsCookie { + cookie := c.newCookie(false, true) + c.newRequest(listInstalledColormapsRequest(Window), cookie) + return ListInstalledColormapsCookie(cookie) } // Request reply for ListInstalledColormaps @@ -9335,13 +10666,17 @@ type ListInstalledColormapsReply struct { Cmaps []Id // size: pad((int(CmapsLen) * 4)) } -// Read reply ListInstalledColormaps -func (c *Conn) ListInstalledColormapsReply(cook *Cookie) (*ListInstalledColormapsReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request ListInstalledColormaps +func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return listInstalledColormapsReply(buf), nil +} +// Read reply into structure from buffer for ListInstalledColormaps +func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { v := new(ListInstalledColormapsReply) b := 1 // skip reply determinant @@ -9365,17 +10700,99 @@ func (c *Conn) ListInstalledColormapsReply(cook *Cookie) (*ListInstalledColormap } b = pad(b) - return v, nil + return v +} + +// Write request to wire for ListInstalledColormaps +func listInstalledColormapsRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 83 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } // Request AllocColor // size: 16 -func (c *Conn) AllocColor(Cmap Id, Red uint16, Green uint16, Blue uint16) (*AllocColorReply, error) { - return c.AllocColorReply(c.AllocColorRequest(Cmap, Red, Green, Blue)) +type AllocColorCookie cookie + +func (c *Conn) AllocColor(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.newCookie(true, true) + c.newRequest(allocColorRequest(Cmap, Red, Green, Blue), cookie) + return AllocColorCookie(cookie) +} + +func (c *Conn) AllocColorUnchecked(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.newCookie(false, true) + c.newRequest(allocColorRequest(Cmap, Red, Green, Blue), cookie) + return AllocColorCookie(cookie) +} + +// Request reply for AllocColor +// size: 20 +type AllocColorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Red uint16 + Green uint16 + Blue uint16 + // padding: 2 bytes + Pixel uint32 +} + +// Waits and reads reply data from request AllocColor +func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return allocColorReply(buf), nil +} + +// Read reply into structure from buffer for AllocColor +func allocColorReply(buf []byte) *AllocColorReply { + v := new(AllocColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Pixel = Get32(buf[b:]) + b += 4 + + return v } // Write request to wire for AllocColor -func (c *Conn) AllocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) *Cookie { +func allocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9402,89 +10819,23 @@ func (c *Conn) AllocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) b += 2 // padding - return c.sendRequest(true, buf) -} - -// Request reply for AllocColor -// size: 20 -type AllocColorReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Red uint16 - Green uint16 - Blue uint16 - // padding: 2 bytes - Pixel uint32 -} - -// Read reply AllocColor -func (c *Conn) AllocColorReply(cook *Cookie) (*AllocColorReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(AllocColorReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Red = Get16(buf[b:]) - b += 2 - - v.Green = Get16(buf[b:]) - b += 2 - - v.Blue = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Pixel = Get32(buf[b:]) - b += 4 - - return v, nil + return buf } // Request AllocNamedColor -// size: (12 + pad((int(NameLen) * 1))) -func (c *Conn) AllocNamedColor(Cmap Id, NameLen uint16, Name string) (*AllocNamedColorReply, error) { - return c.AllocNamedColorReply(c.AllocNamedColorRequest(Cmap, NameLen, Name)) +// size: pad((12 + pad((int(NameLen) * 1)))) +type AllocNamedColorCookie cookie + +func (c *Conn) AllocNamedColor(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.newCookie(true, true) + c.newRequest(allocNamedColorRequest(Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie(cookie) } -// Write request to wire for AllocNamedColor -func (c *Conn) AllocNamedColorRequest(Cmap Id, NameLen uint16, Name string) *Cookie { - size := (12 + pad((int(NameLen) * 1))) - b := 0 - buf := make([]byte, size) - - buf[b] = 85 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cmap)) - b += 4 - - Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) - - return c.sendRequest(true, buf) +func (c *Conn) AllocNamedColorUnchecked(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.newCookie(false, true) + c.newRequest(allocNamedColorRequest(Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie(cookie) } // Request reply for AllocNamedColor @@ -9502,13 +10853,17 @@ type AllocNamedColorReply struct { VisualBlue uint16 } -// Read reply AllocNamedColor -func (c *Conn) AllocNamedColorReply(cook *Cookie) (*AllocNamedColorReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request AllocNamedColor +func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return allocNamedColorReply(buf), nil +} +// Read reply into structure from buffer for AllocNamedColor +func allocNamedColorReply(buf []byte) *AllocNamedColorReply { v := new(AllocNamedColorReply) b := 1 // skip reply determinant @@ -9541,30 +10896,19 @@ func (c *Conn) AllocNamedColorReply(cook *Cookie) (*AllocNamedColorReply, error) v.VisualBlue = Get16(buf[b:]) b += 2 - return v, nil + return v } -// Request AllocColorCells -// size: 12 -func (c *Conn) AllocColorCells(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) (*AllocColorCellsReply, error) { - return c.AllocColorCellsReply(c.AllocColorCellsRequest(Contiguous, Cmap, Colors, Planes)) -} - -// Write request to wire for AllocColorCells -func (c *Conn) AllocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) *Cookie { - size := 12 +// Write request to wire for AllocNamedColor +func allocNamedColorRequest(Cmap Id, NameLen uint16, Name string) []byte { + size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) - buf[b] = 86 // request opcode + buf[b] = 85 // request opcode b += 1 - if Contiguous { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 + b += 1 // padding Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 @@ -9572,13 +10916,31 @@ func (c *Conn) AllocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, P Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], Colors) + Put16(buf[b:], NameLen) b += 2 - Put16(buf[b:], Planes) - b += 2 + b += 2 // padding - return c.sendRequest(true, buf) + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return buf +} + +// Request AllocColorCells +// size: 12 +type AllocColorCellsCookie cookie + +func (c *Conn) AllocColorCells(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.newCookie(true, true) + c.newRequest(allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie(cookie) +} + +func (c *Conn) AllocColorCellsUnchecked(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.newCookie(false, true) + c.newRequest(allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie(cookie) } // Request reply for AllocColorCells @@ -9594,13 +10956,17 @@ type AllocColorCellsReply struct { Masks []uint32 // size: pad((int(MasksLen) * 4)) } -// Read reply AllocColorCells -func (c *Conn) AllocColorCellsReply(cook *Cookie) (*AllocColorCellsReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request AllocColorCells +func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return allocColorCellsReply(buf), nil +} +// Read reply into structure from buffer for AllocColorCells +func allocColorCellsReply(buf []byte) *AllocColorCellsReply { v := new(AllocColorCellsReply) b := 1 // skip reply determinant @@ -9634,22 +11000,16 @@ func (c *Conn) AllocColorCellsReply(cook *Cookie) (*AllocColorCellsReply, error) } b = pad(b) - return v, nil + return v } -// Request AllocColorPlanes -// size: 16 -func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) (*AllocColorPlanesReply, error) { - return c.AllocColorPlanesReply(c.AllocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues)) -} - -// Write request to wire for AllocColorPlanes -func (c *Conn) AllocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) *Cookie { - size := 16 +// Write request to wire for AllocColorCells +func allocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) []byte { + size := 12 b := 0 buf := make([]byte, size) - buf[b] = 87 // request opcode + buf[b] = 86 // request opcode b += 1 if Contiguous { @@ -9668,16 +11028,26 @@ func (c *Conn) AllocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Put16(buf[b:], Colors) b += 2 - Put16(buf[b:], Reds) + Put16(buf[b:], Planes) b += 2 - Put16(buf[b:], Greens) - b += 2 + return buf +} - Put16(buf[b:], Blues) - b += 2 +// Request AllocColorPlanes +// size: 16 +type AllocColorPlanesCookie cookie - return c.sendRequest(true, buf) +func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.newCookie(true, true) + c.newRequest(allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie(cookie) +} + +func (c *Conn) AllocColorPlanesUnchecked(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.newCookie(false, true) + c.newRequest(allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie(cookie) } // Request reply for AllocColorPlanes @@ -9695,13 +11065,17 @@ type AllocColorPlanesReply struct { Pixels []uint32 // size: pad((int(PixelsLen) * 4)) } -// Read reply AllocColorPlanes -func (c *Conn) AllocColorPlanesReply(cook *Cookie) (*AllocColorPlanesReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request AllocColorPlanes +func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return allocColorPlanesReply(buf), nil +} +// Read reply into structure from buffer for AllocColorPlanes +func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { v := new(AllocColorPlanesReply) b := 1 // skip reply determinant @@ -9736,14 +11110,66 @@ func (c *Conn) AllocColorPlanesReply(cook *Cookie) (*AllocColorPlanesReply, erro } b = pad(b) - return v, nil + return v +} + +// Write request to wire for AllocColorPlanes +func allocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 87 // request opcode + b += 1 + + if Contiguous { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], Colors) + b += 2 + + Put16(buf[b:], Reds) + b += 2 + + Put16(buf[b:], Greens) + b += 2 + + Put16(buf[b:], Blues) + b += 2 + + return buf } // Request FreeColors -// size: (12 + pad((len(Pixels) * 4))) +// size: pad((12 + pad((len(Pixels) * 4)))) +type FreeColorsCookie cookie + // Write request to wire for FreeColors -func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) { - size := (12 + pad((len(Pixels) * 4))) +func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.newCookie(false, false) + c.newRequest(freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie(cookie) +} + +func (c *Conn) FreeColorsChecked(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.newCookie(true, false) + c.newRequest(freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie(cookie) +} + +// Write request to wire for FreeColors +func freeColorsRequest(Cmap Id, PlaneMask uint32, Pixels []uint32) []byte { + size := pad((12 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -9767,14 +11193,29 @@ func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) { } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request StoreColors -// size: (8 + pad((len(Items) * 12))) +// size: pad((8 + pad((len(Items) * 12)))) +type StoreColorsCookie cookie + // Write request to wire for StoreColors -func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) { - size := (8 + pad((len(Items) * 12))) +func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) StoreColorsCookie { + cookie := c.newCookie(false, false) + c.newRequest(storeColorsRequest(Cmap, Items), cookie) + return StoreColorsCookie(cookie) +} + +func (c *Conn) StoreColorsChecked(Cmap Id, Items []Coloritem) StoreColorsCookie { + cookie := c.newCookie(true, false) + c.newRequest(storeColorsRequest(Cmap, Items), cookie) + return StoreColorsCookie(cookie) +} + +// Write request to wire for StoreColors +func storeColorsRequest(Cmap Id, Items []Coloritem) []byte { + size := pad((8 + pad((len(Items) * 12)))) b := 0 buf := make([]byte, size) @@ -9791,14 +11232,29 @@ func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) { b += ColoritemListBytes(buf[b:], Items) - c.sendRequest(false, buf) + return buf } // Request StoreNamedColor -// size: (16 + pad((int(NameLen) * 1))) +// size: pad((16 + pad((int(NameLen) * 1)))) +type StoreNamedColorCookie cookie + // Write request to wire for StoreNamedColor -func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) { - size := (16 + pad((int(NameLen) * 1))) +func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { + cookie := c.newCookie(false, false) + c.newRequest(storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) + return StoreNamedColorCookie(cookie) +} + +func (c *Conn) StoreNamedColorChecked(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { + cookie := c.newCookie(true, false) + c.newRequest(storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) + return StoreNamedColorCookie(cookie) +} + +// Write request to wire for StoreNamedColor +func storeNamedColorRequest(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) []byte { + size := pad((16 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9825,18 +11281,72 @@ func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16 copy(buf[b:], Name[:NameLen]) b += pad(int(NameLen)) - c.sendRequest(false, buf) + return buf } // Request QueryColors -// size: (8 + pad((len(Pixels) * 4))) -func (c *Conn) QueryColors(Cmap Id, Pixels []uint32) (*QueryColorsReply, error) { - return c.QueryColorsReply(c.QueryColorsRequest(Cmap, Pixels)) +// size: pad((8 + pad((len(Pixels) * 4)))) +type QueryColorsCookie cookie + +func (c *Conn) QueryColors(Cmap Id, Pixels []uint32) QueryColorsCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryColorsRequest(Cmap, Pixels), cookie) + return QueryColorsCookie(cookie) +} + +func (c *Conn) QueryColorsUnchecked(Cmap Id, Pixels []uint32) QueryColorsCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryColorsRequest(Cmap, Pixels), cookie) + return QueryColorsCookie(cookie) +} + +// Request reply for QueryColors +// size: (32 + pad((int(ColorsLen) * 8))) +type QueryColorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ColorsLen uint16 + // padding: 22 bytes + Colors []Rgb // size: pad((int(ColorsLen) * 8)) +} + +// Waits and reads reply data from request QueryColors +func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return queryColorsReply(buf), nil +} + +// Read reply into structure from buffer for QueryColors +func queryColorsReply(buf []byte) *QueryColorsReply { + v := new(QueryColorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ColorsLen = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Colors = make([]Rgb, v.ColorsLen) + b += ReadRgbList(buf[b:], v.Colors) + + return v } // Write request to wire for QueryColors -func (c *Conn) QueryColorsRequest(Cmap Id, Pixels []uint32) *Cookie { - size := (8 + pad((len(Pixels) * 4))) +func queryColorsRequest(Cmap Id, Pixels []uint32) []byte { + size := pad((8 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -9857,81 +11367,23 @@ func (c *Conn) QueryColorsRequest(Cmap Id, Pixels []uint32) *Cookie { } b = pad(b) - return c.sendRequest(true, buf) -} - -// Request reply for QueryColors -// size: (32 + pad((int(ColorsLen) * 8))) -type QueryColorsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ColorsLen uint16 - // padding: 22 bytes - Colors []Rgb // size: pad((int(ColorsLen) * 8)) -} - -// Read reply QueryColors -func (c *Conn) QueryColorsReply(cook *Cookie) (*QueryColorsReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(QueryColorsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ColorsLen = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Colors = make([]Rgb, v.ColorsLen) - b += ReadRgbList(buf[b:], v.Colors) - - return v, nil + return buf } // Request LookupColor -// size: (12 + pad((int(NameLen) * 1))) -func (c *Conn) LookupColor(Cmap Id, NameLen uint16, Name string) (*LookupColorReply, error) { - return c.LookupColorReply(c.LookupColorRequest(Cmap, NameLen, Name)) +// size: pad((12 + pad((int(NameLen) * 1)))) +type LookupColorCookie cookie + +func (c *Conn) LookupColor(Cmap Id, NameLen uint16, Name string) LookupColorCookie { + cookie := c.newCookie(true, true) + c.newRequest(lookupColorRequest(Cmap, NameLen, Name), cookie) + return LookupColorCookie(cookie) } -// Write request to wire for LookupColor -func (c *Conn) LookupColorRequest(Cmap Id, NameLen uint16, Name string) *Cookie { - size := (12 + pad((int(NameLen) * 1))) - b := 0 - buf := make([]byte, size) - - buf[b] = 92 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cmap)) - b += 4 - - Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) - - return c.sendRequest(true, buf) +func (c *Conn) LookupColorUnchecked(Cmap Id, NameLen uint16, Name string) LookupColorCookie { + cookie := c.newCookie(false, true) + c.newRequest(lookupColorRequest(Cmap, NameLen, Name), cookie) + return LookupColorCookie(cookie) } // Request reply for LookupColor @@ -9948,13 +11400,17 @@ type LookupColorReply struct { VisualBlue uint16 } -// Read reply LookupColor -func (c *Conn) LookupColorReply(cook *Cookie) (*LookupColorReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request LookupColor +func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return lookupColorReply(buf), nil +} +// Read reply into structure from buffer for LookupColor +func lookupColorReply(buf []byte) *LookupColorReply { v := new(LookupColorReply) b := 1 // skip reply determinant @@ -9984,13 +11440,56 @@ func (c *Conn) LookupColorReply(cook *Cookie) (*LookupColorReply, error) { v.VisualBlue = Get16(buf[b:]) b += 2 - return v, nil + return v +} + +// Write request to wire for LookupColor +func lookupColorRequest(Cmap Id, NameLen uint16, Name string) []byte { + size := pad((12 + pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 92 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cmap)) + b += 4 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return buf } // Request CreateCursor // size: 32 +type CreateCursorCookie cookie + // Write request to wire for CreateCursor -func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) { +func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie(cookie) +} + +func (c *Conn) CreateCursorChecked(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie(cookie) +} + +// Write request to wire for CreateCursor +func createCursorRequest(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -10036,13 +11535,28 @@ func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGree Put16(buf[b:], Y) b += 2 - c.sendRequest(false, buf) + return buf } // Request CreateGlyphCursor // size: 32 +type CreateGlyphCursorCookie cookie + // Write request to wire for CreateGlyphCursor -func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) { +func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie(cookie) +} + +func (c *Conn) CreateGlyphCursorChecked(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie(cookie) +} + +// Write request to wire for CreateGlyphCursor +func createGlyphCursorRequest(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -10088,13 +11602,28 @@ func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar Put16(buf[b:], BackBlue) b += 2 - c.sendRequest(false, buf) + return buf } // Request FreeCursor // size: 8 +type FreeCursorCookie cookie + // Write request to wire for FreeCursor -func (c *Conn) FreeCursor(Cursor Id) { +func (c *Conn) FreeCursor(Cursor Id) FreeCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(freeCursorRequest(Cursor), cookie) + return FreeCursorCookie(cookie) +} + +func (c *Conn) FreeCursorChecked(Cursor Id) FreeCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(freeCursorRequest(Cursor), cookie) + return FreeCursorCookie(cookie) +} + +// Write request to wire for FreeCursor +func freeCursorRequest(Cursor Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10110,13 +11639,28 @@ func (c *Conn) FreeCursor(Cursor Id) { Put32(buf[b:], uint32(Cursor)) b += 4 - c.sendRequest(false, buf) + return buf } // Request RecolorCursor // size: 20 +type RecolorCursorCookie cookie + // Write request to wire for RecolorCursor -func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) { +func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie(cookie) +} + +func (c *Conn) RecolorCursorChecked(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie(cookie) +} + +// Write request to wire for RecolorCursor +func recolorCursorRequest(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -10150,17 +11694,68 @@ func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBl Put16(buf[b:], BackBlue) b += 2 - c.sendRequest(false, buf) + return buf } // Request QueryBestSize // size: 12 -func (c *Conn) QueryBestSize(Class byte, Drawable Id, Width uint16, Height uint16) (*QueryBestSizeReply, error) { - return c.QueryBestSizeReply(c.QueryBestSizeRequest(Class, Drawable, Width, Height)) +type QueryBestSizeCookie cookie + +func (c *Conn) QueryBestSize(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryBestSizeRequest(Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie(cookie) +} + +func (c *Conn) QueryBestSizeUnchecked(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryBestSizeRequest(Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie(cookie) +} + +// Request reply for QueryBestSize +// size: 12 +type QueryBestSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint16 + Height uint16 +} + +// Waits and reads reply data from request QueryBestSize +func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return queryBestSizeReply(buf), nil +} + +// Read reply into structure from buffer for QueryBestSize +func queryBestSizeReply(buf []byte) *QueryBestSizeReply { + v := new(QueryBestSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return v } // Write request to wire for QueryBestSize -func (c *Conn) QueryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) *Cookie { +func queryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -10183,75 +11778,23 @@ func (c *Conn) QueryBestSizeRequest(Class byte, Drawable Id, Width uint16, Heigh Put16(buf[b:], Height) b += 2 - return c.sendRequest(true, buf) -} - -// Request reply for QueryBestSize -// size: 12 -type QueryBestSizeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Width uint16 - Height uint16 -} - -// Read reply QueryBestSize -func (c *Conn) QueryBestSizeReply(cook *Cookie) (*QueryBestSizeReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(QueryBestSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - return v, nil + return buf } // Request QueryExtension -// size: (8 + pad((int(NameLen) * 1))) -func (c *Conn) QueryExtension(NameLen uint16, Name string) (*QueryExtensionReply, error) { - return c.QueryExtensionReply(c.QueryExtensionRequest(NameLen, Name)) +// size: pad((8 + pad((int(NameLen) * 1)))) +type QueryExtensionCookie cookie + +func (c *Conn) QueryExtension(NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.newCookie(true, true) + c.newRequest(queryExtensionRequest(NameLen, Name), cookie) + return QueryExtensionCookie(cookie) } -// Write request to wire for QueryExtension -func (c *Conn) QueryExtensionRequest(NameLen uint16, Name string) *Cookie { - size := (8 + pad((int(NameLen) * 1))) - b := 0 - buf := make([]byte, size) - - buf[b] = 98 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) - - return c.sendRequest(true, buf) +func (c *Conn) QueryExtensionUnchecked(NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.newCookie(false, true) + c.newRequest(queryExtensionRequest(NameLen, Name), cookie) + return QueryExtensionCookie(cookie) } // Request reply for QueryExtension @@ -10266,13 +11809,17 @@ type QueryExtensionReply struct { FirstError byte } -// Read reply QueryExtension -func (c *Conn) QueryExtensionReply(cook *Cookie) (*QueryExtensionReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request QueryExtension +func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return queryExtensionReply(buf), nil +} +// Read reply into structure from buffer for QueryExtension +func queryExtensionReply(buf []byte) *QueryExtensionReply { v := new(QueryExtensionReply) b := 1 // skip reply determinant @@ -10300,25 +11847,48 @@ func (c *Conn) QueryExtensionReply(cook *Cookie) (*QueryExtensionReply, error) { v.FirstError = buf[b] b += 1 - return v, nil + return v } -// Request ListExtensions -// size: 3 -func (c *Conn) ListExtensions() (*ListExtensionsReply, error) { - return c.ListExtensionsReply(c.ListExtensionsRequest()) -} - -// Write request to wire for ListExtensions -func (c *Conn) ListExtensionsRequest() *Cookie { - size := 3 +// Write request to wire for QueryExtension +func queryExtensionRequest(NameLen uint16, Name string) []byte { + size := pad((8 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) - buf[b] = 99 // request opcode + buf[b] = 98 // request opcode b += 1 - return c.sendRequest(true, buf) + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return buf +} + +// Request ListExtensions +// size: 4 +type ListExtensionsCookie cookie + +func (c *Conn) ListExtensions() ListExtensionsCookie { + cookie := c.newCookie(true, true) + c.newRequest(listExtensionsRequest(), cookie) + return ListExtensionsCookie(cookie) +} + +func (c *Conn) ListExtensionsUnchecked() ListExtensionsCookie { + cookie := c.newCookie(false, true) + c.newRequest(listExtensionsRequest(), cookie) + return ListExtensionsCookie(cookie) } // Request reply for ListExtensions @@ -10331,13 +11901,17 @@ type ListExtensionsReply struct { Names []Str // size: StrListSize(Names) } -// Read reply ListExtensions -func (c *Conn) ListExtensionsReply(cook *Cookie) (*ListExtensionsReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request ListExtensions +func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return listExtensionsReply(buf), nil +} +// Read reply into structure from buffer for ListExtensions +func listExtensionsReply(buf []byte) *ListExtensionsReply { v := new(ListExtensionsReply) b := 1 // skip reply determinant @@ -10355,14 +11929,41 @@ func (c *Conn) ListExtensionsReply(cook *Cookie) (*ListExtensionsReply, error) { v.Names = make([]Str, v.NamesLen) b += ReadStrList(buf[b:], v.Names) - return v, nil + return v +} + +// Write request to wire for ListExtensions +func listExtensionsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 99 // request opcode + b += 1 + + return buf } // Request ChangeKeyboardMapping -// size: (8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4))) +// size: pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +type ChangeKeyboardMappingCookie cookie + // Write request to wire for ChangeKeyboardMapping -func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) { - size := (8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4))) +func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie(cookie) +} + +func (c *Conn) ChangeKeyboardMappingChecked(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie(cookie) +} + +// Write request to wire for ChangeKeyboardMapping +func changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { + size := pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 buf := make([]byte, size) @@ -10389,36 +11990,23 @@ func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, Ke } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request GetKeyboardMapping -// size: 6 -func (c *Conn) GetKeyboardMapping(FirstKeycode Keycode, Count byte) (*GetKeyboardMappingReply, error) { - return c.GetKeyboardMappingReply(c.GetKeyboardMappingRequest(FirstKeycode, Count)) +// size: 8 +type GetKeyboardMappingCookie cookie + +func (c *Conn) GetKeyboardMapping(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(getKeyboardMappingRequest(FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie(cookie) } -// Write request to wire for GetKeyboardMapping -func (c *Conn) GetKeyboardMappingRequest(FirstKeycode Keycode, Count byte) *Cookie { - size := 6 - b := 0 - buf := make([]byte, size) - - buf[b] = 101 // request opcode - b += 1 - - b += 1 // padding - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = Count - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetKeyboardMappingUnchecked(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(getKeyboardMappingRequest(FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie(cookie) } // Request reply for GetKeyboardMapping @@ -10431,13 +12019,17 @@ type GetKeyboardMappingReply struct { Keysyms []Keysym // size: pad((int(Length) * 4)) } -// Read reply GetKeyboardMapping -func (c *Conn) GetKeyboardMappingReply(cook *Cookie) (*GetKeyboardMappingReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetKeyboardMapping +func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getKeyboardMappingReply(buf), nil +} +// Read reply into structure from buffer for GetKeyboardMapping +func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { v := new(GetKeyboardMappingReply) b := 1 // skip reply determinant @@ -10459,14 +12051,52 @@ func (c *Conn) GetKeyboardMappingReply(cook *Cookie) (*GetKeyboardMappingReply, } b = pad(b) - return v, nil + return v +} + +// Write request to wire for GetKeyboardMapping +func getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 101 // request opcode + b += 1 + + b += 1 // padding + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return buf } // Request ChangeKeyboardControl -// size: (4 + (4 + pad((4 * popCount(int(ValueMask)))))) +// size: pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) +type ChangeKeyboardControlCookie cookie + // Write request to wire for ChangeKeyboardControl -func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) { - size := (4 + (4 + pad((4 * popCount(int(ValueMask)))))) +func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeKeyboardControlRequest(ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie(cookie) +} + +func (c *Conn) ChangeKeyboardControlChecked(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeKeyboardControlRequest(ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie(cookie) +} + +// Write request to wire for ChangeKeyboardControl +func changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32) []byte { + size := pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -10486,25 +12116,23 @@ func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) { } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request GetKeyboardControl -// size: 3 -func (c *Conn) GetKeyboardControl() (*GetKeyboardControlReply, error) { - return c.GetKeyboardControlReply(c.GetKeyboardControlRequest()) +// size: 4 +type GetKeyboardControlCookie cookie + +func (c *Conn) GetKeyboardControl() GetKeyboardControlCookie { + cookie := c.newCookie(true, true) + c.newRequest(getKeyboardControlRequest(), cookie) + return GetKeyboardControlCookie(cookie) } -// Write request to wire for GetKeyboardControl -func (c *Conn) GetKeyboardControlRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 103 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetKeyboardControlUnchecked() GetKeyboardControlCookie { + cookie := c.newCookie(false, true) + c.newRequest(getKeyboardControlRequest(), cookie) + return GetKeyboardControlCookie(cookie) } // Request reply for GetKeyboardControl @@ -10522,13 +12150,17 @@ type GetKeyboardControlReply struct { AutoRepeats []byte // size: pad(32) } -// Read reply GetKeyboardControl -func (c *Conn) GetKeyboardControlReply(cook *Cookie) (*GetKeyboardControlReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetKeyboardControl +func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getKeyboardControlReply(buf), nil +} +// Read reply into structure from buffer for GetKeyboardControl +func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v := new(GetKeyboardControlReply) b := 1 // skip reply determinant @@ -10562,13 +12194,40 @@ func (c *Conn) GetKeyboardControlReply(cook *Cookie) (*GetKeyboardControlReply, copy(v.AutoRepeats[:32], buf[b:]) b += pad(int(32)) - return v, nil + return v +} + +// Write request to wire for GetKeyboardControl +func getKeyboardControlRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 103 // request opcode + b += 1 + + return buf } // Request Bell // size: 4 +type BellCookie cookie + // Write request to wire for Bell -func (c *Conn) Bell(Percent int8) { +func (c *Conn) Bell(Percent int8) BellCookie { + cookie := c.newCookie(false, false) + c.newRequest(bellRequest(Percent), cookie) + return BellCookie(cookie) +} + +func (c *Conn) BellChecked(Percent int8) BellCookie { + cookie := c.newCookie(true, false) + c.newRequest(bellRequest(Percent), cookie) + return BellCookie(cookie) +} + +// Write request to wire for Bell +func bellRequest(Percent int8) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -10579,13 +12238,28 @@ func (c *Conn) Bell(Percent int8) { buf[b] = byte(Percent) b += 1 - c.sendRequest(false, buf) + return buf } // Request ChangePointerControl // size: 12 +type ChangePointerControlCookie cookie + // Write request to wire for ChangePointerControl -func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) { +func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.newCookie(false, false) + c.newRequest(changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie(cookie) +} + +func (c *Conn) ChangePointerControlChecked(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.newCookie(true, false) + c.newRequest(changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie(cookie) +} + +// Write request to wire for ChangePointerControl +func changePointerControlRequest(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -10621,25 +12295,23 @@ func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDen } b += 1 - c.sendRequest(false, buf) + return buf } // Request GetPointerControl -// size: 3 -func (c *Conn) GetPointerControl() (*GetPointerControlReply, error) { - return c.GetPointerControlReply(c.GetPointerControlRequest()) +// size: 4 +type GetPointerControlCookie cookie + +func (c *Conn) GetPointerControl() GetPointerControlCookie { + cookie := c.newCookie(true, true) + c.newRequest(getPointerControlRequest(), cookie) + return GetPointerControlCookie(cookie) } -// Write request to wire for GetPointerControl -func (c *Conn) GetPointerControlRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 106 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetPointerControlUnchecked() GetPointerControlCookie { + cookie := c.newCookie(false, true) + c.newRequest(getPointerControlRequest(), cookie) + return GetPointerControlCookie(cookie) } // Request reply for GetPointerControl @@ -10654,13 +12326,17 @@ type GetPointerControlReply struct { // padding: 18 bytes } -// Read reply GetPointerControl -func (c *Conn) GetPointerControlReply(cook *Cookie) (*GetPointerControlReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetPointerControl +func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getPointerControlReply(buf), nil +} +// Read reply into structure from buffer for GetPointerControl +func getPointerControlReply(buf []byte) *GetPointerControlReply { v := new(GetPointerControlReply) b := 1 // skip reply determinant @@ -10683,14 +12359,41 @@ func (c *Conn) GetPointerControlReply(cook *Cookie) (*GetPointerControlReply, er b += 18 // padding - return v, nil + return v +} + +// Write request to wire for GetPointerControl +func getPointerControlRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 106 // request opcode + b += 1 + + return buf } // Request SetScreenSaver -// size: 10 +// size: 12 +type SetScreenSaverCookie cookie + // Write request to wire for SetScreenSaver -func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) { - size := 10 +func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.newCookie(false, false) + c.newRequest(setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie(cookie) +} + +func (c *Conn) SetScreenSaverChecked(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.newCookie(true, false) + c.newRequest(setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie(cookie) +} + +// Write request to wire for SetScreenSaver +func setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { + size := 12 b := 0 buf := make([]byte, size) @@ -10714,25 +12417,23 @@ func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte buf[b] = AllowExposures b += 1 - c.sendRequest(false, buf) + return buf } // Request GetScreenSaver -// size: 3 -func (c *Conn) GetScreenSaver() (*GetScreenSaverReply, error) { - return c.GetScreenSaverReply(c.GetScreenSaverRequest()) +// size: 4 +type GetScreenSaverCookie cookie + +func (c *Conn) GetScreenSaver() GetScreenSaverCookie { + cookie := c.newCookie(true, true) + c.newRequest(getScreenSaverRequest(), cookie) + return GetScreenSaverCookie(cookie) } -// Write request to wire for GetScreenSaver -func (c *Conn) GetScreenSaverRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 108 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetScreenSaverUnchecked() GetScreenSaverCookie { + cookie := c.newCookie(false, true) + c.newRequest(getScreenSaverRequest(), cookie) + return GetScreenSaverCookie(cookie) } // Request reply for GetScreenSaver @@ -10748,13 +12449,17 @@ type GetScreenSaverReply struct { // padding: 18 bytes } -// Read reply GetScreenSaver -func (c *Conn) GetScreenSaverReply(cook *Cookie) (*GetScreenSaverReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetScreenSaver +func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getScreenSaverReply(buf), nil +} +// Read reply into structure from buffer for GetScreenSaver +func getScreenSaverReply(buf []byte) *GetScreenSaverReply { v := new(GetScreenSaverReply) b := 1 // skip reply determinant @@ -10780,14 +12485,41 @@ func (c *Conn) GetScreenSaverReply(cook *Cookie) (*GetScreenSaverReply, error) { b += 18 // padding - return v, nil + return v +} + +// Write request to wire for GetScreenSaver +func getScreenSaverRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 108 // request opcode + b += 1 + + return buf } // Request ChangeHosts -// size: (8 + pad((int(AddressLen) * 1))) +// size: pad((8 + pad((int(AddressLen) * 1)))) +type ChangeHostsCookie cookie + // Write request to wire for ChangeHosts -func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address []byte) { - size := (8 + pad((int(AddressLen) * 1))) +func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.newCookie(false, false) + c.newRequest(changeHostsRequest(Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie(cookie) +} + +func (c *Conn) ChangeHostsChecked(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.newCookie(true, false) + c.newRequest(changeHostsRequest(Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie(cookie) +} + +// Write request to wire for ChangeHosts +func changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { + size := pad((8 + pad((int(AddressLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10811,25 +12543,23 @@ func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address [] copy(buf[b:], Address[:AddressLen]) b += pad(int(AddressLen)) - c.sendRequest(false, buf) + return buf } // Request ListHosts -// size: 3 -func (c *Conn) ListHosts() (*ListHostsReply, error) { - return c.ListHostsReply(c.ListHostsRequest()) +// size: 4 +type ListHostsCookie cookie + +func (c *Conn) ListHosts() ListHostsCookie { + cookie := c.newCookie(true, true) + c.newRequest(listHostsRequest(), cookie) + return ListHostsCookie(cookie) } -// Write request to wire for ListHosts -func (c *Conn) ListHostsRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 110 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) ListHostsUnchecked() ListHostsCookie { + cookie := c.newCookie(false, true) + c.newRequest(listHostsRequest(), cookie) + return ListHostsCookie(cookie) } // Request reply for ListHosts @@ -10843,13 +12573,17 @@ type ListHostsReply struct { Hosts []Host // size: HostListSize(Hosts) } -// Read reply ListHosts -func (c *Conn) ListHostsReply(cook *Cookie) (*ListHostsReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request ListHosts +func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return listHostsReply(buf), nil +} +// Read reply into structure from buffer for ListHosts +func listHostsReply(buf []byte) *ListHostsReply { v := new(ListHostsReply) b := 1 // skip reply determinant @@ -10870,13 +12604,40 @@ func (c *Conn) ListHostsReply(cook *Cookie) (*ListHostsReply, error) { v.Hosts = make([]Host, v.HostsLen) b += ReadHostList(buf[b:], v.Hosts) - return v, nil + return v +} + +// Write request to wire for ListHosts +func listHostsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 110 // request opcode + b += 1 + + return buf } // Request SetAccessControl // size: 4 +type SetAccessControlCookie cookie + // Write request to wire for SetAccessControl -func (c *Conn) SetAccessControl(Mode byte) { +func (c *Conn) SetAccessControl(Mode byte) SetAccessControlCookie { + cookie := c.newCookie(false, false) + c.newRequest(setAccessControlRequest(Mode), cookie) + return SetAccessControlCookie(cookie) +} + +func (c *Conn) SetAccessControlChecked(Mode byte) SetAccessControlCookie { + cookie := c.newCookie(true, false) + c.newRequest(setAccessControlRequest(Mode), cookie) + return SetAccessControlCookie(cookie) +} + +// Write request to wire for SetAccessControl +func setAccessControlRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -10887,13 +12648,28 @@ func (c *Conn) SetAccessControl(Mode byte) { buf[b] = Mode b += 1 - c.sendRequest(false, buf) + return buf } // Request SetCloseDownMode // size: 4 +type SetCloseDownModeCookie cookie + // Write request to wire for SetCloseDownMode -func (c *Conn) SetCloseDownMode(Mode byte) { +func (c *Conn) SetCloseDownMode(Mode byte) SetCloseDownModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(setCloseDownModeRequest(Mode), cookie) + return SetCloseDownModeCookie(cookie) +} + +func (c *Conn) SetCloseDownModeChecked(Mode byte) SetCloseDownModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(setCloseDownModeRequest(Mode), cookie) + return SetCloseDownModeCookie(cookie) +} + +// Write request to wire for SetCloseDownMode +func setCloseDownModeRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -10904,13 +12680,28 @@ func (c *Conn) SetCloseDownMode(Mode byte) { buf[b] = Mode b += 1 - c.sendRequest(false, buf) + return buf } // Request KillClient // size: 8 +type KillClientCookie cookie + // Write request to wire for KillClient -func (c *Conn) KillClient(Resource uint32) { +func (c *Conn) KillClient(Resource uint32) KillClientCookie { + cookie := c.newCookie(false, false) + c.newRequest(killClientRequest(Resource), cookie) + return KillClientCookie(cookie) +} + +func (c *Conn) KillClientChecked(Resource uint32) KillClientCookie { + cookie := c.newCookie(true, false) + c.newRequest(killClientRequest(Resource), cookie) + return KillClientCookie(cookie) +} + +// Write request to wire for KillClient +func killClientRequest(Resource uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10926,14 +12717,29 @@ func (c *Conn) KillClient(Resource uint32) { Put32(buf[b:], Resource) b += 4 - c.sendRequest(false, buf) + return buf } // Request RotateProperties -// size: (12 + pad((int(AtomsLen) * 4))) +// size: pad((12 + pad((int(AtomsLen) * 4)))) +type RotatePropertiesCookie cookie + // Write request to wire for RotateProperties -func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) { - size := (12 + pad((int(AtomsLen) * 4))) +func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { + cookie := c.newCookie(false, false) + c.newRequest(rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie(cookie) +} + +func (c *Conn) RotatePropertiesChecked(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { + cookie := c.newCookie(true, false) + c.newRequest(rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie(cookie) +} + +// Write request to wire for RotateProperties +func rotatePropertiesRequest(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) []byte { + size := pad((12 + pad((int(AtomsLen) * 4)))) b := 0 buf := make([]byte, size) @@ -10960,13 +12766,28 @@ func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms [ } b = pad(b) - c.sendRequest(false, buf) + return buf } // Request ForceScreenSaver // size: 4 +type ForceScreenSaverCookie cookie + // Write request to wire for ForceScreenSaver -func (c *Conn) ForceScreenSaver(Mode byte) { +func (c *Conn) ForceScreenSaver(Mode byte) ForceScreenSaverCookie { + cookie := c.newCookie(false, false) + c.newRequest(forceScreenSaverRequest(Mode), cookie) + return ForceScreenSaverCookie(cookie) +} + +func (c *Conn) ForceScreenSaverChecked(Mode byte) ForceScreenSaverCookie { + cookie := c.newCookie(true, false) + c.newRequest(forceScreenSaverRequest(Mode), cookie) + return ForceScreenSaverCookie(cookie) +} + +// Write request to wire for ForceScreenSaver +func forceScreenSaverRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -10977,18 +12798,56 @@ func (c *Conn) ForceScreenSaver(Mode byte) { buf[b] = Mode b += 1 - c.sendRequest(false, buf) + return buf } // Request SetPointerMapping -// size: (4 + pad((int(MapLen) * 1))) -func (c *Conn) SetPointerMapping(MapLen byte, Map []byte) (*SetPointerMappingReply, error) { - return c.SetPointerMappingReply(c.SetPointerMappingRequest(MapLen, Map)) +// size: pad((4 + pad((int(MapLen) * 1)))) +type SetPointerMappingCookie cookie + +func (c *Conn) SetPointerMapping(MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(setPointerMappingRequest(MapLen, Map), cookie) + return SetPointerMappingCookie(cookie) +} + +func (c *Conn) SetPointerMappingUnchecked(MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(setPointerMappingRequest(MapLen, Map), cookie) + return SetPointerMappingCookie(cookie) +} + +// Request reply for SetPointerMapping +// size: 8 +type SetPointerMappingReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Waits and reads reply data from request SetPointerMapping +func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return setPointerMappingReply(buf), nil +} + +// Read reply into structure from buffer for SetPointerMapping +func setPointerMappingReply(buf []byte) *SetPointerMappingReply { + v := new(SetPointerMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v } // Write request to wire for SetPointerMapping -func (c *Conn) SetPointerMappingRequest(MapLen byte, Map []byte) *Cookie { - size := (4 + pad((int(MapLen) * 1))) +func setPointerMappingRequest(MapLen byte, Map []byte) []byte { + size := pad((4 + pad((int(MapLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11004,49 +12863,23 @@ func (c *Conn) SetPointerMappingRequest(MapLen byte, Map []byte) *Cookie { copy(buf[b:], Map[:MapLen]) b += pad(int(MapLen)) - return c.sendRequest(true, buf) -} - -// Request reply for SetPointerMapping -// size: 8 -type SetPointerMappingReply struct { - Sequence uint16 - Length uint32 - Status byte -} - -// Read reply SetPointerMapping -func (c *Conn) SetPointerMappingReply(cook *Cookie) (*SetPointerMappingReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(SetPointerMappingReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - return v, nil + return buf } // Request GetPointerMapping -// size: 3 -func (c *Conn) GetPointerMapping() (*GetPointerMappingReply, error) { - return c.GetPointerMappingReply(c.GetPointerMappingRequest()) +// size: 4 +type GetPointerMappingCookie cookie + +func (c *Conn) GetPointerMapping() GetPointerMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(getPointerMappingRequest(), cookie) + return GetPointerMappingCookie(cookie) } -// Write request to wire for GetPointerMapping -func (c *Conn) GetPointerMappingRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 117 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetPointerMappingUnchecked() GetPointerMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(getPointerMappingRequest(), cookie) + return GetPointerMappingCookie(cookie) } // Request reply for GetPointerMapping @@ -11059,13 +12892,17 @@ type GetPointerMappingReply struct { Map []byte // size: pad((int(MapLen) * 1)) } -// Read reply GetPointerMapping -func (c *Conn) GetPointerMappingReply(cook *Cookie) (*GetPointerMappingReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetPointerMapping +func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getPointerMappingReply(buf), nil +} +// Read reply into structure from buffer for GetPointerMapping +func getPointerMappingReply(buf []byte) *GetPointerMappingReply { v := new(GetPointerMappingReply) b := 1 // skip reply determinant @@ -11084,18 +12921,68 @@ func (c *Conn) GetPointerMappingReply(cook *Cookie) (*GetPointerMappingReply, er copy(v.Map[:v.MapLen], buf[b:]) b += pad(int(v.MapLen)) - return v, nil + return v +} + +// Write request to wire for GetPointerMapping +func getPointerMappingRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 117 // request opcode + b += 1 + + return buf } // Request SetModifierMapping -// size: (4 + pad(((int(KeycodesPerModifier) * 8) * 1))) -func (c *Conn) SetModifierMapping(KeycodesPerModifier byte, Keycodes []Keycode) (*SetModifierMappingReply, error) { - return c.SetModifierMappingReply(c.SetModifierMappingRequest(KeycodesPerModifier, Keycodes)) +// size: pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) +type SetModifierMappingCookie cookie + +func (c *Conn) SetModifierMapping(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie(cookie) +} + +func (c *Conn) SetModifierMappingUnchecked(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie(cookie) +} + +// Request reply for SetModifierMapping +// size: 8 +type SetModifierMappingReply struct { + Sequence uint16 + Length uint32 + Status byte +} + +// Waits and reads reply data from request SetModifierMapping +func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { + buf, err := cookie(cook).reply() + if err != nil { + return nil, err + } + return setModifierMappingReply(buf), nil +} + +// Read reply into structure from buffer for SetModifierMapping +func setModifierMappingReply(buf []byte) *SetModifierMappingReply { + v := new(SetModifierMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + return v } // Write request to wire for SetModifierMapping -func (c *Conn) SetModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) *Cookie { - size := (4 + pad(((int(KeycodesPerModifier) * 8) * 1))) +func setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) []byte { + size := pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 buf := make([]byte, size) @@ -11114,49 +13001,23 @@ func (c *Conn) SetModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Ke } b = pad(b) - return c.sendRequest(true, buf) -} - -// Request reply for SetModifierMapping -// size: 8 -type SetModifierMappingReply struct { - Sequence uint16 - Length uint32 - Status byte -} - -// Read reply SetModifierMapping -func (c *Conn) SetModifierMappingReply(cook *Cookie) (*SetModifierMappingReply, error) { - buf, err := c.waitForReply(cook) - if err != nil { - return nil, err - } - - v := new(SetModifierMappingReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - return v, nil + return buf } // Request GetModifierMapping -// size: 3 -func (c *Conn) GetModifierMapping() (*GetModifierMappingReply, error) { - return c.GetModifierMappingReply(c.GetModifierMappingRequest()) +// size: 4 +type GetModifierMappingCookie cookie + +func (c *Conn) GetModifierMapping() GetModifierMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(getModifierMappingRequest(), cookie) + return GetModifierMappingCookie(cookie) } -// Write request to wire for GetModifierMapping -func (c *Conn) GetModifierMappingRequest() *Cookie { - size := 3 - b := 0 - buf := make([]byte, size) - - buf[b] = 119 // request opcode - b += 1 - - return c.sendRequest(true, buf) +func (c *Conn) GetModifierMappingUnchecked() GetModifierMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(getModifierMappingRequest(), cookie) + return GetModifierMappingCookie(cookie) } // Request reply for GetModifierMapping @@ -11169,13 +13030,17 @@ type GetModifierMappingReply struct { Keycodes []Keycode // size: pad(((int(KeycodesPerModifier) * 8) * 1)) } -// Read reply GetModifierMapping -func (c *Conn) GetModifierMappingReply(cook *Cookie) (*GetModifierMappingReply, error) { - buf, err := c.waitForReply(cook) +// Waits and reads reply data from request GetModifierMapping +func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { + buf, err := cookie(cook).reply() if err != nil { return nil, err } + return getModifierMappingReply(buf), nil +} +// Read reply into structure from buffer for GetModifierMapping +func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v := new(GetModifierMappingReply) b := 1 // skip reply determinant @@ -11197,19 +13062,46 @@ func (c *Conn) GetModifierMappingReply(cook *Cookie) (*GetModifierMappingReply, } b = pad(b) - return v, nil + return v +} + +// Write request to wire for GetModifierMapping +func getModifierMappingRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 119 // request opcode + b += 1 + + return buf } // Request NoOperation -// size: 3 +// size: 4 +type NoOperationCookie cookie + // Write request to wire for NoOperation -func (c *Conn) NoOperation() { - size := 3 +func (c *Conn) NoOperation() NoOperationCookie { + cookie := c.newCookie(false, false) + c.newRequest(noOperationRequest(), cookie) + return NoOperationCookie(cookie) +} + +func (c *Conn) NoOperationChecked() NoOperationCookie { + cookie := c.newCookie(true, false) + c.newRequest(noOperationRequest(), cookie) + return NoOperationCookie(cookie) +} + +// Write request to wire for NoOperation +func noOperationRequest() []byte { + size := 4 b := 0 buf := make([]byte, size) buf[b] = 127 // request opcode b += 1 - c.sendRequest(false, buf) + return buf } From b6715f376f5ea3efb58146c58924dcc7b1536181 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 18:21:48 -0400 Subject: [PATCH 14/90] fixing bugs related mostly to extension handling --- nexgb/xgbgen/expression.go | 6 +-- nexgb/xgbgen/field.go | 12 +++--- nexgb/xgbgen/go.go | 6 ++- nexgb/xgbgen/go_error.go | 14 ++++--- nexgb/xgbgen/go_event.go | 51 ++++++++++++++++++++++++ nexgb/xgbgen/go_request_reply.go | 67 +++++++++++++++++++++----------- nexgb/xgbgen/representation.go | 7 +++- nexgb/xgbgen/translation.go | 2 +- nexgb/xgbgen/type.go | 2 +- 9 files changed, 125 insertions(+), 42 deletions(-) diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 6a8aa52..2350979 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -282,7 +282,7 @@ func (e *FieldRef) String() string { } func (e *FieldRef) Initialize(p *Protocol) { - e.Name = SrcName(e.Name) + e.Name = SrcName(p, e.Name) } type EnumRef struct { @@ -309,7 +309,7 @@ func (e *EnumRef) String() string { func (e *EnumRef) Initialize(p *Protocol) { e.EnumKind = e.EnumKind.(*Translation).RealType(p) - e.EnumItem = SrcName(e.EnumItem) + e.EnumItem = SrcName(p, e.EnumItem) } type SumOf struct { @@ -337,5 +337,5 @@ func (e *SumOf) String() string { } func (e *SumOf) Initialize(p *Protocol) { - e.Name = SrcName(e.Name) + e.Name = SrcName(p, e.Name) } diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index ddc2028..5041f77 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -47,7 +47,7 @@ type SingleField struct { } func (f *SingleField) Initialize(p *Protocol) { - f.srcName = SrcName(f.XmlName()) + f.srcName = SrcName(p, f.XmlName()) f.Type = f.Type.(*Translation).RealType(p) } @@ -138,7 +138,7 @@ func (f *ListField) Size() Size { } func (f *ListField) Initialize(p *Protocol) { - f.srcName = SrcName(f.XmlName()) + f.srcName = SrcName(p, f.XmlName()) f.Type = f.Type.(*Translation).RealType(p) if f.LengthExpr != nil { f.LengthExpr.Initialize(p) @@ -173,7 +173,7 @@ func (f *ExprField) Size() Size { } func (f *ExprField) Initialize(p *Protocol) { - f.srcName = SrcName(f.XmlName()) + f.srcName = SrcName(p, f.XmlName()) f.Type = f.Type.(*Translation).RealType(p) f.Expr.Initialize(p) } @@ -230,8 +230,8 @@ func (f *ValueField) ListLength() Size { func (f *ValueField) Initialize(p *Protocol) { f.MaskType = f.MaskType.(*Translation).RealType(p) - f.MaskName = SrcName(f.MaskName) - f.ListName = SrcName(f.ListName) + f.MaskName = SrcName(p, f.MaskName) + f.ListName = SrcName(p, f.ListName) } type SwitchField struct { @@ -260,7 +260,7 @@ func (f *SwitchField) Size() Size { } func (f *SwitchField) Initialize(p *Protocol) { - f.Name = SrcName(f.Name) + f.Name = SrcName(p, f.Name) f.Expr.Initialize(p) for _, bitcase := range f.Bitcases { bitcase.Expr.Initialize(p) diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index 771cfcf..df12e69 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -65,7 +65,8 @@ var NameMap = map[string]string{} // Base types func (b *Base) Define(c *Context) { - c.Putln("// Skipping definition for base type '%s'", SrcName(b.XmlName())) + c.Putln("// Skipping definition for base type '%s'", + SrcName(c.protocol, b.XmlName())) c.Putln("") } @@ -81,7 +82,8 @@ func (enum *Enum) Define(c *Context) { // Resource types func (res *Resource) Define(c *Context) { - c.Putln("// Skipping resource definition of '%s'", SrcName(res.XmlName())) + c.Putln("// Skipping resource definition of '%s'", + SrcName(c.protocol, res.XmlName())) c.Putln("") } diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 5a51064..152db8b 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -64,11 +64,15 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("}") c.Putln("") c.Putln("func (err %s) BadId() Id {", e.ErrType()) - c.Putln("return Id(err.BadValue)") + if c.protocol.Name == "xproto" { + c.Putln("return Id(err.BadValue)") + } else { + c.Putln("return 0") + } c.Putln("}") c.Putln("") c.Putln("func (err %s) Error() string {", e.ErrType()) - FieldString(c, e.Fields, e.ErrConst()) + ErrorFieldString(c, e.Fields, e.ErrConst()) c.Putln("}") c.Putln("") } @@ -119,14 +123,14 @@ func (e *ErrorCopy) ImplementsError(c *Context) { c.Putln("}") c.Putln("") c.Putln("func (err %s) Error() string {", e.ErrType()) - FieldString(c, e.Old.(*Error).Fields, e.ErrConst()) + ErrorFieldString(c, e.Old.(*Error).Fields, e.ErrConst()) c.Putln("}") c.Putln("") } -// FieldString works for both Error and ErrorCopy. It assembles all of the +// ErrorFieldString works for both Error and ErrorCopy. It assembles all of the // fields in an error and formats them into a single string. -func FieldString(c *Context, fields []Field, errName string) { +func ErrorFieldString(c *Context, fields []Field, errName string) { c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) c.Putln("fieldVals = append(fieldVals, \"NiceName: \" + err.NiceName)") c.Putln("fieldVals = append(fieldVals, " + diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index 41f9320..9bc6dfe 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -1,5 +1,9 @@ package main +import ( + "fmt" +) + // Event types func (e *Event) Define(c *Context) { c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) @@ -36,6 +40,10 @@ func (e *Event) Define(c *Context) { } c.Putln("}") c.Putln("") + c.Putln("func (v %s) String() string {", e.EvType()) + EventFieldString(c, e.Fields, e.SrcName()) + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") @@ -115,6 +123,10 @@ func (e *EventCopy) Define(c *Context) { } c.Putln("}") c.Putln("") + c.Putln("func (v %s) String() string {", e.EvType()) + EventFieldString(c, e.Old.(*Event).Fields, e.SrcName()) + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") @@ -137,3 +149,42 @@ func (e *EventCopy) Write(c *Context) { c.Putln("}") c.Putln("") } + +// EventFieldString works for both Event and EventCopy. It assembles all of the +// fields in an event and formats them into a single string. +func EventFieldString(c *Context, fields []Field, evName string) { + c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) + if evName != "KeymapNotify" { + c.Putln("fieldVals = append(fieldVals, " + + "sprintf(\"Sequence: %s\", v.Sequence))", "%d") + } + for _, field := range fields { + switch f := field.(type) { + case *PadField: + continue + case *SingleField: + switch f.Type.(type) { + case *Base: + case *Resource: + case *TypeDef: + default: continue + } + + switch field.SrcType() { + case "string": + format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + field.SrcName(), "%s", field.SrcName()) + c.Putln("fieldVals = append(fieldVals, %s)", format) + case "bool": + format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + field.SrcName(), "%t", field.SrcName()) + c.Putln("fieldVals = append(fieldVals, %s)", format) + default: + format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + field.SrcName(), "%d", field.SrcName()) + c.Putln("fieldVals = append(fieldVals, %s)", format) + } + } + } + c.Putln("return \"%s {\" + stringsJoin(fieldVals, \", \") + \"}\"", evName) +} diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index 00c48f9..e64e2a2 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -8,21 +8,24 @@ import ( func (r *Request) Define(c *Context) { c.Putln("// Request %s", r.SrcName()) c.Putln("// size: %s", r.Size(c)) - c.Putln("type %s cookie", r.CookieName()) + c.Putln("type %s struct {", r.CookieName()) + c.Putln("*cookie") + c.Putln("}") + c.Putln("") if r.Reply != nil { c.Putln("func (c *Conn) %s(%s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.newCookie(true, true)") - c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) - c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") c.Putln("func (c *Conn) %sUnchecked(%s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.newCookie(false, true)") - c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) - c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") @@ -32,20 +35,24 @@ func (r *Request) Define(c *Context) { c.Putln("func (c *Conn) %s(%s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.newCookie(false, false)") - c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) - c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") c.Putln("func (c *Conn) %sChecked(%s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.newCookie(true, false)") - c.Putln("c.newRequest(%s(%s), cookie)", r.ReqName(), r.ParamNames()) - c.Putln("return %s(cookie)", r.CookieName()) + c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") } + c.Putln("func (cook %s) Check() error {", r.CookieName()) + c.Putln("return cook.check()") + c.Putln("}") + c.Putln("") r.WriteRequest(c) } @@ -64,10 +71,13 @@ func (r *Request) ReadReply(c *Context) { c.Putln("// Waits and reads reply data from request %s", r.SrcName()) c.Putln("func (cook %s) Reply() (*%s, error) {", r.CookieName(), r.ReplyTypeName()) - c.Putln("buf, err := cookie(cook).reply()") + c.Putln("buf, err := cook.reply()") c.Putln("if err != nil {") c.Putln("return nil, err") c.Putln("}") + c.Putln("if buf == nil {") + c.Putln("return nil, nil") + c.Putln("}") c.Putln("return %s(buf), nil", r.ReplyName()) c.Putln("}") c.Putln("") @@ -79,7 +89,9 @@ func (r *Request) ReadReply(c *Context) { c.Putln("b := 1 // skip reply determinant") c.Putln("") for i, field := range r.Reply.Fields { - if i == 1 { + field.Read(c, "v.") + c.Putln("") + if i == 0 { c.Putln("v.Sequence = Get16(buf[b:])") c.Putln("b += 2") c.Putln("") @@ -87,8 +99,6 @@ func (r *Request) ReadReply(c *Context) { c.Putln("b += 4") c.Putln("") } - field.Read(c, "v.") - c.Putln("") } c.Putln("return v") c.Putln("}") @@ -96,30 +106,41 @@ func (r *Request) ReadReply(c *Context) { } func (r *Request) WriteRequest(c *Context) { + writeSize := func() { + c.Putln("Put16(buf[b:], uint16(size / 4)) "+ + "// write request size in 4-byte units") + c.Putln("b += 2") + c.Putln("") + } c.Putln("// Write request to wire for %s", r.SrcName()) - c.Putln("func %s(%s) []byte {", r.ReqName(), r.ParamNameTypes()) + c.Putln("func (c *Conn) %s(%s) []byte {", r.ReqName(), r.ParamNameTypes()) c.Putln("size := %s", r.Size(c)) c.Putln("b := 0") c.Putln("buf := make([]byte, size)") c.Putln("") - c.Putln("buf[b] = %d // request opcode", r.Opcode) - c.Putln("b += 1") - c.Putln("") if strings.ToLower(c.protocol.Name) != "xproto" { c.Putln("buf[b] = c.extensions[\"%s\"]", strings.ToUpper(c.protocol.ExtXName)) c.Putln("b += 1") c.Putln("") } - for i, field := range r.Fields { - if i == 1 { - c.Putln("Put16(buf[b:], uint16(size / 4)) "+ - "// write request size in 4-byte units") - c.Putln("b += 2") - c.Putln("") + c.Putln("buf[b] = %d // request opcode", r.Opcode) + c.Putln("b += 1") + c.Putln("") + if len(r.Fields) == 0 { + if strings.ToLower(c.protocol.Name) == "xproto" { + c.Putln("b += 1 // padding") } + writeSize() + } else if strings.ToLower(c.protocol.Name) != "xproto" { + writeSize() + } + for i, field := range r.Fields { field.Write(c, "") c.Putln("") + if i == 0 && strings.ToLower(c.protocol.Name) == "xproto" { + writeSize() + } } c.Putln("return buf") c.Putln("}") diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/representation.go index be7accd..62a3eb2 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/representation.go @@ -3,6 +3,7 @@ package main import ( "fmt" "log" + "strings" "unicode" ) @@ -41,7 +42,11 @@ type Request struct { } func (r *Request) Initialize(p *Protocol) { - r.srcName = SrcName(r.xmlName) + r.srcName = SrcName(p, r.xmlName) + if p.Name != "xproto" { + r.srcName = strings.Title(strings.ToLower(p.Name)) + r.srcName + } + if r.Reply != nil { r.Reply.Initialize(p) } diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index fe5a52b..b650bc4 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -373,7 +373,7 @@ func (x *XMLBitcase) Translate() *Bitcase { // SrcName is used to translate any identifier into a Go name. // Mostly used for fields, but used in a couple other places too (enum items). -func SrcName(name string) string { +func SrcName(p *Protocol, name string) string { // If it's in the name map, use that translation. if newn, ok := NameMap[name]; ok { return newn diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index 3498463..521f67e 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -123,7 +123,7 @@ func (enum *Enum) Size() Size { func (enum *Enum) Initialize(p *Protocol) { enum.srcName = TypeSrcName(p, enum) for _, item := range enum.Items { - item.srcName = SrcName(item.xmlName) + item.srcName = SrcName(p, item.xmlName) if item.Expr != nil { item.Expr.Initialize(p) } From 369ad0d33e51035a3e48436fc85f60130b201437 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 18:22:24 -0400 Subject: [PATCH 15/90] extensions are working! extensions are working! --- nexgb/conn.go | 4 +- nexgb/cookie.go | 51 +- nexgb/examples/atom.go | 2 +- nexgb/examples/property.go | 10 +- nexgb/randr.go | 3988 ++++++++++++++++++++++++++++++++++++ nexgb/render.go | 3506 +++++++++++++++++++++++++++++++ nexgb/xgb.go | 102 +- nexgb/xgb_help.go | 124 +- nexgb/xinerama.go | 629 ++++++ nexgb/xproto.go | 2847 ++++++++++++++++++------- 10 files changed, 10396 insertions(+), 867 deletions(-) create mode 100644 nexgb/randr.go create mode 100644 nexgb/render.go create mode 100644 nexgb/xinerama.go diff --git a/nexgb/conn.go b/nexgb/conn.go index 235402d..02396d4 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -10,7 +10,8 @@ import ( "strings" ) -// connect connects to the X server given in the 'display' string. +// connect connects to the X server given in the 'display' string, +// and does all the necessary setup handshaking. // If 'display' is empty it will be taken from os.Getenv("DISPLAY"). // Note that you should read and understand the "Connection Setup" of the // X Protocol Reference Manual before changing this function: @@ -87,6 +88,7 @@ func (c *Conn) connect(display string) error { return nil } +// dial initializes the actual net connection with X. func (c *Conn) dial(display string) error { if len(display) == 0 { display = os.Getenv("DISPLAY") diff --git a/nexgb/cookie.go b/nexgb/cookie.go index 502ccbf..7f54a22 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -4,16 +4,28 @@ import ( "errors" ) +// cookie is the internal representation of a cookie, where one is generated +// for *every* request sent by XGB. +// 'cookie' is most frequently used by embedding it into a more specific +// kind of cookie, i.e., 'GetInputFocusCookie'. type cookie struct { + conn *Conn Sequence uint16 replyChan chan []byte errorChan chan error pingChan chan bool } -func (c *Conn) newCookie(checked, reply bool) cookie { - cookie := cookie{ - Sequence: c.newSequenceId(), +// newCookie creates a new cookie with the correct channels initialized +// depending upon the values of 'checked' and 'reply'. Together, there are +// four different kinds of cookies. (See more detailed comments in the +// function for more info on those.) +// Note that a sequence number is not set until just before the request +// corresponding to this cookie is sent over the wire. +func (c *Conn) newCookie(checked, reply bool) *cookie { + cookie := &cookie{ + conn: c, + Sequence: 0, // we add the sequence id just before sending a request replyChan: nil, errorChan: nil, pingChan: nil, @@ -48,6 +60,8 @@ func (c *Conn) newCookie(checked, reply bool) cookie { return cookie } +// reply detects whether this is a checked or unchecked cookie, and calls +// 'replyChecked' or 'replyUnchecked' appropriately. func (c cookie) reply() ([]byte, error) { // checked if c.errorChan != nil { @@ -56,6 +70,10 @@ func (c cookie) reply() ([]byte, error) { return c.replyUnchecked() } +// replyChecked waits for a response on either the replyChan or errorChan +// channels. If the former arrives, the bytes are returned with a nil error. +// If the latter arrives, no bytes are returned (nil) and the error received +// is returned. func (c cookie) replyChecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyChecked' on a cookie that " + @@ -75,6 +93,12 @@ func (c cookie) replyChecked() ([]byte, error) { panic("unreachable") } +// replyChecked waits for a response on either the replyChan or pingChan +// channels. If the former arrives, the bytes are returned with a nil error. +// If the latter arrives, no bytes are returned (nil) and a nil error +// is returned. (In the latter case, the corresponding error can be retrieved +// from (Wait|Poll)ForEvent asynchronously.) +// In all honesty, you *probably* don't want to use this method. func (c cookie) replyUnchecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyUnchecked' on a cookie " + @@ -90,7 +114,15 @@ func (c cookie) replyUnchecked() ([]byte, error) { panic("unreachable") } -func (c cookie) Check() error { +// check is used for checked requests that have no replies. It is a mechanism +// by which to report "success" or "error" in a synchronous fashion. (Therefore, +// unchecked requests without replies cannot use this method.) +// If the request causes an error, it is sent to this cookie's errorChan. +// If the request was successful, there is no response from the server. +// Thus, pingChan is sent a value when the *next* reply is read. +// If no more replies are being processed, we force a round trip request with +// GetInputFocus. +func (c cookie) check() error { if c.replyChan != nil { return errors.New("Cannot call 'Check' on a cookie that is " + "expecting a *reply*. Use 'Reply' instead.") @@ -100,6 +132,17 @@ func (c cookie) Check() error { "not expecting a possible *error*.") } + // First do a quick non-blocking check to see if we've been pinged. + select { + case err := <-c.errorChan: + return err + case <-c.pingChan: + return nil + default: + } + + // Now force a round trip and try again, but block this time. + c.conn.GetInputFocus().Reply() select { case err := <-c.errorChan: return err diff --git a/nexgb/examples/atom.go b/nexgb/examples/atom.go index c64acee..2cb7132 100644 --- a/nexgb/examples/atom.go +++ b/nexgb/examples/atom.go @@ -18,7 +18,7 @@ func main() { } aname := "_NET_ACTIVE_WINDOW" - atom, err := X.InternAtom(true, uint16(len(aname)), aname) + atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() if err != nil { log.Fatal(err) } diff --git a/nexgb/examples/property.go b/nexgb/examples/property.go index 2477df4..45144c7 100644 --- a/nexgb/examples/property.go +++ b/nexgb/examples/property.go @@ -27,13 +27,15 @@ func main() { root := X.DefaultScreen().Root aname := "_NET_ACTIVE_WINDOW" - atom, err := X.InternAtom(true, uint16(len(aname)), aname) + atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() if err != nil { log.Fatal(err) } - reply, err := X.GetProperty(false, root, atom.Atom, xgb.GetPropertyTypeAny, - 0, (1<<32)-1) + reply, err := X.GetProperty(false, root, atom.Atom, + xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() + if err != nil { + log.Fatal(err) + } log.Printf("%X", get32(reply.Value)) } - diff --git a/nexgb/randr.go b/nexgb/randr.go new file mode 100644 index 0000000..fdb10ca --- /dev/null +++ b/nexgb/randr.go @@ -0,0 +1,3988 @@ +package xgb + +/* + This file was generated by randr.xml on May 5 2012 6:06:50pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" +// import "render" + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + RandrRotationRotate0 = 1 + RandrRotationRotate90 = 2 + RandrRotationRotate180 = 4 + RandrRotationRotate270 = 8 + RandrRotationReflectX = 16 + RandrRotationReflectY = 32 +) + +const ( + RandrSetConfigSuccess = 0 + RandrSetConfigInvalidConfigTime = 1 + RandrSetConfigInvalidTime = 2 + RandrSetConfigFailed = 3 +) + +const ( + RandrNotifyMaskScreenChange = 1 + RandrNotifyMaskCrtcChange = 2 + RandrNotifyMaskOutputChange = 4 + RandrNotifyMaskOutputProperty = 8 +) + +const ( + RandrModeFlagHsyncPositive = 1 + RandrModeFlagHsyncNegative = 2 + RandrModeFlagVsyncPositive = 4 + RandrModeFlagVsyncNegative = 8 + RandrModeFlagInterlace = 16 + RandrModeFlagDoubleScan = 32 + RandrModeFlagCsync = 64 + RandrModeFlagCsyncPositive = 128 + RandrModeFlagCsyncNegative = 256 + RandrModeFlagHskewPresent = 512 + RandrModeFlagBcast = 1024 + RandrModeFlagPixelMultiplex = 2048 + RandrModeFlagDoubleClock = 4096 + RandrModeFlagHalveClock = 8192 +) + +const ( + RandrConnectionConnected = 0 + RandrConnectionDisconnected = 1 + RandrConnectionUnknown = 2 +) + +const ( + RandrNotifyCrtcChange = 0 + RandrNotifyOutputChange = 1 + RandrNotifyOutputProperty = 2 +) + +// Skipping resource definition of 'Mode' + +// Skipping resource definition of 'Crtc' + +// Skipping resource definition of 'Output' + +// 'RandrScreenSize' struct definition +// Size: 8 +type RandrScreenSize struct { + Width uint16 + Height uint16 + Mwidth uint16 + Mheight uint16 +} + +// Struct read RandrScreenSize +func ReadRandrScreenSize(buf []byte, v *RandrScreenSize) int { + b := 0 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Mwidth = Get16(buf[b:]) + b += 2 + + v.Mheight = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RandrScreenSize +func ReadRandrScreenSizeList(buf []byte, dest []RandrScreenSize) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrScreenSize{} + b += ReadRandrScreenSize(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrScreenSize +func (v RandrScreenSize) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.Mwidth) + b += 2 + + Put16(buf[b:], v.Mheight) + b += 2 + + return buf +} + +// Write struct list RandrScreenSize +func RandrScreenSizeListBytes(buf []byte, list []RandrScreenSize) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RandrRefreshRates' struct definition +// Size: (2 + pad((int(NRates) * 2))) +type RandrRefreshRates struct { + NRates uint16 + Rates []uint16 // size: pad((int(NRates) * 2)) +} + +// Struct read RandrRefreshRates +func ReadRandrRefreshRates(buf []byte, v *RandrRefreshRates) int { + b := 0 + + v.NRates = Get16(buf[b:]) + b += 2 + + v.Rates = make([]uint16, v.NRates) + for i := 0; i < int(v.NRates); i++ { + v.Rates[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + return b +} + +// Struct list read RandrRefreshRates +func ReadRandrRefreshRatesList(buf []byte, dest []RandrRefreshRates) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrRefreshRates{} + b += ReadRandrRefreshRates(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrRefreshRates +func (v RandrRefreshRates) Bytes() []byte { + buf := make([]byte, (2 + pad((int(v.NRates) * 2)))) + b := 0 + + Put16(buf[b:], v.NRates) + b += 2 + + for i := 0; i < int(v.NRates); i++ { + Put16(buf[b:], v.Rates[i]) + b += 2 + } + b = pad(b) + + return buf +} + +// Write struct list RandrRefreshRates +func RandrRefreshRatesListBytes(buf []byte, list []RandrRefreshRates) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size RandrRefreshRates +func RandrRefreshRatesListSize(list []RandrRefreshRates) int { + size := 0 + for _, item := range list { + size += (2 + pad((int(item.NRates) * 2))) + } + return size +} + +// 'RandrModeInfo' struct definition +// Size: 32 +type RandrModeInfo struct { + Id uint32 + Width uint16 + Height uint16 + DotClock uint32 + HsyncStart uint16 + HsyncEnd uint16 + Htotal uint16 + Hskew uint16 + VsyncStart uint16 + VsyncEnd uint16 + Vtotal uint16 + NameLen uint16 + ModeFlags uint32 +} + +// Struct read RandrModeInfo +func ReadRandrModeInfo(buf []byte, v *RandrModeInfo) int { + b := 0 + + v.Id = Get32(buf[b:]) + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.DotClock = Get32(buf[b:]) + b += 4 + + v.HsyncStart = Get16(buf[b:]) + b += 2 + + v.HsyncEnd = Get16(buf[b:]) + b += 2 + + v.Htotal = Get16(buf[b:]) + b += 2 + + v.Hskew = Get16(buf[b:]) + b += 2 + + v.VsyncStart = Get16(buf[b:]) + b += 2 + + v.VsyncEnd = Get16(buf[b:]) + b += 2 + + v.Vtotal = Get16(buf[b:]) + b += 2 + + v.NameLen = Get16(buf[b:]) + b += 2 + + v.ModeFlags = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read RandrModeInfo +func ReadRandrModeInfoList(buf []byte, dest []RandrModeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrModeInfo{} + b += ReadRandrModeInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrModeInfo +func (v RandrModeInfo) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + Put32(buf[b:], v.Id) + b += 4 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put32(buf[b:], v.DotClock) + b += 4 + + Put16(buf[b:], v.HsyncStart) + b += 2 + + Put16(buf[b:], v.HsyncEnd) + b += 2 + + Put16(buf[b:], v.Htotal) + b += 2 + + Put16(buf[b:], v.Hskew) + b += 2 + + Put16(buf[b:], v.VsyncStart) + b += 2 + + Put16(buf[b:], v.VsyncEnd) + b += 2 + + Put16(buf[b:], v.Vtotal) + b += 2 + + Put16(buf[b:], v.NameLen) + b += 2 + + Put32(buf[b:], v.ModeFlags) + b += 4 + + return buf +} + +// Write struct list RandrModeInfo +func RandrModeInfoListBytes(buf []byte, list []RandrModeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RandrCrtcChange' struct definition +// Size: 28 +type RandrCrtcChange struct { + Timestamp Timestamp + Window Id + Crtc Id + Mode Id + Rotation uint16 + // padding: 2 bytes + X int16 + Y int16 + Width uint16 + Height uint16 +} + +// Struct read RandrCrtcChange +func ReadRandrCrtcChange(buf []byte, v *RandrCrtcChange) int { + b := 0 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Crtc = Id(Get32(buf[b:])) + b += 4 + + v.Mode = Id(Get32(buf[b:])) + b += 4 + + v.Rotation = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RandrCrtcChange +func ReadRandrCrtcChangeList(buf []byte, dest []RandrCrtcChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrCrtcChange{} + b += ReadRandrCrtcChange(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrCrtcChange +func (v RandrCrtcChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Crtc)) + b += 4 + + Put32(buf[b:], uint32(v.Mode)) + b += 4 + + Put16(buf[b:], v.Rotation) + b += 2 + + b += 2 // padding + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// Write struct list RandrCrtcChange +func RandrCrtcChangeListBytes(buf []byte, list []RandrCrtcChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RandrOutputChange' struct definition +// Size: 28 +type RandrOutputChange struct { + Timestamp Timestamp + ConfigTimestamp Timestamp + Window Id + Output Id + Crtc Id + Mode Id + Rotation uint16 + Connection byte + SubpixelOrder byte +} + +// Struct read RandrOutputChange +func ReadRandrOutputChange(buf []byte, v *RandrOutputChange) int { + b := 0 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Output = Id(Get32(buf[b:])) + b += 4 + + v.Crtc = Id(Get32(buf[b:])) + b += 4 + + v.Mode = Id(Get32(buf[b:])) + b += 4 + + v.Rotation = Get16(buf[b:]) + b += 2 + + v.Connection = buf[b] + b += 1 + + v.SubpixelOrder = buf[b] + b += 1 + + return b +} + +// Struct list read RandrOutputChange +func ReadRandrOutputChangeList(buf []byte, dest []RandrOutputChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrOutputChange{} + b += ReadRandrOutputChange(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrOutputChange +func (v RandrOutputChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put32(buf[b:], uint32(v.ConfigTimestamp)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Output)) + b += 4 + + Put32(buf[b:], uint32(v.Crtc)) + b += 4 + + Put32(buf[b:], uint32(v.Mode)) + b += 4 + + Put16(buf[b:], v.Rotation) + b += 2 + + buf[b] = v.Connection + b += 1 + + buf[b] = v.SubpixelOrder + b += 1 + + return buf +} + +// Write struct list RandrOutputChange +func RandrOutputChangeListBytes(buf []byte, list []RandrOutputChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RandrOutputProperty' struct definition +// Size: 28 +type RandrOutputProperty struct { + Window Id + Output Id + Atom Id + Timestamp Timestamp + Status byte + // padding: 11 bytes +} + +// Struct read RandrOutputProperty +func ReadRandrOutputProperty(buf []byte, v *RandrOutputProperty) int { + b := 0 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Output = Id(Get32(buf[b:])) + b += 4 + + v.Atom = Id(Get32(buf[b:])) + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Status = buf[b] + b += 1 + + b += 11 // padding + + return b +} + +// Struct list read RandrOutputProperty +func ReadRandrOutputPropertyList(buf []byte, dest []RandrOutputProperty) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrOutputProperty{} + b += ReadRandrOutputProperty(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RandrOutputProperty +func (v RandrOutputProperty) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Output)) + b += 4 + + Put32(buf[b:], uint32(v.Atom)) + b += 4 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.Status + b += 1 + + b += 11 // padding + + return buf +} + +// Write struct list RandrOutputProperty +func RandrOutputPropertyListBytes(buf []byte, list []RandrOutputProperty) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Union definition RandrNotifyDataUnion +// Note that to *create* a Union, you should *never* create +// this struct directly (unless you know what you're doing). +// Instead use one of the following constructors for 'RandrNotifyDataUnion': +// NewRandrNotifyDataUnionCc(Cc RandrCrtcChange) RandrNotifyDataUnion +// NewRandrNotifyDataUnionOc(Oc RandrOutputChange) RandrNotifyDataUnion +// NewRandrNotifyDataUnionOp(Op RandrOutputProperty) RandrNotifyDataUnion +type RandrNotifyDataUnion struct { + Cc RandrCrtcChange + Oc RandrOutputChange + Op RandrOutputProperty +} + +// Union constructor for RandrNotifyDataUnion for field Cc. +func NewRandrNotifyDataUnionCc(Cc RandrCrtcChange) RandrNotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Cc.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + // Create the Union type + v := RandrNotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = RandrCrtcChange{} + b += ReadRandrCrtcChange(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = RandrOutputChange{} + b += ReadRandrOutputChange(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = RandrOutputProperty{} + b += ReadRandrOutputProperty(buf[b:], &v.Op) + + return v +} + +// Union constructor for RandrNotifyDataUnion for field Oc. +func NewRandrNotifyDataUnionOc(Oc RandrOutputChange) RandrNotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Oc.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + // Create the Union type + v := RandrNotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = RandrCrtcChange{} + b += ReadRandrCrtcChange(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = RandrOutputChange{} + b += ReadRandrOutputChange(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = RandrOutputProperty{} + b += ReadRandrOutputProperty(buf[b:], &v.Op) + + return v +} + +// Union constructor for RandrNotifyDataUnion for field Op. +func NewRandrNotifyDataUnionOp(Op RandrOutputProperty) RandrNotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Op.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + // Create the Union type + v := RandrNotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = RandrCrtcChange{} + b += ReadRandrCrtcChange(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = RandrOutputChange{} + b += ReadRandrOutputChange(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = RandrOutputProperty{} + b += ReadRandrOutputProperty(buf[b:], &v.Op) + + return v +} + +// Union read RandrNotifyDataUnion +func ReadRandrNotifyDataUnion(buf []byte, v *RandrNotifyDataUnion) int { + var b int + + b = 0 // re-read the same bytes + v.Cc = RandrCrtcChange{} + b += ReadRandrCrtcChange(buf[b:], &v.Cc) + + b = 0 // re-read the same bytes + v.Oc = RandrOutputChange{} + b += ReadRandrOutputChange(buf[b:], &v.Oc) + + b = 0 // re-read the same bytes + v.Op = RandrOutputProperty{} + b += ReadRandrOutputProperty(buf[b:], &v.Op) + + return 28 +} + +// Union list read RandrNotifyDataUnion +func ReadRandrNotifyDataUnionList(buf []byte, dest []RandrNotifyDataUnion) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RandrNotifyDataUnion{} + b += ReadRandrNotifyDataUnion(buf[b:], &dest[i]) + } + return pad(b) +} + +// Union write RandrNotifyDataUnion +// Each field in a union must contain the same data. +// So simply pick the first field and write that to the wire. +func (v RandrNotifyDataUnion) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + { + structBytes := v.Cc.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return buf +} + +// Union list write RandrNotifyDataUnion +func RandrNotifyDataUnionListBytes(buf []byte, list []RandrNotifyDataUnion) int { + b := 0 + var unionBytes []byte + for _, item := range list { + unionBytes = item.Bytes() + copy(buf[b:], unionBytes) + b += pad(len(unionBytes)) + } + return b +} + +// Event definition RandrScreenChangeNotify (0) +// Size: 32 + +const RandrScreenChangeNotify = 0 + +type RandrScreenChangeNotifyEvent struct { + Sequence uint16 + Rotation byte + Timestamp Timestamp + ConfigTimestamp Timestamp + Root Id + RequestWindow Id + SizeID uint16 + SubpixelOrder uint16 + Width uint16 + Height uint16 + Mwidth uint16 + Mheight uint16 +} + +// Event read RandrScreenChangeNotify +func NewRandrScreenChangeNotifyEvent(buf []byte) Event { + v := RandrScreenChangeNotifyEvent{} + b := 1 // don't read event number + + v.Rotation = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.RequestWindow = Id(Get32(buf[b:])) + b += 4 + + v.SizeID = Get16(buf[b:]) + b += 2 + + v.SubpixelOrder = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Mwidth = Get16(buf[b:]) + b += 2 + + v.Mheight = Get16(buf[b:]) + b += 2 + + return v +} + +// Event write RandrScreenChangeNotify +func (v RandrScreenChangeNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Rotation + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put32(buf[b:], uint32(v.ConfigTimestamp)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.RequestWindow)) + b += 4 + + Put16(buf[b:], v.SizeID) + b += 2 + + Put16(buf[b:], v.SubpixelOrder) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.Mwidth) + b += 2 + + Put16(buf[b:], v.Mheight) + b += 2 + + return buf +} + +func (v RandrScreenChangeNotifyEvent) ImplementsEvent() {} + +func (v RandrScreenChangeNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v RandrScreenChangeNotifyEvent) String() string { + fieldVals := make([]string, 0, 11) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Rotation: %d", v.Rotation)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, sprintf("ConfigTimestamp: %d", v.ConfigTimestamp)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("RequestWindow: %d", v.RequestWindow)) + fieldVals = append(fieldVals, sprintf("SizeID: %d", v.SizeID)) + fieldVals = append(fieldVals, sprintf("SubpixelOrder: %d", v.SubpixelOrder)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("Mwidth: %d", v.Mwidth)) + fieldVals = append(fieldVals, sprintf("Mheight: %d", v.Mheight)) + return "RandrScreenChangeNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewRandrScreenChangeNotifyEvent +} + +// Event definition RandrNotify (1) +// Size: 32 + +const RandrNotify = 1 + +type RandrNotifyEvent struct { + Sequence uint16 + SubCode byte + U RandrNotifyDataUnion +} + +// Event read RandrNotify +func NewRandrNotifyEvent(buf []byte) Event { + v := RandrNotifyEvent{} + b := 1 // don't read event number + + v.SubCode = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.U = RandrNotifyDataUnion{} + b += ReadRandrNotifyDataUnion(buf[b:], &v.U) + + return v +} + +// Event write RandrNotify +func (v RandrNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.SubCode + b += 1 + + b += 2 // skip sequence number + + { + unionBytes := v.U.Bytes() + copy(buf[b:], unionBytes) + b += pad(len(unionBytes)) + } + + return buf +} + +func (v RandrNotifyEvent) ImplementsEvent() {} + +func (v RandrNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v RandrNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("SubCode: %d", v.SubCode)) + return "RandrNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewRandrNotifyEvent +} + +// Error definition RandrBadOutput (0) +// Size: 32 + +const BadRandrBadOutput = 0 + +type RandrBadOutputError struct { + Sequence uint16 + NiceName string +} + +// Error read RandrBadOutput +func NewRandrBadOutputError(buf []byte) Error { + v := RandrBadOutputError{} + v.NiceName = "RandrBadOutput" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RandrBadOutputError) ImplementsError() {} + +func (err RandrBadOutputError) SequenceId() uint16 { + return err.Sequence +} + +func (err RandrBadOutputError) BadId() Id { + return 0 +} + +func (err RandrBadOutputError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRandrBadOutput {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewRandrBadOutputError +} + +// Error definition RandrBadCrtc (1) +// Size: 32 + +const BadRandrBadCrtc = 1 + +type RandrBadCrtcError struct { + Sequence uint16 + NiceName string +} + +// Error read RandrBadCrtc +func NewRandrBadCrtcError(buf []byte) Error { + v := RandrBadCrtcError{} + v.NiceName = "RandrBadCrtc" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RandrBadCrtcError) ImplementsError() {} + +func (err RandrBadCrtcError) SequenceId() uint16 { + return err.Sequence +} + +func (err RandrBadCrtcError) BadId() Id { + return 0 +} + +func (err RandrBadCrtcError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRandrBadCrtc {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewRandrBadCrtcError +} + +// Error definition RandrBadMode (2) +// Size: 32 + +const BadRandrBadMode = 2 + +type RandrBadModeError struct { + Sequence uint16 + NiceName string +} + +// Error read RandrBadMode +func NewRandrBadModeError(buf []byte) Error { + v := RandrBadModeError{} + v.NiceName = "RandrBadMode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RandrBadModeError) ImplementsError() {} + +func (err RandrBadModeError) SequenceId() uint16 { + return err.Sequence +} + +func (err RandrBadModeError) BadId() Id { + return 0 +} + +func (err RandrBadModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRandrBadMode {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewRandrBadModeError +} + +// Request RandrQueryVersion +// size: 12 +type RandrQueryVersionCookie struct { + *cookie +} + +func (c *Conn) RandrQueryVersion(MajorVersion uint32, MinorVersion uint32) RandrQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return RandrQueryVersionCookie{cookie} +} + +func (c *Conn) RandrQueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) RandrQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return RandrQueryVersionCookie{cookie} +} + +// Request reply for RandrQueryVersion +// size: 32 +type RandrQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request RandrQueryVersion +func (cook RandrQueryVersionCookie) Reply() (*RandrQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for RandrQueryVersion +func randrQueryVersionReply(buf []byte) *RandrQueryVersionReply { + v := new(RandrQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook RandrQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrQueryVersion +func (c *Conn) randrQueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request RandrSetScreenConfig +// size: 24 +type RandrSetScreenConfigCookie struct { + *cookie +} + +func (c *Conn) RandrSetScreenConfig(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return RandrSetScreenConfigCookie{cookie} +} + +func (c *Conn) RandrSetScreenConfigUnchecked(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return RandrSetScreenConfigCookie{cookie} +} + +// Request reply for RandrSetScreenConfig +// size: 32 +type RandrSetScreenConfigReply struct { + Sequence uint16 + Length uint32 + Status byte + NewTimestamp Timestamp + ConfigTimestamp Timestamp + Root Id + SubpixelOrder uint16 + // padding: 10 bytes +} + +// Waits and reads reply data from request RandrSetScreenConfig +func (cook RandrSetScreenConfigCookie) Reply() (*RandrSetScreenConfigReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrSetScreenConfigReply(buf), nil +} + +// Read reply into structure from buffer for RandrSetScreenConfig +func randrSetScreenConfigReply(buf []byte) *RandrSetScreenConfigReply { + v := new(RandrSetScreenConfigReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NewTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.SubpixelOrder = Get16(buf[b:]) + b += 2 + + b += 10 // padding + + return v +} + +func (cook RandrSetScreenConfigCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetScreenConfig +func (c *Conn) randrSetScreenConfigRequest(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Timestamp)) + b += 4 + + Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + Put16(buf[b:], SizeID) + b += 2 + + Put16(buf[b:], Rotation) + b += 2 + + Put16(buf[b:], Rate) + b += 2 + + b += 2 // padding + + return buf +} + +// Request RandrSelectInput +// size: 12 +type RandrSelectInputCookie struct { + *cookie +} + +// Write request to wire for RandrSelectInput +func (c *Conn) RandrSelectInput(Window Id, Enable uint16) RandrSelectInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) + return RandrSelectInputCookie{cookie} +} + +func (c *Conn) RandrSelectInputChecked(Window Id, Enable uint16) RandrSelectInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) + return RandrSelectInputCookie{cookie} +} + +func (cook RandrSelectInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSelectInput +func (c *Conn) randrSelectInputRequest(Window Id, Enable uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], Enable) + b += 2 + + b += 2 // padding + + return buf +} + +// Request RandrGetScreenInfo +// size: 8 +type RandrGetScreenInfoCookie struct { + *cookie +} + +func (c *Conn) RandrGetScreenInfo(Window Id) RandrGetScreenInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) + return RandrGetScreenInfoCookie{cookie} +} + +func (c *Conn) RandrGetScreenInfoUnchecked(Window Id) RandrGetScreenInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) + return RandrGetScreenInfoCookie{cookie} +} + +// Request reply for RandrGetScreenInfo +// size: ((32 + pad((int(NSizes) * 8))) + RandrRefreshRatesListSize(Rates)) +type RandrGetScreenInfoReply struct { + Sequence uint16 + Length uint32 + Rotations byte + Root Id + Timestamp Timestamp + ConfigTimestamp Timestamp + NSizes uint16 + SizeID uint16 + Rotation uint16 + Rate uint16 + NInfo uint16 + // padding: 2 bytes + Sizes []RandrScreenSize // size: pad((int(NSizes) * 8)) + Rates []RandrRefreshRates // size: RandrRefreshRatesListSize(Rates) +} + +// Waits and reads reply data from request RandrGetScreenInfo +func (cook RandrGetScreenInfoCookie) Reply() (*RandrGetScreenInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetScreenInfoReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetScreenInfo +func randrGetScreenInfoReply(buf []byte) *RandrGetScreenInfoReply { + v := new(RandrGetScreenInfoReply) + b := 1 // skip reply determinant + + v.Rotations = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.NSizes = Get16(buf[b:]) + b += 2 + + v.SizeID = Get16(buf[b:]) + b += 2 + + v.Rotation = Get16(buf[b:]) + b += 2 + + v.Rate = Get16(buf[b:]) + b += 2 + + v.NInfo = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Sizes = make([]RandrScreenSize, v.NSizes) + b += ReadRandrScreenSizeList(buf[b:], v.Sizes) + + v.Rates = make([]RandrRefreshRates, (int(v.NInfo) - int(v.NSizes))) + b += ReadRandrRefreshRatesList(buf[b:], v.Rates) + + return v +} + +func (cook RandrGetScreenInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetScreenInfo +func (c *Conn) randrGetScreenInfoRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request RandrGetScreenSizeRange +// size: 8 +type RandrGetScreenSizeRangeCookie struct { + *cookie +} + +func (c *Conn) RandrGetScreenSizeRange(Window Id) RandrGetScreenSizeRangeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) + return RandrGetScreenSizeRangeCookie{cookie} +} + +func (c *Conn) RandrGetScreenSizeRangeUnchecked(Window Id) RandrGetScreenSizeRangeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) + return RandrGetScreenSizeRangeCookie{cookie} +} + +// Request reply for RandrGetScreenSizeRange +// size: 32 +type RandrGetScreenSizeRangeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MinWidth uint16 + MinHeight uint16 + MaxWidth uint16 + MaxHeight uint16 + // padding: 16 bytes +} + +// Waits and reads reply data from request RandrGetScreenSizeRange +func (cook RandrGetScreenSizeRangeCookie) Reply() (*RandrGetScreenSizeRangeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetScreenSizeRangeReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetScreenSizeRange +func randrGetScreenSizeRangeReply(buf []byte) *RandrGetScreenSizeRangeReply { + v := new(RandrGetScreenSizeRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinWidth = Get16(buf[b:]) + b += 2 + + v.MinHeight = Get16(buf[b:]) + b += 2 + + v.MaxWidth = Get16(buf[b:]) + b += 2 + + v.MaxHeight = Get16(buf[b:]) + b += 2 + + b += 16 // padding + + return v +} + +func (cook RandrGetScreenSizeRangeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetScreenSizeRange +func (c *Conn) randrGetScreenSizeRangeRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request RandrSetScreenSize +// size: 20 +type RandrSetScreenSizeCookie struct { + *cookie +} + +// Write request to wire for RandrSetScreenSize +func (c *Conn) RandrSetScreenSize(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) + return RandrSetScreenSizeCookie{cookie} +} + +func (c *Conn) RandrSetScreenSizeChecked(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) + return RandrSetScreenSizeCookie{cookie} +} + +func (cook RandrSetScreenSizeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetScreenSize +func (c *Conn) randrSetScreenSizeRequest(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put32(buf[b:], MmWidth) + b += 4 + + Put32(buf[b:], MmHeight) + b += 4 + + return buf +} + +// Request RandrGetScreenResources +// size: 8 +type RandrGetScreenResourcesCookie struct { + *cookie +} + +func (c *Conn) RandrGetScreenResources(Window Id) RandrGetScreenResourcesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) + return RandrGetScreenResourcesCookie{cookie} +} + +func (c *Conn) RandrGetScreenResourcesUnchecked(Window Id) RandrGetScreenResourcesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) + return RandrGetScreenResourcesCookie{cookie} +} + +// Request reply for RandrGetScreenResources +// size: ((((32 + pad((int(NumCrtcs) * 4))) + pad((int(NumOutputs) * 4))) + pad((int(NumModes) * 32))) + pad((int(NamesLen) * 1))) +type RandrGetScreenResourcesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Timestamp Timestamp + ConfigTimestamp Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Id // size: pad((int(NumCrtcs) * 4)) + Outputs []Id // size: pad((int(NumOutputs) * 4)) + Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) + Names []byte // size: pad((int(NamesLen) * 1)) +} + +// Waits and reads reply data from request RandrGetScreenResources +func (cook RandrGetScreenResourcesCookie) Reply() (*RandrGetScreenResourcesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetScreenResourcesReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetScreenResources +func randrGetScreenResourcesReply(buf []byte) *RandrGetScreenResourcesReply { + v := new(RandrGetScreenResourcesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.NumCrtcs = Get16(buf[b:]) + b += 2 + + v.NumOutputs = Get16(buf[b:]) + b += 2 + + v.NumModes = Get16(buf[b:]) + b += 2 + + v.NamesLen = Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Id, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Outputs = make([]Id, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Modes = make([]RandrModeInfo, v.NumModes) + b += ReadRandrModeInfoList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += pad(int(v.NamesLen)) + + return v +} + +func (cook RandrGetScreenResourcesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetScreenResources +func (c *Conn) randrGetScreenResourcesRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request RandrGetOutputInfo +// size: 12 +type RandrGetOutputInfoCookie struct { + *cookie +} + +func (c *Conn) RandrGetOutputInfo(Output Id, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) + return RandrGetOutputInfoCookie{cookie} +} + +func (c *Conn) RandrGetOutputInfoUnchecked(Output Id, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) + return RandrGetOutputInfoCookie{cookie} +} + +// Request reply for RandrGetOutputInfo +// size: ((((36 + pad((int(NumCrtcs) * 4))) + pad((int(NumModes) * 4))) + pad((int(NumClones) * 4))) + pad((int(NameLen) * 1))) +type RandrGetOutputInfoReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp Timestamp + Crtc Id + MmWidth uint32 + MmHeight uint32 + Connection byte + SubpixelOrder byte + NumCrtcs uint16 + NumModes uint16 + NumPreferred uint16 + NumClones uint16 + NameLen uint16 + Crtcs []Id // size: pad((int(NumCrtcs) * 4)) + Modes []Id // size: pad((int(NumModes) * 4)) + Clones []Id // size: pad((int(NumClones) * 4)) + Name []byte // size: pad((int(NameLen) * 1)) +} + +// Waits and reads reply data from request RandrGetOutputInfo +func (cook RandrGetOutputInfoCookie) Reply() (*RandrGetOutputInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetOutputInfoReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetOutputInfo +func randrGetOutputInfoReply(buf []byte) *RandrGetOutputInfoReply { + v := new(RandrGetOutputInfoReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Crtc = Id(Get32(buf[b:])) + b += 4 + + v.MmWidth = Get32(buf[b:]) + b += 4 + + v.MmHeight = Get32(buf[b:]) + b += 4 + + v.Connection = buf[b] + b += 1 + + v.SubpixelOrder = buf[b] + b += 1 + + v.NumCrtcs = Get16(buf[b:]) + b += 2 + + v.NumModes = Get16(buf[b:]) + b += 2 + + v.NumPreferred = Get16(buf[b:]) + b += 2 + + v.NumClones = Get16(buf[b:]) + b += 2 + + v.NameLen = Get16(buf[b:]) + b += 2 + + v.Crtcs = make([]Id, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Modes = make([]Id, v.NumModes) + for i := 0; i < int(v.NumModes); i++ { + v.Modes[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Clones = make([]Id, v.NumClones) + for i := 0; i < int(v.NumClones); i++ { + v.Clones[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Name = make([]byte, v.NameLen) + copy(v.Name[:v.NameLen], buf[b:]) + b += pad(int(v.NameLen)) + + return v +} + +func (cook RandrGetOutputInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetOutputInfo +func (c *Conn) randrGetOutputInfoRequest(Output Id, ConfigTimestamp Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// Request RandrListOutputProperties +// size: 8 +type RandrListOutputPropertiesCookie struct { + *cookie +} + +func (c *Conn) RandrListOutputProperties(Output Id) RandrListOutputPropertiesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) + return RandrListOutputPropertiesCookie{cookie} +} + +func (c *Conn) RandrListOutputPropertiesUnchecked(Output Id) RandrListOutputPropertiesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) + return RandrListOutputPropertiesCookie{cookie} +} + +// Request reply for RandrListOutputProperties +// size: (32 + pad((int(NumAtoms) * 4))) +type RandrListOutputPropertiesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAtoms uint16 + // padding: 22 bytes + Atoms []Id // size: pad((int(NumAtoms) * 4)) +} + +// Waits and reads reply data from request RandrListOutputProperties +func (cook RandrListOutputPropertiesCookie) Reply() (*RandrListOutputPropertiesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrListOutputPropertiesReply(buf), nil +} + +// Read reply into structure from buffer for RandrListOutputProperties +func randrListOutputPropertiesReply(buf []byte) *RandrListOutputPropertiesReply { + v := new(RandrListOutputPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAtoms = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Atoms = make([]Id, v.NumAtoms) + for i := 0; i < int(v.NumAtoms); i++ { + v.Atoms[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook RandrListOutputPropertiesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrListOutputProperties +func (c *Conn) randrListOutputPropertiesRequest(Output Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + return buf +} + +// Request RandrQueryOutputProperty +// size: 12 +type RandrQueryOutputPropertyCookie struct { + *cookie +} + +func (c *Conn) RandrQueryOutputProperty(Output Id, Property Id) RandrQueryOutputPropertyCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) + return RandrQueryOutputPropertyCookie{cookie} +} + +func (c *Conn) RandrQueryOutputPropertyUnchecked(Output Id, Property Id) RandrQueryOutputPropertyCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) + return RandrQueryOutputPropertyCookie{cookie} +} + +// Request reply for RandrQueryOutputProperty +// size: (32 + pad((int(Length) * 4))) +type RandrQueryOutputPropertyReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Pending bool + Range bool + Immutable bool + // padding: 21 bytes + ValidValues []int32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request RandrQueryOutputProperty +func (cook RandrQueryOutputPropertyCookie) Reply() (*RandrQueryOutputPropertyReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrQueryOutputPropertyReply(buf), nil +} + +// Read reply into structure from buffer for RandrQueryOutputProperty +func randrQueryOutputPropertyReply(buf []byte) *RandrQueryOutputPropertyReply { + v := new(RandrQueryOutputPropertyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Pending = true + } else { + v.Pending = false + } + b += 1 + + if buf[b] == 1 { + v.Range = true + } else { + v.Range = false + } + b += 1 + + if buf[b] == 1 { + v.Immutable = true + } else { + v.Immutable = false + } + b += 1 + + b += 21 // padding + + v.ValidValues = make([]int32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.ValidValues[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook RandrQueryOutputPropertyCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrQueryOutputProperty +func (c *Conn) randrQueryOutputPropertyRequest(Output Id, Property Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request RandrConfigureOutputProperty +// size: pad((16 + pad((len(Values) * 4)))) +type RandrConfigureOutputPropertyCookie struct { + *cookie +} + +// Write request to wire for RandrConfigureOutputProperty +func (c *Conn) RandrConfigureOutputProperty(Output Id, Property Id, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) + return RandrConfigureOutputPropertyCookie{cookie} +} + +func (c *Conn) RandrConfigureOutputPropertyChecked(Output Id, Property Id, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) + return RandrConfigureOutputPropertyCookie{cookie} +} + +func (cook RandrConfigureOutputPropertyCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrConfigureOutputProperty +func (c *Conn) randrConfigureOutputPropertyRequest(Output Id, Property Id, Pending bool, Range bool, Values []int32) []byte { + size := pad((16 + pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Range { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Values)); i++ { + Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RandrChangeOutputProperty +// size: pad((24 + pad((((int(NumUnits) * int(Format)) / 8) * 1)))) +type RandrChangeOutputPropertyCookie struct { + *cookie +} + +// Write request to wire for RandrChangeOutputProperty +func (c *Conn) RandrChangeOutputProperty(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return RandrChangeOutputPropertyCookie{cookie} +} + +func (c *Conn) RandrChangeOutputPropertyChecked(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return RandrChangeOutputPropertyCookie{cookie} +} + +func (cook RandrChangeOutputPropertyCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrChangeOutputProperty +func (c *Conn) randrChangeOutputPropertyRequest(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { + size := pad((24 + pad((((int(NumUnits) * int(Format)) / 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + Put32(buf[b:], NumUnits) + b += 4 + + copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) + b += pad(int(((int(NumUnits) * int(Format)) / 8))) + + return buf +} + +// Request RandrDeleteOutputProperty +// size: 12 +type RandrDeleteOutputPropertyCookie struct { + *cookie +} + +// Write request to wire for RandrDeleteOutputProperty +func (c *Conn) RandrDeleteOutputProperty(Output Id, Property Id) RandrDeleteOutputPropertyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) + return RandrDeleteOutputPropertyCookie{cookie} +} + +func (c *Conn) RandrDeleteOutputPropertyChecked(Output Id, Property Id) RandrDeleteOutputPropertyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) + return RandrDeleteOutputPropertyCookie{cookie} +} + +func (cook RandrDeleteOutputPropertyCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrDeleteOutputProperty +func (c *Conn) randrDeleteOutputPropertyRequest(Output Id, Property Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request RandrGetOutputProperty +// size: 28 +type RandrGetOutputPropertyCookie struct { + *cookie +} + +func (c *Conn) RandrGetOutputProperty(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return RandrGetOutputPropertyCookie{cookie} +} + +func (c *Conn) RandrGetOutputPropertyUnchecked(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return RandrGetOutputPropertyCookie{cookie} +} + +// Request reply for RandrGetOutputProperty +// size: (32 + pad(((int(NumItems) * (int(Format) / 8)) * 1))) +type RandrGetOutputPropertyReply struct { + Sequence uint16 + Length uint32 + Format byte + Type Id + BytesAfter uint32 + NumItems uint32 + // padding: 12 bytes + Data []byte // size: pad(((int(NumItems) * (int(Format) / 8)) * 1)) +} + +// Waits and reads reply data from request RandrGetOutputProperty +func (cook RandrGetOutputPropertyCookie) Reply() (*RandrGetOutputPropertyReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetOutputPropertyReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetOutputProperty +func randrGetOutputPropertyReply(buf []byte) *RandrGetOutputPropertyReply { + v := new(RandrGetOutputPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = Id(Get32(buf[b:])) + b += 4 + + v.BytesAfter = Get32(buf[b:]) + b += 4 + + v.NumItems = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) + copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) + b += pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + + return v +} + +func (cook RandrGetOutputPropertyCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetOutputProperty +func (c *Conn) randrGetOutputPropertyRequest(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + Put32(buf[b:], uint32(Type)) + b += 4 + + Put32(buf[b:], LongOffset) + b += 4 + + Put32(buf[b:], LongLength) + b += 4 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + return buf +} + +// Request RandrCreateMode +// size: pad((40 + pad((len(Name) * 1)))) +type RandrCreateModeCookie struct { + *cookie +} + +func (c *Conn) RandrCreateMode(Window Id, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) + return RandrCreateModeCookie{cookie} +} + +func (c *Conn) RandrCreateModeUnchecked(Window Id, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) + return RandrCreateModeCookie{cookie} +} + +// Request reply for RandrCreateMode +// size: 32 +type RandrCreateModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Mode Id + // padding: 20 bytes +} + +// Waits and reads reply data from request RandrCreateMode +func (cook RandrCreateModeCookie) Reply() (*RandrCreateModeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrCreateModeReply(buf), nil +} + +// Read reply into structure from buffer for RandrCreateMode +func randrCreateModeReply(buf []byte) *RandrCreateModeReply { + v := new(RandrCreateModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Mode = Id(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +func (cook RandrCreateModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrCreateMode +func (c *Conn) randrCreateModeRequest(Window Id, ModeInfo RandrModeInfo, Name string) []byte { + size := pad((40 + pad((len(Name) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + { + structBytes := ModeInfo.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + copy(buf[b:], Name[:len(Name)]) + b += pad(int(len(Name))) + + return buf +} + +// Request RandrDestroyMode +// size: 8 +type RandrDestroyModeCookie struct { + *cookie +} + +// Write request to wire for RandrDestroyMode +func (c *Conn) RandrDestroyMode(Mode Id) RandrDestroyModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrDestroyModeRequest(Mode), cookie) + return RandrDestroyModeCookie{cookie} +} + +func (c *Conn) RandrDestroyModeChecked(Mode Id) RandrDestroyModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrDestroyModeRequest(Mode), cookie) + return RandrDestroyModeCookie{cookie} +} + +func (cook RandrDestroyModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrDestroyMode +func (c *Conn) randrDestroyModeRequest(Mode Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request RandrAddOutputMode +// size: 12 +type RandrAddOutputModeCookie struct { + *cookie +} + +// Write request to wire for RandrAddOutputMode +func (c *Conn) RandrAddOutputMode(Output Id, Mode Id) RandrAddOutputModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) + return RandrAddOutputModeCookie{cookie} +} + +func (c *Conn) RandrAddOutputModeChecked(Output Id, Mode Id) RandrAddOutputModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) + return RandrAddOutputModeCookie{cookie} +} + +func (cook RandrAddOutputModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrAddOutputMode +func (c *Conn) randrAddOutputModeRequest(Output Id, Mode Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request RandrDeleteOutputMode +// size: 12 +type RandrDeleteOutputModeCookie struct { + *cookie +} + +// Write request to wire for RandrDeleteOutputMode +func (c *Conn) RandrDeleteOutputMode(Output Id, Mode Id) RandrDeleteOutputModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) + return RandrDeleteOutputModeCookie{cookie} +} + +func (c *Conn) RandrDeleteOutputModeChecked(Output Id, Mode Id) RandrDeleteOutputModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) + return RandrDeleteOutputModeCookie{cookie} +} + +func (cook RandrDeleteOutputModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrDeleteOutputMode +func (c *Conn) randrDeleteOutputModeRequest(Output Id, Mode Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Output)) + b += 4 + + Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request RandrGetCrtcInfo +// size: 12 +type RandrGetCrtcInfoCookie struct { + *cookie +} + +func (c *Conn) RandrGetCrtcInfo(Crtc Id, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) + return RandrGetCrtcInfoCookie{cookie} +} + +func (c *Conn) RandrGetCrtcInfoUnchecked(Crtc Id, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) + return RandrGetCrtcInfoCookie{cookie} +} + +// Request reply for RandrGetCrtcInfo +// size: ((32 + pad((int(NumOutputs) * 4))) + pad((int(NumPossibleOutputs) * 4))) +type RandrGetCrtcInfoReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp Timestamp + X int16 + Y int16 + Width uint16 + Height uint16 + Mode Id + Rotation uint16 + Rotations uint16 + NumOutputs uint16 + NumPossibleOutputs uint16 + Outputs []Id // size: pad((int(NumOutputs) * 4)) + Possible []Id // size: pad((int(NumPossibleOutputs) * 4)) +} + +// Waits and reads reply data from request RandrGetCrtcInfo +func (cook RandrGetCrtcInfoCookie) Reply() (*RandrGetCrtcInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetCrtcInfoReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetCrtcInfo +func randrGetCrtcInfoReply(buf []byte) *RandrGetCrtcInfoReply { + v := new(RandrGetCrtcInfoReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Mode = Id(Get32(buf[b:])) + b += 4 + + v.Rotation = Get16(buf[b:]) + b += 2 + + v.Rotations = Get16(buf[b:]) + b += 2 + + v.NumOutputs = Get16(buf[b:]) + b += 2 + + v.NumPossibleOutputs = Get16(buf[b:]) + b += 2 + + v.Outputs = make([]Id, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Possible = make([]Id, v.NumPossibleOutputs) + for i := 0; i < int(v.NumPossibleOutputs); i++ { + v.Possible[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook RandrGetCrtcInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetCrtcInfo +func (c *Conn) randrGetCrtcInfoRequest(Crtc Id, ConfigTimestamp Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// Request RandrSetCrtcConfig +// size: pad((28 + pad((len(Outputs) * 4)))) +type RandrSetCrtcConfigCookie struct { + *cookie +} + +func (c *Conn) RandrSetCrtcConfig(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) RandrSetCrtcConfigCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) + return RandrSetCrtcConfigCookie{cookie} +} + +func (c *Conn) RandrSetCrtcConfigUnchecked(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) RandrSetCrtcConfigCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) + return RandrSetCrtcConfigCookie{cookie} +} + +// Request reply for RandrSetCrtcConfig +// size: 32 +type RandrSetCrtcConfigReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp Timestamp + // padding: 20 bytes +} + +// Waits and reads reply data from request RandrSetCrtcConfig +func (cook RandrSetCrtcConfigCookie) Reply() (*RandrSetCrtcConfigReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrSetCrtcConfigReply(buf), nil +} + +// Read reply into structure from buffer for RandrSetCrtcConfig +func randrSetCrtcConfigReply(buf []byte) *RandrSetCrtcConfigReply { + v := new(RandrSetCrtcConfigReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +func (cook RandrSetCrtcConfigCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetCrtcConfig +func (c *Conn) randrSetCrtcConfigRequest(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) []byte { + size := pad((28 + pad((len(Outputs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + Put32(buf[b:], uint32(Timestamp)) + b += 4 + + Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put32(buf[b:], uint32(Mode)) + b += 4 + + Put16(buf[b:], Rotation) + b += 2 + + b += 2 // padding + + for i := 0; i < int(len(Outputs)); i++ { + Put32(buf[b:], uint32(Outputs[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RandrGetCrtcGammaSize +// size: 8 +type RandrGetCrtcGammaSizeCookie struct { + *cookie +} + +func (c *Conn) RandrGetCrtcGammaSize(Crtc Id) RandrGetCrtcGammaSizeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) + return RandrGetCrtcGammaSizeCookie{cookie} +} + +func (c *Conn) RandrGetCrtcGammaSizeUnchecked(Crtc Id) RandrGetCrtcGammaSizeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) + return RandrGetCrtcGammaSizeCookie{cookie} +} + +// Request reply for RandrGetCrtcGammaSize +// size: 32 +type RandrGetCrtcGammaSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request RandrGetCrtcGammaSize +func (cook RandrGetCrtcGammaSizeCookie) Reply() (*RandrGetCrtcGammaSizeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetCrtcGammaSizeReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetCrtcGammaSize +func randrGetCrtcGammaSizeReply(buf []byte) *RandrGetCrtcGammaSizeReply { + v := new(RandrGetCrtcGammaSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +func (cook RandrGetCrtcGammaSizeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetCrtcGammaSize +func (c *Conn) randrGetCrtcGammaSizeRequest(Crtc Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request RandrGetCrtcGamma +// size: 8 +type RandrGetCrtcGammaCookie struct { + *cookie +} + +func (c *Conn) RandrGetCrtcGamma(Crtc Id) RandrGetCrtcGammaCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) + return RandrGetCrtcGammaCookie{cookie} +} + +func (c *Conn) RandrGetCrtcGammaUnchecked(Crtc Id) RandrGetCrtcGammaCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) + return RandrGetCrtcGammaCookie{cookie} +} + +// Request reply for RandrGetCrtcGamma +// size: (((32 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2))) +type RandrGetCrtcGammaReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes + Red []uint16 // size: pad((int(Size) * 2)) + Green []uint16 // size: pad((int(Size) * 2)) + Blue []uint16 // size: pad((int(Size) * 2)) +} + +// Waits and reads reply data from request RandrGetCrtcGamma +func (cook RandrGetCrtcGammaCookie) Reply() (*RandrGetCrtcGammaReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetCrtcGammaReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetCrtcGamma +func randrGetCrtcGammaReply(buf []byte) *RandrGetCrtcGammaReply { + v := new(RandrGetCrtcGammaReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Red = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Red[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + v.Green = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Green[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + v.Blue = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Blue[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + return v +} + +func (cook RandrGetCrtcGammaCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetCrtcGamma +func (c *Conn) randrGetCrtcGammaRequest(Crtc Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request RandrSetCrtcGamma +// size: pad((((12 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2)))) +type RandrSetCrtcGammaCookie struct { + *cookie +} + +// Write request to wire for RandrSetCrtcGamma +func (c *Conn) RandrSetCrtcGamma(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) + return RandrSetCrtcGammaCookie{cookie} +} + +func (c *Conn) RandrSetCrtcGammaChecked(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) + return RandrSetCrtcGammaCookie{cookie} +} + +func (cook RandrSetCrtcGammaCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetCrtcGamma +func (c *Conn) randrSetCrtcGammaRequest(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { + size := pad((((12 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + Put16(buf[b:], Size) + b += 2 + + b += 2 // padding + + for i := 0; i < int(Size); i++ { + Put16(buf[b:], Red[i]) + b += 2 + } + b = pad(b) + + for i := 0; i < int(Size); i++ { + Put16(buf[b:], Green[i]) + b += 2 + } + b = pad(b) + + for i := 0; i < int(Size); i++ { + Put16(buf[b:], Blue[i]) + b += 2 + } + b = pad(b) + + return buf +} + +// Request RandrGetScreenResourcesCurrent +// size: 8 +type RandrGetScreenResourcesCurrentCookie struct { + *cookie +} + +func (c *Conn) RandrGetScreenResourcesCurrent(Window Id) RandrGetScreenResourcesCurrentCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) + return RandrGetScreenResourcesCurrentCookie{cookie} +} + +func (c *Conn) RandrGetScreenResourcesCurrentUnchecked(Window Id) RandrGetScreenResourcesCurrentCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) + return RandrGetScreenResourcesCurrentCookie{cookie} +} + +// Request reply for RandrGetScreenResourcesCurrent +// size: ((((32 + pad((int(NumCrtcs) * 4))) + pad((int(NumOutputs) * 4))) + pad((int(NumModes) * 32))) + pad((int(NamesLen) * 1))) +type RandrGetScreenResourcesCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Timestamp Timestamp + ConfigTimestamp Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Id // size: pad((int(NumCrtcs) * 4)) + Outputs []Id // size: pad((int(NumOutputs) * 4)) + Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) + Names []byte // size: pad((int(NamesLen) * 1)) +} + +// Waits and reads reply data from request RandrGetScreenResourcesCurrent +func (cook RandrGetScreenResourcesCurrentCookie) Reply() (*RandrGetScreenResourcesCurrentReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetScreenResourcesCurrentReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetScreenResourcesCurrent +func randrGetScreenResourcesCurrentReply(buf []byte) *RandrGetScreenResourcesCurrentReply { + v := new(RandrGetScreenResourcesCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.NumCrtcs = Get16(buf[b:]) + b += 2 + + v.NumOutputs = Get16(buf[b:]) + b += 2 + + v.NumModes = Get16(buf[b:]) + b += 2 + + v.NamesLen = Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Id, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Outputs = make([]Id, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Modes = make([]RandrModeInfo, v.NumModes) + b += ReadRandrModeInfoList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += pad(int(v.NamesLen)) + + return v +} + +func (cook RandrGetScreenResourcesCurrentCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetScreenResourcesCurrent +func (c *Conn) randrGetScreenResourcesCurrentRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request RandrSetCrtcTransform +// size: pad(((48 + pad((int(FilterLen) * 1))) + pad((len(FilterParams) * 4)))) +type RandrSetCrtcTransformCookie struct { + *cookie +} + +// Write request to wire for RandrSetCrtcTransform +func (c *Conn) RandrSetCrtcTransform(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) + return RandrSetCrtcTransformCookie{cookie} +} + +func (c *Conn) RandrSetCrtcTransformChecked(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) + return RandrSetCrtcTransformCookie{cookie} +} + +func (cook RandrSetCrtcTransformCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetCrtcTransform +func (c *Conn) randrSetCrtcTransformRequest(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) []byte { + size := pad(((48 + pad((int(FilterLen) * 1))) + pad((len(FilterParams) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + { + structBytes := Transform.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put16(buf[b:], FilterLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], FilterName[:FilterLen]) + b += pad(int(FilterLen)) + + for i := 0; i < int(len(FilterParams)); i++ { + Put32(buf[b:], uint32(FilterParams[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RandrGetCrtcTransform +// size: 8 +type RandrGetCrtcTransformCookie struct { + *cookie +} + +func (c *Conn) RandrGetCrtcTransform(Crtc Id) RandrGetCrtcTransformCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) + return RandrGetCrtcTransformCookie{cookie} +} + +func (c *Conn) RandrGetCrtcTransformUnchecked(Crtc Id) RandrGetCrtcTransformCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) + return RandrGetCrtcTransformCookie{cookie} +} + +// Request reply for RandrGetCrtcTransform +// size: ((((96 + pad((int(PendingLen) * 1))) + pad((int(PendingNparams) * 4))) + pad((int(CurrentLen) * 1))) + pad((int(CurrentNparams) * 4))) +type RandrGetCrtcTransformReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PendingTransform RenderTransform + HasTransforms bool + // padding: 3 bytes + CurrentTransform RenderTransform + // padding: 4 bytes + PendingLen uint16 + PendingNparams uint16 + CurrentLen uint16 + CurrentNparams uint16 + PendingFilterName string // size: pad((int(PendingLen) * 1)) + PendingParams []RenderFixed // size: pad((int(PendingNparams) * 4)) + CurrentFilterName string // size: pad((int(CurrentLen) * 1)) + CurrentParams []RenderFixed // size: pad((int(CurrentNparams) * 4)) +} + +// Waits and reads reply data from request RandrGetCrtcTransform +func (cook RandrGetCrtcTransformCookie) Reply() (*RandrGetCrtcTransformReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetCrtcTransformReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetCrtcTransform +func randrGetCrtcTransformReply(buf []byte) *RandrGetCrtcTransformReply { + v := new(RandrGetCrtcTransformReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PendingTransform = RenderTransform{} + b += ReadRenderTransform(buf[b:], &v.PendingTransform) + + if buf[b] == 1 { + v.HasTransforms = true + } else { + v.HasTransforms = false + } + b += 1 + + b += 3 // padding + + v.CurrentTransform = RenderTransform{} + b += ReadRenderTransform(buf[b:], &v.CurrentTransform) + + b += 4 // padding + + v.PendingLen = Get16(buf[b:]) + b += 2 + + v.PendingNparams = Get16(buf[b:]) + b += 2 + + v.CurrentLen = Get16(buf[b:]) + b += 2 + + v.CurrentNparams = Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.PendingLen) + copy(byteString[:v.PendingLen], buf[b:]) + v.PendingFilterName = string(byteString) + b += pad(int(v.PendingLen)) + } + + v.PendingParams = make([]RenderFixed, v.PendingNparams) + for i := 0; i < int(v.PendingNparams); i++ { + v.PendingParams[i] = RenderFixed(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + { + byteString := make([]byte, v.CurrentLen) + copy(byteString[:v.CurrentLen], buf[b:]) + v.CurrentFilterName = string(byteString) + b += pad(int(v.CurrentLen)) + } + + v.CurrentParams = make([]RenderFixed, v.CurrentNparams) + for i := 0; i < int(v.CurrentNparams); i++ { + v.CurrentParams[i] = RenderFixed(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook RandrGetCrtcTransformCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetCrtcTransform +func (c *Conn) randrGetCrtcTransformRequest(Crtc Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request RandrGetPanning +// size: 8 +type RandrGetPanningCookie struct { + *cookie +} + +func (c *Conn) RandrGetPanning(Crtc Id) RandrGetPanningCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetPanningRequest(Crtc), cookie) + return RandrGetPanningCookie{cookie} +} + +func (c *Conn) RandrGetPanningUnchecked(Crtc Id) RandrGetPanningCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetPanningRequest(Crtc), cookie) + return RandrGetPanningCookie{cookie} +} + +// Request reply for RandrGetPanning +// size: 36 +type RandrGetPanningReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp Timestamp + Left uint16 + Top uint16 + Width uint16 + Height uint16 + TrackLeft uint16 + TrackTop uint16 + TrackWidth uint16 + TrackHeight uint16 + BorderLeft int16 + BorderTop int16 + BorderRight int16 + BorderBottom int16 +} + +// Waits and reads reply data from request RandrGetPanning +func (cook RandrGetPanningCookie) Reply() (*RandrGetPanningReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetPanningReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetPanning +func randrGetPanningReply(buf []byte) *RandrGetPanningReply { + v := new(RandrGetPanningReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Left = Get16(buf[b:]) + b += 2 + + v.Top = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.TrackLeft = Get16(buf[b:]) + b += 2 + + v.TrackTop = Get16(buf[b:]) + b += 2 + + v.TrackWidth = Get16(buf[b:]) + b += 2 + + v.TrackHeight = Get16(buf[b:]) + b += 2 + + v.BorderLeft = int16(Get16(buf[b:])) + b += 2 + + v.BorderTop = int16(Get16(buf[b:])) + b += 2 + + v.BorderRight = int16(Get16(buf[b:])) + b += 2 + + v.BorderBottom = int16(Get16(buf[b:])) + b += 2 + + return v +} + +func (cook RandrGetPanningCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetPanning +func (c *Conn) randrGetPanningRequest(Crtc Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request RandrSetPanning +// size: 36 +type RandrSetPanningCookie struct { + *cookie +} + +func (c *Conn) RandrSetPanning(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) + return RandrSetPanningCookie{cookie} +} + +func (c *Conn) RandrSetPanningUnchecked(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) + return RandrSetPanningCookie{cookie} +} + +// Request reply for RandrSetPanning +// size: 12 +type RandrSetPanningReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp Timestamp +} + +// Waits and reads reply data from request RandrSetPanning +func (cook RandrSetPanningCookie) Reply() (*RandrSetPanningReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrSetPanningReply(buf), nil +} + +// Read reply into structure from buffer for RandrSetPanning +func randrSetPanningReply(buf []byte) *RandrSetPanningReply { + v := new(RandrSetPanningReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook RandrSetPanningCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetPanning +func (c *Conn) randrSetPanningRequest(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Crtc)) + b += 4 + + Put32(buf[b:], uint32(Timestamp)) + b += 4 + + Put16(buf[b:], Left) + b += 2 + + Put16(buf[b:], Top) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put16(buf[b:], TrackLeft) + b += 2 + + Put16(buf[b:], TrackTop) + b += 2 + + Put16(buf[b:], TrackWidth) + b += 2 + + Put16(buf[b:], TrackHeight) + b += 2 + + Put16(buf[b:], uint16(BorderLeft)) + b += 2 + + Put16(buf[b:], uint16(BorderTop)) + b += 2 + + Put16(buf[b:], uint16(BorderRight)) + b += 2 + + Put16(buf[b:], uint16(BorderBottom)) + b += 2 + + return buf +} + +// Request RandrSetOutputPrimary +// size: 12 +type RandrSetOutputPrimaryCookie struct { + *cookie +} + +// Write request to wire for RandrSetOutputPrimary +func (c *Conn) RandrSetOutputPrimary(Window Id, Output Id) RandrSetOutputPrimaryCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) + return RandrSetOutputPrimaryCookie{cookie} +} + +func (c *Conn) RandrSetOutputPrimaryChecked(Window Id, Output Id) RandrSetOutputPrimaryCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) + return RandrSetOutputPrimaryCookie{cookie} +} + +func (cook RandrSetOutputPrimaryCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrSetOutputPrimary +func (c *Conn) randrSetOutputPrimaryRequest(Window Id, Output Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Output)) + b += 4 + + return buf +} + +// Request RandrGetOutputPrimary +// size: 8 +type RandrGetOutputPrimaryCookie struct { + *cookie +} + +func (c *Conn) RandrGetOutputPrimary(Window Id) RandrGetOutputPrimaryCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) + return RandrGetOutputPrimaryCookie{cookie} +} + +func (c *Conn) RandrGetOutputPrimaryUnchecked(Window Id) RandrGetOutputPrimaryCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) + return RandrGetOutputPrimaryCookie{cookie} +} + +// Request reply for RandrGetOutputPrimary +// size: 12 +type RandrGetOutputPrimaryReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Output Id +} + +// Waits and reads reply data from request RandrGetOutputPrimary +func (cook RandrGetOutputPrimaryCookie) Reply() (*RandrGetOutputPrimaryReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return randrGetOutputPrimaryReply(buf), nil +} + +// Read reply into structure from buffer for RandrGetOutputPrimary +func randrGetOutputPrimaryReply(buf []byte) *RandrGetOutputPrimaryReply { + v := new(RandrGetOutputPrimaryReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Output = Id(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook RandrGetOutputPrimaryCookie) Check() error { + return cook.check() +} + +// Write request to wire for RandrGetOutputPrimary +func (c *Conn) randrGetOutputPrimaryRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RANDR"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/render.go b/nexgb/render.go new file mode 100644 index 0000000..069ce76 --- /dev/null +++ b/nexgb/render.go @@ -0,0 +1,3506 @@ +package xgb + +/* + This file was generated by render.xml on May 5 2012 6:07:02pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + RenderPictTypeIndexed = 0 + RenderPictTypeDirect = 1 +) + +const ( + RenderPictureNone = 0 +) + +const ( + RenderPictOpClear = 0 + RenderPictOpSrc = 1 + RenderPictOpDst = 2 + RenderPictOpOver = 3 + RenderPictOpOverReverse = 4 + RenderPictOpIn = 5 + RenderPictOpInReverse = 6 + RenderPictOpOut = 7 + RenderPictOpOutReverse = 8 + RenderPictOpAtop = 9 + RenderPictOpAtopReverse = 10 + RenderPictOpXor = 11 + RenderPictOpAdd = 12 + RenderPictOpSaturate = 13 + RenderPictOpDisjointClear = 16 + RenderPictOpDisjointSrc = 17 + RenderPictOpDisjointDst = 18 + RenderPictOpDisjointOver = 19 + RenderPictOpDisjointOverReverse = 20 + RenderPictOpDisjointIn = 21 + RenderPictOpDisjointInReverse = 22 + RenderPictOpDisjointOut = 23 + RenderPictOpDisjointOutReverse = 24 + RenderPictOpDisjointAtop = 25 + RenderPictOpDisjointAtopReverse = 26 + RenderPictOpDisjointXor = 27 + RenderPictOpConjointClear = 32 + RenderPictOpConjointSrc = 33 + RenderPictOpConjointDst = 34 + RenderPictOpConjointOver = 35 + RenderPictOpConjointOverReverse = 36 + RenderPictOpConjointIn = 37 + RenderPictOpConjointInReverse = 38 + RenderPictOpConjointOut = 39 + RenderPictOpConjointOutReverse = 40 + RenderPictOpConjointAtop = 41 + RenderPictOpConjointAtopReverse = 42 + RenderPictOpConjointXor = 43 + RenderPictOpMultiply = 48 + RenderPictOpScreen = 49 + RenderPictOpOverlay = 50 + RenderPictOpDarken = 51 + RenderPictOpLighten = 52 + RenderPictOpColorDodge = 53 + RenderPictOpColorBurn = 54 + RenderPictOpHardLight = 55 + RenderPictOpSoftLight = 56 + RenderPictOpDifference = 57 + RenderPictOpExclusion = 58 + RenderPictOpHSLHue = 59 + RenderPictOpHSLSaturation = 60 + RenderPictOpHSLColor = 61 + RenderPictOpHSLLuminosity = 62 +) + +const ( + RenderPolyEdgeSharp = 0 + RenderPolyEdgeSmooth = 1 +) + +const ( + RenderPolyModePrecise = 0 + RenderPolyModeImprecise = 1 +) + +const ( + RenderCpRepeat = 1 + RenderCpAlphaMap = 2 + RenderCpAlphaXOrigin = 4 + RenderCpAlphaYOrigin = 8 + RenderCpClipXOrigin = 16 + RenderCpClipYOrigin = 32 + RenderCpClipMask = 64 + RenderCpGraphicsExposure = 128 + RenderCpSubwindowMode = 256 + RenderCpPolyEdge = 512 + RenderCpPolyMode = 1024 + RenderCpDither = 2048 + RenderCpComponentAlpha = 4096 +) + +const ( + RenderSubPixelUnknown = 0 + RenderSubPixelHorizontalRGB = 1 + RenderSubPixelHorizontalBGR = 2 + RenderSubPixelVerticalRGB = 3 + RenderSubPixelVerticalBGR = 4 + RenderSubPixelNone = 5 +) + +const ( + RenderRepeatNone = 0 + RenderRepeatNormal = 1 + RenderRepeatPad = 2 + RenderRepeatReflect = 3 +) + +// Skipping resource definition of 'Glyphset' + +// Skipping resource definition of 'Picture' + +// Skipping resource definition of 'Pictformat' + +type RenderGlyph uint32 + +type RenderFixed int32 + +// 'RenderDirectformat' struct definition +// Size: 16 +type RenderDirectformat struct { + RedShift uint16 + RedMask uint16 + GreenShift uint16 + GreenMask uint16 + BlueShift uint16 + BlueMask uint16 + AlphaShift uint16 + AlphaMask uint16 +} + +// Struct read RenderDirectformat +func ReadRenderDirectformat(buf []byte, v *RenderDirectformat) int { + b := 0 + + v.RedShift = Get16(buf[b:]) + b += 2 + + v.RedMask = Get16(buf[b:]) + b += 2 + + v.GreenShift = Get16(buf[b:]) + b += 2 + + v.GreenMask = Get16(buf[b:]) + b += 2 + + v.BlueShift = Get16(buf[b:]) + b += 2 + + v.BlueMask = Get16(buf[b:]) + b += 2 + + v.AlphaShift = Get16(buf[b:]) + b += 2 + + v.AlphaMask = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RenderDirectformat +func ReadRenderDirectformatList(buf []byte, dest []RenderDirectformat) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderDirectformat{} + b += ReadRenderDirectformat(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderDirectformat +func (v RenderDirectformat) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + Put16(buf[b:], v.RedShift) + b += 2 + + Put16(buf[b:], v.RedMask) + b += 2 + + Put16(buf[b:], v.GreenShift) + b += 2 + + Put16(buf[b:], v.GreenMask) + b += 2 + + Put16(buf[b:], v.BlueShift) + b += 2 + + Put16(buf[b:], v.BlueMask) + b += 2 + + Put16(buf[b:], v.AlphaShift) + b += 2 + + Put16(buf[b:], v.AlphaMask) + b += 2 + + return buf +} + +// Write struct list RenderDirectformat +func RenderDirectformatListBytes(buf []byte, list []RenderDirectformat) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderPictforminfo' struct definition +// Size: 28 +type RenderPictforminfo struct { + Id Id + Type byte + Depth byte + // padding: 2 bytes + Direct RenderDirectformat + Colormap Id +} + +// Struct read RenderPictforminfo +func ReadRenderPictforminfo(buf []byte, v *RenderPictforminfo) int { + b := 0 + + v.Id = Id(Get32(buf[b:])) + b += 4 + + v.Type = buf[b] + b += 1 + + v.Depth = buf[b] + b += 1 + + b += 2 // padding + + v.Direct = RenderDirectformat{} + b += ReadRenderDirectformat(buf[b:], &v.Direct) + + v.Colormap = Id(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read RenderPictforminfo +func ReadRenderPictforminfoList(buf []byte, dest []RenderPictforminfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderPictforminfo{} + b += ReadRenderPictforminfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderPictforminfo +func (v RenderPictforminfo) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put32(buf[b:], uint32(v.Id)) + b += 4 + + buf[b] = v.Type + b += 1 + + buf[b] = v.Depth + b += 1 + + b += 2 // padding + + { + structBytes := v.Direct.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(v.Colormap)) + b += 4 + + return buf +} + +// Write struct list RenderPictforminfo +func RenderPictforminfoListBytes(buf []byte, list []RenderPictforminfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderPictvisual' struct definition +// Size: 8 +type RenderPictvisual struct { + Visual Visualid + Format Id +} + +// Struct read RenderPictvisual +func ReadRenderPictvisual(buf []byte, v *RenderPictvisual) int { + b := 0 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + v.Format = Id(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read RenderPictvisual +func ReadRenderPictvisualList(buf []byte, dest []RenderPictvisual) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderPictvisual{} + b += ReadRenderPictvisual(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderPictvisual +func (v RenderPictvisual) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Visual)) + b += 4 + + Put32(buf[b:], uint32(v.Format)) + b += 4 + + return buf +} + +// Write struct list RenderPictvisual +func RenderPictvisualListBytes(buf []byte, list []RenderPictvisual) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderPictdepth' struct definition +// Size: (8 + pad((int(NumVisuals) * 8))) +type RenderPictdepth struct { + Depth byte + // padding: 1 bytes + NumVisuals uint16 + // padding: 4 bytes + Visuals []RenderPictvisual // size: pad((int(NumVisuals) * 8)) +} + +// Struct read RenderPictdepth +func ReadRenderPictdepth(buf []byte, v *RenderPictdepth) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + b += 1 // padding + + v.NumVisuals = Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Visuals = make([]RenderPictvisual, v.NumVisuals) + b += ReadRenderPictvisualList(buf[b:], v.Visuals) + + return b +} + +// Struct list read RenderPictdepth +func ReadRenderPictdepthList(buf []byte, dest []RenderPictdepth) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderPictdepth{} + b += ReadRenderPictdepth(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderPictdepth +func (v RenderPictdepth) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.NumVisuals) * 8)))) + b := 0 + + buf[b] = v.Depth + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.NumVisuals) + b += 2 + + b += 4 // padding + + b += RenderPictvisualListBytes(buf[b:], v.Visuals) + + return buf +} + +// Write struct list RenderPictdepth +func RenderPictdepthListBytes(buf []byte, list []RenderPictdepth) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size RenderPictdepth +func RenderPictdepthListSize(list []RenderPictdepth) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.NumVisuals) * 8))) + } + return size +} + +// 'RenderPictscreen' struct definition +// Size: (8 + RenderPictdepthListSize(Depths)) +type RenderPictscreen struct { + NumDepths uint32 + Fallback Id + Depths []RenderPictdepth // size: RenderPictdepthListSize(Depths) +} + +// Struct read RenderPictscreen +func ReadRenderPictscreen(buf []byte, v *RenderPictscreen) int { + b := 0 + + v.NumDepths = Get32(buf[b:]) + b += 4 + + v.Fallback = Id(Get32(buf[b:])) + b += 4 + + v.Depths = make([]RenderPictdepth, v.NumDepths) + b += ReadRenderPictdepthList(buf[b:], v.Depths) + + return b +} + +// Struct list read RenderPictscreen +func ReadRenderPictscreenList(buf []byte, dest []RenderPictscreen) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderPictscreen{} + b += ReadRenderPictscreen(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderPictscreen +func (v RenderPictscreen) Bytes() []byte { + buf := make([]byte, (8 + RenderPictdepthListSize(v.Depths))) + b := 0 + + Put32(buf[b:], v.NumDepths) + b += 4 + + Put32(buf[b:], uint32(v.Fallback)) + b += 4 + + b += RenderPictdepthListBytes(buf[b:], v.Depths) + + return buf +} + +// Write struct list RenderPictscreen +func RenderPictscreenListBytes(buf []byte, list []RenderPictscreen) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size RenderPictscreen +func RenderPictscreenListSize(list []RenderPictscreen) int { + size := 0 + for _, item := range list { + size += (8 + RenderPictdepthListSize(item.Depths)) + } + return size +} + +// 'RenderIndexvalue' struct definition +// Size: 12 +type RenderIndexvalue struct { + Pixel uint32 + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} + +// Struct read RenderIndexvalue +func ReadRenderIndexvalue(buf []byte, v *RenderIndexvalue) int { + b := 0 + + v.Pixel = Get32(buf[b:]) + b += 4 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + v.Alpha = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RenderIndexvalue +func ReadRenderIndexvalueList(buf []byte, dest []RenderIndexvalue) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderIndexvalue{} + b += ReadRenderIndexvalue(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderIndexvalue +func (v RenderIndexvalue) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put32(buf[b:], v.Pixel) + b += 4 + + Put16(buf[b:], v.Red) + b += 2 + + Put16(buf[b:], v.Green) + b += 2 + + Put16(buf[b:], v.Blue) + b += 2 + + Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// Write struct list RenderIndexvalue +func RenderIndexvalueListBytes(buf []byte, list []RenderIndexvalue) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderColor' struct definition +// Size: 8 +type RenderColor struct { + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} + +// Struct read RenderColor +func ReadRenderColor(buf []byte, v *RenderColor) int { + b := 0 + + v.Red = Get16(buf[b:]) + b += 2 + + v.Green = Get16(buf[b:]) + b += 2 + + v.Blue = Get16(buf[b:]) + b += 2 + + v.Alpha = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RenderColor +func ReadRenderColorList(buf []byte, dest []RenderColor) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderColor{} + b += ReadRenderColor(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderColor +func (v RenderColor) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.Red) + b += 2 + + Put16(buf[b:], v.Green) + b += 2 + + Put16(buf[b:], v.Blue) + b += 2 + + Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// Write struct list RenderColor +func RenderColorListBytes(buf []byte, list []RenderColor) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderPointfix' struct definition +// Size: 8 +type RenderPointfix struct { + X RenderFixed + Y RenderFixed +} + +// Struct read RenderPointfix +func ReadRenderPointfix(buf []byte, v *RenderPointfix) int { + b := 0 + + v.X = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Y = RenderFixed(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read RenderPointfix +func ReadRenderPointfixList(buf []byte, dest []RenderPointfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderPointfix +func (v RenderPointfix) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.X)) + b += 4 + + Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// Write struct list RenderPointfix +func RenderPointfixListBytes(buf []byte, list []RenderPointfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderLinefix' struct definition +// Size: 16 +type RenderLinefix struct { + P1 RenderPointfix + P2 RenderPointfix +} + +// Struct read RenderLinefix +func ReadRenderLinefix(buf []byte, v *RenderLinefix) int { + b := 0 + + v.P1 = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &v.P1) + + v.P2 = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &v.P2) + + return b +} + +// Struct list read RenderLinefix +func ReadRenderLinefixList(buf []byte, dest []RenderLinefix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderLinefix{} + b += ReadRenderLinefix(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderLinefix +func (v RenderLinefix) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list RenderLinefix +func RenderLinefixListBytes(buf []byte, list []RenderLinefix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderTriangle' struct definition +// Size: 24 +type RenderTriangle struct { + P1 RenderPointfix + P2 RenderPointfix + P3 RenderPointfix +} + +// Struct read RenderTriangle +func ReadRenderTriangle(buf []byte, v *RenderTriangle) int { + b := 0 + + v.P1 = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &v.P1) + + v.P2 = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &v.P2) + + v.P3 = RenderPointfix{} + b += ReadRenderPointfix(buf[b:], &v.P3) + + return b +} + +// Struct list read RenderTriangle +func ReadRenderTriangleList(buf []byte, dest []RenderTriangle) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderTriangle{} + b += ReadRenderTriangle(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderTriangle +func (v RenderTriangle) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.P3.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list RenderTriangle +func RenderTriangleListBytes(buf []byte, list []RenderTriangle) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderTrapezoid' struct definition +// Size: 40 +type RenderTrapezoid struct { + Top RenderFixed + Bottom RenderFixed + Left RenderLinefix + Right RenderLinefix +} + +// Struct read RenderTrapezoid +func ReadRenderTrapezoid(buf []byte, v *RenderTrapezoid) int { + b := 0 + + v.Top = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Bottom = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Left = RenderLinefix{} + b += ReadRenderLinefix(buf[b:], &v.Left) + + v.Right = RenderLinefix{} + b += ReadRenderLinefix(buf[b:], &v.Right) + + return b +} + +// Struct list read RenderTrapezoid +func ReadRenderTrapezoidList(buf []byte, dest []RenderTrapezoid) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderTrapezoid{} + b += ReadRenderTrapezoid(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderTrapezoid +func (v RenderTrapezoid) Bytes() []byte { + buf := make([]byte, 40) + b := 0 + + Put32(buf[b:], uint32(v.Top)) + b += 4 + + Put32(buf[b:], uint32(v.Bottom)) + b += 4 + + { + structBytes := v.Left.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.Right.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list RenderTrapezoid +func RenderTrapezoidListBytes(buf []byte, list []RenderTrapezoid) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderGlyphinfo' struct definition +// Size: 12 +type RenderGlyphinfo struct { + Width uint16 + Height uint16 + X int16 + Y int16 + XOff int16 + YOff int16 +} + +// Struct read RenderGlyphinfo +func ReadRenderGlyphinfo(buf []byte, v *RenderGlyphinfo) int { + b := 0 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.XOff = int16(Get16(buf[b:])) + b += 2 + + v.YOff = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read RenderGlyphinfo +func ReadRenderGlyphinfoList(buf []byte, dest []RenderGlyphinfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderGlyphinfo{} + b += ReadRenderGlyphinfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderGlyphinfo +func (v RenderGlyphinfo) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], uint16(v.X)) + b += 2 + + Put16(buf[b:], uint16(v.Y)) + b += 2 + + Put16(buf[b:], uint16(v.XOff)) + b += 2 + + Put16(buf[b:], uint16(v.YOff)) + b += 2 + + return buf +} + +// Write struct list RenderGlyphinfo +func RenderGlyphinfoListBytes(buf []byte, list []RenderGlyphinfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderTransform' struct definition +// Size: 36 +type RenderTransform struct { + Matrix11 RenderFixed + Matrix12 RenderFixed + Matrix13 RenderFixed + Matrix21 RenderFixed + Matrix22 RenderFixed + Matrix23 RenderFixed + Matrix31 RenderFixed + Matrix32 RenderFixed + Matrix33 RenderFixed +} + +// Struct read RenderTransform +func ReadRenderTransform(buf []byte, v *RenderTransform) int { + b := 0 + + v.Matrix11 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix12 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix13 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix21 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix22 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix23 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix31 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix32 = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Matrix33 = RenderFixed(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read RenderTransform +func ReadRenderTransformList(buf []byte, dest []RenderTransform) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderTransform{} + b += ReadRenderTransform(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderTransform +func (v RenderTransform) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + Put32(buf[b:], uint32(v.Matrix11)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix12)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix13)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix21)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix22)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix23)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix31)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix32)) + b += 4 + + Put32(buf[b:], uint32(v.Matrix33)) + b += 4 + + return buf +} + +// Write struct list RenderTransform +func RenderTransformListBytes(buf []byte, list []RenderTransform) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderAnimcursorelt' struct definition +// Size: 8 +type RenderAnimcursorelt struct { + Cursor Id + Delay uint32 +} + +// Struct read RenderAnimcursorelt +func ReadRenderAnimcursorelt(buf []byte, v *RenderAnimcursorelt) int { + b := 0 + + v.Cursor = Id(Get32(buf[b:])) + b += 4 + + v.Delay = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read RenderAnimcursorelt +func ReadRenderAnimcursoreltList(buf []byte, dest []RenderAnimcursorelt) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderAnimcursorelt{} + b += ReadRenderAnimcursorelt(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderAnimcursorelt +func (v RenderAnimcursorelt) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Cursor)) + b += 4 + + Put32(buf[b:], v.Delay) + b += 4 + + return buf +} + +// Write struct list RenderAnimcursorelt +func RenderAnimcursoreltListBytes(buf []byte, list []RenderAnimcursorelt) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderSpanfix' struct definition +// Size: 12 +type RenderSpanfix struct { + L RenderFixed + R RenderFixed + Y RenderFixed +} + +// Struct read RenderSpanfix +func ReadRenderSpanfix(buf []byte, v *RenderSpanfix) int { + b := 0 + + v.L = RenderFixed(Get32(buf[b:])) + b += 4 + + v.R = RenderFixed(Get32(buf[b:])) + b += 4 + + v.Y = RenderFixed(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read RenderSpanfix +func ReadRenderSpanfixList(buf []byte, dest []RenderSpanfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderSpanfix{} + b += ReadRenderSpanfix(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderSpanfix +func (v RenderSpanfix) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put32(buf[b:], uint32(v.L)) + b += 4 + + Put32(buf[b:], uint32(v.R)) + b += 4 + + Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// Write struct list RenderSpanfix +func RenderSpanfixListBytes(buf []byte, list []RenderSpanfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RenderTrap' struct definition +// Size: 24 +type RenderTrap struct { + Top RenderSpanfix + Bot RenderSpanfix +} + +// Struct read RenderTrap +func ReadRenderTrap(buf []byte, v *RenderTrap) int { + b := 0 + + v.Top = RenderSpanfix{} + b += ReadRenderSpanfix(buf[b:], &v.Top) + + v.Bot = RenderSpanfix{} + b += ReadRenderSpanfix(buf[b:], &v.Bot) + + return b +} + +// Struct list read RenderTrap +func ReadRenderTrapList(buf []byte, dest []RenderTrap) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RenderTrap{} + b += ReadRenderTrap(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RenderTrap +func (v RenderTrap) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.Top.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.Bot.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list RenderTrap +func RenderTrapListBytes(buf []byte, list []RenderTrap) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Error definition RenderPictFormat (0) +// Size: 32 + +const BadRenderPictFormat = 0 + +type RenderPictFormatError struct { + Sequence uint16 + NiceName string +} + +// Error read RenderPictFormat +func NewRenderPictFormatError(buf []byte) Error { + v := RenderPictFormatError{} + v.NiceName = "RenderPictFormat" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RenderPictFormatError) ImplementsError() {} + +func (err RenderPictFormatError) SequenceId() uint16 { + return err.Sequence +} + +func (err RenderPictFormatError) BadId() Id { + return 0 +} + +func (err RenderPictFormatError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRenderPictFormat {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewRenderPictFormatError +} + +// Error definition RenderPicture (1) +// Size: 32 + +const BadRenderPicture = 1 + +type RenderPictureError struct { + Sequence uint16 + NiceName string +} + +// Error read RenderPicture +func NewRenderPictureError(buf []byte) Error { + v := RenderPictureError{} + v.NiceName = "RenderPicture" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RenderPictureError) ImplementsError() {} + +func (err RenderPictureError) SequenceId() uint16 { + return err.Sequence +} + +func (err RenderPictureError) BadId() Id { + return 0 +} + +func (err RenderPictureError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRenderPicture {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewRenderPictureError +} + +// Error definition RenderPictOp (2) +// Size: 32 + +const BadRenderPictOp = 2 + +type RenderPictOpError struct { + Sequence uint16 + NiceName string +} + +// Error read RenderPictOp +func NewRenderPictOpError(buf []byte) Error { + v := RenderPictOpError{} + v.NiceName = "RenderPictOp" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RenderPictOpError) ImplementsError() {} + +func (err RenderPictOpError) SequenceId() uint16 { + return err.Sequence +} + +func (err RenderPictOpError) BadId() Id { + return 0 +} + +func (err RenderPictOpError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRenderPictOp {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewRenderPictOpError +} + +// Error definition RenderGlyphSet (3) +// Size: 32 + +const BadRenderGlyphSet = 3 + +type RenderGlyphSetError struct { + Sequence uint16 + NiceName string +} + +// Error read RenderGlyphSet +func NewRenderGlyphSetError(buf []byte) Error { + v := RenderGlyphSetError{} + v.NiceName = "RenderGlyphSet" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RenderGlyphSetError) ImplementsError() {} + +func (err RenderGlyphSetError) SequenceId() uint16 { + return err.Sequence +} + +func (err RenderGlyphSetError) BadId() Id { + return 0 +} + +func (err RenderGlyphSetError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRenderGlyphSet {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[3] = NewRenderGlyphSetError +} + +// Error definition RenderGlyph (4) +// Size: 32 + +const BadRenderGlyph = 4 + +type RenderGlyphError struct { + Sequence uint16 + NiceName string +} + +// Error read RenderGlyph +func NewRenderGlyphError(buf []byte) Error { + v := RenderGlyphError{} + v.NiceName = "RenderGlyph" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err RenderGlyphError) ImplementsError() {} + +func (err RenderGlyphError) SequenceId() uint16 { + return err.Sequence +} + +func (err RenderGlyphError) BadId() Id { + return 0 +} + +func (err RenderGlyphError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadRenderGlyph {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[4] = NewRenderGlyphError +} + +// Request RenderQueryVersion +// size: 12 +type RenderQueryVersionCookie struct { + *cookie +} + +func (c *Conn) RenderQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) RenderQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.renderQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return RenderQueryVersionCookie{cookie} +} + +func (c *Conn) RenderQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) RenderQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.renderQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return RenderQueryVersionCookie{cookie} +} + +// Request reply for RenderQueryVersion +// size: 32 +type RenderQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request RenderQueryVersion +func (cook RenderQueryVersionCookie) Reply() (*RenderQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return renderQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for RenderQueryVersion +func renderQueryVersionReply(buf []byte) *RenderQueryVersionReply { + v := new(RenderQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook RenderQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderQueryVersion +func (c *Conn) renderQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ClientMajorVersion) + b += 4 + + Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request RenderQueryPictFormats +// size: 4 +type RenderQueryPictFormatsCookie struct { + *cookie +} + +func (c *Conn) RenderQueryPictFormats() RenderQueryPictFormatsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.renderQueryPictFormatsRequest(), cookie) + return RenderQueryPictFormatsCookie{cookie} +} + +func (c *Conn) RenderQueryPictFormatsUnchecked() RenderQueryPictFormatsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.renderQueryPictFormatsRequest(), cookie) + return RenderQueryPictFormatsCookie{cookie} +} + +// Request reply for RenderQueryPictFormats +// size: (((32 + pad((int(NumFormats) * 28))) + RenderPictscreenListSize(Screens)) + pad((int(NumSubpixel) * 4))) +type RenderQueryPictFormatsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFormats uint32 + NumScreens uint32 + NumDepths uint32 + NumVisuals uint32 + NumSubpixel uint32 + // padding: 4 bytes + Formats []RenderPictforminfo // size: pad((int(NumFormats) * 28)) + Screens []RenderPictscreen // size: RenderPictscreenListSize(Screens) + Subpixels []uint32 // size: pad((int(NumSubpixel) * 4)) +} + +// Waits and reads reply data from request RenderQueryPictFormats +func (cook RenderQueryPictFormatsCookie) Reply() (*RenderQueryPictFormatsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return renderQueryPictFormatsReply(buf), nil +} + +// Read reply into structure from buffer for RenderQueryPictFormats +func renderQueryPictFormatsReply(buf []byte) *RenderQueryPictFormatsReply { + v := new(RenderQueryPictFormatsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFormats = Get32(buf[b:]) + b += 4 + + v.NumScreens = Get32(buf[b:]) + b += 4 + + v.NumDepths = Get32(buf[b:]) + b += 4 + + v.NumVisuals = Get32(buf[b:]) + b += 4 + + v.NumSubpixel = Get32(buf[b:]) + b += 4 + + b += 4 // padding + + v.Formats = make([]RenderPictforminfo, v.NumFormats) + b += ReadRenderPictforminfoList(buf[b:], v.Formats) + + v.Screens = make([]RenderPictscreen, v.NumScreens) + b += ReadRenderPictscreenList(buf[b:], v.Screens) + + v.Subpixels = make([]uint32, v.NumSubpixel) + for i := 0; i < int(v.NumSubpixel); i++ { + v.Subpixels[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook RenderQueryPictFormatsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderQueryPictFormats +func (c *Conn) renderQueryPictFormatsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request RenderQueryPictIndexValues +// size: 8 +type RenderQueryPictIndexValuesCookie struct { + *cookie +} + +func (c *Conn) RenderQueryPictIndexValues(Format Id) RenderQueryPictIndexValuesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) + return RenderQueryPictIndexValuesCookie{cookie} +} + +func (c *Conn) RenderQueryPictIndexValuesUnchecked(Format Id) RenderQueryPictIndexValuesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) + return RenderQueryPictIndexValuesCookie{cookie} +} + +// Request reply for RenderQueryPictIndexValues +// size: (32 + pad((int(NumValues) * 12))) +type RenderQueryPictIndexValuesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumValues uint32 + // padding: 20 bytes + Values []RenderIndexvalue // size: pad((int(NumValues) * 12)) +} + +// Waits and reads reply data from request RenderQueryPictIndexValues +func (cook RenderQueryPictIndexValuesCookie) Reply() (*RenderQueryPictIndexValuesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return renderQueryPictIndexValuesReply(buf), nil +} + +// Read reply into structure from buffer for RenderQueryPictIndexValues +func renderQueryPictIndexValuesReply(buf []byte) *RenderQueryPictIndexValuesReply { + v := new(RenderQueryPictIndexValuesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumValues = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Values = make([]RenderIndexvalue, v.NumValues) + b += ReadRenderIndexvalueList(buf[b:], v.Values) + + return v +} + +func (cook RenderQueryPictIndexValuesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderQueryPictIndexValues +func (c *Conn) renderQueryPictIndexValuesRequest(Format Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Format)) + b += 4 + + return buf +} + +// Request RenderCreatePicture +// size: pad((16 + (4 + pad((4 * popCount(int(ValueMask))))))) +type RenderCreatePictureCookie struct { + *cookie +} + +// Write request to wire for RenderCreatePicture +func (c *Conn) RenderCreatePicture(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) + return RenderCreatePictureCookie{cookie} +} + +func (c *Conn) RenderCreatePictureChecked(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) + return RenderCreatePictureCookie{cookie} +} + +func (cook RenderCreatePictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreatePicture +func (c *Conn) renderCreatePictureRequest(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((16 + (4 + pad((4 * popCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Pid)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Format)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RenderChangePicture +// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +type RenderChangePictureCookie struct { + *cookie +} + +// Write request to wire for RenderChangePicture +func (c *Conn) RenderChangePicture(Picture Id, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) + return RenderChangePictureCookie{cookie} +} + +func (c *Conn) RenderChangePictureChecked(Picture Id, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) + return RenderChangePictureCookie{cookie} +} + +func (cook RenderChangePictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderChangePicture +func (c *Conn) renderChangePictureRequest(Picture Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RenderSetPictureClipRectangles +// size: pad((12 + pad((len(Rectangles) * 8)))) +type RenderSetPictureClipRectanglesCookie struct { + *cookie +} + +// Write request to wire for RenderSetPictureClipRectangles +func (c *Conn) RenderSetPictureClipRectangles(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return RenderSetPictureClipRectanglesCookie{cookie} +} + +func (c *Conn) RenderSetPictureClipRectanglesChecked(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return RenderSetPictureClipRectanglesCookie{cookie} +} + +func (cook RenderSetPictureClipRectanglesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderSetPictureClipRectangles +func (c *Conn) renderSetPictureClipRectanglesRequest(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { + size := pad((12 + pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + Put16(buf[b:], uint16(ClipXOrigin)) + b += 2 + + Put16(buf[b:], uint16(ClipYOrigin)) + b += 2 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request RenderFreePicture +// size: 8 +type RenderFreePictureCookie struct { + *cookie +} + +// Write request to wire for RenderFreePicture +func (c *Conn) RenderFreePicture(Picture Id) RenderFreePictureCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderFreePictureRequest(Picture), cookie) + return RenderFreePictureCookie{cookie} +} + +func (c *Conn) RenderFreePictureChecked(Picture Id) RenderFreePictureCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderFreePictureRequest(Picture), cookie) + return RenderFreePictureCookie{cookie} +} + +func (cook RenderFreePictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderFreePicture +func (c *Conn) renderFreePictureRequest(Picture Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// Request RenderComposite +// size: 36 +type RenderCompositeCookie struct { + *cookie +} + +// Write request to wire for RenderComposite +func (c *Conn) RenderComposite(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return RenderCompositeCookie{cookie} +} + +func (c *Conn) RenderCompositeChecked(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return RenderCompositeCookie{cookie} +} + +func (cook RenderCompositeCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderComposite +func (c *Conn) renderCompositeRequest(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Mask)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], uint16(MaskX)) + b += 2 + + Put16(buf[b:], uint16(MaskY)) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request RenderTrapezoids +// size: pad((24 + pad((len(Traps) * 40)))) +type RenderTrapezoidsCookie struct { + *cookie +} + +// Write request to wire for RenderTrapezoids +func (c *Conn) RenderTrapezoids(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) + return RenderTrapezoidsCookie{cookie} +} + +func (c *Conn) RenderTrapezoidsChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) + return RenderTrapezoidsCookie{cookie} +} + +func (cook RenderTrapezoidsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderTrapezoids +func (c *Conn) renderTrapezoidsRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) []byte { + size := pad((24 + pad((len(Traps) * 40)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += RenderTrapezoidListBytes(buf[b:], Traps) + + return buf +} + +// Request RenderTriangles +// size: pad((24 + pad((len(Triangles) * 24)))) +type RenderTrianglesCookie struct { + *cookie +} + +// Write request to wire for RenderTriangles +func (c *Conn) RenderTriangles(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return RenderTrianglesCookie{cookie} +} + +func (c *Conn) RenderTrianglesChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return RenderTrianglesCookie{cookie} +} + +func (cook RenderTrianglesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderTriangles +func (c *Conn) renderTrianglesRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) []byte { + size := pad((24 + pad((len(Triangles) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += RenderTriangleListBytes(buf[b:], Triangles) + + return buf +} + +// Request RenderTriStrip +// size: pad((24 + pad((len(Points) * 8)))) +type RenderTriStripCookie struct { + *cookie +} + +// Write request to wire for RenderTriStrip +func (c *Conn) RenderTriStrip(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return RenderTriStripCookie{cookie} +} + +func (c *Conn) RenderTriStripChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return RenderTriStripCookie{cookie} +} + +func (cook RenderTriStripCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderTriStrip +func (c *Conn) renderTriStripRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { + size := pad((24 + pad((len(Points) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += RenderPointfixListBytes(buf[b:], Points) + + return buf +} + +// Request RenderTriFan +// size: pad((24 + pad((len(Points) * 8)))) +type RenderTriFanCookie struct { + *cookie +} + +// Write request to wire for RenderTriFan +func (c *Conn) RenderTriFan(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return RenderTriFanCookie{cookie} +} + +func (c *Conn) RenderTriFanChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return RenderTriFanCookie{cookie} +} + +func (cook RenderTriFanCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderTriFan +func (c *Conn) renderTriFanRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { + size := pad((24 + pad((len(Points) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += RenderPointfixListBytes(buf[b:], Points) + + return buf +} + +// Request RenderCreateGlyphSet +// size: 12 +type RenderCreateGlyphSetCookie struct { + *cookie +} + +// Write request to wire for RenderCreateGlyphSet +func (c *Conn) RenderCreateGlyphSet(Gsid Id, Format Id) RenderCreateGlyphSetCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) + return RenderCreateGlyphSetCookie{cookie} +} + +func (c *Conn) RenderCreateGlyphSetChecked(Gsid Id, Format Id) RenderCreateGlyphSetCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) + return RenderCreateGlyphSetCookie{cookie} +} + +func (cook RenderCreateGlyphSetCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateGlyphSet +func (c *Conn) renderCreateGlyphSetRequest(Gsid Id, Format Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gsid)) + b += 4 + + Put32(buf[b:], uint32(Format)) + b += 4 + + return buf +} + +// Request RenderReferenceGlyphSet +// size: 12 +type RenderReferenceGlyphSetCookie struct { + *cookie +} + +// Write request to wire for RenderReferenceGlyphSet +func (c *Conn) RenderReferenceGlyphSet(Gsid Id, Existing Id) RenderReferenceGlyphSetCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) + return RenderReferenceGlyphSetCookie{cookie} +} + +func (c *Conn) RenderReferenceGlyphSetChecked(Gsid Id, Existing Id) RenderReferenceGlyphSetCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) + return RenderReferenceGlyphSetCookie{cookie} +} + +func (cook RenderReferenceGlyphSetCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderReferenceGlyphSet +func (c *Conn) renderReferenceGlyphSetRequest(Gsid Id, Existing Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gsid)) + b += 4 + + Put32(buf[b:], uint32(Existing)) + b += 4 + + return buf +} + +// Request RenderFreeGlyphSet +// size: 8 +type RenderFreeGlyphSetCookie struct { + *cookie +} + +// Write request to wire for RenderFreeGlyphSet +func (c *Conn) RenderFreeGlyphSet(Glyphset Id) RenderFreeGlyphSetCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) + return RenderFreeGlyphSetCookie{cookie} +} + +func (c *Conn) RenderFreeGlyphSetChecked(Glyphset Id) RenderFreeGlyphSetCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) + return RenderFreeGlyphSetCookie{cookie} +} + +func (cook RenderFreeGlyphSetCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderFreeGlyphSet +func (c *Conn) renderFreeGlyphSetRequest(Glyphset Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + return buf +} + +// Request RenderAddGlyphs +// size: pad((((12 + pad((int(GlyphsLen) * 4))) + pad((int(GlyphsLen) * 12))) + pad((len(Data) * 1)))) +type RenderAddGlyphsCookie struct { + *cookie +} + +// Write request to wire for RenderAddGlyphs +func (c *Conn) RenderAddGlyphs(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return RenderAddGlyphsCookie{cookie} +} + +func (c *Conn) RenderAddGlyphsChecked(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return RenderAddGlyphsCookie{cookie} +} + +func (cook RenderAddGlyphsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderAddGlyphs +func (c *Conn) renderAddGlyphsRequest(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) []byte { + size := pad((((12 + pad((int(GlyphsLen) * 4))) + pad((int(GlyphsLen) * 12))) + pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + Put32(buf[b:], GlyphsLen) + b += 4 + + for i := 0; i < int(GlyphsLen); i++ { + Put32(buf[b:], Glyphids[i]) + b += 4 + } + b = pad(b) + + b += RenderGlyphinfoListBytes(buf[b:], Glyphs) + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + return buf +} + +// Request RenderFreeGlyphs +// size: pad((8 + pad((len(Glyphs) * 4)))) +type RenderFreeGlyphsCookie struct { + *cookie +} + +// Write request to wire for RenderFreeGlyphs +func (c *Conn) RenderFreeGlyphs(Glyphset Id, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) + return RenderFreeGlyphsCookie{cookie} +} + +func (c *Conn) RenderFreeGlyphsChecked(Glyphset Id, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) + return RenderFreeGlyphsCookie{cookie} +} + +func (cook RenderFreeGlyphsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderFreeGlyphs +func (c *Conn) renderFreeGlyphsRequest(Glyphset Id, Glyphs []RenderGlyph) []byte { + size := pad((8 + pad((len(Glyphs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + for i := 0; i < int(len(Glyphs)); i++ { + Put32(buf[b:], uint32(Glyphs[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RenderCompositeGlyphs8 +// size: pad((28 + pad((len(Glyphcmds) * 1)))) +type RenderCompositeGlyphs8Cookie struct { + *cookie +} + +// Write request to wire for RenderCompositeGlyphs8 +func (c *Conn) RenderCompositeGlyphs8(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs8Cookie{cookie} +} + +func (c *Conn) RenderCompositeGlyphs8Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs8Cookie{cookie} +} + +func (cook RenderCompositeGlyphs8Cookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCompositeGlyphs8 +func (c *Conn) renderCompositeGlyphs8Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := pad((28 + pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += pad(int(len(Glyphcmds))) + + return buf +} + +// Request RenderCompositeGlyphs16 +// size: pad((28 + pad((len(Glyphcmds) * 1)))) +type RenderCompositeGlyphs16Cookie struct { + *cookie +} + +// Write request to wire for RenderCompositeGlyphs16 +func (c *Conn) RenderCompositeGlyphs16(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs16Cookie{cookie} +} + +func (c *Conn) RenderCompositeGlyphs16Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs16Cookie{cookie} +} + +func (cook RenderCompositeGlyphs16Cookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCompositeGlyphs16 +func (c *Conn) renderCompositeGlyphs16Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := pad((28 + pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += pad(int(len(Glyphcmds))) + + return buf +} + +// Request RenderCompositeGlyphs32 +// size: pad((28 + pad((len(Glyphcmds) * 1)))) +type RenderCompositeGlyphs32Cookie struct { + *cookie +} + +// Write request to wire for RenderCompositeGlyphs32 +func (c *Conn) RenderCompositeGlyphs32(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs32Cookie{cookie} +} + +func (c *Conn) RenderCompositeGlyphs32Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return RenderCompositeGlyphs32Cookie{cookie} +} + +func (cook RenderCompositeGlyphs32Cookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCompositeGlyphs32 +func (c *Conn) renderCompositeGlyphs32Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := pad((28 + pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dst)) + b += 4 + + Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + Put32(buf[b:], uint32(Glyphset)) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += pad(int(len(Glyphcmds))) + + return buf +} + +// Request RenderFillRectangles +// size: pad((20 + pad((len(Rects) * 8)))) +type RenderFillRectanglesCookie struct { + *cookie +} + +// Write request to wire for RenderFillRectangles +func (c *Conn) RenderFillRectangles(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) + return RenderFillRectanglesCookie{cookie} +} + +func (c *Conn) RenderFillRectanglesChecked(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) + return RenderFillRectanglesCookie{cookie} +} + +func (cook RenderFillRectanglesCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderFillRectangles +func (c *Conn) renderFillRectanglesRequest(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) []byte { + size := pad((20 + pad((len(Rects) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Dst)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + b += RectangleListBytes(buf[b:], Rects) + + return buf +} + +// Request RenderCreateCursor +// size: 16 +type RenderCreateCursorCookie struct { + *cookie +} + +// Write request to wire for RenderCreateCursor +func (c *Conn) RenderCreateCursor(Cid Id, Source Id, X uint16, Y uint16) RenderCreateCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) + return RenderCreateCursorCookie{cookie} +} + +func (c *Conn) RenderCreateCursorChecked(Cid Id, Source Id, X uint16, Y uint16) RenderCreateCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) + return RenderCreateCursorCookie{cookie} +} + +func (cook RenderCreateCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateCursor +func (c *Conn) renderCreateCursorRequest(Cid Id, Source Id, X uint16, Y uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cid)) + b += 4 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put16(buf[b:], X) + b += 2 + + Put16(buf[b:], Y) + b += 2 + + return buf +} + +// Request RenderSetPictureTransform +// size: 44 +type RenderSetPictureTransformCookie struct { + *cookie +} + +// Write request to wire for RenderSetPictureTransform +func (c *Conn) RenderSetPictureTransform(Picture Id, Transform RenderTransform) RenderSetPictureTransformCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) + return RenderSetPictureTransformCookie{cookie} +} + +func (c *Conn) RenderSetPictureTransformChecked(Picture Id, Transform RenderTransform) RenderSetPictureTransformCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) + return RenderSetPictureTransformCookie{cookie} +} + +func (cook RenderSetPictureTransformCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderSetPictureTransform +func (c *Conn) renderSetPictureTransformRequest(Picture Id, Transform RenderTransform) []byte { + size := 44 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Transform.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Request RenderQueryFilters +// size: 8 +type RenderQueryFiltersCookie struct { + *cookie +} + +func (c *Conn) RenderQueryFilters(Drawable Id) RenderQueryFiltersCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) + return RenderQueryFiltersCookie{cookie} +} + +func (c *Conn) RenderQueryFiltersUnchecked(Drawable Id) RenderQueryFiltersCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) + return RenderQueryFiltersCookie{cookie} +} + +// Request reply for RenderQueryFilters +// size: ((32 + pad((int(NumAliases) * 2))) + StrListSize(Filters)) +type RenderQueryFiltersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAliases uint32 + NumFilters uint32 + // padding: 16 bytes + Aliases []uint16 // size: pad((int(NumAliases) * 2)) + Filters []Str // size: StrListSize(Filters) +} + +// Waits and reads reply data from request RenderQueryFilters +func (cook RenderQueryFiltersCookie) Reply() (*RenderQueryFiltersReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return renderQueryFiltersReply(buf), nil +} + +// Read reply into structure from buffer for RenderQueryFilters +func renderQueryFiltersReply(buf []byte) *RenderQueryFiltersReply { + v := new(RenderQueryFiltersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAliases = Get32(buf[b:]) + b += 4 + + v.NumFilters = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.Aliases = make([]uint16, v.NumAliases) + for i := 0; i < int(v.NumAliases); i++ { + v.Aliases[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + v.Filters = make([]Str, v.NumFilters) + b += ReadStrList(buf[b:], v.Filters) + + return v +} + +func (cook RenderQueryFiltersCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderQueryFilters +func (c *Conn) renderQueryFiltersRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request RenderSetPictureFilter +// size: pad(((12 + pad((int(FilterLen) * 1))) + pad((len(Values) * 4)))) +type RenderSetPictureFilterCookie struct { + *cookie +} + +// Write request to wire for RenderSetPictureFilter +func (c *Conn) RenderSetPictureFilter(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) + return RenderSetPictureFilterCookie{cookie} +} + +func (c *Conn) RenderSetPictureFilterChecked(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) + return RenderSetPictureFilterCookie{cookie} +} + +func (cook RenderSetPictureFilterCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderSetPictureFilter +func (c *Conn) renderSetPictureFilterRequest(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) []byte { + size := pad(((12 + pad((int(FilterLen) * 1))) + pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + Put16(buf[b:], FilterLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Filter[:FilterLen]) + b += pad(int(FilterLen)) + + for i := 0; i < int(len(Values)); i++ { + Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RenderCreateAnimCursor +// size: pad((8 + pad((len(Cursors) * 8)))) +type RenderCreateAnimCursorCookie struct { + *cookie +} + +// Write request to wire for RenderCreateAnimCursor +func (c *Conn) RenderCreateAnimCursor(Cid Id, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) + return RenderCreateAnimCursorCookie{cookie} +} + +func (c *Conn) RenderCreateAnimCursorChecked(Cid Id, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) + return RenderCreateAnimCursorCookie{cookie} +} + +func (cook RenderCreateAnimCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateAnimCursor +func (c *Conn) renderCreateAnimCursorRequest(Cid Id, Cursors []RenderAnimcursorelt) []byte { + size := pad((8 + pad((len(Cursors) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cid)) + b += 4 + + b += RenderAnimcursoreltListBytes(buf[b:], Cursors) + + return buf +} + +// Request RenderAddTraps +// size: pad((12 + pad((len(Traps) * 24)))) +type RenderAddTrapsCookie struct { + *cookie +} + +// Write request to wire for RenderAddTraps +func (c *Conn) RenderAddTraps(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) + return RenderAddTrapsCookie{cookie} +} + +func (c *Conn) RenderAddTrapsChecked(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) + return RenderAddTrapsCookie{cookie} +} + +func (cook RenderAddTrapsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderAddTraps +func (c *Conn) renderAddTrapsRequest(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) []byte { + size := pad((12 + pad((len(Traps) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + Put16(buf[b:], uint16(XOff)) + b += 2 + + Put16(buf[b:], uint16(YOff)) + b += 2 + + b += RenderTrapListBytes(buf[b:], Traps) + + return buf +} + +// Request RenderCreateSolidFill +// size: 16 +type RenderCreateSolidFillCookie struct { + *cookie +} + +// Write request to wire for RenderCreateSolidFill +func (c *Conn) RenderCreateSolidFill(Picture Id, Color RenderColor) RenderCreateSolidFillCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) + return RenderCreateSolidFillCookie{cookie} +} + +func (c *Conn) RenderCreateSolidFillChecked(Picture Id, Color RenderColor) RenderCreateSolidFillCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) + return RenderCreateSolidFillCookie{cookie} +} + +func (cook RenderCreateSolidFillCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateSolidFill +func (c *Conn) renderCreateSolidFillRequest(Picture Id, Color RenderColor) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Request RenderCreateLinearGradient +// size: pad(((28 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) +type RenderCreateLinearGradientCookie struct { + *cookie +} + +// Write request to wire for RenderCreateLinearGradient +func (c *Conn) RenderCreateLinearGradient(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) + return RenderCreateLinearGradientCookie{cookie} +} + +func (c *Conn) RenderCreateLinearGradientChecked(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) + return RenderCreateLinearGradientCookie{cookie} +} + +func (cook RenderCreateLinearGradientCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateLinearGradient +func (c *Conn) renderCreateLinearGradientRequest(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { + size := pad(((28 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := P1.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := P2.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = pad(b) + + b += RenderColorListBytes(buf[b:], Colors) + + return buf +} + +// Request RenderCreateRadialGradient +// size: pad(((36 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) +type RenderCreateRadialGradientCookie struct { + *cookie +} + +// Write request to wire for RenderCreateRadialGradient +func (c *Conn) RenderCreateRadialGradient(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return RenderCreateRadialGradientCookie{cookie} +} + +func (c *Conn) RenderCreateRadialGradientChecked(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return RenderCreateRadialGradientCookie{cookie} +} + +func (cook RenderCreateRadialGradientCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateRadialGradient +func (c *Conn) renderCreateRadialGradientRequest(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { + size := pad(((36 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Inner.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := Outer.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(InnerRadius)) + b += 4 + + Put32(buf[b:], uint32(OuterRadius)) + b += 4 + + Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = pad(b) + + b += RenderColorListBytes(buf[b:], Colors) + + return buf +} + +// Request RenderCreateConicalGradient +// size: pad(((24 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) +type RenderCreateConicalGradientCookie struct { + *cookie +} + +// Write request to wire for RenderCreateConicalGradient +func (c *Conn) RenderCreateConicalGradient(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return RenderCreateConicalGradientCookie{cookie} +} + +func (c *Conn) RenderCreateConicalGradientChecked(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return RenderCreateConicalGradientCookie{cookie} +} + +func (cook RenderCreateConicalGradientCookie) Check() error { + return cook.check() +} + +// Write request to wire for RenderCreateConicalGradient +func (c *Conn) renderCreateConicalGradientRequest(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { + size := pad(((24 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RENDER"] + b += 1 + + buf[b] = 36 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Center.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(Angle)) + b += 4 + + Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = pad(b) + + b += RenderColorListBytes(buf[b:], Colors) + + return buf +} diff --git a/nexgb/xgb.go b/nexgb/xgb.go index b453427..26c0138 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -17,6 +17,11 @@ import ( ) const ( + // cookieBuffer represents the queue size of cookies existing at any + // point in time. The size of the buffer is really only important when + // there are many requests without replies made in sequence. Once the + // buffer fills, a round trip request is made to clear the buffer. + cookieBuffer = 1000 readBuffer = 100 writeBuffer = 100 ) @@ -32,7 +37,7 @@ type Conn struct { extensions map[string]byte eventChan chan eventOrError - cookieChan chan cookie + cookieChan chan *cookie xidChan chan xid seqChan chan uint16 reqChan chan *request @@ -68,7 +73,7 @@ func NewConnDisplay(display string) (*Conn, error) { conn.extensions = make(map[string]byte) - conn.cookieChan = make(chan cookie, 100) + conn.cookieChan = make(chan *cookie, cookieBuffer) conn.xidChan = make(chan xid, 5) conn.seqChan = make(chan uint16, 20) conn.reqChan = make(chan *request, 100) @@ -87,6 +92,12 @@ func (c *Conn) Close() { c.conn.Close() } +// DefaultScreen returns the Screen info for the default screen, which is +// 0 or the one given in the display argument to Dial. +func (c *Conn) DefaultScreen() *ScreenInfo { + return &c.Setup.Roots[c.defaultScreen] +} + // Id is used for all X identifiers, such as windows, pixmaps, and GCs. type Id uint32 @@ -95,6 +106,7 @@ type Id uint32 type Event interface { ImplementsEvent() Bytes() []byte + String() string } // newEventFuncs is a map from event numbers to functions that create @@ -188,7 +200,8 @@ func (c *Conn) newSequenceId() uint16 { // to match up replies with requests. // Since sequence ids can only be 16 bit integers we start over at zero when it // comes time to wrap. -// FIXME: 65,536 requests without replies cannot be made in a single sequence. +// N.B. As long as the cookie buffer is less than 2^16, there are no limitations +// on the number (or kind) of requests made in sequence. func (c *Conn) generateSeqIds() { seqid := uint16(1) for { @@ -206,13 +219,14 @@ func (c *Conn) generateSeqIds() { // The cookie is used to match up the reply/error. type request struct { buf []byte - cookie cookie + cookie *cookie } // newRequest takes the bytes an a cookie, constructs a request type, -// and sends it over the Conn.reqChan channel. It then returns the cookie -// (for convenience). -func (c *Conn) newRequest(buf []byte, cookie cookie) { +// and sends it over the Conn.reqChan channel. +// Note that the sequence number is added to the cookie after it is sent +// over the request channel. +func (c *Conn) newRequest(buf []byte, cookie *cookie) { c.reqChan <- &request{buf: buf, cookie: cookie} } @@ -220,15 +234,38 @@ func (c *Conn) newRequest(buf []byte, cookie cookie) { // the bytes to the wire and adds the cookie to the cookie queue. func (c *Conn) sendRequests() { for req := range c.reqChan { + // ho there! if the cookie channel is nearly full, force a round + // trip to clear out the cookie buffer. + // Note that we circumvent the request channel, because we're *in* + // the request channel. + if len(c.cookieChan) == cookieBuffer - 1 { + cookie := c.newCookie(true, true) + cookie.Sequence = c.newSequenceId() + c.cookieChan <- cookie + if !c.writeBuffer(c.getInputFocusRequest()) { + return + } + GetInputFocusCookie{cookie}.Reply() // wait for the buffer to clear + } + + req.cookie.Sequence = c.newSequenceId() c.cookieChan <- req.cookie - if _, err := c.conn.Write(req.buf); err != nil { - fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) - close(c.reqChan) + if !c.writeBuffer(req.buf) { return } } } +// writeBuffer is a convenience function for writing a byte slice to the wire. +func (c *Conn) writeBuffer(buf []byte) bool { + if _, err := c.conn.Write(buf); err != nil { + fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) + close(c.reqChan) + return false + } + return true +} + // readResponses is a goroutine that reads events, errors and // replies off the wire. // When an event is read, it is always added to the event channel. @@ -260,7 +297,15 @@ func (c *Conn) readResponses() { case 0: // This is an error // Use the constructor function for this error (that is auto // generated) by looking it up by the error number. - err = newErrorFuncs[int(buf[1])](buf) + newErrFun, ok := newErrorFuncs[int(buf[1])] + if !ok { + fmt.Fprintf(os.Stderr, + "BUG: " + + "Could not find error constructor function for error " + + "with number %d.", buf[1]) + continue + } + err = newErrFun(buf) seq = err.SequenceId() // This error is either sent to the event channel or a specific @@ -291,22 +336,23 @@ func (c *Conn) readResponses() { // Note that we AND the event number with 127 so that we ignore // the most significant bit (which is set when it was sent from // a SendEvent request). - event = newEventFuncs[int(buf[0] & 127)](buf) - // seq = event.SequenceId() // 0 for KeymapNotify + evNum := int(buf[0] & 127) + newEventFun, ok := newEventFuncs[evNum] + if !ok { + fmt.Fprintf(os.Stderr, + "BUG: " + + "Could not find event constructor function for event " + + "with number %d.", evNum) + continue + } + + event = newEventFun(buf) // Put the event into the queue. c.eventChan <- event // No more processing for events. continue - - // If this was a KeymapNotify event, then we don't do any more - // processing since we don't have any sequence id. - // if event != nil { - // if _, ok := event.(KeymapNotifyEvent); ok { - // continue - // } - // } } // At this point, we have a sequence number and we're either @@ -326,12 +372,17 @@ func (c *Conn) readResponses() { cookie.errorChan <- err } else { // asynchronous processing c.eventChan <- err + // if this is an unchecked reply, ping the cookie too + if cookie.pingChan != nil { + cookie.pingChan <- true + } } } else { // this is a reply if cookie.replyChan == nil { fmt.Fprintf(os.Stderr, "Reply with sequence id %d does not have a " + "cookie with a valid reply channel.\n", seq) + continue } else { cookie.replyChan <- replyBytes } @@ -344,10 +395,14 @@ func (c *Conn) readResponses() { case cookie.replyChan != nil && cookie.errorChan != nil: fmt.Fprintf(os.Stderr, "Found cookie with sequence id %d that is expecting a " + - "reply but will never get it.\n", cookie.Sequence) + "reply but will never get it. Currently on sequence " + + "number %d\n", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - cookie.pingChan <- true + fmt.Fprintf(os.Stderr, + "Found cookie with sequence id %d that is expecting a " + + "reply (and not an error) but will never get it. " + + "Currently on sequence number %d\n", cookie.Sequence, seq) // Checked requests without replies case cookie.pingChan != nil && cookie.errorChan != nil: cookie.pingChan <- true @@ -368,6 +423,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { return nil, ee default: fmt.Fprintf(os.Stderr, "Invalid event/error type: %T\n", everr) + return nil, nil } panic("unreachable") } diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index f7b4948..b54ab41 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -5,20 +5,6 @@ import ( "strings" ) -// getExtensionOpcode retrieves the extension opcode from the extensions map. -// If one doesn't exist, just return 0. An X error will likely result. -func (c *Conn) getExtensionOpcode(name string) byte { - return c.extensions[name] -} - -func (c *Conn) bytesPadding(buf []byte) []byte { - return append(buf, make([]byte, pad(len(buf))-len(buf))...) -} - -func (c *Conn) bytesString(str string) []byte { - return c.bytesPadding([]byte(str)) -} - // stringsJoin is an alias to strings.Join. It allows us to avoid having to // import 'strings' in each of the generated Go files. func stringsJoin(ss []string, sep string) string { @@ -31,58 +17,11 @@ func sprintf(format string, v ...interface{}) string { } // Pad a length to align on 4 bytes. -func pad(n int) int { return (n + 3) & ^3 } - -func Put16(buf []byte, v uint16) { - buf[0] = byte(v) - buf[1] = byte(v >> 8) +func pad(n int) int { + return (n + 3) & ^3 } -func Put32(buf []byte, v uint32) { - buf[0] = byte(v) - buf[1] = byte(v >> 8) - buf[2] = byte(v >> 16) - buf[3] = byte(v >> 24) -} - -func Put64(buf []byte, v uint64) { - buf[0] = byte(v) - buf[1] = byte(v >> 8) - buf[2] = byte(v >> 16) - buf[3] = byte(v >> 24) - buf[4] = byte(v >> 32) - buf[5] = byte(v >> 40) - buf[6] = byte(v >> 48) - buf[7] = byte(v >> 56) -} - -func Get16(buf []byte) uint16 { - v := uint16(buf[0]) - v |= uint16(buf[1]) << 8 - return v -} - -func Get32(buf []byte) uint32 { - v := uint32(buf[0]) - v |= uint32(buf[1]) << 8 - v |= uint32(buf[2]) << 16 - v |= uint32(buf[3]) << 24 - return v -} - -func Get64(buf []byte) uint64 { - v := uint64(buf[0]) - v |= uint64(buf[1]) << 8 - v |= uint64(buf[2]) << 16 - v |= uint64(buf[3]) << 24 - v |= uint64(buf[4]) << 32 - v |= uint64(buf[5]) << 40 - v |= uint64(buf[6]) << 48 - v |= uint64(buf[7]) << 56 - return v -} - -// Voodoo to count the number of bits set in a value list mask. +// popCount counts the number of bits set in a value list mask. func popCount(mask0 int) int { mask := uint32(mask0) n := 0 @@ -94,6 +33,57 @@ func popCount(mask0 int) int { return n } -// DefaultScreen returns the Screen info for the default screen, which is -// 0 or the one given in the display argument to Dial. -func (c *Conn) DefaultScreen() *ScreenInfo { return &c.Setup.Roots[c.defaultScreen] } +// Put16 takes a 16 bit integer and copies it into a byte slice. +func Put16(buf []byte, v uint16) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) +} + +// Put32 takes a 32 bit integer and copies it into a byte slice. +func Put32(buf []byte, v uint32) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) + buf[2] = byte(v >> 16) + buf[3] = byte(v >> 24) +} + +// Put64 takes a 64 bit integer and copies it into a byte slice. +func Put64(buf []byte, v uint64) { + buf[0] = byte(v) + buf[1] = byte(v >> 8) + buf[2] = byte(v >> 16) + buf[3] = byte(v >> 24) + buf[4] = byte(v >> 32) + buf[5] = byte(v >> 40) + buf[6] = byte(v >> 48) + buf[7] = byte(v >> 56) +} + +// Get16 constructs a 16 bit integer from the beginning of a byte slice. +func Get16(buf []byte) uint16 { + v := uint16(buf[0]) + v |= uint16(buf[1]) << 8 + return v +} + +// Get32 constructs a 32 bit integer from the beginning of a byte slice. +func Get32(buf []byte) uint32 { + v := uint32(buf[0]) + v |= uint32(buf[1]) << 8 + v |= uint32(buf[2]) << 16 + v |= uint32(buf[3]) << 24 + return v +} + +// Get64 constructs a 64 bit integer from the beginning of a byte slice. +func Get64(buf []byte) uint64 { + v := uint64(buf[0]) + v |= uint64(buf[1]) << 8 + v |= uint64(buf[2]) << 16 + v |= uint64(buf[3]) << 24 + v |= uint64(buf[4]) << 32 + v |= uint64(buf[5]) << 40 + v |= uint64(buf[6]) << 48 + v |= uint64(buf[7]) << 56 + return v +} diff --git a/nexgb/xinerama.go b/nexgb/xinerama.go new file mode 100644 index 0000000..c2e031c --- /dev/null +++ b/nexgb/xinerama.go @@ -0,0 +1,629 @@ +package xgb + +/* + This file was generated by xinerama.xml on May 5 2012 5:56:52pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// 'XineramaScreenInfo' struct definition +// Size: 8 +type XineramaScreenInfo struct { + XOrg int16 + YOrg int16 + Width uint16 + Height uint16 +} + +// Struct read XineramaScreenInfo +func ReadXineramaScreenInfo(buf []byte, v *XineramaScreenInfo) int { + b := 0 + + v.XOrg = int16(Get16(buf[b:])) + b += 2 + + v.YOrg = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XineramaScreenInfo +func ReadXineramaScreenInfoList(buf []byte, dest []XineramaScreenInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XineramaScreenInfo{} + b += ReadXineramaScreenInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XineramaScreenInfo +func (v XineramaScreenInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], uint16(v.XOrg)) + b += 2 + + Put16(buf[b:], uint16(v.YOrg)) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// Write struct list XineramaScreenInfo +func XineramaScreenInfoListBytes(buf []byte, list []XineramaScreenInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Request XineramaQueryVersion +// size: 8 +type XineramaQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XineramaQueryVersion(Major byte, Minor byte) XineramaQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie) + return XineramaQueryVersionCookie{cookie} +} + +func (c *Conn) XineramaQueryVersionUnchecked(Major byte, Minor byte) XineramaQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie) + return XineramaQueryVersionCookie{cookie} +} + +// Request reply for XineramaQueryVersion +// size: 12 +type XineramaQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint16 + Minor uint16 +} + +// Waits and reads reply data from request XineramaQueryVersion +func (cook XineramaQueryVersionCookie) Reply() (*XineramaQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XineramaQueryVersion +func xineramaQueryVersionReply(buf []byte) *XineramaQueryVersionReply { + v := new(XineramaQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = Get16(buf[b:]) + b += 2 + + v.Minor = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XineramaQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaQueryVersion +func (c *Conn) xineramaQueryVersionRequest(Major byte, Minor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + buf[b] = Major + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Minor + b += 1 + + return buf +} + +// Request XineramaGetState +// size: 8 +type XineramaGetStateCookie struct { + *cookie +} + +func (c *Conn) XineramaGetState(Window Id) XineramaGetStateCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaGetStateRequest(Window), cookie) + return XineramaGetStateCookie{cookie} +} + +func (c *Conn) XineramaGetStateUnchecked(Window Id) XineramaGetStateCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaGetStateRequest(Window), cookie) + return XineramaGetStateCookie{cookie} +} + +// Request reply for XineramaGetState +// size: 12 +type XineramaGetStateReply struct { + Sequence uint16 + Length uint32 + State byte + Window Id +} + +// Waits and reads reply data from request XineramaGetState +func (cook XineramaGetStateCookie) Reply() (*XineramaGetStateReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaGetStateReply(buf), nil +} + +// Read reply into structure from buffer for XineramaGetState +func xineramaGetStateReply(buf []byte) *XineramaGetStateReply { + v := new(XineramaGetStateReply) + b := 1 // skip reply determinant + + v.State = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook XineramaGetStateCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaGetState +func (c *Conn) xineramaGetStateRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XineramaGetScreenCount +// size: 8 +type XineramaGetScreenCountCookie struct { + *cookie +} + +func (c *Conn) XineramaGetScreenCount(Window Id) XineramaGetScreenCountCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) + return XineramaGetScreenCountCookie{cookie} +} + +func (c *Conn) XineramaGetScreenCountUnchecked(Window Id) XineramaGetScreenCountCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) + return XineramaGetScreenCountCookie{cookie} +} + +// Request reply for XineramaGetScreenCount +// size: 12 +type XineramaGetScreenCountReply struct { + Sequence uint16 + Length uint32 + ScreenCount byte + Window Id +} + +// Waits and reads reply data from request XineramaGetScreenCount +func (cook XineramaGetScreenCountCookie) Reply() (*XineramaGetScreenCountReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaGetScreenCountReply(buf), nil +} + +// Read reply into structure from buffer for XineramaGetScreenCount +func xineramaGetScreenCountReply(buf []byte) *XineramaGetScreenCountReply { + v := new(XineramaGetScreenCountReply) + b := 1 // skip reply determinant + + v.ScreenCount = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook XineramaGetScreenCountCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaGetScreenCount +func (c *Conn) xineramaGetScreenCountRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XineramaGetScreenSize +// size: 12 +type XineramaGetScreenSizeCookie struct { + *cookie +} + +func (c *Conn) XineramaGetScreenSize(Window Id, Screen uint32) XineramaGetScreenSizeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) + return XineramaGetScreenSizeCookie{cookie} +} + +func (c *Conn) XineramaGetScreenSizeUnchecked(Window Id, Screen uint32) XineramaGetScreenSizeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) + return XineramaGetScreenSizeCookie{cookie} +} + +// Request reply for XineramaGetScreenSize +// size: 24 +type XineramaGetScreenSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Window Id + Screen uint32 +} + +// Waits and reads reply data from request XineramaGetScreenSize +func (cook XineramaGetScreenSizeCookie) Reply() (*XineramaGetScreenSizeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaGetScreenSizeReply(buf), nil +} + +// Read reply into structure from buffer for XineramaGetScreenSize +func xineramaGetScreenSizeReply(buf []byte) *XineramaGetScreenSizeReply { + v := new(XineramaGetScreenSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get32(buf[b:]) + b += 4 + + v.Height = Get32(buf[b:]) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Screen = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook XineramaGetScreenSizeCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaGetScreenSize +func (c *Conn) xineramaGetScreenSizeRequest(Window Id, Screen uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request XineramaIsActive +// size: 4 +type XineramaIsActiveCookie struct { + *cookie +} + +func (c *Conn) XineramaIsActive() XineramaIsActiveCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaIsActiveRequest(), cookie) + return XineramaIsActiveCookie{cookie} +} + +func (c *Conn) XineramaIsActiveUnchecked() XineramaIsActiveCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaIsActiveRequest(), cookie) + return XineramaIsActiveCookie{cookie} +} + +// Request reply for XineramaIsActive +// size: 12 +type XineramaIsActiveReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + State uint32 +} + +// Waits and reads reply data from request XineramaIsActive +func (cook XineramaIsActiveCookie) Reply() (*XineramaIsActiveReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaIsActiveReply(buf), nil +} + +// Read reply into structure from buffer for XineramaIsActive +func xineramaIsActiveReply(buf []byte) *XineramaIsActiveReply { + v := new(XineramaIsActiveReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.State = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook XineramaIsActiveCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaIsActive +func (c *Conn) xineramaIsActiveRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XineramaQueryScreens +// size: 4 +type XineramaQueryScreensCookie struct { + *cookie +} + +func (c *Conn) XineramaQueryScreens() XineramaQueryScreensCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xineramaQueryScreensRequest(), cookie) + return XineramaQueryScreensCookie{cookie} +} + +func (c *Conn) XineramaQueryScreensUnchecked() XineramaQueryScreensCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xineramaQueryScreensRequest(), cookie) + return XineramaQueryScreensCookie{cookie} +} + +// Request reply for XineramaQueryScreens +// size: (32 + pad((int(Number) * 8))) +type XineramaQueryScreensReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Number uint32 + // padding: 20 bytes + ScreenInfo []XineramaScreenInfo // size: pad((int(Number) * 8)) +} + +// Waits and reads reply data from request XineramaQueryScreens +func (cook XineramaQueryScreensCookie) Reply() (*XineramaQueryScreensReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xineramaQueryScreensReply(buf), nil +} + +// Read reply into structure from buffer for XineramaQueryScreens +func xineramaQueryScreensReply(buf []byte) *XineramaQueryScreensReply { + v := new(XineramaQueryScreensReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Number = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.ScreenInfo = make([]XineramaScreenInfo, v.Number) + b += ReadXineramaScreenInfoList(buf[b:], v.ScreenInfo) + + return v +} + +func (cook XineramaQueryScreensCookie) Check() error { + return cook.check() +} + +// Write request to wire for XineramaQueryScreens +func (c *Conn) xineramaQueryScreensRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINERAMA"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/xproto.go b/nexgb/xproto.go index d56f0a1..32fa6dd 100644 --- a/nexgb/xproto.go +++ b/nexgb/xproto.go @@ -1,10 +1,16 @@ package xgb /* - This file was generated by xproto.xml on May 5 2012 2:50:11am EDT. + This file was generated by xproto.xml on May 5 2012 5:43:45pm EDT. This file is automatically generated. Edit at your peril! */ +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -25,12 +31,6 @@ package xgb // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -2731,6 +2731,23 @@ func (v KeyPressEvent) SequenceId() uint16 { return v.Sequence } +func (v KeyPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + return "KeyPress {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[2] = NewKeyPressEvent } @@ -2865,6 +2882,23 @@ func (v ButtonPressEvent) SequenceId() uint16 { return v.Sequence } +func (v ButtonPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonPress {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[4] = NewButtonPressEvent } @@ -2999,6 +3033,23 @@ func (v MotionNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v MotionNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + return "MotionNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[6] = NewMotionNotifyEvent } @@ -3127,6 +3178,24 @@ func (v EnterNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v EnterNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "EnterNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[7] = NewEnterNotifyEvent } @@ -3197,6 +3266,15 @@ func (v FocusInEvent) SequenceId() uint16 { return v.Sequence } +func (v FocusInEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + return "FocusIn {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[9] = NewFocusInEvent } @@ -3243,6 +3321,11 @@ func (v KeymapNotifyEvent) SequenceId() uint16 { return uint16(0) } +func (v KeymapNotifyEvent) String() string { + fieldVals := make([]string, 0, 1) + return "KeymapNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[11] = NewKeymapNotifyEvent } @@ -3339,6 +3422,18 @@ func (v ExposeEvent) SequenceId() uint16 { return v.Sequence } +func (v ExposeEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + return "Expose {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[12] = NewExposeEvent } @@ -3449,6 +3544,20 @@ func (v GraphicsExposureEvent) SequenceId() uint16 { return v.Sequence } +func (v GraphicsExposureEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "GraphicsExposure {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[13] = NewGraphicsExposureEvent } @@ -3524,6 +3633,15 @@ func (v NoExposureEvent) SequenceId() uint16 { return v.Sequence } +func (v NoExposureEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "NoExposure {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[14] = NewNoExposureEvent } @@ -3592,6 +3710,14 @@ func (v VisibilityNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v VisibilityNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + return "VisibilityNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[15] = NewVisibilityNotifyEvent } @@ -3710,6 +3836,20 @@ func (v CreateNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v CreateNotifyEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "CreateNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[16] = NewCreateNotifyEvent } @@ -3773,6 +3913,14 @@ func (v DestroyNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v DestroyNotifyEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + return "DestroyNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[17] = NewDestroyNotifyEvent } @@ -3856,6 +4004,15 @@ func (v UnmapNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v UnmapNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("FromConfigure: %t", v.FromConfigure)) + return "UnmapNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[18] = NewUnmapNotifyEvent } @@ -3939,6 +4096,15 @@ func (v MapNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v MapNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "MapNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[19] = NewMapNotifyEvent } @@ -4002,6 +4168,14 @@ func (v MapRequestEvent) SequenceId() uint16 { return v.Sequence } +func (v MapRequestEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + return "MapRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[20] = NewMapRequestEvent } @@ -4106,6 +4280,18 @@ func (v ReparentNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v ReparentNotifyEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "ReparentNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[21] = NewReparentNotifyEvent } @@ -4231,6 +4417,21 @@ func (v ConfigureNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v ConfigureNotifyEvent) String() string { + fieldVals := make([]string, 0, 11) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("AboveSibling: %d", v.AboveSibling)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "ConfigureNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[22] = NewConfigureNotifyEvent } @@ -4345,6 +4546,22 @@ func (v ConfigureRequestEvent) SequenceId() uint16 { return v.Sequence } +func (v ConfigureRequestEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("StackMode: %d", v.StackMode)) + fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Sibling: %d", v.Sibling)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, sprintf("ValueMask: %d", v.ValueMask)) + return "ConfigureRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[23] = NewConfigureRequestEvent } @@ -4422,6 +4639,16 @@ func (v GravityNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v GravityNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + return "GravityNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[24] = NewGravityNotifyEvent } @@ -4492,6 +4719,15 @@ func (v ResizeRequestEvent) SequenceId() uint16 { return v.Sequence } +func (v ResizeRequestEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + return "ResizeRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[25] = NewResizeRequestEvent } @@ -4572,6 +4808,15 @@ func (v CirculateNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v CirculateNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Place: %d", v.Place)) + return "CirculateNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[26] = NewCirculateNotifyEvent } @@ -4654,6 +4899,16 @@ func (v PropertyNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v PropertyNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Atom: %d", v.Atom)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + return "PropertyNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[28] = NewPropertyNotifyEvent } @@ -4724,6 +4979,15 @@ func (v SelectionClearEvent) SequenceId() uint16 { return v.Sequence } +func (v SelectionClearEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) + return "SelectionClear {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[29] = NewSelectionClearEvent } @@ -4815,6 +5079,18 @@ func (v SelectionRequestEvent) SequenceId() uint16 { return v.Sequence } +func (v SelectionRequestEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, sprintf("Requestor: %d", v.Requestor)) + fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, sprintf("Target: %d", v.Target)) + fieldVals = append(fieldVals, sprintf("Property: %d", v.Property)) + return "SelectionRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[30] = NewSelectionRequestEvent } @@ -4899,6 +5175,17 @@ func (v SelectionNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v SelectionNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Requestor: %d", v.Requestor)) + fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, sprintf("Target: %d", v.Target)) + fieldVals = append(fieldVals, sprintf("Property: %d", v.Property)) + return "SelectionNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[31] = NewSelectionNotifyEvent } @@ -4989,6 +5276,16 @@ func (v ColormapNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v ColormapNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Colormap: %d", v.Colormap)) + fieldVals = append(fieldVals, sprintf("New: %t", v.New)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + return "ColormapNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[32] = NewColormapNotifyEvent } @@ -5064,6 +5361,15 @@ func (v ClientMessageEvent) SequenceId() uint16 { return v.Sequence } +func (v ClientMessageEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Format: %d", v.Format)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Type: %d", v.Type)) + return "ClientMessage {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[33] = NewClientMessageEvent } @@ -5139,6 +5445,15 @@ func (v MappingNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v MappingNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + return "MappingNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[34] = NewMappingNotifyEvent } @@ -5163,6 +5478,23 @@ func (v KeyReleaseEvent) SequenceId() uint16 { return v.Sequence } +func (v KeyReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + return "KeyRelease {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[3] = NewKeyReleaseEvent } @@ -5187,6 +5519,23 @@ func (v ButtonReleaseEvent) SequenceId() uint16 { return v.Sequence } +func (v ButtonReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonRelease {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[5] = NewButtonReleaseEvent } @@ -5211,6 +5560,24 @@ func (v LeaveNotifyEvent) SequenceId() uint16 { return v.Sequence } +func (v LeaveNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "LeaveNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[8] = NewLeaveNotifyEvent } @@ -5235,6 +5602,15 @@ func (v FocusOutEvent) SequenceId() uint16 { return v.Sequence } +func (v FocusOutEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + return "FocusOut {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[10] = NewFocusOutEvent } @@ -5259,6 +5635,15 @@ func (v CirculateRequestEvent) SequenceId() uint16 { return v.Sequence } +func (v CirculateRequestEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Place: %d", v.Place)) + return "CirculateRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + func init() { newEventFuncs[27] = NewCirculateRequestEvent } @@ -5931,23 +6316,29 @@ func init() { // Request CreateWindow // size: pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) -type CreateWindowCookie cookie +type CreateWindowCookie struct { + *cookie +} // Write request to wire for CreateWindow func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) - return CreateWindowCookie(cookie) + c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) + return CreateWindowCookie{cookie} } func (c *Conn) CreateWindowChecked(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) - return CreateWindowCookie(cookie) + c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) + return CreateWindowCookie{cookie} +} + +func (cook CreateWindowCookie) Check() error { + return cook.check() } // Write request to wire for CreateWindow -func createWindowRequest(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) createWindowRequest(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6001,23 +6392,29 @@ func createWindowRequest(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width // Request ChangeWindowAttributes // size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) -type ChangeWindowAttributesCookie cookie +type ChangeWindowAttributesCookie struct { + *cookie +} // Write request to wire for ChangeWindowAttributes func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.newCookie(false, false) - c.newRequest(changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) - return ChangeWindowAttributesCookie(cookie) + c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie{cookie} } func (c *Conn) ChangeWindowAttributesChecked(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.newCookie(true, false) - c.newRequest(changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) - return ChangeWindowAttributesCookie(cookie) + c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie{cookie} +} + +func (cook ChangeWindowAttributesCookie) Check() error { + return cook.check() } // Write request to wire for ChangeWindowAttributes -func changeWindowAttributesRequest(Window Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) changeWindowAttributesRequest(Window Id, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6046,18 +6443,20 @@ func changeWindowAttributesRequest(Window Id, ValueMask uint32, ValueList []uint // Request GetWindowAttributes // size: 8 -type GetWindowAttributesCookie cookie +type GetWindowAttributesCookie struct { + *cookie +} func (c *Conn) GetWindowAttributes(Window Id) GetWindowAttributesCookie { cookie := c.newCookie(true, true) - c.newRequest(getWindowAttributesRequest(Window), cookie) - return GetWindowAttributesCookie(cookie) + c.newRequest(c.getWindowAttributesRequest(Window), cookie) + return GetWindowAttributesCookie{cookie} } func (c *Conn) GetWindowAttributesUnchecked(Window Id) GetWindowAttributesCookie { cookie := c.newCookie(false, true) - c.newRequest(getWindowAttributesRequest(Window), cookie) - return GetWindowAttributesCookie(cookie) + c.newRequest(c.getWindowAttributesRequest(Window), cookie) + return GetWindowAttributesCookie{cookie} } // Request reply for GetWindowAttributes @@ -6085,10 +6484,13 @@ type GetWindowAttributesReply struct { // Waits and reads reply data from request GetWindowAttributes func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getWindowAttributesReply(buf), nil } @@ -6165,8 +6567,12 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { return v } +func (cook GetWindowAttributesCookie) Check() error { + return cook.check() +} + // Write request to wire for GetWindowAttributes -func getWindowAttributesRequest(Window Id) []byte { +func (c *Conn) getWindowAttributesRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6187,23 +6593,29 @@ func getWindowAttributesRequest(Window Id) []byte { // Request DestroyWindow // size: 8 -type DestroyWindowCookie cookie +type DestroyWindowCookie struct { + *cookie +} // Write request to wire for DestroyWindow func (c *Conn) DestroyWindow(Window Id) DestroyWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(destroyWindowRequest(Window), cookie) - return DestroyWindowCookie(cookie) + c.newRequest(c.destroyWindowRequest(Window), cookie) + return DestroyWindowCookie{cookie} } func (c *Conn) DestroyWindowChecked(Window Id) DestroyWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(destroyWindowRequest(Window), cookie) - return DestroyWindowCookie(cookie) + c.newRequest(c.destroyWindowRequest(Window), cookie) + return DestroyWindowCookie{cookie} +} + +func (cook DestroyWindowCookie) Check() error { + return cook.check() } // Write request to wire for DestroyWindow -func destroyWindowRequest(Window Id) []byte { +func (c *Conn) destroyWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6224,23 +6636,29 @@ func destroyWindowRequest(Window Id) []byte { // Request DestroySubwindows // size: 8 -type DestroySubwindowsCookie cookie +type DestroySubwindowsCookie struct { + *cookie +} // Write request to wire for DestroySubwindows func (c *Conn) DestroySubwindows(Window Id) DestroySubwindowsCookie { cookie := c.newCookie(false, false) - c.newRequest(destroySubwindowsRequest(Window), cookie) - return DestroySubwindowsCookie(cookie) + c.newRequest(c.destroySubwindowsRequest(Window), cookie) + return DestroySubwindowsCookie{cookie} } func (c *Conn) DestroySubwindowsChecked(Window Id) DestroySubwindowsCookie { cookie := c.newCookie(true, false) - c.newRequest(destroySubwindowsRequest(Window), cookie) - return DestroySubwindowsCookie(cookie) + c.newRequest(c.destroySubwindowsRequest(Window), cookie) + return DestroySubwindowsCookie{cookie} +} + +func (cook DestroySubwindowsCookie) Check() error { + return cook.check() } // Write request to wire for DestroySubwindows -func destroySubwindowsRequest(Window Id) []byte { +func (c *Conn) destroySubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6261,23 +6679,29 @@ func destroySubwindowsRequest(Window Id) []byte { // Request ChangeSaveSet // size: 8 -type ChangeSaveSetCookie cookie +type ChangeSaveSetCookie struct { + *cookie +} // Write request to wire for ChangeSaveSet func (c *Conn) ChangeSaveSet(Mode byte, Window Id) ChangeSaveSetCookie { cookie := c.newCookie(false, false) - c.newRequest(changeSaveSetRequest(Mode, Window), cookie) - return ChangeSaveSetCookie(cookie) + c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) + return ChangeSaveSetCookie{cookie} } func (c *Conn) ChangeSaveSetChecked(Mode byte, Window Id) ChangeSaveSetCookie { cookie := c.newCookie(true, false) - c.newRequest(changeSaveSetRequest(Mode, Window), cookie) - return ChangeSaveSetCookie(cookie) + c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) + return ChangeSaveSetCookie{cookie} +} + +func (cook ChangeSaveSetCookie) Check() error { + return cook.check() } // Write request to wire for ChangeSaveSet -func changeSaveSetRequest(Mode byte, Window Id) []byte { +func (c *Conn) changeSaveSetRequest(Mode byte, Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6299,23 +6723,29 @@ func changeSaveSetRequest(Mode byte, Window Id) []byte { // Request ReparentWindow // size: 16 -type ReparentWindowCookie cookie +type ReparentWindowCookie struct { + *cookie +} // Write request to wire for ReparentWindow func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(reparentWindowRequest(Window, Parent, X, Y), cookie) - return ReparentWindowCookie(cookie) + c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) + return ReparentWindowCookie{cookie} } func (c *Conn) ReparentWindowChecked(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(reparentWindowRequest(Window, Parent, X, Y), cookie) - return ReparentWindowCookie(cookie) + c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) + return ReparentWindowCookie{cookie} +} + +func (cook ReparentWindowCookie) Check() error { + return cook.check() } // Write request to wire for ReparentWindow -func reparentWindowRequest(Window Id, Parent Id, X int16, Y int16) []byte { +func (c *Conn) reparentWindowRequest(Window Id, Parent Id, X int16, Y int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6345,23 +6775,29 @@ func reparentWindowRequest(Window Id, Parent Id, X int16, Y int16) []byte { // Request MapWindow // size: 8 -type MapWindowCookie cookie +type MapWindowCookie struct { + *cookie +} // Write request to wire for MapWindow func (c *Conn) MapWindow(Window Id) MapWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(mapWindowRequest(Window), cookie) - return MapWindowCookie(cookie) + c.newRequest(c.mapWindowRequest(Window), cookie) + return MapWindowCookie{cookie} } func (c *Conn) MapWindowChecked(Window Id) MapWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(mapWindowRequest(Window), cookie) - return MapWindowCookie(cookie) + c.newRequest(c.mapWindowRequest(Window), cookie) + return MapWindowCookie{cookie} +} + +func (cook MapWindowCookie) Check() error { + return cook.check() } // Write request to wire for MapWindow -func mapWindowRequest(Window Id) []byte { +func (c *Conn) mapWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6382,23 +6818,29 @@ func mapWindowRequest(Window Id) []byte { // Request MapSubwindows // size: 8 -type MapSubwindowsCookie cookie +type MapSubwindowsCookie struct { + *cookie +} // Write request to wire for MapSubwindows func (c *Conn) MapSubwindows(Window Id) MapSubwindowsCookie { cookie := c.newCookie(false, false) - c.newRequest(mapSubwindowsRequest(Window), cookie) - return MapSubwindowsCookie(cookie) + c.newRequest(c.mapSubwindowsRequest(Window), cookie) + return MapSubwindowsCookie{cookie} } func (c *Conn) MapSubwindowsChecked(Window Id) MapSubwindowsCookie { cookie := c.newCookie(true, false) - c.newRequest(mapSubwindowsRequest(Window), cookie) - return MapSubwindowsCookie(cookie) + c.newRequest(c.mapSubwindowsRequest(Window), cookie) + return MapSubwindowsCookie{cookie} +} + +func (cook MapSubwindowsCookie) Check() error { + return cook.check() } // Write request to wire for MapSubwindows -func mapSubwindowsRequest(Window Id) []byte { +func (c *Conn) mapSubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6419,23 +6861,29 @@ func mapSubwindowsRequest(Window Id) []byte { // Request UnmapWindow // size: 8 -type UnmapWindowCookie cookie +type UnmapWindowCookie struct { + *cookie +} // Write request to wire for UnmapWindow func (c *Conn) UnmapWindow(Window Id) UnmapWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(unmapWindowRequest(Window), cookie) - return UnmapWindowCookie(cookie) + c.newRequest(c.unmapWindowRequest(Window), cookie) + return UnmapWindowCookie{cookie} } func (c *Conn) UnmapWindowChecked(Window Id) UnmapWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(unmapWindowRequest(Window), cookie) - return UnmapWindowCookie(cookie) + c.newRequest(c.unmapWindowRequest(Window), cookie) + return UnmapWindowCookie{cookie} +} + +func (cook UnmapWindowCookie) Check() error { + return cook.check() } // Write request to wire for UnmapWindow -func unmapWindowRequest(Window Id) []byte { +func (c *Conn) unmapWindowRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6456,23 +6904,29 @@ func unmapWindowRequest(Window Id) []byte { // Request UnmapSubwindows // size: 8 -type UnmapSubwindowsCookie cookie +type UnmapSubwindowsCookie struct { + *cookie +} // Write request to wire for UnmapSubwindows func (c *Conn) UnmapSubwindows(Window Id) UnmapSubwindowsCookie { cookie := c.newCookie(false, false) - c.newRequest(unmapSubwindowsRequest(Window), cookie) - return UnmapSubwindowsCookie(cookie) + c.newRequest(c.unmapSubwindowsRequest(Window), cookie) + return UnmapSubwindowsCookie{cookie} } func (c *Conn) UnmapSubwindowsChecked(Window Id) UnmapSubwindowsCookie { cookie := c.newCookie(true, false) - c.newRequest(unmapSubwindowsRequest(Window), cookie) - return UnmapSubwindowsCookie(cookie) + c.newRequest(c.unmapSubwindowsRequest(Window), cookie) + return UnmapSubwindowsCookie{cookie} +} + +func (cook UnmapSubwindowsCookie) Check() error { + return cook.check() } // Write request to wire for UnmapSubwindows -func unmapSubwindowsRequest(Window Id) []byte { +func (c *Conn) unmapSubwindowsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6493,23 +6947,29 @@ func unmapSubwindowsRequest(Window Id) []byte { // Request ConfigureWindow // size: pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) -type ConfigureWindowCookie cookie +type ConfigureWindowCookie struct { + *cookie +} // Write request to wire for ConfigureWindow func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(configureWindowRequest(Window, ValueMask, ValueList), cookie) - return ConfigureWindowCookie(cookie) + c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie{cookie} } func (c *Conn) ConfigureWindowChecked(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(configureWindowRequest(Window, ValueMask, ValueList), cookie) - return ConfigureWindowCookie(cookie) + c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie{cookie} +} + +func (cook ConfigureWindowCookie) Check() error { + return cook.check() } // Write request to wire for ConfigureWindow -func configureWindowRequest(Window Id, ValueMask uint16, ValueList []uint32) []byte { +func (c *Conn) configureWindowRequest(Window Id, ValueMask uint16, ValueList []uint32) []byte { size := pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6541,23 +7001,29 @@ func configureWindowRequest(Window Id, ValueMask uint16, ValueList []uint32) []b // Request CirculateWindow // size: 8 -type CirculateWindowCookie cookie +type CirculateWindowCookie struct { + *cookie +} // Write request to wire for CirculateWindow func (c *Conn) CirculateWindow(Direction byte, Window Id) CirculateWindowCookie { cookie := c.newCookie(false, false) - c.newRequest(circulateWindowRequest(Direction, Window), cookie) - return CirculateWindowCookie(cookie) + c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) + return CirculateWindowCookie{cookie} } func (c *Conn) CirculateWindowChecked(Direction byte, Window Id) CirculateWindowCookie { cookie := c.newCookie(true, false) - c.newRequest(circulateWindowRequest(Direction, Window), cookie) - return CirculateWindowCookie(cookie) + c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) + return CirculateWindowCookie{cookie} +} + +func (cook CirculateWindowCookie) Check() error { + return cook.check() } // Write request to wire for CirculateWindow -func circulateWindowRequest(Direction byte, Window Id) []byte { +func (c *Conn) circulateWindowRequest(Direction byte, Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6579,18 +7045,20 @@ func circulateWindowRequest(Direction byte, Window Id) []byte { // Request GetGeometry // size: 8 -type GetGeometryCookie cookie +type GetGeometryCookie struct { + *cookie +} func (c *Conn) GetGeometry(Drawable Id) GetGeometryCookie { cookie := c.newCookie(true, true) - c.newRequest(getGeometryRequest(Drawable), cookie) - return GetGeometryCookie(cookie) + c.newRequest(c.getGeometryRequest(Drawable), cookie) + return GetGeometryCookie{cookie} } func (c *Conn) GetGeometryUnchecked(Drawable Id) GetGeometryCookie { cookie := c.newCookie(false, true) - c.newRequest(getGeometryRequest(Drawable), cookie) - return GetGeometryCookie(cookie) + c.newRequest(c.getGeometryRequest(Drawable), cookie) + return GetGeometryCookie{cookie} } // Request reply for GetGeometry @@ -6610,10 +7078,13 @@ type GetGeometryReply struct { // Waits and reads reply data from request GetGeometry func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getGeometryReply(buf), nil } @@ -6654,8 +7125,12 @@ func getGeometryReply(buf []byte) *GetGeometryReply { return v } +func (cook GetGeometryCookie) Check() error { + return cook.check() +} + // Write request to wire for GetGeometry -func getGeometryRequest(Drawable Id) []byte { +func (c *Conn) getGeometryRequest(Drawable Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6676,18 +7151,20 @@ func getGeometryRequest(Drawable Id) []byte { // Request QueryTree // size: 8 -type QueryTreeCookie cookie +type QueryTreeCookie struct { + *cookie +} func (c *Conn) QueryTree(Window Id) QueryTreeCookie { cookie := c.newCookie(true, true) - c.newRequest(queryTreeRequest(Window), cookie) - return QueryTreeCookie(cookie) + c.newRequest(c.queryTreeRequest(Window), cookie) + return QueryTreeCookie{cookie} } func (c *Conn) QueryTreeUnchecked(Window Id) QueryTreeCookie { cookie := c.newCookie(false, true) - c.newRequest(queryTreeRequest(Window), cookie) - return QueryTreeCookie(cookie) + c.newRequest(c.queryTreeRequest(Window), cookie) + return QueryTreeCookie{cookie} } // Request reply for QueryTree @@ -6705,10 +7182,13 @@ type QueryTreeReply struct { // Waits and reads reply data from request QueryTree func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryTreeReply(buf), nil } @@ -6746,8 +7226,12 @@ func queryTreeReply(buf []byte) *QueryTreeReply { return v } +func (cook QueryTreeCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryTree -func queryTreeRequest(Window Id) []byte { +func (c *Conn) queryTreeRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6768,18 +7252,20 @@ func queryTreeRequest(Window Id) []byte { // Request InternAtom // size: pad((8 + pad((int(NameLen) * 1)))) -type InternAtomCookie cookie +type InternAtomCookie struct { + *cookie +} func (c *Conn) InternAtom(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.newCookie(true, true) - c.newRequest(internAtomRequest(OnlyIfExists, NameLen, Name), cookie) - return InternAtomCookie(cookie) + c.newRequest(c.internAtomRequest(OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie{cookie} } func (c *Conn) InternAtomUnchecked(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.newCookie(false, true) - c.newRequest(internAtomRequest(OnlyIfExists, NameLen, Name), cookie) - return InternAtomCookie(cookie) + c.newRequest(c.internAtomRequest(OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie{cookie} } // Request reply for InternAtom @@ -6793,10 +7279,13 @@ type InternAtomReply struct { // Waits and reads reply data from request InternAtom func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return internAtomReply(buf), nil } @@ -6819,8 +7308,12 @@ func internAtomReply(buf []byte) *InternAtomReply { return v } +func (cook InternAtomCookie) Check() error { + return cook.check() +} + // Write request to wire for InternAtom -func internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) []byte { +func (c *Conn) internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) []byte { size := pad((8 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -6851,18 +7344,20 @@ func internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) []byte { // Request GetAtomName // size: 8 -type GetAtomNameCookie cookie +type GetAtomNameCookie struct { + *cookie +} func (c *Conn) GetAtomName(Atom Id) GetAtomNameCookie { cookie := c.newCookie(true, true) - c.newRequest(getAtomNameRequest(Atom), cookie) - return GetAtomNameCookie(cookie) + c.newRequest(c.getAtomNameRequest(Atom), cookie) + return GetAtomNameCookie{cookie} } func (c *Conn) GetAtomNameUnchecked(Atom Id) GetAtomNameCookie { cookie := c.newCookie(false, true) - c.newRequest(getAtomNameRequest(Atom), cookie) - return GetAtomNameCookie(cookie) + c.newRequest(c.getAtomNameRequest(Atom), cookie) + return GetAtomNameCookie{cookie} } // Request reply for GetAtomName @@ -6878,10 +7373,13 @@ type GetAtomNameReply struct { // Waits and reads reply data from request GetAtomName func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getAtomNameReply(buf), nil } @@ -6913,8 +7411,12 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { return v } +func (cook GetAtomNameCookie) Check() error { + return cook.check() +} + // Write request to wire for GetAtomName -func getAtomNameRequest(Atom Id) []byte { +func (c *Conn) getAtomNameRequest(Atom Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6935,23 +7437,29 @@ func getAtomNameRequest(Atom Id) []byte { // Request ChangeProperty // size: pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) -type ChangePropertyCookie cookie +type ChangePropertyCookie struct { + *cookie +} // Write request to wire for ChangeProperty func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.newCookie(false, false) - c.newRequest(changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) - return ChangePropertyCookie(cookie) + c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie{cookie} } func (c *Conn) ChangePropertyChecked(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.newCookie(true, false) - c.newRequest(changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) - return ChangePropertyCookie(cookie) + c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie{cookie} +} + +func (cook ChangePropertyCookie) Check() error { + return cook.check() } // Write request to wire for ChangeProperty -func changePropertyRequest(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) []byte { +func (c *Conn) changePropertyRequest(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) []byte { size := pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 buf := make([]byte, size) @@ -6990,23 +7498,29 @@ func changePropertyRequest(Mode byte, Window Id, Property Id, Type Id, Format by // Request DeleteProperty // size: 12 -type DeletePropertyCookie cookie +type DeletePropertyCookie struct { + *cookie +} // Write request to wire for DeleteProperty func (c *Conn) DeleteProperty(Window Id, Property Id) DeletePropertyCookie { cookie := c.newCookie(false, false) - c.newRequest(deletePropertyRequest(Window, Property), cookie) - return DeletePropertyCookie(cookie) + c.newRequest(c.deletePropertyRequest(Window, Property), cookie) + return DeletePropertyCookie{cookie} } func (c *Conn) DeletePropertyChecked(Window Id, Property Id) DeletePropertyCookie { cookie := c.newCookie(true, false) - c.newRequest(deletePropertyRequest(Window, Property), cookie) - return DeletePropertyCookie(cookie) + c.newRequest(c.deletePropertyRequest(Window, Property), cookie) + return DeletePropertyCookie{cookie} +} + +func (cook DeletePropertyCookie) Check() error { + return cook.check() } // Write request to wire for DeleteProperty -func deletePropertyRequest(Window Id, Property Id) []byte { +func (c *Conn) deletePropertyRequest(Window Id, Property Id) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7030,18 +7544,20 @@ func deletePropertyRequest(Window Id, Property Id) []byte { // Request GetProperty // size: 24 -type GetPropertyCookie cookie +type GetPropertyCookie struct { + *cookie +} func (c *Conn) GetProperty(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.newCookie(true, true) - c.newRequest(getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) - return GetPropertyCookie(cookie) + c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie{cookie} } func (c *Conn) GetPropertyUnchecked(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.newCookie(false, true) - c.newRequest(getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) - return GetPropertyCookie(cookie) + c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie{cookie} } // Request reply for GetProperty @@ -7059,10 +7575,13 @@ type GetPropertyReply struct { // Waits and reads reply data from request GetProperty func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getPropertyReply(buf), nil } @@ -7098,8 +7617,12 @@ func getPropertyReply(buf []byte) *GetPropertyReply { return v } +func (cook GetPropertyCookie) Check() error { + return cook.check() +} + // Write request to wire for GetProperty -func getPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) []byte { +func (c *Conn) getPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7137,18 +7660,20 @@ func getPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset // Request ListProperties // size: 8 -type ListPropertiesCookie cookie +type ListPropertiesCookie struct { + *cookie +} func (c *Conn) ListProperties(Window Id) ListPropertiesCookie { cookie := c.newCookie(true, true) - c.newRequest(listPropertiesRequest(Window), cookie) - return ListPropertiesCookie(cookie) + c.newRequest(c.listPropertiesRequest(Window), cookie) + return ListPropertiesCookie{cookie} } func (c *Conn) ListPropertiesUnchecked(Window Id) ListPropertiesCookie { cookie := c.newCookie(false, true) - c.newRequest(listPropertiesRequest(Window), cookie) - return ListPropertiesCookie(cookie) + c.newRequest(c.listPropertiesRequest(Window), cookie) + return ListPropertiesCookie{cookie} } // Request reply for ListProperties @@ -7164,10 +7689,13 @@ type ListPropertiesReply struct { // Waits and reads reply data from request ListProperties func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listPropertiesReply(buf), nil } @@ -7199,8 +7727,12 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { return v } +func (cook ListPropertiesCookie) Check() error { + return cook.check() +} + // Write request to wire for ListProperties -func listPropertiesRequest(Window Id) []byte { +func (c *Conn) listPropertiesRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7221,23 +7753,29 @@ func listPropertiesRequest(Window Id) []byte { // Request SetSelectionOwner // size: 16 -type SetSelectionOwnerCookie cookie +type SetSelectionOwnerCookie struct { + *cookie +} // Write request to wire for SetSelectionOwner func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { cookie := c.newCookie(false, false) - c.newRequest(setSelectionOwnerRequest(Owner, Selection, Time), cookie) - return SetSelectionOwnerCookie(cookie) + c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie{cookie} } func (c *Conn) SetSelectionOwnerChecked(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { cookie := c.newCookie(true, false) - c.newRequest(setSelectionOwnerRequest(Owner, Selection, Time), cookie) - return SetSelectionOwnerCookie(cookie) + c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie{cookie} +} + +func (cook SetSelectionOwnerCookie) Check() error { + return cook.check() } // Write request to wire for SetSelectionOwner -func setSelectionOwnerRequest(Owner Id, Selection Id, Time Timestamp) []byte { +func (c *Conn) setSelectionOwnerRequest(Owner Id, Selection Id, Time Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7264,18 +7802,20 @@ func setSelectionOwnerRequest(Owner Id, Selection Id, Time Timestamp) []byte { // Request GetSelectionOwner // size: 8 -type GetSelectionOwnerCookie cookie +type GetSelectionOwnerCookie struct { + *cookie +} func (c *Conn) GetSelectionOwner(Selection Id) GetSelectionOwnerCookie { cookie := c.newCookie(true, true) - c.newRequest(getSelectionOwnerRequest(Selection), cookie) - return GetSelectionOwnerCookie(cookie) + c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) + return GetSelectionOwnerCookie{cookie} } func (c *Conn) GetSelectionOwnerUnchecked(Selection Id) GetSelectionOwnerCookie { cookie := c.newCookie(false, true) - c.newRequest(getSelectionOwnerRequest(Selection), cookie) - return GetSelectionOwnerCookie(cookie) + c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) + return GetSelectionOwnerCookie{cookie} } // Request reply for GetSelectionOwner @@ -7289,10 +7829,13 @@ type GetSelectionOwnerReply struct { // Waits and reads reply data from request GetSelectionOwner func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getSelectionOwnerReply(buf), nil } @@ -7315,8 +7858,12 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { return v } +func (cook GetSelectionOwnerCookie) Check() error { + return cook.check() +} + // Write request to wire for GetSelectionOwner -func getSelectionOwnerRequest(Selection Id) []byte { +func (c *Conn) getSelectionOwnerRequest(Selection Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7337,23 +7884,29 @@ func getSelectionOwnerRequest(Selection Id) []byte { // Request ConvertSelection // size: 24 -type ConvertSelectionCookie cookie +type ConvertSelectionCookie struct { + *cookie +} // Write request to wire for ConvertSelection func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { cookie := c.newCookie(false, false) - c.newRequest(convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) - return ConvertSelectionCookie(cookie) + c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie{cookie} } func (c *Conn) ConvertSelectionChecked(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { cookie := c.newCookie(true, false) - c.newRequest(convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) - return ConvertSelectionCookie(cookie) + c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie{cookie} +} + +func (cook ConvertSelectionCookie) Check() error { + return cook.check() } // Write request to wire for ConvertSelection -func convertSelectionRequest(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) []byte { +func (c *Conn) convertSelectionRequest(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7386,23 +7939,29 @@ func convertSelectionRequest(Requestor Id, Selection Id, Target Id, Property Id, // Request SendEvent // size: pad((12 + pad(32))) -type SendEventCookie cookie +type SendEventCookie struct { + *cookie +} // Write request to wire for SendEvent func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { cookie := c.newCookie(false, false) - c.newRequest(sendEventRequest(Propagate, Destination, EventMask, Event), cookie) - return SendEventCookie(cookie) + c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie{cookie} } func (c *Conn) SendEventChecked(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { cookie := c.newCookie(true, false) - c.newRequest(sendEventRequest(Propagate, Destination, EventMask, Event), cookie) - return SendEventCookie(cookie) + c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie{cookie} +} + +func (cook SendEventCookie) Check() error { + return cook.check() } // Write request to wire for SendEvent -func sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte { +func (c *Conn) sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte { size := pad((12 + pad(32))) b := 0 buf := make([]byte, size) @@ -7434,18 +7993,20 @@ func sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event st // Request GrabPointer // size: 24 -type GrabPointerCookie cookie +type GrabPointerCookie struct { + *cookie +} func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { cookie := c.newCookie(true, true) - c.newRequest(grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) - return GrabPointerCookie(cookie) + c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) + return GrabPointerCookie{cookie} } func (c *Conn) GrabPointerUnchecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { cookie := c.newCookie(false, true) - c.newRequest(grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) - return GrabPointerCookie(cookie) + c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) + return GrabPointerCookie{cookie} } // Request reply for GrabPointer @@ -7458,10 +8019,13 @@ type GrabPointerReply struct { // Waits and reads reply data from request GrabPointer func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return grabPointerReply(buf), nil } @@ -7473,11 +8037,21 @@ func grabPointerReply(buf []byte) *GrabPointerReply { v.Status = buf[b] b += 1 + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + return v } +func (cook GrabPointerCookie) Check() error { + return cook.check() +} + // Write request to wire for GrabPointer -func grabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) []byte { +func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7521,23 +8095,29 @@ func grabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, Point // Request UngrabPointer // size: 8 -type UngrabPointerCookie cookie +type UngrabPointerCookie struct { + *cookie +} // Write request to wire for UngrabPointer func (c *Conn) UngrabPointer(Time Timestamp) UngrabPointerCookie { cookie := c.newCookie(false, false) - c.newRequest(ungrabPointerRequest(Time), cookie) - return UngrabPointerCookie(cookie) + c.newRequest(c.ungrabPointerRequest(Time), cookie) + return UngrabPointerCookie{cookie} } func (c *Conn) UngrabPointerChecked(Time Timestamp) UngrabPointerCookie { cookie := c.newCookie(true, false) - c.newRequest(ungrabPointerRequest(Time), cookie) - return UngrabPointerCookie(cookie) + c.newRequest(c.ungrabPointerRequest(Time), cookie) + return UngrabPointerCookie{cookie} +} + +func (cook UngrabPointerCookie) Check() error { + return cook.check() } // Write request to wire for UngrabPointer -func ungrabPointerRequest(Time Timestamp) []byte { +func (c *Conn) ungrabPointerRequest(Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7558,23 +8138,29 @@ func ungrabPointerRequest(Time Timestamp) []byte { // Request GrabButton // size: 24 -type GrabButtonCookie cookie +type GrabButtonCookie struct { + *cookie +} // Write request to wire for GrabButton func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.newCookie(false, false) - c.newRequest(grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) - return GrabButtonCookie(cookie) + c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie{cookie} } func (c *Conn) GrabButtonChecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.newCookie(true, false) - c.newRequest(grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) - return GrabButtonCookie(cookie) + c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie{cookie} +} + +func (cook GrabButtonCookie) Check() error { + return cook.check() } // Write request to wire for GrabButton -func grabButtonRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) []byte { +func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7623,23 +8209,29 @@ func grabButtonRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, Pointe // Request UngrabButton // size: 12 -type UngrabButtonCookie cookie +type UngrabButtonCookie struct { + *cookie +} // Write request to wire for UngrabButton func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { cookie := c.newCookie(false, false) - c.newRequest(ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) - return UngrabButtonCookie(cookie) + c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie{cookie} } func (c *Conn) UngrabButtonChecked(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { cookie := c.newCookie(true, false) - c.newRequest(ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) - return UngrabButtonCookie(cookie) + c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie{cookie} +} + +func (cook UngrabButtonCookie) Check() error { + return cook.check() } // Write request to wire for UngrabButton -func ungrabButtonRequest(Button byte, GrabWindow Id, Modifiers uint16) []byte { +func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Id, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7666,23 +8258,29 @@ func ungrabButtonRequest(Button byte, GrabWindow Id, Modifiers uint16) []byte { // Request ChangeActivePointerGrab // size: 16 -type ChangeActivePointerGrabCookie cookie +type ChangeActivePointerGrabCookie struct { + *cookie +} // Write request to wire for ChangeActivePointerGrab func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.newCookie(false, false) - c.newRequest(changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) - return ChangeActivePointerGrabCookie(cookie) + c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie{cookie} } func (c *Conn) ChangeActivePointerGrabChecked(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.newCookie(true, false) - c.newRequest(changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) - return ChangeActivePointerGrabCookie(cookie) + c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie{cookie} +} + +func (cook ChangeActivePointerGrabCookie) Check() error { + return cook.check() } // Write request to wire for ChangeActivePointerGrab -func changeActivePointerGrabRequest(Cursor Id, Time Timestamp, EventMask uint16) []byte { +func (c *Conn) changeActivePointerGrabRequest(Cursor Id, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7711,18 +8309,20 @@ func changeActivePointerGrabRequest(Cursor Id, Time Timestamp, EventMask uint16) // Request GrabKeyboard // size: 16 -type GrabKeyboardCookie cookie +type GrabKeyboardCookie struct { + *cookie +} func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.newCookie(true, true) - c.newRequest(grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) - return GrabKeyboardCookie(cookie) + c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie{cookie} } func (c *Conn) GrabKeyboardUnchecked(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.newCookie(false, true) - c.newRequest(grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) - return GrabKeyboardCookie(cookie) + c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie{cookie} } // Request reply for GrabKeyboard @@ -7735,10 +8335,13 @@ type GrabKeyboardReply struct { // Waits and reads reply data from request GrabKeyboard func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return grabKeyboardReply(buf), nil } @@ -7750,11 +8353,21 @@ func grabKeyboardReply(buf []byte) *GrabKeyboardReply { v.Status = buf[b] b += 1 + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + return v } +func (cook GrabKeyboardCookie) Check() error { + return cook.check() +} + // Write request to wire for GrabKeyboard -func grabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { +func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7791,23 +8404,29 @@ func grabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, Pointe // Request UngrabKeyboard // size: 8 -type UngrabKeyboardCookie cookie +type UngrabKeyboardCookie struct { + *cookie +} // Write request to wire for UngrabKeyboard func (c *Conn) UngrabKeyboard(Time Timestamp) UngrabKeyboardCookie { cookie := c.newCookie(false, false) - c.newRequest(ungrabKeyboardRequest(Time), cookie) - return UngrabKeyboardCookie(cookie) + c.newRequest(c.ungrabKeyboardRequest(Time), cookie) + return UngrabKeyboardCookie{cookie} } func (c *Conn) UngrabKeyboardChecked(Time Timestamp) UngrabKeyboardCookie { cookie := c.newCookie(true, false) - c.newRequest(ungrabKeyboardRequest(Time), cookie) - return UngrabKeyboardCookie(cookie) + c.newRequest(c.ungrabKeyboardRequest(Time), cookie) + return UngrabKeyboardCookie{cookie} +} + +func (cook UngrabKeyboardCookie) Check() error { + return cook.check() } // Write request to wire for UngrabKeyboard -func ungrabKeyboardRequest(Time Timestamp) []byte { +func (c *Conn) ungrabKeyboardRequest(Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7828,23 +8447,29 @@ func ungrabKeyboardRequest(Time Timestamp) []byte { // Request GrabKey // size: 16 -type GrabKeyCookie cookie +type GrabKeyCookie struct { + *cookie +} // Write request to wire for GrabKey func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.newCookie(false, false) - c.newRequest(grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) - return GrabKeyCookie(cookie) + c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie{cookie} } func (c *Conn) GrabKeyChecked(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.newCookie(true, false) - c.newRequest(grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) - return GrabKeyCookie(cookie) + c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie{cookie} +} + +func (cook GrabKeyCookie) Check() error { + return cook.check() } // Write request to wire for GrabKey -func grabKeyRequest(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { +func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7884,23 +8509,29 @@ func grabKeyRequest(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keyco // Request UngrabKey // size: 12 -type UngrabKeyCookie cookie +type UngrabKeyCookie struct { + *cookie +} // Write request to wire for UngrabKey func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { cookie := c.newCookie(false, false) - c.newRequest(ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) - return UngrabKeyCookie(cookie) + c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie{cookie} } func (c *Conn) UngrabKeyChecked(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { cookie := c.newCookie(true, false) - c.newRequest(ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) - return UngrabKeyCookie(cookie) + c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie{cookie} +} + +func (cook UngrabKeyCookie) Check() error { + return cook.check() } // Write request to wire for UngrabKey -func ungrabKeyRequest(Key Keycode, GrabWindow Id, Modifiers uint16) []byte { +func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Id, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7927,23 +8558,29 @@ func ungrabKeyRequest(Key Keycode, GrabWindow Id, Modifiers uint16) []byte { // Request AllowEvents // size: 8 -type AllowEventsCookie cookie +type AllowEventsCookie struct { + *cookie +} // Write request to wire for AllowEvents func (c *Conn) AllowEvents(Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.newCookie(false, false) - c.newRequest(allowEventsRequest(Mode, Time), cookie) - return AllowEventsCookie(cookie) + c.newRequest(c.allowEventsRequest(Mode, Time), cookie) + return AllowEventsCookie{cookie} } func (c *Conn) AllowEventsChecked(Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.newCookie(true, false) - c.newRequest(allowEventsRequest(Mode, Time), cookie) - return AllowEventsCookie(cookie) + c.newRequest(c.allowEventsRequest(Mode, Time), cookie) + return AllowEventsCookie{cookie} +} + +func (cook AllowEventsCookie) Check() error { + return cook.check() } // Write request to wire for AllowEvents -func allowEventsRequest(Mode byte, Time Timestamp) []byte { +func (c *Conn) allowEventsRequest(Mode byte, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7965,23 +8602,29 @@ func allowEventsRequest(Mode byte, Time Timestamp) []byte { // Request GrabServer // size: 4 -type GrabServerCookie cookie +type GrabServerCookie struct { + *cookie +} // Write request to wire for GrabServer func (c *Conn) GrabServer() GrabServerCookie { cookie := c.newCookie(false, false) - c.newRequest(grabServerRequest(), cookie) - return GrabServerCookie(cookie) + c.newRequest(c.grabServerRequest(), cookie) + return GrabServerCookie{cookie} } func (c *Conn) GrabServerChecked() GrabServerCookie { cookie := c.newCookie(true, false) - c.newRequest(grabServerRequest(), cookie) - return GrabServerCookie(cookie) + c.newRequest(c.grabServerRequest(), cookie) + return GrabServerCookie{cookie} +} + +func (cook GrabServerCookie) Check() error { + return cook.check() } // Write request to wire for GrabServer -func grabServerRequest() []byte { +func (c *Conn) grabServerRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -7989,28 +8632,38 @@ func grabServerRequest() []byte { buf[b] = 36 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request UngrabServer // size: 4 -type UngrabServerCookie cookie +type UngrabServerCookie struct { + *cookie +} // Write request to wire for UngrabServer func (c *Conn) UngrabServer() UngrabServerCookie { cookie := c.newCookie(false, false) - c.newRequest(ungrabServerRequest(), cookie) - return UngrabServerCookie(cookie) + c.newRequest(c.ungrabServerRequest(), cookie) + return UngrabServerCookie{cookie} } func (c *Conn) UngrabServerChecked() UngrabServerCookie { cookie := c.newCookie(true, false) - c.newRequest(ungrabServerRequest(), cookie) - return UngrabServerCookie(cookie) + c.newRequest(c.ungrabServerRequest(), cookie) + return UngrabServerCookie{cookie} +} + +func (cook UngrabServerCookie) Check() error { + return cook.check() } // Write request to wire for UngrabServer -func ungrabServerRequest() []byte { +func (c *Conn) ungrabServerRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -8018,23 +8671,29 @@ func ungrabServerRequest() []byte { buf[b] = 37 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request QueryPointer // size: 8 -type QueryPointerCookie cookie +type QueryPointerCookie struct { + *cookie +} func (c *Conn) QueryPointer(Window Id) QueryPointerCookie { cookie := c.newCookie(true, true) - c.newRequest(queryPointerRequest(Window), cookie) - return QueryPointerCookie(cookie) + c.newRequest(c.queryPointerRequest(Window), cookie) + return QueryPointerCookie{cookie} } func (c *Conn) QueryPointerUnchecked(Window Id) QueryPointerCookie { cookie := c.newCookie(false, true) - c.newRequest(queryPointerRequest(Window), cookie) - return QueryPointerCookie(cookie) + c.newRequest(c.queryPointerRequest(Window), cookie) + return QueryPointerCookie{cookie} } // Request reply for QueryPointer @@ -8055,10 +8714,13 @@ type QueryPointerReply struct { // Waits and reads reply data from request QueryPointer func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryPointerReply(buf), nil } @@ -8106,8 +8768,12 @@ func queryPointerReply(buf []byte) *QueryPointerReply { return v } +func (cook QueryPointerCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryPointer -func queryPointerRequest(Window Id) []byte { +func (c *Conn) queryPointerRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8128,18 +8794,20 @@ func queryPointerRequest(Window Id) []byte { // Request GetMotionEvents // size: 16 -type GetMotionEventsCookie cookie +type GetMotionEventsCookie struct { + *cookie +} func (c *Conn) GetMotionEvents(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.newCookie(true, true) - c.newRequest(getMotionEventsRequest(Window, Start, Stop), cookie) - return GetMotionEventsCookie(cookie) + c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) + return GetMotionEventsCookie{cookie} } func (c *Conn) GetMotionEventsUnchecked(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.newCookie(false, true) - c.newRequest(getMotionEventsRequest(Window, Start, Stop), cookie) - return GetMotionEventsCookie(cookie) + c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) + return GetMotionEventsCookie{cookie} } // Request reply for GetMotionEvents @@ -8155,10 +8823,13 @@ type GetMotionEventsReply struct { // Waits and reads reply data from request GetMotionEvents func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getMotionEventsReply(buf), nil } @@ -8186,8 +8857,12 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { return v } +func (cook GetMotionEventsCookie) Check() error { + return cook.check() +} + // Write request to wire for GetMotionEvents -func getMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) []byte { +func (c *Conn) getMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8214,18 +8889,20 @@ func getMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) []byte { // Request TranslateCoordinates // size: 16 -type TranslateCoordinatesCookie cookie +type TranslateCoordinatesCookie struct { + *cookie +} func (c *Conn) TranslateCoordinates(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.newCookie(true, true) - c.newRequest(translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) - return TranslateCoordinatesCookie(cookie) + c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie{cookie} } func (c *Conn) TranslateCoordinatesUnchecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.newCookie(false, true) - c.newRequest(translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) - return TranslateCoordinatesCookie(cookie) + c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie{cookie} } // Request reply for TranslateCoordinates @@ -8241,10 +8918,13 @@ type TranslateCoordinatesReply struct { // Waits and reads reply data from request TranslateCoordinates func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return translateCoordinatesReply(buf), nil } @@ -8278,8 +8958,12 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { return v } +func (cook TranslateCoordinatesCookie) Check() error { + return cook.check() +} + // Write request to wire for TranslateCoordinates -func translateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) []byte { +func (c *Conn) translateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8309,23 +8993,29 @@ func translateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY in // Request WarpPointer // size: 24 -type WarpPointerCookie cookie +type WarpPointerCookie struct { + *cookie +} // Write request to wire for WarpPointer func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.newCookie(false, false) - c.newRequest(warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) - return WarpPointerCookie(cookie) + c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie{cookie} } func (c *Conn) WarpPointerChecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.newCookie(true, false) - c.newRequest(warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) - return WarpPointerCookie(cookie) + c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie{cookie} +} + +func (cook WarpPointerCookie) Check() error { + return cook.check() } // Write request to wire for WarpPointer -func warpPointerRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { +func (c *Conn) warpPointerRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -8367,23 +9057,29 @@ func warpPointerRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcW // Request SetInputFocus // size: 12 -type SetInputFocusCookie cookie +type SetInputFocusCookie struct { + *cookie +} // Write request to wire for SetInputFocus func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { cookie := c.newCookie(false, false) - c.newRequest(setInputFocusRequest(RevertTo, Focus, Time), cookie) - return SetInputFocusCookie(cookie) + c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) + return SetInputFocusCookie{cookie} } func (c *Conn) SetInputFocusChecked(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { cookie := c.newCookie(true, false) - c.newRequest(setInputFocusRequest(RevertTo, Focus, Time), cookie) - return SetInputFocusCookie(cookie) + c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) + return SetInputFocusCookie{cookie} +} + +func (cook SetInputFocusCookie) Check() error { + return cook.check() } // Write request to wire for SetInputFocus -func setInputFocusRequest(RevertTo byte, Focus Id, Time Timestamp) []byte { +func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Id, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -8408,18 +9104,20 @@ func setInputFocusRequest(RevertTo byte, Focus Id, Time Timestamp) []byte { // Request GetInputFocus // size: 4 -type GetInputFocusCookie cookie +type GetInputFocusCookie struct { + *cookie +} func (c *Conn) GetInputFocus() GetInputFocusCookie { cookie := c.newCookie(true, true) - c.newRequest(getInputFocusRequest(), cookie) - return GetInputFocusCookie(cookie) + c.newRequest(c.getInputFocusRequest(), cookie) + return GetInputFocusCookie{cookie} } func (c *Conn) GetInputFocusUnchecked() GetInputFocusCookie { cookie := c.newCookie(false, true) - c.newRequest(getInputFocusRequest(), cookie) - return GetInputFocusCookie(cookie) + c.newRequest(c.getInputFocusRequest(), cookie) + return GetInputFocusCookie{cookie} } // Request reply for GetInputFocus @@ -8433,10 +9131,13 @@ type GetInputFocusReply struct { // Waits and reads reply data from request GetInputFocus func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getInputFocusReply(buf), nil } @@ -8460,8 +9161,12 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { return v } +func (cook GetInputFocusCookie) Check() error { + return cook.check() +} + // Write request to wire for GetInputFocus -func getInputFocusRequest() []byte { +func (c *Conn) getInputFocusRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -8469,23 +9174,29 @@ func getInputFocusRequest() []byte { buf[b] = 43 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request QueryKeymap // size: 4 -type QueryKeymapCookie cookie +type QueryKeymapCookie struct { + *cookie +} func (c *Conn) QueryKeymap() QueryKeymapCookie { cookie := c.newCookie(true, true) - c.newRequest(queryKeymapRequest(), cookie) - return QueryKeymapCookie(cookie) + c.newRequest(c.queryKeymapRequest(), cookie) + return QueryKeymapCookie{cookie} } func (c *Conn) QueryKeymapUnchecked() QueryKeymapCookie { cookie := c.newCookie(false, true) - c.newRequest(queryKeymapRequest(), cookie) - return QueryKeymapCookie(cookie) + c.newRequest(c.queryKeymapRequest(), cookie) + return QueryKeymapCookie{cookie} } // Request reply for QueryKeymap @@ -8499,10 +9210,13 @@ type QueryKeymapReply struct { // Waits and reads reply data from request QueryKeymap func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryKeymapReply(buf), nil } @@ -8526,8 +9240,12 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { return v } +func (cook QueryKeymapCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryKeymap -func queryKeymapRequest() []byte { +func (c *Conn) queryKeymapRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -8535,28 +9253,38 @@ func queryKeymapRequest() []byte { buf[b] = 44 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request OpenFont // size: pad((12 + pad((int(NameLen) * 1)))) -type OpenFontCookie cookie +type OpenFontCookie struct { + *cookie +} // Write request to wire for OpenFont func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) OpenFontCookie { cookie := c.newCookie(false, false) - c.newRequest(openFontRequest(Fid, NameLen, Name), cookie) - return OpenFontCookie(cookie) + c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) + return OpenFontCookie{cookie} } func (c *Conn) OpenFontChecked(Fid Id, NameLen uint16, Name string) OpenFontCookie { cookie := c.newCookie(true, false) - c.newRequest(openFontRequest(Fid, NameLen, Name), cookie) - return OpenFontCookie(cookie) + c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) + return OpenFontCookie{cookie} +} + +func (cook OpenFontCookie) Check() error { + return cook.check() } // Write request to wire for OpenFont -func openFontRequest(Fid Id, NameLen uint16, Name string) []byte { +func (c *Conn) openFontRequest(Fid Id, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -8585,23 +9313,29 @@ func openFontRequest(Fid Id, NameLen uint16, Name string) []byte { // Request CloseFont // size: 8 -type CloseFontCookie cookie +type CloseFontCookie struct { + *cookie +} // Write request to wire for CloseFont func (c *Conn) CloseFont(Font Id) CloseFontCookie { cookie := c.newCookie(false, false) - c.newRequest(closeFontRequest(Font), cookie) - return CloseFontCookie(cookie) + c.newRequest(c.closeFontRequest(Font), cookie) + return CloseFontCookie{cookie} } func (c *Conn) CloseFontChecked(Font Id) CloseFontCookie { cookie := c.newCookie(true, false) - c.newRequest(closeFontRequest(Font), cookie) - return CloseFontCookie(cookie) + c.newRequest(c.closeFontRequest(Font), cookie) + return CloseFontCookie{cookie} +} + +func (cook CloseFontCookie) Check() error { + return cook.check() } // Write request to wire for CloseFont -func closeFontRequest(Font Id) []byte { +func (c *Conn) closeFontRequest(Font Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8622,18 +9356,20 @@ func closeFontRequest(Font Id) []byte { // Request QueryFont // size: 8 -type QueryFontCookie cookie +type QueryFontCookie struct { + *cookie +} func (c *Conn) QueryFont(Font Id) QueryFontCookie { cookie := c.newCookie(true, true) - c.newRequest(queryFontRequest(Font), cookie) - return QueryFontCookie(cookie) + c.newRequest(c.queryFontRequest(Font), cookie) + return QueryFontCookie{cookie} } func (c *Conn) QueryFontUnchecked(Font Id) QueryFontCookie { cookie := c.newCookie(false, true) - c.newRequest(queryFontRequest(Font), cookie) - return QueryFontCookie(cookie) + c.newRequest(c.queryFontRequest(Font), cookie) + return QueryFontCookie{cookie} } // Request reply for QueryFont @@ -8663,10 +9399,13 @@ type QueryFontReply struct { // Waits and reads reply data from request QueryFont func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryFontReply(buf), nil } @@ -8739,8 +9478,12 @@ func queryFontReply(buf []byte) *QueryFontReply { return v } +func (cook QueryFontCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryFont -func queryFontRequest(Font Id) []byte { +func (c *Conn) queryFontRequest(Font Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8761,18 +9504,20 @@ func queryFontRequest(Font Id) []byte { // Request QueryTextExtents // size: pad((8 + pad((len(String) * 2)))) -type QueryTextExtentsCookie cookie +type QueryTextExtentsCookie struct { + *cookie +} func (c *Conn) QueryTextExtents(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.newCookie(true, true) - c.newRequest(queryTextExtentsRequest(Font, String, StringLen), cookie) - return QueryTextExtentsCookie(cookie) + c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) + return QueryTextExtentsCookie{cookie} } func (c *Conn) QueryTextExtentsUnchecked(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.newCookie(false, true) - c.newRequest(queryTextExtentsRequest(Font, String, StringLen), cookie) - return QueryTextExtentsCookie(cookie) + c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) + return QueryTextExtentsCookie{cookie} } // Request reply for QueryTextExtents @@ -8792,10 +9537,13 @@ type QueryTextExtentsReply struct { // Waits and reads reply data from request QueryTextExtents func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryTextExtentsReply(buf), nil } @@ -8837,8 +9585,12 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { return v } +func (cook QueryTextExtentsCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryTextExtents -func queryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) []byte { +func (c *Conn) queryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) []byte { size := pad((8 + pad((len(String) * 2)))) b := 0 buf := make([]byte, size) @@ -8864,18 +9616,20 @@ func queryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) []byte // Request ListFonts // size: pad((8 + pad((int(PatternLen) * 1)))) -type ListFontsCookie cookie +type ListFontsCookie struct { + *cookie +} func (c *Conn) ListFonts(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.newCookie(true, true) - c.newRequest(listFontsRequest(MaxNames, PatternLen, Pattern), cookie) - return ListFontsCookie(cookie) + c.newRequest(c.listFontsRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsCookie{cookie} } func (c *Conn) ListFontsUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.newCookie(false, true) - c.newRequest(listFontsRequest(MaxNames, PatternLen, Pattern), cookie) - return ListFontsCookie(cookie) + c.newRequest(c.listFontsRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsCookie{cookie} } // Request reply for ListFonts @@ -8891,10 +9645,13 @@ type ListFontsReply struct { // Waits and reads reply data from request ListFonts func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listFontsReply(buf), nil } @@ -8922,8 +9679,12 @@ func listFontsReply(buf []byte) *ListFontsReply { return v } +func (cook ListFontsCookie) Check() error { + return cook.check() +} + // Write request to wire for ListFonts -func listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { +func (c *Conn) listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := pad((8 + pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -8950,18 +9711,20 @@ func listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte // Request ListFontsWithInfo // size: pad((8 + pad((int(PatternLen) * 1)))) -type ListFontsWithInfoCookie cookie +type ListFontsWithInfoCookie struct { + *cookie +} func (c *Conn) ListFontsWithInfo(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.newCookie(true, true) - c.newRequest(listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) - return ListFontsWithInfoCookie(cookie) + c.newRequest(c.listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsWithInfoCookie{cookie} } func (c *Conn) ListFontsWithInfoUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.newCookie(false, true) - c.newRequest(listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) - return ListFontsWithInfoCookie(cookie) + c.newRequest(c.listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) + return ListFontsWithInfoCookie{cookie} } // Request reply for ListFontsWithInfo @@ -8991,10 +9754,13 @@ type ListFontsWithInfoReply struct { // Waits and reads reply data from request ListFontsWithInfo func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listFontsWithInfoReply(buf), nil } @@ -9072,8 +9838,12 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { return v } +func (cook ListFontsWithInfoCookie) Check() error { + return cook.check() +} + // Write request to wire for ListFontsWithInfo -func listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { +func (c *Conn) listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := pad((8 + pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9100,23 +9870,29 @@ func listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string // Request SetFontPath // size: pad((8 + StrListSize(Font))) -type SetFontPathCookie cookie +type SetFontPathCookie struct { + *cookie +} // Write request to wire for SetFontPath func (c *Conn) SetFontPath(FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.newCookie(false, false) - c.newRequest(setFontPathRequest(FontQty, Font), cookie) - return SetFontPathCookie(cookie) + c.newRequest(c.setFontPathRequest(FontQty, Font), cookie) + return SetFontPathCookie{cookie} } func (c *Conn) SetFontPathChecked(FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.newCookie(true, false) - c.newRequest(setFontPathRequest(FontQty, Font), cookie) - return SetFontPathCookie(cookie) + c.newRequest(c.setFontPathRequest(FontQty, Font), cookie) + return SetFontPathCookie{cookie} +} + +func (cook SetFontPathCookie) Check() error { + return cook.check() } // Write request to wire for SetFontPath -func setFontPathRequest(FontQty uint16, Font []Str) []byte { +func (c *Conn) setFontPathRequest(FontQty uint16, Font []Str) []byte { size := pad((8 + StrListSize(Font))) b := 0 buf := make([]byte, size) @@ -9141,18 +9917,20 @@ func setFontPathRequest(FontQty uint16, Font []Str) []byte { // Request GetFontPath // size: 4 -type GetFontPathCookie cookie +type GetFontPathCookie struct { + *cookie +} func (c *Conn) GetFontPath() GetFontPathCookie { cookie := c.newCookie(true, true) - c.newRequest(getFontPathRequest(), cookie) - return GetFontPathCookie(cookie) + c.newRequest(c.getFontPathRequest(), cookie) + return GetFontPathCookie{cookie} } func (c *Conn) GetFontPathUnchecked() GetFontPathCookie { cookie := c.newCookie(false, true) - c.newRequest(getFontPathRequest(), cookie) - return GetFontPathCookie(cookie) + c.newRequest(c.getFontPathRequest(), cookie) + return GetFontPathCookie{cookie} } // Request reply for GetFontPath @@ -9168,10 +9946,13 @@ type GetFontPathReply struct { // Waits and reads reply data from request GetFontPath func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getFontPathReply(buf), nil } @@ -9199,8 +9980,12 @@ func getFontPathReply(buf []byte) *GetFontPathReply { return v } +func (cook GetFontPathCookie) Check() error { + return cook.check() +} + // Write request to wire for GetFontPath -func getFontPathRequest() []byte { +func (c *Conn) getFontPathRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -9208,28 +9993,38 @@ func getFontPathRequest() []byte { buf[b] = 52 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request CreatePixmap // size: 16 -type CreatePixmapCookie cookie +type CreatePixmapCookie struct { + *cookie +} // Write request to wire for CreatePixmap func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.newCookie(false, false) - c.newRequest(createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) - return CreatePixmapCookie(cookie) + c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie{cookie} } func (c *Conn) CreatePixmapChecked(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.newCookie(true, false) - c.newRequest(createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) - return CreatePixmapCookie(cookie) + c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie{cookie} +} + +func (cook CreatePixmapCookie) Check() error { + return cook.check() } // Write request to wire for CreatePixmap -func createPixmapRequest(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) []byte { +func (c *Conn) createPixmapRequest(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9260,23 +10055,29 @@ func createPixmapRequest(Depth byte, Pid Id, Drawable Id, Width uint16, Height u // Request FreePixmap // size: 8 -type FreePixmapCookie cookie +type FreePixmapCookie struct { + *cookie +} // Write request to wire for FreePixmap func (c *Conn) FreePixmap(Pixmap Id) FreePixmapCookie { cookie := c.newCookie(false, false) - c.newRequest(freePixmapRequest(Pixmap), cookie) - return FreePixmapCookie(cookie) + c.newRequest(c.freePixmapRequest(Pixmap), cookie) + return FreePixmapCookie{cookie} } func (c *Conn) FreePixmapChecked(Pixmap Id) FreePixmapCookie { cookie := c.newCookie(true, false) - c.newRequest(freePixmapRequest(Pixmap), cookie) - return FreePixmapCookie(cookie) + c.newRequest(c.freePixmapRequest(Pixmap), cookie) + return FreePixmapCookie{cookie} +} + +func (cook FreePixmapCookie) Check() error { + return cook.check() } // Write request to wire for FreePixmap -func freePixmapRequest(Pixmap Id) []byte { +func (c *Conn) freePixmapRequest(Pixmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9297,23 +10098,29 @@ func freePixmapRequest(Pixmap Id) []byte { // Request CreateGC // size: pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) -type CreateGCCookie cookie +type CreateGCCookie struct { + *cookie +} // Write request to wire for CreateGC func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.newCookie(false, false) - c.newRequest(createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) - return CreateGCCookie(cookie) + c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie{cookie} } func (c *Conn) CreateGCChecked(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.newCookie(true, false) - c.newRequest(createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) - return CreateGCCookie(cookie) + c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie{cookie} +} + +func (cook CreateGCCookie) Check() error { + return cook.check() } // Write request to wire for CreateGC -func createGCRequest(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) createGCRequest(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) []byte { size := pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -9345,23 +10152,29 @@ func createGCRequest(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) // Request ChangeGC // size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) -type ChangeGCCookie cookie +type ChangeGCCookie struct { + *cookie +} // Write request to wire for ChangeGC func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.newCookie(false, false) - c.newRequest(changeGCRequest(Gc, ValueMask, ValueList), cookie) - return ChangeGCCookie(cookie) + c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie{cookie} } func (c *Conn) ChangeGCChecked(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.newCookie(true, false) - c.newRequest(changeGCRequest(Gc, ValueMask, ValueList), cookie) - return ChangeGCCookie(cookie) + c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie{cookie} +} + +func (cook ChangeGCCookie) Check() error { + return cook.check() } // Write request to wire for ChangeGC -func changeGCRequest(Gc Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) changeGCRequest(Gc Id, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -9390,23 +10203,29 @@ func changeGCRequest(Gc Id, ValueMask uint32, ValueList []uint32) []byte { // Request CopyGC // size: 16 -type CopyGCCookie cookie +type CopyGCCookie struct { + *cookie +} // Write request to wire for CopyGC func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { cookie := c.newCookie(false, false) - c.newRequest(copyGCRequest(SrcGc, DstGc, ValueMask), cookie) - return CopyGCCookie(cookie) + c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie{cookie} } func (c *Conn) CopyGCChecked(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { cookie := c.newCookie(true, false) - c.newRequest(copyGCRequest(SrcGc, DstGc, ValueMask), cookie) - return CopyGCCookie(cookie) + c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie{cookie} +} + +func (cook CopyGCCookie) Check() error { + return cook.check() } // Write request to wire for CopyGC -func copyGCRequest(SrcGc Id, DstGc Id, ValueMask uint32) []byte { +func (c *Conn) copyGCRequest(SrcGc Id, DstGc Id, ValueMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9433,23 +10252,29 @@ func copyGCRequest(SrcGc Id, DstGc Id, ValueMask uint32) []byte { // Request SetDashes // size: pad((12 + pad((int(DashesLen) * 1)))) -type SetDashesCookie cookie +type SetDashesCookie struct { + *cookie +} // Write request to wire for SetDashes func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.newCookie(false, false) - c.newRequest(setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) - return SetDashesCookie(cookie) + c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie{cookie} } func (c *Conn) SetDashesChecked(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.newCookie(true, false) - c.newRequest(setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) - return SetDashesCookie(cookie) + c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie{cookie} +} + +func (cook SetDashesCookie) Check() error { + return cook.check() } // Write request to wire for SetDashes -func setDashesRequest(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { +func (c *Conn) setDashesRequest(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { size := pad((12 + pad((int(DashesLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9479,23 +10304,29 @@ func setDashesRequest(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) // Request SetClipRectangles // size: pad((12 + pad((len(Rectangles) * 8)))) -type SetClipRectanglesCookie cookie +type SetClipRectanglesCookie struct { + *cookie +} // Write request to wire for SetClipRectangles func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.newCookie(false, false) - c.newRequest(setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return SetClipRectanglesCookie(cookie) + c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie{cookie} } func (c *Conn) SetClipRectanglesChecked(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.newCookie(true, false) - c.newRequest(setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return SetClipRectanglesCookie(cookie) + c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie{cookie} +} + +func (cook SetClipRectanglesCookie) Check() error { + return cook.check() } // Write request to wire for SetClipRectangles -func setClipRectanglesRequest(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { +func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -9525,23 +10356,29 @@ func setClipRectanglesRequest(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrig // Request FreeGC // size: 8 -type FreeGCCookie cookie +type FreeGCCookie struct { + *cookie +} // Write request to wire for FreeGC func (c *Conn) FreeGC(Gc Id) FreeGCCookie { cookie := c.newCookie(false, false) - c.newRequest(freeGCRequest(Gc), cookie) - return FreeGCCookie(cookie) + c.newRequest(c.freeGCRequest(Gc), cookie) + return FreeGCCookie{cookie} } func (c *Conn) FreeGCChecked(Gc Id) FreeGCCookie { cookie := c.newCookie(true, false) - c.newRequest(freeGCRequest(Gc), cookie) - return FreeGCCookie(cookie) + c.newRequest(c.freeGCRequest(Gc), cookie) + return FreeGCCookie{cookie} +} + +func (cook FreeGCCookie) Check() error { + return cook.check() } // Write request to wire for FreeGC -func freeGCRequest(Gc Id) []byte { +func (c *Conn) freeGCRequest(Gc Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9562,23 +10399,29 @@ func freeGCRequest(Gc Id) []byte { // Request ClearArea // size: 16 -type ClearAreaCookie cookie +type ClearAreaCookie struct { + *cookie +} // Write request to wire for ClearArea func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.newCookie(false, false) - c.newRequest(clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) - return ClearAreaCookie(cookie) + c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie{cookie} } func (c *Conn) ClearAreaChecked(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.newCookie(true, false) - c.newRequest(clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) - return ClearAreaCookie(cookie) + c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie{cookie} +} + +func (cook ClearAreaCookie) Check() error { + return cook.check() } // Write request to wire for ClearArea -func clearAreaRequest(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) []byte { +func (c *Conn) clearAreaRequest(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9616,23 +10459,29 @@ func clearAreaRequest(Exposures bool, Window Id, X int16, Y int16, Width uint16, // Request CopyArea // size: 28 -type CopyAreaCookie cookie +type CopyAreaCookie struct { + *cookie +} // Write request to wire for CopyArea func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.newCookie(false, false) - c.newRequest(copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) - return CopyAreaCookie(cookie) + c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie{cookie} } func (c *Conn) CopyAreaChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.newCookie(true, false) - c.newRequest(copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) - return CopyAreaCookie(cookie) + c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie{cookie} +} + +func (cook CopyAreaCookie) Check() error { + return cook.check() } // Write request to wire for CopyArea -func copyAreaRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { +func (c *Conn) copyAreaRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -9677,23 +10526,29 @@ func copyAreaRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int // Request CopyPlane // size: 32 -type CopyPlaneCookie cookie +type CopyPlaneCookie struct { + *cookie +} // Write request to wire for CopyPlane func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.newCookie(false, false) - c.newRequest(copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) - return CopyPlaneCookie(cookie) + c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie{cookie} } func (c *Conn) CopyPlaneChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.newCookie(true, false) - c.newRequest(copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) - return CopyPlaneCookie(cookie) + c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie{cookie} +} + +func (cook CopyPlaneCookie) Check() error { + return cook.check() } // Write request to wire for CopyPlane -func copyPlaneRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { +func (c *Conn) copyPlaneRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -9741,23 +10596,29 @@ func copyPlaneRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY in // Request PolyPoint // size: pad((12 + pad((len(Points) * 4)))) -type PolyPointCookie cookie +type PolyPointCookie struct { + *cookie +} // Write request to wire for PolyPoint func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { cookie := c.newCookie(false, false) - c.newRequest(polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) - return PolyPointCookie(cookie) + c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie{cookie} } func (c *Conn) PolyPointChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { cookie := c.newCookie(true, false) - c.newRequest(polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) - return PolyPointCookie(cookie) + c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie{cookie} +} + +func (cook PolyPointCookie) Check() error { + return cook.check() } // Write request to wire for PolyPoint -func polyPointRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { +func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -9784,23 +10645,29 @@ func polyPointRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) [ // Request PolyLine // size: pad((12 + pad((len(Points) * 4)))) -type PolyLineCookie cookie +type PolyLineCookie struct { + *cookie +} // Write request to wire for PolyLine func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { cookie := c.newCookie(false, false) - c.newRequest(polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) - return PolyLineCookie(cookie) + c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie{cookie} } func (c *Conn) PolyLineChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { cookie := c.newCookie(true, false) - c.newRequest(polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) - return PolyLineCookie(cookie) + c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie{cookie} +} + +func (cook PolyLineCookie) Check() error { + return cook.check() } // Write request to wire for PolyLine -func polyLineRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { +func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -9827,23 +10694,29 @@ func polyLineRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) [] // Request PolySegment // size: pad((12 + pad((len(Segments) * 8)))) -type PolySegmentCookie cookie +type PolySegmentCookie struct { + *cookie +} // Write request to wire for PolySegment func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { cookie := c.newCookie(false, false) - c.newRequest(polySegmentRequest(Drawable, Gc, Segments), cookie) - return PolySegmentCookie(cookie) + c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) + return PolySegmentCookie{cookie} } func (c *Conn) PolySegmentChecked(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { cookie := c.newCookie(true, false) - c.newRequest(polySegmentRequest(Drawable, Gc, Segments), cookie) - return PolySegmentCookie(cookie) + c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) + return PolySegmentCookie{cookie} +} + +func (cook PolySegmentCookie) Check() error { + return cook.check() } // Write request to wire for PolySegment -func polySegmentRequest(Drawable Id, Gc Id, Segments []Segment) []byte { +func (c *Conn) polySegmentRequest(Drawable Id, Gc Id, Segments []Segment) []byte { size := pad((12 + pad((len(Segments) * 8)))) b := 0 buf := make([]byte, size) @@ -9869,23 +10742,29 @@ func polySegmentRequest(Drawable Id, Gc Id, Segments []Segment) []byte { // Request PolyRectangle // size: pad((12 + pad((len(Rectangles) * 8)))) -type PolyRectangleCookie cookie +type PolyRectangleCookie struct { + *cookie +} // Write request to wire for PolyRectangle func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.newCookie(false, false) - c.newRequest(polyRectangleRequest(Drawable, Gc, Rectangles), cookie) - return PolyRectangleCookie(cookie) + c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie{cookie} } func (c *Conn) PolyRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.newCookie(true, false) - c.newRequest(polyRectangleRequest(Drawable, Gc, Rectangles), cookie) - return PolyRectangleCookie(cookie) + c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie{cookie} +} + +func (cook PolyRectangleCookie) Check() error { + return cook.check() } // Write request to wire for PolyRectangle -func polyRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { +func (c *Conn) polyRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -9911,23 +10790,29 @@ func polyRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { // Request PolyArc // size: pad((12 + pad((len(Arcs) * 12)))) -type PolyArcCookie cookie +type PolyArcCookie struct { + *cookie +} // Write request to wire for PolyArc func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { cookie := c.newCookie(false, false) - c.newRequest(polyArcRequest(Drawable, Gc, Arcs), cookie) - return PolyArcCookie(cookie) + c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) + return PolyArcCookie{cookie} } func (c *Conn) PolyArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { cookie := c.newCookie(true, false) - c.newRequest(polyArcRequest(Drawable, Gc, Arcs), cookie) - return PolyArcCookie(cookie) + c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) + return PolyArcCookie{cookie} +} + +func (cook PolyArcCookie) Check() error { + return cook.check() } // Write request to wire for PolyArc -func polyArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { +func (c *Conn) polyArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -9953,23 +10838,29 @@ func polyArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { // Request FillPoly // size: pad((16 + pad((len(Points) * 4)))) -type FillPolyCookie cookie +type FillPolyCookie struct { + *cookie +} // Write request to wire for FillPoly func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.newCookie(false, false) - c.newRequest(fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) - return FillPolyCookie(cookie) + c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie{cookie} } func (c *Conn) FillPolyChecked(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.newCookie(true, false) - c.newRequest(fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) - return FillPolyCookie(cookie) + c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie{cookie} +} + +func (cook FillPolyCookie) Check() error { + return cook.check() } // Write request to wire for FillPoly -func fillPolyRequest(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) []byte { +func (c *Conn) fillPolyRequest(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) []byte { size := pad((16 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10003,23 +10894,29 @@ func fillPolyRequest(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points // Request PolyFillRectangle // size: pad((12 + pad((len(Rectangles) * 8)))) -type PolyFillRectangleCookie cookie +type PolyFillRectangleCookie struct { + *cookie +} // Write request to wire for PolyFillRectangle func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.newCookie(false, false) - c.newRequest(polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) - return PolyFillRectangleCookie(cookie) + c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie{cookie} } func (c *Conn) PolyFillRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.newCookie(true, false) - c.newRequest(polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) - return PolyFillRectangleCookie(cookie) + c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie{cookie} +} + +func (cook PolyFillRectangleCookie) Check() error { + return cook.check() } // Write request to wire for PolyFillRectangle -func polyFillRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { +func (c *Conn) polyFillRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10045,23 +10942,29 @@ func polyFillRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte // Request PolyFillArc // size: pad((12 + pad((len(Arcs) * 12)))) -type PolyFillArcCookie cookie +type PolyFillArcCookie struct { + *cookie +} // Write request to wire for PolyFillArc func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { cookie := c.newCookie(false, false) - c.newRequest(polyFillArcRequest(Drawable, Gc, Arcs), cookie) - return PolyFillArcCookie(cookie) + c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie{cookie} } func (c *Conn) PolyFillArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { cookie := c.newCookie(true, false) - c.newRequest(polyFillArcRequest(Drawable, Gc, Arcs), cookie) - return PolyFillArcCookie(cookie) + c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie{cookie} +} + +func (cook PolyFillArcCookie) Check() error { + return cook.check() } // Write request to wire for PolyFillArc -func polyFillArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { +func (c *Conn) polyFillArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -10087,23 +10990,29 @@ func polyFillArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { // Request PutImage // size: pad((24 + pad((len(Data) * 1)))) -type PutImageCookie cookie +type PutImageCookie struct { + *cookie +} // Write request to wire for PutImage func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.newCookie(false, false) - c.newRequest(putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) - return PutImageCookie(cookie) + c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie{cookie} } func (c *Conn) PutImageChecked(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.newCookie(true, false) - c.newRequest(putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) - return PutImageCookie(cookie) + c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie{cookie} +} + +func (cook PutImageCookie) Check() error { + return cook.check() } // Write request to wire for PutImage -func putImageRequest(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { +func (c *Conn) putImageRequest(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { size := pad((24 + pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -10151,18 +11060,20 @@ func putImageRequest(Format byte, Drawable Id, Gc Id, Width uint16, Height uint1 // Request GetImage // size: 20 -type GetImageCookie cookie +type GetImageCookie struct { + *cookie +} func (c *Conn) GetImage(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.newCookie(true, true) - c.newRequest(getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) - return GetImageCookie(cookie) + c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie{cookie} } func (c *Conn) GetImageUnchecked(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.newCookie(false, true) - c.newRequest(getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) - return GetImageCookie(cookie) + c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie{cookie} } // Request reply for GetImage @@ -10178,10 +11089,13 @@ type GetImageReply struct { // Waits and reads reply data from request GetImage func (cook GetImageCookie) Reply() (*GetImageReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getImageReply(buf), nil } @@ -10211,8 +11125,12 @@ func getImageReply(buf []byte) *GetImageReply { return v } +func (cook GetImageCookie) Check() error { + return cook.check() +} + // Write request to wire for GetImage -func getImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { +func (c *Conn) getImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -10249,23 +11167,29 @@ func getImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, H // Request PolyText8 // size: pad((16 + pad((len(Items) * 1)))) -type PolyText8Cookie cookie +type PolyText8Cookie struct { + *cookie +} // Write request to wire for PolyText8 func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.newCookie(false, false) - c.newRequest(polyText8Request(Drawable, Gc, X, Y, Items), cookie) - return PolyText8Cookie(cookie) + c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie{cookie} } func (c *Conn) PolyText8Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.newCookie(true, false) - c.newRequest(polyText8Request(Drawable, Gc, X, Y, Items), cookie) - return PolyText8Cookie(cookie) + c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie{cookie} +} + +func (cook PolyText8Cookie) Check() error { + return cook.check() } // Write request to wire for PolyText8 -func polyText8Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { +func (c *Conn) polyText8Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -10298,23 +11222,29 @@ func polyText8Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte // Request PolyText16 // size: pad((16 + pad((len(Items) * 1)))) -type PolyText16Cookie cookie +type PolyText16Cookie struct { + *cookie +} // Write request to wire for PolyText16 func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.newCookie(false, false) - c.newRequest(polyText16Request(Drawable, Gc, X, Y, Items), cookie) - return PolyText16Cookie(cookie) + c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie{cookie} } func (c *Conn) PolyText16Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.newCookie(true, false) - c.newRequest(polyText16Request(Drawable, Gc, X, Y, Items), cookie) - return PolyText16Cookie(cookie) + c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie{cookie} +} + +func (cook PolyText16Cookie) Check() error { + return cook.check() } // Write request to wire for PolyText16 -func polyText16Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { +func (c *Conn) polyText16Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -10347,23 +11277,29 @@ func polyText16Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byt // Request ImageText8 // size: pad((16 + pad((int(StringLen) * 1)))) -type ImageText8Cookie cookie +type ImageText8Cookie struct { + *cookie +} // Write request to wire for ImageText8 func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { cookie := c.newCookie(false, false) - c.newRequest(imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText8Cookie(cookie) + c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie{cookie} } func (c *Conn) ImageText8Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { cookie := c.newCookie(true, false) - c.newRequest(imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText8Cookie(cookie) + c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie{cookie} +} + +func (cook ImageText8Cookie) Check() error { + return cook.check() } // Write request to wire for ImageText8 -func imageText8Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) []byte { +func (c *Conn) imageText8Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) []byte { size := pad((16 + pad((int(StringLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10397,23 +11333,29 @@ func imageText8Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, Str // Request ImageText16 // size: pad((16 + pad((int(StringLen) * 2)))) -type ImageText16Cookie cookie +type ImageText16Cookie struct { + *cookie +} // Write request to wire for ImageText16 func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.newCookie(false, false) - c.newRequest(imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText16Cookie(cookie) + c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie{cookie} } func (c *Conn) ImageText16Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.newCookie(true, false) - c.newRequest(imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText16Cookie(cookie) + c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie{cookie} +} + +func (cook ImageText16Cookie) Check() error { + return cook.check() } // Write request to wire for ImageText16 -func imageText16Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) []byte { +func (c *Conn) imageText16Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) []byte { size := pad((16 + pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) @@ -10446,23 +11388,29 @@ func imageText16Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, St // Request CreateColormap // size: 16 -type CreateColormapCookie cookie +type CreateColormapCookie struct { + *cookie +} // Write request to wire for CreateColormap func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { cookie := c.newCookie(false, false) - c.newRequest(createColormapRequest(Alloc, Mid, Window, Visual), cookie) - return CreateColormapCookie(cookie) + c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie{cookie} } func (c *Conn) CreateColormapChecked(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { cookie := c.newCookie(true, false) - c.newRequest(createColormapRequest(Alloc, Mid, Window, Visual), cookie) - return CreateColormapCookie(cookie) + c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie{cookie} +} + +func (cook CreateColormapCookie) Check() error { + return cook.check() } // Write request to wire for CreateColormap -func createColormapRequest(Alloc byte, Mid Id, Window Id, Visual Visualid) []byte { +func (c *Conn) createColormapRequest(Alloc byte, Mid Id, Window Id, Visual Visualid) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10490,23 +11438,29 @@ func createColormapRequest(Alloc byte, Mid Id, Window Id, Visual Visualid) []byt // Request FreeColormap // size: 8 -type FreeColormapCookie cookie +type FreeColormapCookie struct { + *cookie +} // Write request to wire for FreeColormap func (c *Conn) FreeColormap(Cmap Id) FreeColormapCookie { cookie := c.newCookie(false, false) - c.newRequest(freeColormapRequest(Cmap), cookie) - return FreeColormapCookie(cookie) + c.newRequest(c.freeColormapRequest(Cmap), cookie) + return FreeColormapCookie{cookie} } func (c *Conn) FreeColormapChecked(Cmap Id) FreeColormapCookie { cookie := c.newCookie(true, false) - c.newRequest(freeColormapRequest(Cmap), cookie) - return FreeColormapCookie(cookie) + c.newRequest(c.freeColormapRequest(Cmap), cookie) + return FreeColormapCookie{cookie} +} + +func (cook FreeColormapCookie) Check() error { + return cook.check() } // Write request to wire for FreeColormap -func freeColormapRequest(Cmap Id) []byte { +func (c *Conn) freeColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10527,23 +11481,29 @@ func freeColormapRequest(Cmap Id) []byte { // Request CopyColormapAndFree // size: 12 -type CopyColormapAndFreeCookie cookie +type CopyColormapAndFreeCookie struct { + *cookie +} // Write request to wire for CopyColormapAndFree func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { cookie := c.newCookie(false, false) - c.newRequest(copyColormapAndFreeRequest(Mid, SrcCmap), cookie) - return CopyColormapAndFreeCookie(cookie) + c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie{cookie} } func (c *Conn) CopyColormapAndFreeChecked(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { cookie := c.newCookie(true, false) - c.newRequest(copyColormapAndFreeRequest(Mid, SrcCmap), cookie) - return CopyColormapAndFreeCookie(cookie) + c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie{cookie} +} + +func (cook CopyColormapAndFreeCookie) Check() error { + return cook.check() } // Write request to wire for CopyColormapAndFree -func copyColormapAndFreeRequest(Mid Id, SrcCmap Id) []byte { +func (c *Conn) copyColormapAndFreeRequest(Mid Id, SrcCmap Id) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -10567,23 +11527,29 @@ func copyColormapAndFreeRequest(Mid Id, SrcCmap Id) []byte { // Request InstallColormap // size: 8 -type InstallColormapCookie cookie +type InstallColormapCookie struct { + *cookie +} // Write request to wire for InstallColormap func (c *Conn) InstallColormap(Cmap Id) InstallColormapCookie { cookie := c.newCookie(false, false) - c.newRequest(installColormapRequest(Cmap), cookie) - return InstallColormapCookie(cookie) + c.newRequest(c.installColormapRequest(Cmap), cookie) + return InstallColormapCookie{cookie} } func (c *Conn) InstallColormapChecked(Cmap Id) InstallColormapCookie { cookie := c.newCookie(true, false) - c.newRequest(installColormapRequest(Cmap), cookie) - return InstallColormapCookie(cookie) + c.newRequest(c.installColormapRequest(Cmap), cookie) + return InstallColormapCookie{cookie} +} + +func (cook InstallColormapCookie) Check() error { + return cook.check() } // Write request to wire for InstallColormap -func installColormapRequest(Cmap Id) []byte { +func (c *Conn) installColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10604,23 +11570,29 @@ func installColormapRequest(Cmap Id) []byte { // Request UninstallColormap // size: 8 -type UninstallColormapCookie cookie +type UninstallColormapCookie struct { + *cookie +} // Write request to wire for UninstallColormap func (c *Conn) UninstallColormap(Cmap Id) UninstallColormapCookie { cookie := c.newCookie(false, false) - c.newRequest(uninstallColormapRequest(Cmap), cookie) - return UninstallColormapCookie(cookie) + c.newRequest(c.uninstallColormapRequest(Cmap), cookie) + return UninstallColormapCookie{cookie} } func (c *Conn) UninstallColormapChecked(Cmap Id) UninstallColormapCookie { cookie := c.newCookie(true, false) - c.newRequest(uninstallColormapRequest(Cmap), cookie) - return UninstallColormapCookie(cookie) + c.newRequest(c.uninstallColormapRequest(Cmap), cookie) + return UninstallColormapCookie{cookie} +} + +func (cook UninstallColormapCookie) Check() error { + return cook.check() } // Write request to wire for UninstallColormap -func uninstallColormapRequest(Cmap Id) []byte { +func (c *Conn) uninstallColormapRequest(Cmap Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10641,18 +11613,20 @@ func uninstallColormapRequest(Cmap Id) []byte { // Request ListInstalledColormaps // size: 8 -type ListInstalledColormapsCookie cookie +type ListInstalledColormapsCookie struct { + *cookie +} func (c *Conn) ListInstalledColormaps(Window Id) ListInstalledColormapsCookie { cookie := c.newCookie(true, true) - c.newRequest(listInstalledColormapsRequest(Window), cookie) - return ListInstalledColormapsCookie(cookie) + c.newRequest(c.listInstalledColormapsRequest(Window), cookie) + return ListInstalledColormapsCookie{cookie} } func (c *Conn) ListInstalledColormapsUnchecked(Window Id) ListInstalledColormapsCookie { cookie := c.newCookie(false, true) - c.newRequest(listInstalledColormapsRequest(Window), cookie) - return ListInstalledColormapsCookie(cookie) + c.newRequest(c.listInstalledColormapsRequest(Window), cookie) + return ListInstalledColormapsCookie{cookie} } // Request reply for ListInstalledColormaps @@ -10668,10 +11642,13 @@ type ListInstalledColormapsReply struct { // Waits and reads reply data from request ListInstalledColormaps func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listInstalledColormapsReply(buf), nil } @@ -10703,8 +11680,12 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { return v } +func (cook ListInstalledColormapsCookie) Check() error { + return cook.check() +} + // Write request to wire for ListInstalledColormaps -func listInstalledColormapsRequest(Window Id) []byte { +func (c *Conn) listInstalledColormapsRequest(Window Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10725,18 +11706,20 @@ func listInstalledColormapsRequest(Window Id) []byte { // Request AllocColor // size: 16 -type AllocColorCookie cookie +type AllocColorCookie struct { + *cookie +} func (c *Conn) AllocColor(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.newCookie(true, true) - c.newRequest(allocColorRequest(Cmap, Red, Green, Blue), cookie) - return AllocColorCookie(cookie) + c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) + return AllocColorCookie{cookie} } func (c *Conn) AllocColorUnchecked(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.newCookie(false, true) - c.newRequest(allocColorRequest(Cmap, Red, Green, Blue), cookie) - return AllocColorCookie(cookie) + c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) + return AllocColorCookie{cookie} } // Request reply for AllocColor @@ -10754,10 +11737,13 @@ type AllocColorReply struct { // Waits and reads reply data from request AllocColor func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return allocColorReply(buf), nil } @@ -10791,8 +11777,12 @@ func allocColorReply(buf []byte) *AllocColorReply { return v } +func (cook AllocColorCookie) Check() error { + return cook.check() +} + // Write request to wire for AllocColor -func allocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) []byte { +func (c *Conn) allocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10824,18 +11814,20 @@ func allocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) []byte { // Request AllocNamedColor // size: pad((12 + pad((int(NameLen) * 1)))) -type AllocNamedColorCookie cookie +type AllocNamedColorCookie struct { + *cookie +} func (c *Conn) AllocNamedColor(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.newCookie(true, true) - c.newRequest(allocNamedColorRequest(Cmap, NameLen, Name), cookie) - return AllocNamedColorCookie(cookie) + c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie{cookie} } func (c *Conn) AllocNamedColorUnchecked(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.newCookie(false, true) - c.newRequest(allocNamedColorRequest(Cmap, NameLen, Name), cookie) - return AllocNamedColorCookie(cookie) + c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie{cookie} } // Request reply for AllocNamedColor @@ -10855,10 +11847,13 @@ type AllocNamedColorReply struct { // Waits and reads reply data from request AllocNamedColor func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return allocNamedColorReply(buf), nil } @@ -10899,8 +11894,12 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { return v } +func (cook AllocNamedColorCookie) Check() error { + return cook.check() +} + // Write request to wire for AllocNamedColor -func allocNamedColorRequest(Cmap Id, NameLen uint16, Name string) []byte { +func (c *Conn) allocNamedColorRequest(Cmap Id, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10929,18 +11928,20 @@ func allocNamedColorRequest(Cmap Id, NameLen uint16, Name string) []byte { // Request AllocColorCells // size: 12 -type AllocColorCellsCookie cookie +type AllocColorCellsCookie struct { + *cookie +} func (c *Conn) AllocColorCells(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.newCookie(true, true) - c.newRequest(allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) - return AllocColorCellsCookie(cookie) + c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie{cookie} } func (c *Conn) AllocColorCellsUnchecked(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.newCookie(false, true) - c.newRequest(allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) - return AllocColorCellsCookie(cookie) + c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie{cookie} } // Request reply for AllocColorCells @@ -10958,10 +11959,13 @@ type AllocColorCellsReply struct { // Waits and reads reply data from request AllocColorCells func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return allocColorCellsReply(buf), nil } @@ -11003,8 +12007,12 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { return v } +func (cook AllocColorCellsCookie) Check() error { + return cook.check() +} + // Write request to wire for AllocColorCells -func allocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) []byte { +func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -11036,18 +12044,20 @@ func allocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint // Request AllocColorPlanes // size: 16 -type AllocColorPlanesCookie cookie +type AllocColorPlanesCookie struct { + *cookie +} func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.newCookie(true, true) - c.newRequest(allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) - return AllocColorPlanesCookie(cookie) + c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie{cookie} } func (c *Conn) AllocColorPlanesUnchecked(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.newCookie(false, true) - c.newRequest(allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) - return AllocColorPlanesCookie(cookie) + c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie{cookie} } // Request reply for AllocColorPlanes @@ -11067,10 +12077,13 @@ type AllocColorPlanesReply struct { // Waits and reads reply data from request AllocColorPlanes func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return allocColorPlanesReply(buf), nil } @@ -11113,8 +12126,12 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { return v } +func (cook AllocColorPlanesCookie) Check() error { + return cook.check() +} + // Write request to wire for AllocColorPlanes -func allocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { +func (c *Conn) allocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -11152,23 +12169,29 @@ func allocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint1 // Request FreeColors // size: pad((12 + pad((len(Pixels) * 4)))) -type FreeColorsCookie cookie +type FreeColorsCookie struct { + *cookie +} // Write request to wire for FreeColors func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.newCookie(false, false) - c.newRequest(freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) - return FreeColorsCookie(cookie) + c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie{cookie} } func (c *Conn) FreeColorsChecked(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.newCookie(true, false) - c.newRequest(freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) - return FreeColorsCookie(cookie) + c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie{cookie} +} + +func (cook FreeColorsCookie) Check() error { + return cook.check() } // Write request to wire for FreeColors -func freeColorsRequest(Cmap Id, PlaneMask uint32, Pixels []uint32) []byte { +func (c *Conn) freeColorsRequest(Cmap Id, PlaneMask uint32, Pixels []uint32) []byte { size := pad((12 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -11198,23 +12221,29 @@ func freeColorsRequest(Cmap Id, PlaneMask uint32, Pixels []uint32) []byte { // Request StoreColors // size: pad((8 + pad((len(Items) * 12)))) -type StoreColorsCookie cookie +type StoreColorsCookie struct { + *cookie +} // Write request to wire for StoreColors func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) StoreColorsCookie { cookie := c.newCookie(false, false) - c.newRequest(storeColorsRequest(Cmap, Items), cookie) - return StoreColorsCookie(cookie) + c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) + return StoreColorsCookie{cookie} } func (c *Conn) StoreColorsChecked(Cmap Id, Items []Coloritem) StoreColorsCookie { cookie := c.newCookie(true, false) - c.newRequest(storeColorsRequest(Cmap, Items), cookie) - return StoreColorsCookie(cookie) + c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) + return StoreColorsCookie{cookie} +} + +func (cook StoreColorsCookie) Check() error { + return cook.check() } // Write request to wire for StoreColors -func storeColorsRequest(Cmap Id, Items []Coloritem) []byte { +func (c *Conn) storeColorsRequest(Cmap Id, Items []Coloritem) []byte { size := pad((8 + pad((len(Items) * 12)))) b := 0 buf := make([]byte, size) @@ -11237,23 +12266,29 @@ func storeColorsRequest(Cmap Id, Items []Coloritem) []byte { // Request StoreNamedColor // size: pad((16 + pad((int(NameLen) * 1)))) -type StoreNamedColorCookie cookie +type StoreNamedColorCookie struct { + *cookie +} // Write request to wire for StoreNamedColor func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.newCookie(false, false) - c.newRequest(storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) - return StoreNamedColorCookie(cookie) + c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) + return StoreNamedColorCookie{cookie} } func (c *Conn) StoreNamedColorChecked(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.newCookie(true, false) - c.newRequest(storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) - return StoreNamedColorCookie(cookie) + c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) + return StoreNamedColorCookie{cookie} +} + +func (cook StoreNamedColorCookie) Check() error { + return cook.check() } // Write request to wire for StoreNamedColor -func storeNamedColorRequest(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) []byte { +func (c *Conn) storeNamedColorRequest(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) []byte { size := pad((16 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11286,18 +12321,20 @@ func storeNamedColorRequest(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, N // Request QueryColors // size: pad((8 + pad((len(Pixels) * 4)))) -type QueryColorsCookie cookie +type QueryColorsCookie struct { + *cookie +} func (c *Conn) QueryColors(Cmap Id, Pixels []uint32) QueryColorsCookie { cookie := c.newCookie(true, true) - c.newRequest(queryColorsRequest(Cmap, Pixels), cookie) - return QueryColorsCookie(cookie) + c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) + return QueryColorsCookie{cookie} } func (c *Conn) QueryColorsUnchecked(Cmap Id, Pixels []uint32) QueryColorsCookie { cookie := c.newCookie(false, true) - c.newRequest(queryColorsRequest(Cmap, Pixels), cookie) - return QueryColorsCookie(cookie) + c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) + return QueryColorsCookie{cookie} } // Request reply for QueryColors @@ -11313,10 +12350,13 @@ type QueryColorsReply struct { // Waits and reads reply data from request QueryColors func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryColorsReply(buf), nil } @@ -11344,8 +12384,12 @@ func queryColorsReply(buf []byte) *QueryColorsReply { return v } +func (cook QueryColorsCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryColors -func queryColorsRequest(Cmap Id, Pixels []uint32) []byte { +func (c *Conn) queryColorsRequest(Cmap Id, Pixels []uint32) []byte { size := pad((8 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -11372,18 +12416,20 @@ func queryColorsRequest(Cmap Id, Pixels []uint32) []byte { // Request LookupColor // size: pad((12 + pad((int(NameLen) * 1)))) -type LookupColorCookie cookie +type LookupColorCookie struct { + *cookie +} func (c *Conn) LookupColor(Cmap Id, NameLen uint16, Name string) LookupColorCookie { cookie := c.newCookie(true, true) - c.newRequest(lookupColorRequest(Cmap, NameLen, Name), cookie) - return LookupColorCookie(cookie) + c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) + return LookupColorCookie{cookie} } func (c *Conn) LookupColorUnchecked(Cmap Id, NameLen uint16, Name string) LookupColorCookie { cookie := c.newCookie(false, true) - c.newRequest(lookupColorRequest(Cmap, NameLen, Name), cookie) - return LookupColorCookie(cookie) + c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) + return LookupColorCookie{cookie} } // Request reply for LookupColor @@ -11402,10 +12448,13 @@ type LookupColorReply struct { // Waits and reads reply data from request LookupColor func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return lookupColorReply(buf), nil } @@ -11443,8 +12492,12 @@ func lookupColorReply(buf []byte) *LookupColorReply { return v } +func (cook LookupColorCookie) Check() error { + return cook.check() +} + // Write request to wire for LookupColor -func lookupColorRequest(Cmap Id, NameLen uint16, Name string) []byte { +func (c *Conn) lookupColorRequest(Cmap Id, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11473,23 +12526,29 @@ func lookupColorRequest(Cmap Id, NameLen uint16, Name string) []byte { // Request CreateCursor // size: 32 -type CreateCursorCookie cookie +type CreateCursorCookie struct { + *cookie +} // Write request to wire for CreateCursor func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.newCookie(false, false) - c.newRequest(createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) - return CreateCursorCookie(cookie) + c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie{cookie} } func (c *Conn) CreateCursorChecked(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.newCookie(true, false) - c.newRequest(createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) - return CreateCursorCookie(cookie) + c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +func (cook CreateCursorCookie) Check() error { + return cook.check() } // Write request to wire for CreateCursor -func createCursorRequest(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { +func (c *Conn) createCursorRequest(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -11540,23 +12599,29 @@ func createCursorRequest(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen u // Request CreateGlyphCursor // size: 32 -type CreateGlyphCursorCookie cookie +type CreateGlyphCursorCookie struct { + *cookie +} // Write request to wire for CreateGlyphCursor func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.newCookie(false, false) - c.newRequest(createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return CreateGlyphCursorCookie(cookie) + c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie{cookie} } func (c *Conn) CreateGlyphCursorChecked(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.newCookie(true, false) - c.newRequest(createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return CreateGlyphCursorCookie(cookie) + c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie{cookie} +} + +func (cook CreateGlyphCursorCookie) Check() error { + return cook.check() } // Write request to wire for CreateGlyphCursor -func createGlyphCursorRequest(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func (c *Conn) createGlyphCursorRequest(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -11607,23 +12672,29 @@ func createGlyphCursorRequest(Cid Id, SourceFont Id, MaskFont Id, SourceChar uin // Request FreeCursor // size: 8 -type FreeCursorCookie cookie +type FreeCursorCookie struct { + *cookie +} // Write request to wire for FreeCursor func (c *Conn) FreeCursor(Cursor Id) FreeCursorCookie { cookie := c.newCookie(false, false) - c.newRequest(freeCursorRequest(Cursor), cookie) - return FreeCursorCookie(cookie) + c.newRequest(c.freeCursorRequest(Cursor), cookie) + return FreeCursorCookie{cookie} } func (c *Conn) FreeCursorChecked(Cursor Id) FreeCursorCookie { cookie := c.newCookie(true, false) - c.newRequest(freeCursorRequest(Cursor), cookie) - return FreeCursorCookie(cookie) + c.newRequest(c.freeCursorRequest(Cursor), cookie) + return FreeCursorCookie{cookie} +} + +func (cook FreeCursorCookie) Check() error { + return cook.check() } // Write request to wire for FreeCursor -func freeCursorRequest(Cursor Id) []byte { +func (c *Conn) freeCursorRequest(Cursor Id) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11644,23 +12715,29 @@ func freeCursorRequest(Cursor Id) []byte { // Request RecolorCursor // size: 20 -type RecolorCursorCookie cookie +type RecolorCursorCookie struct { + *cookie +} // Write request to wire for RecolorCursor func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.newCookie(false, false) - c.newRequest(recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return RecolorCursorCookie(cookie) + c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie{cookie} } func (c *Conn) RecolorCursorChecked(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.newCookie(true, false) - c.newRequest(recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return RecolorCursorCookie(cookie) + c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie{cookie} +} + +func (cook RecolorCursorCookie) Check() error { + return cook.check() } // Write request to wire for RecolorCursor -func recolorCursorRequest(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func (c *Conn) recolorCursorRequest(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -11699,18 +12776,20 @@ func recolorCursorRequest(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue // Request QueryBestSize // size: 12 -type QueryBestSizeCookie cookie +type QueryBestSizeCookie struct { + *cookie +} func (c *Conn) QueryBestSize(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.newCookie(true, true) - c.newRequest(queryBestSizeRequest(Class, Drawable, Width, Height), cookie) - return QueryBestSizeCookie(cookie) + c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie{cookie} } func (c *Conn) QueryBestSizeUnchecked(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.newCookie(false, true) - c.newRequest(queryBestSizeRequest(Class, Drawable, Width, Height), cookie) - return QueryBestSizeCookie(cookie) + c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie{cookie} } // Request reply for QueryBestSize @@ -11725,10 +12804,13 @@ type QueryBestSizeReply struct { // Waits and reads reply data from request QueryBestSize func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryBestSizeReply(buf), nil } @@ -11754,8 +12836,12 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { return v } +func (cook QueryBestSizeCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryBestSize -func queryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) []byte { +func (c *Conn) queryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -11783,18 +12869,20 @@ func queryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) // Request QueryExtension // size: pad((8 + pad((int(NameLen) * 1)))) -type QueryExtensionCookie cookie +type QueryExtensionCookie struct { + *cookie +} func (c *Conn) QueryExtension(NameLen uint16, Name string) QueryExtensionCookie { cookie := c.newCookie(true, true) - c.newRequest(queryExtensionRequest(NameLen, Name), cookie) - return QueryExtensionCookie(cookie) + c.newRequest(c.queryExtensionRequest(NameLen, Name), cookie) + return QueryExtensionCookie{cookie} } func (c *Conn) QueryExtensionUnchecked(NameLen uint16, Name string) QueryExtensionCookie { cookie := c.newCookie(false, true) - c.newRequest(queryExtensionRequest(NameLen, Name), cookie) - return QueryExtensionCookie(cookie) + c.newRequest(c.queryExtensionRequest(NameLen, Name), cookie) + return QueryExtensionCookie{cookie} } // Request reply for QueryExtension @@ -11811,10 +12899,13 @@ type QueryExtensionReply struct { // Waits and reads reply data from request QueryExtension func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return queryExtensionReply(buf), nil } @@ -11850,8 +12941,12 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { return v } +func (cook QueryExtensionCookie) Check() error { + return cook.check() +} + // Write request to wire for QueryExtension -func queryExtensionRequest(NameLen uint16, Name string) []byte { +func (c *Conn) queryExtensionRequest(NameLen uint16, Name string) []byte { size := pad((8 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11877,18 +12972,20 @@ func queryExtensionRequest(NameLen uint16, Name string) []byte { // Request ListExtensions // size: 4 -type ListExtensionsCookie cookie +type ListExtensionsCookie struct { + *cookie +} func (c *Conn) ListExtensions() ListExtensionsCookie { cookie := c.newCookie(true, true) - c.newRequest(listExtensionsRequest(), cookie) - return ListExtensionsCookie(cookie) + c.newRequest(c.listExtensionsRequest(), cookie) + return ListExtensionsCookie{cookie} } func (c *Conn) ListExtensionsUnchecked() ListExtensionsCookie { cookie := c.newCookie(false, true) - c.newRequest(listExtensionsRequest(), cookie) - return ListExtensionsCookie(cookie) + c.newRequest(c.listExtensionsRequest(), cookie) + return ListExtensionsCookie{cookie} } // Request reply for ListExtensions @@ -11903,10 +13000,13 @@ type ListExtensionsReply struct { // Waits and reads reply data from request ListExtensions func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listExtensionsReply(buf), nil } @@ -11932,8 +13032,12 @@ func listExtensionsReply(buf []byte) *ListExtensionsReply { return v } +func (cook ListExtensionsCookie) Check() error { + return cook.check() +} + // Write request to wire for ListExtensions -func listExtensionsRequest() []byte { +func (c *Conn) listExtensionsRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -11941,28 +13045,38 @@ func listExtensionsRequest() []byte { buf[b] = 99 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request ChangeKeyboardMapping // size: pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) -type ChangeKeyboardMappingCookie cookie +type ChangeKeyboardMappingCookie struct { + *cookie +} // Write request to wire for ChangeKeyboardMapping func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.newCookie(false, false) - c.newRequest(changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) - return ChangeKeyboardMappingCookie(cookie) + c.newRequest(c.changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie{cookie} } func (c *Conn) ChangeKeyboardMappingChecked(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.newCookie(true, false) - c.newRequest(changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) - return ChangeKeyboardMappingCookie(cookie) + c.newRequest(c.changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie{cookie} +} + +func (cook ChangeKeyboardMappingCookie) Check() error { + return cook.check() } // Write request to wire for ChangeKeyboardMapping -func changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { +func (c *Conn) changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { size := pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 buf := make([]byte, size) @@ -11995,18 +13109,20 @@ func changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keycode, Keysy // Request GetKeyboardMapping // size: 8 -type GetKeyboardMappingCookie cookie +type GetKeyboardMappingCookie struct { + *cookie +} func (c *Conn) GetKeyboardMapping(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.newCookie(true, true) - c.newRequest(getKeyboardMappingRequest(FirstKeycode, Count), cookie) - return GetKeyboardMappingCookie(cookie) + c.newRequest(c.getKeyboardMappingRequest(FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie{cookie} } func (c *Conn) GetKeyboardMappingUnchecked(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.newCookie(false, true) - c.newRequest(getKeyboardMappingRequest(FirstKeycode, Count), cookie) - return GetKeyboardMappingCookie(cookie) + c.newRequest(c.getKeyboardMappingRequest(FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie{cookie} } // Request reply for GetKeyboardMapping @@ -12021,10 +13137,13 @@ type GetKeyboardMappingReply struct { // Waits and reads reply data from request GetKeyboardMapping func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getKeyboardMappingReply(buf), nil } @@ -12054,8 +13173,12 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { return v } +func (cook GetKeyboardMappingCookie) Check() error { + return cook.check() +} + // Write request to wire for GetKeyboardMapping -func getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byte { +func (c *Conn) getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -12079,23 +13202,29 @@ func getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byte { // Request ChangeKeyboardControl // size: pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) -type ChangeKeyboardControlCookie cookie +type ChangeKeyboardControlCookie struct { + *cookie +} // Write request to wire for ChangeKeyboardControl func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.newCookie(false, false) - c.newRequest(changeKeyboardControlRequest(ValueMask, ValueList), cookie) - return ChangeKeyboardControlCookie(cookie) + c.newRequest(c.changeKeyboardControlRequest(ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie{cookie} } func (c *Conn) ChangeKeyboardControlChecked(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.newCookie(true, false) - c.newRequest(changeKeyboardControlRequest(ValueMask, ValueList), cookie) - return ChangeKeyboardControlCookie(cookie) + c.newRequest(c.changeKeyboardControlRequest(ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie{cookie} +} + +func (cook ChangeKeyboardControlCookie) Check() error { + return cook.check() } // Write request to wire for ChangeKeyboardControl -func changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32) []byte { size := pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -12121,18 +13250,20 @@ func changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32) []byte { // Request GetKeyboardControl // size: 4 -type GetKeyboardControlCookie cookie +type GetKeyboardControlCookie struct { + *cookie +} func (c *Conn) GetKeyboardControl() GetKeyboardControlCookie { cookie := c.newCookie(true, true) - c.newRequest(getKeyboardControlRequest(), cookie) - return GetKeyboardControlCookie(cookie) + c.newRequest(c.getKeyboardControlRequest(), cookie) + return GetKeyboardControlCookie{cookie} } func (c *Conn) GetKeyboardControlUnchecked() GetKeyboardControlCookie { cookie := c.newCookie(false, true) - c.newRequest(getKeyboardControlRequest(), cookie) - return GetKeyboardControlCookie(cookie) + c.newRequest(c.getKeyboardControlRequest(), cookie) + return GetKeyboardControlCookie{cookie} } // Request reply for GetKeyboardControl @@ -12152,10 +13283,13 @@ type GetKeyboardControlReply struct { // Waits and reads reply data from request GetKeyboardControl func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getKeyboardControlReply(buf), nil } @@ -12197,8 +13331,12 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { return v } +func (cook GetKeyboardControlCookie) Check() error { + return cook.check() +} + // Write request to wire for GetKeyboardControl -func getKeyboardControlRequest() []byte { +func (c *Conn) getKeyboardControlRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12206,28 +13344,38 @@ func getKeyboardControlRequest() []byte { buf[b] = 103 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request Bell // size: 4 -type BellCookie cookie +type BellCookie struct { + *cookie +} // Write request to wire for Bell func (c *Conn) Bell(Percent int8) BellCookie { cookie := c.newCookie(false, false) - c.newRequest(bellRequest(Percent), cookie) - return BellCookie(cookie) + c.newRequest(c.bellRequest(Percent), cookie) + return BellCookie{cookie} } func (c *Conn) BellChecked(Percent int8) BellCookie { cookie := c.newCookie(true, false) - c.newRequest(bellRequest(Percent), cookie) - return BellCookie(cookie) + c.newRequest(c.bellRequest(Percent), cookie) + return BellCookie{cookie} +} + +func (cook BellCookie) Check() error { + return cook.check() } // Write request to wire for Bell -func bellRequest(Percent int8) []byte { +func (c *Conn) bellRequest(Percent int8) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12238,28 +13386,37 @@ func bellRequest(Percent int8) []byte { buf[b] = byte(Percent) b += 1 + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request ChangePointerControl // size: 12 -type ChangePointerControlCookie cookie +type ChangePointerControlCookie struct { + *cookie +} // Write request to wire for ChangePointerControl func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.newCookie(false, false) - c.newRequest(changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) - return ChangePointerControlCookie(cookie) + c.newRequest(c.changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie{cookie} } func (c *Conn) ChangePointerControlChecked(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.newCookie(true, false) - c.newRequest(changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) - return ChangePointerControlCookie(cookie) + c.newRequest(c.changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie{cookie} +} + +func (cook ChangePointerControlCookie) Check() error { + return cook.check() } // Write request to wire for ChangePointerControl -func changePointerControlRequest(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { +func (c *Conn) changePointerControlRequest(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12300,18 +13457,20 @@ func changePointerControlRequest(AccelerationNumerator int16, AccelerationDenomi // Request GetPointerControl // size: 4 -type GetPointerControlCookie cookie +type GetPointerControlCookie struct { + *cookie +} func (c *Conn) GetPointerControl() GetPointerControlCookie { cookie := c.newCookie(true, true) - c.newRequest(getPointerControlRequest(), cookie) - return GetPointerControlCookie(cookie) + c.newRequest(c.getPointerControlRequest(), cookie) + return GetPointerControlCookie{cookie} } func (c *Conn) GetPointerControlUnchecked() GetPointerControlCookie { cookie := c.newCookie(false, true) - c.newRequest(getPointerControlRequest(), cookie) - return GetPointerControlCookie(cookie) + c.newRequest(c.getPointerControlRequest(), cookie) + return GetPointerControlCookie{cookie} } // Request reply for GetPointerControl @@ -12328,10 +13487,13 @@ type GetPointerControlReply struct { // Waits and reads reply data from request GetPointerControl func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getPointerControlReply(buf), nil } @@ -12362,8 +13524,12 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { return v } +func (cook GetPointerControlCookie) Check() error { + return cook.check() +} + // Write request to wire for GetPointerControl -func getPointerControlRequest() []byte { +func (c *Conn) getPointerControlRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12371,28 +13537,38 @@ func getPointerControlRequest() []byte { buf[b] = 106 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request SetScreenSaver // size: 12 -type SetScreenSaverCookie cookie +type SetScreenSaverCookie struct { + *cookie +} // Write request to wire for SetScreenSaver func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.newCookie(false, false) - c.newRequest(setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) - return SetScreenSaverCookie(cookie) + c.newRequest(c.setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie{cookie} } func (c *Conn) SetScreenSaverChecked(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.newCookie(true, false) - c.newRequest(setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) - return SetScreenSaverCookie(cookie) + c.newRequest(c.setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie{cookie} +} + +func (cook SetScreenSaverCookie) Check() error { + return cook.check() } // Write request to wire for SetScreenSaver -func setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { +func (c *Conn) setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12422,18 +13598,20 @@ func setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanking byte, A // Request GetScreenSaver // size: 4 -type GetScreenSaverCookie cookie +type GetScreenSaverCookie struct { + *cookie +} func (c *Conn) GetScreenSaver() GetScreenSaverCookie { cookie := c.newCookie(true, true) - c.newRequest(getScreenSaverRequest(), cookie) - return GetScreenSaverCookie(cookie) + c.newRequest(c.getScreenSaverRequest(), cookie) + return GetScreenSaverCookie{cookie} } func (c *Conn) GetScreenSaverUnchecked() GetScreenSaverCookie { cookie := c.newCookie(false, true) - c.newRequest(getScreenSaverRequest(), cookie) - return GetScreenSaverCookie(cookie) + c.newRequest(c.getScreenSaverRequest(), cookie) + return GetScreenSaverCookie{cookie} } // Request reply for GetScreenSaver @@ -12451,10 +13629,13 @@ type GetScreenSaverReply struct { // Waits and reads reply data from request GetScreenSaver func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getScreenSaverReply(buf), nil } @@ -12488,8 +13669,12 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { return v } +func (cook GetScreenSaverCookie) Check() error { + return cook.check() +} + // Write request to wire for GetScreenSaver -func getScreenSaverRequest() []byte { +func (c *Conn) getScreenSaverRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12497,28 +13682,38 @@ func getScreenSaverRequest() []byte { buf[b] = 108 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request ChangeHosts // size: pad((8 + pad((int(AddressLen) * 1)))) -type ChangeHostsCookie cookie +type ChangeHostsCookie struct { + *cookie +} // Write request to wire for ChangeHosts func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.newCookie(false, false) - c.newRequest(changeHostsRequest(Mode, Family, AddressLen, Address), cookie) - return ChangeHostsCookie(cookie) + c.newRequest(c.changeHostsRequest(Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie{cookie} } func (c *Conn) ChangeHostsChecked(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.newCookie(true, false) - c.newRequest(changeHostsRequest(Mode, Family, AddressLen, Address), cookie) - return ChangeHostsCookie(cookie) + c.newRequest(c.changeHostsRequest(Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie{cookie} +} + +func (cook ChangeHostsCookie) Check() error { + return cook.check() } // Write request to wire for ChangeHosts -func changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { +func (c *Conn) changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { size := pad((8 + pad((int(AddressLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12548,18 +13743,20 @@ func changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Address []byt // Request ListHosts // size: 4 -type ListHostsCookie cookie +type ListHostsCookie struct { + *cookie +} func (c *Conn) ListHosts() ListHostsCookie { cookie := c.newCookie(true, true) - c.newRequest(listHostsRequest(), cookie) - return ListHostsCookie(cookie) + c.newRequest(c.listHostsRequest(), cookie) + return ListHostsCookie{cookie} } func (c *Conn) ListHostsUnchecked() ListHostsCookie { cookie := c.newCookie(false, true) - c.newRequest(listHostsRequest(), cookie) - return ListHostsCookie(cookie) + c.newRequest(c.listHostsRequest(), cookie) + return ListHostsCookie{cookie} } // Request reply for ListHosts @@ -12575,10 +13772,13 @@ type ListHostsReply struct { // Waits and reads reply data from request ListHosts func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return listHostsReply(buf), nil } @@ -12607,8 +13807,12 @@ func listHostsReply(buf []byte) *ListHostsReply { return v } +func (cook ListHostsCookie) Check() error { + return cook.check() +} + // Write request to wire for ListHosts -func listHostsRequest() []byte { +func (c *Conn) listHostsRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12616,28 +13820,38 @@ func listHostsRequest() []byte { buf[b] = 110 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request SetAccessControl // size: 4 -type SetAccessControlCookie cookie +type SetAccessControlCookie struct { + *cookie +} // Write request to wire for SetAccessControl func (c *Conn) SetAccessControl(Mode byte) SetAccessControlCookie { cookie := c.newCookie(false, false) - c.newRequest(setAccessControlRequest(Mode), cookie) - return SetAccessControlCookie(cookie) + c.newRequest(c.setAccessControlRequest(Mode), cookie) + return SetAccessControlCookie{cookie} } func (c *Conn) SetAccessControlChecked(Mode byte) SetAccessControlCookie { cookie := c.newCookie(true, false) - c.newRequest(setAccessControlRequest(Mode), cookie) - return SetAccessControlCookie(cookie) + c.newRequest(c.setAccessControlRequest(Mode), cookie) + return SetAccessControlCookie{cookie} +} + +func (cook SetAccessControlCookie) Check() error { + return cook.check() } // Write request to wire for SetAccessControl -func setAccessControlRequest(Mode byte) []byte { +func (c *Conn) setAccessControlRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12648,28 +13862,37 @@ func setAccessControlRequest(Mode byte) []byte { buf[b] = Mode b += 1 + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request SetCloseDownMode // size: 4 -type SetCloseDownModeCookie cookie +type SetCloseDownModeCookie struct { + *cookie +} // Write request to wire for SetCloseDownMode func (c *Conn) SetCloseDownMode(Mode byte) SetCloseDownModeCookie { cookie := c.newCookie(false, false) - c.newRequest(setCloseDownModeRequest(Mode), cookie) - return SetCloseDownModeCookie(cookie) + c.newRequest(c.setCloseDownModeRequest(Mode), cookie) + return SetCloseDownModeCookie{cookie} } func (c *Conn) SetCloseDownModeChecked(Mode byte) SetCloseDownModeCookie { cookie := c.newCookie(true, false) - c.newRequest(setCloseDownModeRequest(Mode), cookie) - return SetCloseDownModeCookie(cookie) + c.newRequest(c.setCloseDownModeRequest(Mode), cookie) + return SetCloseDownModeCookie{cookie} +} + +func (cook SetCloseDownModeCookie) Check() error { + return cook.check() } // Write request to wire for SetCloseDownMode -func setCloseDownModeRequest(Mode byte) []byte { +func (c *Conn) setCloseDownModeRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12680,28 +13903,37 @@ func setCloseDownModeRequest(Mode byte) []byte { buf[b] = Mode b += 1 + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request KillClient // size: 8 -type KillClientCookie cookie +type KillClientCookie struct { + *cookie +} // Write request to wire for KillClient func (c *Conn) KillClient(Resource uint32) KillClientCookie { cookie := c.newCookie(false, false) - c.newRequest(killClientRequest(Resource), cookie) - return KillClientCookie(cookie) + c.newRequest(c.killClientRequest(Resource), cookie) + return KillClientCookie{cookie} } func (c *Conn) KillClientChecked(Resource uint32) KillClientCookie { cookie := c.newCookie(true, false) - c.newRequest(killClientRequest(Resource), cookie) - return KillClientCookie(cookie) + c.newRequest(c.killClientRequest(Resource), cookie) + return KillClientCookie{cookie} +} + +func (cook KillClientCookie) Check() error { + return cook.check() } // Write request to wire for KillClient -func killClientRequest(Resource uint32) []byte { +func (c *Conn) killClientRequest(Resource uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -12722,23 +13954,29 @@ func killClientRequest(Resource uint32) []byte { // Request RotateProperties // size: pad((12 + pad((int(AtomsLen) * 4)))) -type RotatePropertiesCookie cookie +type RotatePropertiesCookie struct { + *cookie +} // Write request to wire for RotateProperties func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { cookie := c.newCookie(false, false) - c.newRequest(rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) - return RotatePropertiesCookie(cookie) + c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie{cookie} } func (c *Conn) RotatePropertiesChecked(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { cookie := c.newCookie(true, false) - c.newRequest(rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) - return RotatePropertiesCookie(cookie) + c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie{cookie} +} + +func (cook RotatePropertiesCookie) Check() error { + return cook.check() } // Write request to wire for RotateProperties -func rotatePropertiesRequest(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) []byte { +func (c *Conn) rotatePropertiesRequest(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) []byte { size := pad((12 + pad((int(AtomsLen) * 4)))) b := 0 buf := make([]byte, size) @@ -12771,23 +14009,29 @@ func rotatePropertiesRequest(Window Id, AtomsLen uint16, Delta int16, Atoms []Id // Request ForceScreenSaver // size: 4 -type ForceScreenSaverCookie cookie +type ForceScreenSaverCookie struct { + *cookie +} // Write request to wire for ForceScreenSaver func (c *Conn) ForceScreenSaver(Mode byte) ForceScreenSaverCookie { cookie := c.newCookie(false, false) - c.newRequest(forceScreenSaverRequest(Mode), cookie) - return ForceScreenSaverCookie(cookie) + c.newRequest(c.forceScreenSaverRequest(Mode), cookie) + return ForceScreenSaverCookie{cookie} } func (c *Conn) ForceScreenSaverChecked(Mode byte) ForceScreenSaverCookie { cookie := c.newCookie(true, false) - c.newRequest(forceScreenSaverRequest(Mode), cookie) - return ForceScreenSaverCookie(cookie) + c.newRequest(c.forceScreenSaverRequest(Mode), cookie) + return ForceScreenSaverCookie{cookie} +} + +func (cook ForceScreenSaverCookie) Check() error { + return cook.check() } // Write request to wire for ForceScreenSaver -func forceScreenSaverRequest(Mode byte) []byte { +func (c *Conn) forceScreenSaverRequest(Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12798,23 +14042,28 @@ func forceScreenSaverRequest(Mode byte) []byte { buf[b] = Mode b += 1 + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request SetPointerMapping // size: pad((4 + pad((int(MapLen) * 1)))) -type SetPointerMappingCookie cookie +type SetPointerMappingCookie struct { + *cookie +} func (c *Conn) SetPointerMapping(MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.newCookie(true, true) - c.newRequest(setPointerMappingRequest(MapLen, Map), cookie) - return SetPointerMappingCookie(cookie) + c.newRequest(c.setPointerMappingRequest(MapLen, Map), cookie) + return SetPointerMappingCookie{cookie} } func (c *Conn) SetPointerMappingUnchecked(MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.newCookie(false, true) - c.newRequest(setPointerMappingRequest(MapLen, Map), cookie) - return SetPointerMappingCookie(cookie) + c.newRequest(c.setPointerMappingRequest(MapLen, Map), cookie) + return SetPointerMappingCookie{cookie} } // Request reply for SetPointerMapping @@ -12827,10 +14076,13 @@ type SetPointerMappingReply struct { // Waits and reads reply data from request SetPointerMapping func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return setPointerMappingReply(buf), nil } @@ -12842,11 +14094,21 @@ func setPointerMappingReply(buf []byte) *SetPointerMappingReply { v.Status = buf[b] b += 1 + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + return v } +func (cook SetPointerMappingCookie) Check() error { + return cook.check() +} + // Write request to wire for SetPointerMapping -func setPointerMappingRequest(MapLen byte, Map []byte) []byte { +func (c *Conn) setPointerMappingRequest(MapLen byte, Map []byte) []byte { size := pad((4 + pad((int(MapLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12868,18 +14130,20 @@ func setPointerMappingRequest(MapLen byte, Map []byte) []byte { // Request GetPointerMapping // size: 4 -type GetPointerMappingCookie cookie +type GetPointerMappingCookie struct { + *cookie +} func (c *Conn) GetPointerMapping() GetPointerMappingCookie { cookie := c.newCookie(true, true) - c.newRequest(getPointerMappingRequest(), cookie) - return GetPointerMappingCookie(cookie) + c.newRequest(c.getPointerMappingRequest(), cookie) + return GetPointerMappingCookie{cookie} } func (c *Conn) GetPointerMappingUnchecked() GetPointerMappingCookie { cookie := c.newCookie(false, true) - c.newRequest(getPointerMappingRequest(), cookie) - return GetPointerMappingCookie(cookie) + c.newRequest(c.getPointerMappingRequest(), cookie) + return GetPointerMappingCookie{cookie} } // Request reply for GetPointerMapping @@ -12894,10 +14158,13 @@ type GetPointerMappingReply struct { // Waits and reads reply data from request GetPointerMapping func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getPointerMappingReply(buf), nil } @@ -12924,8 +14191,12 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { return v } +func (cook GetPointerMappingCookie) Check() error { + return cook.check() +} + // Write request to wire for GetPointerMapping -func getPointerMappingRequest() []byte { +func (c *Conn) getPointerMappingRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -12933,23 +14204,29 @@ func getPointerMappingRequest() []byte { buf[b] = 117 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request SetModifierMapping // size: pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) -type SetModifierMappingCookie cookie +type SetModifierMappingCookie struct { + *cookie +} func (c *Conn) SetModifierMapping(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.newCookie(true, true) - c.newRequest(setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) - return SetModifierMappingCookie(cookie) + c.newRequest(c.setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie{cookie} } func (c *Conn) SetModifierMappingUnchecked(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.newCookie(false, true) - c.newRequest(setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) - return SetModifierMappingCookie(cookie) + c.newRequest(c.setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie{cookie} } // Request reply for SetModifierMapping @@ -12962,10 +14239,13 @@ type SetModifierMappingReply struct { // Waits and reads reply data from request SetModifierMapping func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return setModifierMappingReply(buf), nil } @@ -12977,11 +14257,21 @@ func setModifierMappingReply(buf []byte) *SetModifierMappingReply { v.Status = buf[b] b += 1 + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + return v } +func (cook SetModifierMappingCookie) Check() error { + return cook.check() +} + // Write request to wire for SetModifierMapping -func setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) []byte { +func (c *Conn) setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) []byte { size := pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 buf := make([]byte, size) @@ -13006,18 +14296,20 @@ func setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) []b // Request GetModifierMapping // size: 4 -type GetModifierMappingCookie cookie +type GetModifierMappingCookie struct { + *cookie +} func (c *Conn) GetModifierMapping() GetModifierMappingCookie { cookie := c.newCookie(true, true) - c.newRequest(getModifierMappingRequest(), cookie) - return GetModifierMappingCookie(cookie) + c.newRequest(c.getModifierMappingRequest(), cookie) + return GetModifierMappingCookie{cookie} } func (c *Conn) GetModifierMappingUnchecked() GetModifierMappingCookie { cookie := c.newCookie(false, true) - c.newRequest(getModifierMappingRequest(), cookie) - return GetModifierMappingCookie(cookie) + c.newRequest(c.getModifierMappingRequest(), cookie) + return GetModifierMappingCookie{cookie} } // Request reply for GetModifierMapping @@ -13032,10 +14324,13 @@ type GetModifierMappingReply struct { // Waits and reads reply data from request GetModifierMapping func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { - buf, err := cookie(cook).reply() + buf, err := cook.reply() if err != nil { return nil, err } + if buf == nil { + return nil, nil + } return getModifierMappingReply(buf), nil } @@ -13065,8 +14360,12 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { return v } +func (cook GetModifierMappingCookie) Check() error { + return cook.check() +} + // Write request to wire for GetModifierMapping -func getModifierMappingRequest() []byte { +func (c *Conn) getModifierMappingRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13074,28 +14373,38 @@ func getModifierMappingRequest() []byte { buf[b] = 119 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } // Request NoOperation // size: 4 -type NoOperationCookie cookie +type NoOperationCookie struct { + *cookie +} // Write request to wire for NoOperation func (c *Conn) NoOperation() NoOperationCookie { cookie := c.newCookie(false, false) - c.newRequest(noOperationRequest(), cookie) - return NoOperationCookie(cookie) + c.newRequest(c.noOperationRequest(), cookie) + return NoOperationCookie{cookie} } func (c *Conn) NoOperationChecked() NoOperationCookie { cookie := c.newCookie(true, false) - c.newRequest(noOperationRequest(), cookie) - return NoOperationCookie(cookie) + c.newRequest(c.noOperationRequest(), cookie) + return NoOperationCookie{cookie} +} + +func (cook NoOperationCookie) Check() error { + return cook.check() } // Write request to wire for NoOperation -func noOperationRequest() []byte { +func (c *Conn) noOperationRequest() []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13103,5 +14412,9 @@ func noOperationRequest() []byte { buf[b] = 127 // request opcode b += 1 + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } From 99bc76de54729df5494faa944d4da96a8885d51e Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 18:22:40 -0400 Subject: [PATCH 16/90] examples. some should be tests --- nexgb/examples/randr.go | 48 ++++++++++++++++++++++++++++ nexgb/examples/seq-nowrap.go | 29 +++++++++++++++++ nexgb/examples/seq-wrap.go | 24 ++++++++++++++ nexgb/examples/window.go | 61 ++++++++++++++++++++++++++++++++++++ nexgb/examples/xinerama.go | 29 +++++++++++++++++ 5 files changed, 191 insertions(+) create mode 100644 nexgb/examples/randr.go create mode 100644 nexgb/examples/seq-nowrap.go create mode 100644 nexgb/examples/seq-wrap.go create mode 100644 nexgb/examples/window.go create mode 100644 nexgb/examples/xinerama.go diff --git a/nexgb/examples/randr.go b/nexgb/examples/randr.go new file mode 100644 index 0000000..064856d --- /dev/null +++ b/nexgb/examples/randr.go @@ -0,0 +1,48 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + err := X.RegisterExtension("randr") + if err != nil { + log.Fatal(err) + } + + resources, err := X.RandrGetScreenResources(X.DefaultScreen().Root).Reply() + if err != nil { + log.Fatal(err) + } + + for _, output := range resources.Outputs { + info, err := X.RandrGetOutputInfo(output, 0).Reply() + if err != nil { + log.Fatal(err) + } + + bestMode := info.Modes[0] + for _, mode := range resources.Modes { + if mode.Id == uint32(bestMode) { + fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) + } + } + } + + fmt.Println("\n") + + for _, crtc := range resources.Crtcs { + info, err := X.RandrGetCrtcInfo(crtc, 0).Reply() + if err != nil { + log.Fatal(err) + } + fmt.Printf("X: %d, Y: %d, Width: %d, Height: %d\n", + info.X, info.Y, info.Width, info.Height) + } +} + diff --git a/nexgb/examples/seq-nowrap.go b/nexgb/examples/seq-nowrap.go new file mode 100644 index 0000000..994a07b --- /dev/null +++ b/nexgb/examples/seq-nowrap.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + for i := 1; i <= 1<<16 + 10; i++ { + X.NoOperation() + // fmt.Printf("%d. No-Op\n", i) + } + + aname := "_NET_ACTIVE_WINDOW" + + for i := 1; i <= 10; i++ { + atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + if err != nil { + fmt.Println(err) + } else { + fmt.Printf("%d. Sequence: %d, Atom: %d\n", + i, atom.Sequence, atom.Atom) + } + } +} + diff --git a/nexgb/examples/seq-wrap.go b/nexgb/examples/seq-wrap.go new file mode 100644 index 0000000..b5bc834 --- /dev/null +++ b/nexgb/examples/seq-wrap.go @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + aname := "_NET_ACTIVE_WINDOW" + + for i := 1; i <= 1<<16 + 10; i++ { + atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + if err != nil { + fmt.Println(err) + } else { + fmt.Printf("%d. Sequence: %d, Atom: %d\n", + i, atom.Sequence, atom.Atom) + } + } +} + diff --git a/nexgb/examples/window.go b/nexgb/examples/window.go new file mode 100644 index 0000000..68fe27b --- /dev/null +++ b/nexgb/examples/window.go @@ -0,0 +1,61 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + wid, _ := X.NewId() + X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + 0, 0, 500, 500, 0, + xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, + 0, []uint32{}) + X.ChangeWindowAttributes(wid, xgb.CwEventMask | xgb.CwBackPixel, + []uint32{0xffffffff, xgb.EventMaskKeyPress | xgb.EventMaskKeyRelease}) + + err = X.MapWindowChecked(wid).Check() + if err != nil { + fmt.Printf("Checked Error for mapping window %d: %s\n", wid, err) + } else { + fmt.Printf("Map window %d successful!\n", wid) + } + + err = X.MapWindowChecked(0x1).Check() + if err != nil { + fmt.Printf("Checked Error for mapping window 0x1: %s\n", err) + } else { + fmt.Printf("Map window 0x1 successful!\n") + } + + for { + ev, xerr := X.WaitForEvent() + if ev == nil && xerr == nil { + log.Fatal("Both event and error are nil. Exiting...") + } + + if ev != nil { + fmt.Printf("Event: %s\n", ev) + } + if xerr != nil { + fmt.Printf("Error: %s\n", xerr) + } + + if xerr == nil { + geom, err := X.GetGeometry(0x1).Reply() + if err != nil { + fmt.Printf("Geom Error: %#v\n", err) + } else { + fmt.Printf("Geometry: %#v\n", geom) + } + } + } +} + diff --git a/nexgb/examples/xinerama.go b/nexgb/examples/xinerama.go new file mode 100644 index 0000000..7fe9984 --- /dev/null +++ b/nexgb/examples/xinerama.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + err := X.RegisterExtension("xinerama") + if err != nil { + log.Fatal(err) + } + + reply, err := X.XineramaQueryScreens().Reply() + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Xinerama number: %d\n", reply.Number) + for i, screen := range reply.ScreenInfo { + fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", + i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) + } +} + From 18b2d420b092d71313f0c05210c3038ff32483e7 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 02:21:31 -0400 Subject: [PATCH 17/90] added documentation and did some slight restructuring. it's party time. --- nexgb/xgbgen/context.go | 2 + nexgb/xgbgen/doc.go | 74 ++++++++ nexgb/xgbgen/expression.go | 41 +++++ nexgb/xgbgen/field.go | 60 ++++++- nexgb/xgbgen/misc.go | 4 +- nexgb/xgbgen/protocol.go | 41 +++++ .../{representation.go => request_reply.go} | 62 +++---- nexgb/xgbgen/size.go | 9 + nexgb/xgbgen/xml.go | 64 +++---- nexgb/xgbgen/xml_expression.go | 160 ------------------ nexgb/xgbgen/xml_fields.go | 71 +------- 11 files changed, 284 insertions(+), 304 deletions(-) create mode 100644 nexgb/xgbgen/doc.go create mode 100644 nexgb/xgbgen/protocol.go rename nexgb/xgbgen/{representation.go => request_reply.go} (59%) delete mode 100644 nexgb/xgbgen/xml_expression.go diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 3e484f3..d433531 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -8,6 +8,8 @@ import ( "time" ) +// Context represents the protocol we're converting to Go, and a writer +// buffer to write the Go source to. type Context struct { protocol *Protocol out *bytes.Buffer diff --git a/nexgb/xgbgen/doc.go b/nexgb/xgbgen/doc.go new file mode 100644 index 0000000..4ba6145 --- /dev/null +++ b/nexgb/xgbgen/doc.go @@ -0,0 +1,74 @@ +/* +xgbgen constructs Go source files from xproto XML description files. xgbgen +accomplishes the same task as the Python code generator for XCB and xpyb. + +Usage: + xgbgen [flags] some-protocol.xml + +The flags are: + --proto-path path + The path to a directory containing xproto XML description files. + This is only necessary when 'some-protocol.xml' imports other + protocol files. + --gofmt=true + When false, the outputted Go code will not be gofmt'd. And it won't + be very pretty at all. This is typically useful if there are syntax + errors that need to be debugged in code generation. gofmt will hiccup; + this will allow you to see the raw code. + +How it works + +xgbgen works by parsing the input XML file using Go's encoding/xml package. +The majority of this work is done in xml.go and xml_fields.go, where the +appropriate types are declared. + +Due to the nature of the XML in the protocol description files, the types +required to parse the XML are not well suited to reasoning about code +generation. Because of this, all data parsed in the XML types is translated +into more reasonable types. This translation is done in translation.go, +and is mainly grunt work. (The only interesting tidbits are the translation +of XML names to Go source names, and connecting fields with their +appropriate types.) + +The organization of these types is greatly +inspired by the description of the XML found here: +http://cgit.freedesktop.org/xcb/proto/tree/doc/xml-xcb.txt + +These types come with a lot of supporting methods to make their use in +code generation easier. They can be found in expression.go, field.go, +protocol.go, request_reply.go and type.go. Of particular interest are +expression evaluation and size calculation (in bytes). + +These types also come with supporting methods that convert their +representation into Go source code. I've quartered such methods in +go.go, go_error.go, go_event.go, go_list.go, go_request_reply.go, +go_single_field.go, go_struct.go and go_union.go. The idea is to keep +as much of the Go specific code generation in one area as possible. Namely, +while not *all* Go related code is found in the 'go*.go' files, *most* +of it is. (If there's any interest in using xgbgen for other languages, +I'd be happy to try and make xgbgen a little more friendly in this regard. +I did, however, design xgbgen with this in mind, so it shouldn't involve +anything as serious as a re-design.) + +Why + +I wrote xgbgen because I found the existing code generator that was written in +Python to be unwieldy. In particular, static and strong typing greatly helped +me reason better about the code generation task. + +What does not work + +The core X protocol should be completely working. As far as I know, most +extensions should work too, although I've only tested (and not much) the +Xinerama and RandR extensions. + +XKB does not work. I don't have any real plans of working on this unless there +is demand and I have some test cases to work with. (i.e., even if I could get +something generated for XKB, I don't have the inclination to understand it +enough to verify that it works.) XKB poses several extremely difficult +problems that XCB also has trouble with. More info on that can be found at +http://cgit.freedesktop.org/xcb/libxcb/tree/doc/xkb_issues and +http://cgit.freedesktop.org/xcb/libxcb/tree/doc/xkb_internals. + +*/ +package main diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 2350979..721ebfd 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -5,11 +5,32 @@ import ( "log" ) +// Expression represents all the different forms of expressions possible in +// side an XML protocol description file. It's also received a few custom +// addendums to make applying special functions (like padding) easier. type Expression interface { + // Concrete determines whether this particular expression can be computed + // to some constant value inside xgbgen. (The alternative is that the + // expression can only be computed with values at run time of the + // generated code.) Concrete() bool + + // Eval evaluates a concrete expression. It is an error to call Eval + // on any expression that is not concrete (or contains any sub-expression + // that is not concrete). Eval() uint + + // Reduce attempts to evaluate any concrete sub-expressions. + // i.e., (1 + 2 * (5 + 1 + someSizeOfStruct) reduces to + // (3 * (6 + someSizeOfStruct)). + // 'prefix' is used preprended to any field reference name. Reduce(prefix string) string + + // String is an alias for Reduce("") String() string + + // Initialize makes sure all names in this expression and any subexpressions + // have been translated to Go source names. Initialize(p *Protocol) } @@ -41,12 +62,17 @@ func (e *Function) Initialize(p *Protocol) { e.Expr.Initialize(p) } +// BinaryOp is an expression that performs some operation (defined in the XML +// file) with Expr1 and Expr2 as operands. type BinaryOp struct { Op string Expr1 Expression Expr2 Expression } +// newBinaryOp constructs a new binary expression when both expr1 and expr2 +// are not nil. If one or both are nil, then the non-nil expression is +// returned unchanged or nil is returned. func newBinaryOp(op string, expr1, expr2 Expression) Expression { switch { case expr1 != nil && expr2 != nil: @@ -124,6 +150,8 @@ func (e *BinaryOp) Initialize(p *Protocol) { e.Expr2.Initialize(p) } +// UnaryOp is the same as BinaryOp, except it's a unary operator with only +// one sub-expression. type UnaryOp struct { Op string Expr Expression @@ -158,6 +186,8 @@ func (e *UnaryOp) Initialize(p *Protocol) { e.Expr.Initialize(p) } +// Padding represents the application of the 'pad' function to some +// sub-expression. type Padding struct { Expr Expression } @@ -185,6 +215,8 @@ func (e *Padding) Initialize(p *Protocol) { e.Expr.Initialize(p) } +// PopCount represents the application of the 'PopCount' function to +// some sub-expression. type PopCount struct { Expr Expression } @@ -212,6 +244,7 @@ func (e *PopCount) Initialize(p *Protocol) { e.Expr.Initialize(p) } +// Value represents some constant integer. type Value struct { v uint } @@ -234,6 +267,7 @@ func (e *Value) String() string { func (e *Value) Initialize(p *Protocol) {} +// Bit represents some bit whose value is computed by '1 << bit'. type Bit struct { b uint } @@ -256,6 +290,8 @@ func (e *Bit) String() string { func (e *Bit) Initialize(p *Protocol) {} +// FieldRef represents a reference to some variable in the generated code +// with name Name. type FieldRef struct { Name string } @@ -285,6 +321,9 @@ func (e *FieldRef) Initialize(p *Protocol) { e.Name = SrcName(p, e.Name) } +// EnumRef represents a reference to some enumeration field. +// EnumKind is the "group" an EnumItem is the name of the specific enumeration +// value inside that group. type EnumRef struct { EnumKind Type EnumItem string @@ -312,6 +351,8 @@ func (e *EnumRef) Initialize(p *Protocol) { e.EnumItem = SrcName(p, e.EnumItem) } +// SumOf represents a summation of the variable in the generated code named by +// Name. It is not currently used. (It's XKB voodoo.) type SumOf struct { Name string } diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 5041f77..725f3de 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -6,20 +6,48 @@ import ( "strings" ) +// Field corresponds to any field described in an XML protocol description +// file. This includes struct fields, union fields, request fields, +// reply fields and so on. +// To make code generation easier, fields that have types are also stored. +// Note that not all fields support all methods defined in this interface. +// For instance, a padding field does not have a source name. type Field interface { + // Initialize sets up the source name of this field. Initialize(p *Protocol) + + // SrcName is the Go source name of this field. SrcName() string + + // XmlName is the name of this field from the XML file. XmlName() string + + // SrcType is the Go source type name of this field. SrcType() string + + // Size returns an expression that computes the size (in bytes) + // of this field. Size() Size + // Define writes the Go code to declare this field (in a struct definition). Define(c *Context) + + // Read writes the Go code to convert a byte slice to a Go value + // of this field. + // 'prefix' is the prefix of the name of the Go value. Read(c *Context, prefix string) + + // Write writes the Go code to convert a Go value to a byte slice of + // this field. + // 'prefix' is the prefix of the name of the Go value. Write(c *Context, prefix string) } func (pad *PadField) Initialize(p *Protocol) {} +// PadField represents any type of padding. It is omitted from +// definitions, but is used in Read/Write to increment the buffer index. +// It is also used in size calculation. type PadField struct { Bytes uint } @@ -40,6 +68,8 @@ func (p *PadField) Size() Size { return newFixedSize(p.Bytes) } +// SingleField represents most of the fields in an XML protocol description. +// It corresponds to any single value. type SingleField struct { srcName string xmlName string @@ -67,6 +97,7 @@ func (f *SingleField) Size() Size { return f.Type.Size() } +// ListField represents a list of values. type ListField struct { srcName string xmlName string @@ -89,6 +120,9 @@ func (f *ListField) SrcType() string { return fmt.Sprintf("[]%s", f.Type.SrcName()) } +// Length computes the *number* of values in a list. +// If this ListField does not have any length expression, we throw our hands +// up and simply compute the 'len' of the field name of this list. func (f *ListField) Length() Size { if f.LengthExpr == nil { return newExpressionSize(&Function{ @@ -101,6 +135,12 @@ func (f *ListField) Length() Size { return newExpressionSize(f.LengthExpr) } +// Size computes the *size* of a list (in bytes). +// It it typically a simple matter of multiplying the length of the list by +// the size of the type of the list. +// But if it's a list of struct where the struct has a list field, we use a +// special function written in go_struct.go to compute the size (since the +// size in this case can only be computed recursively). func (f *ListField) Size() Size { simpleLen := &Function{ Name: "pad", @@ -120,11 +160,6 @@ func (f *ListField) Size() Size { } case *Union: return newExpressionSize(simpleLen) - // sizeFun := &Function{ - // Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), - // Expr: &FieldRef{Name: f.SrcName()}, - // } - // return newExpressionSize(sizeFun) case *Base: return newExpressionSize(simpleLen) case *Resource: @@ -145,10 +180,14 @@ func (f *ListField) Initialize(p *Protocol) { } } +// LocalField is exactly the same as a regular SingleField, except it isn't +// sent over the wire. (i.e., it's probably used to compute an ExprField). type LocalField struct { *SingleField } +// ExprField is a field that is not parameterized, but is computed from values +// of other fields. type ExprField struct { srcName string xmlName string @@ -178,6 +217,9 @@ func (f *ExprField) Initialize(p *Protocol) { f.Expr.Initialize(p) } +// ValueField represents two fields in one: a mask and a list of 4-byte +// integers. The mask specifies which kinds of values are in the list. +// (i.e., See ConfigureWindow, CreateWindow, ChangeWindowAttributes, etc.) type ValueField struct { Parent interface{} MaskType Type @@ -197,6 +239,10 @@ func (f *ValueField) SrcType() string { return f.MaskType.SrcName() } +// Size computes the size in bytes of the combination of the mask and list +// in this value field. +// The expression to compute this looks complicated, but it's really just +// the number of bits set in the mask multiplied 4 (and padded of course). func (f *ValueField) Size() Size { maskSize := f.MaskType.Size() listSize := newExpressionSize(&Function{ @@ -234,6 +280,8 @@ func (f *ValueField) Initialize(p *Protocol) { f.ListName = SrcName(p, f.ListName) } +// SwitchField represents a 'switch' element in the XML protocol description +// file. It is not currently used. (i.e., it is XKB voodoo.) type SwitchField struct { Name string Expr Expression @@ -270,6 +318,8 @@ func (f *SwitchField) Initialize(p *Protocol) { } } +// Bitcase represents a single bitcase inside a switch expression. +// It is not currently used. (i.e., it's XKB voodoo.) type Bitcase struct { Fields []Field Expr Expression diff --git a/nexgb/xgbgen/misc.go b/nexgb/xgbgen/misc.go index 13c4cc2..85d788f 100644 --- a/nexgb/xgbgen/misc.go +++ b/nexgb/xgbgen/misc.go @@ -7,7 +7,7 @@ import ( // AllCaps is a regex to test if a string identifier is made of // all upper case letters. -var AllCaps = regexp.MustCompile("^[A-Z0-9]+$") +var allCaps = regexp.MustCompile("^[A-Z0-9]+$") // popCount counts number of bits 'set' in mask. func popCount(mask uint) uint { @@ -30,7 +30,7 @@ func pad(n int) int { // first letter of each chunk, and smushes'em back together. func splitAndTitle(s string) string { // If the string is all caps, lower it and capitalize first letter. - if AllCaps.MatchString(s) { + if allCaps.MatchString(s) { return strings.Title(strings.ToLower(s)) } diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go new file mode 100644 index 0000000..505b400 --- /dev/null +++ b/nexgb/xgbgen/protocol.go @@ -0,0 +1,41 @@ +package main + +import ( + "strings" +) + +// Protocol is a type that encapsulates all information about one +// particular XML file. It also contains links to other protocol types +// if this protocol imports other other extensions. The import relationship +// is recursive. +type Protocol struct { + Name string + ExtXName string + ExtName string + MajorVersion string + MinorVersion string + + Imports []*Protocol + Types []Type + Requests []*Request +} + +// Initialize traverses all structures, looks for 'Translation' type, +// and looks up the real type in the namespace. It also sets the source +// name for all relevant fields/structures. +// This is necessary because we don't traverse the XML in order initially. +func (p *Protocol) Initialize() { + for _, typ := range p.Types { + typ.Initialize(p) + } + for _, req := range p.Requests { + req.Initialize(p) + } +} + +// isExt returns true if this protocol is an extension. +// i.e., it's name isn't "xproto". +func (p *Protocol) isExt() bool { + return strings.ToLower(p.Name) == "xproto" +} + diff --git a/nexgb/xgbgen/representation.go b/nexgb/xgbgen/request_reply.go similarity index 59% rename from nexgb/xgbgen/representation.go rename to nexgb/xgbgen/request_reply.go index 62a3eb2..7cd2859 100644 --- a/nexgb/xgbgen/representation.go +++ b/nexgb/xgbgen/request_reply.go @@ -7,40 +7,19 @@ import ( "unicode" ) -type Protocol struct { - Name string - ExtXName string - ExtName string - MajorVersion string - MinorVersion string - - Imports []*Protocol - Types []Type - Requests []*Request -} - -// Initialize traverses all structures, looks for 'Translation' type, -// and looks up the real type in the namespace. It also sets the source -// name for all relevant fields/structures. -// This is necessary because we don't traverse the XML in order initially. -func (p *Protocol) Initialize() { - for _, typ := range p.Types { - typ.Initialize(p) - } - for _, req := range p.Requests { - req.Initialize(p) - } -} - +// Request represents all XML 'request' nodes. +// If the request doesn't have a reply, Reply is nil. type Request struct { - srcName string - xmlName string + srcName string // The Go name of this request. + xmlName string // The XML name of this request. Opcode int - Combine bool - Fields []Field - Reply *Reply + Combine bool // Not currently used. + Fields []Field // All fields in the request. + Reply *Reply // A reply, if one exists for this request. } +// Initialize creates the proper Go source name for this request. +// It also initializes the reply if one exists, and all fields in this request. func (r *Request) Initialize(p *Protocol) { r.srcName = SrcName(p, r.xmlName) if p.Name != "xproto" { @@ -63,6 +42,9 @@ func (r *Request) XmlName() string { return r.xmlName } +// ReplyName gets the Go source name of the function that generates a +// reply type from a slice of bytes. +// The generated function is not currently exported. func (r *Request) ReplyName() string { if r.Reply == nil { log.Panicf("Cannot call 'ReplyName' on request %s, which has no reply.", @@ -73,6 +55,8 @@ func (r *Request) ReplyName() string { return fmt.Sprintf("%sReply", lower) } +// ReplyTypeName gets the Go source name of the type holding all reply data +// for this request. func (r *Request) ReplyTypeName() string { if r.Reply == nil { log.Panicf("Cannot call 'ReplyName' on request %s, which has no reply.", @@ -81,12 +65,17 @@ func (r *Request) ReplyTypeName() string { return fmt.Sprintf("%sReply", r.SrcName()) } +// ReqName gets the Go source name of the function that generates a byte +// slice from a list of parameters. +// The generated function is not currently exported. func (r *Request) ReqName() string { name := r.SrcName() lower := string(unicode.ToLower(rune(name[0]))) + name[1:] return fmt.Sprintf("%sRequest", lower) } +// CookieName gets the Go source name of the type that holds cookies for +// this request. func (r *Request) CookieName() string { return fmt.Sprintf("%sCookie", r.SrcName()) } @@ -99,6 +88,11 @@ func (r *Request) CookieName() string { func (r *Request) Size(c *Context) Size { size := newFixedSize(0) + // If this is a core protocol request, we squeeze in an extra byte of + // data (from the fields below) between the opcode and the size of the + // request. In an extension request, this byte is always occupied + // by the opcode of the request (while the first byte is always occupied + // by the opcode of the extension). if c.protocol.Name == "xproto" { size = size.Add(newFixedSize(3)) } else { @@ -107,7 +101,7 @@ func (r *Request) Size(c *Context) Size { for _, field := range r.Fields { switch field.(type) { - case *LocalField: + case *LocalField: // local fields don't go over the wire continue case *SingleField: // mofos!!! @@ -126,10 +120,16 @@ func (r *Request) Size(c *Context) Size { }) } +// Reply encapsulates the fields associated with a 'reply' element. type Reply struct { Fields []Field } +// Size gets the number of bytes in this request's reply. +// A reply always has at least 7 bytes: +// 1 byte: A reply discriminant (first byte set to 1) +// 2 bytes: A sequence number +// 4 bytes: Number of additional bytes in 4-byte units past initial 32 bytes. func (r *Reply) Size() Size { size := newFixedSize(0) diff --git a/nexgb/xgbgen/size.go b/nexgb/xgbgen/size.go index 70edb8f..d8d3ac3 100644 --- a/nexgb/xgbgen/size.go +++ b/nexgb/xgbgen/size.go @@ -1,21 +1,30 @@ package main +// Size corresponds to an expression that represents the number of bytes +// in some *thing*. Generally, sizes are used to allocate buffers and to +// inform X how big requests are. +// Size is basically a thin layer over an Expression that yields easy methods +// for adding and multiplying sizes. type Size struct { Expression } +// newFixedSize creates a new Size with some fixed and known value. func newFixedSize(fixed uint) Size { return Size{&Value{v: fixed}} } +// newExpressionSize creates a new Size with some expression. func newExpressionSize(variable Expression) Size { return Size{variable} } +// Add adds s1 and s2 and returns a new Size. func (s1 Size) Add(s2 Size) Size { return Size{newBinaryOp("+", s1, s2)} } +// Multiply mupltiplies s1 and s2 and returns a new Size. func (s1 Size) Multiply(s2 Size) Size { return Size{newBinaryOp("*", s1, s2)} } diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index 1b2f89a..df21433 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -18,19 +18,19 @@ type XML struct { // Types for all top-level elements. // First are the simple ones. Imports XMLImports `xml:"import"` - Enums XMLEnums `xml:"enum"` - Xids XMLXids `xml:"xidtype"` - XidUnions XMLXids `xml:"xidunion"` - TypeDefs XMLTypeDefs `xml:"typedef"` - EventCopies XMLEventCopies `xml:"eventcopy"` - ErrorCopies XMLErrorCopies `xml:"errorcopy"` + Enums []*XMLEnum `xml:"enum"` + Xids []*XMLXid `xml:"xidtype"` + XidUnions []*XMLXid `xml:"xidunion"` + TypeDefs []*XMLTypeDef `xml:"typedef"` + EventCopies []*XMLEventCopy `xml:"eventcopy"` + ErrorCopies []*XMLErrorCopy `xml:"errorcopy"` // Here are the complex ones, i.e., anything with "structure contents" - Structs XMLStructs `xml:"struct"` - Unions XMLUnions `xml:"union"` - Requests XMLRequests `xml:"request"` - Events XMLEvents `xml:"event"` - Errors XMLErrors `xml:"error"` + Structs []*XMLStruct `xml:"struct"` + Unions []*XMLUnion `xml:"union"` + Requests []*XMLRequest `xml:"request"` + Events []*XMLEvent `xml:"event"` + Errors []*XMLError `xml:"error"` } type XMLImports []*XMLImport @@ -60,8 +60,6 @@ type XMLImport struct { xml *XML `xml:"-"` } -type XMLEnums []XMLEnum - type XMLEnum struct { Name string `xml:"name,attr"` Items []*XMLEnumItem `xml:"item"` @@ -72,77 +70,69 @@ type XMLEnumItem struct { Expr *XMLExpression `xml:",any"` } -type XMLXids []*XMLXid - type XMLXid struct { XMLName xml.Name Name string `xml:"name,attr"` } -type XMLTypeDefs []*XMLTypeDef - type XMLTypeDef struct { Old string `xml:"oldname,attr"` New string `xml:"newname,attr"` } -type XMLEventCopies []*XMLEventCopy - type XMLEventCopy struct { Name string `xml:"name,attr"` Number int `xml:"number,attr"` Ref string `xml:"ref,attr"` } -type XMLErrorCopies []*XMLErrorCopy - type XMLErrorCopy struct { Name string `xml:"name,attr"` Number int `xml:"number,attr"` Ref string `xml:"ref,attr"` } -type XMLStructs []*XMLStruct - type XMLStruct struct { Name string `xml:"name,attr"` - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` } -type XMLUnions []*XMLUnion - type XMLUnion struct { Name string `xml:"name,attr"` - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` } -type XMLRequests []*XMLRequest - type XMLRequest struct { Name string `xml:"name,attr"` Opcode int `xml:"opcode,attr"` Combine bool `xml:"combine-adjacent,attr"` - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` Reply *XMLReply `xml:"reply"` } type XMLReply struct { - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` } -type XMLEvents []*XMLEvent - type XMLEvent struct { Name string `xml:"name,attr"` Number int `xml:"number,attr"` NoSequence bool `xml:"no-sequence-number,attr"` - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` } -type XMLErrors []*XMLError - type XMLError struct { Name string `xml:"name,attr"` Number int `xml:"number,attr"` - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` +} + +type XMLExpression struct { + XMLName xml.Name + + Exprs []*XMLExpression `xml:",any"` + + Data string `xml:",chardata"` + Op string `xml:"op,attr"` + Ref string `xml:"ref,attr"` } diff --git a/nexgb/xgbgen/xml_expression.go b/nexgb/xgbgen/xml_expression.go deleted file mode 100644 index 2989668..0000000 --- a/nexgb/xgbgen/xml_expression.go +++ /dev/null @@ -1,160 +0,0 @@ -package main - -import ( - "encoding/xml" - "fmt" - "log" - "strconv" -) - -type XMLExpression struct { - XMLName xml.Name - - Exprs []*XMLExpression `xml:",any"` - - Data string `xml:",chardata"` - Op string `xml:"op,attr"` - Ref string `xml:"ref,attr"` -} - -func newValueExpression(v uint) *XMLExpression { - return &XMLExpression{ - XMLName: xml.Name{Local: "value"}, - Data: fmt.Sprintf("%d", v), - } -} - -// String is for debugging. For actual use, please use 'Morph'. -func (e *XMLExpression) String() string { - switch e.XMLName.Local { - case "op": - return fmt.Sprintf("(%s %s %s)", e.Exprs[0], e.Op, e.Exprs[1]) - case "unop": - return fmt.Sprintf("(%s (%s))", e.Op, e.Exprs[0]) - case "popcount": - return fmt.Sprintf("popcount(%s)", e.Exprs[0]) - case "fieldref": - fallthrough - case "value": - return fmt.Sprintf("%s", e.Data) - case "bit": - return fmt.Sprintf("(1 << %s)", e.Data) - case "enumref": - return fmt.Sprintf("%s%s", e.Ref, e.Data) - case "sumof": - return fmt.Sprintf("sum(%s)", e.Ref) - default: - log.Panicf("Unrecognized expression element: %s", e.XMLName.Local) - } - - panic("unreachable") -} - -// Eval is used to *attempt* to compute a concrete value for a particular -// expression. This is used in the initial setup to instantiate values for -// empty items in enums. -// We can't compute a concrete value for expressions that rely on a context, -// i.e., some field value. -func (e *XMLExpression) Eval() uint { - switch e.XMLName.Local { - case "op": - if len(e.Exprs) != 2 { - log.Panicf("'op' found %d expressions; expected 2.", len(e.Exprs)) - } - return e.BinaryOp(e.Exprs[0], e.Exprs[1]).Eval() - case "unop": - if len(e.Exprs) != 1 { - log.Panicf("'unop' found %d expressions; expected 1.", len(e.Exprs)) - } - return e.UnaryOp(e.Exprs[0]).Eval() - case "popcount": - if len(e.Exprs) != 1 { - log.Panicf("'popcount' found %d expressions; expected 1.", - len(e.Exprs)) - } - return popCount(e.Exprs[0].Eval()) - case "value": - val, err := strconv.Atoi(e.Data) - if err != nil { - log.Panicf("Could not convert '%s' in 'value' expression to int.", - e.Data) - } - return uint(val) - case "bit": - bit, err := strconv.Atoi(e.Data) - if err != nil { - log.Panicf("Could not convert '%s' in 'bit' expression to int.", - e.Data) - } - if bit < 0 || bit > 31 { - log.Panicf("A 'bit' literal must be in the range [0, 31], but "+ - " is %d", bit) - } - return 1 << uint(bit) - case "fieldref": - log.Panicf("Cannot compute concrete value of 'fieldref' in "+ - "expression '%s'.", e) - case "enumref": - log.Panicf("Cannot compute concrete value of 'enumref' in "+ - "expression '%s'.", e) - case "sumof": - log.Panicf("Cannot compute concrete value of 'sumof' in "+ - "expression '%s'.", e) - } - - log.Panicf("Unrecognized tag '%s' in expression context. Expected one of "+ - "op, fieldref, value, bit, enumref, unop, sumof or popcount.", - e.XMLName.Local) - panic("unreachable") -} - -func (e *XMLExpression) BinaryOp(oprnd1, oprnd2 *XMLExpression) *XMLExpression { - if e.XMLName.Local != "op" { - log.Panicf("Cannot perform binary operation on non-op expression: %s", - e.XMLName.Local) - } - if len(e.Op) == 0 { - log.Panicf("Cannot perform binary operation without operator for: %s", - e.XMLName.Local) - } - - wrap := newValueExpression - switch e.Op { - case "+": - return wrap(oprnd1.Eval() + oprnd2.Eval()) - case "-": - return wrap(oprnd1.Eval() + oprnd2.Eval()) - case "*": - return wrap(oprnd1.Eval() * oprnd2.Eval()) - case "/": - return wrap(oprnd1.Eval() / oprnd2.Eval()) - case "&": - return wrap(oprnd1.Eval() & oprnd2.Eval()) - case "<<": - return wrap(oprnd1.Eval() << oprnd2.Eval()) - } - - log.Panicf("Invalid binary operator '%s' for '%s' expression.", - e.Op, e.XMLName.Local) - panic("unreachable") -} - -func (e *XMLExpression) UnaryOp(oprnd *XMLExpression) *XMLExpression { - if e.XMLName.Local != "unop" { - log.Panicf("Cannot perform unary operation on non-unop expression: %s", - e.XMLName.Local) - } - if len(e.Op) == 0 { - log.Panicf("Cannot perform unary operation without operator for: %s", - e.XMLName.Local) - } - - switch e.Op { - case "~": - return newValueExpression(^oprnd.Eval()) - } - - log.Panicf("Invalid unary operator '%s' for '%s' expression.", - e.Op, e.XMLName.Local) - panic("unreachable") -} diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go index 991141b..fe6c5d5 100644 --- a/nexgb/xgbgen/xml_fields.go +++ b/nexgb/xgbgen/xml_fields.go @@ -1,31 +1,10 @@ package main -/* - A series of fields should be taken as "structure contents", and *not* - just the single 'field' elements. Namely, 'fields' subsumes 'field' - elements. - - More particularly, 'fields' corresponds to list, in order, of any of the - follow elements: pad, field, list, localfield, exprfield, valueparm - and switch. - - Thus, the 'Field' type must contain the union of information corresponding - to all aforementioned fields. - - This would ideally be a better job for interfaces, but I could not figure - out how to make them jive with Go's XML package. (And I don't really feel - up to type translation.) -*/ - import ( "encoding/xml" - "fmt" "log" - "strings" ) -type XMLFields []*XMLField - type XMLField struct { XMLName xml.Name @@ -47,7 +26,7 @@ type XMLField struct { ValueListName string `xml:"value-list-name,attr"` // For 'switch' element. - Bitcases XMLBitcases `xml:"bitcase"` + Bitcases []*XMLBitcase `xml:"bitcase"` // I don't know which elements these are for. The documentation is vague. // They also seem to be completely optional. @@ -56,41 +35,6 @@ type XMLField struct { OptAltEnum string `xml:"altenum,attr"` } -// String is for debugging purposes. -func (f *XMLField) String() string { - switch f.XMLName.Local { - case "pad": - return fmt.Sprintf("pad (%d bytes)", f.Bytes) - case "field": - return fmt.Sprintf("field (type = '%s', name = '%s')", f.Type, f.Name) - case "list": - return fmt.Sprintf("list (type = '%s', name = '%s', length = '%s')", - f.Type, f.Name, f.Expr) - case "localfield": - return fmt.Sprintf("localfield (type = '%s', name = '%s')", - f.Type, f.Name) - case "exprfield": - return fmt.Sprintf("exprfield (type = '%s', name = '%s', expr = '%s')", - f.Type, f.Name, f.Expr) - case "valueparam": - return fmt.Sprintf("valueparam (type = '%s', name = '%s', list = '%s')", - f.ValueMaskType, f.ValueMaskName, f.ValueListName) - case "switch": - bitcases := make([]string, len(f.Bitcases)) - for i, bitcase := range f.Bitcases { - bitcases[i] = bitcase.StringPrefix("\t") - } - return fmt.Sprintf("switch (name = '%s', expr = '%s')\n\t%s", - f.Name, f.Expr, strings.Join(bitcases, "\n\t")) - default: - log.Panicf("Unrecognized field element: %s", f.XMLName.Local) - } - - panic("unreachable") -} - -type XMLBitcases []*XMLBitcase - // Bitcase represents a single expression followed by any number of fields. // Namely, if the switch's expression (all bitcases are inside a switch), // and'd with the bitcase's expression is equal to the bitcase expression, @@ -100,7 +44,7 @@ type XMLBitcases []*XMLBitcase // it's the closest thing to a Union I can get to in Go without interfaces. // Would an '' tag have been too much to ask? :-( type XMLBitcase struct { - Fields XMLFields `xml:",any"` + Fields []*XMLField `xml:",any"` // All the different expressions. // When it comes time to choose one, use the 'Expr' method. @@ -114,17 +58,6 @@ type XMLBitcase struct { ExprPop *XMLExpression `xml:"popcount"` } -// StringPrefix is for debugging purposes only. -// StringPrefix takes a string to prefix to every extra line for formatting. -func (b *XMLBitcase) StringPrefix(prefix string) string { - fields := make([]string, len(b.Fields)) - for i, field := range b.Fields { - fields[i] = fmt.Sprintf("%s%s", prefix, field) - } - return fmt.Sprintf("%s\n\t%s%s", b.Expr(), prefix, - strings.Join(fields, "\n\t")) -} - // Expr chooses the only non-nil Expr* field from Bitcase. // Panic if there is more than one non-nil expression. func (b *XMLBitcase) Expr() *XMLExpression { From 014a0598bfe6d997a5dacda9eae4591df0b17826 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 02:28:32 -0400 Subject: [PATCH 18/90] status update --- nexgb/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/README b/nexgb/README index 989e5c8..d2fd2dd 100644 --- a/nexgb/README +++ b/nexgb/README @@ -8,7 +8,7 @@ of an xgbgen package. The biggest parts that *haven't* been rewritten by me are the connection and authentication handshakes. They're inherently messy, and there's really no -reason to re-work them. +reason to re-work them. The rest of XGB has been completely rewritten. I like to release my code under the WTFPL, but since I'm starting with someone else's work, I'm leaving the original license/contributor/author information From ea30f1a0a718e5e86343cceac12104baab1bedca Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 03:06:02 -0400 Subject: [PATCH 19/90] more bug fixes for the rest of the extensions --- nexgb/{randr.go => auto_randr.go} | 0 nexgb/{render.go => auto_render.go} | 0 nexgb/{xinerama.go => auto_xinerama.go} | 0 nexgb/{xproto.go => auto_xproto.go} | 0 nexgb/xgbgen/expression.go | 34 ++++++++++++------------- nexgb/xgbgen/field.go | 3 +-- nexgb/xgbgen/go.go | 18 ++++++++----- nexgb/xgbgen/go_struct.go | 6 ++++- nexgb/xgbgen/size.go | 2 +- nexgb/xgbgen/translation.go | 10 ++++---- 10 files changed, 41 insertions(+), 32 deletions(-) rename nexgb/{randr.go => auto_randr.go} (100%) rename nexgb/{render.go => auto_render.go} (100%) rename nexgb/{xinerama.go => auto_xinerama.go} (100%) rename nexgb/{xproto.go => auto_xproto.go} (100%) diff --git a/nexgb/randr.go b/nexgb/auto_randr.go similarity index 100% rename from nexgb/randr.go rename to nexgb/auto_randr.go diff --git a/nexgb/render.go b/nexgb/auto_render.go similarity index 100% rename from nexgb/render.go rename to nexgb/auto_render.go diff --git a/nexgb/xinerama.go b/nexgb/auto_xinerama.go similarity index 100% rename from nexgb/xinerama.go rename to nexgb/auto_xinerama.go diff --git a/nexgb/xproto.go b/nexgb/auto_xproto.go similarity index 100% rename from nexgb/xproto.go rename to nexgb/auto_xproto.go diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 721ebfd..0966b58 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -18,7 +18,7 @@ type Expression interface { // Eval evaluates a concrete expression. It is an error to call Eval // on any expression that is not concrete (or contains any sub-expression // that is not concrete). - Eval() uint + Eval() int // Reduce attempts to evaluate any concrete sub-expressions. // i.e., (1 + 2 * (5 + 1 + someSizeOfStruct) reduces to @@ -45,7 +45,7 @@ func (e *Function) Concrete() bool { return false } -func (e *Function) Eval() uint { +func (e *Function) Eval() int { log.Fatalf("Cannot evaluate a 'Function'. It is not concrete.") panic("unreachable") } @@ -95,7 +95,7 @@ func (e *BinaryOp) Concrete() bool { return e.Expr1.Concrete() && e.Expr2.Concrete() } -func (e *BinaryOp) Eval() uint { +func (e *BinaryOp) Eval() int { switch e.Op { case "+": return e.Expr1.Eval() + e.Expr2.Eval() @@ -108,7 +108,7 @@ func (e *BinaryOp) Eval() uint { case "&": return e.Expr1.Eval() & e.Expr2.Eval() case "<<": - return e.Expr1.Eval() << e.Expr2.Eval() + return int(uint(e.Expr1.Eval()) << uint(e.Expr2.Eval())) } log.Fatalf("Invalid binary operator '%s' for expression.", e.Op) @@ -161,7 +161,7 @@ func (e *UnaryOp) Concrete() bool { return e.Expr.Concrete() } -func (e *UnaryOp) Eval() uint { +func (e *UnaryOp) Eval() int { switch e.Op { case "~": return ^e.Expr.Eval() @@ -196,8 +196,8 @@ func (e *Padding) Concrete() bool { return e.Expr.Concrete() } -func (e *Padding) Eval() uint { - return uint(pad(int(e.Expr.Eval()))) +func (e *Padding) Eval() int { + return pad(e.Expr.Eval()) } func (e *Padding) Reduce(prefix string) string { @@ -225,8 +225,8 @@ func (e *PopCount) Concrete() bool { return e.Expr.Concrete() } -func (e *PopCount) Eval() uint { - return popCount(e.Expr.Eval()) +func (e *PopCount) Eval() int { + return int(popCount(uint(e.Expr.Eval()))) } func (e *PopCount) Reduce(prefix string) string { @@ -246,14 +246,14 @@ func (e *PopCount) Initialize(p *Protocol) { // Value represents some constant integer. type Value struct { - v uint + v int } func (e *Value) Concrete() bool { return true } -func (e *Value) Eval() uint { +func (e *Value) Eval() int { return e.v } @@ -269,15 +269,15 @@ func (e *Value) Initialize(p *Protocol) {} // Bit represents some bit whose value is computed by '1 << bit'. type Bit struct { - b uint + b int } func (e *Bit) Concrete() bool { return true } -func (e *Bit) Eval() uint { - return 1 << e.b +func (e *Bit) Eval() int { + return int(1 << uint(e.b)) } func (e *Bit) Reduce(prefix string) string { @@ -300,7 +300,7 @@ func (e *FieldRef) Concrete() bool { return false } -func (e *FieldRef) Eval() uint { +func (e *FieldRef) Eval() int { log.Fatalf("Cannot evaluate a 'FieldRef'. It is not concrete.") panic("unreachable") } @@ -333,7 +333,7 @@ func (e *EnumRef) Concrete() bool { return false } -func (e *EnumRef) Eval() uint { +func (e *EnumRef) Eval() int { log.Fatalf("Cannot evaluate an 'EnumRef'. It is not concrete.") panic("unreachable") } @@ -361,7 +361,7 @@ func (e *SumOf) Concrete() bool { return false } -func (e *SumOf) Eval() uint { +func (e *SumOf) Eval() int { log.Fatalf("Cannot evaluate a 'SumOf'. It is not concrete.") panic("unreachable") } diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 725f3de..4452408 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -142,8 +142,7 @@ func (f *ListField) Length() Size { // special function written in go_struct.go to compute the size (since the // size in this case can only be computed recursively). func (f *ListField) Size() Size { - simpleLen := &Function{ - Name: "pad", + simpleLen := &Padding{ Expr: newBinaryOp("*", f.Length().Expression, f.Type.Size().Expression), } diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index df12e69..e0d4579 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -150,15 +150,21 @@ func (f *ExprField) Write(c *Context, prefix string) { // Value field func (f *ValueField) Define(c *Context) { - c.Putln("// valueparam field: type: %s, mask name: %s, list name: %s", - f.MaskType.SrcName(), f.MaskName, f.ListName) - panic("todo") + c.Putln("%s %s", f.MaskName, f.SrcType()) + c.Putln("%s []uint32", f.ListName) } func (f *ValueField) Read(c *Context, prefix string) { - c.Putln("// reading valueparam: type: %s, mask name: %s, list name: %s", - f.MaskType.SrcName(), f.MaskName, f.ListName) - panic("todo") + ReadSimpleSingleField(c, + fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType) + c.Putln("") + c.Putln("%s%s = make([]uint32, %s)", + prefix, f.ListName, f.ListLength().Reduce(prefix)) + c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) + c.Putln("%s%s[i] = Get32(buf[b:])", prefix, f.ListName) + c.Putln("b += 4") + c.Putln("}") + c.Putln("b = pad(b)") } func (f *ValueField) Write(c *Context, prefix string) { diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 1e43199..9884194 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -104,7 +104,11 @@ func (s *Struct) WriteListSize(c *Context) { c.Putln("// Struct list size %s", s.SrcName()) c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName()) c.Putln("size := 0") - c.Putln("for _, item := range list {") + if s.Size().Expression.Concrete() { + c.Putln("for _ = range list {") + } else { + c.Putln("for _, item := range list {") + } c.Putln("size += %s", s.Size().Reduce("item.")) c.Putln("}") c.Putln("return size") diff --git a/nexgb/xgbgen/size.go b/nexgb/xgbgen/size.go index d8d3ac3..8836892 100644 --- a/nexgb/xgbgen/size.go +++ b/nexgb/xgbgen/size.go @@ -11,7 +11,7 @@ type Size struct { // newFixedSize creates a new Size with some fixed and known value. func newFixedSize(fixed uint) Size { - return Size{&Value{v: fixed}} + return Size{&Value{v: int(fixed)}} } // newExpressionSize creates a new Size with some expression. diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index b650bc4..90cd0f3 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -89,7 +89,7 @@ func (xml *XML) Translate() *Protocol { if !ok { continue } - nextValue := uint(0) + nextValue := 0 for _, item := range enum.Items { if item.Expr == nil { item.Expr = &Value{v: nextValue} @@ -267,16 +267,16 @@ func (x *XMLExpression) Translate() Expression { Expr: x.Exprs[0].Translate(), } case "value": - val, err := strconv.Atoi(x.Data) + val, err := strconv.Atoi(strings.TrimSpace(x.Data)) if err != nil { log.Panicf("Could not convert '%s' in 'value' expression to int.", x.Data) } return &Value{ - v: uint(val), + v: val, } case "bit": - bit, err := strconv.Atoi(x.Data) + bit, err := strconv.Atoi(strings.TrimSpace(x.Data)) if err != nil { log.Panicf("Could not convert '%s' in 'bit' expression to int.", x.Data) @@ -286,7 +286,7 @@ func (x *XMLExpression) Translate() Expression { " is %d", bit) } return &Bit{ - b: uint(bit), + b: bit, } case "fieldref": return &FieldRef{ From 70ebcf5178018a31378367f67542fc89980e62a2 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 03:06:27 -0400 Subject: [PATCH 20/90] build comman for converting XML to Go --- nexgb/Makefile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nexgb/Makefile b/nexgb/Makefile index 041d20c..b1ef0ca 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -1,19 +1,16 @@ +# This Makefile is used by the developer. It is not needed in any way to build +# a checkout of the XGB repository. + XPROTO=/usr/share/xcb -all: xproto xinerama -xproto: - python2 go_client.py $(XPROTO)/xproto.xml - gofmt -w xproto.go +# All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_- +all: bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ + ge.xml glx.xml randr.xml record.xml render.xml res.xml \ + screensaver.xml shape.xml shm.xml sync.xml xc_misc.xml \ + xevie.xml xf86dri.xml xf86vidmode.xml xfixes.xml xinerama.xml \ + xinput.xml xprint.xml xproto.xml xselinux.xml xtest.xml \ + xvmc.xml xv.xml -xinerama: - python2 go_client.py $(XPROTO)/xinerama.xml - gofmt -w xinerama.go - -randr: - python2 go_client.py $(XPROTO)/randr.xml - gofmt -w randr.go - -render: - python2 go_client.py $(XPROTO)/render.xml - gofmt -w render.go +%.xml: + xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > auto_$*.go From 135cee57610cccd10009b264cce7fbcd5af367cb Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 03:06:48 -0400 Subject: [PATCH 21/90] auto-generated Go code ftw. ~65,000 lines. woooheee --- nexgb/auto_bigreq.go | 112 + nexgb/auto_composite.go | 555 +++ nexgb/auto_damage.go | 479 ++ nexgb/auto_dpms.go | 574 +++ nexgb/auto_dri2.go | 1534 ++++++ nexgb/auto_ge.go | 125 + nexgb/auto_glx.go | 9356 +++++++++++++++++++++++++++++++++++++ nexgb/auto_randr.go | 14 +- nexgb/auto_record.go | 1061 +++++ nexgb/auto_render.go | 26 +- nexgb/auto_res.go | 502 ++ nexgb/auto_screensaver.go | 601 +++ nexgb/auto_shape.go | 871 ++++ nexgb/auto_shm.go | 644 +++ nexgb/auto_sync.go | 1899 ++++++++ nexgb/auto_xc_misc.go | 300 ++ nexgb/auto_xevie.go | 513 ++ nexgb/auto_xf86dri.go | 1125 +++++ nexgb/auto_xf86vidmode.go | 2372 ++++++++++ nexgb/auto_xfixes.go | 2139 +++++++++ nexgb/auto_xinerama.go | 46 +- nexgb/auto_xinput.go | 7271 ++++++++++++++++++++++++++++ nexgb/auto_xprint.go | 2176 +++++++++ nexgb/auto_xproto.go | 36 +- nexgb/auto_xselinux.go | 1939 ++++++++ nexgb/auto_xtest.go | 335 ++ nexgb/auto_xv.go | 2738 +++++++++++ nexgb/auto_xvmc.go | 879 ++++ 28 files changed, 40161 insertions(+), 61 deletions(-) create mode 100644 nexgb/auto_bigreq.go create mode 100644 nexgb/auto_composite.go create mode 100644 nexgb/auto_damage.go create mode 100644 nexgb/auto_dpms.go create mode 100644 nexgb/auto_dri2.go create mode 100644 nexgb/auto_ge.go create mode 100644 nexgb/auto_glx.go create mode 100644 nexgb/auto_record.go create mode 100644 nexgb/auto_res.go create mode 100644 nexgb/auto_screensaver.go create mode 100644 nexgb/auto_shape.go create mode 100644 nexgb/auto_shm.go create mode 100644 nexgb/auto_sync.go create mode 100644 nexgb/auto_xc_misc.go create mode 100644 nexgb/auto_xevie.go create mode 100644 nexgb/auto_xf86dri.go create mode 100644 nexgb/auto_xf86vidmode.go create mode 100644 nexgb/auto_xfixes.go create mode 100644 nexgb/auto_xinput.go create mode 100644 nexgb/auto_xprint.go create mode 100644 nexgb/auto_xselinux.go create mode 100644 nexgb/auto_xtest.go create mode 100644 nexgb/auto_xv.go create mode 100644 nexgb/auto_xvmc.go diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go new file mode 100644 index 0000000..d008bce --- /dev/null +++ b/nexgb/auto_bigreq.go @@ -0,0 +1,112 @@ +package xgb + +/* + This file was generated by bigreq.xml on May 6 2012 3:00:43am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Request BigreqEnable +// size: 4 +type BigreqEnableCookie struct { + *cookie +} + +func (c *Conn) BigreqEnable() BigreqEnableCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.bigreqEnableRequest(), cookie) + return BigreqEnableCookie{cookie} +} + +func (c *Conn) BigreqEnableUnchecked() BigreqEnableCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.bigreqEnableRequest(), cookie) + return BigreqEnableCookie{cookie} +} + +// Request reply for BigreqEnable +// size: 12 +type BigreqEnableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MaximumRequestLength uint32 +} + +// Waits and reads reply data from request BigreqEnable +func (cook BigreqEnableCookie) Reply() (*BigreqEnableReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return bigreqEnableReply(buf), nil +} + +// Read reply into structure from buffer for BigreqEnable +func bigreqEnableReply(buf []byte) *BigreqEnableReply { + v := new(BigreqEnableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MaximumRequestLength = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook BigreqEnableCookie) Check() error { + return cook.check() +} + +// Write request to wire for BigreqEnable +func (c *Conn) bigreqEnableRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["BIG-REQUESTS"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go new file mode 100644 index 0000000..185e425 --- /dev/null +++ b/nexgb/auto_composite.go @@ -0,0 +1,555 @@ +package xgb + +/* + This file was generated by composite.xml on May 6 2012 3:00:43am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" +// import "xfixes" + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + CompositeRedirectAutomatic = 0 + CompositeRedirectManual = 1 +) + +// Request CompositeQueryVersion +// size: 12 +type CompositeQueryVersionCookie struct { + *cookie +} + +func (c *Conn) CompositeQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return CompositeQueryVersionCookie{cookie} +} + +func (c *Conn) CompositeQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return CompositeQueryVersionCookie{cookie} +} + +// Request reply for CompositeQueryVersion +// size: 32 +type CompositeQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request CompositeQueryVersion +func (cook CompositeQueryVersionCookie) Reply() (*CompositeQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return compositeQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for CompositeQueryVersion +func compositeQueryVersionReply(buf []byte) *CompositeQueryVersionReply { + v := new(CompositeQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook CompositeQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeQueryVersion +func (c *Conn) compositeQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ClientMajorVersion) + b += 4 + + Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request CompositeRedirectWindow +// size: 12 +type CompositeRedirectWindowCookie struct { + *cookie +} + +// Write request to wire for CompositeRedirectWindow +func (c *Conn) CompositeRedirectWindow(Window Id, Update byte) CompositeRedirectWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) + return CompositeRedirectWindowCookie{cookie} +} + +func (c *Conn) CompositeRedirectWindowChecked(Window Id, Update byte) CompositeRedirectWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) + return CompositeRedirectWindowCookie{cookie} +} + +func (cook CompositeRedirectWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeRedirectWindow +func (c *Conn) compositeRedirectWindowRequest(Window Id, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request CompositeRedirectSubwindows +// size: 12 +type CompositeRedirectSubwindowsCookie struct { + *cookie +} + +// Write request to wire for CompositeRedirectSubwindows +func (c *Conn) CompositeRedirectSubwindows(Window Id, Update byte) CompositeRedirectSubwindowsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) + return CompositeRedirectSubwindowsCookie{cookie} +} + +func (c *Conn) CompositeRedirectSubwindowsChecked(Window Id, Update byte) CompositeRedirectSubwindowsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) + return CompositeRedirectSubwindowsCookie{cookie} +} + +func (cook CompositeRedirectSubwindowsCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeRedirectSubwindows +func (c *Conn) compositeRedirectSubwindowsRequest(Window Id, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request CompositeUnredirectWindow +// size: 12 +type CompositeUnredirectWindowCookie struct { + *cookie +} + +// Write request to wire for CompositeUnredirectWindow +func (c *Conn) CompositeUnredirectWindow(Window Id, Update byte) CompositeUnredirectWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) + return CompositeUnredirectWindowCookie{cookie} +} + +func (c *Conn) CompositeUnredirectWindowChecked(Window Id, Update byte) CompositeUnredirectWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) + return CompositeUnredirectWindowCookie{cookie} +} + +func (cook CompositeUnredirectWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeUnredirectWindow +func (c *Conn) compositeUnredirectWindowRequest(Window Id, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request CompositeUnredirectSubwindows +// size: 12 +type CompositeUnredirectSubwindowsCookie struct { + *cookie +} + +// Write request to wire for CompositeUnredirectSubwindows +func (c *Conn) CompositeUnredirectSubwindows(Window Id, Update byte) CompositeUnredirectSubwindowsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) + return CompositeUnredirectSubwindowsCookie{cookie} +} + +func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Id, Update byte) CompositeUnredirectSubwindowsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) + return CompositeUnredirectSubwindowsCookie{cookie} +} + +func (cook CompositeUnredirectSubwindowsCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeUnredirectSubwindows +func (c *Conn) compositeUnredirectSubwindowsRequest(Window Id, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request CompositeCreateRegionFromBorderClip +// size: 12 +type CompositeCreateRegionFromBorderClipCookie struct { + *cookie +} + +// Write request to wire for CompositeCreateRegionFromBorderClip +func (c *Conn) CompositeCreateRegionFromBorderClip(Region Id, Window Id) CompositeCreateRegionFromBorderClipCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) + return CompositeCreateRegionFromBorderClipCookie{cookie} +} + +func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region Id, Window Id) CompositeCreateRegionFromBorderClipCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) + return CompositeCreateRegionFromBorderClipCookie{cookie} +} + +func (cook CompositeCreateRegionFromBorderClipCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeCreateRegionFromBorderClip +func (c *Conn) compositeCreateRegionFromBorderClipRequest(Region Id, Window Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request CompositeNameWindowPixmap +// size: 12 +type CompositeNameWindowPixmapCookie struct { + *cookie +} + +// Write request to wire for CompositeNameWindowPixmap +func (c *Conn) CompositeNameWindowPixmap(Window Id, Pixmap Id) CompositeNameWindowPixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) + return CompositeNameWindowPixmapCookie{cookie} +} + +func (c *Conn) CompositeNameWindowPixmapChecked(Window Id, Pixmap Id) CompositeNameWindowPixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) + return CompositeNameWindowPixmapCookie{cookie} +} + +func (cook CompositeNameWindowPixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeNameWindowPixmap +func (c *Conn) compositeNameWindowPixmapRequest(Window Id, Pixmap Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Pixmap)) + b += 4 + + return buf +} + +// Request CompositeGetOverlayWindow +// size: 8 +type CompositeGetOverlayWindowCookie struct { + *cookie +} + +func (c *Conn) CompositeGetOverlayWindow(Window Id) CompositeGetOverlayWindowCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) + return CompositeGetOverlayWindowCookie{cookie} +} + +func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Id) CompositeGetOverlayWindowCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) + return CompositeGetOverlayWindowCookie{cookie} +} + +// Request reply for CompositeGetOverlayWindow +// size: 32 +type CompositeGetOverlayWindowReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + OverlayWin Id + // padding: 20 bytes +} + +// Waits and reads reply data from request CompositeGetOverlayWindow +func (cook CompositeGetOverlayWindowCookie) Reply() (*CompositeGetOverlayWindowReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return compositeGetOverlayWindowReply(buf), nil +} + +// Read reply into structure from buffer for CompositeGetOverlayWindow +func compositeGetOverlayWindowReply(buf []byte) *CompositeGetOverlayWindowReply { + v := new(CompositeGetOverlayWindowReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.OverlayWin = Id(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +func (cook CompositeGetOverlayWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeGetOverlayWindow +func (c *Conn) compositeGetOverlayWindowRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request CompositeReleaseOverlayWindow +// size: 8 +type CompositeReleaseOverlayWindowCookie struct { + *cookie +} + +// Write request to wire for CompositeReleaseOverlayWindow +func (c *Conn) CompositeReleaseOverlayWindow(Window Id) CompositeReleaseOverlayWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) + return CompositeReleaseOverlayWindowCookie{cookie} +} + +func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Id) CompositeReleaseOverlayWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) + return CompositeReleaseOverlayWindowCookie{cookie} +} + +func (cook CompositeReleaseOverlayWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for CompositeReleaseOverlayWindow +func (c *Conn) compositeReleaseOverlayWindowRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["COMPOSITE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go new file mode 100644 index 0000000..c875016 --- /dev/null +++ b/nexgb/auto_damage.go @@ -0,0 +1,479 @@ +package xgb + +/* + This file was generated by damage.xml on May 6 2012 3:00:43am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" +// import "xfixes" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +const ( + DamageReportLevelRawRectangles = 0 + DamageReportLevelDeltaRectangles = 1 + DamageReportLevelBoundingBox = 2 + DamageReportLevelNonEmpty = 3 +) + +// Skipping resource definition of 'Damage' + +// Event definition DamageNotify (0) +// Size: 32 + +const DamageNotify = 0 + +type DamageNotifyEvent struct { + Sequence uint16 + Level byte + Drawable Id + Damage Id + Timestamp Timestamp + Area Rectangle + Geometry Rectangle +} + +// Event read DamageNotify +func NewDamageNotifyEvent(buf []byte) Event { + v := DamageNotifyEvent{} + b := 1 // don't read event number + + v.Level = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.Damage = Id(Get32(buf[b:])) + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Area = Rectangle{} + b += ReadRectangle(buf[b:], &v.Area) + + v.Geometry = Rectangle{} + b += ReadRectangle(buf[b:], &v.Geometry) + + return v +} + +// Event write DamageNotify +func (v DamageNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Level + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put32(buf[b:], uint32(v.Damage)) + b += 4 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + { + structBytes := v.Area.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.Geometry.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +func (v DamageNotifyEvent) ImplementsEvent() {} + +func (v DamageNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DamageNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Level: %d", v.Level)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("Damage: %d", v.Damage)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + return "DamageNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewDamageNotifyEvent +} + +// Error definition DamageBadDamage (0) +// Size: 32 + +const BadDamageBadDamage = 0 + +type DamageBadDamageError struct { + Sequence uint16 + NiceName string +} + +// Error read DamageBadDamage +func NewDamageBadDamageError(buf []byte) Error { + v := DamageBadDamageError{} + v.NiceName = "DamageBadDamage" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err DamageBadDamageError) ImplementsError() {} + +func (err DamageBadDamageError) SequenceId() uint16 { + return err.Sequence +} + +func (err DamageBadDamageError) BadId() Id { + return 0 +} + +func (err DamageBadDamageError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadDamageBadDamage {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewDamageBadDamageError +} + +// Request DamageQueryVersion +// size: 12 +type DamageQueryVersionCookie struct { + *cookie +} + +func (c *Conn) DamageQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return DamageQueryVersionCookie{cookie} +} + +func (c *Conn) DamageQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return DamageQueryVersionCookie{cookie} +} + +// Request reply for DamageQueryVersion +// size: 32 +type DamageQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request DamageQueryVersion +func (cook DamageQueryVersionCookie) Reply() (*DamageQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return damageQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for DamageQueryVersion +func damageQueryVersionReply(buf []byte) *DamageQueryVersionReply { + v := new(DamageQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook DamageQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for DamageQueryVersion +func (c *Conn) damageQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DAMAGE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ClientMajorVersion) + b += 4 + + Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request DamageCreate +// size: 16 +type DamageCreateCookie struct { + *cookie +} + +// Write request to wire for DamageCreate +func (c *Conn) DamageCreate(Damage Id, Drawable Id, Level byte) DamageCreateCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) + return DamageCreateCookie{cookie} +} + +func (c *Conn) DamageCreateChecked(Damage Id, Drawable Id, Level byte) DamageCreateCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) + return DamageCreateCookie{cookie} +} + +func (cook DamageCreateCookie) Check() error { + return cook.check() +} + +// Write request to wire for DamageCreate +func (c *Conn) damageCreateRequest(Damage Id, Drawable Id, Level byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DAMAGE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Damage)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + buf[b] = Level + b += 1 + + b += 3 // padding + + return buf +} + +// Request DamageDestroy +// size: 8 +type DamageDestroyCookie struct { + *cookie +} + +// Write request to wire for DamageDestroy +func (c *Conn) DamageDestroy(Damage Id) DamageDestroyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.damageDestroyRequest(Damage), cookie) + return DamageDestroyCookie{cookie} +} + +func (c *Conn) DamageDestroyChecked(Damage Id) DamageDestroyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.damageDestroyRequest(Damage), cookie) + return DamageDestroyCookie{cookie} +} + +func (cook DamageDestroyCookie) Check() error { + return cook.check() +} + +// Write request to wire for DamageDestroy +func (c *Conn) damageDestroyRequest(Damage Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DAMAGE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Damage)) + b += 4 + + return buf +} + +// Request DamageSubtract +// size: 16 +type DamageSubtractCookie struct { + *cookie +} + +// Write request to wire for DamageSubtract +func (c *Conn) DamageSubtract(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) + return DamageSubtractCookie{cookie} +} + +func (c *Conn) DamageSubtractChecked(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) + return DamageSubtractCookie{cookie} +} + +func (cook DamageSubtractCookie) Check() error { + return cook.check() +} + +// Write request to wire for DamageSubtract +func (c *Conn) damageSubtractRequest(Damage Id, Repair Id, Parts Id) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DAMAGE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Damage)) + b += 4 + + Put32(buf[b:], uint32(Repair)) + b += 4 + + Put32(buf[b:], uint32(Parts)) + b += 4 + + return buf +} + +// Request DamageAdd +// size: 12 +type DamageAddCookie struct { + *cookie +} + +// Write request to wire for DamageAdd +func (c *Conn) DamageAdd(Drawable Id, Region Id) DamageAddCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.damageAddRequest(Drawable, Region), cookie) + return DamageAddCookie{cookie} +} + +func (c *Conn) DamageAddChecked(Drawable Id, Region Id) DamageAddCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.damageAddRequest(Drawable, Region), cookie) + return DamageAddCookie{cookie} +} + +func (cook DamageAddCookie) Check() error { + return cook.check() +} + +// Write request to wire for DamageAdd +func (c *Conn) damageAddRequest(Drawable Id, Region Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DAMAGE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go new file mode 100644 index 0000000..a1f733b --- /dev/null +++ b/nexgb/auto_dpms.go @@ -0,0 +1,574 @@ +package xgb + +/* + This file was generated by dpms.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +const ( + DpmsDPMSModeOn = 0 + DpmsDPMSModeStandby = 1 + DpmsDPMSModeSuspend = 2 + DpmsDPMSModeOff = 3 +) + +// Request DpmsGetVersion +// size: 8 +type DpmsGetVersionCookie struct { + *cookie +} + +func (c *Conn) DpmsGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return DpmsGetVersionCookie{cookie} +} + +func (c *Conn) DpmsGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return DpmsGetVersionCookie{cookie} +} + +// Request reply for DpmsGetVersion +// size: 12 +type DpmsGetVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 +} + +// Waits and reads reply data from request DpmsGetVersion +func (cook DpmsGetVersionCookie) Reply() (*DpmsGetVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dpmsGetVersionReply(buf), nil +} + +// Read reply into structure from buffer for DpmsGetVersion +func dpmsGetVersionReply(buf []byte) *DpmsGetVersionReply { + v := new(DpmsGetVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook DpmsGetVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsGetVersion +func (c *Conn) dpmsGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], ClientMajorVersion) + b += 2 + + Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request DpmsCapable +// size: 4 +type DpmsCapableCookie struct { + *cookie +} + +func (c *Conn) DpmsCapable() DpmsCapableCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dpmsCapableRequest(), cookie) + return DpmsCapableCookie{cookie} +} + +func (c *Conn) DpmsCapableUnchecked() DpmsCapableCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dpmsCapableRequest(), cookie) + return DpmsCapableCookie{cookie} +} + +// Request reply for DpmsCapable +// size: 32 +type DpmsCapableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Capable bool + // padding: 23 bytes +} + +// Waits and reads reply data from request DpmsCapable +func (cook DpmsCapableCookie) Reply() (*DpmsCapableReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dpmsCapableReply(buf), nil +} + +// Read reply into structure from buffer for DpmsCapable +func dpmsCapableReply(buf []byte) *DpmsCapableReply { + v := new(DpmsCapableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Capable = true + } else { + v.Capable = false + } + b += 1 + + b += 23 // padding + + return v +} + +func (cook DpmsCapableCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsCapable +func (c *Conn) dpmsCapableRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request DpmsGetTimeouts +// size: 4 +type DpmsGetTimeoutsCookie struct { + *cookie +} + +func (c *Conn) DpmsGetTimeouts() DpmsGetTimeoutsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dpmsGetTimeoutsRequest(), cookie) + return DpmsGetTimeoutsCookie{cookie} +} + +func (c *Conn) DpmsGetTimeoutsUnchecked() DpmsGetTimeoutsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dpmsGetTimeoutsRequest(), cookie) + return DpmsGetTimeoutsCookie{cookie} +} + +// Request reply for DpmsGetTimeouts +// size: 32 +type DpmsGetTimeoutsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StandbyTimeout uint16 + SuspendTimeout uint16 + OffTimeout uint16 + // padding: 18 bytes +} + +// Waits and reads reply data from request DpmsGetTimeouts +func (cook DpmsGetTimeoutsCookie) Reply() (*DpmsGetTimeoutsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dpmsGetTimeoutsReply(buf), nil +} + +// Read reply into structure from buffer for DpmsGetTimeouts +func dpmsGetTimeoutsReply(buf []byte) *DpmsGetTimeoutsReply { + v := new(DpmsGetTimeoutsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.StandbyTimeout = Get16(buf[b:]) + b += 2 + + v.SuspendTimeout = Get16(buf[b:]) + b += 2 + + v.OffTimeout = Get16(buf[b:]) + b += 2 + + b += 18 // padding + + return v +} + +func (cook DpmsGetTimeoutsCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsGetTimeouts +func (c *Conn) dpmsGetTimeoutsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request DpmsSetTimeouts +// size: 12 +type DpmsSetTimeoutsCookie struct { + *cookie +} + +// Write request to wire for DpmsSetTimeouts +func (c *Conn) DpmsSetTimeouts(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return DpmsSetTimeoutsCookie{cookie} +} + +func (c *Conn) DpmsSetTimeoutsChecked(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return DpmsSetTimeoutsCookie{cookie} +} + +func (cook DpmsSetTimeoutsCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsSetTimeouts +func (c *Conn) dpmsSetTimeoutsRequest(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], StandbyTimeout) + b += 2 + + Put16(buf[b:], SuspendTimeout) + b += 2 + + Put16(buf[b:], OffTimeout) + b += 2 + + return buf +} + +// Request DpmsEnable +// size: 4 +type DpmsEnableCookie struct { + *cookie +} + +// Write request to wire for DpmsEnable +func (c *Conn) DpmsEnable() DpmsEnableCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dpmsEnableRequest(), cookie) + return DpmsEnableCookie{cookie} +} + +func (c *Conn) DpmsEnableChecked() DpmsEnableCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dpmsEnableRequest(), cookie) + return DpmsEnableCookie{cookie} +} + +func (cook DpmsEnableCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsEnable +func (c *Conn) dpmsEnableRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request DpmsDisable +// size: 4 +type DpmsDisableCookie struct { + *cookie +} + +// Write request to wire for DpmsDisable +func (c *Conn) DpmsDisable() DpmsDisableCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dpmsDisableRequest(), cookie) + return DpmsDisableCookie{cookie} +} + +func (c *Conn) DpmsDisableChecked() DpmsDisableCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dpmsDisableRequest(), cookie) + return DpmsDisableCookie{cookie} +} + +func (cook DpmsDisableCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsDisable +func (c *Conn) dpmsDisableRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request DpmsForceLevel +// size: 8 +type DpmsForceLevelCookie struct { + *cookie +} + +// Write request to wire for DpmsForceLevel +func (c *Conn) DpmsForceLevel(PowerLevel uint16) DpmsForceLevelCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie) + return DpmsForceLevelCookie{cookie} +} + +func (c *Conn) DpmsForceLevelChecked(PowerLevel uint16) DpmsForceLevelCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie) + return DpmsForceLevelCookie{cookie} +} + +func (cook DpmsForceLevelCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsForceLevel +func (c *Conn) dpmsForceLevelRequest(PowerLevel uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], PowerLevel) + b += 2 + + return buf +} + +// Request DpmsInfo +// size: 4 +type DpmsInfoCookie struct { + *cookie +} + +func (c *Conn) DpmsInfo() DpmsInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dpmsInfoRequest(), cookie) + return DpmsInfoCookie{cookie} +} + +func (c *Conn) DpmsInfoUnchecked() DpmsInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dpmsInfoRequest(), cookie) + return DpmsInfoCookie{cookie} +} + +// Request reply for DpmsInfo +// size: 32 +type DpmsInfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PowerLevel uint16 + State bool + // padding: 21 bytes +} + +// Waits and reads reply data from request DpmsInfo +func (cook DpmsInfoCookie) Reply() (*DpmsInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dpmsInfoReply(buf), nil +} + +// Read reply into structure from buffer for DpmsInfo +func dpmsInfoReply(buf []byte) *DpmsInfoReply { + v := new(DpmsInfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PowerLevel = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.State = true + } else { + v.State = false + } + b += 1 + + b += 21 // padding + + return v +} + +func (cook DpmsInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for DpmsInfo +func (c *Conn) dpmsInfoRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DPMS"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go new file mode 100644 index 0000000..7797623 --- /dev/null +++ b/nexgb/auto_dri2.go @@ -0,0 +1,1534 @@ +package xgb + +/* + This file was generated by dri2.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + Dri2AttachmentBufferFrontLeft = 0 + Dri2AttachmentBufferBackLeft = 1 + Dri2AttachmentBufferFrontRight = 2 + Dri2AttachmentBufferBackRight = 3 + Dri2AttachmentBufferDepth = 4 + Dri2AttachmentBufferStencil = 5 + Dri2AttachmentBufferAccum = 6 + Dri2AttachmentBufferFakeFrontLeft = 7 + Dri2AttachmentBufferFakeFrontRight = 8 + Dri2AttachmentBufferDepthStencil = 9 + Dri2AttachmentBufferHiz = 10 +) + +const ( + Dri2DriverTypeDri = 0 + Dri2DriverTypeVdpau = 1 +) + +const ( + Dri2EventTypeExchangeComplete = 1 + Dri2EventTypeBlitComplete = 2 + Dri2EventTypeFlipComplete = 3 +) + +// 'Dri2DRI2Buffer' struct definition +// Size: 20 +type Dri2DRI2Buffer struct { + Attachment uint32 + Name uint32 + Pitch uint32 + Cpp uint32 + Flags uint32 +} + +// Struct read Dri2DRI2Buffer +func ReadDri2DRI2Buffer(buf []byte, v *Dri2DRI2Buffer) int { + b := 0 + + v.Attachment = Get32(buf[b:]) + b += 4 + + v.Name = Get32(buf[b:]) + b += 4 + + v.Pitch = Get32(buf[b:]) + b += 4 + + v.Cpp = Get32(buf[b:]) + b += 4 + + v.Flags = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Dri2DRI2Buffer +func ReadDri2DRI2BufferList(buf []byte, dest []Dri2DRI2Buffer) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Dri2DRI2Buffer{} + b += ReadDri2DRI2Buffer(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Dri2DRI2Buffer +func (v Dri2DRI2Buffer) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + Put32(buf[b:], v.Attachment) + b += 4 + + Put32(buf[b:], v.Name) + b += 4 + + Put32(buf[b:], v.Pitch) + b += 4 + + Put32(buf[b:], v.Cpp) + b += 4 + + Put32(buf[b:], v.Flags) + b += 4 + + return buf +} + +// Write struct list Dri2DRI2Buffer +func Dri2DRI2BufferListBytes(buf []byte, list []Dri2DRI2Buffer) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'Dri2AttachFormat' struct definition +// Size: 8 +type Dri2AttachFormat struct { + Attachment uint32 + Format uint32 +} + +// Struct read Dri2AttachFormat +func ReadDri2AttachFormat(buf []byte, v *Dri2AttachFormat) int { + b := 0 + + v.Attachment = Get32(buf[b:]) + b += 4 + + v.Format = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Dri2AttachFormat +func ReadDri2AttachFormatList(buf []byte, dest []Dri2AttachFormat) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Dri2AttachFormat{} + b += ReadDri2AttachFormat(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Dri2AttachFormat +func (v Dri2AttachFormat) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], v.Attachment) + b += 4 + + Put32(buf[b:], v.Format) + b += 4 + + return buf +} + +// Write struct list Dri2AttachFormat +func Dri2AttachFormatListBytes(buf []byte, list []Dri2AttachFormat) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Event definition Dri2BufferSwapComplete (0) +// Size: 32 + +const Dri2BufferSwapComplete = 0 + +type Dri2BufferSwapCompleteEvent struct { + Sequence uint16 + // padding: 1 bytes + EventType uint16 + // padding: 2 bytes + Drawable Id + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + Sbc uint32 +} + +// Event read Dri2BufferSwapComplete +func NewDri2BufferSwapCompleteEvent(buf []byte) Event { + v := Dri2BufferSwapCompleteEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.EventType = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.UstHi = Get32(buf[b:]) + b += 4 + + v.UstLo = Get32(buf[b:]) + b += 4 + + v.MscHi = Get32(buf[b:]) + b += 4 + + v.MscLo = Get32(buf[b:]) + b += 4 + + v.Sbc = Get32(buf[b:]) + b += 4 + + return v +} + +// Event write Dri2BufferSwapComplete +func (v Dri2BufferSwapCompleteEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put16(buf[b:], v.EventType) + b += 2 + + b += 2 // padding + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put32(buf[b:], v.UstHi) + b += 4 + + Put32(buf[b:], v.UstLo) + b += 4 + + Put32(buf[b:], v.MscHi) + b += 4 + + Put32(buf[b:], v.MscLo) + b += 4 + + Put32(buf[b:], v.Sbc) + b += 4 + + return buf +} + +func (v Dri2BufferSwapCompleteEvent) ImplementsEvent() {} + +func (v Dri2BufferSwapCompleteEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v Dri2BufferSwapCompleteEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("EventType: %d", v.EventType)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("UstHi: %d", v.UstHi)) + fieldVals = append(fieldVals, sprintf("UstLo: %d", v.UstLo)) + fieldVals = append(fieldVals, sprintf("MscHi: %d", v.MscHi)) + fieldVals = append(fieldVals, sprintf("MscLo: %d", v.MscLo)) + fieldVals = append(fieldVals, sprintf("Sbc: %d", v.Sbc)) + return "Dri2BufferSwapComplete {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewDri2BufferSwapCompleteEvent +} + +// Event definition Dri2InvalidateBuffers (1) +// Size: 32 + +const Dri2InvalidateBuffers = 1 + +type Dri2InvalidateBuffersEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Id +} + +// Event read Dri2InvalidateBuffers +func NewDri2InvalidateBuffersEvent(buf []byte) Event { + v := Dri2InvalidateBuffersEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write Dri2InvalidateBuffers +func (v Dri2InvalidateBuffersEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + return buf +} + +func (v Dri2InvalidateBuffersEvent) ImplementsEvent() {} + +func (v Dri2InvalidateBuffersEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v Dri2InvalidateBuffersEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + return "Dri2InvalidateBuffers {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewDri2InvalidateBuffersEvent +} + +// Request Dri2QueryVersion +// size: 12 +type Dri2QueryVersionCookie struct { + *cookie +} + +func (c *Conn) Dri2QueryVersion(MajorVersion uint32, MinorVersion uint32) Dri2QueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2QueryVersionRequest(MajorVersion, MinorVersion), cookie) + return Dri2QueryVersionCookie{cookie} +} + +func (c *Conn) Dri2QueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) Dri2QueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2QueryVersionRequest(MajorVersion, MinorVersion), cookie) + return Dri2QueryVersionCookie{cookie} +} + +// Request reply for Dri2QueryVersion +// size: 16 +type Dri2QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 +} + +// Waits and reads reply data from request Dri2QueryVersion +func (cook Dri2QueryVersionCookie) Reply() (*Dri2QueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2QueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for Dri2QueryVersion +func dri2QueryVersionReply(buf []byte) *Dri2QueryVersionReply { + v := new(Dri2QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2QueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2QueryVersion +func (c *Conn) dri2QueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request Dri2Connect +// size: 12 +type Dri2ConnectCookie struct { + *cookie +} + +func (c *Conn) Dri2Connect(Window Id, DriverType uint32) Dri2ConnectCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) + return Dri2ConnectCookie{cookie} +} + +func (c *Conn) Dri2ConnectUnchecked(Window Id, DriverType uint32) Dri2ConnectCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) + return Dri2ConnectCookie{cookie} +} + +// Request reply for Dri2Connect +// size: (((32 + pad((int(DriverNameLength) * 1))) + pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + pad((int(DeviceNameLength) * 1))) +type Dri2ConnectReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DriverNameLength uint32 + DeviceNameLength uint32 + // padding: 16 bytes + DriverName string // size: pad((int(DriverNameLength) * 1)) + AlignmentPad []byte // size: pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1)) + DeviceName string // size: pad((int(DeviceNameLength) * 1)) +} + +// Waits and reads reply data from request Dri2Connect +func (cook Dri2ConnectCookie) Reply() (*Dri2ConnectReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2ConnectReply(buf), nil +} + +// Read reply into structure from buffer for Dri2Connect +func dri2ConnectReply(buf []byte) *Dri2ConnectReply { + v := new(Dri2ConnectReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.DriverNameLength = Get32(buf[b:]) + b += 4 + + v.DeviceNameLength = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.DriverNameLength) + copy(byteString[:v.DriverNameLength], buf[b:]) + v.DriverName = string(byteString) + b += pad(int(v.DriverNameLength)) + } + + v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) + copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:]) + b += pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))) + + { + byteString := make([]byte, v.DeviceNameLength) + copy(byteString[:v.DeviceNameLength], buf[b:]) + v.DeviceName = string(byteString) + b += pad(int(v.DeviceNameLength)) + } + + return v +} + +func (cook Dri2ConnectCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2Connect +func (c *Conn) dri2ConnectRequest(Window Id, DriverType uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], DriverType) + b += 4 + + return buf +} + +// Request Dri2Authenticate +// size: 12 +type Dri2AuthenticateCookie struct { + *cookie +} + +func (c *Conn) Dri2Authenticate(Window Id, Magic uint32) Dri2AuthenticateCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) + return Dri2AuthenticateCookie{cookie} +} + +func (c *Conn) Dri2AuthenticateUnchecked(Window Id, Magic uint32) Dri2AuthenticateCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) + return Dri2AuthenticateCookie{cookie} +} + +// Request reply for Dri2Authenticate +// size: 12 +type Dri2AuthenticateReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Authenticated uint32 +} + +// Waits and reads reply data from request Dri2Authenticate +func (cook Dri2AuthenticateCookie) Reply() (*Dri2AuthenticateReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2AuthenticateReply(buf), nil +} + +// Read reply into structure from buffer for Dri2Authenticate +func dri2AuthenticateReply(buf []byte) *Dri2AuthenticateReply { + v := new(Dri2AuthenticateReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Authenticated = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2AuthenticateCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2Authenticate +func (c *Conn) dri2AuthenticateRequest(Window Id, Magic uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], Magic) + b += 4 + + return buf +} + +// Request Dri2CreateDrawable +// size: 8 +type Dri2CreateDrawableCookie struct { + *cookie +} + +// Write request to wire for Dri2CreateDrawable +func (c *Conn) Dri2CreateDrawable(Drawable Id) Dri2CreateDrawableCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) + return Dri2CreateDrawableCookie{cookie} +} + +func (c *Conn) Dri2CreateDrawableChecked(Drawable Id) Dri2CreateDrawableCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) + return Dri2CreateDrawableCookie{cookie} +} + +func (cook Dri2CreateDrawableCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2CreateDrawable +func (c *Conn) dri2CreateDrawableRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request Dri2DestroyDrawable +// size: 8 +type Dri2DestroyDrawableCookie struct { + *cookie +} + +// Write request to wire for Dri2DestroyDrawable +func (c *Conn) Dri2DestroyDrawable(Drawable Id) Dri2DestroyDrawableCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) + return Dri2DestroyDrawableCookie{cookie} +} + +func (c *Conn) Dri2DestroyDrawableChecked(Drawable Id) Dri2DestroyDrawableCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) + return Dri2DestroyDrawableCookie{cookie} +} + +func (cook Dri2DestroyDrawableCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2DestroyDrawable +func (c *Conn) dri2DestroyDrawableRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request Dri2GetBuffers +// size: pad((12 + pad((len(Attachments) * 4)))) +type Dri2GetBuffersCookie struct { + *cookie +} + +func (c *Conn) Dri2GetBuffers(Drawable Id, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) + return Dri2GetBuffersCookie{cookie} +} + +func (c *Conn) Dri2GetBuffersUnchecked(Drawable Id, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) + return Dri2GetBuffersCookie{cookie} +} + +// Request reply for Dri2GetBuffers +// size: (32 + pad((int(Count) * 20))) +type Dri2GetBuffersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Count uint32 + // padding: 12 bytes + Buffers []Dri2DRI2Buffer // size: pad((int(Count) * 20)) +} + +// Waits and reads reply data from request Dri2GetBuffers +func (cook Dri2GetBuffersCookie) Reply() (*Dri2GetBuffersReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2GetBuffersReply(buf), nil +} + +// Read reply into structure from buffer for Dri2GetBuffers +func dri2GetBuffersReply(buf []byte) *Dri2GetBuffersReply { + v := new(Dri2GetBuffersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get32(buf[b:]) + b += 4 + + v.Height = Get32(buf[b:]) + b += 4 + + v.Count = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Buffers = make([]Dri2DRI2Buffer, v.Count) + b += ReadDri2DRI2BufferList(buf[b:], v.Buffers) + + return v +} + +func (cook Dri2GetBuffersCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2GetBuffers +func (c *Conn) dri2GetBuffersRequest(Drawable Id, Count uint32, Attachments []uint32) []byte { + size := pad((12 + pad((len(Attachments) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], Count) + b += 4 + + for i := 0; i < int(len(Attachments)); i++ { + Put32(buf[b:], Attachments[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request Dri2CopyRegion +// size: 20 +type Dri2CopyRegionCookie struct { + *cookie +} + +func (c *Conn) Dri2CopyRegion(Drawable Id, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) + return Dri2CopyRegionCookie{cookie} +} + +func (c *Conn) Dri2CopyRegionUnchecked(Drawable Id, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) + return Dri2CopyRegionCookie{cookie} +} + +// Request reply for Dri2CopyRegion +// size: 8 +type Dri2CopyRegionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes +} + +// Waits and reads reply data from request Dri2CopyRegion +func (cook Dri2CopyRegionCookie) Reply() (*Dri2CopyRegionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2CopyRegionReply(buf), nil +} + +// Read reply into structure from buffer for Dri2CopyRegion +func dri2CopyRegionReply(buf []byte) *Dri2CopyRegionReply { + v := new(Dri2CopyRegionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +func (cook Dri2CopyRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2CopyRegion +func (c *Conn) dri2CopyRegionRequest(Drawable Id, Region uint32, Dest uint32, Src uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], Region) + b += 4 + + Put32(buf[b:], Dest) + b += 4 + + Put32(buf[b:], Src) + b += 4 + + return buf +} + +// Request Dri2GetBuffersWithFormat +// size: pad((12 + pad((len(Attachments) * 8)))) +type Dri2GetBuffersWithFormatCookie struct { + *cookie +} + +func (c *Conn) Dri2GetBuffersWithFormat(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) + return Dri2GetBuffersWithFormatCookie{cookie} +} + +func (c *Conn) Dri2GetBuffersWithFormatUnchecked(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) + return Dri2GetBuffersWithFormatCookie{cookie} +} + +// Request reply for Dri2GetBuffersWithFormat +// size: (32 + pad((int(Count) * 20))) +type Dri2GetBuffersWithFormatReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Count uint32 + // padding: 12 bytes + Buffers []Dri2DRI2Buffer // size: pad((int(Count) * 20)) +} + +// Waits and reads reply data from request Dri2GetBuffersWithFormat +func (cook Dri2GetBuffersWithFormatCookie) Reply() (*Dri2GetBuffersWithFormatReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2GetBuffersWithFormatReply(buf), nil +} + +// Read reply into structure from buffer for Dri2GetBuffersWithFormat +func dri2GetBuffersWithFormatReply(buf []byte) *Dri2GetBuffersWithFormatReply { + v := new(Dri2GetBuffersWithFormatReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get32(buf[b:]) + b += 4 + + v.Height = Get32(buf[b:]) + b += 4 + + v.Count = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Buffers = make([]Dri2DRI2Buffer, v.Count) + b += ReadDri2DRI2BufferList(buf[b:], v.Buffers) + + return v +} + +func (cook Dri2GetBuffersWithFormatCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2GetBuffersWithFormat +func (c *Conn) dri2GetBuffersWithFormatRequest(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) []byte { + size := pad((12 + pad((len(Attachments) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], Count) + b += 4 + + b += Dri2AttachFormatListBytes(buf[b:], Attachments) + + return buf +} + +// Request Dri2SwapBuffers +// size: 32 +type Dri2SwapBuffersCookie struct { + *cookie +} + +func (c *Conn) Dri2SwapBuffers(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return Dri2SwapBuffersCookie{cookie} +} + +func (c *Conn) Dri2SwapBuffersUnchecked(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return Dri2SwapBuffersCookie{cookie} +} + +// Request reply for Dri2SwapBuffers +// size: 16 +type Dri2SwapBuffersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SwapHi uint32 + SwapLo uint32 +} + +// Waits and reads reply data from request Dri2SwapBuffers +func (cook Dri2SwapBuffersCookie) Reply() (*Dri2SwapBuffersReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2SwapBuffersReply(buf), nil +} + +// Read reply into structure from buffer for Dri2SwapBuffers +func dri2SwapBuffersReply(buf []byte) *Dri2SwapBuffersReply { + v := new(Dri2SwapBuffersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.SwapHi = Get32(buf[b:]) + b += 4 + + v.SwapLo = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2SwapBuffersCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2SwapBuffers +func (c *Conn) dri2SwapBuffersRequest(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], TargetMscHi) + b += 4 + + Put32(buf[b:], TargetMscLo) + b += 4 + + Put32(buf[b:], DivisorHi) + b += 4 + + Put32(buf[b:], DivisorLo) + b += 4 + + Put32(buf[b:], RemainderHi) + b += 4 + + Put32(buf[b:], RemainderLo) + b += 4 + + return buf +} + +// Request Dri2GetMSC +// size: 8 +type Dri2GetMSCCookie struct { + *cookie +} + +func (c *Conn) Dri2GetMSC(Drawable Id) Dri2GetMSCCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) + return Dri2GetMSCCookie{cookie} +} + +func (c *Conn) Dri2GetMSCUnchecked(Drawable Id) Dri2GetMSCCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) + return Dri2GetMSCCookie{cookie} +} + +// Request reply for Dri2GetMSC +// size: 32 +type Dri2GetMSCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request Dri2GetMSC +func (cook Dri2GetMSCCookie) Reply() (*Dri2GetMSCReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2GetMSCReply(buf), nil +} + +// Read reply into structure from buffer for Dri2GetMSC +func dri2GetMSCReply(buf []byte) *Dri2GetMSCReply { + v := new(Dri2GetMSCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = Get32(buf[b:]) + b += 4 + + v.UstLo = Get32(buf[b:]) + b += 4 + + v.MscHi = Get32(buf[b:]) + b += 4 + + v.MscLo = Get32(buf[b:]) + b += 4 + + v.SbcHi = Get32(buf[b:]) + b += 4 + + v.SbcLo = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2GetMSCCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2GetMSC +func (c *Conn) dri2GetMSCRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request Dri2WaitMSC +// size: 32 +type Dri2WaitMSCCookie struct { + *cookie +} + +func (c *Conn) Dri2WaitMSC(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return Dri2WaitMSCCookie{cookie} +} + +func (c *Conn) Dri2WaitMSCUnchecked(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return Dri2WaitMSCCookie{cookie} +} + +// Request reply for Dri2WaitMSC +// size: 32 +type Dri2WaitMSCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request Dri2WaitMSC +func (cook Dri2WaitMSCCookie) Reply() (*Dri2WaitMSCReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2WaitMSCReply(buf), nil +} + +// Read reply into structure from buffer for Dri2WaitMSC +func dri2WaitMSCReply(buf []byte) *Dri2WaitMSCReply { + v := new(Dri2WaitMSCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = Get32(buf[b:]) + b += 4 + + v.UstLo = Get32(buf[b:]) + b += 4 + + v.MscHi = Get32(buf[b:]) + b += 4 + + v.MscLo = Get32(buf[b:]) + b += 4 + + v.SbcHi = Get32(buf[b:]) + b += 4 + + v.SbcLo = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2WaitMSCCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2WaitMSC +func (c *Conn) dri2WaitMSCRequest(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], TargetMscHi) + b += 4 + + Put32(buf[b:], TargetMscLo) + b += 4 + + Put32(buf[b:], DivisorHi) + b += 4 + + Put32(buf[b:], DivisorLo) + b += 4 + + Put32(buf[b:], RemainderHi) + b += 4 + + Put32(buf[b:], RemainderLo) + b += 4 + + return buf +} + +// Request Dri2WaitSBC +// size: 16 +type Dri2WaitSBCCookie struct { + *cookie +} + +func (c *Conn) Dri2WaitSBC(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) + return Dri2WaitSBCCookie{cookie} +} + +func (c *Conn) Dri2WaitSBCUnchecked(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) + return Dri2WaitSBCCookie{cookie} +} + +// Request reply for Dri2WaitSBC +// size: 32 +type Dri2WaitSBCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request Dri2WaitSBC +func (cook Dri2WaitSBCCookie) Reply() (*Dri2WaitSBCReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return dri2WaitSBCReply(buf), nil +} + +// Read reply into structure from buffer for Dri2WaitSBC +func dri2WaitSBCReply(buf []byte) *Dri2WaitSBCReply { + v := new(Dri2WaitSBCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = Get32(buf[b:]) + b += 4 + + v.UstLo = Get32(buf[b:]) + b += 4 + + v.MscHi = Get32(buf[b:]) + b += 4 + + v.MscLo = Get32(buf[b:]) + b += 4 + + v.SbcHi = Get32(buf[b:]) + b += 4 + + v.SbcLo = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Dri2WaitSBCCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2WaitSBC +func (c *Conn) dri2WaitSBCRequest(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], TargetSbcHi) + b += 4 + + Put32(buf[b:], TargetSbcLo) + b += 4 + + return buf +} + +// Request Dri2SwapInterval +// size: 12 +type Dri2SwapIntervalCookie struct { + *cookie +} + +// Write request to wire for Dri2SwapInterval +func (c *Conn) Dri2SwapInterval(Drawable Id, Interval uint32) Dri2SwapIntervalCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) + return Dri2SwapIntervalCookie{cookie} +} + +func (c *Conn) Dri2SwapIntervalChecked(Drawable Id, Interval uint32) Dri2SwapIntervalCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) + return Dri2SwapIntervalCookie{cookie} +} + +func (cook Dri2SwapIntervalCookie) Check() error { + return cook.check() +} + +// Write request to wire for Dri2SwapInterval +func (c *Conn) dri2SwapIntervalRequest(Drawable Id, Interval uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["DRI2"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], Interval) + b += 4 + + return buf +} diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go new file mode 100644 index 0000000..d9f52c1 --- /dev/null +++ b/nexgb/auto_ge.go @@ -0,0 +1,125 @@ +package xgb + +/* + This file was generated by ge.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Request GeQueryVersion +// size: 8 +type GeQueryVersionCookie struct { + *cookie +} + +func (c *Conn) GeQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return GeQueryVersionCookie{cookie} +} + +func (c *Conn) GeQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return GeQueryVersionCookie{cookie} +} + +// Request reply for GeQueryVersion +// size: 32 +type GeQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request GeQueryVersion +func (cook GeQueryVersionCookie) Reply() (*GeQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return geQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for GeQueryVersion +func geQueryVersionReply(buf []byte) *GeQueryVersionReply { + v := new(GeQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +func (cook GeQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for GeQueryVersion +func (c *Conn) geQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GENERIC EVENT EXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], ClientMajorVersion) + b += 2 + + Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go new file mode 100644 index 0000000..4b6b2c5 --- /dev/null +++ b/nexgb/auto_glx.go @@ -0,0 +1,9356 @@ +package xgb + +/* + This file was generated by glx.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +const ( + GlxPbcetDamaged = 32791 + GlxPbcetSaved = 32792 +) + +const ( + GlxPbcdtWindow = 32793 + GlxPbcdtPbuffer = 32794 +) + +const ( + GlxGcGlCurrentBit = 1 + GlxGcGlPointBit = 2 + GlxGcGlLineBit = 4 + GlxGcGlPolygonBit = 8 + GlxGcGlPolygonStippleBit = 16 + GlxGcGlPixelModeBit = 32 + GlxGcGlLightingBit = 64 + GlxGcGlFogBit = 128 + GlxGcGlDepthBufferBit = 256 + GlxGcGlAccumBufferBit = 512 + GlxGcGlStencilBufferBit = 1024 + GlxGcGlViewportBit = 2048 + GlxGcGlTransformBit = 4096 + GlxGcGlEnableBit = 8192 + GlxGcGlColorBufferBit = 16384 + GlxGcGlHintBit = 32768 + GlxGcGlEvalBit = 65536 + GlxGcGlListBit = 131072 + GlxGcGlTextureBit = 262144 + GlxGcGlScissorBit = 524288 + GlxGcGlAllAttribBits = 16777215 +) + +const ( + GlxRmGlRender = 7168 + GlxRmGlFeedback = 7169 + GlxRmGlSelect = 7170 +) + +// Skipping resource definition of 'Pixmap' + +// Skipping resource definition of 'Context' + +// Skipping resource definition of 'Pbuffer' + +// Skipping resource definition of 'Window' + +// Skipping resource definition of 'Fbconfig' + +// Skipping resource definition of 'Drawable' + +type GlxFloat32 float64 + +type GlxFloat64 float64 + +type GlxBool32 uint32 + +type GlxContextTag uint32 + +// Event definition GlxPbufferClobber (0) +// Size: 32 + +const GlxPbufferClobber = 0 + +type GlxPbufferClobberEvent struct { + Sequence uint16 + // padding: 1 bytes + EventType uint16 + DrawType uint16 + Drawable Id + BMask uint32 + AuxBuffer uint16 + X uint16 + Y uint16 + Width uint16 + Height uint16 + Count uint16 + // padding: 4 bytes +} + +// Event read GlxPbufferClobber +func NewGlxPbufferClobberEvent(buf []byte) Event { + v := GlxPbufferClobberEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.EventType = Get16(buf[b:]) + b += 2 + + v.DrawType = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.BMask = Get32(buf[b:]) + b += 4 + + v.AuxBuffer = Get16(buf[b:]) + b += 2 + + v.X = Get16(buf[b:]) + b += 2 + + v.Y = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Count = Get16(buf[b:]) + b += 2 + + b += 4 // padding + + return v +} + +// Event write GlxPbufferClobber +func (v GlxPbufferClobberEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put16(buf[b:], v.EventType) + b += 2 + + Put16(buf[b:], v.DrawType) + b += 2 + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put32(buf[b:], v.BMask) + b += 4 + + Put16(buf[b:], v.AuxBuffer) + b += 2 + + Put16(buf[b:], v.X) + b += 2 + + Put16(buf[b:], v.Y) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put16(buf[b:], v.Count) + b += 2 + + b += 4 // padding + + return buf +} + +func (v GlxPbufferClobberEvent) ImplementsEvent() {} + +func (v GlxPbufferClobberEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v GlxPbufferClobberEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("EventType: %d", v.EventType)) + fieldVals = append(fieldVals, sprintf("DrawType: %d", v.DrawType)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("BMask: %d", v.BMask)) + fieldVals = append(fieldVals, sprintf("AuxBuffer: %d", v.AuxBuffer)) + fieldVals = append(fieldVals, sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + return "GlxPbufferClobber {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewGlxPbufferClobberEvent +} + +// Error definition GlxGeneric (-1) +// Size: 32 + +const BadGlxGeneric = -1 + +type GlxGenericError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 21 bytes +} + +// Error read GlxGeneric +func NewGlxGenericError(buf []byte) Error { + v := GlxGenericError{} + v.NiceName = "GlxGeneric" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.BadValue = Get32(buf[b:]) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 21 // padding + + return v +} + +func (err GlxGenericError) ImplementsError() {} + +func (err GlxGenericError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxGenericError) BadId() Id { + return 0 +} + +func (err GlxGenericError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxGeneric {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[-1] = NewGlxGenericError +} + +// ErrorCopy definition GlxBadContext (0) + +const BadGlxBadContext = 0 + +type GlxBadContextError GlxGenericError + +func NewGlxBadContextError(buf []byte) Error { + v := GlxBadContextError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadContext" + return v +} + +func (err GlxBadContextError) ImplementsError() {} + +func (err GlxBadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadContextError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadContextError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadContext {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewGlxBadContextError +} + +// ErrorCopy definition GlxBadContextState (1) + +const BadGlxBadContextState = 1 + +type GlxBadContextStateError GlxGenericError + +func NewGlxBadContextStateError(buf []byte) Error { + v := GlxBadContextStateError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadContextState" + return v +} + +func (err GlxBadContextStateError) ImplementsError() {} + +func (err GlxBadContextStateError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadContextStateError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadContextStateError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadContextState {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewGlxBadContextStateError +} + +// ErrorCopy definition GlxBadDrawable (2) + +const BadGlxBadDrawable = 2 + +type GlxBadDrawableError GlxGenericError + +func NewGlxBadDrawableError(buf []byte) Error { + v := GlxBadDrawableError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadDrawable" + return v +} + +func (err GlxBadDrawableError) ImplementsError() {} + +func (err GlxBadDrawableError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadDrawableError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadDrawable {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewGlxBadDrawableError +} + +// ErrorCopy definition GlxBadPixmap (3) + +const BadGlxBadPixmap = 3 + +type GlxBadPixmapError GlxGenericError + +func NewGlxBadPixmapError(buf []byte) Error { + v := GlxBadPixmapError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadPixmap" + return v +} + +func (err GlxBadPixmapError) ImplementsError() {} + +func (err GlxBadPixmapError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadPixmapError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadPixmapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadPixmap {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[3] = NewGlxBadPixmapError +} + +// ErrorCopy definition GlxBadContextTag (4) + +const BadGlxBadContextTag = 4 + +type GlxBadContextTagError GlxGenericError + +func NewGlxBadContextTagError(buf []byte) Error { + v := GlxBadContextTagError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadContextTag" + return v +} + +func (err GlxBadContextTagError) ImplementsError() {} + +func (err GlxBadContextTagError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadContextTagError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadContextTagError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadContextTag {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[4] = NewGlxBadContextTagError +} + +// ErrorCopy definition GlxBadCurrentWindow (5) + +const BadGlxBadCurrentWindow = 5 + +type GlxBadCurrentWindowError GlxGenericError + +func NewGlxBadCurrentWindowError(buf []byte) Error { + v := GlxBadCurrentWindowError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadCurrentWindow" + return v +} + +func (err GlxBadCurrentWindowError) ImplementsError() {} + +func (err GlxBadCurrentWindowError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadCurrentWindowError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadCurrentWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadCurrentWindow {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[5] = NewGlxBadCurrentWindowError +} + +// ErrorCopy definition GlxBadRenderRequest (6) + +const BadGlxBadRenderRequest = 6 + +type GlxBadRenderRequestError GlxGenericError + +func NewGlxBadRenderRequestError(buf []byte) Error { + v := GlxBadRenderRequestError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadRenderRequest" + return v +} + +func (err GlxBadRenderRequestError) ImplementsError() {} + +func (err GlxBadRenderRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadRenderRequestError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadRenderRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadRenderRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[6] = NewGlxBadRenderRequestError +} + +// ErrorCopy definition GlxBadLargeRequest (7) + +const BadGlxBadLargeRequest = 7 + +type GlxBadLargeRequestError GlxGenericError + +func NewGlxBadLargeRequestError(buf []byte) Error { + v := GlxBadLargeRequestError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadLargeRequest" + return v +} + +func (err GlxBadLargeRequestError) ImplementsError() {} + +func (err GlxBadLargeRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadLargeRequestError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadLargeRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadLargeRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[7] = NewGlxBadLargeRequestError +} + +// ErrorCopy definition GlxUnsupportedPrivateRequest (8) + +const BadGlxUnsupportedPrivateRequest = 8 + +type GlxUnsupportedPrivateRequestError GlxGenericError + +func NewGlxUnsupportedPrivateRequestError(buf []byte) Error { + v := GlxUnsupportedPrivateRequestError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxUnsupportedPrivateRequest" + return v +} + +func (err GlxUnsupportedPrivateRequestError) ImplementsError() {} + +func (err GlxUnsupportedPrivateRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxUnsupportedPrivateRequestError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxUnsupportedPrivateRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxUnsupportedPrivateRequest {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[8] = NewGlxUnsupportedPrivateRequestError +} + +// ErrorCopy definition GlxBadFBConfig (9) + +const BadGlxBadFBConfig = 9 + +type GlxBadFBConfigError GlxGenericError + +func NewGlxBadFBConfigError(buf []byte) Error { + v := GlxBadFBConfigError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadFBConfig" + return v +} + +func (err GlxBadFBConfigError) ImplementsError() {} + +func (err GlxBadFBConfigError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadFBConfigError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadFBConfigError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadFBConfig {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[9] = NewGlxBadFBConfigError +} + +// ErrorCopy definition GlxBadPbuffer (10) + +const BadGlxBadPbuffer = 10 + +type GlxBadPbufferError GlxGenericError + +func NewGlxBadPbufferError(buf []byte) Error { + v := GlxBadPbufferError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadPbuffer" + return v +} + +func (err GlxBadPbufferError) ImplementsError() {} + +func (err GlxBadPbufferError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadPbufferError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadPbufferError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadPbuffer {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[10] = NewGlxBadPbufferError +} + +// ErrorCopy definition GlxBadCurrentDrawable (11) + +const BadGlxBadCurrentDrawable = 11 + +type GlxBadCurrentDrawableError GlxGenericError + +func NewGlxBadCurrentDrawableError(buf []byte) Error { + v := GlxBadCurrentDrawableError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadCurrentDrawable" + return v +} + +func (err GlxBadCurrentDrawableError) ImplementsError() {} + +func (err GlxBadCurrentDrawableError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadCurrentDrawableError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadCurrentDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadCurrentDrawable {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[11] = NewGlxBadCurrentDrawableError +} + +// ErrorCopy definition GlxBadWindow (12) + +const BadGlxBadWindow = 12 + +type GlxBadWindowError GlxGenericError + +func NewGlxBadWindowError(buf []byte) Error { + v := GlxBadWindowError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxBadWindow" + return v +} + +func (err GlxBadWindowError) ImplementsError() {} + +func (err GlxBadWindowError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxBadWindowError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxBadWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxBadWindow {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[12] = NewGlxBadWindowError +} + +// ErrorCopy definition GlxGLXBadProfileARB (13) + +const BadGlxGLXBadProfileARB = 13 + +type GlxGLXBadProfileARBError GlxGenericError + +func NewGlxGLXBadProfileARBError(buf []byte) Error { + v := GlxGLXBadProfileARBError(NewGlxGenericError(buf).(GlxGenericError)) + v.NiceName = "GlxGLXBadProfileARB" + return v +} + +func (err GlxGLXBadProfileARBError) ImplementsError() {} + +func (err GlxGLXBadProfileARBError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlxGLXBadProfileARBError) BadId() Id { + return Id(err.BadValue) +} + +func (err GlxGLXBadProfileARBError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGlxGLXBadProfileARB {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[13] = NewGlxGLXBadProfileARBError +} + +// Request GlxRender +// size: pad((8 + pad((len(Data) * 1)))) +type GlxRenderCookie struct { + *cookie +} + +// Write request to wire for GlxRender +func (c *Conn) GlxRender(ContextTag GlxContextTag, Data []byte) GlxRenderCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxRenderRequest(ContextTag, Data), cookie) + return GlxRenderCookie{cookie} +} + +func (c *Conn) GlxRenderChecked(ContextTag GlxContextTag, Data []byte) GlxRenderCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxRenderRequest(ContextTag, Data), cookie) + return GlxRenderCookie{cookie} +} + +func (cook GlxRenderCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxRender +func (c *Conn) glxRenderRequest(ContextTag GlxContextTag, Data []byte) []byte { + size := pad((8 + pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + return buf +} + +// Request GlxRenderLarge +// size: pad((16 + pad((int(DataLen) * 1)))) +type GlxRenderLargeCookie struct { + *cookie +} + +// Write request to wire for GlxRenderLarge +func (c *Conn) GlxRenderLarge(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) GlxRenderLargeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxRenderLargeRequest(ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return GlxRenderLargeCookie{cookie} +} + +func (c *Conn) GlxRenderLargeChecked(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) GlxRenderLargeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxRenderLargeRequest(ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return GlxRenderLargeCookie{cookie} +} + +func (cook GlxRenderLargeCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxRenderLarge +func (c *Conn) glxRenderLargeRequest(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { + size := pad((16 + pad((int(DataLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put16(buf[b:], RequestNum) + b += 2 + + Put16(buf[b:], RequestTotal) + b += 2 + + Put32(buf[b:], DataLen) + b += 4 + + copy(buf[b:], Data[:DataLen]) + b += pad(int(DataLen)) + + return buf +} + +// Request GlxCreateContext +// size: 24 +type GlxCreateContextCookie struct { + *cookie +} + +// Write request to wire for GlxCreateContext +func (c *Conn) GlxCreateContext(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) GlxCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) + return GlxCreateContextCookie{cookie} +} + +func (c *Conn) GlxCreateContextChecked(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) GlxCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) + return GlxCreateContextCookie{cookie} +} + +func (cook GlxCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreateContext +func (c *Conn) glxCreateContextRequest(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], uint32(Visual)) + b += 4 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request GlxDestroyContext +// size: 8 +type GlxDestroyContextCookie struct { + *cookie +} + +// Write request to wire for GlxDestroyContext +func (c *Conn) GlxDestroyContext(Context Id) GlxDestroyContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDestroyContextRequest(Context), cookie) + return GlxDestroyContextCookie{cookie} +} + +func (c *Conn) GlxDestroyContextChecked(Context Id) GlxDestroyContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDestroyContextRequest(Context), cookie) + return GlxDestroyContextCookie{cookie} +} + +func (cook GlxDestroyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDestroyContext +func (c *Conn) glxDestroyContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request GlxMakeCurrent +// size: 16 +type GlxMakeCurrentCookie struct { + *cookie +} + +func (c *Conn) GlxMakeCurrent(Drawable Id, Context Id, OldContextTag GlxContextTag) GlxMakeCurrentCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) + return GlxMakeCurrentCookie{cookie} +} + +func (c *Conn) GlxMakeCurrentUnchecked(Drawable Id, Context Id, OldContextTag GlxContextTag) GlxMakeCurrentCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) + return GlxMakeCurrentCookie{cookie} +} + +// Request reply for GlxMakeCurrent +// size: 32 +type GlxMakeCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextTag GlxContextTag + // padding: 20 bytes +} + +// Waits and reads reply data from request GlxMakeCurrent +func (cook GlxMakeCurrentCookie) Reply() (*GlxMakeCurrentReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxMakeCurrentReply(buf), nil +} + +// Read reply into structure from buffer for GlxMakeCurrent +func glxMakeCurrentReply(buf []byte) *GlxMakeCurrentReply { + v := new(GlxMakeCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = GlxContextTag(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +func (cook GlxMakeCurrentCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxMakeCurrent +func (c *Conn) glxMakeCurrentRequest(Drawable Id, Context Id, OldContextTag GlxContextTag) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + return buf +} + +// Request GlxIsDirect +// size: 8 +type GlxIsDirectCookie struct { + *cookie +} + +func (c *Conn) GlxIsDirect(Context Id) GlxIsDirectCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxIsDirectRequest(Context), cookie) + return GlxIsDirectCookie{cookie} +} + +func (c *Conn) GlxIsDirectUnchecked(Context Id) GlxIsDirectCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxIsDirectRequest(Context), cookie) + return GlxIsDirectCookie{cookie} +} + +// Request reply for GlxIsDirect +// size: 32 +type GlxIsDirectReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IsDirect bool + // padding: 23 bytes +} + +// Waits and reads reply data from request GlxIsDirect +func (cook GlxIsDirectCookie) Reply() (*GlxIsDirectReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxIsDirectReply(buf), nil +} + +// Read reply into structure from buffer for GlxIsDirect +func glxIsDirectReply(buf []byte) *GlxIsDirectReply { + v := new(GlxIsDirectReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.IsDirect = true + } else { + v.IsDirect = false + } + b += 1 + + b += 23 // padding + + return v +} + +func (cook GlxIsDirectCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxIsDirect +func (c *Conn) glxIsDirectRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request GlxQueryVersion +// size: 12 +type GlxQueryVersionCookie struct { + *cookie +} + +func (c *Conn) GlxQueryVersion(MajorVersion uint32, MinorVersion uint32) GlxQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return GlxQueryVersionCookie{cookie} +} + +func (c *Conn) GlxQueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) GlxQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return GlxQueryVersionCookie{cookie} +} + +// Request reply for GlxQueryVersion +// size: 32 +type GlxQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request GlxQueryVersion +func (cook GlxQueryVersionCookie) Reply() (*GlxQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for GlxQueryVersion +func glxQueryVersionReply(buf []byte) *GlxQueryVersionReply { + v := new(GlxQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook GlxQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxQueryVersion +func (c *Conn) glxQueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request GlxWaitGL +// size: 8 +type GlxWaitGLCookie struct { + *cookie +} + +// Write request to wire for GlxWaitGL +func (c *Conn) GlxWaitGL(ContextTag GlxContextTag) GlxWaitGLCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxWaitGLRequest(ContextTag), cookie) + return GlxWaitGLCookie{cookie} +} + +func (c *Conn) GlxWaitGLChecked(ContextTag GlxContextTag) GlxWaitGLCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxWaitGLRequest(ContextTag), cookie) + return GlxWaitGLCookie{cookie} +} + +func (cook GlxWaitGLCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxWaitGL +func (c *Conn) glxWaitGLRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxWaitX +// size: 8 +type GlxWaitXCookie struct { + *cookie +} + +// Write request to wire for GlxWaitX +func (c *Conn) GlxWaitX(ContextTag GlxContextTag) GlxWaitXCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxWaitXRequest(ContextTag), cookie) + return GlxWaitXCookie{cookie} +} + +func (c *Conn) GlxWaitXChecked(ContextTag GlxContextTag) GlxWaitXCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxWaitXRequest(ContextTag), cookie) + return GlxWaitXCookie{cookie} +} + +func (cook GlxWaitXCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxWaitX +func (c *Conn) glxWaitXRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxCopyContext +// size: 20 +type GlxCopyContextCookie struct { + *cookie +} + +// Write request to wire for GlxCopyContext +func (c *Conn) GlxCopyContext(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) + return GlxCopyContextCookie{cookie} +} + +func (c *Conn) GlxCopyContextChecked(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) + return GlxCopyContextCookie{cookie} +} + +func (cook GlxCopyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCopyContext +func (c *Conn) glxCopyContextRequest(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put32(buf[b:], uint32(Dest)) + b += 4 + + Put32(buf[b:], Mask) + b += 4 + + Put32(buf[b:], uint32(SrcContextTag)) + b += 4 + + return buf +} + +// Request GlxSwapBuffers +// size: 12 +type GlxSwapBuffersCookie struct { + *cookie +} + +// Write request to wire for GlxSwapBuffers +func (c *Conn) GlxSwapBuffers(ContextTag GlxContextTag, Drawable Id) GlxSwapBuffersCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) + return GlxSwapBuffersCookie{cookie} +} + +func (c *Conn) GlxSwapBuffersChecked(ContextTag GlxContextTag, Drawable Id) GlxSwapBuffersCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) + return GlxSwapBuffersCookie{cookie} +} + +func (cook GlxSwapBuffersCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxSwapBuffers +func (c *Conn) glxSwapBuffersRequest(ContextTag GlxContextTag, Drawable Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request GlxUseXFont +// size: 24 +type GlxUseXFontCookie struct { + *cookie +} + +// Write request to wire for GlxUseXFont +func (c *Conn) GlxUseXFont(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) + return GlxUseXFontCookie{cookie} +} + +func (c *Conn) GlxUseXFontChecked(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) + return GlxUseXFontCookie{cookie} +} + +func (cook GlxUseXFontCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxUseXFont +func (c *Conn) glxUseXFontRequest(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Font)) + b += 4 + + Put32(buf[b:], First) + b += 4 + + Put32(buf[b:], Count) + b += 4 + + Put32(buf[b:], ListBase) + b += 4 + + return buf +} + +// Request GlxCreateGLXPixmap +// size: 20 +type GlxCreateGLXPixmapCookie struct { + *cookie +} + +// Write request to wire for GlxCreateGLXPixmap +func (c *Conn) GlxCreateGLXPixmap(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) GlxCreateGLXPixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) + return GlxCreateGLXPixmapCookie{cookie} +} + +func (c *Conn) GlxCreateGLXPixmapChecked(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) GlxCreateGLXPixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) + return GlxCreateGLXPixmapCookie{cookie} +} + +func (cook GlxCreateGLXPixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreateGLXPixmap +func (c *Conn) glxCreateGLXPixmapRequest(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Visual)) + b += 4 + + Put32(buf[b:], uint32(Pixmap)) + b += 4 + + Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request GlxGetVisualConfigs +// size: 8 +type GlxGetVisualConfigsCookie struct { + *cookie +} + +func (c *Conn) GlxGetVisualConfigs(Screen uint32) GlxGetVisualConfigsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetVisualConfigsRequest(Screen), cookie) + return GlxGetVisualConfigsCookie{cookie} +} + +func (c *Conn) GlxGetVisualConfigsUnchecked(Screen uint32) GlxGetVisualConfigsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetVisualConfigsRequest(Screen), cookie) + return GlxGetVisualConfigsCookie{cookie} +} + +// Request reply for GlxGetVisualConfigs +// size: (32 + pad((int(Length) * 4))) +type GlxGetVisualConfigsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumVisuals uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GlxGetVisualConfigs +func (cook GlxGetVisualConfigsCookie) Reply() (*GlxGetVisualConfigsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetVisualConfigsReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetVisualConfigs +func glxGetVisualConfigsReply(buf []byte) *GlxGetVisualConfigsReply { + v := new(GlxGetVisualConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumVisuals = Get32(buf[b:]) + b += 4 + + v.NumProperties = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetVisualConfigsCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetVisualConfigs +func (c *Conn) glxGetVisualConfigsRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request GlxDestroyGLXPixmap +// size: 8 +type GlxDestroyGLXPixmapCookie struct { + *cookie +} + +// Write request to wire for GlxDestroyGLXPixmap +func (c *Conn) GlxDestroyGLXPixmap(GlxPixmap Id) GlxDestroyGLXPixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) + return GlxDestroyGLXPixmapCookie{cookie} +} + +func (c *Conn) GlxDestroyGLXPixmapChecked(GlxPixmap Id) GlxDestroyGLXPixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) + return GlxDestroyGLXPixmapCookie{cookie} +} + +func (cook GlxDestroyGLXPixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDestroyGLXPixmap +func (c *Conn) glxDestroyGLXPixmapRequest(GlxPixmap Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request GlxVendorPrivate +// size: pad((12 + pad((len(Data) * 1)))) +type GlxVendorPrivateCookie struct { + *cookie +} + +// Write request to wire for GlxVendorPrivate +func (c *Conn) GlxVendorPrivate(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxVendorPrivateRequest(VendorCode, ContextTag, Data), cookie) + return GlxVendorPrivateCookie{cookie} +} + +func (c *Conn) GlxVendorPrivateChecked(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxVendorPrivateRequest(VendorCode, ContextTag, Data), cookie) + return GlxVendorPrivateCookie{cookie} +} + +func (cook GlxVendorPrivateCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxVendorPrivate +func (c *Conn) glxVendorPrivateRequest(VendorCode uint32, ContextTag GlxContextTag, Data []byte) []byte { + size := pad((12 + pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], VendorCode) + b += 4 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + return buf +} + +// Request GlxVendorPrivateWithReply +// size: pad((12 + pad((len(Data) * 1)))) +type GlxVendorPrivateWithReplyCookie struct { + *cookie +} + +func (c *Conn) GlxVendorPrivateWithReply(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateWithReplyCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxVendorPrivateWithReplyRequest(VendorCode, ContextTag, Data), cookie) + return GlxVendorPrivateWithReplyCookie{cookie} +} + +func (c *Conn) GlxVendorPrivateWithReplyUnchecked(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateWithReplyCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxVendorPrivateWithReplyRequest(VendorCode, ContextTag, Data), cookie) + return GlxVendorPrivateWithReplyCookie{cookie} +} + +// Request reply for GlxVendorPrivateWithReply +// size: (36 + pad(((int(Length) * 4) * 1))) +type GlxVendorPrivateWithReplyReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Retval uint32 + Data1 []byte // size: 24 + Data2 []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxVendorPrivateWithReply +func (cook GlxVendorPrivateWithReplyCookie) Reply() (*GlxVendorPrivateWithReplyReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxVendorPrivateWithReplyReply(buf), nil +} + +// Read reply into structure from buffer for GlxVendorPrivateWithReply +func glxVendorPrivateWithReplyReply(buf []byte) *GlxVendorPrivateWithReplyReply { + v := new(GlxVendorPrivateWithReplyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Retval = Get32(buf[b:]) + b += 4 + + v.Data1 = make([]byte, 24) + copy(v.Data1[:24], buf[b:]) + b += pad(int(24)) + + v.Data2 = make([]byte, (int(v.Length) * 4)) + copy(v.Data2[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxVendorPrivateWithReplyCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxVendorPrivateWithReply +func (c *Conn) glxVendorPrivateWithReplyRequest(VendorCode uint32, ContextTag GlxContextTag, Data []byte) []byte { + size := pad((12 + pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], VendorCode) + b += 4 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + return buf +} + +// Request GlxQueryExtensionsString +// size: 8 +type GlxQueryExtensionsStringCookie struct { + *cookie +} + +func (c *Conn) GlxQueryExtensionsString(Screen uint32) GlxQueryExtensionsStringCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxQueryExtensionsStringRequest(Screen), cookie) + return GlxQueryExtensionsStringCookie{cookie} +} + +func (c *Conn) GlxQueryExtensionsStringUnchecked(Screen uint32) GlxQueryExtensionsStringCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxQueryExtensionsStringRequest(Screen), cookie) + return GlxQueryExtensionsStringCookie{cookie} +} + +// Request reply for GlxQueryExtensionsString +// size: 32 +type GlxQueryExtensionsStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request GlxQueryExtensionsString +func (cook GlxQueryExtensionsStringCookie) Reply() (*GlxQueryExtensionsStringReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxQueryExtensionsStringReply(buf), nil +} + +// Read reply into structure from buffer for GlxQueryExtensionsString +func glxQueryExtensionsStringReply(buf []byte) *GlxQueryExtensionsStringReply { + v := new(GlxQueryExtensionsStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook GlxQueryExtensionsStringCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxQueryExtensionsString +func (c *Conn) glxQueryExtensionsStringRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request GlxQueryServerString +// size: 12 +type GlxQueryServerStringCookie struct { + *cookie +} + +func (c *Conn) GlxQueryServerString(Screen uint32, Name uint32) GlxQueryServerStringCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxQueryServerStringRequest(Screen, Name), cookie) + return GlxQueryServerStringCookie{cookie} +} + +func (c *Conn) GlxQueryServerStringUnchecked(Screen uint32, Name uint32) GlxQueryServerStringCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxQueryServerStringRequest(Screen, Name), cookie) + return GlxQueryServerStringCookie{cookie} +} + +// Request reply for GlxQueryServerString +// size: (32 + pad((int(StrLen) * 1))) +type GlxQueryServerStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + StrLen uint32 + // padding: 16 bytes + String string // size: pad((int(StrLen) * 1)) +} + +// Waits and reads reply data from request GlxQueryServerString +func (cook GlxQueryServerStringCookie) Reply() (*GlxQueryServerStringReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxQueryServerStringReply(buf), nil +} + +// Read reply into structure from buffer for GlxQueryServerString +func glxQueryServerStringReply(buf []byte) *GlxQueryServerStringReply { + v := new(GlxQueryServerStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.StrLen = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.StrLen) + copy(byteString[:v.StrLen], buf[b:]) + v.String = string(byteString) + b += pad(int(v.StrLen)) + } + + return v +} + +func (cook GlxQueryServerStringCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxQueryServerString +func (c *Conn) glxQueryServerStringRequest(Screen uint32, Name uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Name) + b += 4 + + return buf +} + +// Request GlxClientInfo +// size: pad((16 + pad((int(StrLen) * 1)))) +type GlxClientInfoCookie struct { + *cookie +} + +// Write request to wire for GlxClientInfo +func (c *Conn) GlxClientInfo(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) GlxClientInfoCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxClientInfoRequest(MajorVersion, MinorVersion, StrLen, String), cookie) + return GlxClientInfoCookie{cookie} +} + +func (c *Conn) GlxClientInfoChecked(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) GlxClientInfoCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxClientInfoRequest(MajorVersion, MinorVersion, StrLen, String), cookie) + return GlxClientInfoCookie{cookie} +} + +func (cook GlxClientInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxClientInfo +func (c *Conn) glxClientInfoRequest(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { + size := pad((16 + pad((int(StrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + Put32(buf[b:], StrLen) + b += 4 + + copy(buf[b:], String[:StrLen]) + b += pad(int(StrLen)) + + return buf +} + +// Request GlxGetFBConfigs +// size: 8 +type GlxGetFBConfigsCookie struct { + *cookie +} + +func (c *Conn) GlxGetFBConfigs(Screen uint32) GlxGetFBConfigsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetFBConfigsRequest(Screen), cookie) + return GlxGetFBConfigsCookie{cookie} +} + +func (c *Conn) GlxGetFBConfigsUnchecked(Screen uint32) GlxGetFBConfigsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetFBConfigsRequest(Screen), cookie) + return GlxGetFBConfigsCookie{cookie} +} + +// Request reply for GlxGetFBConfigs +// size: (32 + pad((int(Length) * 4))) +type GlxGetFBConfigsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFbConfigs uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GlxGetFBConfigs +func (cook GlxGetFBConfigsCookie) Reply() (*GlxGetFBConfigsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetFBConfigsReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetFBConfigs +func glxGetFBConfigsReply(buf []byte) *GlxGetFBConfigsReply { + v := new(GlxGetFBConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFbConfigs = Get32(buf[b:]) + b += 4 + + v.NumProperties = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetFBConfigsCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetFBConfigs +func (c *Conn) glxGetFBConfigsRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request GlxCreatePixmap +// size: pad((24 + pad(((int(NumAttribs) * 2) * 4)))) +type GlxCreatePixmapCookie struct { + *cookie +} + +// Write request to wire for GlxCreatePixmap +func (c *Conn) GlxCreatePixmap(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return GlxCreatePixmapCookie{cookie} +} + +func (c *Conn) GlxCreatePixmapChecked(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return GlxCreatePixmapCookie{cookie} +} + +func (cook GlxCreatePixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreatePixmap +func (c *Conn) glxCreatePixmapRequest(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) []byte { + size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + Put32(buf[b:], uint32(Pixmap)) + b += 4 + + Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + Put32(buf[b:], Attribs[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxDestroyPixmap +// size: 8 +type GlxDestroyPixmapCookie struct { + *cookie +} + +// Write request to wire for GlxDestroyPixmap +func (c *Conn) GlxDestroyPixmap(GlxPixmap Id) GlxDestroyPixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) + return GlxDestroyPixmapCookie{cookie} +} + +func (c *Conn) GlxDestroyPixmapChecked(GlxPixmap Id) GlxDestroyPixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) + return GlxDestroyPixmapCookie{cookie} +} + +func (cook GlxDestroyPixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDestroyPixmap +func (c *Conn) glxDestroyPixmapRequest(GlxPixmap Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request GlxCreateNewContext +// size: 28 +type GlxCreateNewContextCookie struct { + *cookie +} + +// Write request to wire for GlxCreateNewContext +func (c *Conn) GlxCreateNewContext(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) GlxCreateNewContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) + return GlxCreateNewContextCookie{cookie} +} + +func (c *Conn) GlxCreateNewContextChecked(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) GlxCreateNewContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) + return GlxCreateNewContextCookie{cookie} +} + +func (cook GlxCreateNewContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreateNewContext +func (c *Conn) glxCreateNewContextRequest(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], RenderType) + b += 4 + + Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request GlxQueryContext +// size: 8 +type GlxQueryContextCookie struct { + *cookie +} + +func (c *Conn) GlxQueryContext(Context Id) GlxQueryContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxQueryContextRequest(Context), cookie) + return GlxQueryContextCookie{cookie} +} + +func (c *Conn) GlxQueryContextUnchecked(Context Id) GlxQueryContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxQueryContextRequest(Context), cookie) + return GlxQueryContextCookie{cookie} +} + +// Request reply for GlxQueryContext +// size: (32 + pad(((int(NumAttribs) * 2) * 4))) +type GlxQueryContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: pad(((int(NumAttribs) * 2) * 4)) +} + +// Waits and reads reply data from request GlxQueryContext +func (cook GlxQueryContextCookie) Reply() (*GlxQueryContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxQueryContextReply(buf), nil +} + +// Read reply into structure from buffer for GlxQueryContext +func glxQueryContextReply(buf []byte) *GlxQueryContextReply { + v := new(GlxQueryContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxQueryContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxQueryContext +func (c *Conn) glxQueryContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request GlxMakeContextCurrent +// size: 20 +type GlxMakeContextCurrentCookie struct { + *cookie +} + +func (c *Conn) GlxMakeContextCurrent(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) GlxMakeContextCurrentCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) + return GlxMakeContextCurrentCookie{cookie} +} + +func (c *Conn) GlxMakeContextCurrentUnchecked(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) GlxMakeContextCurrentCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) + return GlxMakeContextCurrentCookie{cookie} +} + +// Request reply for GlxMakeContextCurrent +// size: 32 +type GlxMakeContextCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextTag GlxContextTag + // padding: 20 bytes +} + +// Waits and reads reply data from request GlxMakeContextCurrent +func (cook GlxMakeContextCurrentCookie) Reply() (*GlxMakeContextCurrentReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxMakeContextCurrentReply(buf), nil +} + +// Read reply into structure from buffer for GlxMakeContextCurrent +func glxMakeContextCurrentReply(buf []byte) *GlxMakeContextCurrentReply { + v := new(GlxMakeContextCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = GlxContextTag(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +func (cook GlxMakeContextCurrentCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxMakeContextCurrent +func (c *Conn) glxMakeContextCurrentRequest(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(ReadDrawable)) + b += 4 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request GlxCreatePbuffer +// size: pad((20 + pad(((int(NumAttribs) * 2) * 4)))) +type GlxCreatePbufferCookie struct { + *cookie +} + +// Write request to wire for GlxCreatePbuffer +func (c *Conn) GlxCreatePbuffer(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) + return GlxCreatePbufferCookie{cookie} +} + +func (c *Conn) GlxCreatePbufferChecked(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) + return GlxCreatePbufferCookie{cookie} +} + +func (cook GlxCreatePbufferCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreatePbuffer +func (c *Conn) glxCreatePbufferRequest(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) []byte { + size := pad((20 + pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + Put32(buf[b:], uint32(Pbuffer)) + b += 4 + + Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + Put32(buf[b:], Attribs[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxDestroyPbuffer +// size: 8 +type GlxDestroyPbufferCookie struct { + *cookie +} + +// Write request to wire for GlxDestroyPbuffer +func (c *Conn) GlxDestroyPbuffer(Pbuffer Id) GlxDestroyPbufferCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) + return GlxDestroyPbufferCookie{cookie} +} + +func (c *Conn) GlxDestroyPbufferChecked(Pbuffer Id) GlxDestroyPbufferCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) + return GlxDestroyPbufferCookie{cookie} +} + +func (cook GlxDestroyPbufferCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDestroyPbuffer +func (c *Conn) glxDestroyPbufferRequest(Pbuffer Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Pbuffer)) + b += 4 + + return buf +} + +// Request GlxGetDrawableAttributes +// size: 8 +type GlxGetDrawableAttributesCookie struct { + *cookie +} + +func (c *Conn) GlxGetDrawableAttributes(Drawable Id) GlxGetDrawableAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) + return GlxGetDrawableAttributesCookie{cookie} +} + +func (c *Conn) GlxGetDrawableAttributesUnchecked(Drawable Id) GlxGetDrawableAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) + return GlxGetDrawableAttributesCookie{cookie} +} + +// Request reply for GlxGetDrawableAttributes +// size: (32 + pad(((int(NumAttribs) * 2) * 4))) +type GlxGetDrawableAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: pad(((int(NumAttribs) * 2) * 4)) +} + +// Waits and reads reply data from request GlxGetDrawableAttributes +func (cook GlxGetDrawableAttributesCookie) Reply() (*GlxGetDrawableAttributesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetDrawableAttributesReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetDrawableAttributes +func glxGetDrawableAttributesReply(buf []byte) *GlxGetDrawableAttributesReply { + v := new(GlxGetDrawableAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetDrawableAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetDrawableAttributes +func (c *Conn) glxGetDrawableAttributesRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request GlxChangeDrawableAttributes +// size: pad((12 + pad(((int(NumAttribs) * 2) * 4)))) +type GlxChangeDrawableAttributesCookie struct { + *cookie +} + +// Write request to wire for GlxChangeDrawableAttributes +func (c *Conn) GlxChangeDrawableAttributes(Drawable Id, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) + return GlxChangeDrawableAttributesCookie{cookie} +} + +func (c *Conn) GlxChangeDrawableAttributesChecked(Drawable Id, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) + return GlxChangeDrawableAttributesCookie{cookie} +} + +func (cook GlxChangeDrawableAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxChangeDrawableAttributes +func (c *Conn) glxChangeDrawableAttributesRequest(Drawable Id, NumAttribs uint32, Attribs []uint32) []byte { + size := pad((12 + pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + Put32(buf[b:], Attribs[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxCreateWindow +// size: pad((24 + pad(((int(NumAttribs) * 2) * 4)))) +type GlxCreateWindowCookie struct { + *cookie +} + +// Write request to wire for GlxCreateWindow +func (c *Conn) GlxCreateWindow(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) + return GlxCreateWindowCookie{cookie} +} + +func (c *Conn) GlxCreateWindowChecked(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) + return GlxCreateWindowCookie{cookie} +} + +func (cook GlxCreateWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreateWindow +func (c *Conn) glxCreateWindowRequest(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) []byte { + size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(GlxWindow)) + b += 4 + + Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + Put32(buf[b:], Attribs[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxDeleteWindow +// size: 8 +type GlxDeleteWindowCookie struct { + *cookie +} + +// Write request to wire for GlxDeleteWindow +func (c *Conn) GlxDeleteWindow(Glxwindow Id) GlxDeleteWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) + return GlxDeleteWindowCookie{cookie} +} + +func (c *Conn) GlxDeleteWindowChecked(Glxwindow Id) GlxDeleteWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) + return GlxDeleteWindowCookie{cookie} +} + +func (cook GlxDeleteWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDeleteWindow +func (c *Conn) glxDeleteWindowRequest(Glxwindow Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Glxwindow)) + b += 4 + + return buf +} + +// Request GlxSetClientInfoARB +// size: pad((((24 + pad(((int(NumVersions) * 2) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) +type GlxSetClientInfoARBCookie struct { + *cookie +} + +// Write request to wire for GlxSetClientInfoARB +func (c *Conn) GlxSetClientInfoARB(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfoARBCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxSetClientInfoARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return GlxSetClientInfoARBCookie{cookie} +} + +func (c *Conn) GlxSetClientInfoARBChecked(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfoARBCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxSetClientInfoARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return GlxSetClientInfoARBCookie{cookie} +} + +func (cook GlxSetClientInfoARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxSetClientInfoARB +func (c *Conn) glxSetClientInfoARBRequest(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := pad((((24 + pad(((int(NumVersions) * 2) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + Put32(buf[b:], NumVersions) + b += 4 + + Put32(buf[b:], GlStrLen) + b += 4 + + Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 2)); i++ { + Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += pad(int(GlxStrLen)) + + return buf +} + +// Request GlxCreateContextAttribsARB +// size: pad((28 + pad(((int(NumAttribs) * 2) * 4)))) +type GlxCreateContextAttribsARBCookie struct { + *cookie +} + +// Write request to wire for GlxCreateContextAttribsARB +func (c *Conn) GlxCreateContextAttribsARB(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return GlxCreateContextAttribsARBCookie{cookie} +} + +func (c *Conn) GlxCreateContextAttribsARBChecked(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return GlxCreateContextAttribsARBCookie{cookie} +} + +func (cook GlxCreateContextAttribsARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxCreateContextAttribsARB +func (c *Conn) glxCreateContextAttribsARBRequest(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { + size := pad((28 + pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + Put32(buf[b:], Attribs[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxSetClientInfo2ARB +// size: pad((((24 + pad(((int(NumVersions) * 3) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) +type GlxSetClientInfo2ARBCookie struct { + *cookie +} + +// Write request to wire for GlxSetClientInfo2ARB +func (c *Conn) GlxSetClientInfo2ARB(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfo2ARBCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxSetClientInfo2ARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return GlxSetClientInfo2ARBCookie{cookie} +} + +func (c *Conn) GlxSetClientInfo2ARBChecked(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfo2ARBCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxSetClientInfo2ARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return GlxSetClientInfo2ARBCookie{cookie} +} + +func (cook GlxSetClientInfo2ARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxSetClientInfo2ARB +func (c *Conn) glxSetClientInfo2ARBRequest(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := pad((((24 + pad(((int(NumVersions) * 3) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], MajorVersion) + b += 4 + + Put32(buf[b:], MinorVersion) + b += 4 + + Put32(buf[b:], NumVersions) + b += 4 + + Put32(buf[b:], GlStrLen) + b += 4 + + Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 3)); i++ { + Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += pad(int(GlxStrLen)) + + return buf +} + +// Request GlxNewList +// size: 16 +type GlxNewListCookie struct { + *cookie +} + +// Write request to wire for GlxNewList +func (c *Conn) GlxNewList(ContextTag GlxContextTag, List uint32, Mode uint32) GlxNewListCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxNewListRequest(ContextTag, List, Mode), cookie) + return GlxNewListCookie{cookie} +} + +func (c *Conn) GlxNewListChecked(ContextTag GlxContextTag, List uint32, Mode uint32) GlxNewListCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxNewListRequest(ContextTag, List, Mode), cookie) + return GlxNewListCookie{cookie} +} + +func (cook GlxNewListCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxNewList +func (c *Conn) glxNewListRequest(ContextTag GlxContextTag, List uint32, Mode uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 101 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], List) + b += 4 + + Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// Request GlxEndList +// size: 8 +type GlxEndListCookie struct { + *cookie +} + +// Write request to wire for GlxEndList +func (c *Conn) GlxEndList(ContextTag GlxContextTag) GlxEndListCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxEndListRequest(ContextTag), cookie) + return GlxEndListCookie{cookie} +} + +func (c *Conn) GlxEndListChecked(ContextTag GlxContextTag) GlxEndListCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxEndListRequest(ContextTag), cookie) + return GlxEndListCookie{cookie} +} + +func (cook GlxEndListCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxEndList +func (c *Conn) glxEndListRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 102 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxDeleteLists +// size: 16 +type GlxDeleteListsCookie struct { + *cookie +} + +// Write request to wire for GlxDeleteLists +func (c *Conn) GlxDeleteLists(ContextTag GlxContextTag, List uint32, Range int32) GlxDeleteListsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDeleteListsRequest(ContextTag, List, Range), cookie) + return GlxDeleteListsCookie{cookie} +} + +func (c *Conn) GlxDeleteListsChecked(ContextTag GlxContextTag, List uint32, Range int32) GlxDeleteListsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDeleteListsRequest(ContextTag, List, Range), cookie) + return GlxDeleteListsCookie{cookie} +} + +func (cook GlxDeleteListsCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDeleteLists +func (c *Conn) glxDeleteListsRequest(ContextTag GlxContextTag, List uint32, Range int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 103 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], List) + b += 4 + + Put32(buf[b:], uint32(Range)) + b += 4 + + return buf +} + +// Request GlxGenLists +// size: 12 +type GlxGenListsCookie struct { + *cookie +} + +func (c *Conn) GlxGenLists(ContextTag GlxContextTag, Range int32) GlxGenListsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGenListsRequest(ContextTag, Range), cookie) + return GlxGenListsCookie{cookie} +} + +func (c *Conn) GlxGenListsUnchecked(ContextTag GlxContextTag, Range int32) GlxGenListsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGenListsRequest(ContextTag, Range), cookie) + return GlxGenListsCookie{cookie} +} + +// Request reply for GlxGenLists +// size: 12 +type GlxGenListsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal uint32 +} + +// Waits and reads reply data from request GlxGenLists +func (cook GlxGenListsCookie) Reply() (*GlxGenListsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGenListsReply(buf), nil +} + +// Read reply into structure from buffer for GlxGenLists +func glxGenListsReply(buf []byte) *GlxGenListsReply { + v := new(GlxGenListsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook GlxGenListsCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGenLists +func (c *Conn) glxGenListsRequest(ContextTag GlxContextTag, Range int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 104 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Range)) + b += 4 + + return buf +} + +// Request GlxFeedbackBuffer +// size: 16 +type GlxFeedbackBufferCookie struct { + *cookie +} + +// Write request to wire for GlxFeedbackBuffer +func (c *Conn) GlxFeedbackBuffer(ContextTag GlxContextTag, Size int32, Type int32) GlxFeedbackBufferCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxFeedbackBufferRequest(ContextTag, Size, Type), cookie) + return GlxFeedbackBufferCookie{cookie} +} + +func (c *Conn) GlxFeedbackBufferChecked(ContextTag GlxContextTag, Size int32, Type int32) GlxFeedbackBufferCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxFeedbackBufferRequest(ContextTag, Size, Type), cookie) + return GlxFeedbackBufferCookie{cookie} +} + +func (cook GlxFeedbackBufferCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxFeedbackBuffer +func (c *Conn) glxFeedbackBufferRequest(ContextTag GlxContextTag, Size int32, Type int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 105 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Size)) + b += 4 + + Put32(buf[b:], uint32(Type)) + b += 4 + + return buf +} + +// Request GlxSelectBuffer +// size: 12 +type GlxSelectBufferCookie struct { + *cookie +} + +// Write request to wire for GlxSelectBuffer +func (c *Conn) GlxSelectBuffer(ContextTag GlxContextTag, Size int32) GlxSelectBufferCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxSelectBufferRequest(ContextTag, Size), cookie) + return GlxSelectBufferCookie{cookie} +} + +func (c *Conn) GlxSelectBufferChecked(ContextTag GlxContextTag, Size int32) GlxSelectBufferCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxSelectBufferRequest(ContextTag, Size), cookie) + return GlxSelectBufferCookie{cookie} +} + +func (cook GlxSelectBufferCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxSelectBuffer +func (c *Conn) glxSelectBufferRequest(ContextTag GlxContextTag, Size int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 106 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Size)) + b += 4 + + return buf +} + +// Request GlxRenderMode +// size: 12 +type GlxRenderModeCookie struct { + *cookie +} + +func (c *Conn) GlxRenderMode(ContextTag GlxContextTag, Mode uint32) GlxRenderModeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxRenderModeRequest(ContextTag, Mode), cookie) + return GlxRenderModeCookie{cookie} +} + +func (c *Conn) GlxRenderModeUnchecked(ContextTag GlxContextTag, Mode uint32) GlxRenderModeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxRenderModeRequest(ContextTag, Mode), cookie) + return GlxRenderModeCookie{cookie} +} + +// Request reply for GlxRenderMode +// size: (32 + pad((int(N) * 4))) +type GlxRenderModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal uint32 + N uint32 + NewMode uint32 + // padding: 12 bytes + Data []uint32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxRenderMode +func (cook GlxRenderModeCookie) Reply() (*GlxRenderModeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxRenderModeReply(buf), nil +} + +// Read reply into structure from buffer for GlxRenderMode +func glxRenderModeReply(buf []byte) *GlxRenderModeReply { + v := new(GlxRenderModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Get32(buf[b:]) + b += 4 + + v.N = Get32(buf[b:]) + b += 4 + + v.NewMode = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxRenderModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxRenderMode +func (c *Conn) glxRenderModeRequest(ContextTag GlxContextTag, Mode uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 107 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// Request GlxFinish +// size: 8 +type GlxFinishCookie struct { + *cookie +} + +func (c *Conn) GlxFinish(ContextTag GlxContextTag) GlxFinishCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxFinishRequest(ContextTag), cookie) + return GlxFinishCookie{cookie} +} + +func (c *Conn) GlxFinishUnchecked(ContextTag GlxContextTag) GlxFinishCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxFinishRequest(ContextTag), cookie) + return GlxFinishCookie{cookie} +} + +// Request reply for GlxFinish +// size: 8 +type GlxFinishReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes +} + +// Waits and reads reply data from request GlxFinish +func (cook GlxFinishCookie) Reply() (*GlxFinishReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxFinishReply(buf), nil +} + +// Read reply into structure from buffer for GlxFinish +func glxFinishReply(buf []byte) *GlxFinishReply { + v := new(GlxFinishReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +func (cook GlxFinishCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxFinish +func (c *Conn) glxFinishRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 108 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxPixelStoref +// size: 16 +type GlxPixelStorefCookie struct { + *cookie +} + +// Write request to wire for GlxPixelStoref +func (c *Conn) GlxPixelStoref(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) GlxPixelStorefCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxPixelStorefRequest(ContextTag, Pname, Datum), cookie) + return GlxPixelStorefCookie{cookie} +} + +func (c *Conn) GlxPixelStorefChecked(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) GlxPixelStorefCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxPixelStorefRequest(ContextTag, Pname, Datum), cookie) + return GlxPixelStorefCookie{cookie} +} + +func (cook GlxPixelStorefCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxPixelStoref +func (c *Conn) glxPixelStorefRequest(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 109 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// Request GlxPixelStorei +// size: 16 +type GlxPixelStoreiCookie struct { + *cookie +} + +// Write request to wire for GlxPixelStorei +func (c *Conn) GlxPixelStorei(ContextTag GlxContextTag, Pname uint32, Datum int32) GlxPixelStoreiCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxPixelStoreiRequest(ContextTag, Pname, Datum), cookie) + return GlxPixelStoreiCookie{cookie} +} + +func (c *Conn) GlxPixelStoreiChecked(ContextTag GlxContextTag, Pname uint32, Datum int32) GlxPixelStoreiCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxPixelStoreiRequest(ContextTag, Pname, Datum), cookie) + return GlxPixelStoreiCookie{cookie} +} + +func (cook GlxPixelStoreiCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxPixelStorei +func (c *Conn) glxPixelStoreiRequest(ContextTag GlxContextTag, Pname uint32, Datum int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 110 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// Request GlxReadPixels +// size: 36 +type GlxReadPixelsCookie struct { + *cookie +} + +func (c *Conn) GlxReadPixels(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) GlxReadPixelsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxReadPixelsRequest(ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return GlxReadPixelsCookie{cookie} +} + +func (c *Conn) GlxReadPixelsUnchecked(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) GlxReadPixelsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxReadPixelsRequest(ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return GlxReadPixelsCookie{cookie} +} + +// Request reply for GlxReadPixels +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxReadPixelsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxReadPixels +func (cook GlxReadPixelsCookie) Reply() (*GlxReadPixelsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxReadPixelsReply(buf), nil +} + +// Read reply into structure from buffer for GlxReadPixels +func glxReadPixelsReply(buf []byte) *GlxReadPixelsReply { + v := new(GlxReadPixelsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxReadPixelsCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxReadPixels +func (c *Conn) glxReadPixelsRequest(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 111 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(X)) + b += 4 + + Put32(buf[b:], uint32(Y)) + b += 4 + + Put32(buf[b:], uint32(Width)) + b += 4 + + Put32(buf[b:], uint32(Height)) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if LsbFirst { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetBooleanv +// size: 12 +type GlxGetBooleanvCookie struct { + *cookie +} + +func (c *Conn) GlxGetBooleanv(ContextTag GlxContextTag, Pname int32) GlxGetBooleanvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetBooleanvRequest(ContextTag, Pname), cookie) + return GlxGetBooleanvCookie{cookie} +} + +func (c *Conn) GlxGetBooleanvUnchecked(ContextTag GlxContextTag, Pname int32) GlxGetBooleanvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetBooleanvRequest(ContextTag, Pname), cookie) + return GlxGetBooleanvCookie{cookie} +} + +// Request reply for GlxGetBooleanv +// size: (32 + pad((int(N) * 1))) +type GlxGetBooleanvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum bool + // padding: 15 bytes + Data []bool // size: pad((int(N) * 1)) +} + +// Waits and reads reply data from request GlxGetBooleanv +func (cook GlxGetBooleanvCookie) Reply() (*GlxGetBooleanvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetBooleanvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetBooleanv +func glxGetBooleanvReply(buf []byte) *GlxGetBooleanvReply { + v := new(GlxGetBooleanvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.Datum = true + } else { + v.Datum = false + } + b += 1 + + b += 15 // padding + + v.Data = make([]bool, v.N) + for i := 0; i < int(v.N); i++ { + if buf[b] == 1 { + v.Data[i] = true + } else { + v.Data[i] = false + } + b += 1 + } + b = pad(b) + + return v +} + +func (cook GlxGetBooleanvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetBooleanv +func (c *Conn) glxGetBooleanvRequest(ContextTag GlxContextTag, Pname int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 112 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Pname)) + b += 4 + + return buf +} + +// Request GlxGetClipPlane +// size: 12 +type GlxGetClipPlaneCookie struct { + *cookie +} + +func (c *Conn) GlxGetClipPlane(ContextTag GlxContextTag, Plane int32) GlxGetClipPlaneCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetClipPlaneRequest(ContextTag, Plane), cookie) + return GlxGetClipPlaneCookie{cookie} +} + +func (c *Conn) GlxGetClipPlaneUnchecked(ContextTag GlxContextTag, Plane int32) GlxGetClipPlaneCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetClipPlaneRequest(ContextTag, Plane), cookie) + return GlxGetClipPlaneCookie{cookie} +} + +// Request reply for GlxGetClipPlane +// size: (32 + pad(((int(Length) / 2) * 8))) +type GlxGetClipPlaneReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []GlxFloat64 // size: pad(((int(Length) / 2) * 8)) +} + +// Waits and reads reply data from request GlxGetClipPlane +func (cook GlxGetClipPlaneCookie) Reply() (*GlxGetClipPlaneReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetClipPlaneReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetClipPlane +func glxGetClipPlaneReply(buf []byte) *GlxGetClipPlaneReply { + v := new(GlxGetClipPlaneReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]GlxFloat64, (int(v.Length) / 2)) + for i := 0; i < int((int(v.Length) / 2)); i++ { + v.Data[i] = GlxFloat64(Get64(buf[b:])) + b += 8 + } + b = pad(b) + + return v +} + +func (cook GlxGetClipPlaneCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetClipPlane +func (c *Conn) glxGetClipPlaneRequest(ContextTag GlxContextTag, Plane int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 113 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(Plane)) + b += 4 + + return buf +} + +// Request GlxGetDoublev +// size: 12 +type GlxGetDoublevCookie struct { + *cookie +} + +func (c *Conn) GlxGetDoublev(ContextTag GlxContextTag, Pname uint32) GlxGetDoublevCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetDoublevRequest(ContextTag, Pname), cookie) + return GlxGetDoublevCookie{cookie} +} + +func (c *Conn) GlxGetDoublevUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetDoublevCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetDoublevRequest(ContextTag, Pname), cookie) + return GlxGetDoublevCookie{cookie} +} + +// Request reply for GlxGetDoublev +// size: (32 + pad((int(N) * 8))) +type GlxGetDoublevReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat64 + // padding: 8 bytes + Data []GlxFloat64 // size: pad((int(N) * 8)) +} + +// Waits and reads reply data from request GlxGetDoublev +func (cook GlxGetDoublevCookie) Reply() (*GlxGetDoublevReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetDoublevReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetDoublev +func glxGetDoublevReply(buf []byte) *GlxGetDoublevReply { + v := new(GlxGetDoublevReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat64(Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]GlxFloat64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat64(Get64(buf[b:])) + b += 8 + } + b = pad(b) + + return v +} + +func (cook GlxGetDoublevCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetDoublev +func (c *Conn) glxGetDoublevRequest(ContextTag GlxContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 114 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetError +// size: 8 +type GlxGetErrorCookie struct { + *cookie +} + +func (c *Conn) GlxGetError(ContextTag GlxContextTag) GlxGetErrorCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetErrorRequest(ContextTag), cookie) + return GlxGetErrorCookie{cookie} +} + +func (c *Conn) GlxGetErrorUnchecked(ContextTag GlxContextTag) GlxGetErrorCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetErrorRequest(ContextTag), cookie) + return GlxGetErrorCookie{cookie} +} + +// Request reply for GlxGetError +// size: 12 +type GlxGetErrorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Error int32 +} + +// Waits and reads reply data from request GlxGetError +func (cook GlxGetErrorCookie) Reply() (*GlxGetErrorReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetErrorReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetError +func glxGetErrorReply(buf []byte) *GlxGetErrorReply { + v := new(GlxGetErrorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Error = int32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook GlxGetErrorCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetError +func (c *Conn) glxGetErrorRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 115 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxGetFloatv +// size: 12 +type GlxGetFloatvCookie struct { + *cookie +} + +func (c *Conn) GlxGetFloatv(ContextTag GlxContextTag, Pname uint32) GlxGetFloatvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetFloatvRequest(ContextTag, Pname), cookie) + return GlxGetFloatvCookie{cookie} +} + +func (c *Conn) GlxGetFloatvUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetFloatvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetFloatvRequest(ContextTag, Pname), cookie) + return GlxGetFloatvCookie{cookie} +} + +// Request reply for GlxGetFloatv +// size: (32 + pad((int(N) * 4))) +type GlxGetFloatvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetFloatv +func (cook GlxGetFloatvCookie) Reply() (*GlxGetFloatvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetFloatvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetFloatv +func glxGetFloatvReply(buf []byte) *GlxGetFloatvReply { + v := new(GlxGetFloatvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetFloatvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetFloatv +func (c *Conn) glxGetFloatvRequest(ContextTag GlxContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 116 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetIntegerv +// size: 12 +type GlxGetIntegervCookie struct { + *cookie +} + +func (c *Conn) GlxGetIntegerv(ContextTag GlxContextTag, Pname uint32) GlxGetIntegervCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetIntegervRequest(ContextTag, Pname), cookie) + return GlxGetIntegervCookie{cookie} +} + +func (c *Conn) GlxGetIntegervUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetIntegervCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetIntegervRequest(ContextTag, Pname), cookie) + return GlxGetIntegervCookie{cookie} +} + +// Request reply for GlxGetIntegerv +// size: (32 + pad((int(N) * 4))) +type GlxGetIntegervReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetIntegerv +func (cook GlxGetIntegervCookie) Reply() (*GlxGetIntegervReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetIntegervReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetIntegerv +func glxGetIntegervReply(buf []byte) *GlxGetIntegervReply { + v := new(GlxGetIntegervReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetIntegervCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetIntegerv +func (c *Conn) glxGetIntegervRequest(ContextTag GlxContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 117 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetLightfv +// size: 16 +type GlxGetLightfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetLightfv(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetLightfvRequest(ContextTag, Light, Pname), cookie) + return GlxGetLightfvCookie{cookie} +} + +func (c *Conn) GlxGetLightfvUnchecked(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetLightfvRequest(ContextTag, Light, Pname), cookie) + return GlxGetLightfvCookie{cookie} +} + +// Request reply for GlxGetLightfv +// size: (32 + pad((int(N) * 4))) +type GlxGetLightfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetLightfv +func (cook GlxGetLightfvCookie) Reply() (*GlxGetLightfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetLightfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetLightfv +func glxGetLightfvReply(buf []byte) *GlxGetLightfvReply { + v := new(GlxGetLightfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetLightfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetLightfv +func (c *Conn) glxGetLightfvRequest(ContextTag GlxContextTag, Light uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 118 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Light) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetLightiv +// size: 16 +type GlxGetLightivCookie struct { + *cookie +} + +func (c *Conn) GlxGetLightiv(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetLightivRequest(ContextTag, Light, Pname), cookie) + return GlxGetLightivCookie{cookie} +} + +func (c *Conn) GlxGetLightivUnchecked(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetLightivRequest(ContextTag, Light, Pname), cookie) + return GlxGetLightivCookie{cookie} +} + +// Request reply for GlxGetLightiv +// size: (32 + pad((int(N) * 4))) +type GlxGetLightivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetLightiv +func (cook GlxGetLightivCookie) Reply() (*GlxGetLightivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetLightivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetLightiv +func glxGetLightivReply(buf []byte) *GlxGetLightivReply { + v := new(GlxGetLightivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetLightivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetLightiv +func (c *Conn) glxGetLightivRequest(ContextTag GlxContextTag, Light uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 119 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Light) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetMapdv +// size: 16 +type GlxGetMapdvCookie struct { + *cookie +} + +func (c *Conn) GlxGetMapdv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapdvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMapdvRequest(ContextTag, Target, Query), cookie) + return GlxGetMapdvCookie{cookie} +} + +func (c *Conn) GlxGetMapdvUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapdvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMapdvRequest(ContextTag, Target, Query), cookie) + return GlxGetMapdvCookie{cookie} +} + +// Request reply for GlxGetMapdv +// size: (32 + pad((int(N) * 8))) +type GlxGetMapdvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat64 + // padding: 8 bytes + Data []GlxFloat64 // size: pad((int(N) * 8)) +} + +// Waits and reads reply data from request GlxGetMapdv +func (cook GlxGetMapdvCookie) Reply() (*GlxGetMapdvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMapdvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMapdv +func glxGetMapdvReply(buf []byte) *GlxGetMapdvReply { + v := new(GlxGetMapdvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat64(Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]GlxFloat64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat64(Get64(buf[b:])) + b += 8 + } + b = pad(b) + + return v +} + +func (cook GlxGetMapdvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMapdv +func (c *Conn) glxGetMapdvRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 120 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GlxGetMapfv +// size: 16 +type GlxGetMapfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetMapfv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMapfvRequest(ContextTag, Target, Query), cookie) + return GlxGetMapfvCookie{cookie} +} + +func (c *Conn) GlxGetMapfvUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMapfvRequest(ContextTag, Target, Query), cookie) + return GlxGetMapfvCookie{cookie} +} + +// Request reply for GlxGetMapfv +// size: (32 + pad((int(N) * 4))) +type GlxGetMapfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMapfv +func (cook GlxGetMapfvCookie) Reply() (*GlxGetMapfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMapfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMapfv +func glxGetMapfvReply(buf []byte) *GlxGetMapfvReply { + v := new(GlxGetMapfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMapfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMapfv +func (c *Conn) glxGetMapfvRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 121 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GlxGetMapiv +// size: 16 +type GlxGetMapivCookie struct { + *cookie +} + +func (c *Conn) GlxGetMapiv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMapivRequest(ContextTag, Target, Query), cookie) + return GlxGetMapivCookie{cookie} +} + +func (c *Conn) GlxGetMapivUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMapivRequest(ContextTag, Target, Query), cookie) + return GlxGetMapivCookie{cookie} +} + +// Request reply for GlxGetMapiv +// size: (32 + pad((int(N) * 4))) +type GlxGetMapivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMapiv +func (cook GlxGetMapivCookie) Reply() (*GlxGetMapivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMapivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMapiv +func glxGetMapivReply(buf []byte) *GlxGetMapivReply { + v := new(GlxGetMapivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMapivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMapiv +func (c *Conn) glxGetMapivRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 122 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GlxGetMaterialfv +// size: 16 +type GlxGetMaterialfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetMaterialfv(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMaterialfvRequest(ContextTag, Face, Pname), cookie) + return GlxGetMaterialfvCookie{cookie} +} + +func (c *Conn) GlxGetMaterialfvUnchecked(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMaterialfvRequest(ContextTag, Face, Pname), cookie) + return GlxGetMaterialfvCookie{cookie} +} + +// Request reply for GlxGetMaterialfv +// size: (32 + pad((int(N) * 4))) +type GlxGetMaterialfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMaterialfv +func (cook GlxGetMaterialfvCookie) Reply() (*GlxGetMaterialfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMaterialfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMaterialfv +func glxGetMaterialfvReply(buf []byte) *GlxGetMaterialfvReply { + v := new(GlxGetMaterialfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMaterialfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMaterialfv +func (c *Conn) glxGetMaterialfvRequest(ContextTag GlxContextTag, Face uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 123 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Face) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetMaterialiv +// size: 16 +type GlxGetMaterialivCookie struct { + *cookie +} + +func (c *Conn) GlxGetMaterialiv(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMaterialivRequest(ContextTag, Face, Pname), cookie) + return GlxGetMaterialivCookie{cookie} +} + +func (c *Conn) GlxGetMaterialivUnchecked(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMaterialivRequest(ContextTag, Face, Pname), cookie) + return GlxGetMaterialivCookie{cookie} +} + +// Request reply for GlxGetMaterialiv +// size: (32 + pad((int(N) * 4))) +type GlxGetMaterialivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMaterialiv +func (cook GlxGetMaterialivCookie) Reply() (*GlxGetMaterialivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMaterialivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMaterialiv +func glxGetMaterialivReply(buf []byte) *GlxGetMaterialivReply { + v := new(GlxGetMaterialivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMaterialivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMaterialiv +func (c *Conn) glxGetMaterialivRequest(ContextTag GlxContextTag, Face uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 124 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Face) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetPixelMapfv +// size: 12 +type GlxGetPixelMapfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetPixelMapfv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetPixelMapfvRequest(ContextTag, Map), cookie) + return GlxGetPixelMapfvCookie{cookie} +} + +func (c *Conn) GlxGetPixelMapfvUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetPixelMapfvRequest(ContextTag, Map), cookie) + return GlxGetPixelMapfvCookie{cookie} +} + +// Request reply for GlxGetPixelMapfv +// size: (32 + pad((int(N) * 4))) +type GlxGetPixelMapfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetPixelMapfv +func (cook GlxGetPixelMapfvCookie) Reply() (*GlxGetPixelMapfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetPixelMapfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetPixelMapfv +func glxGetPixelMapfvReply(buf []byte) *GlxGetPixelMapfvReply { + v := new(GlxGetPixelMapfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetPixelMapfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetPixelMapfv +func (c *Conn) glxGetPixelMapfvRequest(ContextTag GlxContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 125 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GlxGetPixelMapuiv +// size: 12 +type GlxGetPixelMapuivCookie struct { + *cookie +} + +func (c *Conn) GlxGetPixelMapuiv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapuivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetPixelMapuivRequest(ContextTag, Map), cookie) + return GlxGetPixelMapuivCookie{cookie} +} + +func (c *Conn) GlxGetPixelMapuivUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapuivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetPixelMapuivRequest(ContextTag, Map), cookie) + return GlxGetPixelMapuivCookie{cookie} +} + +// Request reply for GlxGetPixelMapuiv +// size: (32 + pad((int(N) * 4))) +type GlxGetPixelMapuivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint32 + // padding: 12 bytes + Data []uint32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetPixelMapuiv +func (cook GlxGetPixelMapuivCookie) Reply() (*GlxGetPixelMapuivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetPixelMapuivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetPixelMapuiv +func glxGetPixelMapuivReply(buf []byte) *GlxGetPixelMapuivReply { + v := new(GlxGetPixelMapuivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetPixelMapuivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetPixelMapuiv +func (c *Conn) glxGetPixelMapuivRequest(ContextTag GlxContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 126 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GlxGetPixelMapusv +// size: 12 +type GlxGetPixelMapusvCookie struct { + *cookie +} + +func (c *Conn) GlxGetPixelMapusv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapusvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetPixelMapusvRequest(ContextTag, Map), cookie) + return GlxGetPixelMapusvCookie{cookie} +} + +func (c *Conn) GlxGetPixelMapusvUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapusvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetPixelMapusvRequest(ContextTag, Map), cookie) + return GlxGetPixelMapusvCookie{cookie} +} + +// Request reply for GlxGetPixelMapusv +// size: (34 + pad((int(N) * 2))) +type GlxGetPixelMapusvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint16 + // padding: 16 bytes + Data []uint16 // size: pad((int(N) * 2)) +} + +// Waits and reads reply data from request GlxGetPixelMapusv +func (cook GlxGetPixelMapusvCookie) Reply() (*GlxGetPixelMapusvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetPixelMapusvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetPixelMapusv +func glxGetPixelMapusvReply(buf []byte) *GlxGetPixelMapusvReply { + v := new(GlxGetPixelMapusvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = Get16(buf[b:]) + b += 2 + + b += 16 // padding + + v.Data = make([]uint16, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + return v +} + +func (cook GlxGetPixelMapusvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetPixelMapusv +func (c *Conn) glxGetPixelMapusvRequest(ContextTag GlxContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 127 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GlxGetPolygonStipple +// size: 12 +type GlxGetPolygonStippleCookie struct { + *cookie +} + +func (c *Conn) GlxGetPolygonStipple(ContextTag GlxContextTag, LsbFirst bool) GlxGetPolygonStippleCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetPolygonStippleRequest(ContextTag, LsbFirst), cookie) + return GlxGetPolygonStippleCookie{cookie} +} + +func (c *Conn) GlxGetPolygonStippleUnchecked(ContextTag GlxContextTag, LsbFirst bool) GlxGetPolygonStippleCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetPolygonStippleRequest(ContextTag, LsbFirst), cookie) + return GlxGetPolygonStippleCookie{cookie} +} + +// Request reply for GlxGetPolygonStipple +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetPolygonStippleReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetPolygonStipple +func (cook GlxGetPolygonStippleCookie) Reply() (*GlxGetPolygonStippleReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetPolygonStippleReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetPolygonStipple +func glxGetPolygonStippleReply(buf []byte) *GlxGetPolygonStippleReply { + v := new(GlxGetPolygonStippleReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetPolygonStippleCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetPolygonStipple +func (c *Conn) glxGetPolygonStippleRequest(ContextTag GlxContextTag, LsbFirst bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 128 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + if LsbFirst { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetString +// size: 12 +type GlxGetStringCookie struct { + *cookie +} + +func (c *Conn) GlxGetString(ContextTag GlxContextTag, Name uint32) GlxGetStringCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetStringRequest(ContextTag, Name), cookie) + return GlxGetStringCookie{cookie} +} + +func (c *Conn) GlxGetStringUnchecked(ContextTag GlxContextTag, Name uint32) GlxGetStringCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetStringRequest(ContextTag, Name), cookie) + return GlxGetStringCookie{cookie} +} + +// Request reply for GlxGetString +// size: (32 + pad((int(N) * 1))) +type GlxGetStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + // padding: 16 bytes + String string // size: pad((int(N) * 1)) +} + +// Waits and reads reply data from request GlxGetString +func (cook GlxGetStringCookie) Reply() (*GlxGetStringReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetStringReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetString +func glxGetStringReply(buf []byte) *GlxGetStringReply { + v := new(GlxGetStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.N) + copy(byteString[:v.N], buf[b:]) + v.String = string(byteString) + b += pad(int(v.N)) + } + + return v +} + +func (cook GlxGetStringCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetString +func (c *Conn) glxGetStringRequest(ContextTag GlxContextTag, Name uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 129 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Name) + b += 4 + + return buf +} + +// Request GlxGetTexEnvfv +// size: 16 +type GlxGetTexEnvfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexEnvfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexEnvfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexEnvfvCookie{cookie} +} + +func (c *Conn) GlxGetTexEnvfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexEnvfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexEnvfvCookie{cookie} +} + +// Request reply for GlxGetTexEnvfv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexEnvfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexEnvfv +func (cook GlxGetTexEnvfvCookie) Reply() (*GlxGetTexEnvfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexEnvfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexEnvfv +func glxGetTexEnvfvReply(buf []byte) *GlxGetTexEnvfvReply { + v := new(GlxGetTexEnvfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexEnvfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexEnvfv +func (c *Conn) glxGetTexEnvfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 130 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexEnviv +// size: 16 +type GlxGetTexEnvivCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexEnviv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexEnvivRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexEnvivCookie{cookie} +} + +func (c *Conn) GlxGetTexEnvivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexEnvivRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexEnvivCookie{cookie} +} + +// Request reply for GlxGetTexEnviv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexEnvivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexEnviv +func (cook GlxGetTexEnvivCookie) Reply() (*GlxGetTexEnvivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexEnvivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexEnviv +func glxGetTexEnvivReply(buf []byte) *GlxGetTexEnvivReply { + v := new(GlxGetTexEnvivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexEnvivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexEnviv +func (c *Conn) glxGetTexEnvivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 131 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexGendv +// size: 16 +type GlxGetTexGendvCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexGendv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGendvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexGendvRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGendvCookie{cookie} +} + +func (c *Conn) GlxGetTexGendvUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGendvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexGendvRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGendvCookie{cookie} +} + +// Request reply for GlxGetTexGendv +// size: (32 + pad((int(N) * 8))) +type GlxGetTexGendvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat64 + // padding: 8 bytes + Data []GlxFloat64 // size: pad((int(N) * 8)) +} + +// Waits and reads reply data from request GlxGetTexGendv +func (cook GlxGetTexGendvCookie) Reply() (*GlxGetTexGendvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexGendvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexGendv +func glxGetTexGendvReply(buf []byte) *GlxGetTexGendvReply { + v := new(GlxGetTexGendvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat64(Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]GlxFloat64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat64(Get64(buf[b:])) + b += 8 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexGendvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexGendv +func (c *Conn) glxGetTexGendvRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 132 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Coord) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexGenfv +// size: 16 +type GlxGetTexGenfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexGenfv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexGenfvRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGenfvCookie{cookie} +} + +func (c *Conn) GlxGetTexGenfvUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexGenfvRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGenfvCookie{cookie} +} + +// Request reply for GlxGetTexGenfv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexGenfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexGenfv +func (cook GlxGetTexGenfvCookie) Reply() (*GlxGetTexGenfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexGenfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexGenfv +func glxGetTexGenfvReply(buf []byte) *GlxGetTexGenfvReply { + v := new(GlxGetTexGenfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexGenfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexGenfv +func (c *Conn) glxGetTexGenfvRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 133 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Coord) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexGeniv +// size: 16 +type GlxGetTexGenivCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexGeniv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexGenivRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGenivCookie{cookie} +} + +func (c *Conn) GlxGetTexGenivUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexGenivRequest(ContextTag, Coord, Pname), cookie) + return GlxGetTexGenivCookie{cookie} +} + +// Request reply for GlxGetTexGeniv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexGenivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexGeniv +func (cook GlxGetTexGenivCookie) Reply() (*GlxGetTexGenivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexGenivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexGeniv +func glxGetTexGenivReply(buf []byte) *GlxGetTexGenivReply { + v := new(GlxGetTexGenivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexGenivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexGeniv +func (c *Conn) glxGetTexGenivRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 134 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Coord) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexImage +// size: 28 +type GlxGetTexImageCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexImage(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GlxGetTexImageCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexImageRequest(ContextTag, Target, Level, Format, Type, SwapBytes), cookie) + return GlxGetTexImageCookie{cookie} +} + +func (c *Conn) GlxGetTexImageUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GlxGetTexImageCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexImageRequest(ContextTag, Target, Level, Format, Type, SwapBytes), cookie) + return GlxGetTexImageCookie{cookie} +} + +// Request reply for GlxGetTexImage +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetTexImageReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + Height int32 + Depth int32 + // padding: 4 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetTexImage +func (cook GlxGetTexImageCookie) Reply() (*GlxGetTexImageReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexImageReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexImage +func glxGetTexImageReply(buf []byte) *GlxGetTexImageReply { + v := new(GlxGetTexImageReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(Get32(buf[b:])) + b += 4 + + v.Height = int32(Get32(buf[b:])) + b += 4 + + v.Depth = int32(Get32(buf[b:])) + b += 4 + + b += 4 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetTexImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexImage +func (c *Conn) glxGetTexImageRequest(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 135 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], uint32(Level)) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetTexParameterfv +// size: 16 +type GlxGetTexParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetTexParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexParameterfvCookie{cookie} +} + +// Request reply for GlxGetTexParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexParameterfv +func (cook GlxGetTexParameterfvCookie) Reply() (*GlxGetTexParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexParameterfv +func glxGetTexParameterfvReply(buf []byte) *GlxGetTexParameterfvReply { + v := new(GlxGetTexParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexParameterfv +func (c *Conn) glxGetTexParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 136 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexParameteriv +// size: 16 +type GlxGetTexParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexParameterivCookie{cookie} +} + +func (c *Conn) GlxGetTexParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetTexParameterivCookie{cookie} +} + +// Request reply for GlxGetTexParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexParameteriv +func (cook GlxGetTexParameterivCookie) Reply() (*GlxGetTexParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexParameteriv +func glxGetTexParameterivReply(buf []byte) *GlxGetTexParameterivReply { + v := new(GlxGetTexParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexParameteriv +func (c *Conn) glxGetTexParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 137 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexLevelParameterfv +// size: 20 +type GlxGetTexLevelParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexLevelParameterfv(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexLevelParameterfvRequest(ContextTag, Target, Level, Pname), cookie) + return GlxGetTexLevelParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetTexLevelParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexLevelParameterfvRequest(ContextTag, Target, Level, Pname), cookie) + return GlxGetTexLevelParameterfvCookie{cookie} +} + +// Request reply for GlxGetTexLevelParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexLevelParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexLevelParameterfv +func (cook GlxGetTexLevelParameterfvCookie) Reply() (*GlxGetTexLevelParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexLevelParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexLevelParameterfv +func glxGetTexLevelParameterfvReply(buf []byte) *GlxGetTexLevelParameterfvReply { + v := new(GlxGetTexLevelParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexLevelParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexLevelParameterfv +func (c *Conn) glxGetTexLevelParameterfvRequest(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 138 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], uint32(Level)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetTexLevelParameteriv +// size: 20 +type GlxGetTexLevelParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetTexLevelParameteriv(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetTexLevelParameterivRequest(ContextTag, Target, Level, Pname), cookie) + return GlxGetTexLevelParameterivCookie{cookie} +} + +func (c *Conn) GlxGetTexLevelParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetTexLevelParameterivRequest(ContextTag, Target, Level, Pname), cookie) + return GlxGetTexLevelParameterivCookie{cookie} +} + +// Request reply for GlxGetTexLevelParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetTexLevelParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetTexLevelParameteriv +func (cook GlxGetTexLevelParameterivCookie) Reply() (*GlxGetTexLevelParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetTexLevelParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetTexLevelParameteriv +func glxGetTexLevelParameterivReply(buf []byte) *GlxGetTexLevelParameterivReply { + v := new(GlxGetTexLevelParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetTexLevelParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetTexLevelParameteriv +func (c *Conn) glxGetTexLevelParameterivRequest(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 139 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], uint32(Level)) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxIsList +// size: 12 +type GlxIsListCookie struct { + *cookie +} + +func (c *Conn) GlxIsList(ContextTag GlxContextTag, List uint32) GlxIsListCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxIsListRequest(ContextTag, List), cookie) + return GlxIsListCookie{cookie} +} + +func (c *Conn) GlxIsListUnchecked(ContextTag GlxContextTag, List uint32) GlxIsListCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxIsListRequest(ContextTag, List), cookie) + return GlxIsListCookie{cookie} +} + +// Request reply for GlxIsList +// size: 12 +type GlxIsListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal GlxBool32 +} + +// Waits and reads reply data from request GlxIsList +func (cook GlxIsListCookie) Reply() (*GlxIsListReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxIsListReply(buf), nil +} + +// Read reply into structure from buffer for GlxIsList +func glxIsListReply(buf []byte) *GlxIsListReply { + v := new(GlxIsListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = GlxBool32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook GlxIsListCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxIsList +func (c *Conn) glxIsListRequest(ContextTag GlxContextTag, List uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 141 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], List) + b += 4 + + return buf +} + +// Request GlxFlush +// size: 8 +type GlxFlushCookie struct { + *cookie +} + +// Write request to wire for GlxFlush +func (c *Conn) GlxFlush(ContextTag GlxContextTag) GlxFlushCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxFlushRequest(ContextTag), cookie) + return GlxFlushCookie{cookie} +} + +func (c *Conn) GlxFlushChecked(ContextTag GlxContextTag) GlxFlushCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxFlushRequest(ContextTag), cookie) + return GlxFlushCookie{cookie} +} + +func (cook GlxFlushCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxFlush +func (c *Conn) glxFlushRequest(ContextTag GlxContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 142 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GlxAreTexturesResident +// size: pad((12 + pad((int(N) * 4)))) +type GlxAreTexturesResidentCookie struct { + *cookie +} + +func (c *Conn) GlxAreTexturesResident(ContextTag GlxContextTag, N int32, Textures []uint32) GlxAreTexturesResidentCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxAreTexturesResidentRequest(ContextTag, N, Textures), cookie) + return GlxAreTexturesResidentCookie{cookie} +} + +func (c *Conn) GlxAreTexturesResidentUnchecked(ContextTag GlxContextTag, N int32, Textures []uint32) GlxAreTexturesResidentCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxAreTexturesResidentRequest(ContextTag, N, Textures), cookie) + return GlxAreTexturesResidentCookie{cookie} +} + +// Request reply for GlxAreTexturesResident +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxAreTexturesResidentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal GlxBool32 + // padding: 20 bytes + Data []bool // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxAreTexturesResident +func (cook GlxAreTexturesResidentCookie) Reply() (*GlxAreTexturesResidentReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxAreTexturesResidentReply(buf), nil +} + +// Read reply into structure from buffer for GlxAreTexturesResident +func glxAreTexturesResidentReply(buf []byte) *GlxAreTexturesResidentReply { + v := new(GlxAreTexturesResidentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = GlxBool32(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]bool, (int(v.Length) * 4)) + for i := 0; i < int((int(v.Length) * 4)); i++ { + if buf[b] == 1 { + v.Data[i] = true + } else { + v.Data[i] = false + } + b += 1 + } + b = pad(b) + + return v +} + +func (cook GlxAreTexturesResidentCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxAreTexturesResident +func (c *Conn) glxAreTexturesResidentRequest(ContextTag GlxContextTag, N int32, Textures []uint32) []byte { + size := pad((12 + pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 143 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + Put32(buf[b:], Textures[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxDeleteTextures +// size: pad((12 + pad((int(N) * 4)))) +type GlxDeleteTexturesCookie struct { + *cookie +} + +// Write request to wire for GlxDeleteTextures +func (c *Conn) GlxDeleteTextures(ContextTag GlxContextTag, N int32, Textures []uint32) GlxDeleteTexturesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDeleteTexturesRequest(ContextTag, N, Textures), cookie) + return GlxDeleteTexturesCookie{cookie} +} + +func (c *Conn) GlxDeleteTexturesChecked(ContextTag GlxContextTag, N int32, Textures []uint32) GlxDeleteTexturesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDeleteTexturesRequest(ContextTag, N, Textures), cookie) + return GlxDeleteTexturesCookie{cookie} +} + +func (cook GlxDeleteTexturesCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDeleteTextures +func (c *Conn) glxDeleteTexturesRequest(ContextTag GlxContextTag, N int32, Textures []uint32) []byte { + size := pad((12 + pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 144 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + Put32(buf[b:], Textures[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxGenTextures +// size: 12 +type GlxGenTexturesCookie struct { + *cookie +} + +func (c *Conn) GlxGenTextures(ContextTag GlxContextTag, N int32) GlxGenTexturesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGenTexturesRequest(ContextTag, N), cookie) + return GlxGenTexturesCookie{cookie} +} + +func (c *Conn) GlxGenTexturesUnchecked(ContextTag GlxContextTag, N int32) GlxGenTexturesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGenTexturesRequest(ContextTag, N), cookie) + return GlxGenTexturesCookie{cookie} +} + +// Request reply for GlxGenTextures +// size: (32 + pad((int(Length) * 4))) +type GlxGenTexturesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GlxGenTextures +func (cook GlxGenTexturesCookie) Reply() (*GlxGenTexturesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGenTexturesReply(buf), nil +} + +// Read reply into structure from buffer for GlxGenTextures +func glxGenTexturesReply(buf []byte) *GlxGenTexturesReply { + v := new(GlxGenTexturesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGenTexturesCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGenTextures +func (c *Conn) glxGenTexturesRequest(ContextTag GlxContextTag, N int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 145 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(N)) + b += 4 + + return buf +} + +// Request GlxIsTexture +// size: 12 +type GlxIsTextureCookie struct { + *cookie +} + +func (c *Conn) GlxIsTexture(ContextTag GlxContextTag, Texture uint32) GlxIsTextureCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxIsTextureRequest(ContextTag, Texture), cookie) + return GlxIsTextureCookie{cookie} +} + +func (c *Conn) GlxIsTextureUnchecked(ContextTag GlxContextTag, Texture uint32) GlxIsTextureCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxIsTextureRequest(ContextTag, Texture), cookie) + return GlxIsTextureCookie{cookie} +} + +// Request reply for GlxIsTexture +// size: 12 +type GlxIsTextureReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal GlxBool32 +} + +// Waits and reads reply data from request GlxIsTexture +func (cook GlxIsTextureCookie) Reply() (*GlxIsTextureReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxIsTextureReply(buf), nil +} + +// Read reply into structure from buffer for GlxIsTexture +func glxIsTextureReply(buf []byte) *GlxIsTextureReply { + v := new(GlxIsTextureReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = GlxBool32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook GlxIsTextureCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxIsTexture +func (c *Conn) glxIsTextureRequest(ContextTag GlxContextTag, Texture uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 146 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Texture) + b += 4 + + return buf +} + +// Request GlxGetColorTable +// size: 24 +type GlxGetColorTableCookie struct { + *cookie +} + +func (c *Conn) GlxGetColorTable(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetColorTableCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetColorTableRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetColorTableCookie{cookie} +} + +func (c *Conn) GlxGetColorTableUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetColorTableCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetColorTableRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetColorTableCookie{cookie} +} + +// Request reply for GlxGetColorTable +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetColorTableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetColorTable +func (cook GlxGetColorTableCookie) Reply() (*GlxGetColorTableReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetColorTableReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetColorTable +func glxGetColorTableReply(buf []byte) *GlxGetColorTableReply { + v := new(GlxGetColorTableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetColorTableCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetColorTable +func (c *Conn) glxGetColorTableRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 147 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetColorTableParameterfv +// size: 16 +type GlxGetColorTableParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetColorTableParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetColorTableParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetColorTableParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetColorTableParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetColorTableParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetColorTableParameterfvCookie{cookie} +} + +// Request reply for GlxGetColorTableParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetColorTableParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetColorTableParameterfv +func (cook GlxGetColorTableParameterfvCookie) Reply() (*GlxGetColorTableParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetColorTableParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetColorTableParameterfv +func glxGetColorTableParameterfvReply(buf []byte) *GlxGetColorTableParameterfvReply { + v := new(GlxGetColorTableParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetColorTableParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetColorTableParameterfv +func (c *Conn) glxGetColorTableParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 148 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetColorTableParameteriv +// size: 16 +type GlxGetColorTableParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetColorTableParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetColorTableParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetColorTableParameterivCookie{cookie} +} + +func (c *Conn) GlxGetColorTableParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetColorTableParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetColorTableParameterivCookie{cookie} +} + +// Request reply for GlxGetColorTableParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetColorTableParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetColorTableParameteriv +func (cook GlxGetColorTableParameterivCookie) Reply() (*GlxGetColorTableParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetColorTableParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetColorTableParameteriv +func glxGetColorTableParameterivReply(buf []byte) *GlxGetColorTableParameterivReply { + v := new(GlxGetColorTableParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetColorTableParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetColorTableParameteriv +func (c *Conn) glxGetColorTableParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 149 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetConvolutionFilter +// size: 24 +type GlxGetConvolutionFilterCookie struct { + *cookie +} + +func (c *Conn) GlxGetConvolutionFilter(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetConvolutionFilterCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetConvolutionFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetConvolutionFilterCookie{cookie} +} + +func (c *Conn) GlxGetConvolutionFilterUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetConvolutionFilterCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetConvolutionFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetConvolutionFilterCookie{cookie} +} + +// Request reply for GlxGetConvolutionFilter +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetConvolutionFilterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + Height int32 + // padding: 8 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetConvolutionFilter +func (cook GlxGetConvolutionFilterCookie) Reply() (*GlxGetConvolutionFilterReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetConvolutionFilterReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetConvolutionFilter +func glxGetConvolutionFilterReply(buf []byte) *GlxGetConvolutionFilterReply { + v := new(GlxGetConvolutionFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(Get32(buf[b:])) + b += 4 + + v.Height = int32(Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetConvolutionFilterCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetConvolutionFilter +func (c *Conn) glxGetConvolutionFilterRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 150 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetConvolutionParameterfv +// size: 16 +type GlxGetConvolutionParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetConvolutionParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetConvolutionParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetConvolutionParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetConvolutionParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetConvolutionParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetConvolutionParameterfvCookie{cookie} +} + +// Request reply for GlxGetConvolutionParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetConvolutionParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetConvolutionParameterfv +func (cook GlxGetConvolutionParameterfvCookie) Reply() (*GlxGetConvolutionParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetConvolutionParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetConvolutionParameterfv +func glxGetConvolutionParameterfvReply(buf []byte) *GlxGetConvolutionParameterfvReply { + v := new(GlxGetConvolutionParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetConvolutionParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetConvolutionParameterfv +func (c *Conn) glxGetConvolutionParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 151 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetConvolutionParameteriv +// size: 16 +type GlxGetConvolutionParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetConvolutionParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetConvolutionParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetConvolutionParameterivCookie{cookie} +} + +func (c *Conn) GlxGetConvolutionParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetConvolutionParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetConvolutionParameterivCookie{cookie} +} + +// Request reply for GlxGetConvolutionParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetConvolutionParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetConvolutionParameteriv +func (cook GlxGetConvolutionParameterivCookie) Reply() (*GlxGetConvolutionParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetConvolutionParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetConvolutionParameteriv +func glxGetConvolutionParameterivReply(buf []byte) *GlxGetConvolutionParameterivReply { + v := new(GlxGetConvolutionParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetConvolutionParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetConvolutionParameteriv +func (c *Conn) glxGetConvolutionParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 152 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetSeparableFilter +// size: 24 +type GlxGetSeparableFilterCookie struct { + *cookie +} + +func (c *Conn) GlxGetSeparableFilter(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetSeparableFilterCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetSeparableFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetSeparableFilterCookie{cookie} +} + +func (c *Conn) GlxGetSeparableFilterUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetSeparableFilterCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetSeparableFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) + return GlxGetSeparableFilterCookie{cookie} +} + +// Request reply for GlxGetSeparableFilter +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetSeparableFilterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + RowW int32 + ColH int32 + // padding: 8 bytes + RowsAndCols []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetSeparableFilter +func (cook GlxGetSeparableFilterCookie) Reply() (*GlxGetSeparableFilterReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetSeparableFilterReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetSeparableFilter +func glxGetSeparableFilterReply(buf []byte) *GlxGetSeparableFilterReply { + v := new(GlxGetSeparableFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.RowW = int32(Get32(buf[b:])) + b += 4 + + v.ColH = int32(Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.RowsAndCols = make([]byte, (int(v.Length) * 4)) + copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetSeparableFilterCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetSeparableFilter +func (c *Conn) glxGetSeparableFilterRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 153 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetHistogram +// size: 24 +type GlxGetHistogramCookie struct { + *cookie +} + +func (c *Conn) GlxGetHistogram(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetHistogramCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetHistogramRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GlxGetHistogramCookie{cookie} +} + +func (c *Conn) GlxGetHistogramUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetHistogramCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetHistogramRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GlxGetHistogramCookie{cookie} +} + +// Request reply for GlxGetHistogram +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetHistogramReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetHistogram +func (cook GlxGetHistogramCookie) Reply() (*GlxGetHistogramReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetHistogramReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetHistogram +func glxGetHistogramReply(buf []byte) *GlxGetHistogramReply { + v := new(GlxGetHistogramReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetHistogramCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetHistogram +func (c *Conn) glxGetHistogramRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 154 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetHistogramParameterfv +// size: 16 +type GlxGetHistogramParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetHistogramParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetHistogramParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetHistogramParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetHistogramParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetHistogramParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetHistogramParameterfvCookie{cookie} +} + +// Request reply for GlxGetHistogramParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetHistogramParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetHistogramParameterfv +func (cook GlxGetHistogramParameterfvCookie) Reply() (*GlxGetHistogramParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetHistogramParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetHistogramParameterfv +func glxGetHistogramParameterfvReply(buf []byte) *GlxGetHistogramParameterfvReply { + v := new(GlxGetHistogramParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetHistogramParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetHistogramParameterfv +func (c *Conn) glxGetHistogramParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 155 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetHistogramParameteriv +// size: 16 +type GlxGetHistogramParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetHistogramParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetHistogramParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetHistogramParameterivCookie{cookie} +} + +func (c *Conn) GlxGetHistogramParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetHistogramParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetHistogramParameterivCookie{cookie} +} + +// Request reply for GlxGetHistogramParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetHistogramParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetHistogramParameteriv +func (cook GlxGetHistogramParameterivCookie) Reply() (*GlxGetHistogramParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetHistogramParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetHistogramParameteriv +func glxGetHistogramParameterivReply(buf []byte) *GlxGetHistogramParameterivReply { + v := new(GlxGetHistogramParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetHistogramParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetHistogramParameteriv +func (c *Conn) glxGetHistogramParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 156 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetMinmax +// size: 24 +type GlxGetMinmaxCookie struct { + *cookie +} + +func (c *Conn) GlxGetMinmax(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetMinmaxCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMinmaxRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GlxGetMinmaxCookie{cookie} +} + +func (c *Conn) GlxGetMinmaxUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetMinmaxCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMinmaxRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GlxGetMinmaxCookie{cookie} +} + +// Request reply for GlxGetMinmax +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetMinmaxReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetMinmax +func (cook GlxGetMinmaxCookie) Reply() (*GlxGetMinmaxReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMinmaxReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMinmax +func glxGetMinmaxReply(buf []byte) *GlxGetMinmaxReply { + v := new(GlxGetMinmaxReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetMinmaxCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMinmax +func (c *Conn) glxGetMinmaxRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 157 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Format) + b += 4 + + Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GlxGetMinmaxParameterfv +// size: 16 +type GlxGetMinmaxParameterfvCookie struct { + *cookie +} + +func (c *Conn) GlxGetMinmaxParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterfvCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMinmaxParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetMinmaxParameterfvCookie{cookie} +} + +func (c *Conn) GlxGetMinmaxParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterfvCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMinmaxParameterfvRequest(ContextTag, Target, Pname), cookie) + return GlxGetMinmaxParameterfvCookie{cookie} +} + +// Request reply for GlxGetMinmaxParameterfv +// size: (32 + pad((int(N) * 4))) +type GlxGetMinmaxParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum GlxFloat32 + // padding: 12 bytes + Data []GlxFloat32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMinmaxParameterfv +func (cook GlxGetMinmaxParameterfvCookie) Reply() (*GlxGetMinmaxParameterfvReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMinmaxParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMinmaxParameterfv +func glxGetMinmaxParameterfvReply(buf []byte) *GlxGetMinmaxParameterfvReply { + v := new(GlxGetMinmaxParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = GlxFloat32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]GlxFloat32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = GlxFloat32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMinmaxParameterfvCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMinmaxParameterfv +func (c *Conn) glxGetMinmaxParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 158 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetMinmaxParameteriv +// size: 16 +type GlxGetMinmaxParameterivCookie struct { + *cookie +} + +func (c *Conn) GlxGetMinmaxParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterivCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetMinmaxParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetMinmaxParameterivCookie{cookie} +} + +func (c *Conn) GlxGetMinmaxParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterivCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetMinmaxParameterivRequest(ContextTag, Target, Pname), cookie) + return GlxGetMinmaxParameterivCookie{cookie} +} + +// Request reply for GlxGetMinmaxParameteriv +// size: (32 + pad((int(N) * 4))) +type GlxGetMinmaxParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetMinmaxParameteriv +func (cook GlxGetMinmaxParameterivCookie) Reply() (*GlxGetMinmaxParameterivReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetMinmaxParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetMinmaxParameteriv +func glxGetMinmaxParameterivReply(buf []byte) *GlxGetMinmaxParameterivReply { + v := new(GlxGetMinmaxParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetMinmaxParameterivCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetMinmaxParameteriv +func (c *Conn) glxGetMinmaxParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 159 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetCompressedTexImageARB +// size: 16 +type GlxGetCompressedTexImageARBCookie struct { + *cookie +} + +func (c *Conn) GlxGetCompressedTexImageARB(ContextTag GlxContextTag, Target uint32, Level int32) GlxGetCompressedTexImageARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetCompressedTexImageARBRequest(ContextTag, Target, Level), cookie) + return GlxGetCompressedTexImageARBCookie{cookie} +} + +func (c *Conn) GlxGetCompressedTexImageARBUnchecked(ContextTag GlxContextTag, Target uint32, Level int32) GlxGetCompressedTexImageARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetCompressedTexImageARBRequest(ContextTag, Target, Level), cookie) + return GlxGetCompressedTexImageARBCookie{cookie} +} + +// Request reply for GlxGetCompressedTexImageARB +// size: (32 + pad(((int(Length) * 4) * 1))) +type GlxGetCompressedTexImageARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Size int32 + // padding: 12 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GlxGetCompressedTexImageARB +func (cook GlxGetCompressedTexImageARBCookie) Reply() (*GlxGetCompressedTexImageARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetCompressedTexImageARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetCompressedTexImageARB +func glxGetCompressedTexImageARBReply(buf []byte) *GlxGetCompressedTexImageARBReply { + v := new(GlxGetCompressedTexImageARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Size = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook GlxGetCompressedTexImageARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetCompressedTexImageARB +func (c *Conn) glxGetCompressedTexImageARBRequest(ContextTag GlxContextTag, Target uint32, Level int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 160 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], uint32(Level)) + b += 4 + + return buf +} + +// Request GlxDeleteQueriesARB +// size: pad((12 + pad((int(N) * 4)))) +type GlxDeleteQueriesARBCookie struct { + *cookie +} + +// Write request to wire for GlxDeleteQueriesARB +func (c *Conn) GlxDeleteQueriesARB(ContextTag GlxContextTag, N int32, Ids []uint32) GlxDeleteQueriesARBCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.glxDeleteQueriesARBRequest(ContextTag, N, Ids), cookie) + return GlxDeleteQueriesARBCookie{cookie} +} + +func (c *Conn) GlxDeleteQueriesARBChecked(ContextTag GlxContextTag, N int32, Ids []uint32) GlxDeleteQueriesARBCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.glxDeleteQueriesARBRequest(ContextTag, N, Ids), cookie) + return GlxDeleteQueriesARBCookie{cookie} +} + +func (cook GlxDeleteQueriesARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxDeleteQueriesARB +func (c *Conn) glxDeleteQueriesARBRequest(ContextTag GlxContextTag, N int32, Ids []uint32) []byte { + size := pad((12 + pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 161 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + Put32(buf[b:], Ids[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request GlxGenQueriesARB +// size: 12 +type GlxGenQueriesARBCookie struct { + *cookie +} + +func (c *Conn) GlxGenQueriesARB(ContextTag GlxContextTag, N int32) GlxGenQueriesARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGenQueriesARBRequest(ContextTag, N), cookie) + return GlxGenQueriesARBCookie{cookie} +} + +func (c *Conn) GlxGenQueriesARBUnchecked(ContextTag GlxContextTag, N int32) GlxGenQueriesARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGenQueriesARBRequest(ContextTag, N), cookie) + return GlxGenQueriesARBCookie{cookie} +} + +// Request reply for GlxGenQueriesARB +// size: (32 + pad((int(Length) * 4))) +type GlxGenQueriesARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GlxGenQueriesARB +func (cook GlxGenQueriesARBCookie) Reply() (*GlxGenQueriesARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGenQueriesARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxGenQueriesARB +func glxGenQueriesARBReply(buf []byte) *GlxGenQueriesARBReply { + v := new(GlxGenQueriesARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGenQueriesARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGenQueriesARB +func (c *Conn) glxGenQueriesARBRequest(ContextTag GlxContextTag, N int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 162 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], uint32(N)) + b += 4 + + return buf +} + +// Request GlxIsQueryARB +// size: 12 +type GlxIsQueryARBCookie struct { + *cookie +} + +func (c *Conn) GlxIsQueryARB(ContextTag GlxContextTag, Id uint32) GlxIsQueryARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxIsQueryARBRequest(ContextTag, Id), cookie) + return GlxIsQueryARBCookie{cookie} +} + +func (c *Conn) GlxIsQueryARBUnchecked(ContextTag GlxContextTag, Id uint32) GlxIsQueryARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxIsQueryARBRequest(ContextTag, Id), cookie) + return GlxIsQueryARBCookie{cookie} +} + +// Request reply for GlxIsQueryARB +// size: 12 +type GlxIsQueryARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal GlxBool32 +} + +// Waits and reads reply data from request GlxIsQueryARB +func (cook GlxIsQueryARBCookie) Reply() (*GlxIsQueryARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxIsQueryARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxIsQueryARB +func glxIsQueryARBReply(buf []byte) *GlxIsQueryARBReply { + v := new(GlxIsQueryARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = GlxBool32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook GlxIsQueryARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxIsQueryARB +func (c *Conn) glxIsQueryARBRequest(ContextTag GlxContextTag, Id uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 163 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + return buf +} + +// Request GlxGetQueryivARB +// size: 16 +type GlxGetQueryivARBCookie struct { + *cookie +} + +func (c *Conn) GlxGetQueryivARB(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetQueryivARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetQueryivARBRequest(ContextTag, Target, Pname), cookie) + return GlxGetQueryivARBCookie{cookie} +} + +func (c *Conn) GlxGetQueryivARBUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetQueryivARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetQueryivARBRequest(ContextTag, Target, Pname), cookie) + return GlxGetQueryivARBCookie{cookie} +} + +// Request reply for GlxGetQueryivARB +// size: (32 + pad((int(N) * 4))) +type GlxGetQueryivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetQueryivARB +func (cook GlxGetQueryivARBCookie) Reply() (*GlxGetQueryivARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetQueryivARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetQueryivARB +func glxGetQueryivARBReply(buf []byte) *GlxGetQueryivARBReply { + v := new(GlxGetQueryivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetQueryivARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetQueryivARB +func (c *Conn) glxGetQueryivARBRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 164 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Target) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetQueryObjectivARB +// size: 16 +type GlxGetQueryObjectivARBCookie struct { + *cookie +} + +func (c *Conn) GlxGetQueryObjectivARB(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectivARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetQueryObjectivARBRequest(ContextTag, Id, Pname), cookie) + return GlxGetQueryObjectivARBCookie{cookie} +} + +func (c *Conn) GlxGetQueryObjectivARBUnchecked(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectivARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetQueryObjectivARBRequest(ContextTag, Id, Pname), cookie) + return GlxGetQueryObjectivARBCookie{cookie} +} + +// Request reply for GlxGetQueryObjectivARB +// size: (32 + pad((int(N) * 4))) +type GlxGetQueryObjectivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetQueryObjectivARB +func (cook GlxGetQueryObjectivARBCookie) Reply() (*GlxGetQueryObjectivARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetQueryObjectivARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetQueryObjectivARB +func glxGetQueryObjectivARBReply(buf []byte) *GlxGetQueryObjectivARBReply { + v := new(GlxGetQueryObjectivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = int32(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetQueryObjectivARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetQueryObjectivARB +func (c *Conn) glxGetQueryObjectivARBRequest(ContextTag GlxContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 165 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GlxGetQueryObjectuivARB +// size: 16 +type GlxGetQueryObjectuivARBCookie struct { + *cookie +} + +func (c *Conn) GlxGetQueryObjectuivARB(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectuivARBCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.glxGetQueryObjectuivARBRequest(ContextTag, Id, Pname), cookie) + return GlxGetQueryObjectuivARBCookie{cookie} +} + +func (c *Conn) GlxGetQueryObjectuivARBUnchecked(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectuivARBCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.glxGetQueryObjectuivARBRequest(ContextTag, Id, Pname), cookie) + return GlxGetQueryObjectuivARBCookie{cookie} +} + +// Request reply for GlxGetQueryObjectuivARB +// size: (32 + pad((int(N) * 4))) +type GlxGetQueryObjectuivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint32 + // padding: 12 bytes + Data []uint32 // size: pad((int(N) * 4)) +} + +// Waits and reads reply data from request GlxGetQueryObjectuivARB +func (cook GlxGetQueryObjectuivARBCookie) Reply() (*GlxGetQueryObjectuivARBReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return glxGetQueryObjectuivARBReply(buf), nil +} + +// Read reply into structure from buffer for GlxGetQueryObjectuivARB +func glxGetQueryObjectuivARBReply(buf []byte) *GlxGetQueryObjectuivARBReply { + v := new(GlxGetQueryObjectuivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = Get32(buf[b:]) + b += 4 + + v.Datum = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook GlxGetQueryObjectuivARBCookie) Check() error { + return cook.check() +} + +// Write request to wire for GlxGetQueryObjectuivARB +func (c *Conn) glxGetQueryObjectuivARBRequest(ContextTag GlxContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["GLX"] + b += 1 + + buf[b] = 166 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextTag)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + Put32(buf[b:], Pname) + b += 4 + + return buf +} diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index fdb10ca..bb092f5 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 5 2012 6:06:50pm EDT. + This file was generated by randr.xml on May 6 2012 3:00:44am EDT. This file is automatically generated. Edit at your peril! */ @@ -10,12 +10,6 @@ package xgb // import "xproto" // import "render" -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -36,6 +30,12 @@ package xgb // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go new file mode 100644 index 0000000..75caf76 --- /dev/null +++ b/nexgb/auto_record.go @@ -0,0 +1,1061 @@ +package xgb + +/* + This file was generated by record.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +const ( + RecordHTypeFromServerTime = 1 + RecordHTypeFromClientTime = 2 + RecordHTypeFromClientSequence = 4 +) + +const ( + RecordCsCurrentClients = 1 + RecordCsFutureClients = 2 + RecordCsAllClients = 3 +) + +// Skipping resource definition of 'Context' + +type RecordElementHeader byte + +type RecordClientSpec uint32 + +// 'RecordRange8' struct definition +// Size: 2 +type RecordRange8 struct { + First byte + Last byte +} + +// Struct read RecordRange8 +func ReadRecordRange8(buf []byte, v *RecordRange8) int { + b := 0 + + v.First = buf[b] + b += 1 + + v.Last = buf[b] + b += 1 + + return b +} + +// Struct list read RecordRange8 +func ReadRecordRange8List(buf []byte, dest []RecordRange8) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RecordRange8{} + b += ReadRecordRange8(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RecordRange8 +func (v RecordRange8) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.First + b += 1 + + buf[b] = v.Last + b += 1 + + return buf +} + +// Write struct list RecordRange8 +func RecordRange8ListBytes(buf []byte, list []RecordRange8) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RecordRange16' struct definition +// Size: 4 +type RecordRange16 struct { + First uint16 + Last uint16 +} + +// Struct read RecordRange16 +func ReadRecordRange16(buf []byte, v *RecordRange16) int { + b := 0 + + v.First = Get16(buf[b:]) + b += 2 + + v.Last = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read RecordRange16 +func ReadRecordRange16List(buf []byte, dest []RecordRange16) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RecordRange16{} + b += ReadRecordRange16(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RecordRange16 +func (v RecordRange16) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + Put16(buf[b:], v.First) + b += 2 + + Put16(buf[b:], v.Last) + b += 2 + + return buf +} + +// Write struct list RecordRange16 +func RecordRange16ListBytes(buf []byte, list []RecordRange16) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RecordExtRange' struct definition +// Size: 6 +type RecordExtRange struct { + Major RecordRange8 + Minor RecordRange16 +} + +// Struct read RecordExtRange +func ReadRecordExtRange(buf []byte, v *RecordExtRange) int { + b := 0 + + v.Major = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.Major) + + v.Minor = RecordRange16{} + b += ReadRecordRange16(buf[b:], &v.Minor) + + return b +} + +// Struct list read RecordExtRange +func ReadRecordExtRangeList(buf []byte, dest []RecordExtRange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RecordExtRange{} + b += ReadRecordExtRange(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RecordExtRange +func (v RecordExtRange) Bytes() []byte { + buf := make([]byte, 6) + b := 0 + + { + structBytes := v.Major.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.Minor.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list RecordExtRange +func RecordExtRangeListBytes(buf []byte, list []RecordExtRange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RecordRange' struct definition +// Size: 24 +type RecordRange struct { + CoreRequests RecordRange8 + CoreReplies RecordRange8 + ExtRequests RecordExtRange + ExtReplies RecordExtRange + DeliveredEvents RecordRange8 + DeviceEvents RecordRange8 + Errors RecordRange8 + ClientStarted bool + ClientDied bool +} + +// Struct read RecordRange +func ReadRecordRange(buf []byte, v *RecordRange) int { + b := 0 + + v.CoreRequests = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.CoreRequests) + + v.CoreReplies = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.CoreReplies) + + v.ExtRequests = RecordExtRange{} + b += ReadRecordExtRange(buf[b:], &v.ExtRequests) + + v.ExtReplies = RecordExtRange{} + b += ReadRecordExtRange(buf[b:], &v.ExtReplies) + + v.DeliveredEvents = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.DeliveredEvents) + + v.DeviceEvents = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.DeviceEvents) + + v.Errors = RecordRange8{} + b += ReadRecordRange8(buf[b:], &v.Errors) + + if buf[b] == 1 { + v.ClientStarted = true + } else { + v.ClientStarted = false + } + b += 1 + + if buf[b] == 1 { + v.ClientDied = true + } else { + v.ClientDied = false + } + b += 1 + + return b +} + +// Struct list read RecordRange +func ReadRecordRangeList(buf []byte, dest []RecordRange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RecordRange{} + b += ReadRecordRange(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RecordRange +func (v RecordRange) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.CoreRequests.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.CoreReplies.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.ExtRequests.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.ExtReplies.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.DeliveredEvents.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.DeviceEvents.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.Errors.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + if v.ClientStarted { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if v.ClientDied { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Write struct list RecordRange +func RecordRangeListBytes(buf []byte, list []RecordRange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'RecordClientInfo' struct definition +// Size: (8 + pad((int(NumRanges) * 24))) +type RecordClientInfo struct { + ClientResource RecordClientSpec + NumRanges uint32 + Ranges []RecordRange // size: pad((int(NumRanges) * 24)) +} + +// Struct read RecordClientInfo +func ReadRecordClientInfo(buf []byte, v *RecordClientInfo) int { + b := 0 + + v.ClientResource = RecordClientSpec(Get32(buf[b:])) + b += 4 + + v.NumRanges = Get32(buf[b:]) + b += 4 + + v.Ranges = make([]RecordRange, v.NumRanges) + b += ReadRecordRangeList(buf[b:], v.Ranges) + + return b +} + +// Struct list read RecordClientInfo +func ReadRecordClientInfoList(buf []byte, dest []RecordClientInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RecordClientInfo{} + b += ReadRecordClientInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write RecordClientInfo +func (v RecordClientInfo) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.NumRanges) * 24)))) + b := 0 + + Put32(buf[b:], uint32(v.ClientResource)) + b += 4 + + Put32(buf[b:], v.NumRanges) + b += 4 + + b += RecordRangeListBytes(buf[b:], v.Ranges) + + return buf +} + +// Write struct list RecordClientInfo +func RecordClientInfoListBytes(buf []byte, list []RecordClientInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size RecordClientInfo +func RecordClientInfoListSize(list []RecordClientInfo) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.NumRanges) * 24))) + } + return size +} + +// Error definition RecordBadContext (0) +// Size: 32 + +const BadRecordBadContext = 0 + +type RecordBadContextError struct { + Sequence uint16 + NiceName string + InvalidRecord uint32 +} + +// Error read RecordBadContext +func NewRecordBadContextError(buf []byte) Error { + v := RecordBadContextError{} + v.NiceName = "RecordBadContext" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.InvalidRecord = Get32(buf[b:]) + b += 4 + + return v +} + +func (err RecordBadContextError) ImplementsError() {} + +func (err RecordBadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err RecordBadContextError) BadId() Id { + return 0 +} + +func (err RecordBadContextError) Error() string { + fieldVals := make([]string, 0, 1) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("InvalidRecord: %d", err.InvalidRecord)) + return "BadRecordBadContext {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewRecordBadContextError +} + +// Request RecordQueryVersion +// size: 8 +type RecordQueryVersionCookie struct { + *cookie +} + +func (c *Conn) RecordQueryVersion(MajorVersion uint16, MinorVersion uint16) RecordQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.recordQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return RecordQueryVersionCookie{cookie} +} + +func (c *Conn) RecordQueryVersionUnchecked(MajorVersion uint16, MinorVersion uint16) RecordQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.recordQueryVersionRequest(MajorVersion, MinorVersion), cookie) + return RecordQueryVersionCookie{cookie} +} + +// Request reply for RecordQueryVersion +// size: 12 +type RecordQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request RecordQueryVersion +func (cook RecordQueryVersionCookie) Reply() (*RecordQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return recordQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for RecordQueryVersion +func recordQueryVersionReply(buf []byte) *RecordQueryVersionReply { + v := new(RecordQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook RecordQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordQueryVersion +func (c *Conn) recordQueryVersionRequest(MajorVersion uint16, MinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], MajorVersion) + b += 2 + + Put16(buf[b:], MinorVersion) + b += 2 + + return buf +} + +// Request RecordCreateContext +// size: pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) +type RecordCreateContextCookie struct { + *cookie +} + +// Write request to wire for RecordCreateContext +func (c *Conn) RecordCreateContext(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RecordCreateContextCookie{cookie} +} + +func (c *Conn) RecordCreateContextChecked(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RecordCreateContextCookie{cookie} +} + +func (cook RecordCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordCreateContext +func (c *Conn) recordCreateContextRequest(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { + size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = byte(ElementHeader) + b += 1 + + b += 3 // padding + + Put32(buf[b:], NumClientSpecs) + b += 4 + + Put32(buf[b:], NumRanges) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = pad(b) + + b += RecordRangeListBytes(buf[b:], Ranges) + + return buf +} + +// Request RecordRegisterClients +// size: pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) +type RecordRegisterClientsCookie struct { + *cookie +} + +// Write request to wire for RecordRegisterClients +func (c *Conn) RecordRegisterClients(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RecordRegisterClientsCookie{cookie} +} + +func (c *Conn) RecordRegisterClientsChecked(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RecordRegisterClientsCookie{cookie} +} + +func (cook RecordRegisterClientsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordRegisterClients +func (c *Conn) recordRegisterClientsRequest(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { + size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = byte(ElementHeader) + b += 1 + + b += 3 // padding + + Put32(buf[b:], NumClientSpecs) + b += 4 + + Put32(buf[b:], NumRanges) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = pad(b) + + b += RecordRangeListBytes(buf[b:], Ranges) + + return buf +} + +// Request RecordUnregisterClients +// size: pad((12 + pad((int(NumClientSpecs) * 4)))) +type RecordUnregisterClientsCookie struct { + *cookie +} + +// Write request to wire for RecordUnregisterClients +func (c *Conn) RecordUnregisterClients(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) + return RecordUnregisterClientsCookie{cookie} +} + +func (c *Conn) RecordUnregisterClientsChecked(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) + return RecordUnregisterClientsCookie{cookie} +} + +func (cook RecordUnregisterClientsCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordUnregisterClients +func (c *Conn) recordUnregisterClientsRequest(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) []byte { + size := pad((12 + pad((int(NumClientSpecs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], NumClientSpecs) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request RecordGetContext +// size: 8 +type RecordGetContextCookie struct { + *cookie +} + +func (c *Conn) RecordGetContext(Context Id) RecordGetContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.recordGetContextRequest(Context), cookie) + return RecordGetContextCookie{cookie} +} + +func (c *Conn) RecordGetContextUnchecked(Context Id) RecordGetContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.recordGetContextRequest(Context), cookie) + return RecordGetContextCookie{cookie} +} + +// Request reply for RecordGetContext +// size: (32 + RecordClientInfoListSize(InterceptedClients)) +type RecordGetContextReply struct { + Sequence uint16 + Length uint32 + Enabled bool + ElementHeader RecordElementHeader + // padding: 3 bytes + NumInterceptedClients uint32 + // padding: 16 bytes + InterceptedClients []RecordClientInfo // size: RecordClientInfoListSize(InterceptedClients) +} + +// Waits and reads reply data from request RecordGetContext +func (cook RecordGetContextCookie) Reply() (*RecordGetContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return recordGetContextReply(buf), nil +} + +// Read reply into structure from buffer for RecordGetContext +func recordGetContextReply(buf []byte) *RecordGetContextReply { + v := new(RecordGetContextReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ElementHeader = RecordElementHeader(buf[b]) + b += 1 + + b += 3 // padding + + v.NumInterceptedClients = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.InterceptedClients = make([]RecordClientInfo, v.NumInterceptedClients) + b += ReadRecordClientInfoList(buf[b:], v.InterceptedClients) + + return v +} + +func (cook RecordGetContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordGetContext +func (c *Conn) recordGetContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request RecordEnableContext +// size: 8 +type RecordEnableContextCookie struct { + *cookie +} + +func (c *Conn) RecordEnableContext(Context Id) RecordEnableContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.recordEnableContextRequest(Context), cookie) + return RecordEnableContextCookie{cookie} +} + +func (c *Conn) RecordEnableContextUnchecked(Context Id) RecordEnableContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.recordEnableContextRequest(Context), cookie) + return RecordEnableContextCookie{cookie} +} + +// Request reply for RecordEnableContext +// size: (32 + pad(((int(Length) * 4) * 1))) +type RecordEnableContextReply struct { + Sequence uint16 + Length uint32 + Category byte + ElementHeader RecordElementHeader + ClientSwapped bool + // padding: 2 bytes + XidBase uint32 + ServerTime uint32 + RecSequenceNum uint32 + // padding: 8 bytes + Data []byte // size: pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request RecordEnableContext +func (cook RecordEnableContextCookie) Reply() (*RecordEnableContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return recordEnableContextReply(buf), nil +} + +// Read reply into structure from buffer for RecordEnableContext +func recordEnableContextReply(buf []byte) *RecordEnableContextReply { + v := new(RecordEnableContextReply) + b := 1 // skip reply determinant + + v.Category = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ElementHeader = RecordElementHeader(buf[b]) + b += 1 + + if buf[b] == 1 { + v.ClientSwapped = true + } else { + v.ClientSwapped = false + } + b += 1 + + b += 2 // padding + + v.XidBase = Get32(buf[b:]) + b += 4 + + v.ServerTime = Get32(buf[b:]) + b += 4 + + v.RecSequenceNum = Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += pad(int((int(v.Length) * 4))) + + return v +} + +func (cook RecordEnableContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordEnableContext +func (c *Conn) recordEnableContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request RecordDisableContext +// size: 8 +type RecordDisableContextCookie struct { + *cookie +} + +// Write request to wire for RecordDisableContext +func (c *Conn) RecordDisableContext(Context Id) RecordDisableContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.recordDisableContextRequest(Context), cookie) + return RecordDisableContextCookie{cookie} +} + +func (c *Conn) RecordDisableContextChecked(Context Id) RecordDisableContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.recordDisableContextRequest(Context), cookie) + return RecordDisableContextCookie{cookie} +} + +func (cook RecordDisableContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordDisableContext +func (c *Conn) recordDisableContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request RecordFreeContext +// size: 8 +type RecordFreeContextCookie struct { + *cookie +} + +// Write request to wire for RecordFreeContext +func (c *Conn) RecordFreeContext(Context Id) RecordFreeContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.recordFreeContextRequest(Context), cookie) + return RecordFreeContextCookie{cookie} +} + +func (c *Conn) RecordFreeContextChecked(Context Id) RecordFreeContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.recordFreeContextRequest(Context), cookie) + return RecordFreeContextCookie{cookie} +} + +func (cook RecordFreeContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for RecordFreeContext +func (c *Conn) recordFreeContextRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["RECORD"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index 069ce76..f6b37b7 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 5 2012 6:07:02pm EDT. + This file was generated by render.xml on May 6 2012 3:00:44am EDT. This file is automatically generated. Edit at your peril! */ @@ -9,18 +9,6 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -35,6 +23,18 @@ package xgb // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go new file mode 100644 index 0000000..066bad8 --- /dev/null +++ b/nexgb/auto_res.go @@ -0,0 +1,502 @@ +package xgb + +/* + This file was generated by res.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// 'ResClient' struct definition +// Size: 8 +type ResClient struct { + ResourceBase uint32 + ResourceMask uint32 +} + +// Struct read ResClient +func ReadResClient(buf []byte, v *ResClient) int { + b := 0 + + v.ResourceBase = Get32(buf[b:]) + b += 4 + + v.ResourceMask = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read ResClient +func ReadResClientList(buf []byte, dest []ResClient) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResClient{} + b += ReadResClient(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write ResClient +func (v ResClient) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], v.ResourceBase) + b += 4 + + Put32(buf[b:], v.ResourceMask) + b += 4 + + return buf +} + +// Write struct list ResClient +func ResClientListBytes(buf []byte, list []ResClient) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'ResType' struct definition +// Size: 8 +type ResType struct { + ResourceType Id + Count uint32 +} + +// Struct read ResType +func ReadResType(buf []byte, v *ResType) int { + b := 0 + + v.ResourceType = Id(Get32(buf[b:])) + b += 4 + + v.Count = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read ResType +func ReadResTypeList(buf []byte, dest []ResType) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResType{} + b += ReadResType(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write ResType +func (v ResType) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.ResourceType)) + b += 4 + + Put32(buf[b:], v.Count) + b += 4 + + return buf +} + +// Write struct list ResType +func ResTypeListBytes(buf []byte, list []ResType) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Request ResQueryVersion +// size: 8 +type ResQueryVersionCookie struct { + *cookie +} + +func (c *Conn) ResQueryVersion(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie) + return ResQueryVersionCookie{cookie} +} + +func (c *Conn) ResQueryVersionUnchecked(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie) + return ResQueryVersionCookie{cookie} +} + +// Request reply for ResQueryVersion +// size: 12 +type ResQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 +} + +// Waits and reads reply data from request ResQueryVersion +func (cook ResQueryVersionCookie) Reply() (*ResQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return resQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for ResQueryVersion +func resQueryVersionReply(buf []byte) *ResQueryVersionReply { + v := new(ResQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = Get16(buf[b:]) + b += 2 + + v.ServerMinor = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook ResQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for ResQueryVersion +func (c *Conn) resQueryVersionRequest(ClientMajor byte, ClientMinor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["X-RESOURCE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 + + return buf +} + +// Request ResQueryClients +// size: 4 +type ResQueryClientsCookie struct { + *cookie +} + +func (c *Conn) ResQueryClients() ResQueryClientsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.resQueryClientsRequest(), cookie) + return ResQueryClientsCookie{cookie} +} + +func (c *Conn) ResQueryClientsUnchecked() ResQueryClientsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.resQueryClientsRequest(), cookie) + return ResQueryClientsCookie{cookie} +} + +// Request reply for ResQueryClients +// size: (32 + pad((int(NumClients) * 8))) +type ResQueryClientsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClients uint32 + // padding: 20 bytes + Clients []ResClient // size: pad((int(NumClients) * 8)) +} + +// Waits and reads reply data from request ResQueryClients +func (cook ResQueryClientsCookie) Reply() (*ResQueryClientsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return resQueryClientsReply(buf), nil +} + +// Read reply into structure from buffer for ResQueryClients +func resQueryClientsReply(buf []byte) *ResQueryClientsReply { + v := new(ResQueryClientsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClients = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Clients = make([]ResClient, v.NumClients) + b += ReadResClientList(buf[b:], v.Clients) + + return v +} + +func (cook ResQueryClientsCookie) Check() error { + return cook.check() +} + +// Write request to wire for ResQueryClients +func (c *Conn) resQueryClientsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["X-RESOURCE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ResQueryClientResources +// size: 8 +type ResQueryClientResourcesCookie struct { + *cookie +} + +func (c *Conn) ResQueryClientResources(Xid uint32) ResQueryClientResourcesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie) + return ResQueryClientResourcesCookie{cookie} +} + +func (c *Conn) ResQueryClientResourcesUnchecked(Xid uint32) ResQueryClientResourcesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie) + return ResQueryClientResourcesCookie{cookie} +} + +// Request reply for ResQueryClientResources +// size: (32 + pad((int(NumTypes) * 8))) +type ResQueryClientResourcesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumTypes uint32 + // padding: 20 bytes + Types []ResType // size: pad((int(NumTypes) * 8)) +} + +// Waits and reads reply data from request ResQueryClientResources +func (cook ResQueryClientResourcesCookie) Reply() (*ResQueryClientResourcesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return resQueryClientResourcesReply(buf), nil +} + +// Read reply into structure from buffer for ResQueryClientResources +func resQueryClientResourcesReply(buf []byte) *ResQueryClientResourcesReply { + v := new(ResQueryClientResourcesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumTypes = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Types = make([]ResType, v.NumTypes) + b += ReadResTypeList(buf[b:], v.Types) + + return v +} + +func (cook ResQueryClientResourcesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ResQueryClientResources +func (c *Conn) resQueryClientResourcesRequest(Xid uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["X-RESOURCE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Xid) + b += 4 + + return buf +} + +// Request ResQueryClientPixmapBytes +// size: 8 +type ResQueryClientPixmapBytesCookie struct { + *cookie +} + +func (c *Conn) ResQueryClientPixmapBytes(Xid uint32) ResQueryClientPixmapBytesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie) + return ResQueryClientPixmapBytesCookie{cookie} +} + +func (c *Conn) ResQueryClientPixmapBytesUnchecked(Xid uint32) ResQueryClientPixmapBytesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie) + return ResQueryClientPixmapBytesCookie{cookie} +} + +// Request reply for ResQueryClientPixmapBytes +// size: 16 +type ResQueryClientPixmapBytesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Bytes uint32 + BytesOverflow uint32 +} + +// Waits and reads reply data from request ResQueryClientPixmapBytes +func (cook ResQueryClientPixmapBytesCookie) Reply() (*ResQueryClientPixmapBytesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return resQueryClientPixmapBytesReply(buf), nil +} + +// Read reply into structure from buffer for ResQueryClientPixmapBytes +func resQueryClientPixmapBytesReply(buf []byte) *ResQueryClientPixmapBytesReply { + v := new(ResQueryClientPixmapBytesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Bytes = Get32(buf[b:]) + b += 4 + + v.BytesOverflow = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook ResQueryClientPixmapBytesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ResQueryClientPixmapBytes +func (c *Conn) resQueryClientPixmapBytesRequest(Xid uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["X-RESOURCE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Xid) + b += 4 + + return buf +} diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go new file mode 100644 index 0000000..c023eec --- /dev/null +++ b/nexgb/auto_screensaver.go @@ -0,0 +1,601 @@ +package xgb + +/* + This file was generated by screensaver.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +const ( + ScreensaverKindBlanked = 0 + ScreensaverKindInternal = 1 + ScreensaverKindExternal = 2 +) + +const ( + ScreensaverEventNotifyMask = 1 + ScreensaverEventCycleMask = 2 +) + +const ( + ScreensaverStateOff = 0 + ScreensaverStateOn = 1 + ScreensaverStateCycle = 2 + ScreensaverStateDisabled = 3 +) + +// Event definition ScreensaverNotify (0) +// Size: 32 + +const ScreensaverNotify = 0 + +type ScreensaverNotifyEvent struct { + Sequence uint16 + Code byte + State byte + // padding: 1 bytes + SequenceNumber uint16 + Time Timestamp + Root Id + Window Id + Kind byte + Forced bool + // padding: 14 bytes +} + +// Event read ScreensaverNotify +func NewScreensaverNotifyEvent(buf []byte) Event { + v := ScreensaverNotifyEvent{} + b := 1 // don't read event number + + v.Code = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.State = buf[b] + b += 1 + + b += 1 // padding + + v.SequenceNumber = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Kind = buf[b] + b += 1 + + if buf[b] == 1 { + v.Forced = true + } else { + v.Forced = false + } + b += 1 + + b += 14 // padding + + return v +} + +// Event write ScreensaverNotify +func (v ScreensaverNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Code + b += 1 + + b += 2 // skip sequence number + + buf[b] = v.State + b += 1 + + b += 1 // padding + + Put16(buf[b:], v.SequenceNumber) + b += 2 + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.Kind + b += 1 + + if v.Forced { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 14 // padding + + return buf +} + +func (v ScreensaverNotifyEvent) ImplementsEvent() {} + +func (v ScreensaverNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ScreensaverNotifyEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Code: %d", v.Code)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SequenceNumber: %d", v.SequenceNumber)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, sprintf("Forced: %t", v.Forced)) + return "ScreensaverNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewScreensaverNotifyEvent +} + +// Request ScreensaverQueryVersion +// size: 8 +type ScreensaverQueryVersionCookie struct { + *cookie +} + +func (c *Conn) ScreensaverQueryVersion(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return ScreensaverQueryVersionCookie{cookie} +} + +func (c *Conn) ScreensaverQueryVersionUnchecked(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return ScreensaverQueryVersionCookie{cookie} +} + +// Request reply for ScreensaverQueryVersion +// size: 32 +type ScreensaverQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request ScreensaverQueryVersion +func (cook ScreensaverQueryVersionCookie) Reply() (*ScreensaverQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return screensaverQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for ScreensaverQueryVersion +func screensaverQueryVersionReply(buf []byte) *ScreensaverQueryVersionReply { + v := new(ScreensaverQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +func (cook ScreensaverQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverQueryVersion +func (c *Conn) screensaverQueryVersionRequest(ClientMajorVersion byte, ClientMinorVersion byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajorVersion + b += 1 + + buf[b] = ClientMinorVersion + b += 1 + + b += 2 // padding + + return buf +} + +// Request ScreensaverQueryInfo +// size: 8 +type ScreensaverQueryInfoCookie struct { + *cookie +} + +func (c *Conn) ScreensaverQueryInfo(Drawable Id) ScreensaverQueryInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) + return ScreensaverQueryInfoCookie{cookie} +} + +func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Id) ScreensaverQueryInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) + return ScreensaverQueryInfoCookie{cookie} +} + +// Request reply for ScreensaverQueryInfo +// size: 32 +type ScreensaverQueryInfoReply struct { + Sequence uint16 + Length uint32 + State byte + SaverWindow Id + MsUntilServer uint32 + MsSinceUserInput uint32 + EventMask uint32 + Kind byte + // padding: 7 bytes +} + +// Waits and reads reply data from request ScreensaverQueryInfo +func (cook ScreensaverQueryInfoCookie) Reply() (*ScreensaverQueryInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return screensaverQueryInfoReply(buf), nil +} + +// Read reply into structure from buffer for ScreensaverQueryInfo +func screensaverQueryInfoReply(buf []byte) *ScreensaverQueryInfoReply { + v := new(ScreensaverQueryInfoReply) + b := 1 // skip reply determinant + + v.State = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.SaverWindow = Id(Get32(buf[b:])) + b += 4 + + v.MsUntilServer = Get32(buf[b:]) + b += 4 + + v.MsSinceUserInput = Get32(buf[b:]) + b += 4 + + v.EventMask = Get32(buf[b:]) + b += 4 + + v.Kind = buf[b] + b += 1 + + b += 7 // padding + + return v +} + +func (cook ScreensaverQueryInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverQueryInfo +func (c *Conn) screensaverQueryInfoRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request ScreensaverSelectInput +// size: 12 +type ScreensaverSelectInputCookie struct { + *cookie +} + +// Write request to wire for ScreensaverSelectInput +func (c *Conn) ScreensaverSelectInput(Drawable Id, EventMask uint32) ScreensaverSelectInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) + return ScreensaverSelectInputCookie{cookie} +} + +func (c *Conn) ScreensaverSelectInputChecked(Drawable Id, EventMask uint32) ScreensaverSelectInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) + return ScreensaverSelectInputCookie{cookie} +} + +func (cook ScreensaverSelectInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverSelectInput +func (c *Conn) screensaverSelectInputRequest(Drawable Id, EventMask uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request ScreensaverSetAttributes +// size: pad((24 + (4 + pad((4 * popCount(int(ValueMask))))))) +type ScreensaverSetAttributesCookie struct { + *cookie +} + +// Write request to wire for ScreensaverSetAttributes +func (c *Conn) ScreensaverSetAttributes(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) + return ScreensaverSetAttributesCookie{cookie} +} + +func (c *Conn) ScreensaverSetAttributesChecked(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) + return ScreensaverSetAttributesCookie{cookie} +} + +func (cook ScreensaverSetAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverSetAttributes +func (c *Conn) screensaverSetAttributesRequest(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { + size := pad((24 + (4 + pad((4 * popCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put16(buf[b:], BorderWidth) + b += 2 + + buf[b] = Class + b += 1 + + buf[b] = Depth + b += 1 + + Put32(buf[b:], uint32(Visual)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request ScreensaverUnsetAttributes +// size: 8 +type ScreensaverUnsetAttributesCookie struct { + *cookie +} + +// Write request to wire for ScreensaverUnsetAttributes +func (c *Conn) ScreensaverUnsetAttributes(Drawable Id) ScreensaverUnsetAttributesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) + return ScreensaverUnsetAttributesCookie{cookie} +} + +func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Id) ScreensaverUnsetAttributesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) + return ScreensaverUnsetAttributesCookie{cookie} +} + +func (cook ScreensaverUnsetAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverUnsetAttributes +func (c *Conn) screensaverUnsetAttributesRequest(Drawable Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request ScreensaverSuspend +// size: 8 +type ScreensaverSuspendCookie struct { + *cookie +} + +// Write request to wire for ScreensaverSuspend +func (c *Conn) ScreensaverSuspend(Suspend bool) ScreensaverSuspendCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.screensaverSuspendRequest(Suspend), cookie) + return ScreensaverSuspendCookie{cookie} +} + +func (c *Conn) ScreensaverSuspendChecked(Suspend bool) ScreensaverSuspendCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.screensaverSuspendRequest(Suspend), cookie) + return ScreensaverSuspendCookie{cookie} +} + +func (cook ScreensaverSuspendCookie) Check() error { + return cook.check() +} + +// Write request to wire for ScreensaverSuspend +func (c *Conn) screensaverSuspendRequest(Suspend bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Suspend { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go new file mode 100644 index 0000000..b5c5f04 --- /dev/null +++ b/nexgb/auto_shape.go @@ -0,0 +1,871 @@ +package xgb + +/* + This file was generated by shape.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +const ( + ShapeSoSet = 0 + ShapeSoUnion = 1 + ShapeSoIntersect = 2 + ShapeSoSubtract = 3 + ShapeSoInvert = 4 +) + +const ( + ShapeSkBounding = 0 + ShapeSkClip = 1 + ShapeSkInput = 2 +) + +type ShapeOp byte + +type ShapeKind byte + +// Event definition ShapeNotify (0) +// Size: 32 + +const ShapeNotify = 0 + +type ShapeNotifyEvent struct { + Sequence uint16 + ShapeKind ShapeKind + AffectedWindow Id + ExtentsX int16 + ExtentsY int16 + ExtentsWidth uint16 + ExtentsHeight uint16 + ServerTime Timestamp + Shaped bool + // padding: 11 bytes +} + +// Event read ShapeNotify +func NewShapeNotifyEvent(buf []byte) Event { + v := ShapeNotifyEvent{} + b := 1 // don't read event number + + v.ShapeKind = ShapeKind(buf[b]) + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.AffectedWindow = Id(Get32(buf[b:])) + b += 4 + + v.ExtentsX = int16(Get16(buf[b:])) + b += 2 + + v.ExtentsY = int16(Get16(buf[b:])) + b += 2 + + v.ExtentsWidth = Get16(buf[b:]) + b += 2 + + v.ExtentsHeight = Get16(buf[b:]) + b += 2 + + v.ServerTime = Timestamp(Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.Shaped = true + } else { + v.Shaped = false + } + b += 1 + + b += 11 // padding + + return v +} + +// Event write ShapeNotify +func (v ShapeNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = byte(v.ShapeKind) + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.AffectedWindow)) + b += 4 + + Put16(buf[b:], uint16(v.ExtentsX)) + b += 2 + + Put16(buf[b:], uint16(v.ExtentsY)) + b += 2 + + Put16(buf[b:], v.ExtentsWidth) + b += 2 + + Put16(buf[b:], v.ExtentsHeight) + b += 2 + + Put32(buf[b:], uint32(v.ServerTime)) + b += 4 + + if v.Shaped { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 11 // padding + + return buf +} + +func (v ShapeNotifyEvent) ImplementsEvent() {} + +func (v ShapeNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ShapeNotifyEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("ShapeKind: %d", v.ShapeKind)) + fieldVals = append(fieldVals, sprintf("AffectedWindow: %d", v.AffectedWindow)) + fieldVals = append(fieldVals, sprintf("ExtentsX: %d", v.ExtentsX)) + fieldVals = append(fieldVals, sprintf("ExtentsY: %d", v.ExtentsY)) + fieldVals = append(fieldVals, sprintf("ExtentsWidth: %d", v.ExtentsWidth)) + fieldVals = append(fieldVals, sprintf("ExtentsHeight: %d", v.ExtentsHeight)) + fieldVals = append(fieldVals, sprintf("ServerTime: %d", v.ServerTime)) + fieldVals = append(fieldVals, sprintf("Shaped: %t", v.Shaped)) + return "ShapeNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewShapeNotifyEvent +} + +// Request ShapeQueryVersion +// size: 4 +type ShapeQueryVersionCookie struct { + *cookie +} + +func (c *Conn) ShapeQueryVersion() ShapeQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shapeQueryVersionRequest(), cookie) + return ShapeQueryVersionCookie{cookie} +} + +func (c *Conn) ShapeQueryVersionUnchecked() ShapeQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shapeQueryVersionRequest(), cookie) + return ShapeQueryVersionCookie{cookie} +} + +// Request reply for ShapeQueryVersion +// size: 12 +type ShapeQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request ShapeQueryVersion +func (cook ShapeQueryVersionCookie) Reply() (*ShapeQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shapeQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for ShapeQueryVersion +func shapeQueryVersionReply(buf []byte) *ShapeQueryVersionReply { + v := new(ShapeQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook ShapeQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeQueryVersion +func (c *Conn) shapeQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ShapeRectangles +// size: pad((16 + pad((len(Rectangles) * 8)))) +type ShapeRectanglesCookie struct { + *cookie +} + +// Write request to wire for ShapeRectangles +func (c *Conn) ShapeRectangles(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return ShapeRectanglesCookie{cookie} +} + +func (c *Conn) ShapeRectanglesChecked(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return ShapeRectanglesCookie{cookie} +} + +func (cook ShapeRectanglesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeRectangles +func (c *Conn) shapeRectanglesRequest(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) []byte { + size := pad((16 + pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + buf[b] = Ordering + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + Put16(buf[b:], uint16(XOffset)) + b += 2 + + Put16(buf[b:], uint16(YOffset)) + b += 2 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request ShapeMask +// size: 20 +type ShapeMaskCookie struct { + *cookie +} + +// Write request to wire for ShapeMask +func (c *Conn) ShapeMask(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) ShapeMaskCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return ShapeMaskCookie{cookie} +} + +func (c *Conn) ShapeMaskChecked(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) ShapeMaskCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return ShapeMaskCookie{cookie} +} + +func (cook ShapeMaskCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeMask +func (c *Conn) shapeMaskRequest(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + b += 2 // padding + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + Put16(buf[b:], uint16(XOffset)) + b += 2 + + Put16(buf[b:], uint16(YOffset)) + b += 2 + + Put32(buf[b:], uint32(SourceBitmap)) + b += 4 + + return buf +} + +// Request ShapeCombine +// size: 20 +type ShapeCombineCookie struct { + *cookie +} + +// Write request to wire for ShapeCombine +func (c *Conn) ShapeCombine(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) ShapeCombineCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) + return ShapeCombineCookie{cookie} +} + +func (c *Conn) ShapeCombineChecked(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) ShapeCombineCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) + return ShapeCombineCookie{cookie} +} + +func (cook ShapeCombineCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeCombine +func (c *Conn) shapeCombineRequest(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + buf[b] = byte(SourceKind) + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + Put16(buf[b:], uint16(XOffset)) + b += 2 + + Put16(buf[b:], uint16(YOffset)) + b += 2 + + Put32(buf[b:], uint32(SourceWindow)) + b += 4 + + return buf +} + +// Request ShapeOffset +// size: 16 +type ShapeOffsetCookie struct { + *cookie +} + +// Write request to wire for ShapeOffset +func (c *Conn) ShapeOffset(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) ShapeOffsetCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) + return ShapeOffsetCookie{cookie} +} + +func (c *Conn) ShapeOffsetChecked(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) ShapeOffsetCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) + return ShapeOffsetCookie{cookie} +} + +func (cook ShapeOffsetCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeOffset +func (c *Conn) shapeOffsetRequest(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(DestinationKind) + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + Put16(buf[b:], uint16(XOffset)) + b += 2 + + Put16(buf[b:], uint16(YOffset)) + b += 2 + + return buf +} + +// Request ShapeQueryExtents +// size: 8 +type ShapeQueryExtentsCookie struct { + *cookie +} + +func (c *Conn) ShapeQueryExtents(DestinationWindow Id) ShapeQueryExtentsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) + return ShapeQueryExtentsCookie{cookie} +} + +func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Id) ShapeQueryExtentsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) + return ShapeQueryExtentsCookie{cookie} +} + +// Request reply for ShapeQueryExtents +// size: 28 +type ShapeQueryExtentsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + BoundingShaped bool + ClipShaped bool + // padding: 2 bytes + BoundingShapeExtentsX int16 + BoundingShapeExtentsY int16 + BoundingShapeExtentsWidth uint16 + BoundingShapeExtentsHeight uint16 + ClipShapeExtentsX int16 + ClipShapeExtentsY int16 + ClipShapeExtentsWidth uint16 + ClipShapeExtentsHeight uint16 +} + +// Waits and reads reply data from request ShapeQueryExtents +func (cook ShapeQueryExtentsCookie) Reply() (*ShapeQueryExtentsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shapeQueryExtentsReply(buf), nil +} + +// Read reply into structure from buffer for ShapeQueryExtents +func shapeQueryExtentsReply(buf []byte) *ShapeQueryExtentsReply { + v := new(ShapeQueryExtentsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.BoundingShaped = true + } else { + v.BoundingShaped = false + } + b += 1 + + if buf[b] == 1 { + v.ClipShaped = true + } else { + v.ClipShaped = false + } + b += 1 + + b += 2 // padding + + v.BoundingShapeExtentsX = int16(Get16(buf[b:])) + b += 2 + + v.BoundingShapeExtentsY = int16(Get16(buf[b:])) + b += 2 + + v.BoundingShapeExtentsWidth = Get16(buf[b:]) + b += 2 + + v.BoundingShapeExtentsHeight = Get16(buf[b:]) + b += 2 + + v.ClipShapeExtentsX = int16(Get16(buf[b:])) + b += 2 + + v.ClipShapeExtentsY = int16(Get16(buf[b:])) + b += 2 + + v.ClipShapeExtentsWidth = Get16(buf[b:]) + b += 2 + + v.ClipShapeExtentsHeight = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook ShapeQueryExtentsCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeQueryExtents +func (c *Conn) shapeQueryExtentsRequest(DestinationWindow Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + return buf +} + +// Request ShapeSelectInput +// size: 12 +type ShapeSelectInputCookie struct { + *cookie +} + +// Write request to wire for ShapeSelectInput +func (c *Conn) ShapeSelectInput(DestinationWindow Id, Enable bool) ShapeSelectInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) + return ShapeSelectInputCookie{cookie} +} + +func (c *Conn) ShapeSelectInputChecked(DestinationWindow Id, Enable bool) ShapeSelectInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) + return ShapeSelectInputCookie{cookie} +} + +func (cook ShapeSelectInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeSelectInput +func (c *Conn) shapeSelectInputRequest(DestinationWindow Id, Enable bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + if Enable { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request ShapeInputSelected +// size: 8 +type ShapeInputSelectedCookie struct { + *cookie +} + +func (c *Conn) ShapeInputSelected(DestinationWindow Id) ShapeInputSelectedCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) + return ShapeInputSelectedCookie{cookie} +} + +func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Id) ShapeInputSelectedCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) + return ShapeInputSelectedCookie{cookie} +} + +// Request reply for ShapeInputSelected +// size: 8 +type ShapeInputSelectedReply struct { + Sequence uint16 + Length uint32 + Enabled bool +} + +// Waits and reads reply data from request ShapeInputSelected +func (cook ShapeInputSelectedCookie) Reply() (*ShapeInputSelectedReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shapeInputSelectedReply(buf), nil +} + +// Read reply into structure from buffer for ShapeInputSelected +func shapeInputSelectedReply(buf []byte) *ShapeInputSelectedReply { + v := new(ShapeInputSelectedReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +func (cook ShapeInputSelectedCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeInputSelected +func (c *Conn) shapeInputSelectedRequest(DestinationWindow Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + return buf +} + +// Request ShapeGetRectangles +// size: 12 +type ShapeGetRectanglesCookie struct { + *cookie +} + +func (c *Conn) ShapeGetRectangles(Window Id, SourceKind ShapeKind) ShapeGetRectanglesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) + return ShapeGetRectanglesCookie{cookie} +} + +func (c *Conn) ShapeGetRectanglesUnchecked(Window Id, SourceKind ShapeKind) ShapeGetRectanglesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) + return ShapeGetRectanglesCookie{cookie} +} + +// Request reply for ShapeGetRectangles +// size: (32 + pad((int(RectanglesLen) * 8))) +type ShapeGetRectanglesReply struct { + Sequence uint16 + Length uint32 + Ordering byte + RectanglesLen uint32 + // padding: 20 bytes + Rectangles []Rectangle // size: pad((int(RectanglesLen) * 8)) +} + +// Waits and reads reply data from request ShapeGetRectangles +func (cook ShapeGetRectanglesCookie) Reply() (*ShapeGetRectanglesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shapeGetRectanglesReply(buf), nil +} + +// Read reply into structure from buffer for ShapeGetRectangles +func shapeGetRectanglesReply(buf []byte) *ShapeGetRectanglesReply { + v := new(ShapeGetRectanglesReply) + b := 1 // skip reply determinant + + v.Ordering = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.RectanglesLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Rectangles = make([]Rectangle, v.RectanglesLen) + b += ReadRectangleList(buf[b:], v.Rectangles) + + return v +} + +func (cook ShapeGetRectanglesCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShapeGetRectangles +func (c *Conn) shapeGetRectanglesRequest(Window Id, SourceKind ShapeKind) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SHAPE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = byte(SourceKind) + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go new file mode 100644 index 0000000..5b7ba28 --- /dev/null +++ b/nexgb/auto_shm.go @@ -0,0 +1,644 @@ +package xgb + +/* + This file was generated by shm.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping resource definition of 'Seg' + +// Event definition ShmCompletion (0) +// Size: 32 + +const ShmCompletion = 0 + +type ShmCompletionEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Id + MinorEvent uint16 + MajorEvent byte + // padding: 1 bytes + Shmseg Id + Offset uint32 +} + +// Event read ShmCompletion +func NewShmCompletionEvent(buf []byte) Event { + v := ShmCompletionEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.MinorEvent = Get16(buf[b:]) + b += 2 + + v.MajorEvent = buf[b] + b += 1 + + b += 1 // padding + + v.Shmseg = Id(Get32(buf[b:])) + b += 4 + + v.Offset = Get32(buf[b:]) + b += 4 + + return v +} + +// Event write ShmCompletion +func (v ShmCompletionEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put16(buf[b:], v.MinorEvent) + b += 2 + + buf[b] = v.MajorEvent + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(v.Shmseg)) + b += 4 + + Put32(buf[b:], v.Offset) + b += 4 + + return buf +} + +func (v ShmCompletionEvent) ImplementsEvent() {} + +func (v ShmCompletionEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ShmCompletionEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("MinorEvent: %d", v.MinorEvent)) + fieldVals = append(fieldVals, sprintf("MajorEvent: %d", v.MajorEvent)) + fieldVals = append(fieldVals, sprintf("Shmseg: %d", v.Shmseg)) + fieldVals = append(fieldVals, sprintf("Offset: %d", v.Offset)) + return "ShmCompletion {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewShmCompletionEvent +} + +// ErrorCopy definition ShmBadSeg (0) + +const BadShmBadSeg = 0 + +type ShmBadSegError ValueError + +func NewShmBadSegError(buf []byte) Error { + v := ShmBadSegError(NewValueError(buf).(ValueError)) + v.NiceName = "ShmBadSeg" + return v +} + +func (err ShmBadSegError) ImplementsError() {} + +func (err ShmBadSegError) SequenceId() uint16 { + return err.Sequence +} + +func (err ShmBadSegError) BadId() Id { + return Id(err.BadValue) +} + +func (err ShmBadSegError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadShmBadSeg {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewShmBadSegError +} + +// Request ShmQueryVersion +// size: 4 +type ShmQueryVersionCookie struct { + *cookie +} + +func (c *Conn) ShmQueryVersion() ShmQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shmQueryVersionRequest(), cookie) + return ShmQueryVersionCookie{cookie} +} + +func (c *Conn) ShmQueryVersionUnchecked() ShmQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shmQueryVersionRequest(), cookie) + return ShmQueryVersionCookie{cookie} +} + +// Request reply for ShmQueryVersion +// size: 32 +type ShmQueryVersionReply struct { + Sequence uint16 + Length uint32 + SharedPixmaps bool + MajorVersion uint16 + MinorVersion uint16 + Uid uint16 + Gid uint16 + PixmapFormat byte + // padding: 15 bytes +} + +// Waits and reads reply data from request ShmQueryVersion +func (cook ShmQueryVersionCookie) Reply() (*ShmQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shmQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for ShmQueryVersion +func shmQueryVersionReply(buf []byte) *ShmQueryVersionReply { + v := new(ShmQueryVersionReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SharedPixmaps = true + } else { + v.SharedPixmaps = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + v.Uid = Get16(buf[b:]) + b += 2 + + v.Gid = Get16(buf[b:]) + b += 2 + + v.PixmapFormat = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +func (cook ShmQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmQueryVersion +func (c *Conn) shmQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ShmAttach +// size: 16 +type ShmAttachCookie struct { + *cookie +} + +// Write request to wire for ShmAttach +func (c *Conn) ShmAttach(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) + return ShmAttachCookie{cookie} +} + +func (c *Conn) ShmAttachChecked(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) + return ShmAttachCookie{cookie} +} + +func (cook ShmAttachCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmAttach +func (c *Conn) shmAttachRequest(Shmseg Id, Shmid uint32, ReadOnly bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + Put32(buf[b:], Shmid) + b += 4 + + if ReadOnly { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request ShmDetach +// size: 8 +type ShmDetachCookie struct { + *cookie +} + +// Write request to wire for ShmDetach +func (c *Conn) ShmDetach(Shmseg Id) ShmDetachCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shmDetachRequest(Shmseg), cookie) + return ShmDetachCookie{cookie} +} + +func (c *Conn) ShmDetachChecked(Shmseg Id) ShmDetachCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shmDetachRequest(Shmseg), cookie) + return ShmDetachCookie{cookie} +} + +func (cook ShmDetachCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmDetach +func (c *Conn) shmDetachRequest(Shmseg Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + return buf +} + +// Request ShmPutImage +// size: 40 +type ShmPutImageCookie struct { + *cookie +} + +// Write request to wire for ShmPutImage +func (c *Conn) ShmPutImage(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return ShmPutImageCookie{cookie} +} + +func (c *Conn) ShmPutImageChecked(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return ShmPutImageCookie{cookie} +} + +func (cook ShmPutImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmPutImage +func (c *Conn) shmPutImageRequest(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) []byte { + size := 40 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], TotalWidth) + b += 2 + + Put16(buf[b:], TotalHeight) + b += 2 + + Put16(buf[b:], SrcX) + b += 2 + + Put16(buf[b:], SrcY) + b += 2 + + Put16(buf[b:], SrcWidth) + b += 2 + + Put16(buf[b:], SrcHeight) + b += 2 + + Put16(buf[b:], uint16(DstX)) + b += 2 + + Put16(buf[b:], uint16(DstY)) + b += 2 + + buf[b] = Depth + b += 1 + + buf[b] = Format + b += 1 + + buf[b] = SendEvent + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + Put32(buf[b:], Offset) + b += 4 + + return buf +} + +// Request ShmGetImage +// size: 32 +type ShmGetImageCookie struct { + *cookie +} + +func (c *Conn) ShmGetImage(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) + return ShmGetImageCookie{cookie} +} + +func (c *Conn) ShmGetImageUnchecked(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) + return ShmGetImageCookie{cookie} +} + +// Request reply for ShmGetImage +// size: 16 +type ShmGetImageReply struct { + Sequence uint16 + Length uint32 + Depth byte + Visual Visualid + Size uint32 +} + +// Waits and reads reply data from request ShmGetImage +func (cook ShmGetImageCookie) Reply() (*ShmGetImageReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return shmGetImageReply(buf), nil +} + +// Read reply into structure from buffer for ShmGetImage +func shmGetImageReply(buf []byte) *ShmGetImageReply { + v := new(ShmGetImageReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + v.Size = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook ShmGetImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmGetImage +func (c *Conn) shmGetImageRequest(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], uint16(X)) + b += 2 + + Put16(buf[b:], uint16(Y)) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put32(buf[b:], PlaneMask) + b += 4 + + buf[b] = Format + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + Put32(buf[b:], Offset) + b += 4 + + return buf +} + +// Request ShmCreatePixmap +// size: 28 +type ShmCreatePixmapCookie struct { + *cookie +} + +// Write request to wire for ShmCreatePixmap +func (c *Conn) ShmCreatePixmap(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return ShmCreatePixmapCookie{cookie} +} + +func (c *Conn) ShmCreatePixmapChecked(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return ShmCreatePixmapCookie{cookie} +} + +func (cook ShmCreatePixmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for ShmCreatePixmap +func (c *Conn) shmCreatePixmapRequest(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["MIT-SHM"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Pid)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + buf[b] = Depth + b += 1 + + b += 3 // padding + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + Put32(buf[b:], Offset) + b += 4 + + return buf +} diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go new file mode 100644 index 0000000..e87c488 --- /dev/null +++ b/nexgb/auto_sync.go @@ -0,0 +1,1899 @@ +package xgb + +/* + This file was generated by sync.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + SyncAlarmstateActive = 0 + SyncAlarmstateInactive = 1 + SyncAlarmstateDestroyed = 2 +) + +const ( + SyncTesttypePositiveTransition = 0 + SyncTesttypeNegativeTransition = 1 + SyncTesttypePositiveComparison = 2 + SyncTesttypeNegativeComparison = 3 +) + +const ( + SyncValuetypeAbsolute = 0 + SyncValuetypeRelative = 1 +) + +const ( + SyncCaCounter = 1 + SyncCaValueType = 2 + SyncCaValue = 4 + SyncCaTestType = 8 + SyncCaDelta = 16 + SyncCaEvents = 32 +) + +// Skipping resource definition of 'Alarm' + +// Skipping resource definition of 'Counter' + +// Skipping resource definition of 'Fence' + +// 'SyncInt64' struct definition +// Size: 8 +type SyncInt64 struct { + Hi int32 + Lo uint32 +} + +// Struct read SyncInt64 +func ReadSyncInt64(buf []byte, v *SyncInt64) int { + b := 0 + + v.Hi = int32(Get32(buf[b:])) + b += 4 + + v.Lo = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read SyncInt64 +func ReadSyncInt64List(buf []byte, dest []SyncInt64) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SyncInt64{} + b += ReadSyncInt64(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SyncInt64 +func (v SyncInt64) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Hi)) + b += 4 + + Put32(buf[b:], v.Lo) + b += 4 + + return buf +} + +// Write struct list SyncInt64 +func SyncInt64ListBytes(buf []byte, list []SyncInt64) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'SyncSystemcounter' struct definition +// Size: (14 + pad((int(NameLen) * 1))) +type SyncSystemcounter struct { + Counter Id + Resolution SyncInt64 + NameLen uint16 + Name string // size: pad((int(NameLen) * 1)) +} + +// Struct read SyncSystemcounter +func ReadSyncSystemcounter(buf []byte, v *SyncSystemcounter) int { + b := 0 + + v.Counter = Id(Get32(buf[b:])) + b += 4 + + v.Resolution = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.Resolution) + + v.NameLen = Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameLen)) + } + + return b +} + +// Struct list read SyncSystemcounter +func ReadSyncSystemcounterList(buf []byte, dest []SyncSystemcounter) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SyncSystemcounter{} + b += ReadSyncSystemcounter(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SyncSystemcounter +func (v SyncSystemcounter) Bytes() []byte { + buf := make([]byte, (14 + pad((int(v.NameLen) * 1)))) + b := 0 + + Put32(buf[b:], uint32(v.Counter)) + b += 4 + + { + structBytes := v.Resolution.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put16(buf[b:], v.NameLen) + b += 2 + + copy(buf[b:], v.Name[:v.NameLen]) + b += pad(int(v.NameLen)) + + return buf +} + +// Write struct list SyncSystemcounter +func SyncSystemcounterListBytes(buf []byte, list []SyncSystemcounter) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size SyncSystemcounter +func SyncSystemcounterListSize(list []SyncSystemcounter) int { + size := 0 + for _, item := range list { + size += (14 + pad((int(item.NameLen) * 1))) + } + return size +} + +// 'SyncTrigger' struct definition +// Size: 20 +type SyncTrigger struct { + Counter Id + WaitType uint32 + WaitValue SyncInt64 + TestType uint32 +} + +// Struct read SyncTrigger +func ReadSyncTrigger(buf []byte, v *SyncTrigger) int { + b := 0 + + v.Counter = Id(Get32(buf[b:])) + b += 4 + + v.WaitType = Get32(buf[b:]) + b += 4 + + v.WaitValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.WaitValue) + + v.TestType = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read SyncTrigger +func ReadSyncTriggerList(buf []byte, dest []SyncTrigger) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SyncTrigger{} + b += ReadSyncTrigger(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SyncTrigger +func (v SyncTrigger) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + Put32(buf[b:], uint32(v.Counter)) + b += 4 + + Put32(buf[b:], v.WaitType) + b += 4 + + { + structBytes := v.WaitValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], v.TestType) + b += 4 + + return buf +} + +// Write struct list SyncTrigger +func SyncTriggerListBytes(buf []byte, list []SyncTrigger) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'SyncWaitcondition' struct definition +// Size: 28 +type SyncWaitcondition struct { + Trigger SyncTrigger + EventThreshold SyncInt64 +} + +// Struct read SyncWaitcondition +func ReadSyncWaitcondition(buf []byte, v *SyncWaitcondition) int { + b := 0 + + v.Trigger = SyncTrigger{} + b += ReadSyncTrigger(buf[b:], &v.Trigger) + + v.EventThreshold = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.EventThreshold) + + return b +} + +// Struct list read SyncWaitcondition +func ReadSyncWaitconditionList(buf []byte, dest []SyncWaitcondition) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SyncWaitcondition{} + b += ReadSyncWaitcondition(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write SyncWaitcondition +func (v SyncWaitcondition) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + { + structBytes := v.Trigger.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.EventThreshold.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Write struct list SyncWaitcondition +func SyncWaitconditionListBytes(buf []byte, list []SyncWaitcondition) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Event definition SyncCounterNotify (0) +// Size: 32 + +const SyncCounterNotify = 0 + +type SyncCounterNotifyEvent struct { + Sequence uint16 + Kind byte + Counter Id + WaitValue SyncInt64 + CounterValue SyncInt64 + Timestamp Timestamp + Count uint16 + Destroyed bool + // padding: 1 bytes +} + +// Event read SyncCounterNotify +func NewSyncCounterNotifyEvent(buf []byte) Event { + v := SyncCounterNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Counter = Id(Get32(buf[b:])) + b += 4 + + v.WaitValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.WaitValue) + + v.CounterValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.CounterValue) + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Count = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Destroyed = true + } else { + v.Destroyed = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write SyncCounterNotify +func (v SyncCounterNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Counter)) + b += 4 + + { + structBytes := v.WaitValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put16(buf[b:], v.Count) + b += 2 + + if v.Destroyed { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v SyncCounterNotifyEvent) ImplementsEvent() {} + +func (v SyncCounterNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v SyncCounterNotifyEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, sprintf("Counter: %d", v.Counter)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, sprintf("Destroyed: %t", v.Destroyed)) + return "SyncCounterNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewSyncCounterNotifyEvent +} + +// Event definition SyncAlarmNotify (1) +// Size: 32 + +const SyncAlarmNotify = 1 + +type SyncAlarmNotifyEvent struct { + Sequence uint16 + Kind byte + Alarm Id + CounterValue SyncInt64 + AlarmValue SyncInt64 + Timestamp Timestamp + State byte + // padding: 3 bytes +} + +// Event read SyncAlarmNotify +func NewSyncAlarmNotifyEvent(buf []byte) Event { + v := SyncAlarmNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Alarm = Id(Get32(buf[b:])) + b += 4 + + v.CounterValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.CounterValue) + + v.AlarmValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.AlarmValue) + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write SyncAlarmNotify +func (v SyncAlarmNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Alarm)) + b += 4 + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + { + structBytes := v.AlarmValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +func (v SyncAlarmNotifyEvent) ImplementsEvent() {} + +func (v SyncAlarmNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v SyncAlarmNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, sprintf("Alarm: %d", v.Alarm)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + return "SyncAlarmNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewSyncAlarmNotifyEvent +} + +// Error definition SyncCounter (0) +// Size: 32 + +const BadSyncCounter = 0 + +type SyncCounterError struct { + Sequence uint16 + NiceName string + BadCounter uint32 + MinorOpcode uint16 + MajorOpcode byte +} + +// Error read SyncCounter +func NewSyncCounterError(buf []byte) Error { + v := SyncCounterError{} + v.NiceName = "SyncCounter" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.BadCounter = Get32(buf[b:]) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + return v +} + +func (err SyncCounterError) ImplementsError() {} + +func (err SyncCounterError) SequenceId() uint16 { + return err.Sequence +} + +func (err SyncCounterError) BadId() Id { + return 0 +} + +func (err SyncCounterError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadCounter: %d", err.BadCounter)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadSyncCounter {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewSyncCounterError +} + +// Error definition SyncAlarm (1) +// Size: 32 + +const BadSyncAlarm = 1 + +type SyncAlarmError struct { + Sequence uint16 + NiceName string + BadAlarm uint32 + MinorOpcode uint16 + MajorOpcode byte +} + +// Error read SyncAlarm +func NewSyncAlarmError(buf []byte) Error { + v := SyncAlarmError{} + v.NiceName = "SyncAlarm" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.BadAlarm = Get32(buf[b:]) + b += 4 + + v.MinorOpcode = Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + return v +} + +func (err SyncAlarmError) ImplementsError() {} + +func (err SyncAlarmError) SequenceId() uint16 { + return err.Sequence +} + +func (err SyncAlarmError) BadId() Id { + return 0 +} + +func (err SyncAlarmError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, sprintf("BadAlarm: %d", err.BadAlarm)) + fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadSyncAlarm {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewSyncAlarmError +} + +// Request SyncInitialize +// size: 8 +type SyncInitializeCookie struct { + *cookie +} + +func (c *Conn) SyncInitialize(DesiredMajorVersion byte, DesiredMinorVersion byte) SyncInitializeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncInitializeRequest(DesiredMajorVersion, DesiredMinorVersion), cookie) + return SyncInitializeCookie{cookie} +} + +func (c *Conn) SyncInitializeUnchecked(DesiredMajorVersion byte, DesiredMinorVersion byte) SyncInitializeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncInitializeRequest(DesiredMajorVersion, DesiredMinorVersion), cookie) + return SyncInitializeCookie{cookie} +} + +// Request reply for SyncInitialize +// size: 32 +type SyncInitializeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion byte + MinorVersion byte + // padding: 22 bytes +} + +// Waits and reads reply data from request SyncInitialize +func (cook SyncInitializeCookie) Reply() (*SyncInitializeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncInitializeReply(buf), nil +} + +// Read reply into structure from buffer for SyncInitialize +func syncInitializeReply(buf []byte) *SyncInitializeReply { + v := new(SyncInitializeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = buf[b] + b += 1 + + v.MinorVersion = buf[b] + b += 1 + + b += 22 // padding + + return v +} + +func (cook SyncInitializeCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncInitialize +func (c *Conn) syncInitializeRequest(DesiredMajorVersion byte, DesiredMinorVersion byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DesiredMajorVersion + b += 1 + + buf[b] = DesiredMinorVersion + b += 1 + + return buf +} + +// Request SyncListSystemCounters +// size: 4 +type SyncListSystemCountersCookie struct { + *cookie +} + +func (c *Conn) SyncListSystemCounters() SyncListSystemCountersCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncListSystemCountersRequest(), cookie) + return SyncListSystemCountersCookie{cookie} +} + +func (c *Conn) SyncListSystemCountersUnchecked() SyncListSystemCountersCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncListSystemCountersRequest(), cookie) + return SyncListSystemCountersCookie{cookie} +} + +// Request reply for SyncListSystemCounters +// size: (32 + SyncSystemcounterListSize(Counters)) +type SyncListSystemCountersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + CountersLen uint32 + // padding: 20 bytes + Counters []SyncSystemcounter // size: SyncSystemcounterListSize(Counters) +} + +// Waits and reads reply data from request SyncListSystemCounters +func (cook SyncListSystemCountersCookie) Reply() (*SyncListSystemCountersReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncListSystemCountersReply(buf), nil +} + +// Read reply into structure from buffer for SyncListSystemCounters +func syncListSystemCountersReply(buf []byte) *SyncListSystemCountersReply { + v := new(SyncListSystemCountersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.CountersLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Counters = make([]SyncSystemcounter, v.CountersLen) + b += ReadSyncSystemcounterList(buf[b:], v.Counters) + + return v +} + +func (cook SyncListSystemCountersCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncListSystemCounters +func (c *Conn) syncListSystemCountersRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request SyncCreateCounter +// size: 16 +type SyncCreateCounterCookie struct { + *cookie +} + +// Write request to wire for SyncCreateCounter +func (c *Conn) SyncCreateCounter(Id Id, InitialValue SyncInt64) SyncCreateCounterCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) + return SyncCreateCounterCookie{cookie} +} + +func (c *Conn) SyncCreateCounterChecked(Id Id, InitialValue SyncInt64) SyncCreateCounterCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) + return SyncCreateCounterCookie{cookie} +} + +func (cook SyncCreateCounterCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncCreateCounter +func (c *Conn) syncCreateCounterRequest(Id Id, InitialValue SyncInt64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Id)) + b += 4 + + { + structBytes := InitialValue.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Request SyncDestroyCounter +// size: 8 +type SyncDestroyCounterCookie struct { + *cookie +} + +// Write request to wire for SyncDestroyCounter +func (c *Conn) SyncDestroyCounter(Counter Id) SyncDestroyCounterCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) + return SyncDestroyCounterCookie{cookie} +} + +func (c *Conn) SyncDestroyCounterChecked(Counter Id) SyncDestroyCounterCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) + return SyncDestroyCounterCookie{cookie} +} + +func (cook SyncDestroyCounterCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncDestroyCounter +func (c *Conn) syncDestroyCounterRequest(Counter Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Counter)) + b += 4 + + return buf +} + +// Request SyncQueryCounter +// size: 8 +type SyncQueryCounterCookie struct { + *cookie +} + +func (c *Conn) SyncQueryCounter(Counter Id) SyncQueryCounterCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncQueryCounterRequest(Counter), cookie) + return SyncQueryCounterCookie{cookie} +} + +func (c *Conn) SyncQueryCounterUnchecked(Counter Id) SyncQueryCounterCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncQueryCounterRequest(Counter), cookie) + return SyncQueryCounterCookie{cookie} +} + +// Request reply for SyncQueryCounter +// size: 16 +type SyncQueryCounterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + CounterValue SyncInt64 +} + +// Waits and reads reply data from request SyncQueryCounter +func (cook SyncQueryCounterCookie) Reply() (*SyncQueryCounterReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncQueryCounterReply(buf), nil +} + +// Read reply into structure from buffer for SyncQueryCounter +func syncQueryCounterReply(buf []byte) *SyncQueryCounterReply { + v := new(SyncQueryCounterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.CounterValue = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.CounterValue) + + return v +} + +func (cook SyncQueryCounterCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncQueryCounter +func (c *Conn) syncQueryCounterRequest(Counter Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Counter)) + b += 4 + + return buf +} + +// Request SyncAwait +// size: pad((4 + pad((len(WaitList) * 28)))) +type SyncAwaitCookie struct { + *cookie +} + +// Write request to wire for SyncAwait +func (c *Conn) SyncAwait(WaitList []SyncWaitcondition) SyncAwaitCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncAwaitRequest(WaitList), cookie) + return SyncAwaitCookie{cookie} +} + +func (c *Conn) SyncAwaitChecked(WaitList []SyncWaitcondition) SyncAwaitCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncAwaitRequest(WaitList), cookie) + return SyncAwaitCookie{cookie} +} + +func (cook SyncAwaitCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncAwait +func (c *Conn) syncAwaitRequest(WaitList []SyncWaitcondition) []byte { + size := pad((4 + pad((len(WaitList) * 28)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + b += SyncWaitconditionListBytes(buf[b:], WaitList) + + return buf +} + +// Request SyncChangeCounter +// size: 16 +type SyncChangeCounterCookie struct { + *cookie +} + +// Write request to wire for SyncChangeCounter +func (c *Conn) SyncChangeCounter(Counter Id, Amount SyncInt64) SyncChangeCounterCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) + return SyncChangeCounterCookie{cookie} +} + +func (c *Conn) SyncChangeCounterChecked(Counter Id, Amount SyncInt64) SyncChangeCounterCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) + return SyncChangeCounterCookie{cookie} +} + +func (cook SyncChangeCounterCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncChangeCounter +func (c *Conn) syncChangeCounterRequest(Counter Id, Amount SyncInt64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Amount.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Request SyncSetCounter +// size: 16 +type SyncSetCounterCookie struct { + *cookie +} + +// Write request to wire for SyncSetCounter +func (c *Conn) SyncSetCounter(Counter Id, Value SyncInt64) SyncSetCounterCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) + return SyncSetCounterCookie{cookie} +} + +func (c *Conn) SyncSetCounterChecked(Counter Id, Value SyncInt64) SyncSetCounterCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) + return SyncSetCounterCookie{cookie} +} + +func (cook SyncSetCounterCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncSetCounter +func (c *Conn) syncSetCounterRequest(Counter Id, Value SyncInt64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Value.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + return buf +} + +// Request SyncCreateAlarm +// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +type SyncCreateAlarmCookie struct { + *cookie +} + +// Write request to wire for SyncCreateAlarm +func (c *Conn) SyncCreateAlarm(Id Id, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) + return SyncCreateAlarmCookie{cookie} +} + +func (c *Conn) SyncCreateAlarmChecked(Id Id, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) + return SyncCreateAlarmCookie{cookie} +} + +func (cook SyncCreateAlarmCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncCreateAlarm +func (c *Conn) syncCreateAlarmRequest(Id Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Id)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request SyncChangeAlarm +// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +type SyncChangeAlarmCookie struct { + *cookie +} + +// Write request to wire for SyncChangeAlarm +func (c *Conn) SyncChangeAlarm(Id Id, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) + return SyncChangeAlarmCookie{cookie} +} + +func (c *Conn) SyncChangeAlarmChecked(Id Id, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) + return SyncChangeAlarmCookie{cookie} +} + +func (cook SyncChangeAlarmCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncChangeAlarm +func (c *Conn) syncChangeAlarmRequest(Id Id, ValueMask uint32, ValueList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Id)) + b += 4 + + Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < popCount(int(ValueMask)); i++ { + Put32(buf[b:], ValueList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request SyncDestroyAlarm +// size: 8 +type SyncDestroyAlarmCookie struct { + *cookie +} + +// Write request to wire for SyncDestroyAlarm +func (c *Conn) SyncDestroyAlarm(Alarm Id) SyncDestroyAlarmCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) + return SyncDestroyAlarmCookie{cookie} +} + +func (c *Conn) SyncDestroyAlarmChecked(Alarm Id) SyncDestroyAlarmCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) + return SyncDestroyAlarmCookie{cookie} +} + +func (cook SyncDestroyAlarmCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncDestroyAlarm +func (c *Conn) syncDestroyAlarmRequest(Alarm Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Alarm)) + b += 4 + + return buf +} + +// Request SyncQueryAlarm +// size: 8 +type SyncQueryAlarmCookie struct { + *cookie +} + +func (c *Conn) SyncQueryAlarm(Alarm Id) SyncQueryAlarmCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) + return SyncQueryAlarmCookie{cookie} +} + +func (c *Conn) SyncQueryAlarmUnchecked(Alarm Id) SyncQueryAlarmCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) + return SyncQueryAlarmCookie{cookie} +} + +// Request reply for SyncQueryAlarm +// size: 40 +type SyncQueryAlarmReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Trigger SyncTrigger + Delta SyncInt64 + Events bool + State byte + // padding: 2 bytes +} + +// Waits and reads reply data from request SyncQueryAlarm +func (cook SyncQueryAlarmCookie) Reply() (*SyncQueryAlarmReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncQueryAlarmReply(buf), nil +} + +// Read reply into structure from buffer for SyncQueryAlarm +func syncQueryAlarmReply(buf []byte) *SyncQueryAlarmReply { + v := new(SyncQueryAlarmReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Trigger = SyncTrigger{} + b += ReadSyncTrigger(buf[b:], &v.Trigger) + + v.Delta = SyncInt64{} + b += ReadSyncInt64(buf[b:], &v.Delta) + + if buf[b] == 1 { + v.Events = true + } else { + v.Events = false + } + b += 1 + + v.State = buf[b] + b += 1 + + b += 2 // padding + + return v +} + +func (cook SyncQueryAlarmCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncQueryAlarm +func (c *Conn) syncQueryAlarmRequest(Alarm Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Alarm)) + b += 4 + + return buf +} + +// Request SyncSetPriority +// size: 12 +type SyncSetPriorityCookie struct { + *cookie +} + +// Write request to wire for SyncSetPriority +func (c *Conn) SyncSetPriority(Id uint32, Priority int32) SyncSetPriorityCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncSetPriorityRequest(Id, Priority), cookie) + return SyncSetPriorityCookie{cookie} +} + +func (c *Conn) SyncSetPriorityChecked(Id uint32, Priority int32) SyncSetPriorityCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncSetPriorityRequest(Id, Priority), cookie) + return SyncSetPriorityCookie{cookie} +} + +func (cook SyncSetPriorityCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncSetPriority +func (c *Conn) syncSetPriorityRequest(Id uint32, Priority int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Id) + b += 4 + + Put32(buf[b:], uint32(Priority)) + b += 4 + + return buf +} + +// Request SyncGetPriority +// size: 8 +type SyncGetPriorityCookie struct { + *cookie +} + +func (c *Conn) SyncGetPriority(Id uint32) SyncGetPriorityCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncGetPriorityRequest(Id), cookie) + return SyncGetPriorityCookie{cookie} +} + +func (c *Conn) SyncGetPriorityUnchecked(Id uint32) SyncGetPriorityCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncGetPriorityRequest(Id), cookie) + return SyncGetPriorityCookie{cookie} +} + +// Request reply for SyncGetPriority +// size: 12 +type SyncGetPriorityReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Priority int32 +} + +// Waits and reads reply data from request SyncGetPriority +func (cook SyncGetPriorityCookie) Reply() (*SyncGetPriorityReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncGetPriorityReply(buf), nil +} + +// Read reply into structure from buffer for SyncGetPriority +func syncGetPriorityReply(buf []byte) *SyncGetPriorityReply { + v := new(SyncGetPriorityReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Priority = int32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook SyncGetPriorityCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncGetPriority +func (c *Conn) syncGetPriorityRequest(Id uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Id) + b += 4 + + return buf +} + +// Request SyncCreateFence +// size: 16 +type SyncCreateFenceCookie struct { + *cookie +} + +// Write request to wire for SyncCreateFence +func (c *Conn) SyncCreateFence(Drawable Id, Fence Id, InitiallyTriggered bool) SyncCreateFenceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) + return SyncCreateFenceCookie{cookie} +} + +func (c *Conn) SyncCreateFenceChecked(Drawable Id, Fence Id, InitiallyTriggered bool) SyncCreateFenceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) + return SyncCreateFenceCookie{cookie} +} + +func (cook SyncCreateFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncCreateFence +func (c *Conn) syncCreateFenceRequest(Drawable Id, Fence Id, InitiallyTriggered bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Fence)) + b += 4 + + if InitiallyTriggered { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request SyncTriggerFence +// size: 8 +type SyncTriggerFenceCookie struct { + *cookie +} + +// Write request to wire for SyncTriggerFence +func (c *Conn) SyncTriggerFence(Fence Id) SyncTriggerFenceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) + return SyncTriggerFenceCookie{cookie} +} + +func (c *Conn) SyncTriggerFenceChecked(Fence Id) SyncTriggerFenceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) + return SyncTriggerFenceCookie{cookie} +} + +func (cook SyncTriggerFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncTriggerFence +func (c *Conn) syncTriggerFenceRequest(Fence Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request SyncResetFence +// size: 8 +type SyncResetFenceCookie struct { + *cookie +} + +// Write request to wire for SyncResetFence +func (c *Conn) SyncResetFence(Fence Id) SyncResetFenceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncResetFenceRequest(Fence), cookie) + return SyncResetFenceCookie{cookie} +} + +func (c *Conn) SyncResetFenceChecked(Fence Id) SyncResetFenceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncResetFenceRequest(Fence), cookie) + return SyncResetFenceCookie{cookie} +} + +func (cook SyncResetFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncResetFence +func (c *Conn) syncResetFenceRequest(Fence Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request SyncDestroyFence +// size: 8 +type SyncDestroyFenceCookie struct { + *cookie +} + +// Write request to wire for SyncDestroyFence +func (c *Conn) SyncDestroyFence(Fence Id) SyncDestroyFenceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) + return SyncDestroyFenceCookie{cookie} +} + +func (c *Conn) SyncDestroyFenceChecked(Fence Id) SyncDestroyFenceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) + return SyncDestroyFenceCookie{cookie} +} + +func (cook SyncDestroyFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncDestroyFence +func (c *Conn) syncDestroyFenceRequest(Fence Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request SyncQueryFence +// size: 8 +type SyncQueryFenceCookie struct { + *cookie +} + +func (c *Conn) SyncQueryFence(Fence Id) SyncQueryFenceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.syncQueryFenceRequest(Fence), cookie) + return SyncQueryFenceCookie{cookie} +} + +func (c *Conn) SyncQueryFenceUnchecked(Fence Id) SyncQueryFenceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.syncQueryFenceRequest(Fence), cookie) + return SyncQueryFenceCookie{cookie} +} + +// Request reply for SyncQueryFence +// size: 32 +type SyncQueryFenceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Triggered bool + // padding: 23 bytes +} + +// Waits and reads reply data from request SyncQueryFence +func (cook SyncQueryFenceCookie) Reply() (*SyncQueryFenceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return syncQueryFenceReply(buf), nil +} + +// Read reply into structure from buffer for SyncQueryFence +func syncQueryFenceReply(buf []byte) *SyncQueryFenceReply { + v := new(SyncQueryFenceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Triggered = true + } else { + v.Triggered = false + } + b += 1 + + b += 23 // padding + + return v +} + +func (cook SyncQueryFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncQueryFence +func (c *Conn) syncQueryFenceRequest(Fence Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request SyncAwaitFence +// size: pad((4 + pad((len(FenceList) * 4)))) +type SyncAwaitFenceCookie struct { + *cookie +} + +// Write request to wire for SyncAwaitFence +func (c *Conn) SyncAwaitFence(FenceList []Id) SyncAwaitFenceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) + return SyncAwaitFenceCookie{cookie} +} + +func (c *Conn) SyncAwaitFenceChecked(FenceList []Id) SyncAwaitFenceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) + return SyncAwaitFenceCookie{cookie} +} + +func (cook SyncAwaitFenceCookie) Check() error { + return cook.check() +} + +// Write request to wire for SyncAwaitFence +func (c *Conn) syncAwaitFenceRequest(FenceList []Id) []byte { + size := pad((4 + pad((len(FenceList) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SYNC"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + for i := 0; i < int(len(FenceList)); i++ { + Put32(buf[b:], uint32(FenceList[i])) + b += 4 + } + b = pad(b) + + return buf +} diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go new file mode 100644 index 0000000..48a5d1e --- /dev/null +++ b/nexgb/auto_xc_misc.go @@ -0,0 +1,300 @@ +package xgb + +/* + This file was generated by xc_misc.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Request Xc_miscGetVersion +// size: 8 +type Xc_miscGetVersionCookie struct { + *cookie +} + +func (c *Conn) Xc_miscGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return Xc_miscGetVersionCookie{cookie} +} + +func (c *Conn) Xc_miscGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return Xc_miscGetVersionCookie{cookie} +} + +// Request reply for Xc_miscGetVersion +// size: 12 +type Xc_miscGetVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 +} + +// Waits and reads reply data from request Xc_miscGetVersion +func (cook Xc_miscGetVersionCookie) Reply() (*Xc_miscGetVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xc_miscGetVersionReply(buf), nil +} + +// Read reply into structure from buffer for Xc_miscGetVersion +func xc_miscGetVersionReply(buf []byte) *Xc_miscGetVersionReply { + v := new(Xc_miscGetVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook Xc_miscGetVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xc_miscGetVersion +func (c *Conn) xc_miscGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XC-MISC"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], ClientMajorVersion) + b += 2 + + Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request Xc_miscGetXIDRange +// size: 4 +type Xc_miscGetXIDRangeCookie struct { + *cookie +} + +func (c *Conn) Xc_miscGetXIDRange() Xc_miscGetXIDRangeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie) + return Xc_miscGetXIDRangeCookie{cookie} +} + +func (c *Conn) Xc_miscGetXIDRangeUnchecked() Xc_miscGetXIDRangeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie) + return Xc_miscGetXIDRangeCookie{cookie} +} + +// Request reply for Xc_miscGetXIDRange +// size: 16 +type Xc_miscGetXIDRangeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StartId uint32 + Count uint32 +} + +// Waits and reads reply data from request Xc_miscGetXIDRange +func (cook Xc_miscGetXIDRangeCookie) Reply() (*Xc_miscGetXIDRangeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xc_miscGetXIDRangeReply(buf), nil +} + +// Read reply into structure from buffer for Xc_miscGetXIDRange +func xc_miscGetXIDRangeReply(buf []byte) *Xc_miscGetXIDRangeReply { + v := new(Xc_miscGetXIDRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.StartId = Get32(buf[b:]) + b += 4 + + v.Count = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Xc_miscGetXIDRangeCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xc_miscGetXIDRange +func (c *Conn) xc_miscGetXIDRangeRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XC-MISC"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Xc_miscGetXIDList +// size: 8 +type Xc_miscGetXIDListCookie struct { + *cookie +} + +func (c *Conn) Xc_miscGetXIDList(Count uint32) Xc_miscGetXIDListCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie) + return Xc_miscGetXIDListCookie{cookie} +} + +func (c *Conn) Xc_miscGetXIDListUnchecked(Count uint32) Xc_miscGetXIDListCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie) + return Xc_miscGetXIDListCookie{cookie} +} + +// Request reply for Xc_miscGetXIDList +// size: (32 + pad((int(IdsLen) * 4))) +type Xc_miscGetXIDListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IdsLen uint32 + // padding: 20 bytes + Ids []uint32 // size: pad((int(IdsLen) * 4)) +} + +// Waits and reads reply data from request Xc_miscGetXIDList +func (cook Xc_miscGetXIDListCookie) Reply() (*Xc_miscGetXIDListReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xc_miscGetXIDListReply(buf), nil +} + +// Read reply into structure from buffer for Xc_miscGetXIDList +func xc_miscGetXIDListReply(buf []byte) *Xc_miscGetXIDListReply { + v := new(Xc_miscGetXIDListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.IdsLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Ids = make([]uint32, v.IdsLen) + for i := 0; i < int(v.IdsLen); i++ { + v.Ids[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook Xc_miscGetXIDListCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xc_miscGetXIDList +func (c *Conn) xc_miscGetXIDListRequest(Count uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XC-MISC"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Count) + b += 4 + + return buf +} diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go new file mode 100644 index 0000000..fbc1d92 --- /dev/null +++ b/nexgb/auto_xevie.go @@ -0,0 +1,513 @@ +package xgb + +/* + This file was generated by xevie.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + XevieDatatypeUnmodified = 0 + XevieDatatypeModified = 1 +) + +// 'XevieEvent' struct definition +// Size: 32 +type XevieEvent struct { + // padding: 32 bytes +} + +// Struct read XevieEvent +func ReadXevieEvent(buf []byte, v *XevieEvent) int { + b := 0 + + b += 32 // padding + + return b +} + +// Struct list read XevieEvent +func ReadXevieEventList(buf []byte, dest []XevieEvent) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XevieEvent{} + b += ReadXevieEvent(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XevieEvent +func (v XevieEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + b += 32 // padding + + return buf +} + +// Write struct list XevieEvent +func XevieEventListBytes(buf []byte, list []XevieEvent) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Request XevieQueryVersion +// size: 8 +type XevieQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XevieQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return XevieQueryVersionCookie{cookie} +} + +func (c *Conn) XevieQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return XevieQueryVersionCookie{cookie} +} + +// Request reply for XevieQueryVersion +// size: 32 +type XevieQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request XevieQueryVersion +func (cook XevieQueryVersionCookie) Reply() (*XevieQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xevieQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XevieQueryVersion +func xevieQueryVersionReply(buf []byte) *XevieQueryVersionReply { + v := new(XevieQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +func (cook XevieQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XevieQueryVersion +func (c *Conn) xevieQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XEVIE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], ClientMajorVersion) + b += 2 + + Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request XevieStart +// size: 8 +type XevieStartCookie struct { + *cookie +} + +func (c *Conn) XevieStart(Screen uint32) XevieStartCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xevieStartRequest(Screen), cookie) + return XevieStartCookie{cookie} +} + +func (c *Conn) XevieStartUnchecked(Screen uint32) XevieStartCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xevieStartRequest(Screen), cookie) + return XevieStartCookie{cookie} +} + +// Request reply for XevieStart +// size: 32 +type XevieStartReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request XevieStart +func (cook XevieStartCookie) Reply() (*XevieStartReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xevieStartReply(buf), nil +} + +// Read reply into structure from buffer for XevieStart +func xevieStartReply(buf []byte) *XevieStartReply { + v := new(XevieStartReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +func (cook XevieStartCookie) Check() error { + return cook.check() +} + +// Write request to wire for XevieStart +func (c *Conn) xevieStartRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XEVIE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request XevieEnd +// size: 8 +type XevieEndCookie struct { + *cookie +} + +func (c *Conn) XevieEnd(Cmap uint32) XevieEndCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xevieEndRequest(Cmap), cookie) + return XevieEndCookie{cookie} +} + +func (c *Conn) XevieEndUnchecked(Cmap uint32) XevieEndCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xevieEndRequest(Cmap), cookie) + return XevieEndCookie{cookie} +} + +// Request reply for XevieEnd +// size: 32 +type XevieEndReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request XevieEnd +func (cook XevieEndCookie) Reply() (*XevieEndReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xevieEndReply(buf), nil +} + +// Read reply into structure from buffer for XevieEnd +func xevieEndReply(buf []byte) *XevieEndReply { + v := new(XevieEndReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +func (cook XevieEndCookie) Check() error { + return cook.check() +} + +// Write request to wire for XevieEnd +func (c *Conn) xevieEndRequest(Cmap uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XEVIE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Cmap) + b += 4 + + return buf +} + +// Request XevieSend +// size: 104 +type XevieSendCookie struct { + *cookie +} + +func (c *Conn) XevieSend(Event XevieEvent, DataType uint32) XevieSendCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xevieSendRequest(Event, DataType), cookie) + return XevieSendCookie{cookie} +} + +func (c *Conn) XevieSendUnchecked(Event XevieEvent, DataType uint32) XevieSendCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xevieSendRequest(Event, DataType), cookie) + return XevieSendCookie{cookie} +} + +// Request reply for XevieSend +// size: 32 +type XevieSendReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request XevieSend +func (cook XevieSendCookie) Reply() (*XevieSendReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xevieSendReply(buf), nil +} + +// Read reply into structure from buffer for XevieSend +func xevieSendReply(buf []byte) *XevieSendReply { + v := new(XevieSendReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +func (cook XevieSendCookie) Check() error { + return cook.check() +} + +// Write request to wire for XevieSend +func (c *Conn) xevieSendRequest(Event XevieEvent, DataType uint32) []byte { + size := 104 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XEVIE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + { + structBytes := Event.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], DataType) + b += 4 + + b += 64 // padding + + return buf +} + +// Request XevieSelectInput +// size: 8 +type XevieSelectInputCookie struct { + *cookie +} + +func (c *Conn) XevieSelectInput(EventMask uint32) XevieSelectInputCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xevieSelectInputRequest(EventMask), cookie) + return XevieSelectInputCookie{cookie} +} + +func (c *Conn) XevieSelectInputUnchecked(EventMask uint32) XevieSelectInputCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xevieSelectInputRequest(EventMask), cookie) + return XevieSelectInputCookie{cookie} +} + +// Request reply for XevieSelectInput +// size: 32 +type XevieSelectInputReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request XevieSelectInput +func (cook XevieSelectInputCookie) Reply() (*XevieSelectInputReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xevieSelectInputReply(buf), nil +} + +// Read reply into structure from buffer for XevieSelectInput +func xevieSelectInputReply(buf []byte) *XevieSelectInputReply { + v := new(XevieSelectInputReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +func (cook XevieSelectInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for XevieSelectInput +func (c *Conn) xevieSelectInputRequest(EventMask uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XEVIE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], EventMask) + b += 4 + + return buf +} diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go new file mode 100644 index 0000000..1dbe77c --- /dev/null +++ b/nexgb/auto_xf86dri.go @@ -0,0 +1,1125 @@ +package xgb + +/* + This file was generated by xf86dri.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// 'Xf86driDrmClipRect' struct definition +// Size: 8 +type Xf86driDrmClipRect struct { + X1 int16 + Y1 int16 + X2 int16 + X3 int16 +} + +// Struct read Xf86driDrmClipRect +func ReadXf86driDrmClipRect(buf []byte, v *Xf86driDrmClipRect) int { + b := 0 + + v.X1 = int16(Get16(buf[b:])) + b += 2 + + v.Y1 = int16(Get16(buf[b:])) + b += 2 + + v.X2 = int16(Get16(buf[b:])) + b += 2 + + v.X3 = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Xf86driDrmClipRect +func ReadXf86driDrmClipRectList(buf []byte, dest []Xf86driDrmClipRect) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Xf86driDrmClipRect{} + b += ReadXf86driDrmClipRect(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Xf86driDrmClipRect +func (v Xf86driDrmClipRect) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], uint16(v.X1)) + b += 2 + + Put16(buf[b:], uint16(v.Y1)) + b += 2 + + Put16(buf[b:], uint16(v.X2)) + b += 2 + + Put16(buf[b:], uint16(v.X3)) + b += 2 + + return buf +} + +// Write struct list Xf86driDrmClipRect +func Xf86driDrmClipRectListBytes(buf []byte, list []Xf86driDrmClipRect) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Request Xf86driQueryVersion +// size: 4 +type Xf86driQueryVersionCookie struct { + *cookie +} + +func (c *Conn) Xf86driQueryVersion() Xf86driQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driQueryVersionRequest(), cookie) + return Xf86driQueryVersionCookie{cookie} +} + +func (c *Conn) Xf86driQueryVersionUnchecked() Xf86driQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driQueryVersionRequest(), cookie) + return Xf86driQueryVersionCookie{cookie} +} + +// Request reply for Xf86driQueryVersion +// size: 16 +type Xf86driQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DriMajorVersion uint16 + DriMinorVersion uint16 + DriMinorPatch uint32 +} + +// Waits and reads reply data from request Xf86driQueryVersion +func (cook Xf86driQueryVersionCookie) Reply() (*Xf86driQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driQueryVersion +func xf86driQueryVersionReply(buf []byte) *Xf86driQueryVersionReply { + v := new(Xf86driQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.DriMajorVersion = Get16(buf[b:]) + b += 2 + + v.DriMinorVersion = Get16(buf[b:]) + b += 2 + + v.DriMinorPatch = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Xf86driQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driQueryVersion +func (c *Conn) xf86driQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Xf86driQueryDirectRenderingCapable +// size: 8 +type Xf86driQueryDirectRenderingCapableCookie struct { + *cookie +} + +func (c *Conn) Xf86driQueryDirectRenderingCapable(Screen uint32) Xf86driQueryDirectRenderingCapableCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driQueryDirectRenderingCapableRequest(Screen), cookie) + return Xf86driQueryDirectRenderingCapableCookie{cookie} +} + +func (c *Conn) Xf86driQueryDirectRenderingCapableUnchecked(Screen uint32) Xf86driQueryDirectRenderingCapableCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driQueryDirectRenderingCapableRequest(Screen), cookie) + return Xf86driQueryDirectRenderingCapableCookie{cookie} +} + +// Request reply for Xf86driQueryDirectRenderingCapable +// size: 9 +type Xf86driQueryDirectRenderingCapableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IsCapable bool +} + +// Waits and reads reply data from request Xf86driQueryDirectRenderingCapable +func (cook Xf86driQueryDirectRenderingCapableCookie) Reply() (*Xf86driQueryDirectRenderingCapableReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driQueryDirectRenderingCapableReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driQueryDirectRenderingCapable +func xf86driQueryDirectRenderingCapableReply(buf []byte) *Xf86driQueryDirectRenderingCapableReply { + v := new(Xf86driQueryDirectRenderingCapableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.IsCapable = true + } else { + v.IsCapable = false + } + b += 1 + + return v +} + +func (cook Xf86driQueryDirectRenderingCapableCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driQueryDirectRenderingCapable +func (c *Conn) xf86driQueryDirectRenderingCapableRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request Xf86driOpenConnection +// size: 8 +type Xf86driOpenConnectionCookie struct { + *cookie +} + +func (c *Conn) Xf86driOpenConnection(Screen uint32) Xf86driOpenConnectionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driOpenConnectionRequest(Screen), cookie) + return Xf86driOpenConnectionCookie{cookie} +} + +func (c *Conn) Xf86driOpenConnectionUnchecked(Screen uint32) Xf86driOpenConnectionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driOpenConnectionRequest(Screen), cookie) + return Xf86driOpenConnectionCookie{cookie} +} + +// Request reply for Xf86driOpenConnection +// size: (32 + pad((int(BusIdLen) * 1))) +type Xf86driOpenConnectionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SareaHandleLow uint32 + SareaHandleHigh uint32 + BusIdLen uint32 + // padding: 12 bytes + BusId string // size: pad((int(BusIdLen) * 1)) +} + +// Waits and reads reply data from request Xf86driOpenConnection +func (cook Xf86driOpenConnectionCookie) Reply() (*Xf86driOpenConnectionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driOpenConnectionReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driOpenConnection +func xf86driOpenConnectionReply(buf []byte) *Xf86driOpenConnectionReply { + v := new(Xf86driOpenConnectionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.SareaHandleLow = Get32(buf[b:]) + b += 4 + + v.SareaHandleHigh = Get32(buf[b:]) + b += 4 + + v.BusIdLen = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + { + byteString := make([]byte, v.BusIdLen) + copy(byteString[:v.BusIdLen], buf[b:]) + v.BusId = string(byteString) + b += pad(int(v.BusIdLen)) + } + + return v +} + +func (cook Xf86driOpenConnectionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driOpenConnection +func (c *Conn) xf86driOpenConnectionRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request Xf86driCloseConnection +// size: 8 +type Xf86driCloseConnectionCookie struct { + *cookie +} + +// Write request to wire for Xf86driCloseConnection +func (c *Conn) Xf86driCloseConnection(Screen uint32) Xf86driCloseConnectionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86driCloseConnectionRequest(Screen), cookie) + return Xf86driCloseConnectionCookie{cookie} +} + +func (c *Conn) Xf86driCloseConnectionChecked(Screen uint32) Xf86driCloseConnectionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86driCloseConnectionRequest(Screen), cookie) + return Xf86driCloseConnectionCookie{cookie} +} + +func (cook Xf86driCloseConnectionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driCloseConnection +func (c *Conn) xf86driCloseConnectionRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request Xf86driGetClientDriverName +// size: 8 +type Xf86driGetClientDriverNameCookie struct { + *cookie +} + +func (c *Conn) Xf86driGetClientDriverName(Screen uint32) Xf86driGetClientDriverNameCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driGetClientDriverNameRequest(Screen), cookie) + return Xf86driGetClientDriverNameCookie{cookie} +} + +func (c *Conn) Xf86driGetClientDriverNameUnchecked(Screen uint32) Xf86driGetClientDriverNameCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driGetClientDriverNameRequest(Screen), cookie) + return Xf86driGetClientDriverNameCookie{cookie} +} + +// Request reply for Xf86driGetClientDriverName +// size: (32 + pad((int(ClientDriverNameLen) * 1))) +type Xf86driGetClientDriverNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ClientDriverMajorVersion uint32 + ClientDriverMinorVersion uint32 + ClientDriverPatchVersion uint32 + ClientDriverNameLen uint32 + // padding: 8 bytes + ClientDriverName string // size: pad((int(ClientDriverNameLen) * 1)) +} + +// Waits and reads reply data from request Xf86driGetClientDriverName +func (cook Xf86driGetClientDriverNameCookie) Reply() (*Xf86driGetClientDriverNameReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driGetClientDriverNameReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driGetClientDriverName +func xf86driGetClientDriverNameReply(buf []byte) *Xf86driGetClientDriverNameReply { + v := new(Xf86driGetClientDriverNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ClientDriverMajorVersion = Get32(buf[b:]) + b += 4 + + v.ClientDriverMinorVersion = Get32(buf[b:]) + b += 4 + + v.ClientDriverPatchVersion = Get32(buf[b:]) + b += 4 + + v.ClientDriverNameLen = Get32(buf[b:]) + b += 4 + + b += 8 // padding + + { + byteString := make([]byte, v.ClientDriverNameLen) + copy(byteString[:v.ClientDriverNameLen], buf[b:]) + v.ClientDriverName = string(byteString) + b += pad(int(v.ClientDriverNameLen)) + } + + return v +} + +func (cook Xf86driGetClientDriverNameCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driGetClientDriverName +func (c *Conn) xf86driGetClientDriverNameRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request Xf86driCreateContext +// size: 16 +type Xf86driCreateContextCookie struct { + *cookie +} + +func (c *Conn) Xf86driCreateContext(Screen uint32, Visual uint32, Context uint32) Xf86driCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driCreateContextRequest(Screen, Visual, Context), cookie) + return Xf86driCreateContextCookie{cookie} +} + +func (c *Conn) Xf86driCreateContextUnchecked(Screen uint32, Visual uint32, Context uint32) Xf86driCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driCreateContextRequest(Screen, Visual, Context), cookie) + return Xf86driCreateContextCookie{cookie} +} + +// Request reply for Xf86driCreateContext +// size: 12 +type Xf86driCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + HwContext uint32 +} + +// Waits and reads reply data from request Xf86driCreateContext +func (cook Xf86driCreateContextCookie) Reply() (*Xf86driCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driCreateContext +func xf86driCreateContextReply(buf []byte) *Xf86driCreateContextReply { + v := new(Xf86driCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwContext = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Xf86driCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driCreateContext +func (c *Conn) xf86driCreateContextRequest(Screen uint32, Visual uint32, Context uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Visual) + b += 4 + + Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request Xf86driDestroyContext +// size: 12 +type Xf86driDestroyContextCookie struct { + *cookie +} + +// Write request to wire for Xf86driDestroyContext +func (c *Conn) Xf86driDestroyContext(Screen uint32, Context uint32) Xf86driDestroyContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86driDestroyContextRequest(Screen, Context), cookie) + return Xf86driDestroyContextCookie{cookie} +} + +func (c *Conn) Xf86driDestroyContextChecked(Screen uint32, Context uint32) Xf86driDestroyContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86driDestroyContextRequest(Screen, Context), cookie) + return Xf86driDestroyContextCookie{cookie} +} + +func (cook Xf86driDestroyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driDestroyContext +func (c *Conn) xf86driDestroyContextRequest(Screen uint32, Context uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request Xf86driCreateDrawable +// size: 12 +type Xf86driCreateDrawableCookie struct { + *cookie +} + +func (c *Conn) Xf86driCreateDrawable(Screen uint32, Drawable uint32) Xf86driCreateDrawableCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driCreateDrawableRequest(Screen, Drawable), cookie) + return Xf86driCreateDrawableCookie{cookie} +} + +func (c *Conn) Xf86driCreateDrawableUnchecked(Screen uint32, Drawable uint32) Xf86driCreateDrawableCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driCreateDrawableRequest(Screen, Drawable), cookie) + return Xf86driCreateDrawableCookie{cookie} +} + +// Request reply for Xf86driCreateDrawable +// size: 12 +type Xf86driCreateDrawableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + HwDrawableHandle uint32 +} + +// Waits and reads reply data from request Xf86driCreateDrawable +func (cook Xf86driCreateDrawableCookie) Reply() (*Xf86driCreateDrawableReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driCreateDrawableReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driCreateDrawable +func xf86driCreateDrawableReply(buf []byte) *Xf86driCreateDrawableReply { + v := new(Xf86driCreateDrawableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwDrawableHandle = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Xf86driCreateDrawableCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driCreateDrawable +func (c *Conn) xf86driCreateDrawableRequest(Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request Xf86driDestroyDrawable +// size: 12 +type Xf86driDestroyDrawableCookie struct { + *cookie +} + +// Write request to wire for Xf86driDestroyDrawable +func (c *Conn) Xf86driDestroyDrawable(Screen uint32, Drawable uint32) Xf86driDestroyDrawableCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86driDestroyDrawableRequest(Screen, Drawable), cookie) + return Xf86driDestroyDrawableCookie{cookie} +} + +func (c *Conn) Xf86driDestroyDrawableChecked(Screen uint32, Drawable uint32) Xf86driDestroyDrawableCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86driDestroyDrawableRequest(Screen, Drawable), cookie) + return Xf86driDestroyDrawableCookie{cookie} +} + +func (cook Xf86driDestroyDrawableCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driDestroyDrawable +func (c *Conn) xf86driDestroyDrawableRequest(Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request Xf86driGetDrawableInfo +// size: 12 +type Xf86driGetDrawableInfoCookie struct { + *cookie +} + +func (c *Conn) Xf86driGetDrawableInfo(Screen uint32, Drawable uint32) Xf86driGetDrawableInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driGetDrawableInfoRequest(Screen, Drawable), cookie) + return Xf86driGetDrawableInfoCookie{cookie} +} + +func (c *Conn) Xf86driGetDrawableInfoUnchecked(Screen uint32, Drawable uint32) Xf86driGetDrawableInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driGetDrawableInfoRequest(Screen, Drawable), cookie) + return Xf86driGetDrawableInfoCookie{cookie} +} + +// Request reply for Xf86driGetDrawableInfo +// size: ((36 + pad((int(NumClipRects) * 8))) + pad((int(NumBackClipRects) * 8))) +type Xf86driGetDrawableInfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DrawableTableIndex uint32 + DrawableTableStamp uint32 + DrawableOriginX int16 + DrawableOriginY int16 + DrawableSizeW int16 + DrawableSizeH int16 + NumClipRects uint32 + BackX int16 + BackY int16 + NumBackClipRects uint32 + ClipRects []Xf86driDrmClipRect // size: pad((int(NumClipRects) * 8)) + BackClipRects []Xf86driDrmClipRect // size: pad((int(NumBackClipRects) * 8)) +} + +// Waits and reads reply data from request Xf86driGetDrawableInfo +func (cook Xf86driGetDrawableInfoCookie) Reply() (*Xf86driGetDrawableInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driGetDrawableInfoReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driGetDrawableInfo +func xf86driGetDrawableInfoReply(buf []byte) *Xf86driGetDrawableInfoReply { + v := new(Xf86driGetDrawableInfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.DrawableTableIndex = Get32(buf[b:]) + b += 4 + + v.DrawableTableStamp = Get32(buf[b:]) + b += 4 + + v.DrawableOriginX = int16(Get16(buf[b:])) + b += 2 + + v.DrawableOriginY = int16(Get16(buf[b:])) + b += 2 + + v.DrawableSizeW = int16(Get16(buf[b:])) + b += 2 + + v.DrawableSizeH = int16(Get16(buf[b:])) + b += 2 + + v.NumClipRects = Get32(buf[b:]) + b += 4 + + v.BackX = int16(Get16(buf[b:])) + b += 2 + + v.BackY = int16(Get16(buf[b:])) + b += 2 + + v.NumBackClipRects = Get32(buf[b:]) + b += 4 + + v.ClipRects = make([]Xf86driDrmClipRect, v.NumClipRects) + b += ReadXf86driDrmClipRectList(buf[b:], v.ClipRects) + + v.BackClipRects = make([]Xf86driDrmClipRect, v.NumBackClipRects) + b += ReadXf86driDrmClipRectList(buf[b:], v.BackClipRects) + + return v +} + +func (cook Xf86driGetDrawableInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driGetDrawableInfo +func (c *Conn) xf86driGetDrawableInfoRequest(Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request Xf86driGetDeviceInfo +// size: 8 +type Xf86driGetDeviceInfoCookie struct { + *cookie +} + +func (c *Conn) Xf86driGetDeviceInfo(Screen uint32) Xf86driGetDeviceInfoCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driGetDeviceInfoRequest(Screen), cookie) + return Xf86driGetDeviceInfoCookie{cookie} +} + +func (c *Conn) Xf86driGetDeviceInfoUnchecked(Screen uint32) Xf86driGetDeviceInfoCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driGetDeviceInfoRequest(Screen), cookie) + return Xf86driGetDeviceInfoCookie{cookie} +} + +// Request reply for Xf86driGetDeviceInfo +// size: (32 + pad((int(DevicePrivateSize) * 4))) +type Xf86driGetDeviceInfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + FramebufferHandleLow uint32 + FramebufferHandleHigh uint32 + FramebufferOriginOffset uint32 + FramebufferSize uint32 + FramebufferStride uint32 + DevicePrivateSize uint32 + DevicePrivate []uint32 // size: pad((int(DevicePrivateSize) * 4)) +} + +// Waits and reads reply data from request Xf86driGetDeviceInfo +func (cook Xf86driGetDeviceInfoCookie) Reply() (*Xf86driGetDeviceInfoReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driGetDeviceInfoReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driGetDeviceInfo +func xf86driGetDeviceInfoReply(buf []byte) *Xf86driGetDeviceInfoReply { + v := new(Xf86driGetDeviceInfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.FramebufferHandleLow = Get32(buf[b:]) + b += 4 + + v.FramebufferHandleHigh = Get32(buf[b:]) + b += 4 + + v.FramebufferOriginOffset = Get32(buf[b:]) + b += 4 + + v.FramebufferSize = Get32(buf[b:]) + b += 4 + + v.FramebufferStride = Get32(buf[b:]) + b += 4 + + v.DevicePrivateSize = Get32(buf[b:]) + b += 4 + + v.DevicePrivate = make([]uint32, v.DevicePrivateSize) + for i := 0; i < int(v.DevicePrivateSize); i++ { + v.DevicePrivate[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook Xf86driGetDeviceInfoCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driGetDeviceInfo +func (c *Conn) xf86driGetDeviceInfoRequest(Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request Xf86driAuthConnection +// size: 12 +type Xf86driAuthConnectionCookie struct { + *cookie +} + +func (c *Conn) Xf86driAuthConnection(Screen uint32, Magic uint32) Xf86driAuthConnectionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86driAuthConnectionRequest(Screen, Magic), cookie) + return Xf86driAuthConnectionCookie{cookie} +} + +func (c *Conn) Xf86driAuthConnectionUnchecked(Screen uint32, Magic uint32) Xf86driAuthConnectionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86driAuthConnectionRequest(Screen, Magic), cookie) + return Xf86driAuthConnectionCookie{cookie} +} + +// Request reply for Xf86driAuthConnection +// size: 12 +type Xf86driAuthConnectionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Authenticated uint32 +} + +// Waits and reads reply data from request Xf86driAuthConnection +func (cook Xf86driAuthConnectionCookie) Reply() (*Xf86driAuthConnectionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86driAuthConnectionReply(buf), nil +} + +// Read reply into structure from buffer for Xf86driAuthConnection +func xf86driAuthConnectionReply(buf []byte) *Xf86driAuthConnectionReply { + v := new(Xf86driAuthConnectionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Authenticated = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook Xf86driAuthConnectionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86driAuthConnection +func (c *Conn) xf86driAuthConnectionRequest(Screen uint32, Magic uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], Magic) + b += 4 + + return buf +} diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go new file mode 100644 index 0000000..aefadf7 --- /dev/null +++ b/nexgb/auto_xf86vidmode.go @@ -0,0 +1,2372 @@ +package xgb + +/* + This file was generated by xf86vidmode.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +const ( + Xf86vidmodeModeFlagPositiveHsync = 1 + Xf86vidmodeModeFlagNegativeHsync = 2 + Xf86vidmodeModeFlagPositiveVsync = 4 + Xf86vidmodeModeFlagNegativeVsync = 8 + Xf86vidmodeModeFlagInterlace = 16 + Xf86vidmodeModeFlagCompositeSync = 32 + Xf86vidmodeModeFlagPositiveCsync = 64 + Xf86vidmodeModeFlagNegativeCsync = 128 + Xf86vidmodeModeFlagHSkew = 256 + Xf86vidmodeModeFlagBroadcast = 512 + Xf86vidmodeModeFlagPixmux = 1024 + Xf86vidmodeModeFlagDoubleClock = 2048 + Xf86vidmodeModeFlagHalfClock = 4096 +) + +const ( + Xf86vidmodeClockFlagProgramable = 1 +) + +const ( + Xf86vidmodePermissionRead = 1 + Xf86vidmodePermissionWrite = 2 +) + +type Xf86vidmodeSyncrange uint32 + +type Xf86vidmodeDotclock uint32 + +// 'Xf86vidmodeModeInfo' struct definition +// Size: 48 +type Xf86vidmodeModeInfo struct { + Dotclock Xf86vidmodeDotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint32 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 4 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 +} + +// Struct read Xf86vidmodeModeInfo +func ReadXf86vidmodeModeInfo(buf []byte, v *Xf86vidmodeModeInfo) int { + b := 0 + + v.Dotclock = Xf86vidmodeDotclock(Get32(buf[b:])) + b += 4 + + v.Hdisplay = Get16(buf[b:]) + b += 2 + + v.Hsyncstart = Get16(buf[b:]) + b += 2 + + v.Hsyncend = Get16(buf[b:]) + b += 2 + + v.Htotal = Get16(buf[b:]) + b += 2 + + v.Hskew = Get32(buf[b:]) + b += 4 + + v.Vdisplay = Get16(buf[b:]) + b += 2 + + v.Vsyncstart = Get16(buf[b:]) + b += 2 + + v.Vsyncend = Get16(buf[b:]) + b += 2 + + v.Vtotal = Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Flags = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Xf86vidmodeModeInfo +func ReadXf86vidmodeModeInfoList(buf []byte, dest []Xf86vidmodeModeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Xf86vidmodeModeInfo{} + b += ReadXf86vidmodeModeInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write Xf86vidmodeModeInfo +func (v Xf86vidmodeModeInfo) Bytes() []byte { + buf := make([]byte, 48) + b := 0 + + Put32(buf[b:], uint32(v.Dotclock)) + b += 4 + + Put16(buf[b:], v.Hdisplay) + b += 2 + + Put16(buf[b:], v.Hsyncstart) + b += 2 + + Put16(buf[b:], v.Hsyncend) + b += 2 + + Put16(buf[b:], v.Htotal) + b += 2 + + Put32(buf[b:], v.Hskew) + b += 4 + + Put16(buf[b:], v.Vdisplay) + b += 2 + + Put16(buf[b:], v.Vsyncstart) + b += 2 + + Put16(buf[b:], v.Vsyncend) + b += 2 + + Put16(buf[b:], v.Vtotal) + b += 2 + + b += 4 // padding + + Put32(buf[b:], v.Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], v.Privsize) + b += 4 + + return buf +} + +// Write struct list Xf86vidmodeModeInfo +func Xf86vidmodeModeInfoListBytes(buf []byte, list []Xf86vidmodeModeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Error definition Xf86vidmodeBadClock (0) +// Size: 32 + +const BadXf86vidmodeBadClock = 0 + +type Xf86vidmodeBadClockError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeBadClock +func NewXf86vidmodeBadClockError(buf []byte) Error { + v := Xf86vidmodeBadClockError{} + v.NiceName = "Xf86vidmodeBadClock" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeBadClockError) ImplementsError() {} + +func (err Xf86vidmodeBadClockError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeBadClockError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeBadClockError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeBadClock {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewXf86vidmodeBadClockError +} + +// Error definition Xf86vidmodeBadHTimings (1) +// Size: 32 + +const BadXf86vidmodeBadHTimings = 1 + +type Xf86vidmodeBadHTimingsError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeBadHTimings +func NewXf86vidmodeBadHTimingsError(buf []byte) Error { + v := Xf86vidmodeBadHTimingsError{} + v.NiceName = "Xf86vidmodeBadHTimings" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeBadHTimingsError) ImplementsError() {} + +func (err Xf86vidmodeBadHTimingsError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeBadHTimingsError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeBadHTimingsError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeBadHTimings {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewXf86vidmodeBadHTimingsError +} + +// Error definition Xf86vidmodeBadVTimings (2) +// Size: 32 + +const BadXf86vidmodeBadVTimings = 2 + +type Xf86vidmodeBadVTimingsError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeBadVTimings +func NewXf86vidmodeBadVTimingsError(buf []byte) Error { + v := Xf86vidmodeBadVTimingsError{} + v.NiceName = "Xf86vidmodeBadVTimings" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeBadVTimingsError) ImplementsError() {} + +func (err Xf86vidmodeBadVTimingsError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeBadVTimingsError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeBadVTimingsError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeBadVTimings {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewXf86vidmodeBadVTimingsError +} + +// Error definition Xf86vidmodeModeUnsuitable (3) +// Size: 32 + +const BadXf86vidmodeModeUnsuitable = 3 + +type Xf86vidmodeModeUnsuitableError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeModeUnsuitable +func NewXf86vidmodeModeUnsuitableError(buf []byte) Error { + v := Xf86vidmodeModeUnsuitableError{} + v.NiceName = "Xf86vidmodeModeUnsuitable" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeModeUnsuitableError) ImplementsError() {} + +func (err Xf86vidmodeModeUnsuitableError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeModeUnsuitableError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeModeUnsuitableError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeModeUnsuitable {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[3] = NewXf86vidmodeModeUnsuitableError +} + +// Error definition Xf86vidmodeExtensionDisabled (4) +// Size: 32 + +const BadXf86vidmodeExtensionDisabled = 4 + +type Xf86vidmodeExtensionDisabledError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeExtensionDisabled +func NewXf86vidmodeExtensionDisabledError(buf []byte) Error { + v := Xf86vidmodeExtensionDisabledError{} + v.NiceName = "Xf86vidmodeExtensionDisabled" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeExtensionDisabledError) ImplementsError() {} + +func (err Xf86vidmodeExtensionDisabledError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeExtensionDisabledError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeExtensionDisabledError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeExtensionDisabled {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[4] = NewXf86vidmodeExtensionDisabledError +} + +// Error definition Xf86vidmodeClientNotLocal (5) +// Size: 32 + +const BadXf86vidmodeClientNotLocal = 5 + +type Xf86vidmodeClientNotLocalError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeClientNotLocal +func NewXf86vidmodeClientNotLocalError(buf []byte) Error { + v := Xf86vidmodeClientNotLocalError{} + v.NiceName = "Xf86vidmodeClientNotLocal" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeClientNotLocalError) ImplementsError() {} + +func (err Xf86vidmodeClientNotLocalError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeClientNotLocalError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeClientNotLocalError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeClientNotLocal {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[5] = NewXf86vidmodeClientNotLocalError +} + +// Error definition Xf86vidmodeZoomLocked (6) +// Size: 32 + +const BadXf86vidmodeZoomLocked = 6 + +type Xf86vidmodeZoomLockedError struct { + Sequence uint16 + NiceName string +} + +// Error read Xf86vidmodeZoomLocked +func NewXf86vidmodeZoomLockedError(buf []byte) Error { + v := Xf86vidmodeZoomLockedError{} + v.NiceName = "Xf86vidmodeZoomLocked" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err Xf86vidmodeZoomLockedError) ImplementsError() {} + +func (err Xf86vidmodeZoomLockedError) SequenceId() uint16 { + return err.Sequence +} + +func (err Xf86vidmodeZoomLockedError) BadId() Id { + return 0 +} + +func (err Xf86vidmodeZoomLockedError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXf86vidmodeZoomLocked {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[6] = NewXf86vidmodeZoomLockedError +} + +// Request Xf86vidmodeQueryVersion +// size: 4 +type Xf86vidmodeQueryVersionCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeQueryVersion() Xf86vidmodeQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeQueryVersionRequest(), cookie) + return Xf86vidmodeQueryVersionCookie{cookie} +} + +func (c *Conn) Xf86vidmodeQueryVersionUnchecked() Xf86vidmodeQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeQueryVersionRequest(), cookie) + return Xf86vidmodeQueryVersionCookie{cookie} +} + +// Request reply for Xf86vidmodeQueryVersion +// size: 12 +type Xf86vidmodeQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request Xf86vidmodeQueryVersion +func (cook Xf86vidmodeQueryVersionCookie) Reply() (*Xf86vidmodeQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeQueryVersion +func xf86vidmodeQueryVersionReply(buf []byte) *Xf86vidmodeQueryVersionReply { + v := new(Xf86vidmodeQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook Xf86vidmodeQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeQueryVersion +func (c *Conn) xf86vidmodeQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Xf86vidmodeGetModeLine +// size: 8 +type Xf86vidmodeGetModeLineCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetModeLine(Screen uint16) Xf86vidmodeGetModeLineCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetModeLineRequest(Screen), cookie) + return Xf86vidmodeGetModeLineCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetModeLineUnchecked(Screen uint16) Xf86vidmodeGetModeLineCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetModeLineRequest(Screen), cookie) + return Xf86vidmodeGetModeLineCookie{cookie} +} + +// Request reply for Xf86vidmodeGetModeLine +// size: (52 + pad((int(Privsize) * 1))) +type Xf86vidmodeGetModeLineReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Dotclock Xf86vidmodeDotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint16 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 2 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 + Private []byte // size: pad((int(Privsize) * 1)) +} + +// Waits and reads reply data from request Xf86vidmodeGetModeLine +func (cook Xf86vidmodeGetModeLineCookie) Reply() (*Xf86vidmodeGetModeLineReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetModeLineReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetModeLine +func xf86vidmodeGetModeLineReply(buf []byte) *Xf86vidmodeGetModeLineReply { + v := new(Xf86vidmodeGetModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Dotclock = Xf86vidmodeDotclock(Get32(buf[b:])) + b += 4 + + v.Hdisplay = Get16(buf[b:]) + b += 2 + + v.Hsyncstart = Get16(buf[b:]) + b += 2 + + v.Hsyncend = Get16(buf[b:]) + b += 2 + + v.Htotal = Get16(buf[b:]) + b += 2 + + v.Hskew = Get16(buf[b:]) + b += 2 + + v.Vdisplay = Get16(buf[b:]) + b += 2 + + v.Vsyncstart = Get16(buf[b:]) + b += 2 + + v.Vsyncend = Get16(buf[b:]) + b += 2 + + v.Vtotal = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Flags = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = Get32(buf[b:]) + b += 4 + + v.Private = make([]byte, v.Privsize) + copy(v.Private[:v.Privsize], buf[b:]) + b += pad(int(v.Privsize)) + + return v +} + +func (cook Xf86vidmodeGetModeLineCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetModeLine +func (c *Conn) xf86vidmodeGetModeLineRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeModModeLine +// size: pad((48 + pad((int(Privsize) * 1)))) +type Xf86vidmodeModModeLineCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeModModeLine +func (c *Conn) Xf86vidmodeModModeLine(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeModModeLineCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeModModeLineRequest(Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeModModeLineCookie{cookie} +} + +func (c *Conn) Xf86vidmodeModModeLineChecked(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeModModeLineCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeModModeLineRequest(Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeModModeLineCookie{cookie} +} + +func (cook Xf86vidmodeModModeLineCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeModModeLine +func (c *Conn) xf86vidmodeModModeLineRequest(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := pad((48 + pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put16(buf[b:], Hdisplay) + b += 2 + + Put16(buf[b:], Hsyncstart) + b += 2 + + Put16(buf[b:], Hsyncend) + b += 2 + + Put16(buf[b:], Htotal) + b += 2 + + Put16(buf[b:], Hskew) + b += 2 + + Put16(buf[b:], Vdisplay) + b += 2 + + Put16(buf[b:], Vsyncstart) + b += 2 + + Put16(buf[b:], Vsyncend) + b += 2 + + Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += pad(int(Privsize)) + + return buf +} + +// Request Xf86vidmodeSwitchMode +// size: 8 +type Xf86vidmodeSwitchModeCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSwitchMode +func (c *Conn) Xf86vidmodeSwitchMode(Screen uint16, Zoom uint16) Xf86vidmodeSwitchModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSwitchModeRequest(Screen, Zoom), cookie) + return Xf86vidmodeSwitchModeCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSwitchModeChecked(Screen uint16, Zoom uint16) Xf86vidmodeSwitchModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSwitchModeRequest(Screen, Zoom), cookie) + return Xf86vidmodeSwitchModeCookie{cookie} +} + +func (cook Xf86vidmodeSwitchModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSwitchMode +func (c *Conn) xf86vidmodeSwitchModeRequest(Screen uint16, Zoom uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + Put16(buf[b:], Zoom) + b += 2 + + return buf +} + +// Request Xf86vidmodeGetMonitor +// size: 8 +type Xf86vidmodeGetMonitorCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetMonitor(Screen uint16) Xf86vidmodeGetMonitorCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetMonitorRequest(Screen), cookie) + return Xf86vidmodeGetMonitorCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetMonitorUnchecked(Screen uint16) Xf86vidmodeGetMonitorCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetMonitorRequest(Screen), cookie) + return Xf86vidmodeGetMonitorCookie{cookie} +} + +// Request reply for Xf86vidmodeGetMonitor +// size: (((((32 + pad((int(NumHsync) * 4))) + pad((int(NumVsync) * 4))) + pad((int(VendorLength) * 1))) + pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1))) + pad((int(ModelLength) * 1))) +type Xf86vidmodeGetMonitorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + VendorLength byte + ModelLength byte + NumHsync byte + NumVsync byte + // padding: 20 bytes + Hsync []Xf86vidmodeSyncrange // size: pad((int(NumHsync) * 4)) + Vsync []Xf86vidmodeSyncrange // size: pad((int(NumVsync) * 4)) + Vendor string // size: pad((int(VendorLength) * 1)) + AlignmentPad []byte // size: pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) + Model string // size: pad((int(ModelLength) * 1)) +} + +// Waits and reads reply data from request Xf86vidmodeGetMonitor +func (cook Xf86vidmodeGetMonitorCookie) Reply() (*Xf86vidmodeGetMonitorReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetMonitorReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetMonitor +func xf86vidmodeGetMonitorReply(buf []byte) *Xf86vidmodeGetMonitorReply { + v := new(Xf86vidmodeGetMonitorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.VendorLength = buf[b] + b += 1 + + v.ModelLength = buf[b] + b += 1 + + v.NumHsync = buf[b] + b += 1 + + v.NumVsync = buf[b] + b += 1 + + b += 20 // padding + + v.Hsync = make([]Xf86vidmodeSyncrange, v.NumHsync) + for i := 0; i < int(v.NumHsync); i++ { + v.Hsync[i] = Xf86vidmodeSyncrange(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.Vsync = make([]Xf86vidmodeSyncrange, v.NumVsync) + for i := 0; i < int(v.NumVsync); i++ { + v.Vsync[i] = Xf86vidmodeSyncrange(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + { + byteString := make([]byte, v.VendorLength) + copy(byteString[:v.VendorLength], buf[b:]) + v.Vendor = string(byteString) + b += pad(int(v.VendorLength)) + } + + v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) + copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) + b += pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) + + { + byteString := make([]byte, v.ModelLength) + copy(byteString[:v.ModelLength], buf[b:]) + v.Model = string(byteString) + b += pad(int(v.ModelLength)) + } + + return v +} + +func (cook Xf86vidmodeGetMonitorCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetMonitor +func (c *Conn) xf86vidmodeGetMonitorRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeLockModeSwitch +// size: 8 +type Xf86vidmodeLockModeSwitchCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeLockModeSwitch +func (c *Conn) Xf86vidmodeLockModeSwitch(Screen uint16, Lock uint16) Xf86vidmodeLockModeSwitchCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeLockModeSwitchRequest(Screen, Lock), cookie) + return Xf86vidmodeLockModeSwitchCookie{cookie} +} + +func (c *Conn) Xf86vidmodeLockModeSwitchChecked(Screen uint16, Lock uint16) Xf86vidmodeLockModeSwitchCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeLockModeSwitchRequest(Screen, Lock), cookie) + return Xf86vidmodeLockModeSwitchCookie{cookie} +} + +func (cook Xf86vidmodeLockModeSwitchCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeLockModeSwitch +func (c *Conn) xf86vidmodeLockModeSwitchRequest(Screen uint16, Lock uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + Put16(buf[b:], Lock) + b += 2 + + return buf +} + +// Request Xf86vidmodeGetAllModeLines +// size: 8 +type Xf86vidmodeGetAllModeLinesCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetAllModeLines(Screen uint16) Xf86vidmodeGetAllModeLinesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetAllModeLinesRequest(Screen), cookie) + return Xf86vidmodeGetAllModeLinesCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetAllModeLinesUnchecked(Screen uint16) Xf86vidmodeGetAllModeLinesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetAllModeLinesRequest(Screen), cookie) + return Xf86vidmodeGetAllModeLinesCookie{cookie} +} + +// Request reply for Xf86vidmodeGetAllModeLines +// size: (32 + pad((int(Modecount) * 48))) +type Xf86vidmodeGetAllModeLinesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Modecount uint32 + // padding: 20 bytes + Modeinfo []Xf86vidmodeModeInfo // size: pad((int(Modecount) * 48)) +} + +// Waits and reads reply data from request Xf86vidmodeGetAllModeLines +func (cook Xf86vidmodeGetAllModeLinesCookie) Reply() (*Xf86vidmodeGetAllModeLinesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetAllModeLinesReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetAllModeLines +func xf86vidmodeGetAllModeLinesReply(buf []byte) *Xf86vidmodeGetAllModeLinesReply { + v := new(Xf86vidmodeGetAllModeLinesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Modecount = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Modeinfo = make([]Xf86vidmodeModeInfo, v.Modecount) + b += ReadXf86vidmodeModeInfoList(buf[b:], v.Modeinfo) + + return v +} + +func (cook Xf86vidmodeGetAllModeLinesCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetAllModeLines +func (c *Conn) xf86vidmodeGetAllModeLinesRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeAddModeLine +// size: pad((92 + pad((int(Privsize) * 1)))) +type Xf86vidmodeAddModeLineCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeAddModeLine +func (c *Conn) Xf86vidmodeAddModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) Xf86vidmodeAddModeLineCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeAddModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) + return Xf86vidmodeAddModeLineCookie{cookie} +} + +func (c *Conn) Xf86vidmodeAddModeLineChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) Xf86vidmodeAddModeLineCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeAddModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) + return Xf86vidmodeAddModeLineCookie{cookie} +} + +func (cook Xf86vidmodeAddModeLineCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeAddModeLine +func (c *Conn) xf86vidmodeAddModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) []byte { + size := pad((92 + pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Dotclock)) + b += 4 + + Put16(buf[b:], Hdisplay) + b += 2 + + Put16(buf[b:], Hsyncstart) + b += 2 + + Put16(buf[b:], Hsyncend) + b += 2 + + Put16(buf[b:], Htotal) + b += 2 + + Put16(buf[b:], Hskew) + b += 2 + + Put16(buf[b:], Vdisplay) + b += 2 + + Put16(buf[b:], Vsyncstart) + b += 2 + + Put16(buf[b:], Vsyncend) + b += 2 + + Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], Privsize) + b += 4 + + Put32(buf[b:], uint32(AfterDotclock)) + b += 4 + + Put16(buf[b:], AfterHdisplay) + b += 2 + + Put16(buf[b:], AfterHsyncstart) + b += 2 + + Put16(buf[b:], AfterHsyncend) + b += 2 + + Put16(buf[b:], AfterHtotal) + b += 2 + + Put16(buf[b:], AfterHskew) + b += 2 + + Put16(buf[b:], AfterVdisplay) + b += 2 + + Put16(buf[b:], AfterVsyncstart) + b += 2 + + Put16(buf[b:], AfterVsyncend) + b += 2 + + Put16(buf[b:], AfterVtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], AfterFlags) + b += 4 + + b += 12 // padding + + copy(buf[b:], Private[:Privsize]) + b += pad(int(Privsize)) + + return buf +} + +// Request Xf86vidmodeDeleteModeLine +// size: pad((52 + pad((int(Privsize) * 1)))) +type Xf86vidmodeDeleteModeLineCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeDeleteModeLine +func (c *Conn) Xf86vidmodeDeleteModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeDeleteModeLineCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeDeleteModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeDeleteModeLineCookie{cookie} +} + +func (c *Conn) Xf86vidmodeDeleteModeLineChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeDeleteModeLineCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeDeleteModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeDeleteModeLineCookie{cookie} +} + +func (cook Xf86vidmodeDeleteModeLineCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeDeleteModeLine +func (c *Conn) xf86vidmodeDeleteModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := pad((52 + pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Dotclock)) + b += 4 + + Put16(buf[b:], Hdisplay) + b += 2 + + Put16(buf[b:], Hsyncstart) + b += 2 + + Put16(buf[b:], Hsyncend) + b += 2 + + Put16(buf[b:], Htotal) + b += 2 + + Put16(buf[b:], Hskew) + b += 2 + + Put16(buf[b:], Vdisplay) + b += 2 + + Put16(buf[b:], Vsyncstart) + b += 2 + + Put16(buf[b:], Vsyncend) + b += 2 + + Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += pad(int(Privsize)) + + return buf +} + +// Request Xf86vidmodeValidateModeLine +// size: pad((52 + pad((int(Privsize) * 1)))) +type Xf86vidmodeValidateModeLineCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeValidateModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeValidateModeLineCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeValidateModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeValidateModeLineCookie{cookie} +} + +func (c *Conn) Xf86vidmodeValidateModeLineUnchecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeValidateModeLineCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeValidateModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeValidateModeLineCookie{cookie} +} + +// Request reply for Xf86vidmodeValidateModeLine +// size: 32 +type Xf86vidmodeValidateModeLineReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status uint32 + // padding: 20 bytes +} + +// Waits and reads reply data from request Xf86vidmodeValidateModeLine +func (cook Xf86vidmodeValidateModeLineCookie) Reply() (*Xf86vidmodeValidateModeLineReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeValidateModeLineReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeValidateModeLine +func xf86vidmodeValidateModeLineReply(buf []byte) *Xf86vidmodeValidateModeLineReply { + v := new(Xf86vidmodeValidateModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + return v +} + +func (cook Xf86vidmodeValidateModeLineCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeValidateModeLine +func (c *Conn) xf86vidmodeValidateModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := pad((52 + pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Dotclock)) + b += 4 + + Put16(buf[b:], Hdisplay) + b += 2 + + Put16(buf[b:], Hsyncstart) + b += 2 + + Put16(buf[b:], Hsyncend) + b += 2 + + Put16(buf[b:], Htotal) + b += 2 + + Put16(buf[b:], Hskew) + b += 2 + + Put16(buf[b:], Vdisplay) + b += 2 + + Put16(buf[b:], Vsyncstart) + b += 2 + + Put16(buf[b:], Vsyncend) + b += 2 + + Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += pad(int(Privsize)) + + return buf +} + +// Request Xf86vidmodeSwitchToMode +// size: pad((52 + pad((int(Privsize) * 1)))) +type Xf86vidmodeSwitchToModeCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSwitchToMode +func (c *Conn) Xf86vidmodeSwitchToMode(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeSwitchToModeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSwitchToModeRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeSwitchToModeCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSwitchToModeChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeSwitchToModeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSwitchToModeRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return Xf86vidmodeSwitchToModeCookie{cookie} +} + +func (cook Xf86vidmodeSwitchToModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSwitchToMode +func (c *Conn) xf86vidmodeSwitchToModeRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := pad((52 + pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Screen) + b += 4 + + Put32(buf[b:], uint32(Dotclock)) + b += 4 + + Put16(buf[b:], Hdisplay) + b += 2 + + Put16(buf[b:], Hsyncstart) + b += 2 + + Put16(buf[b:], Hsyncend) + b += 2 + + Put16(buf[b:], Htotal) + b += 2 + + Put16(buf[b:], Hskew) + b += 2 + + Put16(buf[b:], Vdisplay) + b += 2 + + Put16(buf[b:], Vsyncstart) + b += 2 + + Put16(buf[b:], Vsyncend) + b += 2 + + Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += pad(int(Privsize)) + + return buf +} + +// Request Xf86vidmodeGetViewPort +// size: 8 +type Xf86vidmodeGetViewPortCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetViewPort(Screen uint16) Xf86vidmodeGetViewPortCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetViewPortRequest(Screen), cookie) + return Xf86vidmodeGetViewPortCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetViewPortUnchecked(Screen uint16) Xf86vidmodeGetViewPortCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetViewPortRequest(Screen), cookie) + return Xf86vidmodeGetViewPortCookie{cookie} +} + +// Request reply for Xf86vidmodeGetViewPort +// size: 32 +type Xf86vidmodeGetViewPortReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X uint32 + Y uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request Xf86vidmodeGetViewPort +func (cook Xf86vidmodeGetViewPortCookie) Reply() (*Xf86vidmodeGetViewPortReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetViewPortReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetViewPort +func xf86vidmodeGetViewPortReply(buf []byte) *Xf86vidmodeGetViewPortReply { + v := new(Xf86vidmodeGetViewPortReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = Get32(buf[b:]) + b += 4 + + v.Y = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook Xf86vidmodeGetViewPortCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetViewPort +func (c *Conn) xf86vidmodeGetViewPortRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeSetViewPort +// size: 16 +type Xf86vidmodeSetViewPortCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSetViewPort +func (c *Conn) Xf86vidmodeSetViewPort(Screen uint16, X uint32, Y uint32) Xf86vidmodeSetViewPortCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSetViewPortRequest(Screen, X, Y), cookie) + return Xf86vidmodeSetViewPortCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSetViewPortChecked(Screen uint16, X uint32, Y uint32) Xf86vidmodeSetViewPortCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSetViewPortRequest(Screen, X, Y), cookie) + return Xf86vidmodeSetViewPortCookie{cookie} +} + +func (cook Xf86vidmodeSetViewPortCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSetViewPort +func (c *Conn) xf86vidmodeSetViewPortRequest(Screen uint16, X uint32, Y uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + Put32(buf[b:], X) + b += 4 + + Put32(buf[b:], Y) + b += 4 + + return buf +} + +// Request Xf86vidmodeGetDotClocks +// size: 8 +type Xf86vidmodeGetDotClocksCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetDotClocks(Screen uint16) Xf86vidmodeGetDotClocksCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetDotClocksRequest(Screen), cookie) + return Xf86vidmodeGetDotClocksCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetDotClocksUnchecked(Screen uint16) Xf86vidmodeGetDotClocksCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetDotClocksRequest(Screen), cookie) + return Xf86vidmodeGetDotClocksCookie{cookie} +} + +// Request reply for Xf86vidmodeGetDotClocks +// size: (32 + pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4))) +type Xf86vidmodeGetDotClocksReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Flags uint32 + Clocks uint32 + Maxclocks uint32 + // padding: 12 bytes + Clock []uint32 // size: pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4)) +} + +// Waits and reads reply data from request Xf86vidmodeGetDotClocks +func (cook Xf86vidmodeGetDotClocksCookie) Reply() (*Xf86vidmodeGetDotClocksReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetDotClocksReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetDotClocks +func xf86vidmodeGetDotClocksReply(buf []byte) *Xf86vidmodeGetDotClocksReply { + v := new(Xf86vidmodeGetDotClocksReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Flags = Get32(buf[b:]) + b += 4 + + v.Clocks = Get32(buf[b:]) + b += 4 + + v.Maxclocks = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Clock = make([]uint32, ((1 - (int(v.Flags) & 1)) * int(v.Clocks))) + for i := 0; i < int(((1 - (int(v.Flags) & 1)) * int(v.Clocks))); i++ { + v.Clock[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook Xf86vidmodeGetDotClocksCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetDotClocks +func (c *Conn) xf86vidmodeGetDotClocksRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeSetClientVersion +// size: 8 +type Xf86vidmodeSetClientVersionCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSetClientVersion +func (c *Conn) Xf86vidmodeSetClientVersion(Major uint16, Minor uint16) Xf86vidmodeSetClientVersionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSetClientVersionRequest(Major, Minor), cookie) + return Xf86vidmodeSetClientVersionCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSetClientVersionChecked(Major uint16, Minor uint16) Xf86vidmodeSetClientVersionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSetClientVersionRequest(Major, Minor), cookie) + return Xf86vidmodeSetClientVersionCookie{cookie} +} + +func (cook Xf86vidmodeSetClientVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSetClientVersion +func (c *Conn) xf86vidmodeSetClientVersionRequest(Major uint16, Minor uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Major) + b += 2 + + Put16(buf[b:], Minor) + b += 2 + + return buf +} + +// Request Xf86vidmodeSetGamma +// size: 32 +type Xf86vidmodeSetGammaCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSetGamma +func (c *Conn) Xf86vidmodeSetGamma(Screen uint16, Red uint32, Green uint32, Blue uint32) Xf86vidmodeSetGammaCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSetGammaRequest(Screen, Red, Green, Blue), cookie) + return Xf86vidmodeSetGammaCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSetGammaChecked(Screen uint16, Red uint32, Green uint32, Blue uint32) Xf86vidmodeSetGammaCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSetGammaRequest(Screen, Red, Green, Blue), cookie) + return Xf86vidmodeSetGammaCookie{cookie} +} + +func (cook Xf86vidmodeSetGammaCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSetGamma +func (c *Conn) xf86vidmodeSetGammaRequest(Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + Put32(buf[b:], Red) + b += 4 + + Put32(buf[b:], Green) + b += 4 + + Put32(buf[b:], Blue) + b += 4 + + b += 12 // padding + + return buf +} + +// Request Xf86vidmodeGetGamma +// size: 32 +type Xf86vidmodeGetGammaCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetGamma(Screen uint16) Xf86vidmodeGetGammaCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetGammaRequest(Screen), cookie) + return Xf86vidmodeGetGammaCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetGammaUnchecked(Screen uint16) Xf86vidmodeGetGammaCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetGammaRequest(Screen), cookie) + return Xf86vidmodeGetGammaCookie{cookie} +} + +// Request reply for Xf86vidmodeGetGamma +// size: 32 +type Xf86vidmodeGetGammaReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Red uint32 + Green uint32 + Blue uint32 + // padding: 12 bytes +} + +// Waits and reads reply data from request Xf86vidmodeGetGamma +func (cook Xf86vidmodeGetGammaCookie) Reply() (*Xf86vidmodeGetGammaReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetGammaReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetGamma +func xf86vidmodeGetGammaReply(buf []byte) *Xf86vidmodeGetGammaReply { + v := new(Xf86vidmodeGetGammaReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Red = Get32(buf[b:]) + b += 4 + + v.Green = Get32(buf[b:]) + b += 4 + + v.Blue = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + return v +} + +func (cook Xf86vidmodeGetGammaCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetGamma +func (c *Conn) xf86vidmodeGetGammaRequest(Screen uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 26 // padding + + return buf +} + +// Request Xf86vidmodeGetGammaRamp +// size: 8 +type Xf86vidmodeGetGammaRampCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetGammaRamp(Screen uint16, Size uint16) Xf86vidmodeGetGammaRampCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetGammaRampRequest(Screen, Size), cookie) + return Xf86vidmodeGetGammaRampCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetGammaRampUnchecked(Screen uint16, Size uint16) Xf86vidmodeGetGammaRampCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetGammaRampRequest(Screen, Size), cookie) + return Xf86vidmodeGetGammaRampCookie{cookie} +} + +// Request reply for Xf86vidmodeGetGammaRamp +// size: (((32 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) +type Xf86vidmodeGetGammaRampReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes + Red []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) + Green []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) + Blue []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) +} + +// Waits and reads reply data from request Xf86vidmodeGetGammaRamp +func (cook Xf86vidmodeGetGammaRampCookie) Reply() (*Xf86vidmodeGetGammaRampReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetGammaRampReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetGammaRamp +func xf86vidmodeGetGammaRampReply(buf []byte) *Xf86vidmodeGetGammaRampReply { + v := new(Xf86vidmodeGetGammaRampReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Red = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Red[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + v.Green = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Green[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + v.Blue = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Blue[i] = Get16(buf[b:]) + b += 2 + } + b = pad(b) + + return v +} + +func (cook Xf86vidmodeGetGammaRampCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetGammaRamp +func (c *Conn) xf86vidmodeGetGammaRampRequest(Screen uint16, Size uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + Put16(buf[b:], Size) + b += 2 + + return buf +} + +// Request Xf86vidmodeSetGammaRamp +// size: pad((((8 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2)))) +type Xf86vidmodeSetGammaRampCookie struct { + *cookie +} + +// Write request to wire for Xf86vidmodeSetGammaRamp +func (c *Conn) Xf86vidmodeSetGammaRamp(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) Xf86vidmodeSetGammaRampCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xf86vidmodeSetGammaRampRequest(Screen, Size, Red, Green, Blue), cookie) + return Xf86vidmodeSetGammaRampCookie{cookie} +} + +func (c *Conn) Xf86vidmodeSetGammaRampChecked(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) Xf86vidmodeSetGammaRampCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xf86vidmodeSetGammaRampRequest(Screen, Size, Red, Green, Blue), cookie) + return Xf86vidmodeSetGammaRampCookie{cookie} +} + +func (cook Xf86vidmodeSetGammaRampCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeSetGammaRamp +func (c *Conn) xf86vidmodeSetGammaRampRequest(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { + size := pad((((8 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + Put16(buf[b:], Size) + b += 2 + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + Put16(buf[b:], Red[i]) + b += 2 + } + b = pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + Put16(buf[b:], Green[i]) + b += 2 + } + b = pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + Put16(buf[b:], Blue[i]) + b += 2 + } + b = pad(b) + + return buf +} + +// Request Xf86vidmodeGetGammaRampSize +// size: 8 +type Xf86vidmodeGetGammaRampSizeCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetGammaRampSize(Screen uint16) Xf86vidmodeGetGammaRampSizeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetGammaRampSizeRequest(Screen), cookie) + return Xf86vidmodeGetGammaRampSizeCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetGammaRampSizeUnchecked(Screen uint16) Xf86vidmodeGetGammaRampSizeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetGammaRampSizeRequest(Screen), cookie) + return Xf86vidmodeGetGammaRampSizeCookie{cookie} +} + +// Request reply for Xf86vidmodeGetGammaRampSize +// size: 32 +type Xf86vidmodeGetGammaRampSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request Xf86vidmodeGetGammaRampSize +func (cook Xf86vidmodeGetGammaRampSizeCookie) Reply() (*Xf86vidmodeGetGammaRampSizeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetGammaRampSizeReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetGammaRampSize +func xf86vidmodeGetGammaRampSizeReply(buf []byte) *Xf86vidmodeGetGammaRampSizeReply { + v := new(Xf86vidmodeGetGammaRampSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +func (cook Xf86vidmodeGetGammaRampSizeCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetGammaRampSize +func (c *Conn) xf86vidmodeGetGammaRampSizeRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request Xf86vidmodeGetPermissions +// size: 8 +type Xf86vidmodeGetPermissionsCookie struct { + *cookie +} + +func (c *Conn) Xf86vidmodeGetPermissions(Screen uint16) Xf86vidmodeGetPermissionsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xf86vidmodeGetPermissionsRequest(Screen), cookie) + return Xf86vidmodeGetPermissionsCookie{cookie} +} + +func (c *Conn) Xf86vidmodeGetPermissionsUnchecked(Screen uint16) Xf86vidmodeGetPermissionsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xf86vidmodeGetPermissionsRequest(Screen), cookie) + return Xf86vidmodeGetPermissionsCookie{cookie} +} + +// Request reply for Xf86vidmodeGetPermissions +// size: 32 +type Xf86vidmodeGetPermissionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Permissions uint32 + // padding: 20 bytes +} + +// Waits and reads reply data from request Xf86vidmodeGetPermissions +func (cook Xf86vidmodeGetPermissionsCookie) Reply() (*Xf86vidmodeGetPermissionsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xf86vidmodeGetPermissionsReply(buf), nil +} + +// Read reply into structure from buffer for Xf86vidmodeGetPermissions +func xf86vidmodeGetPermissionsReply(buf []byte) *Xf86vidmodeGetPermissionsReply { + v := new(Xf86vidmodeGetPermissionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Permissions = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + return v +} + +func (cook Xf86vidmodeGetPermissionsCookie) Check() error { + return cook.check() +} + +// Write request to wire for Xf86vidmodeGetPermissions +func (c *Conn) xf86vidmodeGetPermissionsRequest(Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go new file mode 100644 index 0000000..9f1d105 --- /dev/null +++ b/nexgb/auto_xfixes.go @@ -0,0 +1,2139 @@ +package xgb + +/* + This file was generated by xfixes.xml on May 6 2012 3:00:44am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" +// import "render" +// import "shape" + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +const ( + XfixesSaveSetModeInsert = 0 + XfixesSaveSetModeDelete = 1 +) + +const ( + XfixesSaveSetTargetNearest = 0 + XfixesSaveSetTargetRoot = 1 +) + +const ( + XfixesSaveSetMappingMap = 0 + XfixesSaveSetMappingUnmap = 1 +) + +const ( + XfixesSelectionEventSetSelectionOwner = 0 + XfixesSelectionEventSelectionWindowDestroy = 1 + XfixesSelectionEventSelectionClientClose = 2 +) + +const ( + XfixesSelectionEventMaskSetSelectionOwner = 1 + XfixesSelectionEventMaskSelectionWindowDestroy = 2 + XfixesSelectionEventMaskSelectionClientClose = 4 +) + +const ( + XfixesCursorNotifyDisplayCursor = 0 +) + +const ( + XfixesCursorNotifyMaskDisplayCursor = 1 +) + +const ( + XfixesRegionNone = 0 +) + +// Skipping resource definition of 'Region' + +// Event definition XfixesSelectionNotify (0) +// Size: 32 + +const XfixesSelectionNotify = 0 + +type XfixesSelectionNotifyEvent struct { + Sequence uint16 + Subtype byte + Window Id + Owner Id + Selection Id + Timestamp Timestamp + SelectionTimestamp Timestamp + // padding: 8 bytes +} + +// Event read XfixesSelectionNotify +func NewXfixesSelectionNotifyEvent(buf []byte) Event { + v := XfixesSelectionNotifyEvent{} + b := 1 // don't read event number + + v.Subtype = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Owner = Id(Get32(buf[b:])) + b += 4 + + v.Selection = Id(Get32(buf[b:])) + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.SelectionTimestamp = Timestamp(Get32(buf[b:])) + b += 4 + + b += 8 // padding + + return v +} + +// Event write XfixesSelectionNotify +func (v XfixesSelectionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Subtype + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], uint32(v.Owner)) + b += 4 + + Put32(buf[b:], uint32(v.Selection)) + b += 4 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put32(buf[b:], uint32(v.SelectionTimestamp)) + b += 4 + + b += 8 // padding + + return buf +} + +func (v XfixesSelectionNotifyEvent) ImplementsEvent() {} + +func (v XfixesSelectionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XfixesSelectionNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Subtype: %d", v.Subtype)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, sprintf("SelectionTimestamp: %d", v.SelectionTimestamp)) + return "XfixesSelectionNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewXfixesSelectionNotifyEvent +} + +// Event definition XfixesCursorNotify (1) +// Size: 32 + +const XfixesCursorNotify = 1 + +type XfixesCursorNotifyEvent struct { + Sequence uint16 + Subtype byte + Window Id + CursorSerial uint32 + Timestamp Timestamp + Name Id + // padding: 12 bytes +} + +// Event read XfixesCursorNotify +func NewXfixesCursorNotifyEvent(buf []byte) Event { + v := XfixesCursorNotifyEvent{} + b := 1 // don't read event number + + v.Subtype = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.CursorSerial = Get32(buf[b:]) + b += 4 + + v.Timestamp = Timestamp(Get32(buf[b:])) + b += 4 + + v.Name = Id(Get32(buf[b:])) + b += 4 + + b += 12 // padding + + return v +} + +// Event write XfixesCursorNotify +func (v XfixesCursorNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Subtype + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + Put32(buf[b:], v.CursorSerial) + b += 4 + + Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + Put32(buf[b:], uint32(v.Name)) + b += 4 + + b += 12 // padding + + return buf +} + +func (v XfixesCursorNotifyEvent) ImplementsEvent() {} + +func (v XfixesCursorNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XfixesCursorNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Subtype: %d", v.Subtype)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("CursorSerial: %d", v.CursorSerial)) + fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, sprintf("Name: %d", v.Name)) + return "XfixesCursorNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewXfixesCursorNotifyEvent +} + +// Error definition XfixesBadRegion (0) +// Size: 32 + +const BadXfixesBadRegion = 0 + +type XfixesBadRegionError struct { + Sequence uint16 + NiceName string +} + +// Error read XfixesBadRegion +func NewXfixesBadRegionError(buf []byte) Error { + v := XfixesBadRegionError{} + v.NiceName = "XfixesBadRegion" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XfixesBadRegionError) ImplementsError() {} + +func (err XfixesBadRegionError) SequenceId() uint16 { + return err.Sequence +} + +func (err XfixesBadRegionError) BadId() Id { + return 0 +} + +func (err XfixesBadRegionError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXfixesBadRegion {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewXfixesBadRegionError +} + +// Request XfixesQueryVersion +// size: 12 +type XfixesQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XfixesQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) XfixesQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xfixesQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return XfixesQueryVersionCookie{cookie} +} + +func (c *Conn) XfixesQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) XfixesQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xfixesQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) + return XfixesQueryVersionCookie{cookie} +} + +// Request reply for XfixesQueryVersion +// size: 32 +type XfixesQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request XfixesQueryVersion +func (cook XfixesQueryVersionCookie) Reply() (*XfixesQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xfixesQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XfixesQueryVersion +func xfixesQueryVersionReply(buf []byte) *XfixesQueryVersionReply { + v := new(XfixesQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get32(buf[b:]) + b += 4 + + v.MinorVersion = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +func (cook XfixesQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesQueryVersion +func (c *Conn) xfixesQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ClientMajorVersion) + b += 4 + + Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request XfixesChangeSaveSet +// size: 12 +type XfixesChangeSaveSetCookie struct { + *cookie +} + +// Write request to wire for XfixesChangeSaveSet +func (c *Conn) XfixesChangeSaveSet(Mode byte, Target byte, Map byte, Window Id) XfixesChangeSaveSetCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) + return XfixesChangeSaveSetCookie{cookie} +} + +func (c *Conn) XfixesChangeSaveSetChecked(Mode byte, Target byte, Map byte, Window Id) XfixesChangeSaveSetCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) + return XfixesChangeSaveSetCookie{cookie} +} + +func (cook XfixesChangeSaveSetCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesChangeSaveSet +func (c *Conn) xfixesChangeSaveSetRequest(Mode byte, Target byte, Map byte, Window Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Mode + b += 1 + + buf[b] = Target + b += 1 + + buf[b] = Map + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XfixesSelectSelectionInput +// size: 16 +type XfixesSelectSelectionInputCookie struct { + *cookie +} + +// Write request to wire for XfixesSelectSelectionInput +func (c *Conn) XfixesSelectSelectionInput(Window Id, Selection Id, EventMask uint32) XfixesSelectSelectionInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) + return XfixesSelectSelectionInputCookie{cookie} +} + +func (c *Conn) XfixesSelectSelectionInputChecked(Window Id, Selection Id, EventMask uint32) XfixesSelectSelectionInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) + return XfixesSelectSelectionInputCookie{cookie} +} + +func (cook XfixesSelectSelectionInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSelectSelectionInput +func (c *Conn) xfixesSelectSelectionInputRequest(Window Id, Selection Id, EventMask uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request XfixesSelectCursorInput +// size: 12 +type XfixesSelectCursorInputCookie struct { + *cookie +} + +// Write request to wire for XfixesSelectCursorInput +func (c *Conn) XfixesSelectCursorInput(Window Id, EventMask uint32) XfixesSelectCursorInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) + return XfixesSelectCursorInputCookie{cookie} +} + +func (c *Conn) XfixesSelectCursorInputChecked(Window Id, EventMask uint32) XfixesSelectCursorInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) + return XfixesSelectCursorInputCookie{cookie} +} + +func (cook XfixesSelectCursorInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSelectCursorInput +func (c *Conn) xfixesSelectCursorInputRequest(Window Id, EventMask uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request XfixesGetCursorImage +// size: 4 +type XfixesGetCursorImageCookie struct { + *cookie +} + +func (c *Conn) XfixesGetCursorImage() XfixesGetCursorImageCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xfixesGetCursorImageRequest(), cookie) + return XfixesGetCursorImageCookie{cookie} +} + +func (c *Conn) XfixesGetCursorImageUnchecked() XfixesGetCursorImageCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xfixesGetCursorImageRequest(), cookie) + return XfixesGetCursorImageCookie{cookie} +} + +// Request reply for XfixesGetCursorImage +// size: (32 + pad(((int(Width) * int(Height)) * 4))) +type XfixesGetCursorImageReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X int16 + Y int16 + Width uint16 + Height uint16 + Xhot uint16 + Yhot uint16 + CursorSerial uint32 + // padding: 8 bytes + CursorImage []uint32 // size: pad(((int(Width) * int(Height)) * 4)) +} + +// Waits and reads reply data from request XfixesGetCursorImage +func (cook XfixesGetCursorImageCookie) Reply() (*XfixesGetCursorImageReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xfixesGetCursorImageReply(buf), nil +} + +// Read reply into structure from buffer for XfixesGetCursorImage +func xfixesGetCursorImageReply(buf []byte) *XfixesGetCursorImageReply { + v := new(XfixesGetCursorImageReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Xhot = Get16(buf[b:]) + b += 2 + + v.Yhot = Get16(buf[b:]) + b += 2 + + v.CursorSerial = Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) + for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { + v.CursorImage[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XfixesGetCursorImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesGetCursorImage +func (c *Conn) xfixesGetCursorImageRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XfixesCreateRegion +// size: pad((8 + pad((len(Rectangles) * 8)))) +type XfixesCreateRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesCreateRegion +func (c *Conn) XfixesCreateRegion(Region Id, Rectangles []Rectangle) XfixesCreateRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) + return XfixesCreateRegionCookie{cookie} +} + +func (c *Conn) XfixesCreateRegionChecked(Region Id, Rectangles []Rectangle) XfixesCreateRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) + return XfixesCreateRegionCookie{cookie} +} + +func (cook XfixesCreateRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCreateRegion +func (c *Conn) xfixesCreateRegionRequest(Region Id, Rectangles []Rectangle) []byte { + size := pad((8 + pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request XfixesCreateRegionFromBitmap +// size: 12 +type XfixesCreateRegionFromBitmapCookie struct { + *cookie +} + +// Write request to wire for XfixesCreateRegionFromBitmap +func (c *Conn) XfixesCreateRegionFromBitmap(Region Id, Bitmap Id) XfixesCreateRegionFromBitmapCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) + return XfixesCreateRegionFromBitmapCookie{cookie} +} + +func (c *Conn) XfixesCreateRegionFromBitmapChecked(Region Id, Bitmap Id) XfixesCreateRegionFromBitmapCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) + return XfixesCreateRegionFromBitmapCookie{cookie} +} + +func (cook XfixesCreateRegionFromBitmapCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCreateRegionFromBitmap +func (c *Conn) xfixesCreateRegionFromBitmapRequest(Region Id, Bitmap Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put32(buf[b:], uint32(Bitmap)) + b += 4 + + return buf +} + +// Request XfixesCreateRegionFromWindow +// size: 16 +type XfixesCreateRegionFromWindowCookie struct { + *cookie +} + +// Write request to wire for XfixesCreateRegionFromWindow +func (c *Conn) XfixesCreateRegionFromWindow(Region Id, Window Id, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) + return XfixesCreateRegionFromWindowCookie{cookie} +} + +func (c *Conn) XfixesCreateRegionFromWindowChecked(Region Id, Window Id, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) + return XfixesCreateRegionFromWindowCookie{cookie} +} + +func (cook XfixesCreateRegionFromWindowCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCreateRegionFromWindow +func (c *Conn) xfixesCreateRegionFromWindowRequest(Region Id, Window Id, Kind ShapeKind) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = byte(Kind) + b += 1 + + b += 3 // padding + + return buf +} + +// Request XfixesCreateRegionFromGC +// size: 12 +type XfixesCreateRegionFromGCCookie struct { + *cookie +} + +// Write request to wire for XfixesCreateRegionFromGC +func (c *Conn) XfixesCreateRegionFromGC(Region Id, Gc Id) XfixesCreateRegionFromGCCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) + return XfixesCreateRegionFromGCCookie{cookie} +} + +func (c *Conn) XfixesCreateRegionFromGCChecked(Region Id, Gc Id) XfixesCreateRegionFromGCCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) + return XfixesCreateRegionFromGCCookie{cookie} +} + +func (cook XfixesCreateRegionFromGCCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCreateRegionFromGC +func (c *Conn) xfixesCreateRegionFromGCRequest(Region Id, Gc Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + return buf +} + +// Request XfixesCreateRegionFromPicture +// size: 12 +type XfixesCreateRegionFromPictureCookie struct { + *cookie +} + +// Write request to wire for XfixesCreateRegionFromPicture +func (c *Conn) XfixesCreateRegionFromPicture(Region Id, Picture Id) XfixesCreateRegionFromPictureCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) + return XfixesCreateRegionFromPictureCookie{cookie} +} + +func (c *Conn) XfixesCreateRegionFromPictureChecked(Region Id, Picture Id) XfixesCreateRegionFromPictureCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) + return XfixesCreateRegionFromPictureCookie{cookie} +} + +func (cook XfixesCreateRegionFromPictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCreateRegionFromPicture +func (c *Conn) xfixesCreateRegionFromPictureRequest(Region Id, Picture Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// Request XfixesDestroyRegion +// size: 8 +type XfixesDestroyRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesDestroyRegion +func (c *Conn) XfixesDestroyRegion(Region Id) XfixesDestroyRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) + return XfixesDestroyRegionCookie{cookie} +} + +func (c *Conn) XfixesDestroyRegionChecked(Region Id) XfixesDestroyRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) + return XfixesDestroyRegionCookie{cookie} +} + +func (cook XfixesDestroyRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesDestroyRegion +func (c *Conn) xfixesDestroyRegionRequest(Region Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request XfixesSetRegion +// size: pad((8 + pad((len(Rectangles) * 8)))) +type XfixesSetRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesSetRegion +func (c *Conn) XfixesSetRegion(Region Id, Rectangles []Rectangle) XfixesSetRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) + return XfixesSetRegionCookie{cookie} +} + +func (c *Conn) XfixesSetRegionChecked(Region Id, Rectangles []Rectangle) XfixesSetRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) + return XfixesSetRegionCookie{cookie} +} + +func (cook XfixesSetRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSetRegion +func (c *Conn) xfixesSetRegionRequest(Region Id, Rectangles []Rectangle) []byte { + size := pad((8 + pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request XfixesCopyRegion +// size: 12 +type XfixesCopyRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesCopyRegion +func (c *Conn) XfixesCopyRegion(Source Id, Destination Id) XfixesCopyRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) + return XfixesCopyRegionCookie{cookie} +} + +func (c *Conn) XfixesCopyRegionChecked(Source Id, Destination Id) XfixesCopyRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) + return XfixesCopyRegionCookie{cookie} +} + +func (cook XfixesCopyRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesCopyRegion +func (c *Conn) xfixesCopyRegionRequest(Source Id, Destination Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesUnionRegion +// size: 16 +type XfixesUnionRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesUnionRegion +func (c *Conn) XfixesUnionRegion(Source1 Id, Source2 Id, Destination Id) XfixesUnionRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) + return XfixesUnionRegionCookie{cookie} +} + +func (c *Conn) XfixesUnionRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesUnionRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) + return XfixesUnionRegionCookie{cookie} +} + +func (cook XfixesUnionRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesUnionRegion +func (c *Conn) xfixesUnionRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source1)) + b += 4 + + Put32(buf[b:], uint32(Source2)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesIntersectRegion +// size: 16 +type XfixesIntersectRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesIntersectRegion +func (c *Conn) XfixesIntersectRegion(Source1 Id, Source2 Id, Destination Id) XfixesIntersectRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) + return XfixesIntersectRegionCookie{cookie} +} + +func (c *Conn) XfixesIntersectRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesIntersectRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) + return XfixesIntersectRegionCookie{cookie} +} + +func (cook XfixesIntersectRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesIntersectRegion +func (c *Conn) xfixesIntersectRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source1)) + b += 4 + + Put32(buf[b:], uint32(Source2)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesSubtractRegion +// size: 16 +type XfixesSubtractRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesSubtractRegion +func (c *Conn) XfixesSubtractRegion(Source1 Id, Source2 Id, Destination Id) XfixesSubtractRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) + return XfixesSubtractRegionCookie{cookie} +} + +func (c *Conn) XfixesSubtractRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesSubtractRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) + return XfixesSubtractRegionCookie{cookie} +} + +func (cook XfixesSubtractRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSubtractRegion +func (c *Conn) xfixesSubtractRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source1)) + b += 4 + + Put32(buf[b:], uint32(Source2)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesInvertRegion +// size: 20 +type XfixesInvertRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesInvertRegion +func (c *Conn) XfixesInvertRegion(Source Id, Bounds Rectangle, Destination Id) XfixesInvertRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) + return XfixesInvertRegionCookie{cookie} +} + +func (c *Conn) XfixesInvertRegionChecked(Source Id, Bounds Rectangle, Destination Id) XfixesInvertRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) + return XfixesInvertRegionCookie{cookie} +} + +func (cook XfixesInvertRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesInvertRegion +func (c *Conn) xfixesInvertRegionRequest(Source Id, Bounds Rectangle, Destination Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source)) + b += 4 + + { + structBytes := Bounds.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesTranslateRegion +// size: 12 +type XfixesTranslateRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesTranslateRegion +func (c *Conn) XfixesTranslateRegion(Region Id, Dx int16, Dy int16) XfixesTranslateRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) + return XfixesTranslateRegionCookie{cookie} +} + +func (c *Conn) XfixesTranslateRegionChecked(Region Id, Dx int16, Dy int16) XfixesTranslateRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) + return XfixesTranslateRegionCookie{cookie} +} + +func (cook XfixesTranslateRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesTranslateRegion +func (c *Conn) xfixesTranslateRegionRequest(Region Id, Dx int16, Dy int16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put16(buf[b:], uint16(Dx)) + b += 2 + + Put16(buf[b:], uint16(Dy)) + b += 2 + + return buf +} + +// Request XfixesRegionExtents +// size: 12 +type XfixesRegionExtentsCookie struct { + *cookie +} + +// Write request to wire for XfixesRegionExtents +func (c *Conn) XfixesRegionExtents(Source Id, Destination Id) XfixesRegionExtentsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) + return XfixesRegionExtentsCookie{cookie} +} + +func (c *Conn) XfixesRegionExtentsChecked(Source Id, Destination Id) XfixesRegionExtentsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) + return XfixesRegionExtentsCookie{cookie} +} + +func (cook XfixesRegionExtentsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesRegionExtents +func (c *Conn) xfixesRegionExtentsRequest(Source Id, Destination Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesFetchRegion +// size: 8 +type XfixesFetchRegionCookie struct { + *cookie +} + +func (c *Conn) XfixesFetchRegion(Region Id) XfixesFetchRegionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) + return XfixesFetchRegionCookie{cookie} +} + +func (c *Conn) XfixesFetchRegionUnchecked(Region Id) XfixesFetchRegionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) + return XfixesFetchRegionCookie{cookie} +} + +// Request reply for XfixesFetchRegion +// size: (32 + pad(((int(Length) / 2) * 8))) +type XfixesFetchRegionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Extents Rectangle + // padding: 16 bytes + Rectangles []Rectangle // size: pad(((int(Length) / 2) * 8)) +} + +// Waits and reads reply data from request XfixesFetchRegion +func (cook XfixesFetchRegionCookie) Reply() (*XfixesFetchRegionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xfixesFetchRegionReply(buf), nil +} + +// Read reply into structure from buffer for XfixesFetchRegion +func xfixesFetchRegionReply(buf []byte) *XfixesFetchRegionReply { + v := new(XfixesFetchRegionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Extents = Rectangle{} + b += ReadRectangle(buf[b:], &v.Extents) + + b += 16 // padding + + v.Rectangles = make([]Rectangle, (int(v.Length) / 2)) + b += ReadRectangleList(buf[b:], v.Rectangles) + + return v +} + +func (cook XfixesFetchRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesFetchRegion +func (c *Conn) xfixesFetchRegionRequest(Region Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request XfixesSetGCClipRegion +// size: 16 +type XfixesSetGCClipRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesSetGCClipRegion +func (c *Conn) XfixesSetGCClipRegion(Gc Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) + return XfixesSetGCClipRegionCookie{cookie} +} + +func (c *Conn) XfixesSetGCClipRegionChecked(Gc Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) + return XfixesSetGCClipRegionCookie{cookie} +} + +func (cook XfixesSetGCClipRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSetGCClipRegion +func (c *Conn) xfixesSetGCClipRegionRequest(Gc Id, Region Id, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put16(buf[b:], uint16(XOrigin)) + b += 2 + + Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// Request XfixesSetWindowShapeRegion +// size: 20 +type XfixesSetWindowShapeRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesSetWindowShapeRegion +func (c *Conn) XfixesSetWindowShapeRegion(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) XfixesSetWindowShapeRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) + return XfixesSetWindowShapeRegionCookie{cookie} +} + +func (c *Conn) XfixesSetWindowShapeRegionChecked(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) XfixesSetWindowShapeRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) + return XfixesSetWindowShapeRegionCookie{cookie} +} + +func (cook XfixesSetWindowShapeRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSetWindowShapeRegion +func (c *Conn) xfixesSetWindowShapeRegionRequest(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Dest)) + b += 4 + + buf[b] = byte(DestKind) + b += 1 + + b += 3 // padding + + Put16(buf[b:], uint16(XOffset)) + b += 2 + + Put16(buf[b:], uint16(YOffset)) + b += 2 + + Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request XfixesSetPictureClipRegion +// size: 16 +type XfixesSetPictureClipRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesSetPictureClipRegion +func (c *Conn) XfixesSetPictureClipRegion(Picture Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) + return XfixesSetPictureClipRegionCookie{cookie} +} + +func (c *Conn) XfixesSetPictureClipRegionChecked(Picture Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) + return XfixesSetPictureClipRegionCookie{cookie} +} + +func (cook XfixesSetPictureClipRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSetPictureClipRegion +func (c *Conn) xfixesSetPictureClipRegionRequest(Picture Id, Region Id, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Picture)) + b += 4 + + Put32(buf[b:], uint32(Region)) + b += 4 + + Put16(buf[b:], uint16(XOrigin)) + b += 2 + + Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// Request XfixesSetCursorName +// size: pad((12 + pad((int(Nbytes) * 1)))) +type XfixesSetCursorNameCookie struct { + *cookie +} + +// Write request to wire for XfixesSetCursorName +func (c *Conn) XfixesSetCursorName(Cursor Id, Nbytes uint16, Name string) XfixesSetCursorNameCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) + return XfixesSetCursorNameCookie{cookie} +} + +func (c *Conn) XfixesSetCursorNameChecked(Cursor Id, Nbytes uint16, Name string) XfixesSetCursorNameCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) + return XfixesSetCursorNameCookie{cookie} +} + +func (cook XfixesSetCursorNameCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesSetCursorName +func (c *Conn) xfixesSetCursorNameRequest(Cursor Id, Nbytes uint16, Name string) []byte { + size := pad((12 + pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += pad(int(Nbytes)) + + return buf +} + +// Request XfixesGetCursorName +// size: 8 +type XfixesGetCursorNameCookie struct { + *cookie +} + +func (c *Conn) XfixesGetCursorName(Cursor Id) XfixesGetCursorNameCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) + return XfixesGetCursorNameCookie{cookie} +} + +func (c *Conn) XfixesGetCursorNameUnchecked(Cursor Id) XfixesGetCursorNameCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) + return XfixesGetCursorNameCookie{cookie} +} + +// Request reply for XfixesGetCursorName +// size: (32 + pad((int(Nbytes) * 1))) +type XfixesGetCursorNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Atom Id + Nbytes uint16 + // padding: 18 bytes + Name string // size: pad((int(Nbytes) * 1)) +} + +// Waits and reads reply data from request XfixesGetCursorName +func (cook XfixesGetCursorNameCookie) Reply() (*XfixesGetCursorNameReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xfixesGetCursorNameReply(buf), nil +} + +// Read reply into structure from buffer for XfixesGetCursorName +func xfixesGetCursorNameReply(buf []byte) *XfixesGetCursorNameReply { + v := new(XfixesGetCursorNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Atom = Id(Get32(buf[b:])) + b += 4 + + v.Nbytes = Get16(buf[b:]) + b += 2 + + b += 18 // padding + + { + byteString := make([]byte, v.Nbytes) + copy(byteString[:v.Nbytes], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.Nbytes)) + } + + return v +} + +func (cook XfixesGetCursorNameCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesGetCursorName +func (c *Conn) xfixesGetCursorNameRequest(Cursor Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + return buf +} + +// Request XfixesGetCursorImageAndName +// size: 4 +type XfixesGetCursorImageAndNameCookie struct { + *cookie +} + +func (c *Conn) XfixesGetCursorImageAndName() XfixesGetCursorImageAndNameCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xfixesGetCursorImageAndNameRequest(), cookie) + return XfixesGetCursorImageAndNameCookie{cookie} +} + +func (c *Conn) XfixesGetCursorImageAndNameUnchecked() XfixesGetCursorImageAndNameCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xfixesGetCursorImageAndNameRequest(), cookie) + return XfixesGetCursorImageAndNameCookie{cookie} +} + +// Request reply for XfixesGetCursorImageAndName +// size: ((32 + pad((int(Nbytes) * 1))) + pad(((int(Width) * int(Height)) * 4))) +type XfixesGetCursorImageAndNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X int16 + Y int16 + Width uint16 + Height uint16 + Xhot uint16 + Yhot uint16 + CursorSerial uint32 + CursorAtom Id + Nbytes uint16 + // padding: 2 bytes + Name string // size: pad((int(Nbytes) * 1)) + CursorImage []uint32 // size: pad(((int(Width) * int(Height)) * 4)) +} + +// Waits and reads reply data from request XfixesGetCursorImageAndName +func (cook XfixesGetCursorImageAndNameCookie) Reply() (*XfixesGetCursorImageAndNameReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xfixesGetCursorImageAndNameReply(buf), nil +} + +// Read reply into structure from buffer for XfixesGetCursorImageAndName +func xfixesGetCursorImageAndNameReply(buf []byte) *XfixesGetCursorImageAndNameReply { + v := new(XfixesGetCursorImageAndNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = int16(Get16(buf[b:])) + b += 2 + + v.Y = int16(Get16(buf[b:])) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.Xhot = Get16(buf[b:]) + b += 2 + + v.Yhot = Get16(buf[b:]) + b += 2 + + v.CursorSerial = Get32(buf[b:]) + b += 4 + + v.CursorAtom = Id(Get32(buf[b:])) + b += 4 + + v.Nbytes = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + { + byteString := make([]byte, v.Nbytes) + copy(byteString[:v.Nbytes], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.Nbytes)) + } + + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) + for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { + v.CursorImage[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XfixesGetCursorImageAndNameCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesGetCursorImageAndName +func (c *Conn) xfixesGetCursorImageAndNameRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XfixesChangeCursor +// size: 12 +type XfixesChangeCursorCookie struct { + *cookie +} + +// Write request to wire for XfixesChangeCursor +func (c *Conn) XfixesChangeCursor(Source Id, Destination Id) XfixesChangeCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) + return XfixesChangeCursorCookie{cookie} +} + +func (c *Conn) XfixesChangeCursorChecked(Source Id, Destination Id) XfixesChangeCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) + return XfixesChangeCursorCookie{cookie} +} + +func (cook XfixesChangeCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesChangeCursor +func (c *Conn) xfixesChangeCursorRequest(Source Id, Destination Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request XfixesChangeCursorByName +// size: pad((12 + pad((int(Nbytes) * 1)))) +type XfixesChangeCursorByNameCookie struct { + *cookie +} + +// Write request to wire for XfixesChangeCursorByName +func (c *Conn) XfixesChangeCursorByName(Src Id, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) + return XfixesChangeCursorByNameCookie{cookie} +} + +func (c *Conn) XfixesChangeCursorByNameChecked(Src Id, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) + return XfixesChangeCursorByNameCookie{cookie} +} + +func (cook XfixesChangeCursorByNameCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesChangeCursorByName +func (c *Conn) xfixesChangeCursorByNameRequest(Src Id, Nbytes uint16, Name string) []byte { + size := pad((12 + pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Src)) + b += 4 + + Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += pad(int(Nbytes)) + + return buf +} + +// Request XfixesExpandRegion +// size: 20 +type XfixesExpandRegionCookie struct { + *cookie +} + +// Write request to wire for XfixesExpandRegion +func (c *Conn) XfixesExpandRegion(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) + return XfixesExpandRegionCookie{cookie} +} + +func (c *Conn) XfixesExpandRegionChecked(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) + return XfixesExpandRegionCookie{cookie} +} + +func (cook XfixesExpandRegionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesExpandRegion +func (c *Conn) xfixesExpandRegionRequest(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Source)) + b += 4 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + Put16(buf[b:], Left) + b += 2 + + Put16(buf[b:], Right) + b += 2 + + Put16(buf[b:], Top) + b += 2 + + Put16(buf[b:], Bottom) + b += 2 + + return buf +} + +// Request XfixesHideCursor +// size: 8 +type XfixesHideCursorCookie struct { + *cookie +} + +// Write request to wire for XfixesHideCursor +func (c *Conn) XfixesHideCursor(Window Id) XfixesHideCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesHideCursorRequest(Window), cookie) + return XfixesHideCursorCookie{cookie} +} + +func (c *Conn) XfixesHideCursorChecked(Window Id) XfixesHideCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesHideCursorRequest(Window), cookie) + return XfixesHideCursorCookie{cookie} +} + +func (cook XfixesHideCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesHideCursor +func (c *Conn) xfixesHideCursorRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XfixesShowCursor +// size: 8 +type XfixesShowCursorCookie struct { + *cookie +} + +// Write request to wire for XfixesShowCursor +func (c *Conn) XfixesShowCursor(Window Id) XfixesShowCursorCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xfixesShowCursorRequest(Window), cookie) + return XfixesShowCursorCookie{cookie} +} + +func (c *Conn) XfixesShowCursorChecked(Window Id) XfixesShowCursorCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xfixesShowCursorRequest(Window), cookie) + return XfixesShowCursorCookie{cookie} +} + +func (cook XfixesShowCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for XfixesShowCursor +func (c *Conn) xfixesShowCursorRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XFIXES"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index c2e031c..6c08447 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 5 2012 5:56:52pm EDT. + This file was generated by xinerama.xml on May 6 2012 3:00:45am EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,16 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -25,16 +35,6 @@ package xgb // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // 'XineramaScreenInfo' struct definition // Size: 8 type XineramaScreenInfo struct { @@ -183,12 +183,12 @@ func (c *Conn) xineramaQueryVersionRequest(Major byte, Minor byte) []byte { buf[b] = 0 // request opcode b += 1 - buf[b] = Major - b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + buf[b] = Major + b += 1 + buf[b] = Minor b += 1 @@ -270,12 +270,12 @@ func (c *Conn) xineramaGetStateRequest(Window Id) []byte { buf[b] = 1 // request opcode b += 1 - Put32(buf[b:], uint32(Window)) - b += 4 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + Put32(buf[b:], uint32(Window)) + b += 4 + return buf } @@ -354,12 +354,12 @@ func (c *Conn) xineramaGetScreenCountRequest(Window Id) []byte { buf[b] = 2 // request opcode b += 1 - Put32(buf[b:], uint32(Window)) - b += 4 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + Put32(buf[b:], uint32(Window)) + b += 4 + return buf } @@ -449,12 +449,12 @@ func (c *Conn) xineramaGetScreenSizeRequest(Window Id, Screen uint32) []byte { buf[b] = 3 // request opcode b += 1 - Put32(buf[b:], uint32(Window)) - b += 4 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + Put32(buf[b:], uint32(Window)) + b += 4 + Put32(buf[b:], Screen) b += 4 diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go new file mode 100644 index 0000000..d300bca --- /dev/null +++ b/nexgb/auto_xinput.go @@ -0,0 +1,7271 @@ +package xgb + +/* + This file was generated by xinput.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + XinputValuatorModeRelative = 0 + XinputValuatorModeAbsolute = 1 +) + +const ( + XinputPropagateModeAddToList = 0 + XinputPropagateModeDeleteFromList = 1 +) + +const ( + XinputDeviceUseIsXPointer = 0 + XinputDeviceUseIsXKeyboard = 1 + XinputDeviceUseIsXExtensionDevice = 2 + XinputDeviceUseIsXExtensionKeyboard = 3 + XinputDeviceUseIsXExtensionPointer = 4 +) + +const ( + XinputInputClassKey = 0 + XinputInputClassButton = 1 + XinputInputClassValuator = 2 + XinputInputClassFeedback = 3 + XinputInputClassProximity = 4 + XinputInputClassFocus = 5 + XinputInputClassOther = 6 +) + +const ( + XinputDeviceInputModeAsyncThisDevice = 0 + XinputDeviceInputModeSyncThisDevice = 1 + XinputDeviceInputModeReplayThisDevice = 2 + XinputDeviceInputModeAsyncOtherDevices = 3 + XinputDeviceInputModeAsyncAll = 4 + XinputDeviceInputModeSyncAll = 5 +) + +const ( + XinputFeedbackClassKeyboard = 0 + XinputFeedbackClassPointer = 1 + XinputFeedbackClassString = 2 + XinputFeedbackClassInteger = 3 + XinputFeedbackClassLed = 4 + XinputFeedbackClassBell = 5 +) + +type XinputKeyCode byte + +type XinputEventClass uint32 + +// 'XinputDeviceInfo' struct definition +// Size: 8 +type XinputDeviceInfo struct { + DeviceType Id + DeviceId byte + NumClassInfo byte + DeviceUse byte + // padding: 1 bytes +} + +// Struct read XinputDeviceInfo +func ReadXinputDeviceInfo(buf []byte, v *XinputDeviceInfo) int { + b := 0 + + v.DeviceType = Id(Get32(buf[b:])) + b += 4 + + v.DeviceId = buf[b] + b += 1 + + v.NumClassInfo = buf[b] + b += 1 + + v.DeviceUse = buf[b] + b += 1 + + b += 1 // padding + + return b +} + +// Struct list read XinputDeviceInfo +func ReadXinputDeviceInfoList(buf []byte, dest []XinputDeviceInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceInfo{} + b += ReadXinputDeviceInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceInfo +func (v XinputDeviceInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.DeviceType)) + b += 4 + + buf[b] = v.DeviceId + b += 1 + + buf[b] = v.NumClassInfo + b += 1 + + buf[b] = v.DeviceUse + b += 1 + + b += 1 // padding + + return buf +} + +// Write struct list XinputDeviceInfo +func XinputDeviceInfoListBytes(buf []byte, list []XinputDeviceInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputInputInfo' struct definition +// Size: 2 +type XinputInputInfo struct { + ClassId byte + Len byte +} + +// Struct read XinputInputInfo +func ReadXinputInputInfo(buf []byte, v *XinputInputInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + return b +} + +// Struct list read XinputInputInfo +func ReadXinputInputInfoList(buf []byte, dest []XinputInputInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputInputInfo{} + b += ReadXinputInputInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputInputInfo +func (v XinputInputInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + return buf +} + +// Write struct list XinputInputInfo +func XinputInputInfoListBytes(buf []byte, list []XinputInputInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputKeyInfo' struct definition +// Size: 8 +type XinputKeyInfo struct { + ClassId byte + Len byte + MinKeycode XinputKeyCode + MaxKeycode XinputKeyCode + NumKeys uint16 + // padding: 2 bytes +} + +// Struct read XinputKeyInfo +func ReadXinputKeyInfo(buf []byte, v *XinputKeyInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.MinKeycode = XinputKeyCode(buf[b]) + b += 1 + + v.MaxKeycode = XinputKeyCode(buf[b]) + b += 1 + + v.NumKeys = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return b +} + +// Struct list read XinputKeyInfo +func ReadXinputKeyInfoList(buf []byte, dest []XinputKeyInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputKeyInfo{} + b += ReadXinputKeyInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputKeyInfo +func (v XinputKeyInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = byte(v.MinKeycode) + b += 1 + + buf[b] = byte(v.MaxKeycode) + b += 1 + + Put16(buf[b:], v.NumKeys) + b += 2 + + b += 2 // padding + + return buf +} + +// Write struct list XinputKeyInfo +func XinputKeyInfoListBytes(buf []byte, list []XinputKeyInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputButtonInfo' struct definition +// Size: 4 +type XinputButtonInfo struct { + ClassId byte + Len byte + NumButtons uint16 +} + +// Struct read XinputButtonInfo +func ReadXinputButtonInfo(buf []byte, v *XinputButtonInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumButtons = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputButtonInfo +func ReadXinputButtonInfoList(buf []byte, dest []XinputButtonInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputButtonInfo{} + b += ReadXinputButtonInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputButtonInfo +func (v XinputButtonInfo) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + Put16(buf[b:], v.NumButtons) + b += 2 + + return buf +} + +// Write struct list XinputButtonInfo +func XinputButtonInfoListBytes(buf []byte, list []XinputButtonInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputAxisInfo' struct definition +// Size: 12 +type XinputAxisInfo struct { + Resolution uint32 + Minimum int32 + Maximum int32 +} + +// Struct read XinputAxisInfo +func ReadXinputAxisInfo(buf []byte, v *XinputAxisInfo) int { + b := 0 + + v.Resolution = Get32(buf[b:]) + b += 4 + + v.Minimum = int32(Get32(buf[b:])) + b += 4 + + v.Maximum = int32(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read XinputAxisInfo +func ReadXinputAxisInfoList(buf []byte, dest []XinputAxisInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputAxisInfo{} + b += ReadXinputAxisInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputAxisInfo +func (v XinputAxisInfo) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + Put32(buf[b:], v.Resolution) + b += 4 + + Put32(buf[b:], uint32(v.Minimum)) + b += 4 + + Put32(buf[b:], uint32(v.Maximum)) + b += 4 + + return buf +} + +// Write struct list XinputAxisInfo +func XinputAxisInfoListBytes(buf []byte, list []XinputAxisInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputValuatorInfo' struct definition +// Size: (8 + pad((int(AxesLen) * 12))) +type XinputValuatorInfo struct { + ClassId byte + Len byte + AxesLen byte + Mode byte + MotionSize uint32 + Axes []XinputAxisInfo // size: pad((int(AxesLen) * 12)) +} + +// Struct read XinputValuatorInfo +func ReadXinputValuatorInfo(buf []byte, v *XinputValuatorInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.AxesLen = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.MotionSize = Get32(buf[b:]) + b += 4 + + v.Axes = make([]XinputAxisInfo, v.AxesLen) + b += ReadXinputAxisInfoList(buf[b:], v.Axes) + + return b +} + +// Struct list read XinputValuatorInfo +func ReadXinputValuatorInfoList(buf []byte, dest []XinputValuatorInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputValuatorInfo{} + b += ReadXinputValuatorInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputValuatorInfo +func (v XinputValuatorInfo) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.AxesLen) * 12)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.AxesLen + b += 1 + + buf[b] = v.Mode + b += 1 + + Put32(buf[b:], v.MotionSize) + b += 4 + + b += XinputAxisInfoListBytes(buf[b:], v.Axes) + + return buf +} + +// Write struct list XinputValuatorInfo +func XinputValuatorInfoListBytes(buf []byte, list []XinputValuatorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputValuatorInfo +func XinputValuatorInfoListSize(list []XinputValuatorInfo) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.AxesLen) * 12))) + } + return size +} + +// 'XinputInputClassInfo' struct definition +// Size: 2 +type XinputInputClassInfo struct { + ClassId byte + EventTypeBase byte +} + +// Struct read XinputInputClassInfo +func ReadXinputInputClassInfo(buf []byte, v *XinputInputClassInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.EventTypeBase = buf[b] + b += 1 + + return b +} + +// Struct list read XinputInputClassInfo +func ReadXinputInputClassInfoList(buf []byte, dest []XinputInputClassInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputInputClassInfo{} + b += ReadXinputInputClassInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputInputClassInfo +func (v XinputInputClassInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.EventTypeBase + b += 1 + + return buf +} + +// Write struct list XinputInputClassInfo +func XinputInputClassInfoListBytes(buf []byte, list []XinputInputClassInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceTimeCoord' struct definition +// Size: 4 +type XinputDeviceTimeCoord struct { + Time Timestamp +} + +// Struct read XinputDeviceTimeCoord +func ReadXinputDeviceTimeCoord(buf []byte, v *XinputDeviceTimeCoord) int { + b := 0 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read XinputDeviceTimeCoord +func ReadXinputDeviceTimeCoordList(buf []byte, dest []XinputDeviceTimeCoord) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceTimeCoord{} + b += ReadXinputDeviceTimeCoord(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceTimeCoord +func (v XinputDeviceTimeCoord) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + return buf +} + +// Write struct list XinputDeviceTimeCoord +func XinputDeviceTimeCoordListBytes(buf []byte, list []XinputDeviceTimeCoord) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputFeedbackState' struct definition +// Size: 4 +type XinputFeedbackState struct { + ClassId byte + Id byte + Len uint16 +} + +// Struct read XinputFeedbackState +func ReadXinputFeedbackState(buf []byte, v *XinputFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputFeedbackState +func ReadXinputFeedbackStateList(buf []byte, dest []XinputFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputFeedbackState{} + b += ReadXinputFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputFeedbackState +func (v XinputFeedbackState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list XinputFeedbackState +func XinputFeedbackStateListBytes(buf []byte, list []XinputFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputKbdFeedbackState' struct definition +// Size: 52 +type XinputKbdFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Pitch uint16 + Duration uint16 + LedMask uint32 + LedValues uint32 + GlobalAutoRepeat bool + Click byte + Percent byte + // padding: 1 bytes + AutoRepeats []byte // size: 32 +} + +// Struct read XinputKbdFeedbackState +func ReadXinputKbdFeedbackState(buf []byte, v *XinputKbdFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Pitch = Get16(buf[b:]) + b += 2 + + v.Duration = Get16(buf[b:]) + b += 2 + + v.LedMask = Get32(buf[b:]) + b += 4 + + v.LedValues = Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.GlobalAutoRepeat = true + } else { + v.GlobalAutoRepeat = false + } + b += 1 + + v.Click = buf[b] + b += 1 + + v.Percent = buf[b] + b += 1 + + b += 1 // padding + + v.AutoRepeats = make([]byte, 32) + copy(v.AutoRepeats[:32], buf[b:]) + b += pad(int(32)) + + return b +} + +// Struct list read XinputKbdFeedbackState +func ReadXinputKbdFeedbackStateList(buf []byte, dest []XinputKbdFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputKbdFeedbackState{} + b += ReadXinputKbdFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputKbdFeedbackState +func (v XinputKbdFeedbackState) Bytes() []byte { + buf := make([]byte, 52) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put16(buf[b:], v.Pitch) + b += 2 + + Put16(buf[b:], v.Duration) + b += 2 + + Put32(buf[b:], v.LedMask) + b += 4 + + Put32(buf[b:], v.LedValues) + b += 4 + + if v.GlobalAutoRepeat { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.Click + b += 1 + + buf[b] = v.Percent + b += 1 + + b += 1 // padding + + copy(buf[b:], v.AutoRepeats[:32]) + b += pad(int(32)) + + return buf +} + +// Write struct list XinputKbdFeedbackState +func XinputKbdFeedbackStateListBytes(buf []byte, list []XinputKbdFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputKbdFeedbackState +func XinputKbdFeedbackStateListSize(list []XinputKbdFeedbackState) int { + size := 0 + for _ = range list { + size += 52 + } + return size +} + +// 'XinputPtrFeedbackState' struct definition +// Size: 12 +type XinputPtrFeedbackState struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + AccelNum uint16 + AccelDenom uint16 + Threshold uint16 +} + +// Struct read XinputPtrFeedbackState +func ReadXinputPtrFeedbackState(buf []byte, v *XinputPtrFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.AccelNum = Get16(buf[b:]) + b += 2 + + v.AccelDenom = Get16(buf[b:]) + b += 2 + + v.Threshold = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputPtrFeedbackState +func ReadXinputPtrFeedbackStateList(buf []byte, dest []XinputPtrFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputPtrFeedbackState{} + b += ReadXinputPtrFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputPtrFeedbackState +func (v XinputPtrFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + Put16(buf[b:], v.AccelNum) + b += 2 + + Put16(buf[b:], v.AccelDenom) + b += 2 + + Put16(buf[b:], v.Threshold) + b += 2 + + return buf +} + +// Write struct list XinputPtrFeedbackState +func XinputPtrFeedbackStateListBytes(buf []byte, list []XinputPtrFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputIntegerFeedbackState' struct definition +// Size: 16 +type XinputIntegerFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Resolution uint32 + MinValue int32 + MaxValue int32 +} + +// Struct read XinputIntegerFeedbackState +func ReadXinputIntegerFeedbackState(buf []byte, v *XinputIntegerFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Resolution = Get32(buf[b:]) + b += 4 + + v.MinValue = int32(Get32(buf[b:])) + b += 4 + + v.MaxValue = int32(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read XinputIntegerFeedbackState +func ReadXinputIntegerFeedbackStateList(buf []byte, dest []XinputIntegerFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputIntegerFeedbackState{} + b += ReadXinputIntegerFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputIntegerFeedbackState +func (v XinputIntegerFeedbackState) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.Resolution) + b += 4 + + Put32(buf[b:], uint32(v.MinValue)) + b += 4 + + Put32(buf[b:], uint32(v.MaxValue)) + b += 4 + + return buf +} + +// Write struct list XinputIntegerFeedbackState +func XinputIntegerFeedbackStateListBytes(buf []byte, list []XinputIntegerFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputStringFeedbackState' struct definition +// Size: (8 + pad((int(NumKeysyms) * 4))) +type XinputStringFeedbackState struct { + ClassId byte + Id byte + Len uint16 + MaxSymbols uint16 + NumKeysyms uint16 + Keysyms []Keysym // size: pad((int(NumKeysyms) * 4)) +} + +// Struct read XinputStringFeedbackState +func ReadXinputStringFeedbackState(buf []byte, v *XinputStringFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.MaxSymbols = Get16(buf[b:]) + b += 2 + + v.NumKeysyms = Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = Keysym(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return b +} + +// Struct list read XinputStringFeedbackState +func ReadXinputStringFeedbackStateList(buf []byte, dest []XinputStringFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputStringFeedbackState{} + b += ReadXinputStringFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputStringFeedbackState +func (v XinputStringFeedbackState) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put16(buf[b:], v.MaxSymbols) + b += 2 + + Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Write struct list XinputStringFeedbackState +func XinputStringFeedbackStateListBytes(buf []byte, list []XinputStringFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputStringFeedbackState +func XinputStringFeedbackStateListSize(list []XinputStringFeedbackState) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.NumKeysyms) * 4))) + } + return size +} + +// 'XinputBellFeedbackState' struct definition +// Size: 12 +type XinputBellFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Percent byte + // padding: 3 bytes + Pitch uint16 + Duration uint16 +} + +// Struct read XinputBellFeedbackState +func ReadXinputBellFeedbackState(buf []byte, v *XinputBellFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Percent = buf[b] + b += 1 + + b += 3 // padding + + v.Pitch = Get16(buf[b:]) + b += 2 + + v.Duration = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputBellFeedbackState +func ReadXinputBellFeedbackStateList(buf []byte, dest []XinputBellFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputBellFeedbackState{} + b += ReadXinputBellFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputBellFeedbackState +func (v XinputBellFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Percent + b += 1 + + b += 3 // padding + + Put16(buf[b:], v.Pitch) + b += 2 + + Put16(buf[b:], v.Duration) + b += 2 + + return buf +} + +// Write struct list XinputBellFeedbackState +func XinputBellFeedbackStateListBytes(buf []byte, list []XinputBellFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputLedFeedbackState' struct definition +// Size: 12 +type XinputLedFeedbackState struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// Struct read XinputLedFeedbackState +func ReadXinputLedFeedbackState(buf []byte, v *XinputLedFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.LedMask = Get32(buf[b:]) + b += 4 + + v.LedValues = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputLedFeedbackState +func ReadXinputLedFeedbackStateList(buf []byte, dest []XinputLedFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputLedFeedbackState{} + b += ReadXinputLedFeedbackState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputLedFeedbackState +func (v XinputLedFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.LedMask) + b += 4 + + Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list XinputLedFeedbackState +func XinputLedFeedbackStateListBytes(buf []byte, list []XinputLedFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputFeedbackCtl' struct definition +// Size: 4 +type XinputFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 +} + +// Struct read XinputFeedbackCtl +func ReadXinputFeedbackCtl(buf []byte, v *XinputFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputFeedbackCtl +func ReadXinputFeedbackCtlList(buf []byte, dest []XinputFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputFeedbackCtl{} + b += ReadXinputFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputFeedbackCtl +func (v XinputFeedbackCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list XinputFeedbackCtl +func XinputFeedbackCtlListBytes(buf []byte, list []XinputFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputKbdFeedbackCtl' struct definition +// Size: 20 +type XinputKbdFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + Key XinputKeyCode + AutoRepeatMode byte + KeyClickPercent int8 + BellPercent int8 + BellPitch int16 + BellDuration int16 + LedMask uint32 + LedValues uint32 +} + +// Struct read XinputKbdFeedbackCtl +func ReadXinputKbdFeedbackCtl(buf []byte, v *XinputKbdFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Key = XinputKeyCode(buf[b]) + b += 1 + + v.AutoRepeatMode = buf[b] + b += 1 + + v.KeyClickPercent = int8(buf[b]) + b += 1 + + v.BellPercent = int8(buf[b]) + b += 1 + + v.BellPitch = int16(Get16(buf[b:])) + b += 2 + + v.BellDuration = int16(Get16(buf[b:])) + b += 2 + + v.LedMask = Get32(buf[b:]) + b += 4 + + v.LedValues = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputKbdFeedbackCtl +func ReadXinputKbdFeedbackCtlList(buf []byte, dest []XinputKbdFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputKbdFeedbackCtl{} + b += ReadXinputKbdFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputKbdFeedbackCtl +func (v XinputKbdFeedbackCtl) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = byte(v.Key) + b += 1 + + buf[b] = v.AutoRepeatMode + b += 1 + + buf[b] = byte(v.KeyClickPercent) + b += 1 + + buf[b] = byte(v.BellPercent) + b += 1 + + Put16(buf[b:], uint16(v.BellPitch)) + b += 2 + + Put16(buf[b:], uint16(v.BellDuration)) + b += 2 + + Put32(buf[b:], v.LedMask) + b += 4 + + Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list XinputKbdFeedbackCtl +func XinputKbdFeedbackCtlListBytes(buf []byte, list []XinputKbdFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputPtrFeedbackCtl' struct definition +// Size: 12 +type XinputPtrFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + Num int16 + Denom int16 + Threshold int16 +} + +// Struct read XinputPtrFeedbackCtl +func ReadXinputPtrFeedbackCtl(buf []byte, v *XinputPtrFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Num = int16(Get16(buf[b:])) + b += 2 + + v.Denom = int16(Get16(buf[b:])) + b += 2 + + v.Threshold = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read XinputPtrFeedbackCtl +func ReadXinputPtrFeedbackCtlList(buf []byte, dest []XinputPtrFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputPtrFeedbackCtl{} + b += ReadXinputPtrFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputPtrFeedbackCtl +func (v XinputPtrFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + Put16(buf[b:], uint16(v.Num)) + b += 2 + + Put16(buf[b:], uint16(v.Denom)) + b += 2 + + Put16(buf[b:], uint16(v.Threshold)) + b += 2 + + return buf +} + +// Write struct list XinputPtrFeedbackCtl +func XinputPtrFeedbackCtlListBytes(buf []byte, list []XinputPtrFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputIntegerFeedbackCtl' struct definition +// Size: 8 +type XinputIntegerFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + IntToDisplay int32 +} + +// Struct read XinputIntegerFeedbackCtl +func ReadXinputIntegerFeedbackCtl(buf []byte, v *XinputIntegerFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.IntToDisplay = int32(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read XinputIntegerFeedbackCtl +func ReadXinputIntegerFeedbackCtlList(buf []byte, dest []XinputIntegerFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputIntegerFeedbackCtl{} + b += ReadXinputIntegerFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputIntegerFeedbackCtl +func (v XinputIntegerFeedbackCtl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], uint32(v.IntToDisplay)) + b += 4 + + return buf +} + +// Write struct list XinputIntegerFeedbackCtl +func XinputIntegerFeedbackCtlListBytes(buf []byte, list []XinputIntegerFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputStringFeedbackCtl' struct definition +// Size: (8 + pad((int(NumKeysyms) * 4))) +type XinputStringFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + NumKeysyms uint16 + Keysyms []Keysym // size: pad((int(NumKeysyms) * 4)) +} + +// Struct read XinputStringFeedbackCtl +func ReadXinputStringFeedbackCtl(buf []byte, v *XinputStringFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.NumKeysyms = Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = Keysym(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return b +} + +// Struct list read XinputStringFeedbackCtl +func ReadXinputStringFeedbackCtlList(buf []byte, dest []XinputStringFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputStringFeedbackCtl{} + b += ReadXinputStringFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputStringFeedbackCtl +func (v XinputStringFeedbackCtl) Bytes() []byte { + buf := make([]byte, (8 + pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Write struct list XinputStringFeedbackCtl +func XinputStringFeedbackCtlListBytes(buf []byte, list []XinputStringFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputStringFeedbackCtl +func XinputStringFeedbackCtlListSize(list []XinputStringFeedbackCtl) int { + size := 0 + for _, item := range list { + size += (8 + pad((int(item.NumKeysyms) * 4))) + } + return size +} + +// 'XinputBellFeedbackCtl' struct definition +// Size: 12 +type XinputBellFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + Percent int8 + // padding: 3 bytes + Pitch int16 + Duration int16 +} + +// Struct read XinputBellFeedbackCtl +func ReadXinputBellFeedbackCtl(buf []byte, v *XinputBellFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Percent = int8(buf[b]) + b += 1 + + b += 3 // padding + + v.Pitch = int16(Get16(buf[b:])) + b += 2 + + v.Duration = int16(Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read XinputBellFeedbackCtl +func ReadXinputBellFeedbackCtlList(buf []byte, dest []XinputBellFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputBellFeedbackCtl{} + b += ReadXinputBellFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputBellFeedbackCtl +func (v XinputBellFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = byte(v.Percent) + b += 1 + + b += 3 // padding + + Put16(buf[b:], uint16(v.Pitch)) + b += 2 + + Put16(buf[b:], uint16(v.Duration)) + b += 2 + + return buf +} + +// Write struct list XinputBellFeedbackCtl +func XinputBellFeedbackCtlListBytes(buf []byte, list []XinputBellFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputLedFeedbackCtl' struct definition +// Size: 12 +type XinputLedFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// Struct read XinputLedFeedbackCtl +func ReadXinputLedFeedbackCtl(buf []byte, v *XinputLedFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = Get16(buf[b:]) + b += 2 + + v.LedMask = Get32(buf[b:]) + b += 4 + + v.LedValues = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputLedFeedbackCtl +func ReadXinputLedFeedbackCtlList(buf []byte, dest []XinputLedFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputLedFeedbackCtl{} + b += ReadXinputLedFeedbackCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputLedFeedbackCtl +func (v XinputLedFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.LedMask) + b += 4 + + Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list XinputLedFeedbackCtl +func XinputLedFeedbackCtlListBytes(buf []byte, list []XinputLedFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputInputState' struct definition +// Size: 3 +type XinputInputState struct { + ClassId byte + Len byte + NumItems byte +} + +// Struct read XinputInputState +func ReadXinputInputState(buf []byte, v *XinputInputState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumItems = buf[b] + b += 1 + + return b +} + +// Struct list read XinputInputState +func ReadXinputInputStateList(buf []byte, dest []XinputInputState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputInputState{} + b += ReadXinputInputState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputInputState +func (v XinputInputState) Bytes() []byte { + buf := make([]byte, 3) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumItems + b += 1 + + return buf +} + +// Write struct list XinputInputState +func XinputInputStateListBytes(buf []byte, list []XinputInputState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputKeyState' struct definition +// Size: 36 +type XinputKeyState struct { + ClassId byte + Len byte + NumKeys byte + // padding: 1 bytes + Keys []byte // size: 32 +} + +// Struct read XinputKeyState +func ReadXinputKeyState(buf []byte, v *XinputKeyState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumKeys = buf[b] + b += 1 + + b += 1 // padding + + v.Keys = make([]byte, 32) + copy(v.Keys[:32], buf[b:]) + b += pad(int(32)) + + return b +} + +// Struct list read XinputKeyState +func ReadXinputKeyStateList(buf []byte, dest []XinputKeyState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputKeyState{} + b += ReadXinputKeyState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputKeyState +func (v XinputKeyState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumKeys + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Keys[:32]) + b += pad(int(32)) + + return buf +} + +// Write struct list XinputKeyState +func XinputKeyStateListBytes(buf []byte, list []XinputKeyState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputKeyState +func XinputKeyStateListSize(list []XinputKeyState) int { + size := 0 + for _ = range list { + size += 36 + } + return size +} + +// 'XinputButtonState' struct definition +// Size: 36 +type XinputButtonState struct { + ClassId byte + Len byte + NumButtons byte + // padding: 1 bytes + Buttons []byte // size: 32 +} + +// Struct read XinputButtonState +func ReadXinputButtonState(buf []byte, v *XinputButtonState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumButtons = buf[b] + b += 1 + + b += 1 // padding + + v.Buttons = make([]byte, 32) + copy(v.Buttons[:32], buf[b:]) + b += pad(int(32)) + + return b +} + +// Struct list read XinputButtonState +func ReadXinputButtonStateList(buf []byte, dest []XinputButtonState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputButtonState{} + b += ReadXinputButtonState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputButtonState +func (v XinputButtonState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumButtons + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Buttons[:32]) + b += pad(int(32)) + + return buf +} + +// Write struct list XinputButtonState +func XinputButtonStateListBytes(buf []byte, list []XinputButtonState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputButtonState +func XinputButtonStateListSize(list []XinputButtonState) int { + size := 0 + for _ = range list { + size += 36 + } + return size +} + +// 'XinputValuatorState' struct definition +// Size: (4 + pad((int(NumValuators) * 4))) +type XinputValuatorState struct { + ClassId byte + Len byte + NumValuators byte + Mode byte + Valuators []uint32 // size: pad((int(NumValuators) * 4)) +} + +// Struct read XinputValuatorState +func ReadXinputValuatorState(buf []byte, v *XinputValuatorState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.Valuators = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.Valuators[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return b +} + +// Struct list read XinputValuatorState +func ReadXinputValuatorStateList(buf []byte, dest []XinputValuatorState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputValuatorState{} + b += ReadXinputValuatorState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputValuatorState +func (v XinputValuatorState) Bytes() []byte { + buf := make([]byte, (4 + pad((int(v.NumValuators) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.Mode + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + Put32(buf[b:], v.Valuators[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Write struct list XinputValuatorState +func XinputValuatorStateListBytes(buf []byte, list []XinputValuatorState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputValuatorState +func XinputValuatorStateListSize(list []XinputValuatorState) int { + size := 0 + for _, item := range list { + size += (4 + pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'XinputDeviceState' struct definition +// Size: 4 +type XinputDeviceState struct { + ControlId uint16 + Len uint16 +} + +// Struct read XinputDeviceState +func ReadXinputDeviceState(buf []byte, v *XinputDeviceState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputDeviceState +func ReadXinputDeviceStateList(buf []byte, dest []XinputDeviceState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceState{} + b += ReadXinputDeviceState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceState +func (v XinputDeviceState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list XinputDeviceState +func XinputDeviceStateListBytes(buf []byte, list []XinputDeviceState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceResolutionState' struct definition +// Size: (((8 + pad((int(NumValuators) * 4))) + pad((int(NumValuators) * 4))) + pad((int(NumValuators) * 4))) +type XinputDeviceResolutionState struct { + ControlId uint16 + Len uint16 + NumValuators uint32 + ResolutionValues []uint32 // size: pad((int(NumValuators) * 4)) + ResolutionMin []uint32 // size: pad((int(NumValuators) * 4)) + ResolutionMax []uint32 // size: pad((int(NumValuators) * 4)) +} + +// Struct read XinputDeviceResolutionState +func ReadXinputDeviceResolutionState(buf []byte, v *XinputDeviceResolutionState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.NumValuators = Get32(buf[b:]) + b += 4 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.ResolutionMin = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMin[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.ResolutionMax = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMax[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return b +} + +// Struct list read XinputDeviceResolutionState +func ReadXinputDeviceResolutionStateList(buf []byte, dest []XinputDeviceResolutionState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceResolutionState{} + b += ReadXinputDeviceResolutionState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceResolutionState +func (v XinputDeviceResolutionState) Bytes() []byte { + buf := make([]byte, (((8 + pad((int(v.NumValuators) * 4))) + pad((int(v.NumValuators) * 4))) + pad((int(v.NumValuators) * 4)))) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.NumValuators) + b += 4 + + for i := 0; i < int(v.NumValuators); i++ { + Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + Put32(buf[b:], v.ResolutionMin[i]) + b += 4 + } + b = pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + Put32(buf[b:], v.ResolutionMax[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Write struct list XinputDeviceResolutionState +func XinputDeviceResolutionStateListBytes(buf []byte, list []XinputDeviceResolutionState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputDeviceResolutionState +func XinputDeviceResolutionStateListSize(list []XinputDeviceResolutionState) int { + size := 0 + for _, item := range list { + size += (((8 + pad((int(item.NumValuators) * 4))) + pad((int(item.NumValuators) * 4))) + pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'XinputDeviceAbsCalibState' struct definition +// Size: 36 +type XinputDeviceAbsCalibState struct { + ControlId uint16 + Len uint16 + MinX int32 + MaxX int32 + MinY int32 + MaxY int32 + FlipX uint32 + FlipY uint32 + Rotation uint32 + ButtonThreshold uint32 +} + +// Struct read XinputDeviceAbsCalibState +func ReadXinputDeviceAbsCalibState(buf []byte, v *XinputDeviceAbsCalibState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.MinX = int32(Get32(buf[b:])) + b += 4 + + v.MaxX = int32(Get32(buf[b:])) + b += 4 + + v.MinY = int32(Get32(buf[b:])) + b += 4 + + v.MaxY = int32(Get32(buf[b:])) + b += 4 + + v.FlipX = Get32(buf[b:]) + b += 4 + + v.FlipY = Get32(buf[b:]) + b += 4 + + v.Rotation = Get32(buf[b:]) + b += 4 + + v.ButtonThreshold = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputDeviceAbsCalibState +func ReadXinputDeviceAbsCalibStateList(buf []byte, dest []XinputDeviceAbsCalibState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceAbsCalibState{} + b += ReadXinputDeviceAbsCalibState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceAbsCalibState +func (v XinputDeviceAbsCalibState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], uint32(v.MinX)) + b += 4 + + Put32(buf[b:], uint32(v.MaxX)) + b += 4 + + Put32(buf[b:], uint32(v.MinY)) + b += 4 + + Put32(buf[b:], uint32(v.MaxY)) + b += 4 + + Put32(buf[b:], v.FlipX) + b += 4 + + Put32(buf[b:], v.FlipY) + b += 4 + + Put32(buf[b:], v.Rotation) + b += 4 + + Put32(buf[b:], v.ButtonThreshold) + b += 4 + + return buf +} + +// Write struct list XinputDeviceAbsCalibState +func XinputDeviceAbsCalibStateListBytes(buf []byte, list []XinputDeviceAbsCalibState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceAbsAreaState' struct definition +// Size: 28 +type XinputDeviceAbsAreaState struct { + ControlId uint16 + Len uint16 + OffsetX uint32 + OffsetY uint32 + Width uint32 + Height uint32 + Screen uint32 + Following uint32 +} + +// Struct read XinputDeviceAbsAreaState +func ReadXinputDeviceAbsAreaState(buf []byte, v *XinputDeviceAbsAreaState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.OffsetX = Get32(buf[b:]) + b += 4 + + v.OffsetY = Get32(buf[b:]) + b += 4 + + v.Width = Get32(buf[b:]) + b += 4 + + v.Height = Get32(buf[b:]) + b += 4 + + v.Screen = Get32(buf[b:]) + b += 4 + + v.Following = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputDeviceAbsAreaState +func ReadXinputDeviceAbsAreaStateList(buf []byte, dest []XinputDeviceAbsAreaState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceAbsAreaState{} + b += ReadXinputDeviceAbsAreaState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceAbsAreaState +func (v XinputDeviceAbsAreaState) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.OffsetX) + b += 4 + + Put32(buf[b:], v.OffsetY) + b += 4 + + Put32(buf[b:], v.Width) + b += 4 + + Put32(buf[b:], v.Height) + b += 4 + + Put32(buf[b:], v.Screen) + b += 4 + + Put32(buf[b:], v.Following) + b += 4 + + return buf +} + +// Write struct list XinputDeviceAbsAreaState +func XinputDeviceAbsAreaStateListBytes(buf []byte, list []XinputDeviceAbsAreaState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceCoreState' struct definition +// Size: 8 +type XinputDeviceCoreState struct { + ControlId uint16 + Len uint16 + Status byte + Iscore byte + // padding: 2 bytes +} + +// Struct read XinputDeviceCoreState +func ReadXinputDeviceCoreState(buf []byte, v *XinputDeviceCoreState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Status = buf[b] + b += 1 + + v.Iscore = buf[b] + b += 1 + + b += 2 // padding + + return b +} + +// Struct list read XinputDeviceCoreState +func ReadXinputDeviceCoreStateList(buf []byte, dest []XinputDeviceCoreState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceCoreState{} + b += ReadXinputDeviceCoreState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceCoreState +func (v XinputDeviceCoreState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Status + b += 1 + + buf[b] = v.Iscore + b += 1 + + b += 2 // padding + + return buf +} + +// Write struct list XinputDeviceCoreState +func XinputDeviceCoreStateListBytes(buf []byte, list []XinputDeviceCoreState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceEnableState' struct definition +// Size: 8 +type XinputDeviceEnableState struct { + ControlId uint16 + Len uint16 + Enable byte + // padding: 3 bytes +} + +// Struct read XinputDeviceEnableState +func ReadXinputDeviceEnableState(buf []byte, v *XinputDeviceEnableState) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Enable = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read XinputDeviceEnableState +func ReadXinputDeviceEnableStateList(buf []byte, dest []XinputDeviceEnableState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceEnableState{} + b += ReadXinputDeviceEnableState(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceEnableState +func (v XinputDeviceEnableState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Enable + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list XinputDeviceEnableState +func XinputDeviceEnableStateListBytes(buf []byte, list []XinputDeviceEnableState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceCtl' struct definition +// Size: 4 +type XinputDeviceCtl struct { + ControlId uint16 + Len uint16 +} + +// Struct read XinputDeviceCtl +func ReadXinputDeviceCtl(buf []byte, v *XinputDeviceCtl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read XinputDeviceCtl +func ReadXinputDeviceCtlList(buf []byte, dest []XinputDeviceCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceCtl{} + b += ReadXinputDeviceCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceCtl +func (v XinputDeviceCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list XinputDeviceCtl +func XinputDeviceCtlListBytes(buf []byte, list []XinputDeviceCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceResolutionCtl' struct definition +// Size: (6 + pad((int(NumValuators) * 4))) +type XinputDeviceResolutionCtl struct { + ControlId uint16 + Len uint16 + FirstValuator byte + NumValuators byte + ResolutionValues []uint32 // size: pad((int(NumValuators) * 4)) +} + +// Struct read XinputDeviceResolutionCtl +func ReadXinputDeviceResolutionCtl(buf []byte, v *XinputDeviceResolutionCtl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.FirstValuator = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return b +} + +// Struct list read XinputDeviceResolutionCtl +func ReadXinputDeviceResolutionCtlList(buf []byte, dest []XinputDeviceResolutionCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceResolutionCtl{} + b += ReadXinputDeviceResolutionCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceResolutionCtl +func (v XinputDeviceResolutionCtl) Bytes() []byte { + buf := make([]byte, (6 + pad((int(v.NumValuators) * 4)))) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.FirstValuator + b += 1 + + buf[b] = v.NumValuators + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Write struct list XinputDeviceResolutionCtl +func XinputDeviceResolutionCtlListBytes(buf []byte, list []XinputDeviceResolutionCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XinputDeviceResolutionCtl +func XinputDeviceResolutionCtlListSize(list []XinputDeviceResolutionCtl) int { + size := 0 + for _, item := range list { + size += (6 + pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'XinputDeviceAbsCalibCtl' struct definition +// Size: 36 +type XinputDeviceAbsCalibCtl struct { + ControlId uint16 + Len uint16 + MinX int32 + MaxX int32 + MinY int32 + MaxY int32 + FlipX uint32 + FlipY uint32 + Rotation uint32 + ButtonThreshold uint32 +} + +// Struct read XinputDeviceAbsCalibCtl +func ReadXinputDeviceAbsCalibCtl(buf []byte, v *XinputDeviceAbsCalibCtl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.MinX = int32(Get32(buf[b:])) + b += 4 + + v.MaxX = int32(Get32(buf[b:])) + b += 4 + + v.MinY = int32(Get32(buf[b:])) + b += 4 + + v.MaxY = int32(Get32(buf[b:])) + b += 4 + + v.FlipX = Get32(buf[b:]) + b += 4 + + v.FlipY = Get32(buf[b:]) + b += 4 + + v.Rotation = Get32(buf[b:]) + b += 4 + + v.ButtonThreshold = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputDeviceAbsCalibCtl +func ReadXinputDeviceAbsCalibCtlList(buf []byte, dest []XinputDeviceAbsCalibCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceAbsCalibCtl{} + b += ReadXinputDeviceAbsCalibCtl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceAbsCalibCtl +func (v XinputDeviceAbsCalibCtl) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], uint32(v.MinX)) + b += 4 + + Put32(buf[b:], uint32(v.MaxX)) + b += 4 + + Put32(buf[b:], uint32(v.MinY)) + b += 4 + + Put32(buf[b:], uint32(v.MaxY)) + b += 4 + + Put32(buf[b:], v.FlipX) + b += 4 + + Put32(buf[b:], v.FlipY) + b += 4 + + Put32(buf[b:], v.Rotation) + b += 4 + + Put32(buf[b:], v.ButtonThreshold) + b += 4 + + return buf +} + +// Write struct list XinputDeviceAbsCalibCtl +func XinputDeviceAbsCalibCtlListBytes(buf []byte, list []XinputDeviceAbsCalibCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceAbsAreaCtrl' struct definition +// Size: 28 +type XinputDeviceAbsAreaCtrl struct { + ControlId uint16 + Len uint16 + OffsetX uint32 + OffsetY uint32 + Width int32 + Height int32 + Screen int32 + Following uint32 +} + +// Struct read XinputDeviceAbsAreaCtrl +func ReadXinputDeviceAbsAreaCtrl(buf []byte, v *XinputDeviceAbsAreaCtrl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.OffsetX = Get32(buf[b:]) + b += 4 + + v.OffsetY = Get32(buf[b:]) + b += 4 + + v.Width = int32(Get32(buf[b:])) + b += 4 + + v.Height = int32(Get32(buf[b:])) + b += 4 + + v.Screen = int32(Get32(buf[b:])) + b += 4 + + v.Following = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XinputDeviceAbsAreaCtrl +func ReadXinputDeviceAbsAreaCtrlList(buf []byte, dest []XinputDeviceAbsAreaCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceAbsAreaCtrl{} + b += ReadXinputDeviceAbsAreaCtrl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceAbsAreaCtrl +func (v XinputDeviceAbsAreaCtrl) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + Put32(buf[b:], v.OffsetX) + b += 4 + + Put32(buf[b:], v.OffsetY) + b += 4 + + Put32(buf[b:], uint32(v.Width)) + b += 4 + + Put32(buf[b:], uint32(v.Height)) + b += 4 + + Put32(buf[b:], uint32(v.Screen)) + b += 4 + + Put32(buf[b:], v.Following) + b += 4 + + return buf +} + +// Write struct list XinputDeviceAbsAreaCtrl +func XinputDeviceAbsAreaCtrlListBytes(buf []byte, list []XinputDeviceAbsAreaCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceCoreCtrl' struct definition +// Size: 8 +type XinputDeviceCoreCtrl struct { + ControlId uint16 + Len uint16 + Status byte + // padding: 3 bytes +} + +// Struct read XinputDeviceCoreCtrl +func ReadXinputDeviceCoreCtrl(buf []byte, v *XinputDeviceCoreCtrl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Status = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read XinputDeviceCoreCtrl +func ReadXinputDeviceCoreCtrlList(buf []byte, dest []XinputDeviceCoreCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceCoreCtrl{} + b += ReadXinputDeviceCoreCtrl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceCoreCtrl +func (v XinputDeviceCoreCtrl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Status + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list XinputDeviceCoreCtrl +func XinputDeviceCoreCtrlListBytes(buf []byte, list []XinputDeviceCoreCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XinputDeviceEnableCtrl' struct definition +// Size: 8 +type XinputDeviceEnableCtrl struct { + ControlId uint16 + Len uint16 + Enable byte + // padding: 3 bytes +} + +// Struct read XinputDeviceEnableCtrl +func ReadXinputDeviceEnableCtrl(buf []byte, v *XinputDeviceEnableCtrl) int { + b := 0 + + v.ControlId = Get16(buf[b:]) + b += 2 + + v.Len = Get16(buf[b:]) + b += 2 + + v.Enable = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read XinputDeviceEnableCtrl +func ReadXinputDeviceEnableCtrlList(buf []byte, dest []XinputDeviceEnableCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XinputDeviceEnableCtrl{} + b += ReadXinputDeviceEnableCtrl(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XinputDeviceEnableCtrl +func (v XinputDeviceEnableCtrl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put16(buf[b:], v.ControlId) + b += 2 + + Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Enable + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list XinputDeviceEnableCtrl +func XinputDeviceEnableCtrlListBytes(buf []byte, list []XinputDeviceEnableCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Event definition XinputDeviceValuator (0) +// Size: 32 + +const XinputDeviceValuator = 0 + +type XinputDeviceValuatorEvent struct { + Sequence uint16 + DeviceId byte + DeviceState uint16 + NumValuators byte + FirstValuator byte + Valuators []int32 // size: 24 +} + +// Event read XinputDeviceValuator +func NewXinputDeviceValuatorEvent(buf []byte) Event { + v := XinputDeviceValuatorEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.DeviceState = Get16(buf[b:]) + b += 2 + + v.NumValuators = buf[b] + b += 1 + + v.FirstValuator = buf[b] + b += 1 + + v.Valuators = make([]int32, 6) + for i := 0; i < int(6); i++ { + v.Valuators[i] = int32(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +// Event write XinputDeviceValuator +func (v XinputDeviceValuatorEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + Put16(buf[b:], v.DeviceState) + b += 2 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.FirstValuator + b += 1 + + for i := 0; i < int(6); i++ { + Put32(buf[b:], uint32(v.Valuators[i])) + b += 4 + } + b = pad(b) + + return buf +} + +func (v XinputDeviceValuatorEvent) ImplementsEvent() {} + +func (v XinputDeviceValuatorEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceValuatorEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, sprintf("DeviceState: %d", v.DeviceState)) + fieldVals = append(fieldVals, sprintf("NumValuators: %d", v.NumValuators)) + fieldVals = append(fieldVals, sprintf("FirstValuator: %d", v.FirstValuator)) + return "XinputDeviceValuator {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewXinputDeviceValuatorEvent +} + +// Event definition XinputDeviceKeyPress (1) +// Size: 32 + +const XinputDeviceKeyPress = 1 + +type XinputDeviceKeyPressEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Root Id + Event Id + Child Id + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + DeviceId byte +} + +// Event read XinputDeviceKeyPress +func NewXinputDeviceKeyPressEvent(buf []byte) Event { + v := XinputDeviceKeyPressEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + v.Event = Id(Get32(buf[b:])) + b += 4 + + v.Child = Id(Get32(buf[b:])) + b += 4 + + v.RootX = int16(Get16(buf[b:])) + b += 2 + + v.RootY = int16(Get16(buf[b:])) + b += 2 + + v.EventX = int16(Get16(buf[b:])) + b += 2 + + v.EventY = int16(Get16(buf[b:])) + b += 2 + + v.State = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + v.DeviceId = buf[b] + b += 1 + + return v +} + +// Event write XinputDeviceKeyPress +func (v XinputDeviceKeyPressEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Root)) + b += 4 + + Put32(buf[b:], uint32(v.Event)) + b += 4 + + Put32(buf[b:], uint32(v.Child)) + b += 4 + + Put16(buf[b:], uint16(v.RootX)) + b += 2 + + Put16(buf[b:], uint16(v.RootY)) + b += 2 + + Put16(buf[b:], uint16(v.EventX)) + b += 2 + + Put16(buf[b:], uint16(v.EventY)) + b += 2 + + Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.DeviceId + b += 1 + + return buf +} + +func (v XinputDeviceKeyPressEvent) ImplementsEvent() {} + +func (v XinputDeviceKeyPressEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceKeyPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceKeyPress {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewXinputDeviceKeyPressEvent +} + +// Event definition XinputFocusIn (6) +// Size: 32 + +const XinputFocusIn = 6 + +type XinputFocusInEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Window Id + Mode byte + DeviceId byte + // padding: 18 bytes +} + +// Event read XinputFocusIn +func NewXinputFocusInEvent(buf []byte) Event { + v := XinputFocusInEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Window = Id(Get32(buf[b:])) + b += 4 + + v.Mode = buf[b] + b += 1 + + v.DeviceId = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +// Event write XinputFocusIn +func (v XinputFocusInEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 6 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.Mode + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 18 // padding + + return buf +} + +func (v XinputFocusInEvent) ImplementsEvent() {} + +func (v XinputFocusInEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputFocusInEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputFocusIn {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[6] = NewXinputFocusInEvent +} + +// Event definition XinputDeviceStateNotify (10) +// Size: 32 + +const XinputDeviceStateNotify = 10 + +type XinputDeviceStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Time Timestamp + NumKeys byte + NumButtons byte + NumValuators byte + ClassesReported byte + Buttons []byte // size: 4 + Keys []byte // size: 4 + Valuators []uint32 // size: 12 +} + +// Event read XinputDeviceStateNotify +func NewXinputDeviceStateNotifyEvent(buf []byte) Event { + v := XinputDeviceStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.NumKeys = buf[b] + b += 1 + + v.NumButtons = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.ClassesReported = buf[b] + b += 1 + + v.Buttons = make([]byte, 4) + copy(v.Buttons[:4], buf[b:]) + b += pad(int(4)) + + v.Keys = make([]byte, 4) + copy(v.Keys[:4], buf[b:]) + b += pad(int(4)) + + v.Valuators = make([]uint32, 3) + for i := 0; i < int(3); i++ { + v.Valuators[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +// Event write XinputDeviceStateNotify +func (v XinputDeviceStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 10 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.NumKeys + b += 1 + + buf[b] = v.NumButtons + b += 1 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.ClassesReported + b += 1 + + copy(buf[b:], v.Buttons[:4]) + b += pad(int(4)) + + copy(buf[b:], v.Keys[:4]) + b += pad(int(4)) + + for i := 0; i < int(3); i++ { + Put32(buf[b:], v.Valuators[i]) + b += 4 + } + b = pad(b) + + return buf +} + +func (v XinputDeviceStateNotifyEvent) ImplementsEvent() {} + +func (v XinputDeviceStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("NumKeys: %d", v.NumKeys)) + fieldVals = append(fieldVals, sprintf("NumButtons: %d", v.NumButtons)) + fieldVals = append(fieldVals, sprintf("NumValuators: %d", v.NumValuators)) + fieldVals = append(fieldVals, sprintf("ClassesReported: %d", v.ClassesReported)) + return "XinputDeviceStateNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[10] = NewXinputDeviceStateNotifyEvent +} + +// Event definition XinputDeviceMappingNotify (11) +// Size: 32 + +const XinputDeviceMappingNotify = 11 + +type XinputDeviceMappingNotifyEvent struct { + Sequence uint16 + DeviceId byte + Request byte + FirstKeycode XinputKeyCode + Count byte + // padding: 1 bytes + Time Timestamp + // padding: 20 bytes +} + +// Event read XinputDeviceMappingNotify +func NewXinputDeviceMappingNotifyEvent(buf []byte) Event { + v := XinputDeviceMappingNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Request = buf[b] + b += 1 + + v.FirstKeycode = XinputKeyCode(buf[b]) + b += 1 + + v.Count = buf[b] + b += 1 + + b += 1 // padding + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Event write XinputDeviceMappingNotify +func (v XinputDeviceMappingNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 11 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + buf[b] = v.Request + b += 1 + + buf[b] = byte(v.FirstKeycode) + b += 1 + + buf[b] = v.Count + b += 1 + + b += 1 // padding + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + b += 20 // padding + + return buf +} + +func (v XinputDeviceMappingNotifyEvent) ImplementsEvent() {} + +func (v XinputDeviceMappingNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceMappingNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + return "XinputDeviceMappingNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[11] = NewXinputDeviceMappingNotifyEvent +} + +// Event definition XinputChangeDeviceNotify (12) +// Size: 32 + +const XinputChangeDeviceNotify = 12 + +type XinputChangeDeviceNotifyEvent struct { + Sequence uint16 + DeviceId byte + Time Timestamp + Request byte + // padding: 23 bytes +} + +// Event read XinputChangeDeviceNotify +func NewXinputChangeDeviceNotifyEvent(buf []byte) Event { + v := XinputChangeDeviceNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Request = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Event write XinputChangeDeviceNotify +func (v XinputChangeDeviceNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 12 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.Request + b += 1 + + b += 23 // padding + + return buf +} + +func (v XinputChangeDeviceNotifyEvent) ImplementsEvent() {} + +func (v XinputChangeDeviceNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputChangeDeviceNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) + return "XinputChangeDeviceNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[12] = NewXinputChangeDeviceNotifyEvent +} + +// Event definition XinputDeviceKeyStateNotify (13) +// Size: 32 + +const XinputDeviceKeyStateNotify = 13 + +type XinputDeviceKeyStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Keys []byte // size: 28 +} + +// Event read XinputDeviceKeyStateNotify +func NewXinputDeviceKeyStateNotifyEvent(buf []byte) Event { + v := XinputDeviceKeyStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Keys = make([]byte, 28) + copy(v.Keys[:28], buf[b:]) + b += pad(int(28)) + + return v +} + +// Event write XinputDeviceKeyStateNotify +func (v XinputDeviceKeyStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 13 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Keys[:28]) + b += pad(int(28)) + + return buf +} + +func (v XinputDeviceKeyStateNotifyEvent) ImplementsEvent() {} + +func (v XinputDeviceKeyStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceKeyStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceKeyStateNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[13] = NewXinputDeviceKeyStateNotifyEvent +} + +// Event definition XinputDeviceButtonStateNotify (14) +// Size: 32 + +const XinputDeviceButtonStateNotify = 14 + +type XinputDeviceButtonStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Buttons []byte // size: 28 +} + +// Event read XinputDeviceButtonStateNotify +func NewXinputDeviceButtonStateNotifyEvent(buf []byte) Event { + v := XinputDeviceButtonStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Buttons = make([]byte, 28) + copy(v.Buttons[:28], buf[b:]) + b += pad(int(28)) + + return v +} + +// Event write XinputDeviceButtonStateNotify +func (v XinputDeviceButtonStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 14 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Buttons[:28]) + b += pad(int(28)) + + return buf +} + +func (v XinputDeviceButtonStateNotifyEvent) ImplementsEvent() {} + +func (v XinputDeviceButtonStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceButtonStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceButtonStateNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[14] = NewXinputDeviceButtonStateNotifyEvent +} + +// Event definition XinputDevicePresenceNotify (15) +// Size: 32 + +const XinputDevicePresenceNotify = 15 + +type XinputDevicePresenceNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Devchange byte + DeviceId byte + Control uint16 + // padding: 20 bytes +} + +// Event read XinputDevicePresenceNotify +func NewXinputDevicePresenceNotifyEvent(buf []byte) Event { + v := XinputDevicePresenceNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Devchange = buf[b] + b += 1 + + v.DeviceId = buf[b] + b += 1 + + v.Control = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Event write XinputDevicePresenceNotify +func (v XinputDevicePresenceNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 15 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.Devchange + b += 1 + + buf[b] = v.DeviceId + b += 1 + + Put16(buf[b:], v.Control) + b += 2 + + b += 20 // padding + + return buf +} + +func (v XinputDevicePresenceNotifyEvent) ImplementsEvent() {} + +func (v XinputDevicePresenceNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDevicePresenceNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Devchange: %d", v.Devchange)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, sprintf("Control: %d", v.Control)) + return "XinputDevicePresenceNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[15] = NewXinputDevicePresenceNotifyEvent +} + +// EventCopy definition XinputDeviceKeyRelease (2) + +const XinputDeviceKeyRelease = 2 + +type XinputDeviceKeyReleaseEvent XinputDeviceKeyPressEvent + +func NewXinputDeviceKeyReleaseEvent(buf []byte) Event { + return XinputDeviceKeyReleaseEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputDeviceKeyReleaseEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputDeviceKeyReleaseEvent) ImplementsEvent() {} + +func (v XinputDeviceKeyReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceKeyReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceKeyRelease {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[2] = NewXinputDeviceKeyReleaseEvent +} + +// EventCopy definition XinputDeviceButtonPress (3) + +const XinputDeviceButtonPress = 3 + +type XinputDeviceButtonPressEvent XinputDeviceKeyPressEvent + +func NewXinputDeviceButtonPressEvent(buf []byte) Event { + return XinputDeviceButtonPressEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputDeviceButtonPressEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputDeviceButtonPressEvent) ImplementsEvent() {} + +func (v XinputDeviceButtonPressEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceButtonPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceButtonPress {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[3] = NewXinputDeviceButtonPressEvent +} + +// EventCopy definition XinputDeviceButtonRelease (4) + +const XinputDeviceButtonRelease = 4 + +type XinputDeviceButtonReleaseEvent XinputDeviceKeyPressEvent + +func NewXinputDeviceButtonReleaseEvent(buf []byte) Event { + return XinputDeviceButtonReleaseEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputDeviceButtonReleaseEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputDeviceButtonReleaseEvent) ImplementsEvent() {} + +func (v XinputDeviceButtonReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceButtonReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceButtonRelease {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[4] = NewXinputDeviceButtonReleaseEvent +} + +// EventCopy definition XinputDeviceMotionNotify (5) + +const XinputDeviceMotionNotify = 5 + +type XinputDeviceMotionNotifyEvent XinputDeviceKeyPressEvent + +func NewXinputDeviceMotionNotifyEvent(buf []byte) Event { + return XinputDeviceMotionNotifyEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputDeviceMotionNotifyEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputDeviceMotionNotifyEvent) ImplementsEvent() {} + +func (v XinputDeviceMotionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputDeviceMotionNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputDeviceMotionNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[5] = NewXinputDeviceMotionNotifyEvent +} + +// EventCopy definition XinputProximityIn (8) + +const XinputProximityIn = 8 + +type XinputProximityInEvent XinputDeviceKeyPressEvent + +func NewXinputProximityInEvent(buf []byte) Event { + return XinputProximityInEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputProximityInEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputProximityInEvent) ImplementsEvent() {} + +func (v XinputProximityInEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputProximityInEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputProximityIn {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[8] = NewXinputProximityInEvent +} + +// EventCopy definition XinputProximityOut (9) + +const XinputProximityOut = 9 + +type XinputProximityOutEvent XinputDeviceKeyPressEvent + +func NewXinputProximityOutEvent(buf []byte) Event { + return XinputProximityOutEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) +} + +func (v XinputProximityOutEvent) Bytes() []byte { + return XinputDeviceKeyPressEvent(v).Bytes() +} + +func (v XinputProximityOutEvent) ImplementsEvent() {} + +func (v XinputProximityOutEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputProximityOutEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputProximityOut {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[9] = NewXinputProximityOutEvent +} + +// EventCopy definition XinputFocusOut (7) + +const XinputFocusOut = 7 + +type XinputFocusOutEvent XinputFocusInEvent + +func NewXinputFocusOutEvent(buf []byte) Event { + return XinputFocusOutEvent(NewXinputFocusInEvent(buf).(XinputFocusInEvent)) +} + +func (v XinputFocusOutEvent) Bytes() []byte { + return XinputFocusInEvent(v).Bytes() +} + +func (v XinputFocusOutEvent) ImplementsEvent() {} + +func (v XinputFocusOutEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XinputFocusOutEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) + return "XinputFocusOut {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[7] = NewXinputFocusOutEvent +} + +// Error definition XinputDevice (0) +// Size: 32 + +const BadXinputDevice = 0 + +type XinputDeviceError struct { + Sequence uint16 + NiceName string +} + +// Error read XinputDevice +func NewXinputDeviceError(buf []byte) Error { + v := XinputDeviceError{} + v.NiceName = "XinputDevice" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XinputDeviceError) ImplementsError() {} + +func (err XinputDeviceError) SequenceId() uint16 { + return err.Sequence +} + +func (err XinputDeviceError) BadId() Id { + return 0 +} + +func (err XinputDeviceError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXinputDevice {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewXinputDeviceError +} + +// Error definition XinputEvent (1) +// Size: 32 + +const BadXinputEvent = 1 + +type XinputEventError struct { + Sequence uint16 + NiceName string +} + +// Error read XinputEvent +func NewXinputEventError(buf []byte) Error { + v := XinputEventError{} + v.NiceName = "XinputEvent" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XinputEventError) ImplementsError() {} + +func (err XinputEventError) SequenceId() uint16 { + return err.Sequence +} + +func (err XinputEventError) BadId() Id { + return 0 +} + +func (err XinputEventError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXinputEvent {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewXinputEventError +} + +// Error definition XinputMode (2) +// Size: 32 + +const BadXinputMode = 2 + +type XinputModeError struct { + Sequence uint16 + NiceName string +} + +// Error read XinputMode +func NewXinputModeError(buf []byte) Error { + v := XinputModeError{} + v.NiceName = "XinputMode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XinputModeError) ImplementsError() {} + +func (err XinputModeError) SequenceId() uint16 { + return err.Sequence +} + +func (err XinputModeError) BadId() Id { + return 0 +} + +func (err XinputModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXinputMode {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewXinputModeError +} + +// Error definition XinputDeviceBusy (3) +// Size: 32 + +const BadXinputDeviceBusy = 3 + +type XinputDeviceBusyError struct { + Sequence uint16 + NiceName string +} + +// Error read XinputDeviceBusy +func NewXinputDeviceBusyError(buf []byte) Error { + v := XinputDeviceBusyError{} + v.NiceName = "XinputDeviceBusy" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XinputDeviceBusyError) ImplementsError() {} + +func (err XinputDeviceBusyError) SequenceId() uint16 { + return err.Sequence +} + +func (err XinputDeviceBusyError) BadId() Id { + return 0 +} + +func (err XinputDeviceBusyError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXinputDeviceBusy {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[3] = NewXinputDeviceBusyError +} + +// Error definition XinputClass (4) +// Size: 32 + +const BadXinputClass = 4 + +type XinputClassError struct { + Sequence uint16 + NiceName string +} + +// Error read XinputClass +func NewXinputClassError(buf []byte) Error { + v := XinputClassError{} + v.NiceName = "XinputClass" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XinputClassError) ImplementsError() {} + +func (err XinputClassError) SequenceId() uint16 { + return err.Sequence +} + +func (err XinputClassError) BadId() Id { + return 0 +} + +func (err XinputClassError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXinputClass {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[4] = NewXinputClassError +} + +// Request XinputGetExtensionVersion +// size: pad((8 + pad((int(NameLen) * 1)))) +type XinputGetExtensionVersionCookie struct { + *cookie +} + +func (c *Conn) XinputGetExtensionVersion(NameLen uint16, Name string) XinputGetExtensionVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetExtensionVersionRequest(NameLen, Name), cookie) + return XinputGetExtensionVersionCookie{cookie} +} + +func (c *Conn) XinputGetExtensionVersionUnchecked(NameLen uint16, Name string) XinputGetExtensionVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetExtensionVersionRequest(NameLen, Name), cookie) + return XinputGetExtensionVersionCookie{cookie} +} + +// Request reply for XinputGetExtensionVersion +// size: 32 +type XinputGetExtensionVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 + Present bool + // padding: 19 bytes +} + +// Waits and reads reply data from request XinputGetExtensionVersion +func (cook XinputGetExtensionVersionCookie) Reply() (*XinputGetExtensionVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetExtensionVersionReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetExtensionVersion +func xinputGetExtensionVersionReply(buf []byte) *XinputGetExtensionVersionReply { + v := new(XinputGetExtensionVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = Get16(buf[b:]) + b += 2 + + v.ServerMinor = Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Present = true + } else { + v.Present = false + } + b += 1 + + b += 19 // padding + + return v +} + +func (cook XinputGetExtensionVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetExtensionVersion +func (c *Conn) xinputGetExtensionVersionRequest(NameLen uint16, Name string) []byte { + size := pad((8 + pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += pad(int(NameLen)) + + return buf +} + +// Request XinputListInputDevices +// size: 4 +type XinputListInputDevicesCookie struct { + *cookie +} + +func (c *Conn) XinputListInputDevices() XinputListInputDevicesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputListInputDevicesRequest(), cookie) + return XinputListInputDevicesCookie{cookie} +} + +func (c *Conn) XinputListInputDevicesUnchecked() XinputListInputDevicesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputListInputDevicesRequest(), cookie) + return XinputListInputDevicesCookie{cookie} +} + +// Request reply for XinputListInputDevices +// size: (32 + pad((int(DevicesLen) * 8))) +type XinputListInputDevicesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DevicesLen byte + // padding: 23 bytes + Devices []XinputDeviceInfo // size: pad((int(DevicesLen) * 8)) +} + +// Waits and reads reply data from request XinputListInputDevices +func (cook XinputListInputDevicesCookie) Reply() (*XinputListInputDevicesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputListInputDevicesReply(buf), nil +} + +// Read reply into structure from buffer for XinputListInputDevices +func xinputListInputDevicesReply(buf []byte) *XinputListInputDevicesReply { + v := new(XinputListInputDevicesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.DevicesLen = buf[b] + b += 1 + + b += 23 // padding + + v.Devices = make([]XinputDeviceInfo, v.DevicesLen) + b += ReadXinputDeviceInfoList(buf[b:], v.Devices) + + return v +} + +func (cook XinputListInputDevicesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputListInputDevices +func (c *Conn) xinputListInputDevicesRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XinputOpenDevice +// size: 8 +type XinputOpenDeviceCookie struct { + *cookie +} + +func (c *Conn) XinputOpenDevice(DeviceId byte) XinputOpenDeviceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputOpenDeviceRequest(DeviceId), cookie) + return XinputOpenDeviceCookie{cookie} +} + +func (c *Conn) XinputOpenDeviceUnchecked(DeviceId byte) XinputOpenDeviceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputOpenDeviceRequest(DeviceId), cookie) + return XinputOpenDeviceCookie{cookie} +} + +// Request reply for XinputOpenDevice +// size: (32 + pad((int(NumClasses) * 2))) +type XinputOpenDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes + ClassInfo []XinputInputClassInfo // size: pad((int(NumClasses) * 2)) +} + +// Waits and reads reply data from request XinputOpenDevice +func (cook XinputOpenDeviceCookie) Reply() (*XinputOpenDeviceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputOpenDeviceReply(buf), nil +} + +// Read reply into structure from buffer for XinputOpenDevice +func xinputOpenDeviceReply(buf []byte) *XinputOpenDeviceReply { + v := new(XinputOpenDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = buf[b] + b += 1 + + b += 23 // padding + + v.ClassInfo = make([]XinputInputClassInfo, v.NumClasses) + b += ReadXinputInputClassInfoList(buf[b:], v.ClassInfo) + + return v +} + +func (cook XinputOpenDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputOpenDevice +func (c *Conn) xinputOpenDeviceRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputCloseDevice +// size: 8 +type XinputCloseDeviceCookie struct { + *cookie +} + +// Write request to wire for XinputCloseDevice +func (c *Conn) XinputCloseDevice(DeviceId byte) XinputCloseDeviceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputCloseDeviceRequest(DeviceId), cookie) + return XinputCloseDeviceCookie{cookie} +} + +func (c *Conn) XinputCloseDeviceChecked(DeviceId byte) XinputCloseDeviceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputCloseDeviceRequest(DeviceId), cookie) + return XinputCloseDeviceCookie{cookie} +} + +func (cook XinputCloseDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputCloseDevice +func (c *Conn) xinputCloseDeviceRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputSetDeviceMode +// size: 8 +type XinputSetDeviceModeCookie struct { + *cookie +} + +func (c *Conn) XinputSetDeviceMode(DeviceId byte, Mode byte) XinputSetDeviceModeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputSetDeviceModeRequest(DeviceId, Mode), cookie) + return XinputSetDeviceModeCookie{cookie} +} + +func (c *Conn) XinputSetDeviceModeUnchecked(DeviceId byte, Mode byte) XinputSetDeviceModeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputSetDeviceModeRequest(DeviceId, Mode), cookie) + return XinputSetDeviceModeCookie{cookie} +} + +// Request reply for XinputSetDeviceMode +// size: 32 +type XinputSetDeviceModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputSetDeviceMode +func (cook XinputSetDeviceModeCookie) Reply() (*XinputSetDeviceModeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputSetDeviceModeReply(buf), nil +} + +// Read reply into structure from buffer for XinputSetDeviceMode +func xinputSetDeviceModeReply(buf []byte) *XinputSetDeviceModeReply { + v := new(XinputSetDeviceModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputSetDeviceModeCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSetDeviceMode +func (c *Conn) xinputSetDeviceModeRequest(DeviceId byte, Mode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + return buf +} + +// Request XinputSelectExtensionEvent +// size: pad((12 + pad((int(NumClasses) * 4)))) +type XinputSelectExtensionEventCookie struct { + *cookie +} + +// Write request to wire for XinputSelectExtensionEvent +func (c *Conn) XinputSelectExtensionEvent(Window Id, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) + return XinputSelectExtensionEventCookie{cookie} +} + +func (c *Conn) XinputSelectExtensionEventChecked(Window Id, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) + return XinputSelectExtensionEventCookie{cookie} +} + +func (cook XinputSelectExtensionEventCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSelectExtensionEvent +func (c *Conn) xinputSelectExtensionEventRequest(Window Id, NumClasses uint16, Classes []XinputEventClass) []byte { + size := pad((12 + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], NumClasses) + b += 2 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputGetSelectedExtensionEvents +// size: 8 +type XinputGetSelectedExtensionEventsCookie struct { + *cookie +} + +func (c *Conn) XinputGetSelectedExtensionEvents(Window Id) XinputGetSelectedExtensionEventsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) + return XinputGetSelectedExtensionEventsCookie{cookie} +} + +func (c *Conn) XinputGetSelectedExtensionEventsUnchecked(Window Id) XinputGetSelectedExtensionEventsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) + return XinputGetSelectedExtensionEventsCookie{cookie} +} + +// Request reply for XinputGetSelectedExtensionEvents +// size: ((32 + pad((int(NumThisClasses) * 4))) + pad((int(NumAllClasses) * 4))) +type XinputGetSelectedExtensionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumThisClasses uint16 + NumAllClasses uint16 + // padding: 20 bytes + ThisClasses []XinputEventClass // size: pad((int(NumThisClasses) * 4)) + AllClasses []XinputEventClass // size: pad((int(NumAllClasses) * 4)) +} + +// Waits and reads reply data from request XinputGetSelectedExtensionEvents +func (cook XinputGetSelectedExtensionEventsCookie) Reply() (*XinputGetSelectedExtensionEventsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetSelectedExtensionEventsReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetSelectedExtensionEvents +func xinputGetSelectedExtensionEventsReply(buf []byte) *XinputGetSelectedExtensionEventsReply { + v := new(XinputGetSelectedExtensionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumThisClasses = Get16(buf[b:]) + b += 2 + + v.NumAllClasses = Get16(buf[b:]) + b += 2 + + b += 20 // padding + + v.ThisClasses = make([]XinputEventClass, v.NumThisClasses) + for i := 0; i < int(v.NumThisClasses); i++ { + v.ThisClasses[i] = XinputEventClass(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + v.AllClasses = make([]XinputEventClass, v.NumAllClasses) + for i := 0; i < int(v.NumAllClasses); i++ { + v.AllClasses[i] = XinputEventClass(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XinputGetSelectedExtensionEventsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetSelectedExtensionEvents +func (c *Conn) xinputGetSelectedExtensionEventsRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XinputChangeDeviceDontPropagateList +// size: pad((12 + pad((int(NumClasses) * 4)))) +type XinputChangeDeviceDontPropagateListCookie struct { + *cookie +} + +// Write request to wire for XinputChangeDeviceDontPropagateList +func (c *Conn) XinputChangeDeviceDontPropagateList(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) + return XinputChangeDeviceDontPropagateListCookie{cookie} +} + +func (c *Conn) XinputChangeDeviceDontPropagateListChecked(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) + return XinputChangeDeviceDontPropagateListCookie{cookie} +} + +func (cook XinputChangeDeviceDontPropagateListCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputChangeDeviceDontPropagateList +func (c *Conn) xinputChangeDeviceDontPropagateListRequest(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) []byte { + size := pad((12 + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = Mode + b += 1 + + b += 1 // padding + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputGetDeviceDontPropagateList +// size: 8 +type XinputGetDeviceDontPropagateListCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceDontPropagateList(Window Id) XinputGetDeviceDontPropagateListCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) + return XinputGetDeviceDontPropagateListCookie{cookie} +} + +func (c *Conn) XinputGetDeviceDontPropagateListUnchecked(Window Id) XinputGetDeviceDontPropagateListCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) + return XinputGetDeviceDontPropagateListCookie{cookie} +} + +// Request reply for XinputGetDeviceDontPropagateList +// size: (32 + pad((int(NumClasses) * 4))) +type XinputGetDeviceDontPropagateListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses uint16 + // padding: 22 bytes + Classes []XinputEventClass // size: pad((int(NumClasses) * 4)) +} + +// Waits and reads reply data from request XinputGetDeviceDontPropagateList +func (cook XinputGetDeviceDontPropagateListCookie) Reply() (*XinputGetDeviceDontPropagateListReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceDontPropagateListReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceDontPropagateList +func xinputGetDeviceDontPropagateListReply(buf []byte) *XinputGetDeviceDontPropagateListReply { + v := new(XinputGetDeviceDontPropagateListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Classes = make([]XinputEventClass, v.NumClasses) + for i := 0; i < int(v.NumClasses); i++ { + v.Classes[i] = XinputEventClass(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XinputGetDeviceDontPropagateListCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceDontPropagateList +func (c *Conn) xinputGetDeviceDontPropagateListRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XinputGetDeviceMotionEvents +// size: 16 +type XinputGetDeviceMotionEventsCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceMotionEvents(Start Timestamp, Stop Timestamp, DeviceId byte) XinputGetDeviceMotionEventsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceMotionEventsRequest(Start, Stop, DeviceId), cookie) + return XinputGetDeviceMotionEventsCookie{cookie} +} + +func (c *Conn) XinputGetDeviceMotionEventsUnchecked(Start Timestamp, Stop Timestamp, DeviceId byte) XinputGetDeviceMotionEventsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceMotionEventsRequest(Start, Stop, DeviceId), cookie) + return XinputGetDeviceMotionEventsCookie{cookie} +} + +// Request reply for XinputGetDeviceMotionEvents +// size: 32 +type XinputGetDeviceMotionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumCoords uint32 + NumAxes byte + DeviceMode byte + // padding: 18 bytes +} + +// Waits and reads reply data from request XinputGetDeviceMotionEvents +func (cook XinputGetDeviceMotionEventsCookie) Reply() (*XinputGetDeviceMotionEventsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceMotionEventsReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceMotionEvents +func xinputGetDeviceMotionEventsReply(buf []byte) *XinputGetDeviceMotionEventsReply { + v := new(XinputGetDeviceMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumCoords = Get32(buf[b:]) + b += 4 + + v.NumAxes = buf[b] + b += 1 + + v.DeviceMode = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +func (cook XinputGetDeviceMotionEventsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceMotionEvents +func (c *Conn) xinputGetDeviceMotionEventsRequest(Start Timestamp, Stop Timestamp, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Start)) + b += 4 + + Put32(buf[b:], uint32(Stop)) + b += 4 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request XinputChangeKeyboardDevice +// size: 8 +type XinputChangeKeyboardDeviceCookie struct { + *cookie +} + +func (c *Conn) XinputChangeKeyboardDevice(DeviceId byte) XinputChangeKeyboardDeviceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputChangeKeyboardDeviceRequest(DeviceId), cookie) + return XinputChangeKeyboardDeviceCookie{cookie} +} + +func (c *Conn) XinputChangeKeyboardDeviceUnchecked(DeviceId byte) XinputChangeKeyboardDeviceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputChangeKeyboardDeviceRequest(DeviceId), cookie) + return XinputChangeKeyboardDeviceCookie{cookie} +} + +// Request reply for XinputChangeKeyboardDevice +// size: 32 +type XinputChangeKeyboardDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputChangeKeyboardDevice +func (cook XinputChangeKeyboardDeviceCookie) Reply() (*XinputChangeKeyboardDeviceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputChangeKeyboardDeviceReply(buf), nil +} + +// Read reply into structure from buffer for XinputChangeKeyboardDevice +func xinputChangeKeyboardDeviceReply(buf []byte) *XinputChangeKeyboardDeviceReply { + v := new(XinputChangeKeyboardDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputChangeKeyboardDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputChangeKeyboardDevice +func (c *Conn) xinputChangeKeyboardDeviceRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputChangePointerDevice +// size: 8 +type XinputChangePointerDeviceCookie struct { + *cookie +} + +func (c *Conn) XinputChangePointerDevice(XAxis byte, YAxis byte, DeviceId byte) XinputChangePointerDeviceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputChangePointerDeviceRequest(XAxis, YAxis, DeviceId), cookie) + return XinputChangePointerDeviceCookie{cookie} +} + +func (c *Conn) XinputChangePointerDeviceUnchecked(XAxis byte, YAxis byte, DeviceId byte) XinputChangePointerDeviceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputChangePointerDeviceRequest(XAxis, YAxis, DeviceId), cookie) + return XinputChangePointerDeviceCookie{cookie} +} + +// Request reply for XinputChangePointerDevice +// size: 32 +type XinputChangePointerDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputChangePointerDevice +func (cook XinputChangePointerDeviceCookie) Reply() (*XinputChangePointerDeviceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputChangePointerDeviceReply(buf), nil +} + +// Read reply into structure from buffer for XinputChangePointerDevice +func xinputChangePointerDeviceReply(buf []byte) *XinputChangePointerDeviceReply { + v := new(XinputChangePointerDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputChangePointerDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputChangePointerDevice +func (c *Conn) xinputChangePointerDeviceRequest(XAxis byte, YAxis byte, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = XAxis + b += 1 + + buf[b] = YAxis + b += 1 + + buf[b] = DeviceId + b += 1 + + b += 1 // padding + + return buf +} + +// Request XinputGrabDevice +// size: pad((20 + pad((int(NumClasses) * 4)))) +type XinputGrabDeviceCookie struct { + *cookie +} + +func (c *Conn) XinputGrabDevice(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) + return XinputGrabDeviceCookie{cookie} +} + +func (c *Conn) XinputGrabDeviceUnchecked(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) + return XinputGrabDeviceCookie{cookie} +} + +// Request reply for XinputGrabDevice +// size: 32 +type XinputGrabDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputGrabDevice +func (cook XinputGrabDeviceCookie) Reply() (*XinputGrabDeviceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGrabDeviceReply(buf), nil +} + +// Read reply into structure from buffer for XinputGrabDevice +func xinputGrabDeviceReply(buf []byte) *XinputGrabDeviceReply { + v := new(XinputGrabDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputGrabDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGrabDevice +func (c *Conn) xinputGrabDeviceRequest(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) []byte { + size := pad((20 + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = DeviceId + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputUngrabDevice +// size: 12 +type XinputUngrabDeviceCookie struct { + *cookie +} + +// Write request to wire for XinputUngrabDevice +func (c *Conn) XinputUngrabDevice(Time Timestamp, DeviceId byte) XinputUngrabDeviceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputUngrabDeviceRequest(Time, DeviceId), cookie) + return XinputUngrabDeviceCookie{cookie} +} + +func (c *Conn) XinputUngrabDeviceChecked(Time Timestamp, DeviceId byte) XinputUngrabDeviceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputUngrabDeviceRequest(Time, DeviceId), cookie) + return XinputUngrabDeviceCookie{cookie} +} + +func (cook XinputUngrabDeviceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputUngrabDevice +func (c *Conn) xinputUngrabDeviceRequest(Time Timestamp, DeviceId byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request XinputGrabDeviceKey +// size: pad((20 + pad((int(NumClasses) * 4)))) +type XinputGrabDeviceKeyCookie struct { + *cookie +} + +// Write request to wire for XinputGrabDeviceKey +func (c *Conn) XinputGrabDeviceKey(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) + return XinputGrabDeviceKeyCookie{cookie} +} + +func (c *Conn) XinputGrabDeviceKeyChecked(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) + return XinputGrabDeviceKeyCookie{cookie} +} + +func (cook XinputGrabDeviceKeyCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGrabDeviceKey +func (c *Conn) xinputGrabDeviceKeyRequest(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) []byte { + size := pad((20 + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], NumClasses) + b += 2 + + Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + buf[b] = Key + b += 1 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputUngrabDeviceKey +// size: 16 +type XinputUngrabDeviceKeyCookie struct { + *cookie +} + +// Write request to wire for XinputUngrabDeviceKey +func (c *Conn) XinputUngrabDeviceKey(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return XinputUngrabDeviceKeyCookie{cookie} +} + +func (c *Conn) XinputUngrabDeviceKeyChecked(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return XinputUngrabDeviceKeyCookie{cookie} +} + +func (cook XinputUngrabDeviceKeyCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputUngrabDeviceKey +func (c *Conn) xinputUngrabDeviceKeyRequest(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Key + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + return buf +} + +// Request XinputGrabDeviceButton +// size: pad((20 + pad((int(NumClasses) * 4)))) +type XinputGrabDeviceButtonCookie struct { + *cookie +} + +// Write request to wire for XinputGrabDeviceButton +func (c *Conn) XinputGrabDeviceButton(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return XinputGrabDeviceButtonCookie{cookie} +} + +func (c *Conn) XinputGrabDeviceButtonChecked(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return XinputGrabDeviceButtonCookie{cookie} +} + +func (cook XinputGrabDeviceButtonCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGrabDeviceButton +func (c *Conn) xinputGrabDeviceButtonRequest(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) []byte { + size := pad((20 + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + buf[b] = GrabbedDevice + b += 1 + + buf[b] = ModifierDevice + b += 1 + + Put16(buf[b:], NumClasses) + b += 2 + + Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = OwnerEvents + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputUngrabDeviceButton +// size: 16 +type XinputUngrabDeviceButtonCookie struct { + *cookie +} + +// Write request to wire for XinputUngrabDeviceButton +func (c *Conn) XinputUngrabDeviceButton(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return XinputUngrabDeviceButtonCookie{cookie} +} + +func (c *Conn) XinputUngrabDeviceButtonChecked(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return XinputUngrabDeviceButtonCookie{cookie} +} + +func (cook XinputUngrabDeviceButtonCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputUngrabDeviceButton +func (c *Conn) xinputUngrabDeviceButtonRequest(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + return buf +} + +// Request XinputAllowDeviceEvents +// size: 12 +type XinputAllowDeviceEventsCookie struct { + *cookie +} + +// Write request to wire for XinputAllowDeviceEvents +func (c *Conn) XinputAllowDeviceEvents(Time Timestamp, Mode byte, DeviceId byte) XinputAllowDeviceEventsCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputAllowDeviceEventsRequest(Time, Mode, DeviceId), cookie) + return XinputAllowDeviceEventsCookie{cookie} +} + +func (c *Conn) XinputAllowDeviceEventsChecked(Time Timestamp, Mode byte, DeviceId byte) XinputAllowDeviceEventsCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputAllowDeviceEventsRequest(Time, Mode, DeviceId), cookie) + return XinputAllowDeviceEventsCookie{cookie} +} + +func (cook XinputAllowDeviceEventsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputAllowDeviceEvents +func (c *Conn) xinputAllowDeviceEventsRequest(Time Timestamp, Mode byte, DeviceId byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = Mode + b += 1 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request XinputGetDeviceFocus +// size: 8 +type XinputGetDeviceFocusCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceFocus(DeviceId byte) XinputGetDeviceFocusCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceFocusRequest(DeviceId), cookie) + return XinputGetDeviceFocusCookie{cookie} +} + +func (c *Conn) XinputGetDeviceFocusUnchecked(DeviceId byte) XinputGetDeviceFocusCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceFocusRequest(DeviceId), cookie) + return XinputGetDeviceFocusCookie{cookie} +} + +// Request reply for XinputGetDeviceFocus +// size: 32 +type XinputGetDeviceFocusReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Focus Id + Time Timestamp + RevertTo byte + // padding: 15 bytes +} + +// Waits and reads reply data from request XinputGetDeviceFocus +func (cook XinputGetDeviceFocusCookie) Reply() (*XinputGetDeviceFocusReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceFocusReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceFocus +func xinputGetDeviceFocusReply(buf []byte) *XinputGetDeviceFocusReply { + v := new(XinputGetDeviceFocusReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Focus = Id(Get32(buf[b:])) + b += 4 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.RevertTo = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +func (cook XinputGetDeviceFocusCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceFocus +func (c *Conn) xinputGetDeviceFocusRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputSetDeviceFocus +// size: 16 +type XinputSetDeviceFocusCookie struct { + *cookie +} + +// Write request to wire for XinputSetDeviceFocus +func (c *Conn) XinputSetDeviceFocus(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) + return XinputSetDeviceFocusCookie{cookie} +} + +func (c *Conn) XinputSetDeviceFocusChecked(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) + return XinputSetDeviceFocusCookie{cookie} +} + +func (cook XinputSetDeviceFocusCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSetDeviceFocus +func (c *Conn) xinputSetDeviceFocusRequest(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Focus)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = RevertTo + b += 1 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request XinputGetFeedbackControl +// size: 8 +type XinputGetFeedbackControlCookie struct { + *cookie +} + +func (c *Conn) XinputGetFeedbackControl(DeviceId byte) XinputGetFeedbackControlCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetFeedbackControlRequest(DeviceId), cookie) + return XinputGetFeedbackControlCookie{cookie} +} + +func (c *Conn) XinputGetFeedbackControlUnchecked(DeviceId byte) XinputGetFeedbackControlCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetFeedbackControlRequest(DeviceId), cookie) + return XinputGetFeedbackControlCookie{cookie} +} + +// Request reply for XinputGetFeedbackControl +// size: 32 +type XinputGetFeedbackControlReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFeedback uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request XinputGetFeedbackControl +func (cook XinputGetFeedbackControlCookie) Reply() (*XinputGetFeedbackControlReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetFeedbackControlReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetFeedbackControl +func xinputGetFeedbackControlReply(buf []byte) *XinputGetFeedbackControlReply { + v := new(XinputGetFeedbackControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFeedback = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +func (cook XinputGetFeedbackControlCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetFeedbackControl +func (c *Conn) xinputGetFeedbackControlRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputGetDeviceKeyMapping +// size: 8 +type XinputGetDeviceKeyMappingCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceKeyMapping(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) XinputGetDeviceKeyMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceKeyMappingRequest(DeviceId, FirstKeycode, Count), cookie) + return XinputGetDeviceKeyMappingCookie{cookie} +} + +func (c *Conn) XinputGetDeviceKeyMappingUnchecked(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) XinputGetDeviceKeyMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceKeyMappingRequest(DeviceId, FirstKeycode, Count), cookie) + return XinputGetDeviceKeyMappingCookie{cookie} +} + +// Request reply for XinputGetDeviceKeyMapping +// size: (32 + pad((int(Length) * 4))) +type XinputGetDeviceKeyMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + KeysymsPerKeycode byte + // padding: 23 bytes + Keysyms []Keysym // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request XinputGetDeviceKeyMapping +func (cook XinputGetDeviceKeyMappingCookie) Reply() (*XinputGetDeviceKeyMappingReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceKeyMappingReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceKeyMapping +func xinputGetDeviceKeyMappingReply(buf []byte) *XinputGetDeviceKeyMappingReply { + v := new(XinputGetDeviceKeyMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeysymsPerKeycode = buf[b] + b += 1 + + b += 23 // padding + + v.Keysyms = make([]Keysym, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Keysyms[i] = Keysym(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XinputGetDeviceKeyMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceKeyMapping +func (c *Conn) xinputGetDeviceKeyMappingRequest(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return buf +} + +// Request XinputChangeDeviceKeyMapping +// size: pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +type XinputChangeDeviceKeyMappingCookie struct { + *cookie +} + +// Write request to wire for XinputChangeDeviceKeyMapping +func (c *Conn) XinputChangeDeviceKeyMapping(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) XinputChangeDeviceKeyMappingCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputChangeDeviceKeyMappingRequest(DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return XinputChangeDeviceKeyMappingCookie{cookie} +} + +func (c *Conn) XinputChangeDeviceKeyMappingChecked(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) XinputChangeDeviceKeyMappingCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputChangeDeviceKeyMappingRequest(DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return XinputChangeDeviceKeyMappingCookie{cookie} +} + +func (cook XinputChangeDeviceKeyMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputChangeDeviceKeyMapping +func (c *Conn) xinputChangeDeviceKeyMappingRequest(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) []byte { + size := pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = KeysymsPerKeycode + b += 1 + + buf[b] = KeycodeCount + b += 1 + + for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { + Put32(buf[b:], uint32(Keysyms[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputGetDeviceModifierMapping +// size: 8 +type XinputGetDeviceModifierMappingCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceModifierMapping(DeviceId byte) XinputGetDeviceModifierMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceModifierMappingRequest(DeviceId), cookie) + return XinputGetDeviceModifierMappingCookie{cookie} +} + +func (c *Conn) XinputGetDeviceModifierMappingUnchecked(DeviceId byte) XinputGetDeviceModifierMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceModifierMappingRequest(DeviceId), cookie) + return XinputGetDeviceModifierMappingCookie{cookie} +} + +// Request reply for XinputGetDeviceModifierMapping +// size: (32 + pad(((int(KeycodesPerModifier) * 8) * 1))) +type XinputGetDeviceModifierMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + KeycodesPerModifier byte + // padding: 23 bytes + Keymaps []byte // size: pad(((int(KeycodesPerModifier) * 8) * 1)) +} + +// Waits and reads reply data from request XinputGetDeviceModifierMapping +func (cook XinputGetDeviceModifierMappingCookie) Reply() (*XinputGetDeviceModifierMappingReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceModifierMappingReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceModifierMapping +func xinputGetDeviceModifierMappingReply(buf []byte) *XinputGetDeviceModifierMappingReply { + v := new(XinputGetDeviceModifierMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeycodesPerModifier = buf[b] + b += 1 + + b += 23 // padding + + v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) + copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) + b += pad(int((int(v.KeycodesPerModifier) * 8))) + + return v +} + +func (cook XinputGetDeviceModifierMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceModifierMapping +func (c *Conn) xinputGetDeviceModifierMappingRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputSetDeviceModifierMapping +// size: pad((7 + pad(((int(KeycodesPerModifier) * 8) * 1)))) +type XinputSetDeviceModifierMappingCookie struct { + *cookie +} + +func (c *Conn) XinputSetDeviceModifierMapping(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) XinputSetDeviceModifierMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputSetDeviceModifierMappingRequest(DeviceId, KeycodesPerModifier, Keymaps), cookie) + return XinputSetDeviceModifierMappingCookie{cookie} +} + +func (c *Conn) XinputSetDeviceModifierMappingUnchecked(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) XinputSetDeviceModifierMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputSetDeviceModifierMappingRequest(DeviceId, KeycodesPerModifier, Keymaps), cookie) + return XinputSetDeviceModifierMappingCookie{cookie} +} + +// Request reply for XinputSetDeviceModifierMapping +// size: 32 +type XinputSetDeviceModifierMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputSetDeviceModifierMapping +func (cook XinputSetDeviceModifierMappingCookie) Reply() (*XinputSetDeviceModifierMappingReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputSetDeviceModifierMappingReply(buf), nil +} + +// Read reply into structure from buffer for XinputSetDeviceModifierMapping +func xinputSetDeviceModifierMappingReply(buf []byte) *XinputSetDeviceModifierMappingReply { + v := new(XinputSetDeviceModifierMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputSetDeviceModifierMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSetDeviceModifierMapping +func (c *Conn) xinputSetDeviceModifierMappingRequest(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { + size := pad((7 + pad(((int(KeycodesPerModifier) * 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = KeycodesPerModifier + b += 1 + + b += 1 // padding + + copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) + b += pad(int((int(KeycodesPerModifier) * 8))) + + return buf +} + +// Request XinputGetDeviceButtonMapping +// size: 8 +type XinputGetDeviceButtonMappingCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceButtonMapping(DeviceId byte) XinputGetDeviceButtonMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceButtonMappingRequest(DeviceId), cookie) + return XinputGetDeviceButtonMappingCookie{cookie} +} + +func (c *Conn) XinputGetDeviceButtonMappingUnchecked(DeviceId byte) XinputGetDeviceButtonMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceButtonMappingRequest(DeviceId), cookie) + return XinputGetDeviceButtonMappingCookie{cookie} +} + +// Request reply for XinputGetDeviceButtonMapping +// size: (32 + pad((int(MapSize) * 1))) +type XinputGetDeviceButtonMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MapSize byte + // padding: 23 bytes + Map []byte // size: pad((int(MapSize) * 1)) +} + +// Waits and reads reply data from request XinputGetDeviceButtonMapping +func (cook XinputGetDeviceButtonMappingCookie) Reply() (*XinputGetDeviceButtonMappingReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceButtonMappingReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceButtonMapping +func xinputGetDeviceButtonMappingReply(buf []byte) *XinputGetDeviceButtonMappingReply { + v := new(XinputGetDeviceButtonMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MapSize = buf[b] + b += 1 + + b += 23 // padding + + v.Map = make([]byte, v.MapSize) + copy(v.Map[:v.MapSize], buf[b:]) + b += pad(int(v.MapSize)) + + return v +} + +func (cook XinputGetDeviceButtonMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceButtonMapping +func (c *Conn) xinputGetDeviceButtonMappingRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputSetDeviceButtonMapping +// size: pad((8 + pad((int(MapSize) * 1)))) +type XinputSetDeviceButtonMappingCookie struct { + *cookie +} + +func (c *Conn) XinputSetDeviceButtonMapping(DeviceId byte, MapSize byte, Map []byte) XinputSetDeviceButtonMappingCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputSetDeviceButtonMappingRequest(DeviceId, MapSize, Map), cookie) + return XinputSetDeviceButtonMappingCookie{cookie} +} + +func (c *Conn) XinputSetDeviceButtonMappingUnchecked(DeviceId byte, MapSize byte, Map []byte) XinputSetDeviceButtonMappingCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputSetDeviceButtonMappingRequest(DeviceId, MapSize, Map), cookie) + return XinputSetDeviceButtonMappingCookie{cookie} +} + +// Request reply for XinputSetDeviceButtonMapping +// size: 32 +type XinputSetDeviceButtonMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputSetDeviceButtonMapping +func (cook XinputSetDeviceButtonMappingCookie) Reply() (*XinputSetDeviceButtonMappingReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputSetDeviceButtonMappingReply(buf), nil +} + +// Read reply into structure from buffer for XinputSetDeviceButtonMapping +func xinputSetDeviceButtonMappingReply(buf []byte) *XinputSetDeviceButtonMappingReply { + v := new(XinputSetDeviceButtonMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputSetDeviceButtonMappingCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSetDeviceButtonMapping +func (c *Conn) xinputSetDeviceButtonMappingRequest(DeviceId byte, MapSize byte, Map []byte) []byte { + size := pad((8 + pad((int(MapSize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = MapSize + b += 1 + + b += 2 // padding + + copy(buf[b:], Map[:MapSize]) + b += pad(int(MapSize)) + + return buf +} + +// Request XinputQueryDeviceState +// size: 8 +type XinputQueryDeviceStateCookie struct { + *cookie +} + +func (c *Conn) XinputQueryDeviceState(DeviceId byte) XinputQueryDeviceStateCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputQueryDeviceStateRequest(DeviceId), cookie) + return XinputQueryDeviceStateCookie{cookie} +} + +func (c *Conn) XinputQueryDeviceStateUnchecked(DeviceId byte) XinputQueryDeviceStateCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputQueryDeviceStateRequest(DeviceId), cookie) + return XinputQueryDeviceStateCookie{cookie} +} + +// Request reply for XinputQueryDeviceState +// size: 32 +type XinputQueryDeviceStateReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputQueryDeviceState +func (cook XinputQueryDeviceStateCookie) Reply() (*XinputQueryDeviceStateReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputQueryDeviceStateReply(buf), nil +} + +// Read reply into structure from buffer for XinputQueryDeviceState +func xinputQueryDeviceStateReply(buf []byte) *XinputQueryDeviceStateReply { + v := new(XinputQueryDeviceStateReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputQueryDeviceStateCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputQueryDeviceState +func (c *Conn) xinputQueryDeviceStateRequest(DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request XinputSendExtensionEvent +// size: pad(((16 + pad(((int(NumEvents) * 32) * 1))) + pad((int(NumClasses) * 4)))) +type XinputSendExtensionEventCookie struct { + *cookie +} + +// Write request to wire for XinputSendExtensionEvent +func (c *Conn) XinputSendExtensionEvent(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return XinputSendExtensionEventCookie{cookie} +} + +func (c *Conn) XinputSendExtensionEventChecked(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return XinputSendExtensionEventCookie{cookie} +} + +func (cook XinputSendExtensionEventCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSendExtensionEvent +func (c *Conn) xinputSendExtensionEventRequest(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) []byte { + size := pad(((16 + pad(((int(NumEvents) * 32) * 1))) + pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Destination)) + b += 4 + + buf[b] = DeviceId + b += 1 + + if Propagate { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = NumEvents + b += 1 + + b += 3 // padding + + copy(buf[b:], Events[:(int(NumEvents)*32)]) + b += pad(int((int(NumEvents) * 32))) + + for i := 0; i < int(NumClasses); i++ { + Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputDeviceBell +// size: 8 +type XinputDeviceBellCookie struct { + *cookie +} + +// Write request to wire for XinputDeviceBell +func (c *Conn) XinputDeviceBell(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) XinputDeviceBellCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xinputDeviceBellRequest(DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return XinputDeviceBellCookie{cookie} +} + +func (c *Conn) XinputDeviceBellChecked(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) XinputDeviceBellCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xinputDeviceBellRequest(DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return XinputDeviceBellCookie{cookie} +} + +func (cook XinputDeviceBellCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputDeviceBell +func (c *Conn) xinputDeviceBellRequest(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = FeedbackId + b += 1 + + buf[b] = FeedbackClass + b += 1 + + buf[b] = byte(Percent) + b += 1 + + return buf +} + +// Request XinputSetDeviceValuators +// size: pad((8 + pad((int(NumValuators) * 4)))) +type XinputSetDeviceValuatorsCookie struct { + *cookie +} + +func (c *Conn) XinputSetDeviceValuators(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) XinputSetDeviceValuatorsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputSetDeviceValuatorsRequest(DeviceId, FirstValuator, NumValuators, Valuators), cookie) + return XinputSetDeviceValuatorsCookie{cookie} +} + +func (c *Conn) XinputSetDeviceValuatorsUnchecked(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) XinputSetDeviceValuatorsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputSetDeviceValuatorsRequest(DeviceId, FirstValuator, NumValuators, Valuators), cookie) + return XinputSetDeviceValuatorsCookie{cookie} +} + +// Request reply for XinputSetDeviceValuators +// size: 32 +type XinputSetDeviceValuatorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputSetDeviceValuators +func (cook XinputSetDeviceValuatorsCookie) Reply() (*XinputSetDeviceValuatorsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputSetDeviceValuatorsReply(buf), nil +} + +// Read reply into structure from buffer for XinputSetDeviceValuators +func xinputSetDeviceValuatorsReply(buf []byte) *XinputSetDeviceValuatorsReply { + v := new(XinputSetDeviceValuatorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputSetDeviceValuatorsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputSetDeviceValuators +func (c *Conn) xinputSetDeviceValuatorsRequest(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { + size := pad((8 + pad((int(NumValuators) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = FirstValuator + b += 1 + + buf[b] = NumValuators + b += 1 + + b += 1 // padding + + for i := 0; i < int(NumValuators); i++ { + Put32(buf[b:], uint32(Valuators[i])) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XinputGetDeviceControl +// size: 8 +type XinputGetDeviceControlCookie struct { + *cookie +} + +func (c *Conn) XinputGetDeviceControl(ControlId uint16, DeviceId byte) XinputGetDeviceControlCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xinputGetDeviceControlRequest(ControlId, DeviceId), cookie) + return XinputGetDeviceControlCookie{cookie} +} + +func (c *Conn) XinputGetDeviceControlUnchecked(ControlId uint16, DeviceId byte) XinputGetDeviceControlCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xinputGetDeviceControlRequest(ControlId, DeviceId), cookie) + return XinputGetDeviceControlCookie{cookie} +} + +// Request reply for XinputGetDeviceControl +// size: 32 +type XinputGetDeviceControlReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request XinputGetDeviceControl +func (cook XinputGetDeviceControlCookie) Reply() (*XinputGetDeviceControlReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xinputGetDeviceControlReply(buf), nil +} + +// Read reply into structure from buffer for XinputGetDeviceControl +func xinputGetDeviceControlReply(buf []byte) *XinputGetDeviceControlReply { + v := new(XinputGetDeviceControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +func (cook XinputGetDeviceControlCookie) Check() error { + return cook.check() +} + +// Write request to wire for XinputGetDeviceControl +func (c *Conn) xinputGetDeviceControlRequest(ControlId uint16, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put16(buf[b:], ControlId) + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 1 // padding + + return buf +} diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go new file mode 100644 index 0000000..6790a86 --- /dev/null +++ b/nexgb/auto_xprint.go @@ -0,0 +1,2176 @@ +package xgb + +/* + This file was generated by xprint.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +const ( + XprintGetDocFinished = 0 + XprintGetDocSecondConsumer = 1 +) + +const ( + XprintEvMaskNoEventMask = 0 + XprintEvMaskPrintMask = 1 + XprintEvMaskAttributeMask = 2 +) + +const ( + XprintDetailStartJobNotify = 1 + XprintDetailEndJobNotify = 2 + XprintDetailStartDocNotify = 3 + XprintDetailEndDocNotify = 4 + XprintDetailStartPageNotify = 5 + XprintDetailEndPageNotify = 6 +) + +const ( + XprintAttrJobAttr = 1 + XprintAttrDocAttr = 2 + XprintAttrPageAttr = 3 + XprintAttrPrinterAttr = 4 + XprintAttrServerAttr = 5 + XprintAttrMediumAttr = 6 + XprintAttrSpoolerAttr = 7 +) + +// Skipping resource definition of 'Pcontext' + +type XprintString8 byte + +// 'XprintPrinter' struct definition +// Size: (((4 + pad((int(NameLen) * 1))) + 4) + pad((int(DescLen) * 1))) +type XprintPrinter struct { + NameLen uint32 + Name []XprintString8 // size: pad((int(NameLen) * 1)) + DescLen uint32 + Description []XprintString8 // size: pad((int(DescLen) * 1)) +} + +// Struct read XprintPrinter +func ReadXprintPrinter(buf []byte, v *XprintPrinter) int { + b := 0 + + v.NameLen = Get32(buf[b:]) + b += 4 + + v.Name = make([]XprintString8, v.NameLen) + for i := 0; i < int(v.NameLen); i++ { + v.Name[i] = XprintString8(buf[b]) + b += 1 + } + b = pad(b) + + v.DescLen = Get32(buf[b:]) + b += 4 + + v.Description = make([]XprintString8, v.DescLen) + for i := 0; i < int(v.DescLen); i++ { + v.Description[i] = XprintString8(buf[b]) + b += 1 + } + b = pad(b) + + return b +} + +// Struct list read XprintPrinter +func ReadXprintPrinterList(buf []byte, dest []XprintPrinter) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XprintPrinter{} + b += ReadXprintPrinter(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XprintPrinter +func (v XprintPrinter) Bytes() []byte { + buf := make([]byte, (((4 + pad((int(v.NameLen) * 1))) + 4) + pad((int(v.DescLen) * 1)))) + b := 0 + + Put32(buf[b:], v.NameLen) + b += 4 + + for i := 0; i < int(v.NameLen); i++ { + buf[b] = byte(v.Name[i]) + b += 1 + } + b = pad(b) + + Put32(buf[b:], v.DescLen) + b += 4 + + for i := 0; i < int(v.DescLen); i++ { + buf[b] = byte(v.Description[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Write struct list XprintPrinter +func XprintPrinterListBytes(buf []byte, list []XprintPrinter) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XprintPrinter +func XprintPrinterListSize(list []XprintPrinter) int { + size := 0 + for _, item := range list { + size += (((4 + pad((int(item.NameLen) * 1))) + 4) + pad((int(item.DescLen) * 1))) + } + return size +} + +// Event definition XprintNotify (0) +// Size: 32 + +const XprintNotify = 0 + +type XprintNotifyEvent struct { + Sequence uint16 + Detail byte + Context Id + Cancel bool +} + +// Event read XprintNotify +func NewXprintNotifyEvent(buf []byte) Event { + v := XprintNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Context = Id(Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.Cancel = true + } else { + v.Cancel = false + } + b += 1 + + return v +} + +// Event write XprintNotify +func (v XprintNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Context)) + b += 4 + + if v.Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +func (v XprintNotifyEvent) ImplementsEvent() {} + +func (v XprintNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XprintNotifyEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Context: %d", v.Context)) + fieldVals = append(fieldVals, sprintf("Cancel: %t", v.Cancel)) + return "XprintNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewXprintNotifyEvent +} + +// Event definition XprintAttributNotify (1) +// Size: 32 + +const XprintAttributNotify = 1 + +type XprintAttributNotifyEvent struct { + Sequence uint16 + Detail byte + Context Id +} + +// Event read XprintAttributNotify +func NewXprintAttributNotifyEvent(buf []byte) Event { + v := XprintAttributNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Context = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write XprintAttributNotify +func (v XprintAttributNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Context)) + b += 4 + + return buf +} + +func (v XprintAttributNotifyEvent) ImplementsEvent() {} + +func (v XprintAttributNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XprintAttributNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, sprintf("Context: %d", v.Context)) + return "XprintAttributNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewXprintAttributNotifyEvent +} + +// Error definition XprintBadContext (0) +// Size: 32 + +const BadXprintBadContext = 0 + +type XprintBadContextError struct { + Sequence uint16 + NiceName string +} + +// Error read XprintBadContext +func NewXprintBadContextError(buf []byte) Error { + v := XprintBadContextError{} + v.NiceName = "XprintBadContext" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XprintBadContextError) ImplementsError() {} + +func (err XprintBadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err XprintBadContextError) BadId() Id { + return 0 +} + +func (err XprintBadContextError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXprintBadContext {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewXprintBadContextError +} + +// Error definition XprintBadSequence (1) +// Size: 32 + +const BadXprintBadSequence = 1 + +type XprintBadSequenceError struct { + Sequence uint16 + NiceName string +} + +// Error read XprintBadSequence +func NewXprintBadSequenceError(buf []byte) Error { + v := XprintBadSequenceError{} + v.NiceName = "XprintBadSequence" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XprintBadSequenceError) ImplementsError() {} + +func (err XprintBadSequenceError) SequenceId() uint16 { + return err.Sequence +} + +func (err XprintBadSequenceError) BadId() Id { + return 0 +} + +func (err XprintBadSequenceError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXprintBadSequence {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewXprintBadSequenceError +} + +// Request XprintPrintQueryVersion +// size: 4 +type XprintPrintQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XprintPrintQueryVersion() XprintPrintQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintQueryVersionRequest(), cookie) + return XprintPrintQueryVersionCookie{cookie} +} + +func (c *Conn) XprintPrintQueryVersionUnchecked() XprintPrintQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintQueryVersionRequest(), cookie) + return XprintPrintQueryVersionCookie{cookie} +} + +// Request reply for XprintPrintQueryVersion +// size: 12 +type XprintPrintQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request XprintPrintQueryVersion +func (cook XprintPrintQueryVersionCookie) Reply() (*XprintPrintQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintQueryVersion +func xprintPrintQueryVersionReply(buf []byte) *XprintPrintQueryVersionReply { + v := new(XprintPrintQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = Get16(buf[b:]) + b += 2 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XprintPrintQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintQueryVersion +func (c *Conn) xprintPrintQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XprintPrintGetPrinterList +// size: pad(((12 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) +type XprintPrintGetPrinterListCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetPrinterList(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintPrintGetPrinterListCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetPrinterListRequest(PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return XprintPrintGetPrinterListCookie{cookie} +} + +func (c *Conn) XprintPrintGetPrinterListUnchecked(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintPrintGetPrinterListCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetPrinterListRequest(PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return XprintPrintGetPrinterListCookie{cookie} +} + +// Request reply for XprintPrintGetPrinterList +// size: (32 + XprintPrinterListSize(Printers)) +type XprintPrintGetPrinterListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ListCount uint32 + // padding: 20 bytes + Printers []XprintPrinter // size: XprintPrinterListSize(Printers) +} + +// Waits and reads reply data from request XprintPrintGetPrinterList +func (cook XprintPrintGetPrinterListCookie) Reply() (*XprintPrintGetPrinterListReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetPrinterListReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetPrinterList +func xprintPrintGetPrinterListReply(buf []byte) *XprintPrintGetPrinterListReply { + v := new(XprintPrintGetPrinterListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ListCount = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Printers = make([]XprintPrinter, v.ListCount) + b += ReadXprintPrinterList(buf[b:], v.Printers) + + return v +} + +func (cook XprintPrintGetPrinterListCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetPrinterList +func (c *Conn) xprintPrintGetPrinterListRequest(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) []byte { + size := pad(((12 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], PrinterNameLen) + b += 4 + + Put32(buf[b:], LocaleLen) + b += 4 + + for i := 0; i < int(PrinterNameLen); i++ { + buf[b] = byte(PrinterName[i]) + b += 1 + } + b = pad(b) + + for i := 0; i < int(LocaleLen); i++ { + buf[b] = byte(Locale[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Request XprintPrintRehashPrinterList +// size: 4 +type XprintPrintRehashPrinterListCookie struct { + *cookie +} + +// Write request to wire for XprintPrintRehashPrinterList +func (c *Conn) XprintPrintRehashPrinterList() XprintPrintRehashPrinterListCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintRehashPrinterListRequest(), cookie) + return XprintPrintRehashPrinterListCookie{cookie} +} + +func (c *Conn) XprintPrintRehashPrinterListChecked() XprintPrintRehashPrinterListCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintRehashPrinterListRequest(), cookie) + return XprintPrintRehashPrinterListCookie{cookie} +} + +func (cook XprintPrintRehashPrinterListCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintRehashPrinterList +func (c *Conn) xprintPrintRehashPrinterListRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XprintCreateContext +// size: pad(((16 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) +type XprintCreateContextCookie struct { + *cookie +} + +// Write request to wire for XprintCreateContext +func (c *Conn) XprintCreateContext(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintCreateContextRequest(ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return XprintCreateContextCookie{cookie} +} + +func (c *Conn) XprintCreateContextChecked(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintCreateContextRequest(ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return XprintCreateContextCookie{cookie} +} + +func (cook XprintCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintCreateContext +func (c *Conn) xprintCreateContextRequest(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) []byte { + size := pad(((16 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextId) + b += 4 + + Put32(buf[b:], PrinterNameLen) + b += 4 + + Put32(buf[b:], LocaleLen) + b += 4 + + for i := 0; i < int(PrinterNameLen); i++ { + buf[b] = byte(PrinterName[i]) + b += 1 + } + b = pad(b) + + for i := 0; i < int(LocaleLen); i++ { + buf[b] = byte(Locale[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Request XprintPrintSetContext +// size: 8 +type XprintPrintSetContextCookie struct { + *cookie +} + +// Write request to wire for XprintPrintSetContext +func (c *Conn) XprintPrintSetContext(Context uint32) XprintPrintSetContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintSetContextRequest(Context), cookie) + return XprintPrintSetContextCookie{cookie} +} + +func (c *Conn) XprintPrintSetContextChecked(Context uint32) XprintPrintSetContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintSetContextRequest(Context), cookie) + return XprintPrintSetContextCookie{cookie} +} + +func (cook XprintPrintSetContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintSetContext +func (c *Conn) xprintPrintSetContextRequest(Context uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request XprintPrintGetContext +// size: 4 +type XprintPrintGetContextCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetContext() XprintPrintGetContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetContextRequest(), cookie) + return XprintPrintGetContextCookie{cookie} +} + +func (c *Conn) XprintPrintGetContextUnchecked() XprintPrintGetContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetContextRequest(), cookie) + return XprintPrintGetContextCookie{cookie} +} + +// Request reply for XprintPrintGetContext +// size: 12 +type XprintPrintGetContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Context uint32 +} + +// Waits and reads reply data from request XprintPrintGetContext +func (cook XprintPrintGetContextCookie) Reply() (*XprintPrintGetContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetContextReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetContext +func xprintPrintGetContextReply(buf []byte) *XprintPrintGetContextReply { + v := new(XprintPrintGetContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Context = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook XprintPrintGetContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetContext +func (c *Conn) xprintPrintGetContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XprintPrintDestroyContext +// size: 8 +type XprintPrintDestroyContextCookie struct { + *cookie +} + +// Write request to wire for XprintPrintDestroyContext +func (c *Conn) XprintPrintDestroyContext(Context uint32) XprintPrintDestroyContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintDestroyContextRequest(Context), cookie) + return XprintPrintDestroyContextCookie{cookie} +} + +func (c *Conn) XprintPrintDestroyContextChecked(Context uint32) XprintPrintDestroyContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintDestroyContextRequest(Context), cookie) + return XprintPrintDestroyContextCookie{cookie} +} + +func (cook XprintPrintDestroyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintDestroyContext +func (c *Conn) xprintPrintDestroyContextRequest(Context uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request XprintPrintGetScreenOfContext +// size: 4 +type XprintPrintGetScreenOfContextCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetScreenOfContext() XprintPrintGetScreenOfContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetScreenOfContextRequest(), cookie) + return XprintPrintGetScreenOfContextCookie{cookie} +} + +func (c *Conn) XprintPrintGetScreenOfContextUnchecked() XprintPrintGetScreenOfContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetScreenOfContextRequest(), cookie) + return XprintPrintGetScreenOfContextCookie{cookie} +} + +// Request reply for XprintPrintGetScreenOfContext +// size: 12 +type XprintPrintGetScreenOfContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Root Id +} + +// Waits and reads reply data from request XprintPrintGetScreenOfContext +func (cook XprintPrintGetScreenOfContextCookie) Reply() (*XprintPrintGetScreenOfContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetScreenOfContextReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetScreenOfContext +func xprintPrintGetScreenOfContextReply(buf []byte) *XprintPrintGetScreenOfContextReply { + v := new(XprintPrintGetScreenOfContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Id(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook XprintPrintGetScreenOfContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetScreenOfContext +func (c *Conn) xprintPrintGetScreenOfContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XprintPrintStartJob +// size: 8 +type XprintPrintStartJobCookie struct { + *cookie +} + +// Write request to wire for XprintPrintStartJob +func (c *Conn) XprintPrintStartJob(OutputMode byte) XprintPrintStartJobCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintStartJobRequest(OutputMode), cookie) + return XprintPrintStartJobCookie{cookie} +} + +func (c *Conn) XprintPrintStartJobChecked(OutputMode byte) XprintPrintStartJobCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintStartJobRequest(OutputMode), cookie) + return XprintPrintStartJobCookie{cookie} +} + +func (cook XprintPrintStartJobCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintStartJob +func (c *Conn) xprintPrintStartJobRequest(OutputMode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = OutputMode + b += 1 + + return buf +} + +// Request XprintPrintEndJob +// size: 8 +type XprintPrintEndJobCookie struct { + *cookie +} + +// Write request to wire for XprintPrintEndJob +func (c *Conn) XprintPrintEndJob(Cancel bool) XprintPrintEndJobCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintEndJobRequest(Cancel), cookie) + return XprintPrintEndJobCookie{cookie} +} + +func (c *Conn) XprintPrintEndJobChecked(Cancel bool) XprintPrintEndJobCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintEndJobRequest(Cancel), cookie) + return XprintPrintEndJobCookie{cookie} +} + +func (cook XprintPrintEndJobCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintEndJob +func (c *Conn) xprintPrintEndJobRequest(Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request XprintPrintStartDoc +// size: 8 +type XprintPrintStartDocCookie struct { + *cookie +} + +// Write request to wire for XprintPrintStartDoc +func (c *Conn) XprintPrintStartDoc(DriverMode byte) XprintPrintStartDocCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintStartDocRequest(DriverMode), cookie) + return XprintPrintStartDocCookie{cookie} +} + +func (c *Conn) XprintPrintStartDocChecked(DriverMode byte) XprintPrintStartDocCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintStartDocRequest(DriverMode), cookie) + return XprintPrintStartDocCookie{cookie} +} + +func (cook XprintPrintStartDocCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintStartDoc +func (c *Conn) xprintPrintStartDocRequest(DriverMode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DriverMode + b += 1 + + return buf +} + +// Request XprintPrintEndDoc +// size: 8 +type XprintPrintEndDocCookie struct { + *cookie +} + +// Write request to wire for XprintPrintEndDoc +func (c *Conn) XprintPrintEndDoc(Cancel bool) XprintPrintEndDocCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintEndDocRequest(Cancel), cookie) + return XprintPrintEndDocCookie{cookie} +} + +func (c *Conn) XprintPrintEndDocChecked(Cancel bool) XprintPrintEndDocCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintEndDocRequest(Cancel), cookie) + return XprintPrintEndDocCookie{cookie} +} + +func (cook XprintPrintEndDocCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintEndDoc +func (c *Conn) xprintPrintEndDocRequest(Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request XprintPrintPutDocumentData +// size: pad((((16 + pad((int(LenData) * 1))) + pad((len(DocFormat) * 1))) + pad((len(Options) * 1)))) +type XprintPrintPutDocumentDataCookie struct { + *cookie +} + +// Write request to wire for XprintPrintPutDocumentData +func (c *Conn) XprintPrintPutDocumentData(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return XprintPrintPutDocumentDataCookie{cookie} +} + +func (c *Conn) XprintPrintPutDocumentDataChecked(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return XprintPrintPutDocumentDataCookie{cookie} +} + +func (cook XprintPrintPutDocumentDataCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintPutDocumentData +func (c *Conn) xprintPrintPutDocumentDataRequest(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) []byte { + size := pad((((16 + pad((int(LenData) * 1))) + pad((len(DocFormat) * 1))) + pad((len(Options) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], LenData) + b += 4 + + Put16(buf[b:], LenFmt) + b += 2 + + Put16(buf[b:], LenOptions) + b += 2 + + copy(buf[b:], Data[:LenData]) + b += pad(int(LenData)) + + for i := 0; i < int(len(DocFormat)); i++ { + buf[b] = byte(DocFormat[i]) + b += 1 + } + b = pad(b) + + for i := 0; i < int(len(Options)); i++ { + buf[b] = byte(Options[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Request XprintPrintGetDocumentData +// size: 12 +type XprintPrintGetDocumentDataCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetDocumentData(Context Id, MaxBytes uint32) XprintPrintGetDocumentDataCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) + return XprintPrintGetDocumentDataCookie{cookie} +} + +func (c *Conn) XprintPrintGetDocumentDataUnchecked(Context Id, MaxBytes uint32) XprintPrintGetDocumentDataCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) + return XprintPrintGetDocumentDataCookie{cookie} +} + +// Request reply for XprintPrintGetDocumentData +// size: (32 + pad((int(DataLen) * 1))) +type XprintPrintGetDocumentDataReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StatusCode uint32 + FinishedFlag uint32 + DataLen uint32 + // padding: 12 bytes + Data []byte // size: pad((int(DataLen) * 1)) +} + +// Waits and reads reply data from request XprintPrintGetDocumentData +func (cook XprintPrintGetDocumentDataCookie) Reply() (*XprintPrintGetDocumentDataReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetDocumentDataReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetDocumentData +func xprintPrintGetDocumentDataReply(buf []byte) *XprintPrintGetDocumentDataReply { + v := new(XprintPrintGetDocumentDataReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.StatusCode = Get32(buf[b:]) + b += 4 + + v.FinishedFlag = Get32(buf[b:]) + b += 4 + + v.DataLen = Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, v.DataLen) + copy(v.Data[:v.DataLen], buf[b:]) + b += pad(int(v.DataLen)) + + return v +} + +func (cook XprintPrintGetDocumentDataCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetDocumentData +func (c *Conn) xprintPrintGetDocumentDataRequest(Context Id, MaxBytes uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], MaxBytes) + b += 4 + + return buf +} + +// Request XprintPrintStartPage +// size: 8 +type XprintPrintStartPageCookie struct { + *cookie +} + +// Write request to wire for XprintPrintStartPage +func (c *Conn) XprintPrintStartPage(Window Id) XprintPrintStartPageCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) + return XprintPrintStartPageCookie{cookie} +} + +func (c *Conn) XprintPrintStartPageChecked(Window Id) XprintPrintStartPageCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) + return XprintPrintStartPageCookie{cookie} +} + +func (cook XprintPrintStartPageCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintStartPage +func (c *Conn) xprintPrintStartPageRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XprintPrintEndPage +// size: 8 +type XprintPrintEndPageCookie struct { + *cookie +} + +// Write request to wire for XprintPrintEndPage +func (c *Conn) XprintPrintEndPage(Cancel bool) XprintPrintEndPageCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintEndPageRequest(Cancel), cookie) + return XprintPrintEndPageCookie{cookie} +} + +func (c *Conn) XprintPrintEndPageChecked(Cancel bool) XprintPrintEndPageCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintEndPageRequest(Cancel), cookie) + return XprintPrintEndPageCookie{cookie} +} + +func (cook XprintPrintEndPageCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintEndPage +func (c *Conn) xprintPrintEndPageRequest(Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request XprintPrintSelectInput +// size: pad((8 + (4 + pad((4 * popCount(int(EventMask))))))) +type XprintPrintSelectInputCookie struct { + *cookie +} + +// Write request to wire for XprintPrintSelectInput +func (c *Conn) XprintPrintSelectInput(Context Id, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) + return XprintPrintSelectInputCookie{cookie} +} + +func (c *Conn) XprintPrintSelectInputChecked(Context Id, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) + return XprintPrintSelectInputCookie{cookie} +} + +func (cook XprintPrintSelectInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintSelectInput +func (c *Conn) xprintPrintSelectInputRequest(Context Id, EventMask uint32, EventList []uint32) []byte { + size := pad((8 + (4 + pad((4 * popCount(int(EventMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], EventMask) + b += 4 + for i := 0; i < popCount(int(EventMask)); i++ { + Put32(buf[b:], EventList[i]) + b += 4 + } + b = pad(b) + + return buf +} + +// Request XprintPrintInputSelected +// size: 8 +type XprintPrintInputSelectedCookie struct { + *cookie +} + +func (c *Conn) XprintPrintInputSelected(Context Id) XprintPrintInputSelectedCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) + return XprintPrintInputSelectedCookie{cookie} +} + +func (c *Conn) XprintPrintInputSelectedUnchecked(Context Id) XprintPrintInputSelectedCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) + return XprintPrintInputSelectedCookie{cookie} +} + +// Request reply for XprintPrintInputSelected +// size: ((8 + (4 + pad((4 * popCount(int(EventMask)))))) + (4 + pad((4 * popCount(int(AllEventsMask)))))) +type XprintPrintInputSelectedReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + EventMask uint32 + EventList []uint32 + AllEventsMask uint32 + AllEventsList []uint32 +} + +// Waits and reads reply data from request XprintPrintInputSelected +func (cook XprintPrintInputSelectedCookie) Reply() (*XprintPrintInputSelectedReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintInputSelectedReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintInputSelected +func xprintPrintInputSelectedReply(buf []byte) *XprintPrintInputSelectedReply { + v := new(XprintPrintInputSelectedReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventMask = Get32(buf[b:]) + b += 4 + + v.EventList = make([]uint32, popCount(int(v.EventMask))) + for i := 0; i < popCount(int(v.EventMask)); i++ { + v.EventList[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.AllEventsMask = Get32(buf[b:]) + b += 4 + + v.AllEventsList = make([]uint32, popCount(int(v.AllEventsMask))) + for i := 0; i < popCount(int(v.AllEventsMask)); i++ { + v.AllEventsList[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XprintPrintInputSelectedCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintInputSelected +func (c *Conn) xprintPrintInputSelectedRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request XprintPrintGetAttributes +// size: 12 +type XprintPrintGetAttributesCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetAttributes(Context Id, Pool byte) XprintPrintGetAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) + return XprintPrintGetAttributesCookie{cookie} +} + +func (c *Conn) XprintPrintGetAttributesUnchecked(Context Id, Pool byte) XprintPrintGetAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) + return XprintPrintGetAttributesCookie{cookie} +} + +// Request reply for XprintPrintGetAttributes +// size: 33 +type XprintPrintGetAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StringLen uint32 + // padding: 20 bytes + Attributes XprintString8 +} + +// Waits and reads reply data from request XprintPrintGetAttributes +func (cook XprintPrintGetAttributesCookie) Reply() (*XprintPrintGetAttributesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetAttributesReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetAttributes +func xprintPrintGetAttributesReply(buf []byte) *XprintPrintGetAttributesReply { + v := new(XprintPrintGetAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.StringLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attributes = XprintString8(buf[b]) + b += 1 + + return v +} + +func (cook XprintPrintGetAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetAttributes +func (c *Conn) xprintPrintGetAttributesRequest(Context Id, Pool byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = Pool + b += 1 + + b += 3 // padding + + return buf +} + +// Request XprintPrintGetOneAttributes +// size: pad((16 + pad((int(NameLen) * 1)))) +type XprintPrintGetOneAttributesCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetOneAttributes(Context Id, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) + return XprintPrintGetOneAttributesCookie{cookie} +} + +func (c *Conn) XprintPrintGetOneAttributesUnchecked(Context Id, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) + return XprintPrintGetOneAttributesCookie{cookie} +} + +// Request reply for XprintPrintGetOneAttributes +// size: (32 + pad((int(ValueLen) * 1))) +type XprintPrintGetOneAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ValueLen uint32 + // padding: 20 bytes + Value []XprintString8 // size: pad((int(ValueLen) * 1)) +} + +// Waits and reads reply data from request XprintPrintGetOneAttributes +func (cook XprintPrintGetOneAttributesCookie) Reply() (*XprintPrintGetOneAttributesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetOneAttributesReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetOneAttributes +func xprintPrintGetOneAttributesReply(buf []byte) *XprintPrintGetOneAttributesReply { + v := new(XprintPrintGetOneAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ValueLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Value = make([]XprintString8, v.ValueLen) + for i := 0; i < int(v.ValueLen); i++ { + v.Value[i] = XprintString8(buf[b]) + b += 1 + } + b = pad(b) + + return v +} + +func (cook XprintPrintGetOneAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetOneAttributes +func (c *Conn) xprintPrintGetOneAttributesRequest(Context Id, NameLen uint32, Pool byte, Name []XprintString8) []byte { + size := pad((16 + pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], NameLen) + b += 4 + + buf[b] = Pool + b += 1 + + b += 3 // padding + + for i := 0; i < int(NameLen); i++ { + buf[b] = byte(Name[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Request XprintPrintSetAttributes +// size: pad((16 + pad((len(Attributes) * 1)))) +type XprintPrintSetAttributesCookie struct { + *cookie +} + +// Write request to wire for XprintPrintSetAttributes +func (c *Conn) XprintPrintSetAttributes(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) + return XprintPrintSetAttributesCookie{cookie} +} + +func (c *Conn) XprintPrintSetAttributesChecked(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) + return XprintPrintSetAttributesCookie{cookie} +} + +func (cook XprintPrintSetAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintSetAttributes +func (c *Conn) xprintPrintSetAttributesRequest(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) []byte { + size := pad((16 + pad((len(Attributes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], StringLen) + b += 4 + + buf[b] = Pool + b += 1 + + buf[b] = Rule + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Attributes)); i++ { + buf[b] = byte(Attributes[i]) + b += 1 + } + b = pad(b) + + return buf +} + +// Request XprintPrintGetPageDimensions +// size: 8 +type XprintPrintGetPageDimensionsCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetPageDimensions(Context Id) XprintPrintGetPageDimensionsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) + return XprintPrintGetPageDimensionsCookie{cookie} +} + +func (c *Conn) XprintPrintGetPageDimensionsUnchecked(Context Id) XprintPrintGetPageDimensionsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) + return XprintPrintGetPageDimensionsCookie{cookie} +} + +// Request reply for XprintPrintGetPageDimensions +// size: 20 +type XprintPrintGetPageDimensionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint16 + Height uint16 + OffsetX uint16 + OffsetY uint16 + ReproducibleWidth uint16 + ReproducibleHeight uint16 +} + +// Waits and reads reply data from request XprintPrintGetPageDimensions +func (cook XprintPrintGetPageDimensionsCookie) Reply() (*XprintPrintGetPageDimensionsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetPageDimensionsReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetPageDimensions +func xprintPrintGetPageDimensionsReply(buf []byte) *XprintPrintGetPageDimensionsReply { + v := new(XprintPrintGetPageDimensionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.OffsetX = Get16(buf[b:]) + b += 2 + + v.OffsetY = Get16(buf[b:]) + b += 2 + + v.ReproducibleWidth = Get16(buf[b:]) + b += 2 + + v.ReproducibleHeight = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XprintPrintGetPageDimensionsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetPageDimensions +func (c *Conn) xprintPrintGetPageDimensionsRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request XprintPrintQueryScreens +// size: 4 +type XprintPrintQueryScreensCookie struct { + *cookie +} + +func (c *Conn) XprintPrintQueryScreens() XprintPrintQueryScreensCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintQueryScreensRequest(), cookie) + return XprintPrintQueryScreensCookie{cookie} +} + +func (c *Conn) XprintPrintQueryScreensUnchecked() XprintPrintQueryScreensCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintQueryScreensRequest(), cookie) + return XprintPrintQueryScreensCookie{cookie} +} + +// Request reply for XprintPrintQueryScreens +// size: (32 + pad((int(ListCount) * 4))) +type XprintPrintQueryScreensReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ListCount uint32 + // padding: 20 bytes + Roots []Id // size: pad((int(ListCount) * 4)) +} + +// Waits and reads reply data from request XprintPrintQueryScreens +func (cook XprintPrintQueryScreensCookie) Reply() (*XprintPrintQueryScreensReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintQueryScreensReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintQueryScreens +func xprintPrintQueryScreensReply(buf []byte) *XprintPrintQueryScreensReply { + v := new(XprintPrintQueryScreensReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ListCount = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Roots = make([]Id, v.ListCount) + for i := 0; i < int(v.ListCount); i++ { + v.Roots[i] = Id(Get32(buf[b:])) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XprintPrintQueryScreensCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintQueryScreens +func (c *Conn) xprintPrintQueryScreensRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XprintPrintSetImageResolution +// size: 12 +type XprintPrintSetImageResolutionCookie struct { + *cookie +} + +func (c *Conn) XprintPrintSetImageResolution(Context Id, ImageResolution uint16) XprintPrintSetImageResolutionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) + return XprintPrintSetImageResolutionCookie{cookie} +} + +func (c *Conn) XprintPrintSetImageResolutionUnchecked(Context Id, ImageResolution uint16) XprintPrintSetImageResolutionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) + return XprintPrintSetImageResolutionCookie{cookie} +} + +// Request reply for XprintPrintSetImageResolution +// size: 10 +type XprintPrintSetImageResolutionReply struct { + Sequence uint16 + Length uint32 + Status bool + PreviousResolutions uint16 +} + +// Waits and reads reply data from request XprintPrintSetImageResolution +func (cook XprintPrintSetImageResolutionCookie) Reply() (*XprintPrintSetImageResolutionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintSetImageResolutionReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintSetImageResolution +func xprintPrintSetImageResolutionReply(buf []byte) *XprintPrintSetImageResolutionReply { + v := new(XprintPrintSetImageResolutionReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Status = true + } else { + v.Status = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PreviousResolutions = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XprintPrintSetImageResolutionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintSetImageResolution +func (c *Conn) xprintPrintSetImageResolutionRequest(Context Id, ImageResolution uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put16(buf[b:], ImageResolution) + b += 2 + + return buf +} + +// Request XprintPrintGetImageResolution +// size: 8 +type XprintPrintGetImageResolutionCookie struct { + *cookie +} + +func (c *Conn) XprintPrintGetImageResolution(Context Id) XprintPrintGetImageResolutionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) + return XprintPrintGetImageResolutionCookie{cookie} +} + +func (c *Conn) XprintPrintGetImageResolutionUnchecked(Context Id) XprintPrintGetImageResolutionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) + return XprintPrintGetImageResolutionCookie{cookie} +} + +// Request reply for XprintPrintGetImageResolution +// size: 10 +type XprintPrintGetImageResolutionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ImageResolution uint16 +} + +// Waits and reads reply data from request XprintPrintGetImageResolution +func (cook XprintPrintGetImageResolutionCookie) Reply() (*XprintPrintGetImageResolutionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xprintPrintGetImageResolutionReply(buf), nil +} + +// Read reply into structure from buffer for XprintPrintGetImageResolution +func xprintPrintGetImageResolutionReply(buf []byte) *XprintPrintGetImageResolutionReply { + v := new(XprintPrintGetImageResolutionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ImageResolution = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XprintPrintGetImageResolutionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XprintPrintGetImageResolution +func (c *Conn) xprintPrintGetImageResolutionRequest(Context Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XPEXTENSION"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index 32fa6dd..edee988 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,10 +1,12 @@ package xgb /* - This file was generated by xproto.xml on May 5 2012 5:43:45pm EDT. + This file was generated by xproto.xml on May 6 2012 3:00:45am EDT. This file is automatically generated. Edit at your peril! */ +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -29,8 +31,6 @@ package xgb // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -2417,15 +2417,15 @@ func HostListSize(list []Host) int { // NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion // NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion type ClientMessageDataUnion struct { - Data8 []byte // size: pad(20) - Data16 []uint16 // size: pad(20) - Data32 []uint32 // size: pad(20) + Data8 []byte // size: 20 + Data16 []uint16 // size: 20 + Data32 []uint32 // size: 20 } // Union constructor for ClientMessageDataUnion for field Data8. func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion { var b int - buf := make([]byte, pad(20)) + buf := make([]byte, 20) copy(buf[b:], Data8[:20]) b += pad(int(20)) @@ -2462,7 +2462,7 @@ func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion { // Union constructor for ClientMessageDataUnion for field Data16. func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion { var b int - buf := make([]byte, pad(20)) + buf := make([]byte, 20) for i := 0; i < int(10); i++ { Put16(buf[b:], Data16[i]) @@ -2502,7 +2502,7 @@ func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion { // Union constructor for ClientMessageDataUnion for field Data32. func NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion { var b int - buf := make([]byte, pad(20)) + buf := make([]byte, 20) for i := 0; i < int(5); i++ { Put32(buf[b:], Data32[i]) @@ -2564,7 +2564,7 @@ func ReadClientMessageDataUnion(buf []byte, v *ClientMessageDataUnion) int { } b = pad(b) - return pad(20) + return 20 } // Union list read ClientMessageDataUnion @@ -2581,7 +2581,7 @@ func ReadClientMessageDataUnionList(buf []byte, dest []ClientMessageDataUnion) i // Each field in a union must contain the same data. // So simply pick the first field and write that to the wire. func (v ClientMessageDataUnion) Bytes() []byte { - buf := make([]byte, pad(20)) + buf := make([]byte, 20) b := 0 copy(buf[b:], v.Data8[:20]) @@ -3285,7 +3285,7 @@ func init() { const KeymapNotify = 11 type KeymapNotifyEvent struct { - Keys []byte // size: pad(31) + Keys []byte // size: 32 } // Event read KeymapNotify @@ -7938,7 +7938,7 @@ func (c *Conn) convertSelectionRequest(Requestor Id, Selection Id, Target Id, Pr } // Request SendEvent -// size: pad((12 + pad(32))) +// size: 44 type SendEventCookie struct { *cookie } @@ -7962,7 +7962,7 @@ func (cook SendEventCookie) Check() error { // Write request to wire for SendEvent func (c *Conn) sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte { - size := pad((12 + pad(32))) + size := 44 b := 0 buf := make([]byte, size) @@ -9200,12 +9200,12 @@ func (c *Conn) QueryKeymapUnchecked() QueryKeymapCookie { } // Request reply for QueryKeymap -// size: (8 + pad(32)) +// size: 40 type QueryKeymapReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Keys []byte // size: pad(32) + Keys []byte // size: 32 } // Waits and reads reply data from request QueryKeymap @@ -13267,7 +13267,7 @@ func (c *Conn) GetKeyboardControlUnchecked() GetKeyboardControlCookie { } // Request reply for GetKeyboardControl -// size: (20 + pad(32)) +// size: 52 type GetKeyboardControlReply struct { Sequence uint16 Length uint32 @@ -13278,7 +13278,7 @@ type GetKeyboardControlReply struct { BellPitch uint16 BellDuration uint16 // padding: 2 bytes - AutoRepeats []byte // size: pad(32) + AutoRepeats []byte // size: 32 } // Waits and reads reply data from request GetKeyboardControl diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go new file mode 100644 index 0000000..57908c2 --- /dev/null +++ b/nexgb/auto_xselinux.go @@ -0,0 +1,1939 @@ +package xgb + +/* + This file was generated by xselinux.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// 'XselinuxListItem' struct definition +// Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) +type XselinuxListItem struct { + Name Id + ObjectContextLen uint32 + DataContextLen uint32 + ObjectContext string // size: pad((int(ObjectContextLen) * 1)) + DataContext string // size: pad((int(DataContextLen) * 1)) +} + +// Struct read XselinuxListItem +func ReadXselinuxListItem(buf []byte, v *XselinuxListItem) int { + b := 0 + + v.Name = Id(Get32(buf[b:])) + b += 4 + + v.ObjectContextLen = Get32(buf[b:]) + b += 4 + + v.DataContextLen = Get32(buf[b:]) + b += 4 + + { + byteString := make([]byte, v.ObjectContextLen) + copy(byteString[:v.ObjectContextLen], buf[b:]) + v.ObjectContext = string(byteString) + b += pad(int(v.ObjectContextLen)) + } + + { + byteString := make([]byte, v.DataContextLen) + copy(byteString[:v.DataContextLen], buf[b:]) + v.DataContext = string(byteString) + b += pad(int(v.DataContextLen)) + } + + return b +} + +// Struct list read XselinuxListItem +func ReadXselinuxListItemList(buf []byte, dest []XselinuxListItem) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XselinuxListItem{} + b += ReadXselinuxListItem(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XselinuxListItem +func (v XselinuxListItem) Bytes() []byte { + buf := make([]byte, ((12 + pad((int(v.ObjectContextLen) * 1))) + pad((int(v.DataContextLen) * 1)))) + b := 0 + + Put32(buf[b:], uint32(v.Name)) + b += 4 + + Put32(buf[b:], v.ObjectContextLen) + b += 4 + + Put32(buf[b:], v.DataContextLen) + b += 4 + + copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) + b += pad(int(v.ObjectContextLen)) + + copy(buf[b:], v.DataContext[:v.DataContextLen]) + b += pad(int(v.DataContextLen)) + + return buf +} + +// Write struct list XselinuxListItem +func XselinuxListItemListBytes(buf []byte, list []XselinuxListItem) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XselinuxListItem +func XselinuxListItemListSize(list []XselinuxListItem) int { + size := 0 + for _, item := range list { + size += ((12 + pad((int(item.ObjectContextLen) * 1))) + pad((int(item.DataContextLen) * 1))) + } + return size +} + +// Request XselinuxQueryVersion +// size: 8 +type XselinuxQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XselinuxQueryVersion(ClientMajor byte, ClientMinor byte) XselinuxQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxQueryVersionRequest(ClientMajor, ClientMinor), cookie) + return XselinuxQueryVersionCookie{cookie} +} + +func (c *Conn) XselinuxQueryVersionUnchecked(ClientMajor byte, ClientMinor byte) XselinuxQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxQueryVersionRequest(ClientMajor, ClientMinor), cookie) + return XselinuxQueryVersionCookie{cookie} +} + +// Request reply for XselinuxQueryVersion +// size: 12 +type XselinuxQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 +} + +// Waits and reads reply data from request XselinuxQueryVersion +func (cook XselinuxQueryVersionCookie) Reply() (*XselinuxQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxQueryVersion +func xselinuxQueryVersionReply(buf []byte) *XselinuxQueryVersionReply { + v := new(XselinuxQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = Get16(buf[b:]) + b += 2 + + v.ServerMinor = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XselinuxQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxQueryVersion +func (c *Conn) xselinuxQueryVersionRequest(ClientMajor byte, ClientMinor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 + + return buf +} + +// Request XselinuxSetDeviceCreateContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetDeviceCreateContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetDeviceCreateContext +func (c *Conn) XselinuxSetDeviceCreateContext(ContextLen uint32, Context string) XselinuxSetDeviceCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetDeviceCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetDeviceCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxSetDeviceCreateContextChecked(ContextLen uint32, Context string) XselinuxSetDeviceCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetDeviceCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetDeviceCreateContextCookie{cookie} +} + +func (cook XselinuxSetDeviceCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetDeviceCreateContext +func (c *Conn) xselinuxSetDeviceCreateContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetDeviceCreateContext +// size: 4 +type XselinuxGetDeviceCreateContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetDeviceCreateContext() XselinuxGetDeviceCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetDeviceCreateContextRequest(), cookie) + return XselinuxGetDeviceCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxGetDeviceCreateContextUnchecked() XselinuxGetDeviceCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetDeviceCreateContextRequest(), cookie) + return XselinuxGetDeviceCreateContextCookie{cookie} +} + +// Request reply for XselinuxGetDeviceCreateContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetDeviceCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetDeviceCreateContext +func (cook XselinuxGetDeviceCreateContextCookie) Reply() (*XselinuxGetDeviceCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetDeviceCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetDeviceCreateContext +func xselinuxGetDeviceCreateContextReply(buf []byte) *XselinuxGetDeviceCreateContextReply { + v := new(XselinuxGetDeviceCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetDeviceCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetDeviceCreateContext +func (c *Conn) xselinuxGetDeviceCreateContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxSetDeviceContext +// size: pad((12 + pad((int(ContextLen) * 1)))) +type XselinuxSetDeviceContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetDeviceContext +func (c *Conn) XselinuxSetDeviceContext(Device uint32, ContextLen uint32, Context string) XselinuxSetDeviceContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetDeviceContextRequest(Device, ContextLen, Context), cookie) + return XselinuxSetDeviceContextCookie{cookie} +} + +func (c *Conn) XselinuxSetDeviceContextChecked(Device uint32, ContextLen uint32, Context string) XselinuxSetDeviceContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetDeviceContextRequest(Device, ContextLen, Context), cookie) + return XselinuxSetDeviceContextCookie{cookie} +} + +func (cook XselinuxSetDeviceContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetDeviceContext +func (c *Conn) xselinuxSetDeviceContextRequest(Device uint32, ContextLen uint32, Context string) []byte { + size := pad((12 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Device) + b += 4 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetDeviceContext +// size: 8 +type XselinuxGetDeviceContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetDeviceContext(Device uint32) XselinuxGetDeviceContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetDeviceContextRequest(Device), cookie) + return XselinuxGetDeviceContextCookie{cookie} +} + +func (c *Conn) XselinuxGetDeviceContextUnchecked(Device uint32) XselinuxGetDeviceContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetDeviceContextRequest(Device), cookie) + return XselinuxGetDeviceContextCookie{cookie} +} + +// Request reply for XselinuxGetDeviceContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetDeviceContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetDeviceContext +func (cook XselinuxGetDeviceContextCookie) Reply() (*XselinuxGetDeviceContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetDeviceContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetDeviceContext +func xselinuxGetDeviceContextReply(buf []byte) *XselinuxGetDeviceContextReply { + v := new(XselinuxGetDeviceContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetDeviceContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetDeviceContext +func (c *Conn) xselinuxGetDeviceContextRequest(Device uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Device) + b += 4 + + return buf +} + +// Request XselinuxSetWindowCreateContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetWindowCreateContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetWindowCreateContext +func (c *Conn) XselinuxSetWindowCreateContext(ContextLen uint32, Context string) XselinuxSetWindowCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetWindowCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetWindowCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxSetWindowCreateContextChecked(ContextLen uint32, Context string) XselinuxSetWindowCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetWindowCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetWindowCreateContextCookie{cookie} +} + +func (cook XselinuxSetWindowCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetWindowCreateContext +func (c *Conn) xselinuxSetWindowCreateContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetWindowCreateContext +// size: 4 +type XselinuxGetWindowCreateContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetWindowCreateContext() XselinuxGetWindowCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetWindowCreateContextRequest(), cookie) + return XselinuxGetWindowCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxGetWindowCreateContextUnchecked() XselinuxGetWindowCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetWindowCreateContextRequest(), cookie) + return XselinuxGetWindowCreateContextCookie{cookie} +} + +// Request reply for XselinuxGetWindowCreateContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetWindowCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetWindowCreateContext +func (cook XselinuxGetWindowCreateContextCookie) Reply() (*XselinuxGetWindowCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetWindowCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetWindowCreateContext +func xselinuxGetWindowCreateContextReply(buf []byte) *XselinuxGetWindowCreateContextReply { + v := new(XselinuxGetWindowCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetWindowCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetWindowCreateContext +func (c *Conn) xselinuxGetWindowCreateContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxGetWindowContext +// size: 8 +type XselinuxGetWindowContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetWindowContext(Window Id) XselinuxGetWindowContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) + return XselinuxGetWindowContextCookie{cookie} +} + +func (c *Conn) XselinuxGetWindowContextUnchecked(Window Id) XselinuxGetWindowContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) + return XselinuxGetWindowContextCookie{cookie} +} + +// Request reply for XselinuxGetWindowContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetWindowContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetWindowContext +func (cook XselinuxGetWindowContextCookie) Reply() (*XselinuxGetWindowContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetWindowContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetWindowContext +func xselinuxGetWindowContextReply(buf []byte) *XselinuxGetWindowContextReply { + v := new(XselinuxGetWindowContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetWindowContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetWindowContext +func (c *Conn) xselinuxGetWindowContextRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XselinuxSetPropertyCreateContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetPropertyCreateContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetPropertyCreateContext +func (c *Conn) XselinuxSetPropertyCreateContext(ContextLen uint32, Context string) XselinuxSetPropertyCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetPropertyCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetPropertyCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxSetPropertyCreateContextChecked(ContextLen uint32, Context string) XselinuxSetPropertyCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetPropertyCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetPropertyCreateContextCookie{cookie} +} + +func (cook XselinuxSetPropertyCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetPropertyCreateContext +func (c *Conn) xselinuxSetPropertyCreateContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetPropertyCreateContext +// size: 4 +type XselinuxGetPropertyCreateContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetPropertyCreateContext() XselinuxGetPropertyCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetPropertyCreateContextRequest(), cookie) + return XselinuxGetPropertyCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxGetPropertyCreateContextUnchecked() XselinuxGetPropertyCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetPropertyCreateContextRequest(), cookie) + return XselinuxGetPropertyCreateContextCookie{cookie} +} + +// Request reply for XselinuxGetPropertyCreateContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetPropertyCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetPropertyCreateContext +func (cook XselinuxGetPropertyCreateContextCookie) Reply() (*XselinuxGetPropertyCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetPropertyCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetPropertyCreateContext +func xselinuxGetPropertyCreateContextReply(buf []byte) *XselinuxGetPropertyCreateContextReply { + v := new(XselinuxGetPropertyCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetPropertyCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetPropertyCreateContext +func (c *Conn) xselinuxGetPropertyCreateContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxSetPropertyUseContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetPropertyUseContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetPropertyUseContext +func (c *Conn) XselinuxSetPropertyUseContext(ContextLen uint32, Context string) XselinuxSetPropertyUseContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetPropertyUseContextRequest(ContextLen, Context), cookie) + return XselinuxSetPropertyUseContextCookie{cookie} +} + +func (c *Conn) XselinuxSetPropertyUseContextChecked(ContextLen uint32, Context string) XselinuxSetPropertyUseContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetPropertyUseContextRequest(ContextLen, Context), cookie) + return XselinuxSetPropertyUseContextCookie{cookie} +} + +func (cook XselinuxSetPropertyUseContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetPropertyUseContext +func (c *Conn) xselinuxSetPropertyUseContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetPropertyUseContext +// size: 4 +type XselinuxGetPropertyUseContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetPropertyUseContext() XselinuxGetPropertyUseContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetPropertyUseContextRequest(), cookie) + return XselinuxGetPropertyUseContextCookie{cookie} +} + +func (c *Conn) XselinuxGetPropertyUseContextUnchecked() XselinuxGetPropertyUseContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetPropertyUseContextRequest(), cookie) + return XselinuxGetPropertyUseContextCookie{cookie} +} + +// Request reply for XselinuxGetPropertyUseContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetPropertyUseContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetPropertyUseContext +func (cook XselinuxGetPropertyUseContextCookie) Reply() (*XselinuxGetPropertyUseContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetPropertyUseContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetPropertyUseContext +func xselinuxGetPropertyUseContextReply(buf []byte) *XselinuxGetPropertyUseContextReply { + v := new(XselinuxGetPropertyUseContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetPropertyUseContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetPropertyUseContext +func (c *Conn) xselinuxGetPropertyUseContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxGetPropertyContext +// size: 12 +type XselinuxGetPropertyContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetPropertyContext(Window Id, Property Id) XselinuxGetPropertyContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) + return XselinuxGetPropertyContextCookie{cookie} +} + +func (c *Conn) XselinuxGetPropertyContextUnchecked(Window Id, Property Id) XselinuxGetPropertyContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) + return XselinuxGetPropertyContextCookie{cookie} +} + +// Request reply for XselinuxGetPropertyContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetPropertyContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetPropertyContext +func (cook XselinuxGetPropertyContextCookie) Reply() (*XselinuxGetPropertyContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetPropertyContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetPropertyContext +func xselinuxGetPropertyContextReply(buf []byte) *XselinuxGetPropertyContextReply { + v := new(XselinuxGetPropertyContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetPropertyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetPropertyContext +func (c *Conn) xselinuxGetPropertyContextRequest(Window Id, Property Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request XselinuxGetPropertyDataContext +// size: 12 +type XselinuxGetPropertyDataContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetPropertyDataContext(Window Id, Property Id) XselinuxGetPropertyDataContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) + return XselinuxGetPropertyDataContextCookie{cookie} +} + +func (c *Conn) XselinuxGetPropertyDataContextUnchecked(Window Id, Property Id) XselinuxGetPropertyDataContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) + return XselinuxGetPropertyDataContextCookie{cookie} +} + +// Request reply for XselinuxGetPropertyDataContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetPropertyDataContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetPropertyDataContext +func (cook XselinuxGetPropertyDataContextCookie) Reply() (*XselinuxGetPropertyDataContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetPropertyDataContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetPropertyDataContext +func xselinuxGetPropertyDataContextReply(buf []byte) *XselinuxGetPropertyDataContextReply { + v := new(XselinuxGetPropertyDataContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetPropertyDataContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetPropertyDataContext +func (c *Conn) xselinuxGetPropertyDataContextRequest(Window Id, Property Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request XselinuxListProperties +// size: 8 +type XselinuxListPropertiesCookie struct { + *cookie +} + +func (c *Conn) XselinuxListProperties(Window Id) XselinuxListPropertiesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) + return XselinuxListPropertiesCookie{cookie} +} + +func (c *Conn) XselinuxListPropertiesUnchecked(Window Id) XselinuxListPropertiesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) + return XselinuxListPropertiesCookie{cookie} +} + +// Request reply for XselinuxListProperties +// size: (32 + XselinuxListItemListSize(Properties)) +type XselinuxListPropertiesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PropertiesLen uint32 + // padding: 20 bytes + Properties []XselinuxListItem // size: XselinuxListItemListSize(Properties) +} + +// Waits and reads reply data from request XselinuxListProperties +func (cook XselinuxListPropertiesCookie) Reply() (*XselinuxListPropertiesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxListPropertiesReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxListProperties +func xselinuxListPropertiesReply(buf []byte) *XselinuxListPropertiesReply { + v := new(XselinuxListPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.PropertiesLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Properties = make([]XselinuxListItem, v.PropertiesLen) + b += ReadXselinuxListItemList(buf[b:], v.Properties) + + return v +} + +func (cook XselinuxListPropertiesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxListProperties +func (c *Conn) xselinuxListPropertiesRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XselinuxSetSelectionCreateContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetSelectionCreateContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetSelectionCreateContext +func (c *Conn) XselinuxSetSelectionCreateContext(ContextLen uint32, Context string) XselinuxSetSelectionCreateContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetSelectionCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetSelectionCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxSetSelectionCreateContextChecked(ContextLen uint32, Context string) XselinuxSetSelectionCreateContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetSelectionCreateContextRequest(ContextLen, Context), cookie) + return XselinuxSetSelectionCreateContextCookie{cookie} +} + +func (cook XselinuxSetSelectionCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetSelectionCreateContext +func (c *Conn) xselinuxSetSelectionCreateContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetSelectionCreateContext +// size: 4 +type XselinuxGetSelectionCreateContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetSelectionCreateContext() XselinuxGetSelectionCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetSelectionCreateContextRequest(), cookie) + return XselinuxGetSelectionCreateContextCookie{cookie} +} + +func (c *Conn) XselinuxGetSelectionCreateContextUnchecked() XselinuxGetSelectionCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetSelectionCreateContextRequest(), cookie) + return XselinuxGetSelectionCreateContextCookie{cookie} +} + +// Request reply for XselinuxGetSelectionCreateContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetSelectionCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetSelectionCreateContext +func (cook XselinuxGetSelectionCreateContextCookie) Reply() (*XselinuxGetSelectionCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetSelectionCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetSelectionCreateContext +func xselinuxGetSelectionCreateContextReply(buf []byte) *XselinuxGetSelectionCreateContextReply { + v := new(XselinuxGetSelectionCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetSelectionCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetSelectionCreateContext +func (c *Conn) xselinuxGetSelectionCreateContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxSetSelectionUseContext +// size: pad((8 + pad((int(ContextLen) * 1)))) +type XselinuxSetSelectionUseContextCookie struct { + *cookie +} + +// Write request to wire for XselinuxSetSelectionUseContext +func (c *Conn) XselinuxSetSelectionUseContext(ContextLen uint32, Context string) XselinuxSetSelectionUseContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xselinuxSetSelectionUseContextRequest(ContextLen, Context), cookie) + return XselinuxSetSelectionUseContextCookie{cookie} +} + +func (c *Conn) XselinuxSetSelectionUseContextChecked(ContextLen uint32, Context string) XselinuxSetSelectionUseContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xselinuxSetSelectionUseContextRequest(ContextLen, Context), cookie) + return XselinuxSetSelectionUseContextCookie{cookie} +} + +func (cook XselinuxSetSelectionUseContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxSetSelectionUseContext +func (c *Conn) xselinuxSetSelectionUseContextRequest(ContextLen uint32, Context string) []byte { + size := pad((8 + pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += pad(int(ContextLen)) + + return buf +} + +// Request XselinuxGetSelectionUseContext +// size: 4 +type XselinuxGetSelectionUseContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetSelectionUseContext() XselinuxGetSelectionUseContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetSelectionUseContextRequest(), cookie) + return XselinuxGetSelectionUseContextCookie{cookie} +} + +func (c *Conn) XselinuxGetSelectionUseContextUnchecked() XselinuxGetSelectionUseContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetSelectionUseContextRequest(), cookie) + return XselinuxGetSelectionUseContextCookie{cookie} +} + +// Request reply for XselinuxGetSelectionUseContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetSelectionUseContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetSelectionUseContext +func (cook XselinuxGetSelectionUseContextCookie) Reply() (*XselinuxGetSelectionUseContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetSelectionUseContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetSelectionUseContext +func xselinuxGetSelectionUseContextReply(buf []byte) *XselinuxGetSelectionUseContextReply { + v := new(XselinuxGetSelectionUseContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetSelectionUseContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetSelectionUseContext +func (c *Conn) xselinuxGetSelectionUseContextRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxGetSelectionContext +// size: 8 +type XselinuxGetSelectionContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetSelectionContext(Selection Id) XselinuxGetSelectionContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) + return XselinuxGetSelectionContextCookie{cookie} +} + +func (c *Conn) XselinuxGetSelectionContextUnchecked(Selection Id) XselinuxGetSelectionContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) + return XselinuxGetSelectionContextCookie{cookie} +} + +// Request reply for XselinuxGetSelectionContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetSelectionContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetSelectionContext +func (cook XselinuxGetSelectionContextCookie) Reply() (*XselinuxGetSelectionContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetSelectionContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetSelectionContext +func xselinuxGetSelectionContextReply(buf []byte) *XselinuxGetSelectionContextReply { + v := new(XselinuxGetSelectionContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetSelectionContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetSelectionContext +func (c *Conn) xselinuxGetSelectionContextRequest(Selection Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + return buf +} + +// Request XselinuxGetSelectionDataContext +// size: 8 +type XselinuxGetSelectionDataContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetSelectionDataContext(Selection Id) XselinuxGetSelectionDataContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) + return XselinuxGetSelectionDataContextCookie{cookie} +} + +func (c *Conn) XselinuxGetSelectionDataContextUnchecked(Selection Id) XselinuxGetSelectionDataContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) + return XselinuxGetSelectionDataContextCookie{cookie} +} + +// Request reply for XselinuxGetSelectionDataContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetSelectionDataContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetSelectionDataContext +func (cook XselinuxGetSelectionDataContextCookie) Reply() (*XselinuxGetSelectionDataContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetSelectionDataContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetSelectionDataContext +func xselinuxGetSelectionDataContextReply(buf []byte) *XselinuxGetSelectionDataContextReply { + v := new(XselinuxGetSelectionDataContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetSelectionDataContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetSelectionDataContext +func (c *Conn) xselinuxGetSelectionDataContextRequest(Selection Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Selection)) + b += 4 + + return buf +} + +// Request XselinuxListSelections +// size: 4 +type XselinuxListSelectionsCookie struct { + *cookie +} + +func (c *Conn) XselinuxListSelections() XselinuxListSelectionsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxListSelectionsRequest(), cookie) + return XselinuxListSelectionsCookie{cookie} +} + +func (c *Conn) XselinuxListSelectionsUnchecked() XselinuxListSelectionsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxListSelectionsRequest(), cookie) + return XselinuxListSelectionsCookie{cookie} +} + +// Request reply for XselinuxListSelections +// size: (32 + XselinuxListItemListSize(Selections)) +type XselinuxListSelectionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SelectionsLen uint32 + // padding: 20 bytes + Selections []XselinuxListItem // size: XselinuxListItemListSize(Selections) +} + +// Waits and reads reply data from request XselinuxListSelections +func (cook XselinuxListSelectionsCookie) Reply() (*XselinuxListSelectionsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxListSelectionsReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxListSelections +func xselinuxListSelectionsReply(buf []byte) *XselinuxListSelectionsReply { + v := new(XselinuxListSelectionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.SelectionsLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Selections = make([]XselinuxListItem, v.SelectionsLen) + b += ReadXselinuxListItemList(buf[b:], v.Selections) + + return v +} + +func (cook XselinuxListSelectionsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxListSelections +func (c *Conn) xselinuxListSelectionsRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XselinuxGetClientContext +// size: 8 +type XselinuxGetClientContextCookie struct { + *cookie +} + +func (c *Conn) XselinuxGetClientContext(Resource uint32) XselinuxGetClientContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xselinuxGetClientContextRequest(Resource), cookie) + return XselinuxGetClientContextCookie{cookie} +} + +func (c *Conn) XselinuxGetClientContextUnchecked(Resource uint32) XselinuxGetClientContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xselinuxGetClientContextRequest(Resource), cookie) + return XselinuxGetClientContextCookie{cookie} +} + +// Request reply for XselinuxGetClientContext +// size: (32 + pad((int(ContextLen) * 1))) +type XselinuxGetClientContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request XselinuxGetClientContext +func (cook XselinuxGetClientContextCookie) Reply() (*XselinuxGetClientContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xselinuxGetClientContextReply(buf), nil +} + +// Read reply into structure from buffer for XselinuxGetClientContext +func xselinuxGetClientContextReply(buf []byte) *XselinuxGetClientContextReply { + v := new(XselinuxGetClientContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += pad(int(v.ContextLen)) + } + + return v +} + +func (cook XselinuxGetClientContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XselinuxGetClientContext +func (c *Conn) xselinuxGetClientContextRequest(Resource uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["SELINUX"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], Resource) + b += 4 + + return buf +} diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go new file mode 100644 index 0000000..3c4ce7c --- /dev/null +++ b/nexgb/auto_xtest.go @@ -0,0 +1,335 @@ +package xgb + +/* + This file was generated by xtest.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +const ( + XtestCursorNone = 0 + XtestCursorCurrent = 1 +) + +// Request XtestGetVersion +// size: 8 +type XtestGetVersionCookie struct { + *cookie +} + +func (c *Conn) XtestGetVersion(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie) + return XtestGetVersionCookie{cookie} +} + +func (c *Conn) XtestGetVersionUnchecked(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie) + return XtestGetVersionCookie{cookie} +} + +// Request reply for XtestGetVersion +// size: 10 +type XtestGetVersionReply struct { + Sequence uint16 + Length uint32 + MajorVersion byte + MinorVersion uint16 +} + +// Waits and reads reply data from request XtestGetVersion +func (cook XtestGetVersionCookie) Reply() (*XtestGetVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xtestGetVersionReply(buf), nil +} + +// Read reply into structure from buffer for XtestGetVersion +func xtestGetVersionReply(buf []byte) *XtestGetVersionReply { + v := new(XtestGetVersionReply) + b := 1 // skip reply determinant + + v.MajorVersion = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinorVersion = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XtestGetVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XtestGetVersion +func (c *Conn) xtestGetVersionRequest(MajorVersion byte, MinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XTEST"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = MajorVersion + b += 1 + + b += 1 // padding + + Put16(buf[b:], MinorVersion) + b += 2 + + return buf +} + +// Request XtestCompareCursor +// size: 12 +type XtestCompareCursorCookie struct { + *cookie +} + +func (c *Conn) XtestCompareCursor(Window Id, Cursor Id) XtestCompareCursorCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) + return XtestCompareCursorCookie{cookie} +} + +func (c *Conn) XtestCompareCursorUnchecked(Window Id, Cursor Id) XtestCompareCursorCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) + return XtestCompareCursorCookie{cookie} +} + +// Request reply for XtestCompareCursor +// size: 8 +type XtestCompareCursorReply struct { + Sequence uint16 + Length uint32 + Same bool +} + +// Waits and reads reply data from request XtestCompareCursor +func (cook XtestCompareCursorCookie) Reply() (*XtestCompareCursorReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xtestCompareCursorReply(buf), nil +} + +// Read reply into structure from buffer for XtestCompareCursor +func xtestCompareCursorReply(buf []byte) *XtestCompareCursorReply { + v := new(XtestCompareCursorReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Same = true + } else { + v.Same = false + } + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +func (cook XtestCompareCursorCookie) Check() error { + return cook.check() +} + +// Write request to wire for XtestCompareCursor +func (c *Conn) xtestCompareCursorRequest(Window Id, Cursor Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XTEST"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + Put32(buf[b:], uint32(Cursor)) + b += 4 + + return buf +} + +// Request XtestFakeInput +// size: 36 +type XtestFakeInputCookie struct { + *cookie +} + +// Write request to wire for XtestFakeInput +func (c *Conn) XtestFakeInput(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) + return XtestFakeInputCookie{cookie} +} + +func (c *Conn) XtestFakeInputChecked(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) + return XtestFakeInputCookie{cookie} +} + +func (cook XtestFakeInputCookie) Check() error { + return cook.check() +} + +// Write request to wire for XtestFakeInput +func (c *Conn) xtestFakeInputRequest(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XTEST"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Type + b += 1 + + buf[b] = Detail + b += 1 + + b += 2 // padding + + Put32(buf[b:], Time) + b += 4 + + Put32(buf[b:], uint32(Root)) + b += 4 + + b += 8 // padding + + Put16(buf[b:], uint16(RootX)) + b += 2 + + Put16(buf[b:], uint16(RootY)) + b += 2 + + b += 7 // padding + + buf[b] = Deviceid + b += 1 + + return buf +} + +// Request XtestGrabControl +// size: 8 +type XtestGrabControlCookie struct { + *cookie +} + +// Write request to wire for XtestGrabControl +func (c *Conn) XtestGrabControl(Impervious bool) XtestGrabControlCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xtestGrabControlRequest(Impervious), cookie) + return XtestGrabControlCookie{cookie} +} + +func (c *Conn) XtestGrabControlChecked(Impervious bool) XtestGrabControlCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xtestGrabControlRequest(Impervious), cookie) + return XtestGrabControlCookie{cookie} +} + +func (cook XtestGrabControlCookie) Check() error { + return cook.check() +} + +// Write request to wire for XtestGrabControl +func (c *Conn) xtestGrabControlRequest(Impervious bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XTEST"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Impervious { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go new file mode 100644 index 0000000..9e560a0 --- /dev/null +++ b/nexgb/auto_xv.go @@ -0,0 +1,2738 @@ +package xgb + +/* + This file was generated by xv.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xproto" +// import "shm" + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +const ( + XvTypeInputMask = 1 + XvTypeOutputMask = 2 + XvTypeVideoMask = 4 + XvTypeStillMask = 8 + XvTypeImageMask = 16 +) + +const ( + XvImageFormatInfoTypeRgb = 0 + XvImageFormatInfoTypeYuv = 1 +) + +const ( + XvImageFormatInfoFormatPacked = 0 + XvImageFormatInfoFormatPlanar = 1 +) + +const ( + XvAttributeFlagGettable = 1 + XvAttributeFlagSettable = 2 +) + +const ( + XvVideoNotifyReasonStarted = 0 + XvVideoNotifyReasonStopped = 1 + XvVideoNotifyReasonBusy = 2 + XvVideoNotifyReasonPreempted = 3 + XvVideoNotifyReasonHardError = 4 +) + +const ( + XvScanlineOrderTopToBottom = 0 + XvScanlineOrderBottomToTop = 1 +) + +const ( + XvGrabPortStatusSuccess = 0 + XvGrabPortStatusBadExtension = 1 + XvGrabPortStatusAlreadyGrabbed = 2 + XvGrabPortStatusInvalidTime = 3 + XvGrabPortStatusBadReply = 4 + XvGrabPortStatusBadAlloc = 5 +) + +// Skipping resource definition of 'Port' + +// Skipping resource definition of 'Encoding' + +// 'XvRational' struct definition +// Size: 8 +type XvRational struct { + Numerator int32 + Denominator int32 +} + +// Struct read XvRational +func ReadXvRational(buf []byte, v *XvRational) int { + b := 0 + + v.Numerator = int32(Get32(buf[b:])) + b += 4 + + v.Denominator = int32(Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read XvRational +func ReadXvRationalList(buf []byte, dest []XvRational) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvRational{} + b += ReadXvRational(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvRational +func (v XvRational) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Numerator)) + b += 4 + + Put32(buf[b:], uint32(v.Denominator)) + b += 4 + + return buf +} + +// Write struct list XvRational +func XvRationalListBytes(buf []byte, list []XvRational) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XvFormat' struct definition +// Size: 8 +type XvFormat struct { + Visual Visualid + Depth byte + // padding: 3 bytes +} + +// Struct read XvFormat +func ReadXvFormat(buf []byte, v *XvFormat) int { + b := 0 + + v.Visual = Visualid(Get32(buf[b:])) + b += 4 + + v.Depth = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read XvFormat +func ReadXvFormatList(buf []byte, dest []XvFormat) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvFormat{} + b += ReadXvFormat(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvFormat +func (v XvFormat) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + Put32(buf[b:], uint32(v.Visual)) + b += 4 + + buf[b] = v.Depth + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list XvFormat +func XvFormatListBytes(buf []byte, list []XvFormat) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// 'XvAdaptorInfo' struct definition +// Size: ((12 + pad((int(NameSize) * 1))) + pad((int(NumFormats) * 8))) +type XvAdaptorInfo struct { + BaseId Id + NameSize uint16 + NumPorts uint16 + NumFormats uint16 + Type byte + // padding: 1 bytes + Name string // size: pad((int(NameSize) * 1)) + Formats []XvFormat // size: pad((int(NumFormats) * 8)) +} + +// Struct read XvAdaptorInfo +func ReadXvAdaptorInfo(buf []byte, v *XvAdaptorInfo) int { + b := 0 + + v.BaseId = Id(Get32(buf[b:])) + b += 4 + + v.NameSize = Get16(buf[b:]) + b += 2 + + v.NumPorts = Get16(buf[b:]) + b += 2 + + v.NumFormats = Get16(buf[b:]) + b += 2 + + v.Type = buf[b] + b += 1 + + b += 1 // padding + + { + byteString := make([]byte, v.NameSize) + copy(byteString[:v.NameSize], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameSize)) + } + + v.Formats = make([]XvFormat, v.NumFormats) + b += ReadXvFormatList(buf[b:], v.Formats) + + return b +} + +// Struct list read XvAdaptorInfo +func ReadXvAdaptorInfoList(buf []byte, dest []XvAdaptorInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvAdaptorInfo{} + b += ReadXvAdaptorInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvAdaptorInfo +func (v XvAdaptorInfo) Bytes() []byte { + buf := make([]byte, ((12 + pad((int(v.NameSize) * 1))) + pad((int(v.NumFormats) * 8)))) + b := 0 + + Put32(buf[b:], uint32(v.BaseId)) + b += 4 + + Put16(buf[b:], v.NameSize) + b += 2 + + Put16(buf[b:], v.NumPorts) + b += 2 + + Put16(buf[b:], v.NumFormats) + b += 2 + + buf[b] = v.Type + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Name[:v.NameSize]) + b += pad(int(v.NameSize)) + + b += XvFormatListBytes(buf[b:], v.Formats) + + return buf +} + +// Write struct list XvAdaptorInfo +func XvAdaptorInfoListBytes(buf []byte, list []XvAdaptorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XvAdaptorInfo +func XvAdaptorInfoListSize(list []XvAdaptorInfo) int { + size := 0 + for _, item := range list { + size += ((12 + pad((int(item.NameSize) * 1))) + pad((int(item.NumFormats) * 8))) + } + return size +} + +// 'XvEncodingInfo' struct definition +// Size: (20 + pad((int(NameSize) * 1))) +type XvEncodingInfo struct { + Encoding Id + NameSize uint16 + Width uint16 + Height uint16 + // padding: 2 bytes + Rate XvRational + Name string // size: pad((int(NameSize) * 1)) +} + +// Struct read XvEncodingInfo +func ReadXvEncodingInfo(buf []byte, v *XvEncodingInfo) int { + b := 0 + + v.Encoding = Id(Get32(buf[b:])) + b += 4 + + v.NameSize = Get16(buf[b:]) + b += 2 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Rate = XvRational{} + b += ReadXvRational(buf[b:], &v.Rate) + + { + byteString := make([]byte, v.NameSize) + copy(byteString[:v.NameSize], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.NameSize)) + } + + return b +} + +// Struct list read XvEncodingInfo +func ReadXvEncodingInfoList(buf []byte, dest []XvEncodingInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvEncodingInfo{} + b += ReadXvEncodingInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvEncodingInfo +func (v XvEncodingInfo) Bytes() []byte { + buf := make([]byte, (20 + pad((int(v.NameSize) * 1)))) + b := 0 + + Put32(buf[b:], uint32(v.Encoding)) + b += 4 + + Put16(buf[b:], v.NameSize) + b += 2 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + b += 2 // padding + + { + structBytes := v.Rate.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + + copy(buf[b:], v.Name[:v.NameSize]) + b += pad(int(v.NameSize)) + + return buf +} + +// Write struct list XvEncodingInfo +func XvEncodingInfoListBytes(buf []byte, list []XvEncodingInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XvEncodingInfo +func XvEncodingInfoListSize(list []XvEncodingInfo) int { + size := 0 + for _, item := range list { + size += (20 + pad((int(item.NameSize) * 1))) + } + return size +} + +// 'XvImage' struct definition +// Size: (((16 + pad((int(NumPlanes) * 4))) + pad((int(NumPlanes) * 4))) + pad((int(DataSize) * 1))) +type XvImage struct { + Id uint32 + Width uint16 + Height uint16 + DataSize uint32 + NumPlanes uint32 + Pitches []uint32 // size: pad((int(NumPlanes) * 4)) + Offsets []uint32 // size: pad((int(NumPlanes) * 4)) + Data []byte // size: pad((int(DataSize) * 1)) +} + +// Struct read XvImage +func ReadXvImage(buf []byte, v *XvImage) int { + b := 0 + + v.Id = Get32(buf[b:]) + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + v.DataSize = Get32(buf[b:]) + b += 4 + + v.NumPlanes = Get32(buf[b:]) + b += 4 + + v.Pitches = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Pitches[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.Offsets = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Offsets[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.Data = make([]byte, v.DataSize) + copy(v.Data[:v.DataSize], buf[b:]) + b += pad(int(v.DataSize)) + + return b +} + +// Struct list read XvImage +func ReadXvImageList(buf []byte, dest []XvImage) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvImage{} + b += ReadXvImage(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvImage +func (v XvImage) Bytes() []byte { + buf := make([]byte, (((16 + pad((int(v.NumPlanes) * 4))) + pad((int(v.NumPlanes) * 4))) + pad((int(v.DataSize) * 1)))) + b := 0 + + Put32(buf[b:], v.Id) + b += 4 + + Put16(buf[b:], v.Width) + b += 2 + + Put16(buf[b:], v.Height) + b += 2 + + Put32(buf[b:], v.DataSize) + b += 4 + + Put32(buf[b:], v.NumPlanes) + b += 4 + + for i := 0; i < int(v.NumPlanes); i++ { + Put32(buf[b:], v.Pitches[i]) + b += 4 + } + b = pad(b) + + for i := 0; i < int(v.NumPlanes); i++ { + Put32(buf[b:], v.Offsets[i]) + b += 4 + } + b = pad(b) + + copy(buf[b:], v.Data[:v.DataSize]) + b += pad(int(v.DataSize)) + + return buf +} + +// Write struct list XvImage +func XvImageListBytes(buf []byte, list []XvImage) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XvImage +func XvImageListSize(list []XvImage) int { + size := 0 + for _, item := range list { + size += (((16 + pad((int(item.NumPlanes) * 4))) + pad((int(item.NumPlanes) * 4))) + pad((int(item.DataSize) * 1))) + } + return size +} + +// 'XvAttributeInfo' struct definition +// Size: (16 + pad((int(Size) * 1))) +type XvAttributeInfo struct { + Flags uint32 + Min int32 + Max int32 + Size uint32 + Name string // size: pad((int(Size) * 1)) +} + +// Struct read XvAttributeInfo +func ReadXvAttributeInfo(buf []byte, v *XvAttributeInfo) int { + b := 0 + + v.Flags = Get32(buf[b:]) + b += 4 + + v.Min = int32(Get32(buf[b:])) + b += 4 + + v.Max = int32(Get32(buf[b:])) + b += 4 + + v.Size = Get32(buf[b:]) + b += 4 + + { + byteString := make([]byte, v.Size) + copy(byteString[:v.Size], buf[b:]) + v.Name = string(byteString) + b += pad(int(v.Size)) + } + + return b +} + +// Struct list read XvAttributeInfo +func ReadXvAttributeInfoList(buf []byte, dest []XvAttributeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvAttributeInfo{} + b += ReadXvAttributeInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvAttributeInfo +func (v XvAttributeInfo) Bytes() []byte { + buf := make([]byte, (16 + pad((int(v.Size) * 1)))) + b := 0 + + Put32(buf[b:], v.Flags) + b += 4 + + Put32(buf[b:], uint32(v.Min)) + b += 4 + + Put32(buf[b:], uint32(v.Max)) + b += 4 + + Put32(buf[b:], v.Size) + b += 4 + + copy(buf[b:], v.Name[:v.Size]) + b += pad(int(v.Size)) + + return buf +} + +// Write struct list XvAttributeInfo +func XvAttributeInfoListBytes(buf []byte, list []XvAttributeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XvAttributeInfo +func XvAttributeInfoListSize(list []XvAttributeInfo) int { + size := 0 + for _, item := range list { + size += (16 + pad((int(item.Size) * 1))) + } + return size +} + +// 'XvImageFormatInfo' struct definition +// Size: 128 +type XvImageFormatInfo struct { + Id uint32 + Type byte + ByteOrder byte + // padding: 2 bytes + Guid []byte // size: 16 + Bpp byte + NumPlanes byte + // padding: 2 bytes + Depth byte + // padding: 3 bytes + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + Format byte + // padding: 3 bytes + YSampleBits uint32 + USampleBits uint32 + VSampleBits uint32 + VhorzYPeriod uint32 + VhorzUPeriod uint32 + VhorzVPeriod uint32 + VvertYPeriod uint32 + VvertUPeriod uint32 + VvertVPeriod uint32 + VcompOrder []byte // size: 32 + VscanlineOrder byte + // padding: 11 bytes +} + +// Struct read XvImageFormatInfo +func ReadXvImageFormatInfo(buf []byte, v *XvImageFormatInfo) int { + b := 0 + + v.Id = Get32(buf[b:]) + b += 4 + + v.Type = buf[b] + b += 1 + + v.ByteOrder = buf[b] + b += 1 + + b += 2 // padding + + v.Guid = make([]byte, 16) + copy(v.Guid[:16], buf[b:]) + b += pad(int(16)) + + v.Bpp = buf[b] + b += 1 + + v.NumPlanes = buf[b] + b += 1 + + b += 2 // padding + + v.Depth = buf[b] + b += 1 + + b += 3 // padding + + v.RedMask = Get32(buf[b:]) + b += 4 + + v.GreenMask = Get32(buf[b:]) + b += 4 + + v.BlueMask = Get32(buf[b:]) + b += 4 + + v.Format = buf[b] + b += 1 + + b += 3 // padding + + v.YSampleBits = Get32(buf[b:]) + b += 4 + + v.USampleBits = Get32(buf[b:]) + b += 4 + + v.VSampleBits = Get32(buf[b:]) + b += 4 + + v.VhorzYPeriod = Get32(buf[b:]) + b += 4 + + v.VhorzUPeriod = Get32(buf[b:]) + b += 4 + + v.VhorzVPeriod = Get32(buf[b:]) + b += 4 + + v.VvertYPeriod = Get32(buf[b:]) + b += 4 + + v.VvertUPeriod = Get32(buf[b:]) + b += 4 + + v.VvertVPeriod = Get32(buf[b:]) + b += 4 + + v.VcompOrder = make([]byte, 32) + copy(v.VcompOrder[:32], buf[b:]) + b += pad(int(32)) + + v.VscanlineOrder = buf[b] + b += 1 + + b += 11 // padding + + return b +} + +// Struct list read XvImageFormatInfo +func ReadXvImageFormatInfoList(buf []byte, dest []XvImageFormatInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvImageFormatInfo{} + b += ReadXvImageFormatInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvImageFormatInfo +func (v XvImageFormatInfo) Bytes() []byte { + buf := make([]byte, 128) + b := 0 + + Put32(buf[b:], v.Id) + b += 4 + + buf[b] = v.Type + b += 1 + + buf[b] = v.ByteOrder + b += 1 + + b += 2 // padding + + copy(buf[b:], v.Guid[:16]) + b += pad(int(16)) + + buf[b] = v.Bpp + b += 1 + + buf[b] = v.NumPlanes + b += 1 + + b += 2 // padding + + buf[b] = v.Depth + b += 1 + + b += 3 // padding + + Put32(buf[b:], v.RedMask) + b += 4 + + Put32(buf[b:], v.GreenMask) + b += 4 + + Put32(buf[b:], v.BlueMask) + b += 4 + + buf[b] = v.Format + b += 1 + + b += 3 // padding + + Put32(buf[b:], v.YSampleBits) + b += 4 + + Put32(buf[b:], v.USampleBits) + b += 4 + + Put32(buf[b:], v.VSampleBits) + b += 4 + + Put32(buf[b:], v.VhorzYPeriod) + b += 4 + + Put32(buf[b:], v.VhorzUPeriod) + b += 4 + + Put32(buf[b:], v.VhorzVPeriod) + b += 4 + + Put32(buf[b:], v.VvertYPeriod) + b += 4 + + Put32(buf[b:], v.VvertUPeriod) + b += 4 + + Put32(buf[b:], v.VvertVPeriod) + b += 4 + + copy(buf[b:], v.VcompOrder[:32]) + b += pad(int(32)) + + buf[b] = v.VscanlineOrder + b += 1 + + b += 11 // padding + + return buf +} + +// Write struct list XvImageFormatInfo +func XvImageFormatInfoListBytes(buf []byte, list []XvImageFormatInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Struct list size XvImageFormatInfo +func XvImageFormatInfoListSize(list []XvImageFormatInfo) int { + size := 0 + for _ = range list { + size += 128 + } + return size +} + +// Event definition XvVideoNotify (0) +// Size: 32 + +const XvVideoNotify = 0 + +type XvVideoNotifyEvent struct { + Sequence uint16 + Reason byte + Time Timestamp + Drawable Id + Port Id +} + +// Event read XvVideoNotify +func NewXvVideoNotifyEvent(buf []byte) Event { + v := XvVideoNotifyEvent{} + b := 1 // don't read event number + + v.Reason = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Drawable = Id(Get32(buf[b:])) + b += 4 + + v.Port = Id(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write XvVideoNotify +func (v XvVideoNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Reason + b += 1 + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + Put32(buf[b:], uint32(v.Port)) + b += 4 + + return buf +} + +func (v XvVideoNotifyEvent) ImplementsEvent() {} + +func (v XvVideoNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XvVideoNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Reason: %d", v.Reason)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, sprintf("Port: %d", v.Port)) + return "XvVideoNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[0] = NewXvVideoNotifyEvent +} + +// Event definition XvPortNotify (1) +// Size: 32 + +const XvPortNotify = 1 + +type XvPortNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Port Id + Attribute Id + Value int32 +} + +// Event read XvPortNotify +func NewXvPortNotifyEvent(buf []byte) Event { + v := XvPortNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(Get32(buf[b:])) + b += 4 + + v.Port = Id(Get32(buf[b:])) + b += 4 + + v.Attribute = Id(Get32(buf[b:])) + b += 4 + + v.Value = int32(Get32(buf[b:])) + b += 4 + + return v +} + +// Event write XvPortNotify +func (v XvPortNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + Put32(buf[b:], uint32(v.Time)) + b += 4 + + Put32(buf[b:], uint32(v.Port)) + b += 4 + + Put32(buf[b:], uint32(v.Attribute)) + b += 4 + + Put32(buf[b:], uint32(v.Value)) + b += 4 + + return buf +} + +func (v XvPortNotifyEvent) ImplementsEvent() {} + +func (v XvPortNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v XvPortNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, sprintf("Port: %d", v.Port)) + fieldVals = append(fieldVals, sprintf("Attribute: %d", v.Attribute)) + fieldVals = append(fieldVals, sprintf("Value: %d", v.Value)) + return "XvPortNotify {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newEventFuncs[1] = NewXvPortNotifyEvent +} + +// Error definition XvBadPort (0) +// Size: 32 + +const BadXvBadPort = 0 + +type XvBadPortError struct { + Sequence uint16 + NiceName string +} + +// Error read XvBadPort +func NewXvBadPortError(buf []byte) Error { + v := XvBadPortError{} + v.NiceName = "XvBadPort" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XvBadPortError) ImplementsError() {} + +func (err XvBadPortError) SequenceId() uint16 { + return err.Sequence +} + +func (err XvBadPortError) BadId() Id { + return 0 +} + +func (err XvBadPortError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXvBadPort {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[0] = NewXvBadPortError +} + +// Error definition XvBadEncoding (1) +// Size: 32 + +const BadXvBadEncoding = 1 + +type XvBadEncodingError struct { + Sequence uint16 + NiceName string +} + +// Error read XvBadEncoding +func NewXvBadEncodingError(buf []byte) Error { + v := XvBadEncodingError{} + v.NiceName = "XvBadEncoding" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XvBadEncodingError) ImplementsError() {} + +func (err XvBadEncodingError) SequenceId() uint16 { + return err.Sequence +} + +func (err XvBadEncodingError) BadId() Id { + return 0 +} + +func (err XvBadEncodingError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXvBadEncoding {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[1] = NewXvBadEncodingError +} + +// Error definition XvBadControl (2) +// Size: 32 + +const BadXvBadControl = 2 + +type XvBadControlError struct { + Sequence uint16 + NiceName string +} + +// Error read XvBadControl +func NewXvBadControlError(buf []byte) Error { + v := XvBadControlError{} + v.NiceName = "XvBadControl" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = Get16(buf[b:]) + b += 2 + + return v +} + +func (err XvBadControlError) ImplementsError() {} + +func (err XvBadControlError) SequenceId() uint16 { + return err.Sequence +} + +func (err XvBadControlError) BadId() Id { + return 0 +} + +func (err XvBadControlError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) + return "BadXvBadControl {" + stringsJoin(fieldVals, ", ") + "}" +} + +func init() { + newErrorFuncs[2] = NewXvBadControlError +} + +// Request XvQueryExtension +// size: 4 +type XvQueryExtensionCookie struct { + *cookie +} + +func (c *Conn) XvQueryExtension() XvQueryExtensionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryExtensionRequest(), cookie) + return XvQueryExtensionCookie{cookie} +} + +func (c *Conn) XvQueryExtensionUnchecked() XvQueryExtensionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryExtensionRequest(), cookie) + return XvQueryExtensionCookie{cookie} +} + +// Request reply for XvQueryExtension +// size: 12 +type XvQueryExtensionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint16 + Minor uint16 +} + +// Waits and reads reply data from request XvQueryExtension +func (cook XvQueryExtensionCookie) Reply() (*XvQueryExtensionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryExtensionReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryExtension +func xvQueryExtensionReply(buf []byte) *XvQueryExtensionReply { + v := new(XvQueryExtensionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = Get16(buf[b:]) + b += 2 + + v.Minor = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XvQueryExtensionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryExtension +func (c *Conn) xvQueryExtensionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XvQueryAdaptors +// size: 8 +type XvQueryAdaptorsCookie struct { + *cookie +} + +func (c *Conn) XvQueryAdaptors(Window Id) XvQueryAdaptorsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) + return XvQueryAdaptorsCookie{cookie} +} + +func (c *Conn) XvQueryAdaptorsUnchecked(Window Id) XvQueryAdaptorsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) + return XvQueryAdaptorsCookie{cookie} +} + +// Request reply for XvQueryAdaptors +// size: (32 + XvAdaptorInfoListSize(Info)) +type XvQueryAdaptorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAdaptors uint16 + // padding: 22 bytes + Info []XvAdaptorInfo // size: XvAdaptorInfoListSize(Info) +} + +// Waits and reads reply data from request XvQueryAdaptors +func (cook XvQueryAdaptorsCookie) Reply() (*XvQueryAdaptorsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryAdaptorsReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryAdaptors +func xvQueryAdaptorsReply(buf []byte) *XvQueryAdaptorsReply { + v := new(XvQueryAdaptorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAdaptors = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]XvAdaptorInfo, v.NumAdaptors) + b += ReadXvAdaptorInfoList(buf[b:], v.Info) + + return v +} + +func (cook XvQueryAdaptorsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryAdaptors +func (c *Conn) xvQueryAdaptorsRequest(Window Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request XvQueryEncodings +// size: 8 +type XvQueryEncodingsCookie struct { + *cookie +} + +func (c *Conn) XvQueryEncodings(Port Id) XvQueryEncodingsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) + return XvQueryEncodingsCookie{cookie} +} + +func (c *Conn) XvQueryEncodingsUnchecked(Port Id) XvQueryEncodingsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) + return XvQueryEncodingsCookie{cookie} +} + +// Request reply for XvQueryEncodings +// size: (32 + XvEncodingInfoListSize(Info)) +type XvQueryEncodingsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumEncodings uint16 + // padding: 22 bytes + Info []XvEncodingInfo // size: XvEncodingInfoListSize(Info) +} + +// Waits and reads reply data from request XvQueryEncodings +func (cook XvQueryEncodingsCookie) Reply() (*XvQueryEncodingsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryEncodingsReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryEncodings +func xvQueryEncodingsReply(buf []byte) *XvQueryEncodingsReply { + v := new(XvQueryEncodingsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumEncodings = Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]XvEncodingInfo, v.NumEncodings) + b += ReadXvEncodingInfoList(buf[b:], v.Info) + + return v +} + +func (cook XvQueryEncodingsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryEncodings +func (c *Conn) xvQueryEncodingsRequest(Port Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request XvGrabPort +// size: 12 +type XvGrabPortCookie struct { + *cookie +} + +func (c *Conn) XvGrabPort(Port Id, Time Timestamp) XvGrabPortCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) + return XvGrabPortCookie{cookie} +} + +func (c *Conn) XvGrabPortUnchecked(Port Id, Time Timestamp) XvGrabPortCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) + return XvGrabPortCookie{cookie} +} + +// Request reply for XvGrabPort +// size: 8 +type XvGrabPortReply struct { + Sequence uint16 + Length uint32 + Result byte +} + +// Waits and reads reply data from request XvGrabPort +func (cook XvGrabPortCookie) Reply() (*XvGrabPortReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvGrabPortReply(buf), nil +} + +// Read reply into structure from buffer for XvGrabPort +func xvGrabPortReply(buf []byte) *XvGrabPortReply { + v := new(XvGrabPortReply) + b := 1 // skip reply determinant + + v.Result = buf[b] + b += 1 + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +func (cook XvGrabPortCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvGrabPort +func (c *Conn) xvGrabPortRequest(Port Id, Time Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// Request XvUngrabPort +// size: 12 +type XvUngrabPortCookie struct { + *cookie +} + +// Write request to wire for XvUngrabPort +func (c *Conn) XvUngrabPort(Port Id, Time Timestamp) XvUngrabPortCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) + return XvUngrabPortCookie{cookie} +} + +func (c *Conn) XvUngrabPortChecked(Port Id, Time Timestamp) XvUngrabPortCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) + return XvUngrabPortCookie{cookie} +} + +func (cook XvUngrabPortCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvUngrabPort +func (c *Conn) xvUngrabPortRequest(Port Id, Time Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// Request XvPutVideo +// size: 32 +type XvPutVideoCookie struct { + *cookie +} + +// Write request to wire for XvPutVideo +func (c *Conn) XvPutVideo(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvPutVideoCookie{cookie} +} + +func (c *Conn) XvPutVideoChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvPutVideoCookie{cookie} +} + +func (cook XvPutVideoCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvPutVideo +func (c *Conn) xvPutVideoRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(VidX)) + b += 2 + + Put16(buf[b:], uint16(VidY)) + b += 2 + + Put16(buf[b:], VidW) + b += 2 + + Put16(buf[b:], VidH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request XvPutStill +// size: 32 +type XvPutStillCookie struct { + *cookie +} + +// Write request to wire for XvPutStill +func (c *Conn) XvPutStill(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvPutStillCookie{cookie} +} + +func (c *Conn) XvPutStillChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvPutStillCookie{cookie} +} + +func (cook XvPutStillCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvPutStill +func (c *Conn) xvPutStillRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(VidX)) + b += 2 + + Put16(buf[b:], uint16(VidY)) + b += 2 + + Put16(buf[b:], VidW) + b += 2 + + Put16(buf[b:], VidH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request XvGetVideo +// size: 32 +type XvGetVideoCookie struct { + *cookie +} + +// Write request to wire for XvGetVideo +func (c *Conn) XvGetVideo(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvGetVideoCookie{cookie} +} + +func (c *Conn) XvGetVideoChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvGetVideoCookie{cookie} +} + +func (cook XvGetVideoCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvGetVideo +func (c *Conn) xvGetVideoRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(VidX)) + b += 2 + + Put16(buf[b:], uint16(VidY)) + b += 2 + + Put16(buf[b:], VidW) + b += 2 + + Put16(buf[b:], VidH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request XvGetStill +// size: 32 +type XvGetStillCookie struct { + *cookie +} + +// Write request to wire for XvGetStill +func (c *Conn) XvGetStill(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvGetStillCookie{cookie} +} + +func (c *Conn) XvGetStillChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return XvGetStillCookie{cookie} +} + +func (cook XvGetStillCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvGetStill +func (c *Conn) xvGetStillRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put16(buf[b:], uint16(VidX)) + b += 2 + + Put16(buf[b:], uint16(VidY)) + b += 2 + + Put16(buf[b:], VidW) + b += 2 + + Put16(buf[b:], VidH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request XvStopVideo +// size: 12 +type XvStopVideoCookie struct { + *cookie +} + +// Write request to wire for XvStopVideo +func (c *Conn) XvStopVideo(Port Id, Drawable Id) XvStopVideoCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) + return XvStopVideoCookie{cookie} +} + +func (c *Conn) XvStopVideoChecked(Port Id, Drawable Id) XvStopVideoCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) + return XvStopVideoCookie{cookie} +} + +func (cook XvStopVideoCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvStopVideo +func (c *Conn) xvStopVideoRequest(Port Id, Drawable Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request XvSelectVideoNotify +// size: 12 +type XvSelectVideoNotifyCookie struct { + *cookie +} + +// Write request to wire for XvSelectVideoNotify +func (c *Conn) XvSelectVideoNotify(Drawable Id, Onoff bool) XvSelectVideoNotifyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) + return XvSelectVideoNotifyCookie{cookie} +} + +func (c *Conn) XvSelectVideoNotifyChecked(Drawable Id, Onoff bool) XvSelectVideoNotifyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) + return XvSelectVideoNotifyCookie{cookie} +} + +func (cook XvSelectVideoNotifyCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvSelectVideoNotify +func (c *Conn) xvSelectVideoNotifyRequest(Drawable Id, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request XvSelectPortNotify +// size: 12 +type XvSelectPortNotifyCookie struct { + *cookie +} + +// Write request to wire for XvSelectPortNotify +func (c *Conn) XvSelectPortNotify(Port Id, Onoff bool) XvSelectPortNotifyCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) + return XvSelectPortNotifyCookie{cookie} +} + +func (c *Conn) XvSelectPortNotifyChecked(Port Id, Onoff bool) XvSelectPortNotifyCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) + return XvSelectPortNotifyCookie{cookie} +} + +func (cook XvSelectPortNotifyCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvSelectPortNotify +func (c *Conn) xvSelectPortNotifyRequest(Port Id, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request XvQueryBestSize +// size: 20 +type XvQueryBestSizeCookie struct { + *cookie +} + +func (c *Conn) XvQueryBestSize(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) + return XvQueryBestSizeCookie{cookie} +} + +func (c *Conn) XvQueryBestSizeUnchecked(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) + return XvQueryBestSizeCookie{cookie} +} + +// Request reply for XvQueryBestSize +// size: 12 +type XvQueryBestSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ActualWidth uint16 + ActualHeight uint16 +} + +// Waits and reads reply data from request XvQueryBestSize +func (cook XvQueryBestSizeCookie) Reply() (*XvQueryBestSizeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryBestSizeReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryBestSize +func xvQueryBestSizeReply(buf []byte) *XvQueryBestSizeReply { + v := new(XvQueryBestSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.ActualWidth = Get16(buf[b:]) + b += 2 + + v.ActualHeight = Get16(buf[b:]) + b += 2 + + return v +} + +func (cook XvQueryBestSizeCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryBestSize +func (c *Conn) xvQueryBestSizeRequest(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put16(buf[b:], VidW) + b += 2 + + Put16(buf[b:], VidH) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + if Motion { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request XvSetPortAttribute +// size: 16 +type XvSetPortAttributeCookie struct { + *cookie +} + +// Write request to wire for XvSetPortAttribute +func (c *Conn) XvSetPortAttribute(Port Id, Attribute Id, Value int32) XvSetPortAttributeCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) + return XvSetPortAttributeCookie{cookie} +} + +func (c *Conn) XvSetPortAttributeChecked(Port Id, Attribute Id, Value int32) XvSetPortAttributeCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) + return XvSetPortAttributeCookie{cookie} +} + +func (cook XvSetPortAttributeCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvSetPortAttribute +func (c *Conn) xvSetPortAttributeRequest(Port Id, Attribute Id, Value int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Attribute)) + b += 4 + + Put32(buf[b:], uint32(Value)) + b += 4 + + return buf +} + +// Request XvGetPortAttribute +// size: 12 +type XvGetPortAttributeCookie struct { + *cookie +} + +func (c *Conn) XvGetPortAttribute(Port Id, Attribute Id) XvGetPortAttributeCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) + return XvGetPortAttributeCookie{cookie} +} + +func (c *Conn) XvGetPortAttributeUnchecked(Port Id, Attribute Id) XvGetPortAttributeCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) + return XvGetPortAttributeCookie{cookie} +} + +// Request reply for XvGetPortAttribute +// size: 12 +type XvGetPortAttributeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Value int32 +} + +// Waits and reads reply data from request XvGetPortAttribute +func (cook XvGetPortAttributeCookie) Reply() (*XvGetPortAttributeReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvGetPortAttributeReply(buf), nil +} + +// Read reply into structure from buffer for XvGetPortAttribute +func xvGetPortAttributeReply(buf []byte) *XvGetPortAttributeReply { + v := new(XvGetPortAttributeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Value = int32(Get32(buf[b:])) + b += 4 + + return v +} + +func (cook XvGetPortAttributeCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvGetPortAttribute +func (c *Conn) xvGetPortAttributeRequest(Port Id, Attribute Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Attribute)) + b += 4 + + return buf +} + +// Request XvQueryPortAttributes +// size: 8 +type XvQueryPortAttributesCookie struct { + *cookie +} + +func (c *Conn) XvQueryPortAttributes(Port Id) XvQueryPortAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) + return XvQueryPortAttributesCookie{cookie} +} + +func (c *Conn) XvQueryPortAttributesUnchecked(Port Id) XvQueryPortAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) + return XvQueryPortAttributesCookie{cookie} +} + +// Request reply for XvQueryPortAttributes +// size: (32 + XvAttributeInfoListSize(Attributes)) +type XvQueryPortAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttributes uint32 + TextSize uint32 + // padding: 16 bytes + Attributes []XvAttributeInfo // size: XvAttributeInfoListSize(Attributes) +} + +// Waits and reads reply data from request XvQueryPortAttributes +func (cook XvQueryPortAttributesCookie) Reply() (*XvQueryPortAttributesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryPortAttributesReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryPortAttributes +func xvQueryPortAttributesReply(buf []byte) *XvQueryPortAttributesReply { + v := new(XvQueryPortAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttributes = Get32(buf[b:]) + b += 4 + + v.TextSize = Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.Attributes = make([]XvAttributeInfo, v.NumAttributes) + b += ReadXvAttributeInfoList(buf[b:], v.Attributes) + + return v +} + +func (cook XvQueryPortAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryPortAttributes +func (c *Conn) xvQueryPortAttributesRequest(Port Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request XvListImageFormats +// size: 8 +type XvListImageFormatsCookie struct { + *cookie +} + +func (c *Conn) XvListImageFormats(Port Id) XvListImageFormatsCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvListImageFormatsRequest(Port), cookie) + return XvListImageFormatsCookie{cookie} +} + +func (c *Conn) XvListImageFormatsUnchecked(Port Id) XvListImageFormatsCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvListImageFormatsRequest(Port), cookie) + return XvListImageFormatsCookie{cookie} +} + +// Request reply for XvListImageFormats +// size: (32 + XvImageFormatInfoListSize(Format)) +type XvListImageFormatsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFormats uint32 + // padding: 20 bytes + Format []XvImageFormatInfo // size: XvImageFormatInfoListSize(Format) +} + +// Waits and reads reply data from request XvListImageFormats +func (cook XvListImageFormatsCookie) Reply() (*XvListImageFormatsReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvListImageFormatsReply(buf), nil +} + +// Read reply into structure from buffer for XvListImageFormats +func xvListImageFormatsReply(buf []byte) *XvListImageFormatsReply { + v := new(XvListImageFormatsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFormats = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Format = make([]XvImageFormatInfo, v.NumFormats) + b += ReadXvImageFormatInfoList(buf[b:], v.Format) + + return v +} + +func (cook XvListImageFormatsCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvListImageFormats +func (c *Conn) xvListImageFormatsRequest(Port Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request XvQueryImageAttributes +// size: 16 +type XvQueryImageAttributesCookie struct { + *cookie +} + +func (c *Conn) XvQueryImageAttributes(Port Id, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) + return XvQueryImageAttributesCookie{cookie} +} + +func (c *Conn) XvQueryImageAttributesUnchecked(Port Id, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) + return XvQueryImageAttributesCookie{cookie} +} + +// Request reply for XvQueryImageAttributes +// size: ((32 + pad((int(NumPlanes) * 4))) + pad((int(NumPlanes) * 4))) +type XvQueryImageAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumPlanes uint32 + DataSize uint32 + Width uint16 + Height uint16 + // padding: 12 bytes + Pitches []uint32 // size: pad((int(NumPlanes) * 4)) + Offsets []uint32 // size: pad((int(NumPlanes) * 4)) +} + +// Waits and reads reply data from request XvQueryImageAttributes +func (cook XvQueryImageAttributesCookie) Reply() (*XvQueryImageAttributesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvQueryImageAttributesReply(buf), nil +} + +// Read reply into structure from buffer for XvQueryImageAttributes +func xvQueryImageAttributesReply(buf []byte) *XvQueryImageAttributesReply { + v := new(XvQueryImageAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumPlanes = Get32(buf[b:]) + b += 4 + + v.DataSize = Get32(buf[b:]) + b += 4 + + v.Width = Get16(buf[b:]) + b += 2 + + v.Height = Get16(buf[b:]) + b += 2 + + b += 12 // padding + + v.Pitches = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Pitches[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + v.Offsets = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Offsets[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XvQueryImageAttributesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvQueryImageAttributes +func (c *Conn) xvQueryImageAttributesRequest(Port Id, Id uint32, Width uint16, Height uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request XvPutImage +// size: pad((40 + pad((len(Data) * 1)))) +type XvPutImageCookie struct { + *cookie +} + +// Write request to wire for XvPutImage +func (c *Conn) XvPutImage(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return XvPutImageCookie{cookie} +} + +func (c *Conn) XvPutImageChecked(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return XvPutImageCookie{cookie} +} + +func (cook XvPutImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvPutImage +func (c *Conn) xvPutImageRequest(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { + size := pad((40 + pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], SrcW) + b += 2 + + Put16(buf[b:], SrcH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + copy(buf[b:], Data[:len(Data)]) + b += pad(int(len(Data))) + + return buf +} + +// Request XvShmPutImage +// size: 52 +type XvShmPutImageCookie struct { + *cookie +} + +// Write request to wire for XvShmPutImage +func (c *Conn) XvShmPutImage(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) + return XvShmPutImageCookie{cookie} +} + +func (c *Conn) XvShmPutImageChecked(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) + return XvShmPutImageCookie{cookie} +} + +func (cook XvShmPutImageCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvShmPutImage +func (c *Conn) xvShmPutImageRequest(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { + size := 52 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(Port)) + b += 4 + + Put32(buf[b:], uint32(Drawable)) + b += 4 + + Put32(buf[b:], uint32(Gc)) + b += 4 + + Put32(buf[b:], uint32(Shmseg)) + b += 4 + + Put32(buf[b:], Id) + b += 4 + + Put32(buf[b:], Offset) + b += 4 + + Put16(buf[b:], uint16(SrcX)) + b += 2 + + Put16(buf[b:], uint16(SrcY)) + b += 2 + + Put16(buf[b:], SrcW) + b += 2 + + Put16(buf[b:], SrcH) + b += 2 + + Put16(buf[b:], uint16(DrwX)) + b += 2 + + Put16(buf[b:], uint16(DrwY)) + b += 2 + + Put16(buf[b:], DrwW) + b += 2 + + Put16(buf[b:], DrwH) + b += 2 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + buf[b] = SendEvent + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go new file mode 100644 index 0000000..1d8814d --- /dev/null +++ b/nexgb/auto_xvmc.go @@ -0,0 +1,879 @@ +package xgb + +/* + This file was generated by xvmc.xml on May 6 2012 3:00:45am EDT. + This file is automatically generated. Edit at your peril! +*/ + +// Imports are not necessary for XGB because everything is +// in one package. They are still listed here for reference. +// import "xv" + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping resource definition of 'Context' + +// Skipping resource definition of 'Surface' + +// Skipping resource definition of 'Subpicture' + +// 'XvmcSurfaceInfo' struct definition +// Size: 24 +type XvmcSurfaceInfo struct { + Id Id + ChromaFormat uint16 + Pad0 uint16 + MaxWidth uint16 + MaxHeight uint16 + SubpictureMaxWidth uint16 + SubpictureMaxHeight uint16 + McType uint32 + Flags uint32 +} + +// Struct read XvmcSurfaceInfo +func ReadXvmcSurfaceInfo(buf []byte, v *XvmcSurfaceInfo) int { + b := 0 + + v.Id = Id(Get32(buf[b:])) + b += 4 + + v.ChromaFormat = Get16(buf[b:]) + b += 2 + + v.Pad0 = Get16(buf[b:]) + b += 2 + + v.MaxWidth = Get16(buf[b:]) + b += 2 + + v.MaxHeight = Get16(buf[b:]) + b += 2 + + v.SubpictureMaxWidth = Get16(buf[b:]) + b += 2 + + v.SubpictureMaxHeight = Get16(buf[b:]) + b += 2 + + v.McType = Get32(buf[b:]) + b += 4 + + v.Flags = Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read XvmcSurfaceInfo +func ReadXvmcSurfaceInfoList(buf []byte, dest []XvmcSurfaceInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = XvmcSurfaceInfo{} + b += ReadXvmcSurfaceInfo(buf[b:], &dest[i]) + } + return pad(b) +} + +// Struct write XvmcSurfaceInfo +func (v XvmcSurfaceInfo) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + Put32(buf[b:], uint32(v.Id)) + b += 4 + + Put16(buf[b:], v.ChromaFormat) + b += 2 + + Put16(buf[b:], v.Pad0) + b += 2 + + Put16(buf[b:], v.MaxWidth) + b += 2 + + Put16(buf[b:], v.MaxHeight) + b += 2 + + Put16(buf[b:], v.SubpictureMaxWidth) + b += 2 + + Put16(buf[b:], v.SubpictureMaxHeight) + b += 2 + + Put32(buf[b:], v.McType) + b += 4 + + Put32(buf[b:], v.Flags) + b += 4 + + return buf +} + +// Write struct list XvmcSurfaceInfo +func XvmcSurfaceInfoListBytes(buf []byte, list []XvmcSurfaceInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += pad(len(structBytes)) + } + return b +} + +// Request XvmcQueryVersion +// size: 4 +type XvmcQueryVersionCookie struct { + *cookie +} + +func (c *Conn) XvmcQueryVersion() XvmcQueryVersionCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcQueryVersionRequest(), cookie) + return XvmcQueryVersionCookie{cookie} +} + +func (c *Conn) XvmcQueryVersionUnchecked() XvmcQueryVersionCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcQueryVersionRequest(), cookie) + return XvmcQueryVersionCookie{cookie} +} + +// Request reply for XvmcQueryVersion +// size: 16 +type XvmcQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint32 + Minor uint32 +} + +// Waits and reads reply data from request XvmcQueryVersion +func (cook XvmcQueryVersionCookie) Reply() (*XvmcQueryVersionReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for XvmcQueryVersion +func xvmcQueryVersionReply(buf []byte) *XvmcQueryVersionReply { + v := new(XvmcQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = Get32(buf[b:]) + b += 4 + + v.Minor = Get32(buf[b:]) + b += 4 + + return v +} + +func (cook XvmcQueryVersionCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcQueryVersion +func (c *Conn) xvmcQueryVersionRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request XvmcListSurfaceTypes +// size: 8 +type XvmcListSurfaceTypesCookie struct { + *cookie +} + +func (c *Conn) XvmcListSurfaceTypes(PortId Id) XvmcListSurfaceTypesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) + return XvmcListSurfaceTypesCookie{cookie} +} + +func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId Id) XvmcListSurfaceTypesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) + return XvmcListSurfaceTypesCookie{cookie} +} + +// Request reply for XvmcListSurfaceTypes +// size: (32 + pad((int(Num) * 24))) +type XvmcListSurfaceTypesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Num uint32 + // padding: 20 bytes + Surfaces []XvmcSurfaceInfo // size: pad((int(Num) * 24)) +} + +// Waits and reads reply data from request XvmcListSurfaceTypes +func (cook XvmcListSurfaceTypesCookie) Reply() (*XvmcListSurfaceTypesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcListSurfaceTypesReply(buf), nil +} + +// Read reply into structure from buffer for XvmcListSurfaceTypes +func xvmcListSurfaceTypesReply(buf []byte) *XvmcListSurfaceTypesReply { + v := new(XvmcListSurfaceTypesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Num = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Surfaces = make([]XvmcSurfaceInfo, v.Num) + b += ReadXvmcSurfaceInfoList(buf[b:], v.Surfaces) + + return v +} + +func (cook XvmcListSurfaceTypesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcListSurfaceTypes +func (c *Conn) xvmcListSurfaceTypesRequest(PortId Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(PortId)) + b += 4 + + return buf +} + +// Request XvmcCreateContext +// size: 24 +type XvmcCreateContextCookie struct { + *cookie +} + +func (c *Conn) XvmcCreateContext(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) + return XvmcCreateContextCookie{cookie} +} + +func (c *Conn) XvmcCreateContextUnchecked(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) + return XvmcCreateContextCookie{cookie} +} + +// Request reply for XvmcCreateContext +// size: (36 + pad((int(Length) * 4))) +type XvmcCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + WidthActual uint16 + HeightActual uint16 + FlagsReturn uint32 + // padding: 20 bytes + PrivData []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request XvmcCreateContext +func (cook XvmcCreateContextCookie) Reply() (*XvmcCreateContextReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for XvmcCreateContext +func xvmcCreateContextReply(buf []byte) *XvmcCreateContextReply { + v := new(XvmcCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.WidthActual = Get16(buf[b:]) + b += 2 + + v.HeightActual = Get16(buf[b:]) + b += 2 + + v.FlagsReturn = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XvmcCreateContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcCreateContext +func (c *Conn) xvmcCreateContextRequest(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextId)) + b += 4 + + Put32(buf[b:], uint32(PortId)) + b += 4 + + Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + Put32(buf[b:], Flags) + b += 4 + + return buf +} + +// Request XvmcDestroyContext +// size: 8 +type XvmcDestroyContextCookie struct { + *cookie +} + +// Write request to wire for XvmcDestroyContext +func (c *Conn) XvmcDestroyContext(ContextId Id) XvmcDestroyContextCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) + return XvmcDestroyContextCookie{cookie} +} + +func (c *Conn) XvmcDestroyContextChecked(ContextId Id) XvmcDestroyContextCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) + return XvmcDestroyContextCookie{cookie} +} + +func (cook XvmcDestroyContextCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcDestroyContext +func (c *Conn) xvmcDestroyContextRequest(ContextId Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + +// Request XvmcCreateSurface +// size: 12 +type XvmcCreateSurfaceCookie struct { + *cookie +} + +func (c *Conn) XvmcCreateSurface(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) + return XvmcCreateSurfaceCookie{cookie} +} + +func (c *Conn) XvmcCreateSurfaceUnchecked(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) + return XvmcCreateSurfaceCookie{cookie} +} + +// Request reply for XvmcCreateSurface +// size: (32 + pad((int(Length) * 4))) +type XvmcCreateSurfaceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + PrivData []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request XvmcCreateSurface +func (cook XvmcCreateSurfaceCookie) Reply() (*XvmcCreateSurfaceReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcCreateSurfaceReply(buf), nil +} + +// Read reply into structure from buffer for XvmcCreateSurface +func xvmcCreateSurfaceReply(buf []byte) *XvmcCreateSurfaceReply { + v := new(XvmcCreateSurfaceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XvmcCreateSurfaceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcCreateSurface +func (c *Conn) xvmcCreateSurfaceRequest(SurfaceId Id, ContextId Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + +// Request XvmcDestroySurface +// size: 8 +type XvmcDestroySurfaceCookie struct { + *cookie +} + +// Write request to wire for XvmcDestroySurface +func (c *Conn) XvmcDestroySurface(SurfaceId Id) XvmcDestroySurfaceCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) + return XvmcDestroySurfaceCookie{cookie} +} + +func (c *Conn) XvmcDestroySurfaceChecked(SurfaceId Id) XvmcDestroySurfaceCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) + return XvmcDestroySurfaceCookie{cookie} +} + +func (cook XvmcDestroySurfaceCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcDestroySurface +func (c *Conn) xvmcDestroySurfaceRequest(SurfaceId Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + return buf +} + +// Request XvmcCreateSubpicture +// size: 20 +type XvmcCreateSubpictureCookie struct { + *cookie +} + +func (c *Conn) XvmcCreateSubpicture(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) + return XvmcCreateSubpictureCookie{cookie} +} + +func (c *Conn) XvmcCreateSubpictureUnchecked(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) + return XvmcCreateSubpictureCookie{cookie} +} + +// Request reply for XvmcCreateSubpicture +// size: (32 + pad((int(Length) * 4))) +type XvmcCreateSubpictureReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + WidthActual uint16 + HeightActual uint16 + NumPaletteEntries uint16 + EntryBytes uint16 + ComponentOrder []byte // size: 4 + // padding: 12 bytes + PrivData []uint32 // size: pad((int(Length) * 4)) +} + +// Waits and reads reply data from request XvmcCreateSubpicture +func (cook XvmcCreateSubpictureCookie) Reply() (*XvmcCreateSubpictureReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcCreateSubpictureReply(buf), nil +} + +// Read reply into structure from buffer for XvmcCreateSubpicture +func xvmcCreateSubpictureReply(buf []byte) *XvmcCreateSubpictureReply { + v := new(XvmcCreateSubpictureReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.WidthActual = Get16(buf[b:]) + b += 2 + + v.HeightActual = Get16(buf[b:]) + b += 2 + + v.NumPaletteEntries = Get16(buf[b:]) + b += 2 + + v.EntryBytes = Get16(buf[b:]) + b += 2 + + v.ComponentOrder = make([]byte, 4) + copy(v.ComponentOrder[:4], buf[b:]) + b += pad(int(4)) + + b += 12 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = Get32(buf[b:]) + b += 4 + } + b = pad(b) + + return v +} + +func (cook XvmcCreateSubpictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcCreateSubpicture +func (c *Conn) xvmcCreateSubpictureRequest(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SubpictureId)) + b += 4 + + Put32(buf[b:], uint32(Context)) + b += 4 + + Put32(buf[b:], XvimageId) + b += 4 + + Put16(buf[b:], Width) + b += 2 + + Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request XvmcDestroySubpicture +// size: 8 +type XvmcDestroySubpictureCookie struct { + *cookie +} + +// Write request to wire for XvmcDestroySubpicture +func (c *Conn) XvmcDestroySubpicture(SubpictureId Id) XvmcDestroySubpictureCookie { + cookie := c.newCookie(false, false) + c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) + return XvmcDestroySubpictureCookie{cookie} +} + +func (c *Conn) XvmcDestroySubpictureChecked(SubpictureId Id) XvmcDestroySubpictureCookie { + cookie := c.newCookie(true, false) + c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) + return XvmcDestroySubpictureCookie{cookie} +} + +func (cook XvmcDestroySubpictureCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcDestroySubpicture +func (c *Conn) xvmcDestroySubpictureRequest(SubpictureId Id) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(SubpictureId)) + b += 4 + + return buf +} + +// Request XvmcListSubpictureTypes +// size: 12 +type XvmcListSubpictureTypesCookie struct { + *cookie +} + +func (c *Conn) XvmcListSubpictureTypes(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie { + cookie := c.newCookie(true, true) + c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) + return XvmcListSubpictureTypesCookie{cookie} +} + +func (c *Conn) XvmcListSubpictureTypesUnchecked(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie { + cookie := c.newCookie(false, true) + c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) + return XvmcListSubpictureTypesCookie{cookie} +} + +// Request reply for XvmcListSubpictureTypes +// size: (32 + XvImageFormatInfoListSize(Types)) +type XvmcListSubpictureTypesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Num uint32 + // padding: 20 bytes + Types []XvImageFormatInfo // size: XvImageFormatInfoListSize(Types) +} + +// Waits and reads reply data from request XvmcListSubpictureTypes +func (cook XvmcListSubpictureTypesCookie) Reply() (*XvmcListSubpictureTypesReply, error) { + buf, err := cook.reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return xvmcListSubpictureTypesReply(buf), nil +} + +// Read reply into structure from buffer for XvmcListSubpictureTypes +func xvmcListSubpictureTypesReply(buf []byte) *XvmcListSubpictureTypesReply { + v := new(XvmcListSubpictureTypesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = Get16(buf[b:]) + b += 2 + + v.Length = Get32(buf[b:]) // 4-byte units + b += 4 + + v.Num = Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Types = make([]XvImageFormatInfo, v.Num) + b += ReadXvImageFormatInfoList(buf[b:], v.Types) + + return v +} + +func (cook XvmcListSubpictureTypesCookie) Check() error { + return cook.check() +} + +// Write request to wire for XvmcListSubpictureTypes +func (c *Conn) xvmcListSubpictureTypesRequest(PortId Id, SurfaceId Id) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + Put32(buf[b:], uint32(PortId)) + b += 4 + + Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + return buf +} From 6d545e723a7e972998a0e77adcf2219a31a9b800 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 17:48:40 -0400 Subject: [PATCH 22/90] add more extension cruft. make extension checking more uniform. --- nexgb/xgbgen/context.go | 38 ++++++++++++++++++++++++++++++++ nexgb/xgbgen/go_error.go | 2 +- nexgb/xgbgen/go_event.go | 14 ++++++++++-- nexgb/xgbgen/go_request_reply.go | 8 +++---- nexgb/xgbgen/protocol.go | 2 +- nexgb/xgbgen/request_reply.go | 4 ++-- nexgb/xgbgen/translation.go | 2 +- 7 files changed, 59 insertions(+), 11 deletions(-) diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index d433531..35dd37e 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -5,6 +5,7 @@ import ( "encoding/xml" "fmt" "log" + "strings" "time" ) @@ -70,6 +71,43 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("") } + // If this is an extension, create a function to initialize the extension + // before it can be used. + if c.protocol.isExt() { + name := strings.Title(c.protocol.Name) + "Init" + xname := c.protocol.ExtXName + + c.Putln("// %s must be called before using the %s extension.", + name, xname) + c.Putln("func (c *Conn) %s() error {", name) + c.Putln("reply, err := c.QueryExtension(%d, \"%s\").Reply()", + len(xname), xname) + c.Putln("switch {") + c.Putln("case err != nil:") + c.Putln("return err") + c.Putln("case !reply.Present:") + c.Putln("return newError(\"No extension named %s could be found on " + + "on the server.\")", xname) + c.Putln("}") + c.Putln("") + c.Putln("c.extLock.Lock()") + c.Putln("c.extensions[\"%s\"] = reply.MajorOpcode", xname) + c.Putln("for evNum, fun := range newExtEventFuncs[\"%s\"] {", xname) + c.Putln("newEventFuncs[int(reply.FirstEvent) + evNum] = fun") + c.Putln("}") + c.Putln("c.extLock.Unlock()") + c.Putln("") + c.Putln("return nil") + c.Putln("}") + c.Putln("") + + // Make sure newExtEventFuncs["EXT_NAME"] map is initialized. + c.Putln("func init() {") + c.Putln("newExtEventFuncs[\"%s\"] = make(map[int]newEventFun)", xname) + c.Putln("}") + c.Putln("") + } + // Now write Go source code for _, typ := range c.protocol.Types { typ.Define(c) diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 152db8b..0222289 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -64,7 +64,7 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("}") c.Putln("") c.Putln("func (err %s) BadId() Id {", e.ErrType()) - if c.protocol.Name == "xproto" { + if !c.protocol.isExt() { c.Putln("return Id(err.BadValue)") } else { c.Putln("return 0") diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index 9bc6dfe..ce54e19 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -47,7 +47,12 @@ func (e *Event) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + if c.protocol.isExt() { + c.Putln("newExtEventFuncs[\"%s\"][%d] = New%s", + c.protocol.ExtXName, e.Number, e.EvType()) + } else { + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + } c.Putln("}") c.Putln("") } @@ -130,7 +135,12 @@ func (e *EventCopy) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + if c.protocol.isExt() { + c.Putln("newExtEventFuncs[\"%s\"][%d] = New%s", + c.protocol.ExtXName, e.Number, e.EvType()) + } else { + c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + } c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index e64e2a2..451667f 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -118,7 +118,7 @@ func (r *Request) WriteRequest(c *Context) { c.Putln("b := 0") c.Putln("buf := make([]byte, size)") c.Putln("") - if strings.ToLower(c.protocol.Name) != "xproto" { + if c.protocol.isExt() { c.Putln("buf[b] = c.extensions[\"%s\"]", strings.ToUpper(c.protocol.ExtXName)) c.Putln("b += 1") @@ -128,17 +128,17 @@ func (r *Request) WriteRequest(c *Context) { c.Putln("b += 1") c.Putln("") if len(r.Fields) == 0 { - if strings.ToLower(c.protocol.Name) == "xproto" { + if !c.protocol.isExt() { c.Putln("b += 1 // padding") } writeSize() - } else if strings.ToLower(c.protocol.Name) != "xproto" { + } else if c.protocol.isExt() { writeSize() } for i, field := range r.Fields { field.Write(c, "") c.Putln("") - if i == 0 && strings.ToLower(c.protocol.Name) == "xproto" { + if i == 0 && !c.protocol.isExt() { writeSize() } } diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go index 505b400..e01bc17 100644 --- a/nexgb/xgbgen/protocol.go +++ b/nexgb/xgbgen/protocol.go @@ -36,6 +36,6 @@ func (p *Protocol) Initialize() { // isExt returns true if this protocol is an extension. // i.e., it's name isn't "xproto". func (p *Protocol) isExt() bool { - return strings.ToLower(p.Name) == "xproto" + return strings.ToLower(p.Name) != "xproto" } diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index 7cd2859..c7a4cf8 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -22,7 +22,7 @@ type Request struct { // It also initializes the reply if one exists, and all fields in this request. func (r *Request) Initialize(p *Protocol) { r.srcName = SrcName(p, r.xmlName) - if p.Name != "xproto" { + if p.isExt() { r.srcName = strings.Title(strings.ToLower(p.Name)) + r.srcName } @@ -93,7 +93,7 @@ func (r *Request) Size(c *Context) Size { // request. In an extension request, this byte is always occupied // by the opcode of the request (while the first byte is always occupied // by the opcode of the extension). - if c.protocol.Name == "xproto" { + if !c.protocol.isExt() { size = size.Add(newFixedSize(3)) } else { size = size.Add(newFixedSize(4)) diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 90cd0f3..592c152 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -410,7 +410,7 @@ func TypeSrcName(p *Protocol, typ Type) string { // Since there is no namespace, we need to look for a namespace // in the current context. niceType := splitAndTitle(t) - if p.Name != "xproto" { + if p.isExt() { for _, typ2 := range p.Types { if t == typ2.XmlName() { return strings.Title(p.Name) + niceType From fd30f1512a713ae5b3cbacddfe9f29dfccc82047 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 01:00:45 -0400 Subject: [PATCH 23/90] added tests --- nexgb/Makefile | 6 + nexgb/auto_bigreq.go | 26 ++- nexgb/auto_composite.go | 38 +++- nexgb/auto_damage.go | 36 +++- nexgb/auto_dpms.go | 30 +++- nexgb/auto_dri2.go | 30 +++- nexgb/auto_ge.go | 34 +++- nexgb/auto_glx.go | 40 ++++- nexgb/auto_randr.go | 38 +++- nexgb/auto_record.go | 38 +++- nexgb/auto_render.go | 38 +++- nexgb/auto_res.go | 42 ++++- nexgb/auto_screensaver.go | 52 ++++-- nexgb/auto_shape.go | 28 ++- nexgb/auto_shm.go | 36 +++- nexgb/auto_sync.go | 30 +++- nexgb/auto_xc_misc.go | 42 ++++- nexgb/auto_xevie.go | 30 +++- nexgb/auto_xf86dri.go | 26 ++- nexgb/auto_xf86vidmode.go | 28 ++- nexgb/auto_xfixes.go | 30 +++- nexgb/auto_xinerama.go | 50 ++++-- nexgb/auto_xinput.go | 82 ++++++--- nexgb/auto_xprint.go | 42 ++++- nexgb/auto_xproto.go | 10 +- nexgb/auto_xselinux.go | 50 ++++-- nexgb/auto_xtest.go | 46 +++-- nexgb/auto_xv.go | 36 +++- nexgb/auto_xvmc.go | 38 +++- nexgb/cookie.go | 13 +- nexgb/xgb.go | 98 +++++------ nexgb/xgb_help.go | 7 + nexgb/xgb_test.go | 358 ++++++++++++++++++++++++++++++++++++++ 33 files changed, 1264 insertions(+), 264 deletions(-) create mode 100644 nexgb/xgb_test.go diff --git a/nexgb/Makefile b/nexgb/Makefile index b1ef0ca..c70b01c 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -14,3 +14,9 @@ all: bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ %.xml: xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > auto_$*.go +test: + go test + +bench: + go test -run 'nomatch' -bench '.*' -cpu 1,2,6 + diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go index d008bce..3389470 100644 --- a/nexgb/auto_bigreq.go +++ b/nexgb/auto_bigreq.go @@ -1,10 +1,34 @@ package xgb /* - This file was generated by bigreq.xml on May 6 2012 3:00:43am EDT. + This file was generated by bigreq.xml on May 6 2012 5:48:46pm EDT. This file is automatically generated. Edit at your peril! */ +// BigreqInit must be called before using the BIG-REQUESTS extension. +func (c *Conn) BigreqInit() error { + reply, err := c.QueryExtension(12, "BIG-REQUESTS").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named BIG-REQUESTS could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["BIG-REQUESTS"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["BIG-REQUESTS"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["BIG-REQUESTS"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go index 185e425..aec15c9 100644 --- a/nexgb/auto_composite.go +++ b/nexgb/auto_composite.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by composite.xml on May 6 2012 3:00:43am EDT. + This file was generated by composite.xml on May 6 2012 5:48:46pm EDT. This file is automatically generated. Edit at your peril! */ @@ -10,15 +10,29 @@ package xgb // import "xproto" // import "xfixes" -// Skipping definition for base type 'Float' +// CompositeInit must be called before using the Composite extension. +func (c *Conn) CompositeInit() error { + reply, err := c.QueryExtension(9, "Composite").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named Composite could be found on on the server.") + } -// Skipping definition for base type 'Id' + c.extLock.Lock() + c.extensions["Composite"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["Composite"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card8' + return nil +} -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' +func init() { + newExtEventFuncs["Composite"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Void' @@ -36,6 +50,16 @@ package xgb // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( CompositeRedirectAutomatic = 0 CompositeRedirectManual = 1 diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index c875016..8339e6a 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 6 2012 3:00:43am EDT. + This file was generated by damage.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -10,13 +10,29 @@ package xgb // import "xproto" // import "xfixes" -// Skipping definition for base type 'Card16' +// DamageInit must be called before using the DAMAGE extension. +func (c *Conn) DamageInit() error { + reply, err := c.QueryExtension(6, "DAMAGE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named DAMAGE could be found on on the server.") + } -// Skipping definition for base type 'Char' + c.extLock.Lock() + c.extensions["DAMAGE"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["DAMAGE"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card32' + return nil +} -// Skipping definition for base type 'Double' +func init() { + newExtEventFuncs["DAMAGE"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Bool' @@ -36,6 +52,14 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 @@ -144,7 +168,7 @@ func (v DamageNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewDamageNotifyEvent + newExtEventFuncs["DAMAGE"][0] = NewDamageNotifyEvent } // Error definition DamageBadDamage (0) diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go index a1f733b..eee6688 100644 --- a/nexgb/auto_dpms.go +++ b/nexgb/auto_dpms.go @@ -1,10 +1,36 @@ package xgb /* - This file was generated by dpms.xml on May 6 2012 3:00:44am EDT. + This file was generated by dpms.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ +// DpmsInit must be called before using the DPMS extension. +func (c *Conn) DpmsInit() error { + reply, err := c.QueryExtension(4, "DPMS").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named DPMS could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["DPMS"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["DPMS"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["DPMS"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -29,8 +55,6 @@ package xgb // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - const ( DpmsDPMSModeOn = 0 DpmsDPMSModeStandby = 1 diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go index 7797623..0712891 100644 --- a/nexgb/auto_dri2.go +++ b/nexgb/auto_dri2.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dri2.xml on May 6 2012 3:00:44am EDT. + This file was generated by dri2.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,30 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// Dri2Init must be called before using the DRI2 extension. +func (c *Conn) Dri2Init() error { + reply, err := c.QueryExtension(4, "DRI2").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named DRI2 could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["DRI2"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["DRI2"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["DRI2"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -306,7 +330,7 @@ func (v Dri2BufferSwapCompleteEvent) String() string { } func init() { - newEventFuncs[0] = NewDri2BufferSwapCompleteEvent + newExtEventFuncs["DRI2"][0] = NewDri2BufferSwapCompleteEvent } // Event definition Dri2InvalidateBuffers (1) @@ -369,7 +393,7 @@ func (v Dri2InvalidateBuffersEvent) String() string { } func init() { - newEventFuncs[1] = NewDri2InvalidateBuffersEvent + newExtEventFuncs["DRI2"][1] = NewDri2InvalidateBuffersEvent } // Request Dri2QueryVersion diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go index d9f52c1..9a06265 100644 --- a/nexgb/auto_ge.go +++ b/nexgb/auto_ge.go @@ -1,17 +1,33 @@ package xgb /* - This file was generated by ge.xml on May 6 2012 3:00:44am EDT. + This file was generated by ge.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Id' +// GeInit must be called before using the Generic Event Extension extension. +func (c *Conn) GeInit() error { + reply, err := c.QueryExtension(23, "Generic Event Extension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named Generic Event Extension could be found on on the server.") + } -// Skipping definition for base type 'Card8' + c.extLock.Lock() + c.extensions["Generic Event Extension"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["Generic Event Extension"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Int16' + return nil +} -// Skipping definition for base type 'Int32' +func init() { + newExtEventFuncs["Generic Event Extension"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Void' @@ -31,6 +47,14 @@ package xgb // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Request GeQueryVersion // size: 8 type GeQueryVersionCookie struct { diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go index 4b6b2c5..1b88e6c 100644 --- a/nexgb/auto_glx.go +++ b/nexgb/auto_glx.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by glx.xml on May 6 2012 3:00:44am EDT. + This file was generated by glx.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,15 +9,29 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" -// Skipping definition for base type 'Card16' +// GlxInit must be called before using the GLX extension. +func (c *Conn) GlxInit() error { + reply, err := c.QueryExtension(3, "GLX").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named GLX could be found on on the server.") + } -// Skipping definition for base type 'Char' + c.extLock.Lock() + c.extensions["GLX"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["GLX"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card32' + return nil +} -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' +func init() { + newExtEventFuncs["GLX"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Float' @@ -35,6 +49,16 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( GlxPbcetDamaged = 32791 GlxPbcetSaved = 32792 @@ -232,7 +256,7 @@ func (v GlxPbufferClobberEvent) String() string { } func init() { - newEventFuncs[0] = NewGlxPbufferClobberEvent + newExtEventFuncs["GLX"][0] = NewGlxPbufferClobberEvent } // Error definition GlxGeneric (-1) diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index bb092f5..cc5e760 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 6 2012 3:00:44am EDT. + This file was generated by randr.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -10,13 +10,29 @@ package xgb // import "xproto" // import "render" -// Skipping definition for base type 'Int32' +// RandrInit must be called before using the RANDR extension. +func (c *Conn) RandrInit() error { + reply, err := c.QueryExtension(5, "RANDR").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named RANDR could be found on on the server.") + } -// Skipping definition for base type 'Void' + c.extLock.Lock() + c.extensions["RANDR"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["RANDR"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Byte' + return nil +} -// Skipping definition for base type 'Int8' +func init() { + newExtEventFuncs["RANDR"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Card16' @@ -36,6 +52,14 @@ package xgb // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 @@ -963,7 +987,7 @@ func (v RandrScreenChangeNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewRandrScreenChangeNotifyEvent + newExtEventFuncs["RANDR"][0] = NewRandrScreenChangeNotifyEvent } // Event definition RandrNotify (1) @@ -1031,7 +1055,7 @@ func (v RandrNotifyEvent) String() string { } func init() { - newEventFuncs[1] = NewRandrNotifyEvent + newExtEventFuncs["RANDR"][1] = NewRandrNotifyEvent } // Error definition RandrBadOutput (0) diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go index 75caf76..6fb966b 100644 --- a/nexgb/auto_record.go +++ b/nexgb/auto_record.go @@ -1,10 +1,40 @@ package xgb /* - This file was generated by record.xml on May 6 2012 3:00:44am EDT. + This file was generated by record.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ +// RecordInit must be called before using the RECORD extension. +func (c *Conn) RecordInit() error { + reply, err := c.QueryExtension(6, "RECORD").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named RECORD could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["RECORD"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["RECORD"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["RECORD"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -25,12 +55,6 @@ package xgb // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - const ( RecordHTypeFromServerTime = 1 RecordHTypeFromClientTime = 2 diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index f6b37b7..c9fc097 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 6 2012 3:00:44am EDT. + This file was generated by render.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,36 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// RenderInit must be called before using the RENDER extension. +func (c *Conn) RenderInit() error { + reply, err := c.QueryExtension(6, "RENDER").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named RENDER could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["RENDER"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["RENDER"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["RENDER"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -29,12 +59,6 @@ package xgb // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go index 066bad8..d3f0f0b 100644 --- a/nexgb/auto_res.go +++ b/nexgb/auto_res.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by res.xml on May 6 2012 3:00:44am EDT. + This file was generated by res.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,17 +9,29 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" -// Skipping definition for base type 'Card16' +// ResInit must be called before using the X-Resource extension. +func (c *Conn) ResInit() error { + reply, err := c.QueryExtension(10, "X-Resource").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named X-Resource could be found on on the server.") + } -// Skipping definition for base type 'Char' + c.extLock.Lock() + c.extensions["X-Resource"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["X-Resource"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card32' + return nil +} -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' +func init() { + newExtEventFuncs["X-Resource"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Id' @@ -35,6 +47,18 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // 'ResClient' struct definition // Size: 8 type ResClient struct { diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go index c023eec..1e47b91 100644 --- a/nexgb/auto_screensaver.go +++ b/nexgb/auto_screensaver.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by screensaver.xml on May 6 2012 3:00:44am EDT. + This file was generated by screensaver.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,42 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// ScreensaverInit must be called before using the MIT-SCREEN-SAVER extension. +func (c *Conn) ScreensaverInit() error { + reply, err := c.QueryExtension(16, "MIT-SCREEN-SAVER").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named MIT-SCREEN-SAVER could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["MIT-SCREEN-SAVER"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -23,18 +59,6 @@ package xgb // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - const ( ScreensaverKindBlanked = 0 ScreensaverKindInternal = 1 @@ -182,7 +206,7 @@ func (v ScreensaverNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewScreensaverNotifyEvent + newExtEventFuncs["MIT-SCREEN-SAVER"][0] = NewScreensaverNotifyEvent } // Request ScreensaverQueryVersion diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go index b5c5f04..a28836c 100644 --- a/nexgb/auto_shape.go +++ b/nexgb/auto_shape.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shape.xml on May 6 2012 3:00:44am EDT. + This file was generated by shape.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,30 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// ShapeInit must be called before using the SHAPE extension. +func (c *Conn) ShapeInit() error { + reply, err := c.QueryExtension(5, "SHAPE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named SHAPE could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["SHAPE"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["SHAPE"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["SHAPE"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -177,7 +201,7 @@ func (v ShapeNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewShapeNotifyEvent + newExtEventFuncs["SHAPE"][0] = NewShapeNotifyEvent } // Request ShapeQueryVersion diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go index 5b7ba28..514dc03 100644 --- a/nexgb/auto_shm.go +++ b/nexgb/auto_shm.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shm.xml on May 6 2012 3:00:44am EDT. + This file was generated by shm.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,34 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// ShmInit must be called before using the MIT-SHM extension. +func (c *Conn) ShmInit() error { + reply, err := c.QueryExtension(7, "MIT-SHM").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named MIT-SHM could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["MIT-SHM"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["MIT-SHM"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["MIT-SHM"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -31,10 +59,6 @@ package xgb // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // Skipping resource definition of 'Seg' // Event definition ShmCompletion (0) @@ -134,7 +158,7 @@ func (v ShmCompletionEvent) String() string { } func init() { - newEventFuncs[0] = NewShmCompletionEvent + newExtEventFuncs["MIT-SHM"][0] = NewShmCompletionEvent } // ErrorCopy definition ShmBadSeg (0) diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go index e87c488..a59cf20 100644 --- a/nexgb/auto_sync.go +++ b/nexgb/auto_sync.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by sync.xml on May 6 2012 3:00:44am EDT. + This file was generated by sync.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,30 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// SyncInit must be called before using the SYNC extension. +func (c *Conn) SyncInit() error { + reply, err := c.QueryExtension(4, "SYNC").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named SYNC could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["SYNC"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["SYNC"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["SYNC"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -465,7 +489,7 @@ func (v SyncCounterNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewSyncCounterNotifyEvent + newExtEventFuncs["SYNC"][0] = NewSyncCounterNotifyEvent } // Event definition SyncAlarmNotify (1) @@ -572,7 +596,7 @@ func (v SyncAlarmNotifyEvent) String() string { } func init() { - newEventFuncs[1] = NewSyncAlarmNotifyEvent + newExtEventFuncs["SYNC"][1] = NewSyncAlarmNotifyEvent } // Error definition SyncCounter (0) diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go index 48a5d1e..66ad03a 100644 --- a/nexgb/auto_xc_misc.go +++ b/nexgb/auto_xc_misc.go @@ -1,21 +1,33 @@ package xgb /* - This file was generated by xc_misc.xml on May 6 2012 3:00:44am EDT. + This file was generated by xc_misc.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Float' +// Xc_miscInit must be called before using the XC-MISC extension. +func (c *Conn) Xc_miscInit() error { + reply, err := c.QueryExtension(7, "XC-MISC").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XC-MISC could be found on on the server.") + } -// Skipping definition for base type 'Id' + c.extLock.Lock() + c.extensions["XC-MISC"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XC-MISC"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card8' + return nil +} -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' +func init() { + newExtEventFuncs["XC-MISC"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Byte' @@ -31,6 +43,18 @@ package xgb // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + // Request Xc_miscGetVersion // size: 8 type Xc_miscGetVersionCookie struct { diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go index fbc1d92..eed775e 100644 --- a/nexgb/auto_xevie.go +++ b/nexgb/auto_xevie.go @@ -1,10 +1,36 @@ package xgb /* - This file was generated by xevie.xml on May 6 2012 3:00:44am EDT. + This file was generated by xevie.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ +// XevieInit must be called before using the XEVIE extension. +func (c *Conn) XevieInit() error { + reply, err := c.QueryExtension(5, "XEVIE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XEVIE could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XEVIE"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XEVIE"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XEVIE"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -29,8 +55,6 @@ package xgb // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - const ( XevieDatatypeUnmodified = 0 XevieDatatypeModified = 1 diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go index 1dbe77c..7407d24 100644 --- a/nexgb/auto_xf86dri.go +++ b/nexgb/auto_xf86dri.go @@ -1,10 +1,34 @@ package xgb /* - This file was generated by xf86dri.xml on May 6 2012 3:00:44am EDT. + This file was generated by xf86dri.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ +// Xf86driInit must be called before using the XFree86-DRI extension. +func (c *Conn) Xf86driInit() error { + reply, err := c.QueryExtension(11, "XFree86-DRI").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XFree86-DRI could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XFree86-DRI"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XFree86-DRI"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XFree86-DRI"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go index aefadf7..649244d 100644 --- a/nexgb/auto_xf86vidmode.go +++ b/nexgb/auto_xf86vidmode.go @@ -1,11 +1,33 @@ package xgb /* - This file was generated by xf86vidmode.xml on May 6 2012 3:00:44am EDT. + This file was generated by xf86vidmode.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Card16' +// Xf86vidmodeInit must be called before using the XFree86-VidModeExtension extension. +func (c *Conn) Xf86vidmodeInit() error { + reply, err := c.QueryExtension(24, "XFree86-VidModeExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XFree86-VidModeExtension could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XFree86-VidModeExtension"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XFree86-VidModeExtension"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XFree86-VidModeExtension"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Char' @@ -31,6 +53,8 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + const ( Xf86vidmodeModeFlagPositiveHsync = 1 Xf86vidmodeModeFlagNegativeHsync = 2 diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go index 9f1d105..aae1afb 100644 --- a/nexgb/auto_xfixes.go +++ b/nexgb/auto_xfixes.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xfixes.xml on May 6 2012 3:00:44am EDT. + This file was generated by xfixes.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -11,6 +11,30 @@ package xgb // import "render" // import "shape" +// XfixesInit must be called before using the XFIXES extension. +func (c *Conn) XfixesInit() error { + reply, err := c.QueryExtension(6, "XFIXES").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XFIXES could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XFIXES"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XFIXES"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XFIXES"] = make(map[int]newEventFun) +} + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -178,7 +202,7 @@ func (v XfixesSelectionNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewXfixesSelectionNotifyEvent + newExtEventFuncs["XFIXES"][0] = NewXfixesSelectionNotifyEvent } // Event definition XfixesCursorNotify (1) @@ -273,7 +297,7 @@ func (v XfixesCursorNotifyEvent) String() string { } func init() { - newEventFuncs[1] = NewXfixesCursorNotifyEvent + newExtEventFuncs["XFIXES"][1] = NewXfixesCursorNotifyEvent } // Error definition XfixesBadRegion (0) diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index 6c08447..d751710 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 6 2012 3:00:45am EDT. + This file was generated by xinerama.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,42 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// XineramaInit must be called before using the XINERAMA extension. +func (c *Conn) XineramaInit() error { + reply, err := c.QueryExtension(8, "XINERAMA").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XINERAMA could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XINERAMA"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XINERAMA"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XINERAMA"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -23,18 +59,6 @@ package xgb // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // 'XineramaScreenInfo' struct definition // Size: 8 type XineramaScreenInfo struct { diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go index d300bca..ae122b8 100644 --- a/nexgb/auto_xinput.go +++ b/nexgb/auto_xinput.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinput.xml on May 6 2012 3:00:45am EDT. + This file was generated by xinput.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,42 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// XinputInit must be called before using the XInputExtension extension. +func (c *Conn) XinputInit() error { + reply, err := c.QueryExtension(15, "XInputExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XInputExtension could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XInputExtension"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XInputExtension"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XInputExtension"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -23,18 +59,6 @@ package xgb // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( XinputValuatorModeRelative = 0 XinputValuatorModeAbsolute = 1 @@ -3307,7 +3331,7 @@ func (v XinputDeviceValuatorEvent) String() string { } func init() { - newEventFuncs[0] = NewXinputDeviceValuatorEvent + newExtEventFuncs["XInputExtension"][0] = NewXinputDeviceValuatorEvent } // Event definition XinputDeviceKeyPress (1) @@ -3461,7 +3485,7 @@ func (v XinputDeviceKeyPressEvent) String() string { } func init() { - newEventFuncs[1] = NewXinputDeviceKeyPressEvent + newExtEventFuncs["XInputExtension"][1] = NewXinputDeviceKeyPressEvent } // Event definition XinputFocusIn (6) @@ -3556,7 +3580,7 @@ func (v XinputFocusInEvent) String() string { } func init() { - newEventFuncs[6] = NewXinputFocusInEvent + newExtEventFuncs["XInputExtension"][6] = NewXinputFocusInEvent } // Event definition XinputDeviceStateNotify (10) @@ -3684,7 +3708,7 @@ func (v XinputDeviceStateNotifyEvent) String() string { } func init() { - newEventFuncs[10] = NewXinputDeviceStateNotifyEvent + newExtEventFuncs["XInputExtension"][10] = NewXinputDeviceStateNotifyEvent } // Event definition XinputDeviceMappingNotify (11) @@ -3784,7 +3808,7 @@ func (v XinputDeviceMappingNotifyEvent) String() string { } func init() { - newEventFuncs[11] = NewXinputDeviceMappingNotifyEvent + newExtEventFuncs["XInputExtension"][11] = NewXinputDeviceMappingNotifyEvent } // Event definition XinputChangeDeviceNotify (12) @@ -3863,7 +3887,7 @@ func (v XinputChangeDeviceNotifyEvent) String() string { } func init() { - newEventFuncs[12] = NewXinputChangeDeviceNotifyEvent + newExtEventFuncs["XInputExtension"][12] = NewXinputChangeDeviceNotifyEvent } // Event definition XinputDeviceKeyStateNotify (13) @@ -3929,7 +3953,7 @@ func (v XinputDeviceKeyStateNotifyEvent) String() string { } func init() { - newEventFuncs[13] = NewXinputDeviceKeyStateNotifyEvent + newExtEventFuncs["XInputExtension"][13] = NewXinputDeviceKeyStateNotifyEvent } // Event definition XinputDeviceButtonStateNotify (14) @@ -3995,7 +4019,7 @@ func (v XinputDeviceButtonStateNotifyEvent) String() string { } func init() { - newEventFuncs[14] = NewXinputDeviceButtonStateNotifyEvent + newExtEventFuncs["XInputExtension"][14] = NewXinputDeviceButtonStateNotifyEvent } // Event definition XinputDevicePresenceNotify (15) @@ -4087,7 +4111,7 @@ func (v XinputDevicePresenceNotifyEvent) String() string { } func init() { - newEventFuncs[15] = NewXinputDevicePresenceNotifyEvent + newExtEventFuncs["XInputExtension"][15] = NewXinputDevicePresenceNotifyEvent } // EventCopy definition XinputDeviceKeyRelease (2) @@ -4129,7 +4153,7 @@ func (v XinputDeviceKeyReleaseEvent) String() string { } func init() { - newEventFuncs[2] = NewXinputDeviceKeyReleaseEvent + newExtEventFuncs["XInputExtension"][2] = NewXinputDeviceKeyReleaseEvent } // EventCopy definition XinputDeviceButtonPress (3) @@ -4171,7 +4195,7 @@ func (v XinputDeviceButtonPressEvent) String() string { } func init() { - newEventFuncs[3] = NewXinputDeviceButtonPressEvent + newExtEventFuncs["XInputExtension"][3] = NewXinputDeviceButtonPressEvent } // EventCopy definition XinputDeviceButtonRelease (4) @@ -4213,7 +4237,7 @@ func (v XinputDeviceButtonReleaseEvent) String() string { } func init() { - newEventFuncs[4] = NewXinputDeviceButtonReleaseEvent + newExtEventFuncs["XInputExtension"][4] = NewXinputDeviceButtonReleaseEvent } // EventCopy definition XinputDeviceMotionNotify (5) @@ -4255,7 +4279,7 @@ func (v XinputDeviceMotionNotifyEvent) String() string { } func init() { - newEventFuncs[5] = NewXinputDeviceMotionNotifyEvent + newExtEventFuncs["XInputExtension"][5] = NewXinputDeviceMotionNotifyEvent } // EventCopy definition XinputProximityIn (8) @@ -4297,7 +4321,7 @@ func (v XinputProximityInEvent) String() string { } func init() { - newEventFuncs[8] = NewXinputProximityInEvent + newExtEventFuncs["XInputExtension"][8] = NewXinputProximityInEvent } // EventCopy definition XinputProximityOut (9) @@ -4339,7 +4363,7 @@ func (v XinputProximityOutEvent) String() string { } func init() { - newEventFuncs[9] = NewXinputProximityOutEvent + newExtEventFuncs["XInputExtension"][9] = NewXinputProximityOutEvent } // EventCopy definition XinputFocusOut (7) @@ -4374,7 +4398,7 @@ func (v XinputFocusOutEvent) String() string { } func init() { - newEventFuncs[7] = NewXinputFocusOutEvent + newExtEventFuncs["XInputExtension"][7] = NewXinputFocusOutEvent } // Error definition XinputDevice (0) diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go index 6790a86..6c9be85 100644 --- a/nexgb/auto_xprint.go +++ b/nexgb/auto_xprint.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xprint.xml on May 6 2012 3:00:45am EDT. + This file was generated by xprint.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,15 +9,29 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" -// Skipping definition for base type 'Card16' +// XprintInit must be called before using the XpExtension extension. +func (c *Conn) XprintInit() error { + reply, err := c.QueryExtension(11, "XpExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XpExtension could be found on on the server.") + } -// Skipping definition for base type 'Char' + c.extLock.Lock() + c.extensions["XpExtension"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XpExtension"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card32' + return nil +} -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' +func init() { + newExtEventFuncs["XpExtension"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Float' @@ -35,6 +49,16 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( XprintGetDocFinished = 0 XprintGetDocSecondConsumer = 1 @@ -241,7 +265,7 @@ func (v XprintNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewXprintNotifyEvent + newExtEventFuncs["XpExtension"][0] = NewXprintNotifyEvent } // Event definition XprintAttributNotify (1) @@ -307,7 +331,7 @@ func (v XprintAttributNotifyEvent) String() string { } func init() { - newEventFuncs[1] = NewXprintAttributNotifyEvent + newExtEventFuncs["XpExtension"][1] = NewXprintAttributNotifyEvent } // Error definition XprintBadContext (0) diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index edee988..84b193d 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,14 +1,10 @@ package xgb /* - This file was generated by xproto.xml on May 6 2012 3:00:45am EDT. + This file was generated by xproto.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -31,6 +27,10 @@ package xgb // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go index 57908c2..e3dfbf3 100644 --- a/nexgb/auto_xselinux.go +++ b/nexgb/auto_xselinux.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xselinux.xml on May 6 2012 3:00:45am EDT. + This file was generated by xselinux.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,42 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// XselinuxInit must be called before using the SELinux extension. +func (c *Conn) XselinuxInit() error { + reply, err := c.QueryExtension(7, "SELinux").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named SELinux could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["SELinux"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["SELinux"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["SELinux"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -23,18 +59,6 @@ package xgb // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // 'XselinuxListItem' struct definition // Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) type XselinuxListItem struct { diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go index 3c4ce7c..565c3d1 100644 --- a/nexgb/auto_xtest.go +++ b/nexgb/auto_xtest.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xtest.xml on May 6 2012 3:00:45am EDT. + This file was generated by xtest.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,40 @@ package xgb // in one package. They are still listed here for reference. // import "xproto" +// XtestInit must be called before using the XTEST extension. +func (c *Conn) XtestInit() error { + reply, err := c.QueryExtension(5, "XTEST").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XTEST could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XTEST"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XTEST"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XTEST"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -25,16 +59,6 @@ package xgb // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( XtestCursorNone = 0 XtestCursorCurrent = 1 diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go index 9e560a0..0ce0c64 100644 --- a/nexgb/auto_xv.go +++ b/nexgb/auto_xv.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xv.xml on May 6 2012 3:00:45am EDT. + This file was generated by xv.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -10,11 +10,29 @@ package xgb // import "xproto" // import "shm" -// Skipping definition for base type 'Card8' +// XvInit must be called before using the XVideo extension. +func (c *Conn) XvInit() error { + reply, err := c.QueryExtension(6, "XVideo").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XVideo could be found on on the server.") + } -// Skipping definition for base type 'Int16' + c.extLock.Lock() + c.extensions["XVideo"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XVideo"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Int32' + return nil +} + +func init() { + newExtEventFuncs["XVideo"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Void' @@ -36,6 +54,12 @@ package xgb // Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( XvTypeInputMask = 1 XvTypeOutputMask = 2 @@ -938,7 +962,7 @@ func (v XvVideoNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewXvVideoNotifyEvent + newExtEventFuncs["XVideo"][0] = NewXvVideoNotifyEvent } // Event definition XvPortNotify (1) @@ -1025,7 +1049,7 @@ func (v XvPortNotifyEvent) String() string { } func init() { - newEventFuncs[1] = NewXvPortNotifyEvent + newExtEventFuncs["XVideo"][1] = NewXvPortNotifyEvent } // Error definition XvBadPort (0) diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go index 1d8814d..61eab40 100644 --- a/nexgb/auto_xvmc.go +++ b/nexgb/auto_xvmc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xvmc.xml on May 6 2012 3:00:45am EDT. + This file was generated by xvmc.xml on May 6 2012 5:48:48pm EDT. This file is automatically generated. Edit at your peril! */ @@ -9,6 +9,36 @@ package xgb // in one package. They are still listed here for reference. // import "xv" +// XvmcInit must be called before using the XVideo-MotionCompensation extension. +func (c *Conn) XvmcInit() error { + reply, err := c.QueryExtension(25, "XVideo-MotionCompensation").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named XVideo-MotionCompensation could be found on on the server.") + } + + c.extLock.Lock() + c.extensions["XVideo-MotionCompensation"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["XVideo-MotionCompensation"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() + + return nil +} + +func init() { + newExtEventFuncs["XVideo-MotionCompensation"] = make(map[int]newEventFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -29,12 +59,6 @@ package xgb // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping resource definition of 'Context' // Skipping resource definition of 'Surface' diff --git a/nexgb/cookie.go b/nexgb/cookie.go index 7f54a22..8c0774d 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -9,11 +9,11 @@ import ( // 'cookie' is most frequently used by embedding it into a more specific // kind of cookie, i.e., 'GetInputFocusCookie'. type cookie struct { - conn *Conn - Sequence uint16 + conn *Conn + Sequence uint16 replyChan chan []byte errorChan chan error - pingChan chan bool + pingChan chan bool } // newCookie creates a new cookie with the correct channels initialized @@ -24,11 +24,11 @@ type cookie struct { // corresponding to this cookie is sent over the wire. func (c *Conn) newCookie(checked, reply bool) *cookie { cookie := &cookie{ - conn: c, - Sequence: 0, // we add the sequence id just before sending a request + conn: c, + Sequence: 0, // we add the sequence id just before sending a request replyChan: nil, errorChan: nil, - pingChan: nil, + pingChan: nil, } // There are four different kinds of cookies: @@ -151,4 +151,3 @@ func (c cookie) check() error { } panic("unreachable") } - diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 26c0138..223b6e2 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -12,7 +12,6 @@ import ( "io" "net" "os" - "strings" "sync" ) @@ -22,27 +21,24 @@ const ( // there are many requests without replies made in sequence. Once the // buffer fills, a round trip request is made to clear the buffer. cookieBuffer = 1000 - readBuffer = 100 - writeBuffer = 100 ) // A Conn represents a connection to an X server. type Conn struct { host string conn net.Conn - err error display string defaultScreen int Setup SetupInfo - extensions map[string]byte - eventChan chan eventOrError + eventChan chan eventOrError cookieChan chan *cookie - xidChan chan xid - seqChan chan uint16 - reqChan chan *request + xidChan chan xid + seqChan chan uint16 + reqChan chan *request - extLock sync.Mutex + extLock sync.Mutex + extensions map[string]byte } // NewConn creates a new connection instance. It initializes locks, data @@ -109,9 +105,16 @@ type Event interface { String() string } +type newEventFun func(buf []byte) Event + // newEventFuncs is a map from event numbers to functions that create // the corresponding event. -var newEventFuncs = map[int]func(buf []byte) Event{} +var newEventFuncs = make(map[int]newEventFun) + +// newExtEventFuncs is a temporary map that stores event constructor functions +// for each extension. When an extension is initialize, each event for that +// extension is added to the 'newEventFuncs' map. +var newExtEventFuncs = make(map[string]map[int]newEventFun) // Error is an interface that can contain any of the errors returned by // the server. Use a type assertion switch to extract the Error structs. @@ -144,7 +147,7 @@ func (c *Conn) NewId() (Id, error) { // channel. If no new resource id can be generated, id is set to 0 and a // non-nil error is set in xid.err. type xid struct { - id Id + id Id err error } @@ -174,7 +177,7 @@ func (conn *Conn) generateXIds() { last := uint32(0) for { // TODO: Use the XC Misc extension to look for released ids. - if last > 0 && last >= max - inc + 1 { + if last > 0 && last >= max-inc+1 { conn.xidChan <- xid{ id: Id(0), err: errors.New("There are no more available resource" + @@ -184,7 +187,7 @@ func (conn *Conn) generateXIds() { last += inc conn.xidChan <- xid{ - id: Id(last | conn.Setup.ResourceIdBase), + id: Id(last | conn.Setup.ResourceIdBase), err: nil, } } @@ -206,7 +209,7 @@ func (c *Conn) generateSeqIds() { seqid := uint16(1) for { c.seqChan <- seqid - if seqid == uint16((1 << 16) - 1) { + if seqid == uint16((1<<16)-1) { seqid = 0 } else { seqid++ @@ -218,7 +221,7 @@ func (c *Conn) generateSeqIds() { // and a cookie, which when combined represents a single request. // The cookie is used to match up the reply/error. type request struct { - buf []byte + buf []byte cookie *cookie } @@ -238,7 +241,7 @@ func (c *Conn) sendRequests() { // trip to clear out the cookie buffer. // Note that we circumvent the request channel, because we're *in* // the request channel. - if len(c.cookieChan) == cookieBuffer - 1 { + if len(c.cookieChan) == cookieBuffer-1 { cookie := c.newCookie(true, true) cookie.Sequence = c.newSequenceId() c.cookieChan <- cookie @@ -277,9 +280,9 @@ func (c *Conn) writeBuffer(buf []byte) bool { // Finally, cookies that came "before" this reply are always cleaned up. func (c *Conn) readResponses() { var ( - err Error - event Event - seq uint16 + err Error + event Event + seq uint16 replyBytes []byte ) @@ -300,9 +303,9 @@ func (c *Conn) readResponses() { newErrFun, ok := newErrorFuncs[int(buf[1])] if !ok { fmt.Fprintf(os.Stderr, - "BUG: " + - "Could not find error constructor function for error " + - "with number %d.", buf[1]) + "BUG: "+ + "Could not find error constructor function for error "+ + "with number %d.\n", buf[1]) continue } err = newErrFun(buf) @@ -316,7 +319,7 @@ func (c *Conn) readResponses() { // check to see if this reply has more bytes to be read size := Get32(buf[4:]) if size > 0 { - byteCount := 32 + size * 4 + byteCount := 32 + size*4 biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { @@ -340,9 +343,9 @@ func (c *Conn) readResponses() { newEventFun, ok := newEventFuncs[evNum] if !ok { fmt.Fprintf(os.Stderr, - "BUG: " + - "Could not find event constructor function for event " + - "with number %d.", evNum) + "BUG: "+ + "Could not find event constructor function for event "+ + "with number %d.", evNum) continue } @@ -380,8 +383,8 @@ func (c *Conn) readResponses() { } else { // this is a reply if cookie.replyChan == nil { fmt.Fprintf(os.Stderr, - "Reply with sequence id %d does not have a " + - "cookie with a valid reply channel.\n", seq) + "Reply with sequence id %d does not have a "+ + "cookie with a valid reply channel.\n", seq) continue } else { cookie.replyChan <- replyBytes @@ -394,20 +397,20 @@ func (c *Conn) readResponses() { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: fmt.Fprintf(os.Stderr, - "Found cookie with sequence id %d that is expecting a " + - "reply but will never get it. Currently on sequence " + - "number %d\n", cookie.Sequence, seq) + "Found cookie with sequence id %d that is expecting a "+ + "reply but will never get it. Currently on sequence "+ + "number %d\n", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: fmt.Fprintf(os.Stderr, - "Found cookie with sequence id %d that is expecting a " + - "reply (and not an error) but will never get it. " + - "Currently on sequence number %d\n", cookie.Sequence, seq) + "Found cookie with sequence id %d that is expecting a "+ + "reply (and not an error) but will never get it. "+ + "Currently on sequence number %d\n", cookie.Sequence, seq) // Checked requests without replies case cookie.pingChan != nil && cookie.errorChan != nil: cookie.pingChan <- true - // Unchecked requests without replies don't have any channels, - // so we can't do anything with them except let them pass by. + // Unchecked requests without replies don't have any channels, + // so we can't do anything with them except let them pass by. } } } @@ -446,24 +449,3 @@ func (c *Conn) PollForEvent() (Event, Error) { } panic("unreachable") } - -// RegisterExtension adds the respective extension's major op code to -// the extensions map. -func (c *Conn) RegisterExtension(name string) error { - nameUpper := strings.ToUpper(name) - reply, err := c.QueryExtension(uint16(len(nameUpper)), nameUpper).Reply() - - switch { - case err != nil: - return err - case !reply.Present: - return errors.New(fmt.Sprintf("No extension named '%s' is present.", - nameUpper)) - } - - c.extLock.Lock() - c.extensions[nameUpper] = reply.MajorOpcode - c.extLock.Unlock() - - return nil -} diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index b54ab41..6d07938 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -1,6 +1,7 @@ package xgb import ( + "errors" "fmt" "strings" ) @@ -16,6 +17,12 @@ func sprintf(format string, v ...interface{}) string { return fmt.Sprintf(format, v...) } +// newError is just a wrapper for errors.New. Exists for the same reason +// that 'stringsJoin' and 'sprintf' exists. +func newError(format string, v ...interface{}) error { + return errors.New(fmt.Sprintf(format, v...)) +} + // Pad a length to align on 4 bytes. func pad(n int) int { return (n + 3) & ^3 diff --git a/nexgb/xgb_test.go b/nexgb/xgb_test.go new file mode 100644 index 0000000..9665164 --- /dev/null +++ b/nexgb/xgb_test.go @@ -0,0 +1,358 @@ +package xgb + +/* + Tests for XGB. + + These tests only test the core X protocol at the moment. It isn't even + close to complete coverage (and probably never will be), but it does test + a number of different corners: requests with no replies, requests without + replies, checked (i.e., synchronous) errors, unchecked (i.e., asynchronous) + errors, and sequence number wrapping. + + There are also a couple of benchmarks that show the difference between + correctly issuing lots of requests and gathering replies and + incorrectly doing the same. (This particular difference is one of the + claimed advantages of the XCB, and therefore XGB, family. +*/ + +import ( + "fmt" + "log" + "math/rand" + "testing" + "time" +) + +// The X connection used throughout testing. +var X *Conn + +// init initializes the X connection, seeds the RNG and starts waiting +// for events. +func init() { + var err error + + X, err = NewConn() + if err != nil { + log.Fatal(err) + } + + rand.Seed(time.Now().UnixNano()) + + go grabEvents() +} + +/******************************************************************************/ +// Tests +/******************************************************************************/ + +// TestSynchronousError purposefully causes a BadLength error in an +// InternAtom request, and checks it synchronously. +func TestSynchronousError(t *testing.T) { + err := X.MapWindowChecked(0).Check() // resource id 0 is always invalid + if err == nil { + t.Fatalf("MapWindow: A MapWindow request that should return an " + + "error has returned a nil error.") + } + verifyMapWindowError(t, err) +} + +// TestAsynchronousError does the same thing as TestSynchronousError, but +// grabs the error asynchronously instead. +func TestAsynchronousError(t *testing.T) { + X.MapWindow(0) // resource id 0 is always invalid + + evOrErr := waitForEvent(t, 5) + if evOrErr.ev != nil { + t.Fatalf("After issuing an erroneous MapWindow request, we have "+ + "received an event rather than an error: %s", evOrErr.ev) + } + verifyMapWindowError(t, evOrErr.err) +} + +// TestCookieBuffer issues (2^16) + n requets *without* replies to guarantee +// that the sequence number wraps and that the cookie buffer will have to +// flush itself (since there are no replies coming in to flush it). +// And just like TestSequenceWrap, we issue another request with a reply +// at the end to make sure XGB is still working properly. +func TestCookieBuffer(t *testing.T) { + n := (1 << 16) + 10 + for i := 0; i < n; i++ { + X.NoOperation() + } + TestProperty(t) +} + +// TestSequenceWrap issues (2^16) + n requests w/ replies to guarantee that the +// sequence number (which is a 16 bit integer) will wrap. It then issues one +// final request to ensure things still work properly. +func TestSequenceWrap(t *testing.T) { + n := (1 << 16) + 10 + for i := 0; i < n; i++ { + _, err := X.InternAtom(false, 5, "RANDO").Reply() + if err != nil { + t.Fatalf("InternAtom: %s", err) + } + } + TestProperty(t) +} + +// TestProperty tests whether a random value can be set and read. +func TestProperty(t *testing.T) { + propName := randString(20) // whatevs + writeVal := randString(20) + readVal, err := changeAndGetProp(propName, writeVal) + if err != nil { + t.Error(err) + } + + if readVal != writeVal { + t.Errorf("The value written, '%s', is not the same as the "+ + "value read '%s'.", writeVal, readVal) + } +} + +// TestWindowEvents creates a window, maps it, listens for configure notify +// events, issues a configure request, and checks for the appropriate +// configure notify event. +// This probably violates the notion of "test one thing and test it well," +// but testing X stuff is unique since it involves so much state. +// Each request is checked to make sure there are no errors returned. If there +// is an error, the test is failed. +// You may see a window appear quickly and then disappear. Do not be alarmed :P +// It's possible that this test will yield a false negative because we cannot +// control our environment. That is, the window manager could override the +// placement set. However, we set override redirect on the window, so the +// window manager *shouldn't* touch our window if it is well-behaved. +func TestWindowEvents(t *testing.T) { + // The geometry to set the window. + gx, gy, gw, gh := 200, 400, 1000, 300 + + wid, err := X.NewId() + if err != nil { + t.Fatalf("NewId: %s", err) + } + + screen := X.DefaultScreen() // alias + err = X.CreateWindowChecked(screen.RootDepth, wid, screen.Root, + 0, 0, 500, 500, 0, + WindowClassInputOutput, screen.RootVisual, + CwBackPixel|CwOverrideRedirect, []uint32{0xffffffff, 1}).Check() + if err != nil { + t.Fatalf("CreateWindow: %s", err) + } + + err = X.MapWindowChecked(wid).Check() + if err != nil { + t.Fatalf("MapWindow: %s", err) + } + + // We don't listen in the CreateWindow request so that we don't get + // a MapNotify event. + err = X.ChangeWindowAttributesChecked(wid, + CwEventMask, []uint32{EventMaskStructureNotify}).Check() + if err != nil { + t.Fatalf("ChangeWindowAttributes: %s", err) + } + + err = X.ConfigureWindowChecked(wid, + ConfigWindowX|ConfigWindowY| + ConfigWindowWidth|ConfigWindowHeight, + []uint32{uint32(gx), uint32(gy), uint32(gw), uint32(gh)}).Check() + if err != nil { + t.Fatalf("ConfigureWindow: %s", err) + } + + evOrErr := waitForEvent(t, 5) + switch event := evOrErr.ev.(type) { + case ConfigureNotifyEvent: + if event.X != int16(gx) { + t.Fatalf("x was set to %d but ConfigureNotify reports %d", + gx, event.X) + } + if event.Y != int16(gy) { + t.Fatalf("y was set to %d but ConfigureNotify reports %d", + gy, event.Y) + } + if event.Width != uint16(gw) { + t.Fatalf("width was set to %d but ConfigureNotify reports %d", + gw, event.Width) + } + if event.Height != uint16(gh) { + t.Fatalf("height was set to %d but ConfigureNotify reports %d", + gh, event.Height) + } + default: + t.Fatalf("Expected a ConfigureNotifyEvent but got %T instead.", event) + } + + // Okay, clean up! + err = X.ChangeWindowAttributesChecked(wid, + CwEventMask, []uint32{0}).Check() + if err != nil { + t.Fatalf("ChangeWindowAttributes: %s", err) + } + + err = X.DestroyWindowChecked(wid).Check() + if err != nil { + t.Fatalf("DestroyWindow: %s", err) + } +} + +/******************************************************************************/ +// Benchmarks +/******************************************************************************/ + +// BenchmarkInternAtomsGood shows how many requests with replies +// *should* be sent and gathered from the server. Namely, send as many +// requests as you can at once, then go back and gather up all the replies. +// More importantly, this approach can exploit parallelism better when +// GOMAXPROCS > 1. +// Run with `go test -run 'nomatch' -bench '.*' -cpu 1,2,6` if you have +// multiple cores to see the improvement that parallelism brings. +func BenchmarkInternAtomsGood(b *testing.B) { + b.StopTimer() + names := seqNames(b.N) + + b.StartTimer() + cookies := make([]InternAtomCookie, b.N) + for i := 0; i < b.N; i++ { + cookies[i] = X.InternAtom(false, uint16(len(names[i])), names[i]) + } + for _, cookie := range cookies { + cookie.Reply() + } +} + +// BenchmarkInternAtomsBad shows how *not* to issue a lot of requests with +// replies. Namely, each subsequent request isn't issued *until* the last +// reply is made. This implies a round trip to the X server for every +// iteration. +func BenchmarkInternAtomsPoor(b *testing.B) { + b.StopTimer() + names := seqNames(b.N) + + b.StartTimer() + for i := 0; i < b.N; i++ { + X.InternAtom(false, uint16(len(names[i])), names[i]).Reply() + } +} + +/******************************************************************************/ +// Helper functions +/******************************************************************************/ + +// changeAndGetProp sets property 'prop' with value 'val'. +// It then gets the value of that property and returns it. +// (It's used to check that the 'val' going in is the same 'val' going out.) +// It tests both requests with and without replies (GetProperty and +// ChangeProperty respectively.) +func changeAndGetProp(prop, val string) (string, error) { + propAtom, err := X.InternAtom(false, uint16(len(prop)), prop).Reply() + if err != nil { + return "", fmt.Errorf("InternAtom: %s", err) + } + + typName := "UTF8_STRING" + typAtom, err := X.InternAtom(false, uint16(len(typName)), typName).Reply() + if err != nil { + return "", fmt.Errorf("InternAtom: %s", err) + } + + err = X.ChangePropertyChecked(PropModeReplace, X.DefaultScreen().Root, + propAtom.Atom, typAtom.Atom, 8, uint32(len(val)), []byte(val)).Check() + if err != nil { + return "", fmt.Errorf("ChangeProperty: %s", err) + } + + reply, err := X.GetProperty(false, X.DefaultScreen().Root, propAtom.Atom, + GetPropertyTypeAny, 0, (1<<32)-1).Reply() + if err != nil { + return "", fmt.Errorf("GetProperty: %s", err) + } + if reply.Format != 8 { + return "", fmt.Errorf("Property reply format is %d but it should be 8.", + reply.Format) + } + + return string(reply.Value), nil +} + +// verifyMapWindowError takes an error that is returned with an invalid +// MapWindow request with a window Id of 0 and makes sure the error is the +// right type and contains the correct values. +func verifyMapWindowError(t *testing.T, err error) { + switch e := err.(type) { + case WindowError: + if e.BadValue != 0 { + t.Fatalf("WindowError should report a bad value of 0 but "+ + "it reports %d instead.", e.BadValue) + } + if e.MajorOpcode != 8 { + t.Fatalf("WindowError should report a major opcode of 8 "+ + "(which is a MapWindow request), but it reports %d instead.", + e.MajorOpcode) + } + default: + t.Fatalf("Expected a WindowError but got %T instead.", e) + } +} + +// randString generates a random string of length n. +func randString(n int) string { + byts := make([]byte, n) + for i := 0; i < n; i++ { + rando := rand.Intn(53) + switch { + case rando <= 25: + byts[i] = byte(65 + rando) + case rando <= 51: + byts[i] = byte(97 + rando - 26) + default: + byts[i] = ' ' + } + } + return string(byts) +} + +// seqNames creates a slice of NAME0, NAME1, ..., NAMEN. +func seqNames(n int) []string { + names := make([]string, n) + for i := range names { + names[i] = fmt.Sprintf("NAME%d", i) + } + return names +} + +// evErr represents a value that is either an event or an error. +type evErr struct { + ev Event + err Error +} + +// channel used to pass evErrs. +var evOrErrChan = make(chan evErr, 0) + +// grabEvents is a goroutine that reads events off the wire. +// We used this instead of WaitForEvent directly in our tests so that +// we can timeout and fail a test. +func grabEvents() { + for { + ev, err := X.WaitForEvent() + evOrErrChan <- evErr{ev, err} + } +} + +// waitForEvent asks the evOrErrChan channel for an event. +// If it doesn't get an event in 'n' seconds, the current test is failed. +func waitForEvent(t *testing.T, n int) evErr { + var evOrErr evErr + + select { + case evOrErr = <-evOrErrChan: + case <-time.After(time.Second * 5): + t.Fatalf("After waiting 5 seconds for an event or an error, " + + "we have timed out.") + } + + return evOrErr +} From 3bf376bd6648e011de9131c1d90a39c6d3890d65 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 01:11:41 -0400 Subject: [PATCH 24/90] 80 cols --- nexgb/xgb.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 223b6e2..581b8fa 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -53,10 +53,10 @@ func NewConn() (*Conn, error) { // If 'display' is empty it will be taken from os.Getenv("DISPLAY"). // // Examples: -// NewConn(":1") -> net.Dial("unix", "", "/tmp/.X11-unix/X1") -// NewConn("/tmp/launch-123/:0") -> net.Dial("unix", "", "/tmp/launch-123/:0") -// NewConn("hostname:2.1") -> net.Dial("tcp", "", "hostname:6002") -// NewConn("tcp/hostname:1.0") -> net.Dial("tcp", "", "hostname:6001") +// NewConn(":1") -> net.Dial("unix", "", "/tmp/.X11-unix/X1") +// NewConn("/tmp/launch-123/:0") -> net.Dial("unix", "", "/tmp/launch-123/:0") +// NewConn("hostname:2.1") -> net.Dial("tcp", "", "hostname:6002") +// NewConn("tcp/hostname:1.0") -> net.Dial("tcp", "", "hostname:6001") func NewConnDisplay(display string) (*Conn, error) { conn := &Conn{} @@ -405,7 +405,8 @@ func (c *Conn) readResponses() { fmt.Fprintf(os.Stderr, "Found cookie with sequence id %d that is expecting a "+ "reply (and not an error) but will never get it. "+ - "Currently on sequence number %d\n", cookie.Sequence, seq) + "Currently on sequence number %d\n", + cookie.Sequence, seq) // Checked requests without replies case cookie.pingChan != nil && cookie.errorChan != nil: cookie.pingChan <- true From dc48249e1acea54b391f53b95f16e515dead7c97 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 04:09:19 -0400 Subject: [PATCH 25/90] lots of docs and examples --- nexgb/Makefile | 6 + nexgb/doc.go | 152 +++++++++++++++++++++++ nexgb/examples/atom.go | 27 ---- nexgb/examples/create-window/main.go | 98 +++++++++++++++ nexgb/examples/doc.go | 21 ++++ nexgb/examples/get-active-window/main.go | 57 +++++++++ nexgb/examples/property.go | 41 ------ nexgb/examples/randr.go | 48 ------- nexgb/examples/randr/main.go | 84 +++++++++++++ nexgb/examples/seq-nowrap.go | 29 ----- nexgb/examples/seq-wrap.go | 24 ---- nexgb/examples/window.go | 61 --------- nexgb/examples/xinerama.go | 29 ----- nexgb/examples/xinerama/main.go | 39 ++++++ nexgb/xgb.go | 6 - nexgb/xgb_test.go | 6 +- nexgb/xgbgen/context.go | 2 +- nexgb/xgbgen/field.go | 4 +- nexgb/xgbgen/go_error.go | 2 +- nexgb/xgbgen/go_event.go | 5 +- nexgb/xgbgen/go_list.go | 1 - nexgb/xgbgen/go_request_reply.go | 18 +-- nexgb/xgbgen/go_union.go | 1 - nexgb/xgbgen/protocol.go | 1 - nexgb/xgbgen/request_reply.go | 4 +- nexgb/xgbgen/translation.go | 2 +- nexgb/xgbgen/xml.go | 32 ++--- 27 files changed, 495 insertions(+), 305 deletions(-) create mode 100644 nexgb/doc.go delete mode 100644 nexgb/examples/atom.go create mode 100644 nexgb/examples/create-window/main.go create mode 100644 nexgb/examples/doc.go create mode 100644 nexgb/examples/get-active-window/main.go delete mode 100644 nexgb/examples/property.go delete mode 100644 nexgb/examples/randr.go create mode 100644 nexgb/examples/randr/main.go delete mode 100644 nexgb/examples/seq-nowrap.go delete mode 100644 nexgb/examples/seq-wrap.go delete mode 100644 nexgb/examples/window.go delete mode 100644 nexgb/examples/xinerama.go create mode 100644 nexgb/examples/xinerama/main.go diff --git a/nexgb/Makefile b/nexgb/Makefile index c70b01c..7ba1cb4 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -1,5 +1,6 @@ # This Makefile is used by the developer. It is not needed in any way to build # a checkout of the XGB repository. +# It will be useful, however, if you are hacking at the code generator. XPROTO=/usr/share/xcb @@ -20,3 +21,8 @@ test: bench: go test -run 'nomatch' -bench '.*' -cpu 1,2,6 +gofmt: + gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go + colcheck xgbgen/*.go examples/*.go examples/*/*.go \ + auth.go conn.go cookie.go doc.go xgb.go xgb_help.go xgb_test.go + diff --git a/nexgb/doc.go b/nexgb/doc.go new file mode 100644 index 0000000..b6c956f --- /dev/null +++ b/nexgb/doc.go @@ -0,0 +1,152 @@ +/* +Package XGB provides the X Go Binding, which is a low-level API to communicate +with the core X protocol and many of the X extensions. + +It is *very* closely modeled on XCB, so that experience with XCB (or xpyb) is +easily translatable to XGB. That is, it uses the same cookie/reply model +and is thread safe. There are otherwise no major differences (in the API). + +Most uses of XGB typically fall under the realm of window manager and GUI kit +development, but other applications (like pagers, panels, tilers, etc.) may +also require XGB. Moreover, it is a near certainty that if you need to work +with X, xgbutil will be of great use to you as well: +https://github.com/BurntSushi/xgbutil + +Example + +This is an extremely terse example that demonstrates how to connect to X, +create a window, listen to StructureNotify events and Key{Press,Release} +events, map the window, and print out all events received. An example with +accompanying documentation can be found in examples/create-window. + + package main + + import ( + "fmt" + "github.com/BurntSushi/xgb" + ) + + func main() { + X, err := xgb.NewConn() + if err != nil { + fmt.Println(err) + return + } + + wid, _ := X.NewId() + X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + 0, 0, 500, 500, 0, + xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, + xgb.CwBackPixel | xgb.CwEventMask, + []uint32{ // values must be in the order defined by the protocol + 0xffffffff, + xgb.EventMaskStructureNotify | + xgb.EventMaskKeyPress | + xgb.EventMaskKeyRelease}) + + X.MapWindow(wid) + for { + ev, xerr := X.WaitForEvent() + if ev == nil && xerr == nil { + fmt.Println("Both event and error are nil. Exiting...") + return + } + + if ev != nil { + fmt.Printf("Event: %s\n", ev) + } + if xerr != nil { + fmt.Printf("Error: %s\n", xerr) + } + } + } + +Xinerama Example + +This is another small example that shows how to query Xinerama for geometry +information of each active head. Accompanying documentation for this example +can be found in examples/xinerama. + + package main + + import ( + "fmt" + "log" + "github.com/BurntSushi/xgb" + ) + + func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + // Initialize the Xinerama extension. + // The appropriate 'Init' function must be run for *every* + // extension before any of its requests can be used. + err = X.XineramaInit() + if err != nil { + log.Fatal(err) + } + + reply, err := X.XineramaQueryScreens().Reply() + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Number of heads: %d\n", reply.Number) + for i, screen := range reply.ScreenInfo { + fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", + i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) + } + } + +Parallelism + +XGB can benefit greatly from parallelism due to its concurrent design. For +evidence of this claim, please see the benchmarks in xgb_test.go. + +Tests + +xgb_test.go contains a number of contrived tests that stress particular corners +of XGB that I presume could be problem areas. Namely: requests with no replies, +requests with replies, checked errors, unchecked errors, sequence number +wrapping, cookie buffer flushing (i.e., forcing a round trip every N requests +made that don't have a reply), getting/setting properties and creating a window +and listening to StructureNotify events. + +Code Generator + +Both XCB and xpyb use the same Python module (xcbgen) for a code generator. XGB +(before this fork) used the same code generator as well, but in my attempt to +add support for more extensions, I found the code generator extremely difficult +to work with. Therefore, I re-wrote the code generator in Go. It can be found +in its own sub-package, xgbgen, of xgb. My design of xgbgen includes a rough +consideration that it could be used for other languages. + +What works + +I am reasonably confident that the core X protocol is in full working form. I've +also tested the Xinerama and RandR extensions sparingly. Many of the other +existing extensions have Go source generated (and are compilable) and are +included in this package, but I am currently unsure of their status. They +*should* work. + +What does not work + +XKB is the only extension that intentionally does not work, although I suspect +that GLX also does not work (however, there is Go source code for GLX that +compiles, unlike XKB). I don't currently have any intention of getting XKB +working, due to its complexity and my current mental incapacity to test it. + +There are so many functions + +Indeed. Everything below this initial overview is useful insomuch as your +browser's "Find" feature is useful. The following list of types and functions +should act as a reference to the Go representation of a request, type or reply +of something you *already know about*. To search the following list in hopes +of attaining understanding is a quest in folly. For understanding, please see +the X Protocol Reference Manual: http://goo.gl/aMd2e + +*/ +package xgb diff --git a/nexgb/examples/atom.go b/nexgb/examples/atom.go deleted file mode 100644 index 2cb7132..0000000 --- a/nexgb/examples/atom.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - // "fmt" - "log" - - "github.com/BurntSushi/xgb" -) - -func init() { - log.SetFlags(0) -} - -func main() { - X, err := xgb.NewConn() - if err != nil { - log.Fatal(err) - } - - aname := "_NET_ACTIVE_WINDOW" - atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() - if err != nil { - log.Fatal(err) - } - log.Printf("%d", atom.Atom) -} - diff --git a/nexgb/examples/create-window/main.go b/nexgb/examples/create-window/main.go new file mode 100644 index 0000000..6996f37 --- /dev/null +++ b/nexgb/examples/create-window/main.go @@ -0,0 +1,98 @@ +// Example create-window shows how to create a window, map it, resize it, +// and listen to structure and key events (i.e., when the window is resized +// by the window manager, or when key presses/releases are made when the +// window has focus). The events are printed to stdout. +package main + +import ( + "fmt" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, err := xgb.NewConn() + if err != nil { + fmt.Println(err) + return + } + + // Any time a new resource (i.e., a window, pixmap, graphics context, etc.) + // is created, we need to generate a resource identifier with NewId. + wid, _ := X.NewId() + + // CreateWindow takes a boatload of parameters. + X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + 0, 0, 500, 500, 0, + xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, + 0, []uint32{}) + + // This call to ChangeWindowAttributes could be factored out and + // included with the above CreateWindow call, but it is left here for + // instructive purposes. It tells X to send us events when the 'structure' + // of the window is changed (i.e., when it is resized, mapped, unmapped, + // etc.) and when a key press or a key release has been made when the + // window has focus. + // We also set the 'BackPixel' to white so that the window isn't butt ugly. + X.ChangeWindowAttributes(wid, + xgb.CwBackPixel|xgb.CwEventMask, + []uint32{ // values must be in the order defined by the protocol + 0xffffffff, + xgb.EventMaskStructureNotify | + xgb.EventMaskKeyPress | + xgb.EventMaskKeyRelease}) + + // MapWindow makes the window we've created appear on the screen. + // We demonstrated the use of a 'checked' request here. + // A checked request is a fancy way of saying, "do error handling + // synchronously." Namely, if there is a problem with the MapWindow request, + // we'll get the error *here*. If we were to do a normal unchecked + // request (like the above CreateWindow and ChangeWindowAttributes + // requests), then we would only see the error arrive in the main event + // loop. + // + // Typically, checked requests are useful when you need to make sure they + // succeed. Since they are synchronous, they incur a round trip cost before + // the program can continue, but this is only going to be noticeable if + // you're issuing tons of requests in succession. + // + // Note that requests without replies are by default unchecked while + // requests *with* replies are checked by default. + err = X.MapWindowChecked(wid).Check() + if err != nil { + fmt.Printf("Checked Error for mapping window %d: %s\n", wid, err) + } else { + fmt.Printf("Map window %d successful!\n", wid) + } + + // This is an example of an invalid MapWindow request and what an error + // looks like. + err = X.MapWindowChecked(0).Check() + if err != nil { + fmt.Printf("Checked Error for mapping window 0x1: %s\n", err) + } else { // neva + fmt.Printf("Map window 0x1 successful!\n") + } + + // Start the main event loop. + for { + // WaitForEvent either returns an event or an error and never both. + // If both are nil, then something went wrong and the loop should be + // halted. + // + // An error can only be seen here as a response to an unchecked + // request. + ev, xerr := X.WaitForEvent() + if ev == nil && xerr == nil { + fmt.Println("Both event and error are nil. Exiting...") + return + } + + if ev != nil { + fmt.Printf("Event: %s\n", ev) + } + if xerr != nil { + fmt.Printf("Error: %s\n", xerr) + } + } +} diff --git a/nexgb/examples/doc.go b/nexgb/examples/doc.go new file mode 100644 index 0000000..80ea5b7 --- /dev/null +++ b/nexgb/examples/doc.go @@ -0,0 +1,21 @@ +/* +Package examples contains a few different use cases of XGB, like creating +a window, reading properties, and querying for information about multiple +heads using the Xinerama or RandR extensions. + +If you're looking to get started quickly, I recommend checking out the +create-window example first. It is the most documented and probably covers +some of the more common bare bones cases of creating windows and responding +to events. + +If you're looking to query information about your window manager, +get-active-window is a start. However, to do anything extensive requires +a lot of boiler plate. To that end, I'd recommend use of my higher level +library, xgbutil: https://github.com/BurntSushi/xgbutil + +There are also examples of using the Xinerama and RandR extensions, if you're +interested in querying information about your active heads. In RandR's case, +you can also reconfigure your heads, but the example doesn't cover that. + +*/ +package documentation diff --git a/nexgb/examples/get-active-window/main.go b/nexgb/examples/get-active-window/main.go new file mode 100644 index 0000000..e90563c --- /dev/null +++ b/nexgb/examples/get-active-window/main.go @@ -0,0 +1,57 @@ +// Example get-active-window reads the _NET_ACTIVE_WINDOW property of the root +// window and uses the result (a window id) to get the name of the window. +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + // Get the window id of the root window. + root := X.DefaultScreen().Root + + // Get the atom id (i.e., intern an atom) of "_NET_ACTIVE_WINDOW". + aname := "_NET_ACTIVE_WINDOW" + activeAtom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + if err != nil { + log.Fatal(err) + } + + // Get the atom id (i.e., intern an atom) of "_NET_WM_NAME". + aname = "_NET_WM_NAME" + nameAtom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + if err != nil { + log.Fatal(err) + } + + // Get the actual value of _NET_ACTIVE_WINDOW. + // Note that 'reply.Value' is just a slice of bytes, so we use an + // XGB helper function, 'Get32', to pull an unsigned 32-bit integer out + // of the byte slice. We then convert it to an X resource id so it can + // be used to get the name of the window in the next GetProperty request. + reply, err := X.GetProperty(false, root, activeAtom.Atom, + xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() + if err != nil { + log.Fatal(err) + } + windowId := xgb.Id(xgb.Get32(reply.Value)) + fmt.Printf("Active window id: %X\n", windowId) + + // Now get the value of _NET_WM_NAME for the active window. + // Note that this time, we simply convert the resulting byte slice, + // reply.Value, to a string. + reply, err = X.GetProperty(false, windowId, nameAtom.Atom, + xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() + if err != nil { + log.Fatal(err) + } + fmt.Printf("Active window name: %s\n", string(reply.Value)) +} diff --git a/nexgb/examples/property.go b/nexgb/examples/property.go deleted file mode 100644 index 45144c7..0000000 --- a/nexgb/examples/property.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "log" - - "github.com/BurntSushi/xgb" -) - -func init() { - log.SetFlags(0) -} - -func get32(buf []byte) uint32 { - v := uint32(buf[0]) - v |= uint32(buf[1]) << 8 - v |= uint32(buf[2]) << 16 - v |= uint32(buf[3]) << 24 - return v -} - -func main() { - X, err := xgb.NewConn() - if err != nil { - log.Fatal(err) - } - - root := X.DefaultScreen().Root - - aname := "_NET_ACTIVE_WINDOW" - atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() - if err != nil { - log.Fatal(err) - } - - reply, err := X.GetProperty(false, root, atom.Atom, - xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() - if err != nil { - log.Fatal(err) - } - log.Printf("%X", get32(reply.Value)) -} diff --git a/nexgb/examples/randr.go b/nexgb/examples/randr.go deleted file mode 100644 index 064856d..0000000 --- a/nexgb/examples/randr.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/BurntSushi/xgb" -) - -func main() { - X, _ := xgb.NewConn() - - err := X.RegisterExtension("randr") - if err != nil { - log.Fatal(err) - } - - resources, err := X.RandrGetScreenResources(X.DefaultScreen().Root).Reply() - if err != nil { - log.Fatal(err) - } - - for _, output := range resources.Outputs { - info, err := X.RandrGetOutputInfo(output, 0).Reply() - if err != nil { - log.Fatal(err) - } - - bestMode := info.Modes[0] - for _, mode := range resources.Modes { - if mode.Id == uint32(bestMode) { - fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) - } - } - } - - fmt.Println("\n") - - for _, crtc := range resources.Crtcs { - info, err := X.RandrGetCrtcInfo(crtc, 0).Reply() - if err != nil { - log.Fatal(err) - } - fmt.Printf("X: %d, Y: %d, Width: %d, Height: %d\n", - info.X, info.Y, info.Width, info.Height) - } -} - diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go new file mode 100644 index 0000000..5c56609 --- /dev/null +++ b/nexgb/examples/randr/main.go @@ -0,0 +1,84 @@ +// Example randr uses the randr protocol to get information about the active +// heads. It also listens for events that are sent when the head configuration +// changes. Since it listens to events, you'll have to manually kill this +// process when you're done (i.e., ctrl+c.) +// +// While this program is running, if you use 'xrandr' to reconfigure your +// heads, you should see event information dumped to standard out. +// +// For more information, please see the RandR protocol spec: +// http://www.x.org/releases/X11R7.6/doc/randrproto/randrproto.txt +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + // Every extension must be initialized before it can be used. + err := X.RandrInit() + if err != nil { + log.Fatal(err) + } + + // Gets the current screen resources. Screen resources contains a list + // of names, crtcs, outputs and modes, among other things. + resources, err := X.RandrGetScreenResources(X.DefaultScreen().Root).Reply() + if err != nil { + log.Fatal(err) + } + + // Iterate through all of the outputs and show some of their info. + for _, output := range resources.Outputs { + info, err := X.RandrGetOutputInfo(output, 0).Reply() + if err != nil { + log.Fatal(err) + } + + bestMode := info.Modes[0] + for _, mode := range resources.Modes { + if mode.Id == uint32(bestMode) { + fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) + } + } + } + + fmt.Println("\n") + + // Iterate through all of the crtcs and show some of their info. + for _, crtc := range resources.Crtcs { + info, err := X.RandrGetCrtcInfo(crtc, 0).Reply() + if err != nil { + log.Fatal(err) + } + fmt.Printf("X: %d, Y: %d, Width: %d, Height: %d\n", + info.X, info.Y, info.Width, info.Height) + } + + // Tell RandR to send us events. (I think these are all of them, as of 1.3.) + err = X.RandrSelectInputChecked(X.DefaultScreen().Root, + xgb.RandrNotifyMaskScreenChange| + xgb.RandrNotifyMaskCrtcChange| + xgb.RandrNotifyMaskOutputChange| + xgb.RandrNotifyMaskOutputProperty).Check() + if err != nil { + log.Fatal(err) + } + + // Listen to events and just dump them to standard out. + // A more involved approach will have to read the 'U' field of + // RandrNotifyEvent, which is a union (really a struct) of type + // RanrNotifyDataUnion. + for { + ev, err := X.WaitForEvent() + if err != nil { + log.Fatal(err) + } + fmt.Println(ev) + } +} diff --git a/nexgb/examples/seq-nowrap.go b/nexgb/examples/seq-nowrap.go deleted file mode 100644 index 994a07b..0000000 --- a/nexgb/examples/seq-nowrap.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/BurntSushi/xgb" -) - -func main() { - X, _ := xgb.NewConn() - - for i := 1; i <= 1<<16 + 10; i++ { - X.NoOperation() - // fmt.Printf("%d. No-Op\n", i) - } - - aname := "_NET_ACTIVE_WINDOW" - - for i := 1; i <= 10; i++ { - atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() - if err != nil { - fmt.Println(err) - } else { - fmt.Printf("%d. Sequence: %d, Atom: %d\n", - i, atom.Sequence, atom.Atom) - } - } -} - diff --git a/nexgb/examples/seq-wrap.go b/nexgb/examples/seq-wrap.go deleted file mode 100644 index b5bc834..0000000 --- a/nexgb/examples/seq-wrap.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/BurntSushi/xgb" -) - -func main() { - X, _ := xgb.NewConn() - - aname := "_NET_ACTIVE_WINDOW" - - for i := 1; i <= 1<<16 + 10; i++ { - atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() - if err != nil { - fmt.Println(err) - } else { - fmt.Printf("%d. Sequence: %d, Atom: %d\n", - i, atom.Sequence, atom.Atom) - } - } -} - diff --git a/nexgb/examples/window.go b/nexgb/examples/window.go deleted file mode 100644 index 68fe27b..0000000 --- a/nexgb/examples/window.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/BurntSushi/xgb" -) - -func main() { - X, err := xgb.NewConn() - if err != nil { - log.Fatal(err) - } - - wid, _ := X.NewId() - X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, - 0, 0, 500, 500, 0, - xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, - 0, []uint32{}) - X.ChangeWindowAttributes(wid, xgb.CwEventMask | xgb.CwBackPixel, - []uint32{0xffffffff, xgb.EventMaskKeyPress | xgb.EventMaskKeyRelease}) - - err = X.MapWindowChecked(wid).Check() - if err != nil { - fmt.Printf("Checked Error for mapping window %d: %s\n", wid, err) - } else { - fmt.Printf("Map window %d successful!\n", wid) - } - - err = X.MapWindowChecked(0x1).Check() - if err != nil { - fmt.Printf("Checked Error for mapping window 0x1: %s\n", err) - } else { - fmt.Printf("Map window 0x1 successful!\n") - } - - for { - ev, xerr := X.WaitForEvent() - if ev == nil && xerr == nil { - log.Fatal("Both event and error are nil. Exiting...") - } - - if ev != nil { - fmt.Printf("Event: %s\n", ev) - } - if xerr != nil { - fmt.Printf("Error: %s\n", xerr) - } - - if xerr == nil { - geom, err := X.GetGeometry(0x1).Reply() - if err != nil { - fmt.Printf("Geom Error: %#v\n", err) - } else { - fmt.Printf("Geometry: %#v\n", geom) - } - } - } -} - diff --git a/nexgb/examples/xinerama.go b/nexgb/examples/xinerama.go deleted file mode 100644 index 7fe9984..0000000 --- a/nexgb/examples/xinerama.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/BurntSushi/xgb" -) - -func main() { - X, _ := xgb.NewConn() - - err := X.RegisterExtension("xinerama") - if err != nil { - log.Fatal(err) - } - - reply, err := X.XineramaQueryScreens().Reply() - if err != nil { - log.Fatal(err) - } - - fmt.Printf("Xinerama number: %d\n", reply.Number) - for i, screen := range reply.ScreenInfo { - fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", - i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) - } -} - diff --git a/nexgb/examples/xinerama/main.go b/nexgb/examples/xinerama/main.go new file mode 100644 index 0000000..ec7f46a --- /dev/null +++ b/nexgb/examples/xinerama/main.go @@ -0,0 +1,39 @@ +// Example xinerama shows how to query the geometry of all active heads. +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + // Initialize the Xinerama extension. + // The appropriate 'Init' function must be run for *every* + // extension before any of its requests can be used. + err = X.XineramaInit() + if err != nil { + log.Fatal(err) + } + + // Issue a request to get the screen information. + reply, err := X.XineramaQueryScreens().Reply() + if err != nil { + log.Fatal(err) + } + + // reply.Number is the number of active heads, while reply.ScreenInfo + // is a slice of XineramaScreenInfo containing the rectangle geometry + // of each head. + fmt.Printf("Number of heads: %d\n", reply.Number) + for i, screen := range reply.ScreenInfo { + fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", + i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) + } +} diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 581b8fa..c9a265f 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -1,9 +1,3 @@ -// Copyright 2009 The XGB Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The XGB package implements the X11 core protocol. -// It is based on XCB: http://xcb.freedesktop.org/ package xgb import ( diff --git a/nexgb/xgb_test.go b/nexgb/xgb_test.go index 9665164..b70ff5e 100644 --- a/nexgb/xgb_test.go +++ b/nexgb/xgb_test.go @@ -45,8 +45,8 @@ func init() { // Tests /******************************************************************************/ -// TestSynchronousError purposefully causes a BadLength error in an -// InternAtom request, and checks it synchronously. +// TestSynchronousError purposefully causes a BadWindow error in a +// MapWindow request, and checks it synchronously. func TestSynchronousError(t *testing.T) { err := X.MapWindowChecked(0).Check() // resource id 0 is always invalid if err == nil { @@ -205,7 +205,7 @@ func TestWindowEvents(t *testing.T) { // BenchmarkInternAtomsGood shows how many requests with replies // *should* be sent and gathered from the server. Namely, send as many // requests as you can at once, then go back and gather up all the replies. -// More importantly, this approach can exploit parallelism better when +// More importantly, this approach can exploit parallelism when // GOMAXPROCS > 1. // Run with `go test -run 'nomatch' -bench '.*' -cpu 1,2,6` if you have // multiple cores to see the improvement that parallelism brings. diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 35dd37e..f1762d3 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -86,7 +86,7 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("case err != nil:") c.Putln("return err") c.Putln("case !reply.Present:") - c.Putln("return newError(\"No extension named %s could be found on " + + c.Putln("return newError(\"No extension named %s could be found on "+ "on the server.\")", xname) c.Putln("}") c.Putln("") diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 4452408..7c83f1a 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -220,7 +220,7 @@ func (f *ExprField) Initialize(p *Protocol) { // integers. The mask specifies which kinds of values are in the list. // (i.e., See ConfigureWindow, CreateWindow, ChangeWindowAttributes, etc.) type ValueField struct { - Parent interface{} + Parent interface{} MaskType Type MaskName string ListName string @@ -247,7 +247,7 @@ func (f *ValueField) Size() Size { listSize := newExpressionSize(&Function{ Name: "pad", Expr: &BinaryOp{ - Op: "*", + Op: "*", Expr1: &Value{v: 4}, Expr2: &PopCount{ Expr: &Function{ diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 0222289..9e01042 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -133,7 +133,7 @@ func (e *ErrorCopy) ImplementsError(c *Context) { func ErrorFieldString(c *Context, fields []Field, errName string) { c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) c.Putln("fieldVals = append(fieldVals, \"NiceName: \" + err.NiceName)") - c.Putln("fieldVals = append(fieldVals, " + + c.Putln("fieldVals = append(fieldVals, "+ "sprintf(\"Sequence: %s\", err.Sequence))", "%d") for _, field := range fields { switch field.(type) { diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index ce54e19..f55e26f 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -165,7 +165,7 @@ func (e *EventCopy) Write(c *Context) { func EventFieldString(c *Context, fields []Field, evName string) { c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) if evName != "KeymapNotify" { - c.Putln("fieldVals = append(fieldVals, " + + c.Putln("fieldVals = append(fieldVals, "+ "sprintf(\"Sequence: %s\", v.Sequence))", "%d") } for _, field := range fields { @@ -177,7 +177,8 @@ func EventFieldString(c *Context, fields []Field, evName string) { case *Base: case *Resource: case *TypeDef: - default: continue + default: + continue } switch field.SrcType() { diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index 41cfb76..ad859bb 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -107,4 +107,3 @@ func (f *ListField) Write(c *Context, prefix string) { f.XmlName(), f.Type) } } - diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index 451667f..a9e624d 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -71,14 +71,14 @@ func (r *Request) ReadReply(c *Context) { c.Putln("// Waits and reads reply data from request %s", r.SrcName()) c.Putln("func (cook %s) Reply() (*%s, error) {", r.CookieName(), r.ReplyTypeName()) - c.Putln("buf, err := cook.reply()") - c.Putln("if err != nil {") - c.Putln("return nil, err") - c.Putln("}") - c.Putln("if buf == nil {") - c.Putln("return nil, nil") - c.Putln("}") - c.Putln("return %s(buf), nil", r.ReplyName()) + c.Putln("buf, err := cook.reply()") + c.Putln("if err != nil {") + c.Putln("return nil, err") + c.Putln("}") + c.Putln("if buf == nil {") + c.Putln("return nil, nil") + c.Putln("}") + c.Putln("return %s(buf), nil", r.ReplyName()) c.Putln("}") c.Putln("") @@ -107,7 +107,7 @@ func (r *Request) ReadReply(c *Context) { func (r *Request) WriteRequest(c *Context) { writeSize := func() { - c.Putln("Put16(buf[b:], uint16(size / 4)) "+ + c.Putln("Put16(buf[b:], uint16(size / 4)) " + "// write request size in 4-byte units") c.Putln("b += 2") c.Putln("") diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 9f339af..73e85f7 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -139,4 +139,3 @@ func (u *Union) WriteListSize(c *Context) { c.Putln("}") c.Putln("") } - diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go index e01bc17..83dde14 100644 --- a/nexgb/xgbgen/protocol.go +++ b/nexgb/xgbgen/protocol.go @@ -38,4 +38,3 @@ func (p *Protocol) Initialize() { func (p *Protocol) isExt() bool { return strings.ToLower(p.Name) != "xproto" } - diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index c7a4cf8..4daa4ac 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -13,9 +13,9 @@ type Request struct { srcName string // The Go name of this request. xmlName string // The XML name of this request. Opcode int - Combine bool // Not currently used. + Combine bool // Not currently used. Fields []Field // All fields in the request. - Reply *Reply // A reply, if one exists for this request. + Reply *Reply // A reply, if one exists for this request. } // Initialize creates the proper Go source name for this request. diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 592c152..e4d81bc 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -339,7 +339,7 @@ func (x *XMLField) Translate(parent interface{}) Field { } case "valueparam": return &ValueField{ - Parent: parent, + Parent: parent, MaskType: newTranslation(x.ValueMaskType), MaskName: x.ValueMaskName, ListName: x.ValueListName, diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index df21433..440d0a8 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -17,11 +17,11 @@ type XML struct { // Types for all top-level elements. // First are the simple ones. - Imports XMLImports `xml:"import"` - Enums []*XMLEnum `xml:"enum"` - Xids []*XMLXid `xml:"xidtype"` - XidUnions []*XMLXid `xml:"xidunion"` - TypeDefs []*XMLTypeDef `xml:"typedef"` + Imports XMLImports `xml:"import"` + Enums []*XMLEnum `xml:"enum"` + Xids []*XMLXid `xml:"xidtype"` + XidUnions []*XMLXid `xml:"xidunion"` + TypeDefs []*XMLTypeDef `xml:"typedef"` EventCopies []*XMLEventCopy `xml:"eventcopy"` ErrorCopies []*XMLErrorCopy `xml:"errorcopy"` @@ -93,21 +93,21 @@ type XMLErrorCopy struct { } type XMLStruct struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Fields []*XMLField `xml:",any"` } type XMLUnion struct { - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` Fields []*XMLField `xml:",any"` } type XMLRequest struct { - Name string `xml:"name,attr"` - Opcode int `xml:"opcode,attr"` - Combine bool `xml:"combine-adjacent,attr"` + Name string `xml:"name,attr"` + Opcode int `xml:"opcode,attr"` + Combine bool `xml:"combine-adjacent,attr"` Fields []*XMLField `xml:",any"` - Reply *XMLReply `xml:"reply"` + Reply *XMLReply `xml:"reply"` } type XMLReply struct { @@ -115,15 +115,15 @@ type XMLReply struct { } type XMLEvent struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` - NoSequence bool `xml:"no-sequence-number,attr"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` + NoSequence bool `xml:"no-sequence-number,attr"` Fields []*XMLField `xml:",any"` } type XMLError struct { - Name string `xml:"name,attr"` - Number int `xml:"number,attr"` + Name string `xml:"name,attr"` + Number int `xml:"number,attr"` Fields []*XMLField `xml:",any"` } From eed777ebfd37ceff35077c7a00555876e02b4b87 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 04:13:41 -0400 Subject: [PATCH 26/90] more info in readme. link to docs. --- nexgb/README | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nexgb/README b/nexgb/README index d2fd2dd..f5862b1 100644 --- a/nexgb/README +++ b/nexgb/README @@ -1,7 +1,19 @@ +XGB is the X Go Binding, which is a low-level API to communicate with the +core X protocol and many of the X extensions. It is closely modeled after +XCB and xpyb. + +It is thread safe and gets immediate improvement from parallelism when +GOMAXPROCS > 1. (See the benchmarks in xgb_test.go for evidence.) + +Please see doc.go for more info. + BurntSushi's Fork ================= I've forked the XGB repository from Google Code due to inactivty upstream. +Godoc documentation can be found here: +http://godoc.burntsushi.net/pkg/github.com/BurntSushi/xgb/ + Much of the code has been rewritten in an effort to support thread safety and multiple extensions. Namely, go_client.py has been thrown away in favor of an xgbgen package. From daad54a5e114dcff9ef62abbbd18ea52929d01e5 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 04:17:11 -0400 Subject: [PATCH 27/90] important stuff first please --- nexgb/auth.go | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/nexgb/auth.go b/nexgb/auth.go index ac43e07..85e2d56 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -11,37 +11,6 @@ import ( "os" ) -func getU16BE(r io.Reader, b []byte) (uint16, error) { - _, err := io.ReadFull(r, b[0:2]) - if err != nil { - return 0, err - } - return uint16(b[0])<<8 + uint16(b[1]), nil -} - -func getBytes(r io.Reader, b []byte) ([]byte, error) { - n, err := getU16BE(r, b) - if err != nil { - return nil, err - } - if int(n) > len(b) { - return nil, errors.New("bytes too long for buffer") - } - _, err = io.ReadFull(r, b[0:n]) - if err != nil { - return nil, err - } - return b[0:n], nil -} - -func getString(r io.Reader, b []byte) (string, error) { - b, err := getBytes(r, b) - if err != nil { - return "", err - } - return string(b), nil -} - // readAuthority reads the X authority file for the DISPLAY. // If hostname == "" or hostname == "localhost", // then use the system's hostname (as returned by os.Hostname) instead. @@ -111,3 +80,34 @@ func readAuthority(hostname, display string) ( } panic("unreachable") } + +func getU16BE(r io.Reader, b []byte) (uint16, error) { + _, err := io.ReadFull(r, b[0:2]) + if err != nil { + return 0, err + } + return uint16(b[0])<<8 + uint16(b[1]), nil +} + +func getBytes(r io.Reader, b []byte) ([]byte, error) { + n, err := getU16BE(r, b) + if err != nil { + return nil, err + } + if int(n) > len(b) { + return nil, errors.New("bytes too long for buffer") + } + _, err = io.ReadFull(r, b[0:n]) + if err != nil { + return nil, err + } + return b[0:n], nil +} + +func getString(r io.Reader, b []byte) (string, error) { + b, err := getBytes(r, b) + if err != nil { + return "", err + } + return string(b), nil +} From 13d598e5e7f26bc6177ae3f7d52f4f19729ab2f3 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 21:58:33 -0400 Subject: [PATCH 28/90] more clean up. use log instead of fmt.Print to stderr. bug fix for event blocking (a hack fix for now). --- nexgb/Makefile | 6 +- nexgb/README | 3 + nexgb/auto_bigreq.go | 28 +++++---- nexgb/auto_composite.go | 12 ++-- nexgb/auto_damage.go | 26 +++++---- nexgb/auto_dpms.go | 8 ++- nexgb/auto_dri2.go | 12 ++-- nexgb/auto_ge.go | 16 ++++-- nexgb/auto_glx.go | 58 ++++++++++--------- nexgb/auto_randr.go | 18 +++--- nexgb/auto_record.go | 30 +++++----- nexgb/auto_render.go | 30 +++++----- nexgb/auto_res.go | 24 ++++---- nexgb/auto_screensaver.go | 28 +++++---- nexgb/auto_shape.go | 20 ++++--- nexgb/auto_shm.go | 22 ++++--- nexgb/auto_sync.go | 32 ++++++----- nexgb/auto_xc_misc.go | 16 ++++-- nexgb/auto_xevie.go | 12 ++-- nexgb/auto_xf86dri.go | 8 ++- nexgb/auto_xf86vidmode.go | 42 +++++++------- nexgb/auto_xfixes.go | 34 ++++++----- nexgb/auto_xinerama.go | 12 ++-- nexgb/auto_xinput.go | 38 +++++++------ nexgb/auto_xprint.go | 12 ++-- nexgb/auto_xproto.go | 14 ++--- nexgb/auto_xselinux.go | 16 ++++-- nexgb/auto_xtest.go | 12 ++-- nexgb/auto_xv.go | 26 +++++---- nexgb/auto_xvmc.go | 12 ++-- nexgb/xgb.go | 117 +++++++++++++++++++++++--------------- nexgb/xgb_help.go | 7 +-- nexgb/xgb_test.go | 18 ++++++ nexgb/xgbgen/context.go | 7 ++- nexgb/xgbgen/go_error.go | 14 ++++- 35 files changed, 481 insertions(+), 309 deletions(-) diff --git a/nexgb/Makefile b/nexgb/Makefile index 7ba1cb4..56738f4 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -5,13 +5,17 @@ XPROTO=/usr/share/xcb # All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_- -all: bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ +all: build-xgbgen \ + bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ ge.xml glx.xml randr.xml record.xml render.xml res.xml \ screensaver.xml shape.xml shm.xml sync.xml xc_misc.xml \ xevie.xml xf86dri.xml xf86vidmode.xml xfixes.xml xinerama.xml \ xinput.xml xprint.xml xproto.xml xselinux.xml xtest.xml \ xvmc.xml xv.xml +build-xgbgen: + (cd xgbgen && go build) + %.xml: xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > auto_$*.go diff --git a/nexgb/README b/nexgb/README index f5862b1..22aded8 100644 --- a/nexgb/README +++ b/nexgb/README @@ -7,6 +7,9 @@ GOMAXPROCS > 1. (See the benchmarks in xgb_test.go for evidence.) Please see doc.go for more info. +Note that unless you know you need XGB, you can probably make your life +easier by using a slightly higher level library: xgbutil. + BurntSushi's Fork ================= I've forked the XGB repository from Google Code due to inactivty upstream. diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go index 3389470..c1eb4d0 100644 --- a/nexgb/auto_bigreq.go +++ b/nexgb/auto_bigreq.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by bigreq.xml on May 6 2012 5:48:46pm EDT. + This file was generated by bigreq.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) BigreqInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named BIG-REQUESTS could be found on on the server.") + return errorf("No extension named BIG-REQUESTS could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) BigreqInit() error { for evNum, fun := range newExtEventFuncs["BIG-REQUESTS"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["BIG-REQUESTS"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,8 +30,19 @@ func (c *Conn) BigreqInit() error { func init() { newExtEventFuncs["BIG-REQUESTS"] = make(map[int]newEventFun) + newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -45,16 +59,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Request BigreqEnable // size: 4 type BigreqEnableCookie struct { diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go index aec15c9..4262468 100644 --- a/nexgb/auto_composite.go +++ b/nexgb/auto_composite.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by composite.xml on May 6 2012 5:48:46pm EDT. + This file was generated by composite.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -17,7 +17,7 @@ func (c *Conn) CompositeInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named Composite could be found on on the server.") + return errorf("No extension named Composite could be found on on the server.") } c.extLock.Lock() @@ -25,6 +25,9 @@ func (c *Conn) CompositeInit() error { for evNum, fun := range newExtEventFuncs["Composite"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["Composite"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -32,8 +35,11 @@ func (c *Conn) CompositeInit() error { func init() { newExtEventFuncs["Composite"] = make(map[int]newEventFun) + newExtErrorFuncs["Composite"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -58,8 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - const ( CompositeRedirectAutomatic = 0 CompositeRedirectManual = 1 diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index 8339e6a..c3d2734 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 6 2012 5:48:47pm EDT. + This file was generated by damage.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -17,7 +17,7 @@ func (c *Conn) DamageInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named DAMAGE could be found on on the server.") + return errorf("No extension named DAMAGE could be found on on the server.") } c.extLock.Lock() @@ -25,6 +25,9 @@ func (c *Conn) DamageInit() error { for evNum, fun := range newExtEventFuncs["DAMAGE"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["DAMAGE"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -32,8 +35,17 @@ func (c *Conn) DamageInit() error { func init() { newExtEventFuncs["DAMAGE"] = make(map[int]newEventFun) + newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -52,14 +64,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 @@ -213,7 +217,7 @@ func (err DamageBadDamageError) Error() string { } func init() { - newErrorFuncs[0] = NewDamageBadDamageError + newExtErrorFuncs["DAMAGE"][0] = NewDamageBadDamageError } // Request DamageQueryVersion diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go index eee6688..5200bfa 100644 --- a/nexgb/auto_dpms.go +++ b/nexgb/auto_dpms.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dpms.xml on May 6 2012 5:48:47pm EDT. + This file was generated by dpms.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) DpmsInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named DPMS could be found on on the server.") + return errorf("No extension named DPMS could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) DpmsInit() error { for evNum, fun := range newExtEventFuncs["DPMS"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["DPMS"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,6 +30,7 @@ func (c *Conn) DpmsInit() error { func init() { newExtEventFuncs["DPMS"] = make(map[int]newEventFun) + newExtErrorFuncs["DPMS"] = make(map[int]newErrorFun) } // Skipping definition for base type 'Int32' diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go index 0712891..68d6084 100644 --- a/nexgb/auto_dri2.go +++ b/nexgb/auto_dri2.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dri2.xml on May 6 2012 5:48:47pm EDT. + This file was generated by dri2.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) Dri2Init() error { case err != nil: return err case !reply.Present: - return newError("No extension named DRI2 could be found on on the server.") + return errorf("No extension named DRI2 could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) Dri2Init() error { for evNum, fun := range newExtEventFuncs["DRI2"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["DRI2"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,10 +34,9 @@ func (c *Conn) Dri2Init() error { func init() { newExtEventFuncs["DRI2"] = make(map[int]newEventFun) + newExtErrorFuncs["DRI2"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -59,6 +61,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + const ( Dri2AttachmentBufferFrontLeft = 0 Dri2AttachmentBufferBackLeft = 1 diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go index 9a06265..ef80ebf 100644 --- a/nexgb/auto_ge.go +++ b/nexgb/auto_ge.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by ge.xml on May 6 2012 5:48:47pm EDT. + This file was generated by ge.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) GeInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named Generic Event Extension could be found on on the server.") + return errorf("No extension named Generic Event Extension could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) GeInit() error { for evNum, fun := range newExtEventFuncs["Generic Event Extension"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["Generic Event Extension"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,12 +30,9 @@ func (c *Conn) GeInit() error { func init() { newExtEventFuncs["Generic Event Extension"] = make(map[int]newEventFun) + newExtErrorFuncs["Generic Event Extension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,6 +55,10 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Request GeQueryVersion // size: 8 type GeQueryVersionCookie struct { diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go index 1b88e6c..67c79d7 100644 --- a/nexgb/auto_glx.go +++ b/nexgb/auto_glx.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by glx.xml on May 6 2012 5:48:47pm EDT. + This file was generated by glx.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) GlxInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named GLX could be found on on the server.") + return errorf("No extension named GLX could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) GlxInit() error { for evNum, fun := range newExtEventFuncs["GLX"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["GLX"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,19 @@ func (c *Conn) GlxInit() error { func init() { newExtEventFuncs["GLX"] = make(map[int]newEventFun) + newExtErrorFuncs["GLX"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -49,16 +63,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( GlxPbcetDamaged = 32791 GlxPbcetSaved = 32792 @@ -319,7 +323,7 @@ func (err GlxGenericError) Error() string { } func init() { - newErrorFuncs[-1] = NewGlxGenericError + newExtErrorFuncs["GLX"][-1] = NewGlxGenericError } // ErrorCopy definition GlxBadContext (0) @@ -355,7 +359,7 @@ func (err GlxBadContextError) Error() string { } func init() { - newErrorFuncs[0] = NewGlxBadContextError + newExtErrorFuncs["GLX"][0] = NewGlxBadContextError } // ErrorCopy definition GlxBadContextState (1) @@ -391,7 +395,7 @@ func (err GlxBadContextStateError) Error() string { } func init() { - newErrorFuncs[1] = NewGlxBadContextStateError + newExtErrorFuncs["GLX"][1] = NewGlxBadContextStateError } // ErrorCopy definition GlxBadDrawable (2) @@ -427,7 +431,7 @@ func (err GlxBadDrawableError) Error() string { } func init() { - newErrorFuncs[2] = NewGlxBadDrawableError + newExtErrorFuncs["GLX"][2] = NewGlxBadDrawableError } // ErrorCopy definition GlxBadPixmap (3) @@ -463,7 +467,7 @@ func (err GlxBadPixmapError) Error() string { } func init() { - newErrorFuncs[3] = NewGlxBadPixmapError + newExtErrorFuncs["GLX"][3] = NewGlxBadPixmapError } // ErrorCopy definition GlxBadContextTag (4) @@ -499,7 +503,7 @@ func (err GlxBadContextTagError) Error() string { } func init() { - newErrorFuncs[4] = NewGlxBadContextTagError + newExtErrorFuncs["GLX"][4] = NewGlxBadContextTagError } // ErrorCopy definition GlxBadCurrentWindow (5) @@ -535,7 +539,7 @@ func (err GlxBadCurrentWindowError) Error() string { } func init() { - newErrorFuncs[5] = NewGlxBadCurrentWindowError + newExtErrorFuncs["GLX"][5] = NewGlxBadCurrentWindowError } // ErrorCopy definition GlxBadRenderRequest (6) @@ -571,7 +575,7 @@ func (err GlxBadRenderRequestError) Error() string { } func init() { - newErrorFuncs[6] = NewGlxBadRenderRequestError + newExtErrorFuncs["GLX"][6] = NewGlxBadRenderRequestError } // ErrorCopy definition GlxBadLargeRequest (7) @@ -607,7 +611,7 @@ func (err GlxBadLargeRequestError) Error() string { } func init() { - newErrorFuncs[7] = NewGlxBadLargeRequestError + newExtErrorFuncs["GLX"][7] = NewGlxBadLargeRequestError } // ErrorCopy definition GlxUnsupportedPrivateRequest (8) @@ -643,7 +647,7 @@ func (err GlxUnsupportedPrivateRequestError) Error() string { } func init() { - newErrorFuncs[8] = NewGlxUnsupportedPrivateRequestError + newExtErrorFuncs["GLX"][8] = NewGlxUnsupportedPrivateRequestError } // ErrorCopy definition GlxBadFBConfig (9) @@ -679,7 +683,7 @@ func (err GlxBadFBConfigError) Error() string { } func init() { - newErrorFuncs[9] = NewGlxBadFBConfigError + newExtErrorFuncs["GLX"][9] = NewGlxBadFBConfigError } // ErrorCopy definition GlxBadPbuffer (10) @@ -715,7 +719,7 @@ func (err GlxBadPbufferError) Error() string { } func init() { - newErrorFuncs[10] = NewGlxBadPbufferError + newExtErrorFuncs["GLX"][10] = NewGlxBadPbufferError } // ErrorCopy definition GlxBadCurrentDrawable (11) @@ -751,7 +755,7 @@ func (err GlxBadCurrentDrawableError) Error() string { } func init() { - newErrorFuncs[11] = NewGlxBadCurrentDrawableError + newExtErrorFuncs["GLX"][11] = NewGlxBadCurrentDrawableError } // ErrorCopy definition GlxBadWindow (12) @@ -787,7 +791,7 @@ func (err GlxBadWindowError) Error() string { } func init() { - newErrorFuncs[12] = NewGlxBadWindowError + newExtErrorFuncs["GLX"][12] = NewGlxBadWindowError } // ErrorCopy definition GlxGLXBadProfileARB (13) @@ -823,7 +827,7 @@ func (err GlxGLXBadProfileARBError) Error() string { } func init() { - newErrorFuncs[13] = NewGlxGLXBadProfileARBError + newExtErrorFuncs["GLX"][13] = NewGlxGLXBadProfileARBError } // Request GlxRender diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index cc5e760..4e707e6 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 6 2012 5:48:47pm EDT. + This file was generated by randr.xml on May 7 2012 9:17:56pm EDT. This file is automatically generated. Edit at your peril! */ @@ -17,7 +17,7 @@ func (c *Conn) RandrInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named RANDR could be found on on the server.") + return errorf("No extension named RANDR could be found on on the server.") } c.extLock.Lock() @@ -25,6 +25,9 @@ func (c *Conn) RandrInit() error { for evNum, fun := range newExtEventFuncs["RANDR"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["RANDR"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -32,8 +35,11 @@ func (c *Conn) RandrInit() error { func init() { newExtEventFuncs["RANDR"] = make(map[int]newEventFun) + newExtErrorFuncs["RANDR"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -58,8 +64,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 @@ -1100,7 +1104,7 @@ func (err RandrBadOutputError) Error() string { } func init() { - newErrorFuncs[0] = NewRandrBadOutputError + newExtErrorFuncs["RANDR"][0] = NewRandrBadOutputError } // Error definition RandrBadCrtc (1) @@ -1145,7 +1149,7 @@ func (err RandrBadCrtcError) Error() string { } func init() { - newErrorFuncs[1] = NewRandrBadCrtcError + newExtErrorFuncs["RANDR"][1] = NewRandrBadCrtcError } // Error definition RandrBadMode (2) @@ -1190,7 +1194,7 @@ func (err RandrBadModeError) Error() string { } func init() { - newErrorFuncs[2] = NewRandrBadModeError + newExtErrorFuncs["RANDR"][2] = NewRandrBadModeError } // Request RandrQueryVersion diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go index 6fb966b..32e1715 100644 --- a/nexgb/auto_record.go +++ b/nexgb/auto_record.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by record.xml on May 6 2012 5:48:47pm EDT. + This file was generated by record.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) RecordInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named RECORD could be found on on the server.") + return errorf("No extension named RECORD could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) RecordInit() error { for evNum, fun := range newExtEventFuncs["RECORD"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["RECORD"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,8 +30,19 @@ func (c *Conn) RecordInit() error { func init() { newExtEventFuncs["RECORD"] = make(map[int]newEventFun) + newExtErrorFuncs["RECORD"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -45,16 +59,6 @@ func init() { // Skipping definition for base type 'Id' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( RecordHTypeFromServerTime = 1 RecordHTypeFromClientTime = 2 @@ -507,7 +511,7 @@ func (err RecordBadContextError) Error() string { } func init() { - newErrorFuncs[0] = NewRecordBadContextError + newExtErrorFuncs["RECORD"][0] = NewRecordBadContextError } // Request RecordQueryVersion diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index c9fc097..fa0c5f2 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 6 2012 5:48:47pm EDT. + This file was generated by render.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) RenderInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named RENDER could be found on on the server.") + return errorf("No extension named RENDER could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) RenderInit() error { for evNum, fun := range newExtEventFuncs["RENDER"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["RENDER"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,14 +34,9 @@ func (c *Conn) RenderInit() error { func init() { newExtEventFuncs["RENDER"] = make(map[int]newEventFun) + newExtErrorFuncs["RENDER"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -59,6 +57,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 @@ -1392,7 +1396,7 @@ func (err RenderPictFormatError) Error() string { } func init() { - newErrorFuncs[0] = NewRenderPictFormatError + newExtErrorFuncs["RENDER"][0] = NewRenderPictFormatError } // Error definition RenderPicture (1) @@ -1437,7 +1441,7 @@ func (err RenderPictureError) Error() string { } func init() { - newErrorFuncs[1] = NewRenderPictureError + newExtErrorFuncs["RENDER"][1] = NewRenderPictureError } // Error definition RenderPictOp (2) @@ -1482,7 +1486,7 @@ func (err RenderPictOpError) Error() string { } func init() { - newErrorFuncs[2] = NewRenderPictOpError + newExtErrorFuncs["RENDER"][2] = NewRenderPictOpError } // Error definition RenderGlyphSet (3) @@ -1527,7 +1531,7 @@ func (err RenderGlyphSetError) Error() string { } func init() { - newErrorFuncs[3] = NewRenderGlyphSetError + newExtErrorFuncs["RENDER"][3] = NewRenderGlyphSetError } // Error definition RenderGlyph (4) @@ -1572,7 +1576,7 @@ func (err RenderGlyphError) Error() string { } func init() { - newErrorFuncs[4] = NewRenderGlyphError + newExtErrorFuncs["RENDER"][4] = NewRenderGlyphError } // Request RenderQueryVersion diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go index d3f0f0b..eeaf01f 100644 --- a/nexgb/auto_res.go +++ b/nexgb/auto_res.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by res.xml on May 6 2012 5:48:47pm EDT. + This file was generated by res.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) ResInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named X-Resource could be found on on the server.") + return errorf("No extension named X-Resource could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) ResInit() error { for evNum, fun := range newExtEventFuncs["X-Resource"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["X-Resource"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,16 +34,9 @@ func (c *Conn) ResInit() error { func init() { newExtEventFuncs["X-Resource"] = make(map[int]newEventFun) + newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -59,6 +55,14 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // 'ResClient' struct definition // Size: 8 type ResClient struct { diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go index 1e47b91..13aa818 100644 --- a/nexgb/auto_screensaver.go +++ b/nexgb/auto_screensaver.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by screensaver.xml on May 6 2012 5:48:47pm EDT. + This file was generated by screensaver.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) ScreensaverInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named MIT-SCREEN-SAVER could be found on on the server.") + return errorf("No extension named MIT-SCREEN-SAVER could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) ScreensaverInit() error { for evNum, fun := range newExtEventFuncs["MIT-SCREEN-SAVER"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["MIT-SCREEN-SAVER"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,18 +34,9 @@ func (c *Conn) ScreensaverInit() error { func init() { newExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]newEventFun) + newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -59,6 +53,16 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( ScreensaverKindBlanked = 0 ScreensaverKindInternal = 1 diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go index a28836c..4b52a5d 100644 --- a/nexgb/auto_shape.go +++ b/nexgb/auto_shape.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shape.xml on May 6 2012 5:48:47pm EDT. + This file was generated by shape.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) ShapeInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named SHAPE could be found on on the server.") + return errorf("No extension named SHAPE could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) ShapeInit() error { for evNum, fun := range newExtEventFuncs["SHAPE"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["SHAPE"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,15 @@ func (c *Conn) ShapeInit() error { func init() { newExtEventFuncs["SHAPE"] = make(map[int]newEventFun) + newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -53,12 +63,6 @@ func init() { // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( ShapeSoSet = 0 ShapeSoUnion = 1 diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go index 514dc03..a6d64a2 100644 --- a/nexgb/auto_shm.go +++ b/nexgb/auto_shm.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shm.xml on May 6 2012 5:48:47pm EDT. + This file was generated by shm.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) ShmInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named MIT-SHM could be found on on the server.") + return errorf("No extension named MIT-SHM could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) ShmInit() error { for evNum, fun := range newExtEventFuncs["MIT-SHM"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["MIT-SHM"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,15 @@ func (c *Conn) ShmInit() error { func init() { newExtEventFuncs["MIT-SHM"] = make(map[int]newEventFun) + newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -53,12 +63,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping resource definition of 'Seg' // Event definition ShmCompletion (0) @@ -194,7 +198,7 @@ func (err ShmBadSegError) Error() string { } func init() { - newErrorFuncs[0] = NewShmBadSegError + newExtErrorFuncs["MIT-SHM"][0] = NewShmBadSegError } // Request ShmQueryVersion diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go index a59cf20..ef69ebe 100644 --- a/nexgb/auto_sync.go +++ b/nexgb/auto_sync.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by sync.xml on May 6 2012 5:48:47pm EDT. + This file was generated by sync.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) SyncInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named SYNC could be found on on the server.") + return errorf("No extension named SYNC could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) SyncInit() error { for evNum, fun := range newExtEventFuncs["SYNC"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["SYNC"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,19 @@ func (c *Conn) SyncInit() error { func init() { newExtEventFuncs["SYNC"] = make(map[int]newEventFun) + newExtErrorFuncs["SYNC"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -49,16 +63,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( SyncAlarmstateActive = 0 SyncAlarmstateInactive = 1 @@ -656,7 +660,7 @@ func (err SyncCounterError) Error() string { } func init() { - newErrorFuncs[0] = NewSyncCounterError + newExtErrorFuncs["SYNC"][0] = NewSyncCounterError } // Error definition SyncAlarm (1) @@ -716,7 +720,7 @@ func (err SyncAlarmError) Error() string { } func init() { - newErrorFuncs[1] = NewSyncAlarmError + newExtErrorFuncs["SYNC"][1] = NewSyncAlarmError } // Request SyncInitialize diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go index 66ad03a..4d5c03c 100644 --- a/nexgb/auto_xc_misc.go +++ b/nexgb/auto_xc_misc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xc_misc.xml on May 6 2012 5:48:47pm EDT. + This file was generated by xc_misc.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) Xc_miscInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XC-MISC could be found on on the server.") + return errorf("No extension named XC-MISC could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) Xc_miscInit() error { for evNum, fun := range newExtEventFuncs["XC-MISC"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XC-MISC"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,12 +30,9 @@ func (c *Conn) Xc_miscInit() error { func init() { newExtEventFuncs["XC-MISC"] = make(map[int]newEventFun) + newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -55,6 +55,10 @@ func init() { // Skipping definition for base type 'Void' +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Request Xc_miscGetVersion // size: 8 type Xc_miscGetVersionCookie struct { diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go index eed775e..1046f1b 100644 --- a/nexgb/auto_xevie.go +++ b/nexgb/auto_xevie.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xevie.xml on May 6 2012 5:48:47pm EDT. + This file was generated by xevie.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) XevieInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XEVIE could be found on on the server.") + return errorf("No extension named XEVIE could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) XevieInit() error { for evNum, fun := range newExtEventFuncs["XEVIE"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XEVIE"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,10 +30,9 @@ func (c *Conn) XevieInit() error { func init() { newExtEventFuncs["XEVIE"] = make(map[int]newEventFun) + newExtErrorFuncs["XEVIE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -55,6 +57,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + const ( XevieDatatypeUnmodified = 0 XevieDatatypeModified = 1 diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go index 7407d24..362fa40 100644 --- a/nexgb/auto_xf86dri.go +++ b/nexgb/auto_xf86dri.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86dri.xml on May 6 2012 5:48:47pm EDT. + This file was generated by xf86dri.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) Xf86driInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XFree86-DRI could be found on on the server.") + return errorf("No extension named XFree86-DRI could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) Xf86driInit() error { for evNum, fun := range newExtEventFuncs["XFree86-DRI"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XFree86-DRI"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,6 +30,7 @@ func (c *Conn) Xf86driInit() error { func init() { newExtEventFuncs["XFree86-DRI"] = make(map[int]newEventFun) + newExtErrorFuncs["XFree86-DRI"] = make(map[int]newErrorFun) } // Skipping definition for base type 'Int8' diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go index 649244d..d44105d 100644 --- a/nexgb/auto_xf86vidmode.go +++ b/nexgb/auto_xf86vidmode.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86vidmode.xml on May 6 2012 5:48:47pm EDT. + This file was generated by xf86vidmode.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -12,7 +12,7 @@ func (c *Conn) Xf86vidmodeInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XFree86-VidModeExtension could be found on on the server.") + return errorf("No extension named XFree86-VidModeExtension could be found on on the server.") } c.extLock.Lock() @@ -20,6 +20,9 @@ func (c *Conn) Xf86vidmodeInit() error { for evNum, fun := range newExtEventFuncs["XFree86-VidModeExtension"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XFree86-VidModeExtension"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -27,18 +30,9 @@ func (c *Conn) Xf86vidmodeInit() error { func init() { newExtEventFuncs["XFree86-VidModeExtension"] = make(map[int]newEventFun) + newExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -55,6 +49,16 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( Xf86vidmodeModeFlagPositiveHsync = 1 Xf86vidmodeModeFlagNegativeHsync = 2 @@ -262,7 +266,7 @@ func (err Xf86vidmodeBadClockError) Error() string { } func init() { - newErrorFuncs[0] = NewXf86vidmodeBadClockError + newExtErrorFuncs["XFree86-VidModeExtension"][0] = NewXf86vidmodeBadClockError } // Error definition Xf86vidmodeBadHTimings (1) @@ -307,7 +311,7 @@ func (err Xf86vidmodeBadHTimingsError) Error() string { } func init() { - newErrorFuncs[1] = NewXf86vidmodeBadHTimingsError + newExtErrorFuncs["XFree86-VidModeExtension"][1] = NewXf86vidmodeBadHTimingsError } // Error definition Xf86vidmodeBadVTimings (2) @@ -352,7 +356,7 @@ func (err Xf86vidmodeBadVTimingsError) Error() string { } func init() { - newErrorFuncs[2] = NewXf86vidmodeBadVTimingsError + newExtErrorFuncs["XFree86-VidModeExtension"][2] = NewXf86vidmodeBadVTimingsError } // Error definition Xf86vidmodeModeUnsuitable (3) @@ -397,7 +401,7 @@ func (err Xf86vidmodeModeUnsuitableError) Error() string { } func init() { - newErrorFuncs[3] = NewXf86vidmodeModeUnsuitableError + newExtErrorFuncs["XFree86-VidModeExtension"][3] = NewXf86vidmodeModeUnsuitableError } // Error definition Xf86vidmodeExtensionDisabled (4) @@ -442,7 +446,7 @@ func (err Xf86vidmodeExtensionDisabledError) Error() string { } func init() { - newErrorFuncs[4] = NewXf86vidmodeExtensionDisabledError + newExtErrorFuncs["XFree86-VidModeExtension"][4] = NewXf86vidmodeExtensionDisabledError } // Error definition Xf86vidmodeClientNotLocal (5) @@ -487,7 +491,7 @@ func (err Xf86vidmodeClientNotLocalError) Error() string { } func init() { - newErrorFuncs[5] = NewXf86vidmodeClientNotLocalError + newExtErrorFuncs["XFree86-VidModeExtension"][5] = NewXf86vidmodeClientNotLocalError } // Error definition Xf86vidmodeZoomLocked (6) @@ -532,7 +536,7 @@ func (err Xf86vidmodeZoomLockedError) Error() string { } func init() { - newErrorFuncs[6] = NewXf86vidmodeZoomLockedError + newExtErrorFuncs["XFree86-VidModeExtension"][6] = NewXf86vidmodeZoomLockedError } // Request Xf86vidmodeQueryVersion diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go index aae1afb..f188be0 100644 --- a/nexgb/auto_xfixes.go +++ b/nexgb/auto_xfixes.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xfixes.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xfixes.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -18,7 +18,7 @@ func (c *Conn) XfixesInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XFIXES could be found on on the server.") + return errorf("No extension named XFIXES could be found on on the server.") } c.extLock.Lock() @@ -26,6 +26,9 @@ func (c *Conn) XfixesInit() error { for evNum, fun := range newExtEventFuncs["XFIXES"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XFIXES"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -33,20 +36,9 @@ func (c *Conn) XfixesInit() error { func init() { newExtEventFuncs["XFIXES"] = make(map[int]newEventFun) + newExtErrorFuncs["XFIXES"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -61,6 +53,18 @@ func init() { // Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( XfixesSaveSetModeInsert = 0 XfixesSaveSetModeDelete = 1 @@ -342,7 +346,7 @@ func (err XfixesBadRegionError) Error() string { } func init() { - newErrorFuncs[0] = NewXfixesBadRegionError + newExtErrorFuncs["XFIXES"][0] = NewXfixesBadRegionError } // Request XfixesQueryVersion diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index d751710..ff7453c 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xinerama.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XineramaInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XINERAMA could be found on on the server.") + return errorf("No extension named XINERAMA could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XineramaInit() error { for evNum, fun := range newExtEventFuncs["XINERAMA"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XINERAMA"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,11 @@ func (c *Conn) XineramaInit() error { func init() { newExtEventFuncs["XINERAMA"] = make(map[int]newEventFun) + newExtErrorFuncs["XINERAMA"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -57,8 +63,6 @@ func init() { // Skipping definition for base type 'Void' -// Skipping definition for base type 'Byte' - // 'XineramaScreenInfo' struct definition // Size: 8 type XineramaScreenInfo struct { diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go index ae122b8..7305d2d 100644 --- a/nexgb/auto_xinput.go +++ b/nexgb/auto_xinput.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinput.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xinput.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XinputInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XInputExtension could be found on on the server.") + return errorf("No extension named XInputExtension could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XinputInit() error { for evNum, fun := range newExtEventFuncs["XInputExtension"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XInputExtension"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,18 +34,9 @@ func (c *Conn) XinputInit() error { func init() { newExtEventFuncs["XInputExtension"] = make(map[int]newEventFun) + newExtErrorFuncs["XInputExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -59,6 +53,16 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + const ( XinputValuatorModeRelative = 0 XinputValuatorModeAbsolute = 1 @@ -4443,7 +4447,7 @@ func (err XinputDeviceError) Error() string { } func init() { - newErrorFuncs[0] = NewXinputDeviceError + newExtErrorFuncs["XInputExtension"][0] = NewXinputDeviceError } // Error definition XinputEvent (1) @@ -4488,7 +4492,7 @@ func (err XinputEventError) Error() string { } func init() { - newErrorFuncs[1] = NewXinputEventError + newExtErrorFuncs["XInputExtension"][1] = NewXinputEventError } // Error definition XinputMode (2) @@ -4533,7 +4537,7 @@ func (err XinputModeError) Error() string { } func init() { - newErrorFuncs[2] = NewXinputModeError + newExtErrorFuncs["XInputExtension"][2] = NewXinputModeError } // Error definition XinputDeviceBusy (3) @@ -4578,7 +4582,7 @@ func (err XinputDeviceBusyError) Error() string { } func init() { - newErrorFuncs[3] = NewXinputDeviceBusyError + newExtErrorFuncs["XInputExtension"][3] = NewXinputDeviceBusyError } // Error definition XinputClass (4) @@ -4623,7 +4627,7 @@ func (err XinputClassError) Error() string { } func init() { - newErrorFuncs[4] = NewXinputClassError + newExtErrorFuncs["XInputExtension"][4] = NewXinputClassError } // Request XinputGetExtensionVersion diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go index 6c9be85..9bb8ea7 100644 --- a/nexgb/auto_xprint.go +++ b/nexgb/auto_xprint.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xprint.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xprint.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XprintInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XpExtension could be found on on the server.") + return errorf("No extension named XpExtension could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XprintInit() error { for evNum, fun := range newExtEventFuncs["XpExtension"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XpExtension"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,6 +34,7 @@ func (c *Conn) XprintInit() error { func init() { newExtEventFuncs["XpExtension"] = make(map[int]newEventFun) + newExtErrorFuncs["XpExtension"] = make(map[int]newErrorFun) } // Skipping definition for base type 'Float' @@ -376,7 +380,7 @@ func (err XprintBadContextError) Error() string { } func init() { - newErrorFuncs[0] = NewXprintBadContextError + newExtErrorFuncs["XpExtension"][0] = NewXprintBadContextError } // Error definition XprintBadSequence (1) @@ -421,7 +425,7 @@ func (err XprintBadSequenceError) Error() string { } func init() { - newErrorFuncs[1] = NewXprintBadSequenceError + newExtErrorFuncs["XpExtension"][1] = NewXprintBadSequenceError } // Request XprintPrintQueryVersion diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index 84b193d..20152c8 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,16 +1,10 @@ package xgb /* - This file was generated by xproto.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xproto.xml on May 7 2012 9:17:57pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -31,6 +25,12 @@ package xgb // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go index e3dfbf3..a51346a 100644 --- a/nexgb/auto_xselinux.go +++ b/nexgb/auto_xselinux.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xselinux.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xselinux.xml on May 7 2012 9:17:58pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XselinuxInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named SELinux could be found on on the server.") + return errorf("No extension named SELinux could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XselinuxInit() error { for evNum, fun := range newExtEventFuncs["SELinux"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["SELinux"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,12 +34,9 @@ func (c *Conn) XselinuxInit() error { func init() { newExtEventFuncs["SELinux"] = make(map[int]newEventFun) + newExtErrorFuncs["SELinux"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -59,6 +59,10 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // 'XselinuxListItem' struct definition // Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) type XselinuxListItem struct { diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go index 565c3d1..8a43878 100644 --- a/nexgb/auto_xtest.go +++ b/nexgb/auto_xtest.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xtest.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xtest.xml on May 7 2012 9:17:58pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XtestInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XTEST could be found on on the server.") + return errorf("No extension named XTEST could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XtestInit() error { for evNum, fun := range newExtEventFuncs["XTEST"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XTEST"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,10 +34,9 @@ func (c *Conn) XtestInit() error { func init() { newExtEventFuncs["XTEST"] = make(map[int]newEventFun) + newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -59,6 +61,8 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + const ( XtestCursorNone = 0 XtestCursorCurrent = 1 diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go index 0ce0c64..dc2826b 100644 --- a/nexgb/auto_xv.go +++ b/nexgb/auto_xv.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xv.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xv.xml on May 7 2012 9:17:58pm EDT. This file is automatically generated. Edit at your peril! */ @@ -17,7 +17,7 @@ func (c *Conn) XvInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XVideo could be found on on the server.") + return errorf("No extension named XVideo could be found on on the server.") } c.extLock.Lock() @@ -25,6 +25,9 @@ func (c *Conn) XvInit() error { for evNum, fun := range newExtEventFuncs["XVideo"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XVideo"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -32,14 +35,9 @@ func (c *Conn) XvInit() error { func init() { newExtEventFuncs["XVideo"] = make(map[int]newEventFun) + newExtErrorFuncs["XVideo"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -60,6 +58,12 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( XvTypeInputMask = 1 XvTypeOutputMask = 2 @@ -1094,7 +1098,7 @@ func (err XvBadPortError) Error() string { } func init() { - newErrorFuncs[0] = NewXvBadPortError + newExtErrorFuncs["XVideo"][0] = NewXvBadPortError } // Error definition XvBadEncoding (1) @@ -1139,7 +1143,7 @@ func (err XvBadEncodingError) Error() string { } func init() { - newErrorFuncs[1] = NewXvBadEncodingError + newExtErrorFuncs["XVideo"][1] = NewXvBadEncodingError } // Error definition XvBadControl (2) @@ -1184,7 +1188,7 @@ func (err XvBadControlError) Error() string { } func init() { - newErrorFuncs[2] = NewXvBadControlError + newExtErrorFuncs["XVideo"][2] = NewXvBadControlError } // Request XvQueryExtension diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go index 61eab40..9c53a59 100644 --- a/nexgb/auto_xvmc.go +++ b/nexgb/auto_xvmc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xvmc.xml on May 6 2012 5:48:48pm EDT. + This file was generated by xvmc.xml on May 7 2012 9:17:58pm EDT. This file is automatically generated. Edit at your peril! */ @@ -16,7 +16,7 @@ func (c *Conn) XvmcInit() error { case err != nil: return err case !reply.Present: - return newError("No extension named XVideo-MotionCompensation could be found on on the server.") + return errorf("No extension named XVideo-MotionCompensation could be found on on the server.") } c.extLock.Lock() @@ -24,6 +24,9 @@ func (c *Conn) XvmcInit() error { for evNum, fun := range newExtEventFuncs["XVideo-MotionCompensation"] { newEventFuncs[int(reply.FirstEvent)+evNum] = fun } + for errNum, fun := range newExtErrorFuncs["XVideo-MotionCompensation"] { + newErrorFuncs[int(reply.FirstError)+errNum] = fun + } c.extLock.Unlock() return nil @@ -31,8 +34,11 @@ func (c *Conn) XvmcInit() error { func init() { newExtEventFuncs["XVideo-MotionCompensation"] = make(map[int]newEventFun) + newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -57,8 +63,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - // Skipping resource definition of 'Context' // Skipping resource definition of 'Surface' diff --git a/nexgb/xgb.go b/nexgb/xgb.go index c9a265f..cec06d6 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -2,19 +2,43 @@ package xgb import ( "errors" - "fmt" + "log" "io" "net" - "os" "sync" ) +func init() { + log.SetFlags(0) + log.SetPrefix("XGB:") +} + const ( // cookieBuffer represents the queue size of cookies existing at any // point in time. The size of the buffer is really only important when // there are many requests without replies made in sequence. Once the // buffer fills, a round trip request is made to clear the buffer. cookieBuffer = 1000 + + // xidBuffer represents the queue size of the xid channel. + // I don't think this value matters much, since xid generation is not + // that expensive. + xidBuffer = 5 + + // seqBuffer represents the queue size of the sequence number channel. + // I don't think this value matters much, since sequence number generation + // is not that expensive. + seqBuffer = 5 + + // reqBuffer represents the queue size of the number of requests that + // can be made until new ones block. This value seems OK. + reqBuffer = 100 + + // eventBuffer represents the queue size of the number of events or errors + // that can be loaded off the wire and not grabbed with WaitForEvent + // until reading an event blocks. This value should be big enough to handle + // bursts of events. + eventBuffer = 500 ) // A Conn represents a connection to an X server. @@ -64,10 +88,10 @@ func NewConnDisplay(display string) (*Conn, error) { conn.extensions = make(map[string]byte) conn.cookieChan = make(chan *cookie, cookieBuffer) - conn.xidChan = make(chan xid, 5) - conn.seqChan = make(chan uint16, 20) - conn.reqChan = make(chan *request, 100) - conn.eventChan = make(chan eventOrError, 100) + conn.xidChan = make(chan xid, xidBuffer) + conn.seqChan = make(chan uint16, seqBuffer) + conn.reqChan = make(chan *request, reqBuffer) + conn.eventChan = make(chan eventOrError, eventBuffer) go conn.generateXIds() go conn.generateSeqIds() @@ -106,7 +130,7 @@ type newEventFun func(buf []byte) Event var newEventFuncs = make(map[int]newEventFun) // newExtEventFuncs is a temporary map that stores event constructor functions -// for each extension. When an extension is initialize, each event for that +// for each extension. When an extension is initialized, each event for that // extension is added to the 'newEventFuncs' map. var newExtEventFuncs = make(map[string]map[int]newEventFun) @@ -119,9 +143,16 @@ type Error interface { Error() string } +type newErrorFun func(buf []byte) Error + // newErrorFuncs is a map from error numbers to functions that create // the corresponding error. -var newErrorFuncs = map[int]func(buf []byte) Error{} +var newErrorFuncs = make(map[int]newErrorFun) + +// newExtErrorFuncs is a temporary map that stores error constructor functions +// for each extension. When an extension is initialized, each error for that +// extension is added to the 'newErrorFuncs' map. +var newExtErrorFuncs = make(map[string]map[int]newErrorFun) // eventOrError corresponds to values that can be either an event or an // error. @@ -239,28 +270,22 @@ func (c *Conn) sendRequests() { cookie := c.newCookie(true, true) cookie.Sequence = c.newSequenceId() c.cookieChan <- cookie - if !c.writeBuffer(c.getInputFocusRequest()) { - return - } + c.writeBuffer(c.getInputFocusRequest()) GetInputFocusCookie{cookie}.Reply() // wait for the buffer to clear } req.cookie.Sequence = c.newSequenceId() c.cookieChan <- req.cookie - if !c.writeBuffer(req.buf) { - return - } + c.writeBuffer(req.buf) } } // writeBuffer is a convenience function for writing a byte slice to the wire. -func (c *Conn) writeBuffer(buf []byte) bool { +func (c *Conn) writeBuffer(buf []byte) { if _, err := c.conn.Write(buf); err != nil { - fmt.Fprintf(os.Stderr, "x protocol write error: %s\n", err) - close(c.reqChan) - return false + log.Printf("Write error: %s", err) + log.Fatal("A write error is unrecoverable. Exiting...") } - return true } // readResponses is a goroutine that reads events, errors and @@ -285,9 +310,8 @@ func (c *Conn) readResponses() { err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) - close(c.eventChan) - break + log.Printf("Read error: %s", err) + log.Fatal("A read error is unrecoverable. Exiting...") } switch buf[0] { @@ -296,10 +320,8 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := newErrorFuncs[int(buf[1])] if !ok { - fmt.Fprintf(os.Stderr, - "BUG: "+ - "Could not find error constructor function for error "+ - "with number %d.\n", buf[1]) + log.Printf("BUG: Could not find error constructor function " + + "for error with number %d.", buf[1]) continue } err = newErrFun(buf) @@ -317,9 +339,8 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - fmt.Fprintf(os.Stderr, "x protocol read error: %s\n", err) - close(c.eventChan) - break + log.Printf("Read error: %s", err) + log.Fatal("A read error is unrecoverable. Exiting...") } replyBytes = biggerBuf } else { @@ -336,17 +357,24 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := newEventFuncs[evNum] if !ok { - fmt.Fprintf(os.Stderr, - "BUG: "+ - "Could not find event constructor function for event "+ - "with number %d.", evNum) + log.Printf("BUG: Could not find event construct function " + + "for event with number %d.", evNum) continue } event = newEventFun(buf) // Put the event into the queue. - c.eventChan <- event + // FIXME: I'm not sure if using a goroutine here to guarantee + // a non-blocking send is the right way to go. I should implement + // a proper dynamic queue. + if cap(c.eventChan) == len(c.eventChan) { + go func() { + c.eventChan <- event + }() + } else { + c.eventChan <- event + } // No more processing for events. continue @@ -376,9 +404,8 @@ func (c *Conn) readResponses() { } } else { // this is a reply if cookie.replyChan == nil { - fmt.Fprintf(os.Stderr, - "Reply with sequence id %d does not have a "+ - "cookie with a valid reply channel.\n", seq) + log.Printf("Reply with sequence id %d does not have a "+ + "cookie with a valid reply channel.", seq) continue } else { cookie.replyChan <- replyBytes @@ -390,16 +417,14 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - fmt.Fprintf(os.Stderr, - "Found cookie with sequence id %d that is expecting a "+ - "reply but will never get it. Currently on sequence "+ - "number %d\n", cookie.Sequence, seq) + log.Printf("Found cookie with sequence id %d that is " + + "expecting a reply but will never get it. Currently " + + "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - fmt.Fprintf(os.Stderr, - "Found cookie with sequence id %d that is expecting a "+ - "reply (and not an error) but will never get it. "+ - "Currently on sequence number %d\n", + log.Printf("Found cookie with sequence id %d that is " + + "expecting a reply (and not an error) but will never " + + "get it. Currently on sequence number %d", cookie.Sequence, seq) // Checked requests without replies case cookie.pingChan != nil && cookie.errorChan != nil: @@ -420,7 +445,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { case Error: return nil, ee default: - fmt.Fprintf(os.Stderr, "Invalid event/error type: %T\n", everr) + log.Printf("Invalid event/error type: %T", everr) return nil, nil } panic("unreachable") diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index 6d07938..6c3b40a 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -1,7 +1,6 @@ package xgb import ( - "errors" "fmt" "strings" ) @@ -17,10 +16,10 @@ func sprintf(format string, v ...interface{}) string { return fmt.Sprintf(format, v...) } -// newError is just a wrapper for errors.New. Exists for the same reason +// errorf is just a wrapper for fmt.Errorf. Exists for the same reason // that 'stringsJoin' and 'sprintf' exists. -func newError(format string, v ...interface{}) error { - return errors.New(fmt.Sprintf(format, v...)) +func errorf(format string, v ...interface{}) error { + return fmt.Errorf(format, v...) } // Pad a length to align on 4 bytes. diff --git a/nexgb/xgb_test.go b/nexgb/xgb_test.go index b70ff5e..7eea19b 100644 --- a/nexgb/xgb_test.go +++ b/nexgb/xgb_test.go @@ -162,6 +162,24 @@ func TestWindowEvents(t *testing.T) { t.Fatalf("ConfigureWindow: %s", err) } + err = X.ConfigureWindowChecked(wid, + ConfigWindowX|ConfigWindowY| + ConfigWindowWidth|ConfigWindowHeight, + []uint32{uint32(gx + 2), uint32(gy), uint32(gw), uint32(gh)}).Check() + if err != nil { + t.Fatalf("ConfigureWindow: %s", err) + } + + err = X.ConfigureWindowChecked(wid, + ConfigWindowX|ConfigWindowY| + ConfigWindowWidth|ConfigWindowHeight, + []uint32{uint32(gx + 1), uint32(gy), uint32(gw), uint32(gh)}).Check() + if err != nil { + t.Fatalf("ConfigureWindow: %s", err) + } + + TestProperty(t) + evOrErr := waitForEvent(t, 5) switch event := evOrErr.ev.(type) { case ConfigureNotifyEvent: diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index f1762d3..a7a1d1d 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -86,7 +86,7 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("case err != nil:") c.Putln("return err") c.Putln("case !reply.Present:") - c.Putln("return newError(\"No extension named %s could be found on "+ + c.Putln("return errorf(\"No extension named %s could be found on "+ "on the server.\")", xname) c.Putln("}") c.Putln("") @@ -95,6 +95,9 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("for evNum, fun := range newExtEventFuncs[\"%s\"] {", xname) c.Putln("newEventFuncs[int(reply.FirstEvent) + evNum] = fun") c.Putln("}") + c.Putln("for errNum, fun := range newExtErrorFuncs[\"%s\"] {", xname) + c.Putln("newErrorFuncs[int(reply.FirstError) + errNum] = fun") + c.Putln("}") c.Putln("c.extLock.Unlock()") c.Putln("") c.Putln("return nil") @@ -102,8 +105,10 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("") // Make sure newExtEventFuncs["EXT_NAME"] map is initialized. + // Same deal for newExtErrorFuncs["EXT_NAME"] c.Putln("func init() {") c.Putln("newExtEventFuncs[\"%s\"] = make(map[int]newEventFun)", xname) + c.Putln("newExtErrorFuncs[\"%s\"] = make(map[int]newErrorFun)", xname) c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 9e01042..c96866c 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -29,7 +29,12 @@ func (e *Error) Define(c *Context) { // Let's the XGB event loop read this error. c.Putln("func init() {") - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + if c.protocol.isExt() { + c.Putln("newExtErrorFuncs[\"%s\"][%d] = New%s", + c.protocol.ExtXName, e.Number, e.ErrType()) + } else { + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + } c.Putln("}") c.Putln("") } @@ -95,7 +100,12 @@ func (e *ErrorCopy) Define(c *Context) { // Let's the XGB know how to read this error. c.Putln("func init() {") - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + if c.protocol.isExt() { + c.Putln("newExtErrorFuncs[\"%s\"][%d] = New%s", + c.protocol.ExtXName, e.Number, e.ErrType()) + } else { + c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + } c.Putln("}") c.Putln("") } From e256da00b1fdccc7508a4cc5b9e9a3b195d44203 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 7 May 2012 21:58:43 -0400 Subject: [PATCH 29/90] gofmt --- nexgb/xgb.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index cec06d6..e5f4b1f 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -2,8 +2,8 @@ package xgb import ( "errors" - "log" "io" + "log" "net" "sync" ) @@ -320,7 +320,7 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := newErrorFuncs[int(buf[1])] if !ok { - log.Printf("BUG: Could not find error constructor function " + + log.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) continue } @@ -357,7 +357,7 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := newEventFuncs[evNum] if !ok { - log.Printf("BUG: Could not find event construct function " + + log.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) continue } @@ -417,13 +417,13 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - log.Printf("Found cookie with sequence id %d that is " + - "expecting a reply but will never get it. Currently " + + log.Printf("Found cookie with sequence id %d that is "+ + "expecting a reply but will never get it. Currently "+ "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - log.Printf("Found cookie with sequence id %d that is " + - "expecting a reply (and not an error) but will never " + + log.Printf("Found cookie with sequence id %d that is "+ + "expecting a reply (and not an error) but will never "+ "get it. Currently on sequence number %d", cookie.Sequence, seq) // Checked requests without replies From 62b293c9374609afa344135693c33b9e808ceb72 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 8 May 2012 00:27:00 -0400 Subject: [PATCH 30/90] use a custom logger so we don't stomp all over the global log configuration --- nexgb/auto_bigreq.go | 6 +++--- nexgb/auto_composite.go | 14 +++++++------- nexgb/auto_damage.go | 18 +++++++++--------- nexgb/auto_dpms.go | 2 +- nexgb/auto_dri2.go | 2 +- nexgb/auto_ge.go | 6 +++--- nexgb/auto_glx.go | 18 +++++++++--------- nexgb/auto_randr.go | 18 +++++++++--------- nexgb/auto_record.go | 22 +++++++++++----------- nexgb/auto_render.go | 6 +++--- nexgb/auto_res.go | 26 +++++++++++++------------- nexgb/auto_screensaver.go | 18 +++++++++--------- nexgb/auto_shape.go | 14 +++++++------- nexgb/auto_shm.go | 22 +++++++++++----------- nexgb/auto_sync.go | 6 +++--- nexgb/auto_xc_misc.go | 22 +++++++++++----------- nexgb/auto_xevie.go | 18 +++++++++--------- nexgb/auto_xf86dri.go | 14 +++++++------- nexgb/auto_xf86vidmode.go | 26 +++++++++++++------------- nexgb/auto_xfixes.go | 14 +++++++------- nexgb/auto_xinerama.go | 14 +++++++------- nexgb/auto_xinput.go | 22 +++++++++++----------- nexgb/auto_xprint.go | 22 +++++++++++----------- nexgb/auto_xproto.go | 6 +++--- nexgb/auto_xselinux.go | 6 +++--- nexgb/auto_xtest.go | 18 +++++++++--------- nexgb/auto_xv.go | 2 +- nexgb/auto_xvmc.go | 14 +++++++------- nexgb/conn.go | 11 +++++------ nexgb/xgb.go | 32 +++++++++++++++----------------- 30 files changed, 218 insertions(+), 221 deletions(-) diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go index c1eb4d0..24fcfdc 100644 --- a/nexgb/auto_bigreq.go +++ b/nexgb/auto_bigreq.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by bigreq.xml on May 7 2012 9:17:56pm EDT. + This file was generated by bigreq.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,8 @@ func init() { newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -57,8 +59,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - // Request BigreqEnable // size: 4 type BigreqEnableCookie struct { diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go index 4262468..85c4ee2 100644 --- a/nexgb/auto_composite.go +++ b/nexgb/auto_composite.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by composite.xml on May 7 2012 9:17:56pm EDT. + This file was generated by composite.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,12 +38,6 @@ func init() { newExtErrorFuncs["Composite"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( CompositeRedirectAutomatic = 0 CompositeRedirectManual = 1 diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index c3d2734..26f5fba 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 7 2012 9:17:56pm EDT. + This file was generated by damage.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,6 +38,14 @@ func init() { newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go index 5200bfa..4626410 100644 --- a/nexgb/auto_dpms.go +++ b/nexgb/auto_dpms.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dpms.xml on May 7 2012 9:17:56pm EDT. + This file was generated by dpms.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go index 68d6084..a9527f7 100644 --- a/nexgb/auto_dri2.go +++ b/nexgb/auto_dri2.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dri2.xml on May 7 2012 9:17:56pm EDT. + This file was generated by dri2.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go index ef80ebf..0c8f12b 100644 --- a/nexgb/auto_ge.go +++ b/nexgb/auto_ge.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by ge.xml on May 7 2012 9:17:56pm EDT. + This file was generated by ge.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,8 +33,6 @@ func init() { newExtErrorFuncs["Generic Event Extension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -59,6 +57,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + // Request GeQueryVersion // size: 8 type GeQueryVersionCookie struct { diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go index 67c79d7..22e5db5 100644 --- a/nexgb/auto_glx.go +++ b/nexgb/auto_glx.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by glx.xml on May 7 2012 9:17:56pm EDT. + This file was generated by glx.xml on May 7 2012 11:34:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,14 @@ func init() { newExtErrorFuncs["GLX"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -55,14 +63,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( GlxPbcetDamaged = 32791 GlxPbcetSaved = 32792 diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index 4e707e6..1971c2a 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 7 2012 9:17:56pm EDT. + This file was generated by randr.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,6 +38,14 @@ func init() { newExtErrorFuncs["RANDR"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go index 32e1715..b19002e 100644 --- a/nexgb/auto_record.go +++ b/nexgb/auto_record.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by record.xml on May 7 2012 9:17:57pm EDT. + This file was generated by record.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,16 @@ func init() { newExtErrorFuncs["RECORD"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -49,16 +59,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - const ( RecordHTypeFromServerTime = 1 RecordHTypeFromClientTime = 2 diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index fa0c5f2..1cf98e1 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 7 2012 9:17:57pm EDT. + This file was generated by render.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,8 @@ func init() { newExtErrorFuncs["RENDER"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -61,8 +63,6 @@ func init() { // Skipping definition for base type 'Void' -// Skipping definition for base type 'Byte' - const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go index eeaf01f..4e93d7f 100644 --- a/nexgb/auto_res.go +++ b/nexgb/auto_res.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by res.xml on May 7 2012 9:17:57pm EDT. + This file was generated by res.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,18 +37,6 @@ func init() { newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - // Skipping definition for base type 'Double' // Skipping definition for base type 'Bool' @@ -63,6 +51,18 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + // 'ResClient' struct definition // Size: 8 type ResClient struct { diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go index 13aa818..5fa2e27 100644 --- a/nexgb/auto_screensaver.go +++ b/nexgb/auto_screensaver.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by screensaver.xml on May 7 2012 9:17:57pm EDT. + This file was generated by screensaver.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,14 @@ func init() { newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -55,14 +63,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( ScreensaverKindBlanked = 0 ScreensaverKindInternal = 1 diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go index 4b52a5d..3af630c 100644 --- a/nexgb/auto_shape.go +++ b/nexgb/auto_shape.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shape.xml on May 7 2012 9:17:57pm EDT. + This file was generated by shape.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,12 +37,6 @@ func init() { newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -63,6 +57,12 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( ShapeSoSet = 0 ShapeSoUnion = 1 diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go index a6d64a2..b5c4307 100644 --- a/nexgb/auto_shm.go +++ b/nexgb/auto_shm.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shm.xml on May 7 2012 9:17:57pm EDT. + This file was generated by shm.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -53,16 +63,6 @@ func init() { // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - // Skipping resource definition of 'Seg' // Event definition ShmCompletion (0) diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go index ef69ebe..c76db74 100644 --- a/nexgb/auto_sync.go +++ b/nexgb/auto_sync.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by sync.xml on May 7 2012 9:17:57pm EDT. + This file was generated by sync.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["SYNC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -63,6 +61,8 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + const ( SyncAlarmstateActive = 0 SyncAlarmstateInactive = 1 diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go index 4d5c03c..2ad3d34 100644 --- a/nexgb/auto_xc_misc.go +++ b/nexgb/auto_xc_misc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xc_misc.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xc_misc.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,16 +33,6 @@ func init() { newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -59,6 +49,16 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Request Xc_miscGetVersion // size: 8 type Xc_miscGetVersionCookie struct { diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go index 1046f1b..3294fad 100644 --- a/nexgb/auto_xevie.go +++ b/nexgb/auto_xevie.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xevie.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xevie.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,14 +33,6 @@ func init() { newExtErrorFuncs["XEVIE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -59,6 +51,14 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( XevieDatatypeUnmodified = 0 XevieDatatypeModified = 1 diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go index 362fa40..5930f79 100644 --- a/nexgb/auto_xf86dri.go +++ b/nexgb/auto_xf86dri.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86dri.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xf86dri.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,12 +33,6 @@ func init() { newExtErrorFuncs["XFree86-DRI"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -59,6 +53,12 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // 'Xf86driDrmClipRect' struct definition // Size: 8 type Xf86driDrmClipRect struct { diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go index d44105d..aed3216 100644 --- a/nexgb/auto_xf86vidmode.go +++ b/nexgb/auto_xf86vidmode.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86vidmode.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xf86vidmode.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,18 +33,6 @@ func init() { newExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -59,6 +47,18 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( Xf86vidmodeModeFlagPositiveHsync = 1 Xf86vidmodeModeFlagNegativeHsync = 2 diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go index f188be0..3adad5b 100644 --- a/nexgb/auto_xfixes.go +++ b/nexgb/auto_xfixes.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xfixes.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xfixes.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +39,12 @@ func init() { newExtErrorFuncs["XFIXES"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -59,12 +65,6 @@ func init() { // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( XfixesSaveSetModeInsert = 0 XfixesSaveSetModeDelete = 1 diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index ff7453c..09db3f8 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xinerama.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,12 @@ func init() { newExtErrorFuncs["XINERAMA"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -57,12 +63,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // 'XineramaScreenInfo' struct definition // Size: 8 type XineramaScreenInfo struct { diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go index 7305d2d..ddcb170 100644 --- a/nexgb/auto_xinput.go +++ b/nexgb/auto_xinput.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinput.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xinput.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,16 +37,6 @@ func init() { newExtErrorFuncs["XInputExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -63,6 +53,16 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( XinputValuatorModeRelative = 0 XinputValuatorModeAbsolute = 1 diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go index 9bb8ea7..981ca17 100644 --- a/nexgb/auto_xprint.go +++ b/nexgb/auto_xprint.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xprint.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xprint.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["XpExtension"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -53,16 +63,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( XprintGetDocFinished = 0 XprintGetDocSecondConsumer = 1 diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index 20152c8..e826249 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,10 +1,12 @@ package xgb /* - This file was generated by xproto.xml on May 7 2012 9:17:57pm EDT. + This file was generated by xproto.xml on May 7 2012 11:34:26pm EDT. This file is automatically generated. Edit at your peril! */ +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -29,8 +31,6 @@ package xgb // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go index a51346a..c0944aa 100644 --- a/nexgb/auto_xselinux.go +++ b/nexgb/auto_xselinux.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xselinux.xml on May 7 2012 9:17:58pm EDT. + This file was generated by xselinux.xml on May 7 2012 11:34:27pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["SELinux"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -63,6 +61,8 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Id' + // 'XselinuxListItem' struct definition // Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) type XselinuxListItem struct { diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go index 8a43878..616f651 100644 --- a/nexgb/auto_xtest.go +++ b/nexgb/auto_xtest.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xtest.xml on May 7 2012 9:17:58pm EDT. + This file was generated by xtest.xml on May 7 2012 11:34:27pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,14 @@ func init() { newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Id' @@ -55,14 +63,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( XtestCursorNone = 0 XtestCursorCurrent = 1 diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go index dc2826b..e67db8d 100644 --- a/nexgb/auto_xv.go +++ b/nexgb/auto_xv.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xv.xml on May 7 2012 9:17:58pm EDT. + This file was generated by xv.xml on May 7 2012 11:34:27pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go index 9c53a59..2310f20 100644 --- a/nexgb/auto_xvmc.go +++ b/nexgb/auto_xvmc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xvmc.xml on May 7 2012 9:17:58pm EDT. + This file was generated by xvmc.xml on May 7 2012 11:34:27pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,12 +37,6 @@ func init() { newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +57,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping resource definition of 'Context' // Skipping resource definition of 'Surface' diff --git a/nexgb/conn.go b/nexgb/conn.go index 02396d4..af78be9 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -26,8 +26,8 @@ func (c *Conn) connect(display string) error { authName, authData, err := readAuthority(c.host, c.display) noauth := false if err != nil { - fmt.Fprintf(os.Stderr, "Could not get authority info: %v\n", err) - fmt.Fprintf(os.Stderr, "Trying connection without authority info...\n") + logger.Printf("Could not get authority info: %v", err) + logger.Println("Trying connection without authority info...") authName = "" authData = []byte{} noauth = true @@ -63,8 +63,7 @@ func (c *Conn) connect(display string) error { dataLen := Get16(head[6:]) if major != 11 || minor != 0 { - return errors.New(fmt.Sprintf("x protocol version mismatch: %d.%d", - major, minor)) + return fmt.Errorf("x protocol version mismatch: %d.%d", major, minor) } buf = make([]byte, int(dataLen)*4+8, int(dataLen)*4+8) @@ -75,8 +74,8 @@ func (c *Conn) connect(display string) error { if code == 0 { reason := buf[8 : 8+reasonLen] - return errors.New(fmt.Sprintf("x protocol authentication refused: %s", - string(reason))) + return fmt.Errorf("x protocol authentication refused: %s", + string(reason)) } ReadSetupInfo(buf, &c.Setup) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index e5f4b1f..b2bf84b 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -5,13 +5,11 @@ import ( "io" "log" "net" + "os" "sync" ) -func init() { - log.SetFlags(0) - log.SetPrefix("XGB:") -} +var logger = log.New(os.Stderr, "XGB: ", 0) const ( // cookieBuffer represents the queue size of cookies existing at any @@ -283,8 +281,8 @@ func (c *Conn) sendRequests() { // writeBuffer is a convenience function for writing a byte slice to the wire. func (c *Conn) writeBuffer(buf []byte) { if _, err := c.conn.Write(buf); err != nil { - log.Printf("Write error: %s", err) - log.Fatal("A write error is unrecoverable. Exiting...") + logger.Printf("Write error: %s", err) + logger.Fatal("A write error is unrecoverable. Exiting...") } } @@ -310,8 +308,8 @@ func (c *Conn) readResponses() { err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - log.Printf("Read error: %s", err) - log.Fatal("A read error is unrecoverable. Exiting...") + logger.Printf("Read error: %s", err) + logger.Fatal("A read error is unrecoverable. Exiting...") } switch buf[0] { @@ -320,7 +318,7 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := newErrorFuncs[int(buf[1])] if !ok { - log.Printf("BUG: Could not find error constructor function "+ + logger.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) continue } @@ -339,8 +337,8 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - log.Printf("Read error: %s", err) - log.Fatal("A read error is unrecoverable. Exiting...") + logger.Printf("Read error: %s", err) + logger.Fatal("A read error is unrecoverable. Exiting...") } replyBytes = biggerBuf } else { @@ -357,7 +355,7 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := newEventFuncs[evNum] if !ok { - log.Printf("BUG: Could not find event construct function "+ + logger.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) continue } @@ -404,8 +402,8 @@ func (c *Conn) readResponses() { } } else { // this is a reply if cookie.replyChan == nil { - log.Printf("Reply with sequence id %d does not have a "+ - "cookie with a valid reply channel.", seq) + logger.Printf("Reply with sequence id %d does not "+ + "have a cookie with a valid reply channel.", seq) continue } else { cookie.replyChan <- replyBytes @@ -417,12 +415,12 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - log.Printf("Found cookie with sequence id %d that is "+ + logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply but will never get it. Currently "+ "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - log.Printf("Found cookie with sequence id %d that is "+ + logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply (and not an error) but will never "+ "get it. Currently on sequence number %d", cookie.Sequence, seq) @@ -445,7 +443,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { case Error: return nil, ee default: - log.Printf("Invalid event/error type: %T", everr) + logger.Printf("Invalid event/error type: %T", everr) return nil, nil } panic("unreachable") From 5d64f69030fd427f8518b8255f10fab3fc51b72a Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 8 May 2012 23:03:45 -0400 Subject: [PATCH 31/90] fixed nasty bug that made XGB not thread safe --- nexgb/xgb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index b2bf84b..8baa208 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -303,8 +303,8 @@ func (c *Conn) readResponses() { replyBytes []byte ) - buf := make([]byte, 32) for { + buf := make([]byte, 32) err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { From 00c6217ca905b08ce0acda9a90492b5c1dc358e8 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 8 May 2012 23:03:55 -0400 Subject: [PATCH 32/90] update --- nexgb/auto_bigreq.go | 22 +++++++++++----------- nexgb/auto_composite.go | 2 +- nexgb/auto_damage.go | 14 +++++++------- nexgb/auto_dpms.go | 18 +++++++++--------- nexgb/auto_dri2.go | 22 +++++++++++----------- nexgb/auto_ge.go | 6 +++--- nexgb/auto_glx.go | 6 +++--- nexgb/auto_randr.go | 14 +++++++------- nexgb/auto_record.go | 10 +++++----- nexgb/auto_render.go | 18 +++++++++--------- nexgb/auto_res.go | 6 +++--- nexgb/auto_screensaver.go | 14 +++++++------- nexgb/auto_shape.go | 6 +++--- nexgb/auto_shm.go | 14 +++++++------- nexgb/auto_sync.go | 26 +++++++++++++------------- nexgb/auto_xc_misc.go | 14 +++++++------- nexgb/auto_xevie.go | 10 +++++----- nexgb/auto_xf86dri.go | 22 +++++++++++----------- nexgb/auto_xf86vidmode.go | 2 +- nexgb/auto_xfixes.go | 18 +++++++++--------- nexgb/auto_xinerama.go | 2 +- nexgb/auto_xinput.go | 6 +++--- nexgb/auto_xprint.go | 22 +++++++++++----------- nexgb/auto_xproto.go | 22 +++++++++++----------- nexgb/auto_xselinux.go | 22 +++++++++++----------- nexgb/auto_xtest.go | 6 +++--- nexgb/auto_xv.go | 6 +++--- nexgb/auto_xvmc.go | 18 +++++++++--------- 28 files changed, 184 insertions(+), 184 deletions(-) diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go index 24fcfdc..ad06b60 100644 --- a/nexgb/auto_bigreq.go +++ b/nexgb/auto_bigreq.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by bigreq.xml on May 7 2012 11:34:25pm EDT. + This file was generated by bigreq.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,16 +33,6 @@ func init() { newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -59,6 +49,16 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + // Request BigreqEnable // size: 4 type BigreqEnableCookie struct { diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go index 85c4ee2..c6c3241 100644 --- a/nexgb/auto_composite.go +++ b/nexgb/auto_composite.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by composite.xml on May 7 2012 11:34:25pm EDT. + This file was generated by composite.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index 26f5fba..b3130d9 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 7 2012 11:34:25pm EDT. + This file was generated by damage.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,6 +38,12 @@ func init() { newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go index 4626410..fb4b170 100644 --- a/nexgb/auto_dpms.go +++ b/nexgb/auto_dpms.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dpms.xml on May 7 2012 11:34:25pm EDT. + This file was generated by dpms.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,14 +33,6 @@ func init() { newExtErrorFuncs["DPMS"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -59,6 +51,14 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( DpmsDPMSModeOn = 0 DpmsDPMSModeStandby = 1 diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go index a9527f7..d48677b 100644 --- a/nexgb/auto_dri2.go +++ b/nexgb/auto_dri2.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dri2.xml on May 7 2012 11:34:25pm EDT. + This file was generated by dri2.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["DRI2"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Id' // Skipping definition for base type 'Card8' @@ -53,16 +63,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - const ( Dri2AttachmentBufferFrontLeft = 0 Dri2AttachmentBufferBackLeft = 1 diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go index 0c8f12b..10b4ac0 100644 --- a/nexgb/auto_ge.go +++ b/nexgb/auto_ge.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by ge.xml on May 7 2012 11:34:25pm EDT. + This file was generated by ge.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,8 @@ func init() { newExtErrorFuncs["Generic Event Extension"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -57,8 +59,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - // Request GeQueryVersion // size: 8 type GeQueryVersionCookie struct { diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go index 22e5db5..d88b1c9 100644 --- a/nexgb/auto_glx.go +++ b/nexgb/auto_glx.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by glx.xml on May 7 2012 11:34:25pm EDT. + This file was generated by glx.xml on May 8 2012 11:03:23pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["GLX"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -63,6 +61,8 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + const ( GlxPbcetDamaged = 32791 GlxPbcetSaved = 32792 diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index 1971c2a..e086abd 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 7 2012 11:34:26pm EDT. + This file was generated by randr.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,6 +38,12 @@ func init() { newExtErrorFuncs["RANDR"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go index b19002e..c92868f 100644 --- a/nexgb/auto_record.go +++ b/nexgb/auto_record.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by record.xml on May 7 2012 11:34:26pm EDT. + This file was generated by record.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,10 @@ func init() { newExtErrorFuncs["RECORD"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -55,10 +59,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - const ( RecordHTypeFromServerTime = 1 RecordHTypeFromClientTime = 2 diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index 1cf98e1..bea7d88 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 7 2012 11:34:26pm EDT. + This file was generated by render.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,14 +37,6 @@ func init() { newExtErrorFuncs["RENDER"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -63,6 +55,14 @@ func init() { // Skipping definition for base type 'Void' +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go index 4e93d7f..3aca143 100644 --- a/nexgb/auto_res.go +++ b/nexgb/auto_res.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by res.xml on May 7 2012 11:34:26pm EDT. + This file was generated by res.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Double' - // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -63,6 +61,8 @@ func init() { // Skipping definition for base type 'Card32' +// Skipping definition for base type 'Double' + // 'ResClient' struct definition // Size: 8 type ResClient struct { diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go index 5fa2e27..9bb8d13 100644 --- a/nexgb/auto_screensaver.go +++ b/nexgb/auto_screensaver.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by screensaver.xml on May 7 2012 11:34:26pm EDT. + This file was generated by screensaver.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,12 +37,6 @@ func init() { newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +57,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( ScreensaverKindBlanked = 0 ScreensaverKindInternal = 1 diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go index 3af630c..bad291a 100644 --- a/nexgb/auto_shape.go +++ b/nexgb/auto_shape.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shape.xml on May 7 2012 11:34:26pm EDT. + This file was generated by shape.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,8 @@ func init() { newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -61,8 +63,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - const ( ShapeSoSet = 0 ShapeSoUnion = 1 diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go index b5c4307..a3dfcf7 100644 --- a/nexgb/auto_shm.go +++ b/nexgb/auto_shm.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shm.xml on May 7 2012 11:34:26pm EDT. + This file was generated by shm.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,12 @@ func init() { newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -57,12 +63,6 @@ func init() { // Skipping definition for base type 'Id' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping resource definition of 'Seg' // Event definition ShmCompletion (0) diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go index c76db74..b043b9f 100644 --- a/nexgb/auto_sync.go +++ b/nexgb/auto_sync.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by sync.xml on May 7 2012 11:34:26pm EDT. + This file was generated by sync.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,18 +37,6 @@ func init() { newExtErrorFuncs["SYNC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -63,6 +51,18 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + const ( SyncAlarmstateActive = 0 SyncAlarmstateInactive = 1 diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go index 2ad3d34..5088e25 100644 --- a/nexgb/auto_xc_misc.go +++ b/nexgb/auto_xc_misc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xc_misc.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xc_misc.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,12 +33,6 @@ func init() { newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -59,6 +53,12 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + // Request Xc_miscGetVersion // size: 8 type Xc_miscGetVersionCookie struct { diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go index 3294fad..56a8e32 100644 --- a/nexgb/auto_xevie.go +++ b/nexgb/auto_xevie.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xevie.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xevie.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,10 +33,6 @@ func init() { newExtErrorFuncs["XEVIE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -59,6 +55,10 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( XevieDatatypeUnmodified = 0 XevieDatatypeModified = 1 diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go index 5930f79..eb9b14a 100644 --- a/nexgb/auto_xf86dri.go +++ b/nexgb/auto_xf86dri.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86dri.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xf86dri.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,16 +33,6 @@ func init() { newExtErrorFuncs["XFree86-DRI"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -59,6 +49,16 @@ func init() { // Skipping definition for base type 'Char' +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Id' + // 'Xf86driDrmClipRect' struct definition // Size: 8 type Xf86driDrmClipRect struct { diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go index aed3216..459dc9e 100644 --- a/nexgb/auto_xf86vidmode.go +++ b/nexgb/auto_xf86vidmode.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86vidmode.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xf86vidmode.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go index 3adad5b..1518044 100644 --- a/nexgb/auto_xfixes.go +++ b/nexgb/auto_xfixes.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xfixes.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xfixes.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +39,14 @@ func init() { newExtErrorFuncs["XFIXES"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Id' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -57,14 +65,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( XfixesSaveSetModeInsert = 0 XfixesSaveSetModeDelete = 1 diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index 09db3f8..0f52bf2 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xinerama.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go index ddcb170..a15c426 100644 --- a/nexgb/auto_xinput.go +++ b/nexgb/auto_xinput.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinput.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xinput.xml on May 8 2012 11:03:24pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["XInputExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -63,6 +61,8 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + const ( XinputValuatorModeRelative = 0 XinputValuatorModeAbsolute = 1 diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go index 981ca17..5cd086a 100644 --- a/nexgb/auto_xprint.go +++ b/nexgb/auto_xprint.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xprint.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xprint.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["XpExtension"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -53,16 +63,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( XprintGetDocFinished = 0 XprintGetDocSecondConsumer = 1 diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index e826249..6e8e9ee 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,10 +1,20 @@ package xgb /* - This file was generated by xproto.xml on May 7 2012 11:34:26pm EDT. + This file was generated by xproto.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -21,16 +31,6 @@ package xgb // Skipping definition for base type 'Id' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go index c0944aa..34d40fd 100644 --- a/nexgb/auto_xselinux.go +++ b/nexgb/auto_xselinux.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xselinux.xml on May 7 2012 11:34:27pm EDT. + This file was generated by xselinux.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,16 +37,6 @@ func init() { newExtErrorFuncs["SELinux"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +53,16 @@ func init() { // Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // 'XselinuxListItem' struct definition // Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) type XselinuxListItem struct { diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go index 616f651..6410831 100644 --- a/nexgb/auto_xtest.go +++ b/nexgb/auto_xtest.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xtest.xml on May 7 2012 11:34:27pm EDT. + This file was generated by xtest.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,8 @@ func init() { newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -61,8 +63,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - const ( XtestCursorNone = 0 XtestCursorCurrent = 1 diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go index e67db8d..615c540 100644 --- a/nexgb/auto_xv.go +++ b/nexgb/auto_xv.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xv.xml on May 7 2012 11:34:27pm EDT. + This file was generated by xv.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,8 +38,6 @@ func init() { newExtErrorFuncs["XVideo"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + const ( XvTypeInputMask = 1 XvTypeOutputMask = 2 diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go index 2310f20..4797488 100644 --- a/nexgb/auto_xvmc.go +++ b/nexgb/auto_xvmc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xvmc.xml on May 7 2012 11:34:27pm EDT. + This file was generated by xvmc.xml on May 8 2012 11:03:25pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,14 @@ func init() { newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,14 +63,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping resource definition of 'Context' // Skipping resource definition of 'Surface' From e239bb3c68a4981a3916534203c2fbd6b96f593c Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 12:47:19 -0400 Subject: [PATCH 33/90] make resource ids their own individual types. last commit before overhaul to sub-packages --- nexgb/auto_bigreq.go | 20 +- nexgb/auto_composite.go | 68 +-- nexgb/auto_damage.go | 52 +- nexgb/auto_dpms.go | 24 +- nexgb/auto_dri2.go | 92 ++- nexgb/auto_ge.go | 4 +- nexgb/auto_glx.go | 252 ++++---- nexgb/auto_randr.go | 356 +++++------ nexgb/auto_record.go | 82 +-- nexgb/auto_render.go | 250 ++++---- nexgb/auto_res.go | 28 +- nexgb/auto_screensaver.go | 60 +- nexgb/auto_shape.go | 72 ++- nexgb/auto_shm.go | 78 +-- nexgb/auto_sync.go | 166 ++--- nexgb/auto_xc_misc.go | 12 +- nexgb/auto_xevie.go | 4 +- nexgb/auto_xf86dri.go | 8 +- nexgb/auto_xf86vidmode.go | 22 +- nexgb/auto_xfixes.go | 224 +++---- nexgb/auto_xinerama.go | 50 +- nexgb/auto_xinput.go | 112 ++-- nexgb/auto_xprint.go | 106 ++-- nexgb/auto_xproto.go | 1002 +++++++++++++++++-------------- nexgb/auto_xselinux.go | 64 +- nexgb/auto_xtest.go | 36 +- nexgb/auto_xv.go | 184 +++--- nexgb/auto_xvmc.go | 102 ++-- nexgb/xgb.go | 15 +- nexgb/xgb_test.go | 2 +- nexgb/xgbgen/go.go | 22 +- nexgb/xgbgen/go_error.go | 12 +- nexgb/xgbgen/go_list.go | 3 +- nexgb/xgbgen/go_single_field.go | 2 +- nexgb/xgbgen/translation.go | 5 - 35 files changed, 1906 insertions(+), 1685 deletions(-) diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go index ad06b60..e8bbaef 100644 --- a/nexgb/auto_bigreq.go +++ b/nexgb/auto_bigreq.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by bigreq.xml on May 8 2012 11:03:23pm EDT. + This file was generated by bigreq.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,12 +33,18 @@ func init() { newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -51,14 +57,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - // Request BigreqEnable // size: 4 type BigreqEnableCookie struct { diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go index c6c3241..836436f 100644 --- a/nexgb/auto_composite.go +++ b/nexgb/auto_composite.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by composite.xml on May 8 2012 11:03:23pm EDT. + This file was generated by composite.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,6 +38,12 @@ func init() { newExtErrorFuncs["Composite"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -52,18 +58,10 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( CompositeRedirectAutomatic = 0 CompositeRedirectManual = 1 @@ -169,13 +167,13 @@ type CompositeRedirectWindowCookie struct { } // Write request to wire for CompositeRedirectWindow -func (c *Conn) CompositeRedirectWindow(Window Id, Update byte) CompositeRedirectWindowCookie { +func (c *Conn) CompositeRedirectWindow(Window Window, Update byte) CompositeRedirectWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) return CompositeRedirectWindowCookie{cookie} } -func (c *Conn) CompositeRedirectWindowChecked(Window Id, Update byte) CompositeRedirectWindowCookie { +func (c *Conn) CompositeRedirectWindowChecked(Window Window, Update byte) CompositeRedirectWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) return CompositeRedirectWindowCookie{cookie} @@ -186,7 +184,7 @@ func (cook CompositeRedirectWindowCookie) Check() error { } // Write request to wire for CompositeRedirectWindow -func (c *Conn) compositeRedirectWindowRequest(Window Id, Update byte) []byte { +func (c *Conn) compositeRedirectWindowRequest(Window Window, Update byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -218,13 +216,13 @@ type CompositeRedirectSubwindowsCookie struct { } // Write request to wire for CompositeRedirectSubwindows -func (c *Conn) CompositeRedirectSubwindows(Window Id, Update byte) CompositeRedirectSubwindowsCookie { +func (c *Conn) CompositeRedirectSubwindows(Window Window, Update byte) CompositeRedirectSubwindowsCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) return CompositeRedirectSubwindowsCookie{cookie} } -func (c *Conn) CompositeRedirectSubwindowsChecked(Window Id, Update byte) CompositeRedirectSubwindowsCookie { +func (c *Conn) CompositeRedirectSubwindowsChecked(Window Window, Update byte) CompositeRedirectSubwindowsCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) return CompositeRedirectSubwindowsCookie{cookie} @@ -235,7 +233,7 @@ func (cook CompositeRedirectSubwindowsCookie) Check() error { } // Write request to wire for CompositeRedirectSubwindows -func (c *Conn) compositeRedirectSubwindowsRequest(Window Id, Update byte) []byte { +func (c *Conn) compositeRedirectSubwindowsRequest(Window Window, Update byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -267,13 +265,13 @@ type CompositeUnredirectWindowCookie struct { } // Write request to wire for CompositeUnredirectWindow -func (c *Conn) CompositeUnredirectWindow(Window Id, Update byte) CompositeUnredirectWindowCookie { +func (c *Conn) CompositeUnredirectWindow(Window Window, Update byte) CompositeUnredirectWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) return CompositeUnredirectWindowCookie{cookie} } -func (c *Conn) CompositeUnredirectWindowChecked(Window Id, Update byte) CompositeUnredirectWindowCookie { +func (c *Conn) CompositeUnredirectWindowChecked(Window Window, Update byte) CompositeUnredirectWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) return CompositeUnredirectWindowCookie{cookie} @@ -284,7 +282,7 @@ func (cook CompositeUnredirectWindowCookie) Check() error { } // Write request to wire for CompositeUnredirectWindow -func (c *Conn) compositeUnredirectWindowRequest(Window Id, Update byte) []byte { +func (c *Conn) compositeUnredirectWindowRequest(Window Window, Update byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -316,13 +314,13 @@ type CompositeUnredirectSubwindowsCookie struct { } // Write request to wire for CompositeUnredirectSubwindows -func (c *Conn) CompositeUnredirectSubwindows(Window Id, Update byte) CompositeUnredirectSubwindowsCookie { +func (c *Conn) CompositeUnredirectSubwindows(Window Window, Update byte) CompositeUnredirectSubwindowsCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) return CompositeUnredirectSubwindowsCookie{cookie} } -func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Id, Update byte) CompositeUnredirectSubwindowsCookie { +func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Window, Update byte) CompositeUnredirectSubwindowsCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) return CompositeUnredirectSubwindowsCookie{cookie} @@ -333,7 +331,7 @@ func (cook CompositeUnredirectSubwindowsCookie) Check() error { } // Write request to wire for CompositeUnredirectSubwindows -func (c *Conn) compositeUnredirectSubwindowsRequest(Window Id, Update byte) []byte { +func (c *Conn) compositeUnredirectSubwindowsRequest(Window Window, Update byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -365,13 +363,13 @@ type CompositeCreateRegionFromBorderClipCookie struct { } // Write request to wire for CompositeCreateRegionFromBorderClip -func (c *Conn) CompositeCreateRegionFromBorderClip(Region Id, Window Id) CompositeCreateRegionFromBorderClipCookie { +func (c *Conn) CompositeCreateRegionFromBorderClip(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) return CompositeCreateRegionFromBorderClipCookie{cookie} } -func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region Id, Window Id) CompositeCreateRegionFromBorderClipCookie { +func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) return CompositeCreateRegionFromBorderClipCookie{cookie} @@ -382,7 +380,7 @@ func (cook CompositeCreateRegionFromBorderClipCookie) Check() error { } // Write request to wire for CompositeCreateRegionFromBorderClip -func (c *Conn) compositeCreateRegionFromBorderClipRequest(Region Id, Window Id) []byte { +func (c *Conn) compositeCreateRegionFromBorderClipRequest(Region XfixesRegion, Window Window) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -412,13 +410,13 @@ type CompositeNameWindowPixmapCookie struct { } // Write request to wire for CompositeNameWindowPixmap -func (c *Conn) CompositeNameWindowPixmap(Window Id, Pixmap Id) CompositeNameWindowPixmapCookie { +func (c *Conn) CompositeNameWindowPixmap(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) return CompositeNameWindowPixmapCookie{cookie} } -func (c *Conn) CompositeNameWindowPixmapChecked(Window Id, Pixmap Id) CompositeNameWindowPixmapCookie { +func (c *Conn) CompositeNameWindowPixmapChecked(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) return CompositeNameWindowPixmapCookie{cookie} @@ -429,7 +427,7 @@ func (cook CompositeNameWindowPixmapCookie) Check() error { } // Write request to wire for CompositeNameWindowPixmap -func (c *Conn) compositeNameWindowPixmapRequest(Window Id, Pixmap Id) []byte { +func (c *Conn) compositeNameWindowPixmapRequest(Window Window, Pixmap Pixmap) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -458,13 +456,13 @@ type CompositeGetOverlayWindowCookie struct { *cookie } -func (c *Conn) CompositeGetOverlayWindow(Window Id) CompositeGetOverlayWindowCookie { +func (c *Conn) CompositeGetOverlayWindow(Window Window) CompositeGetOverlayWindowCookie { cookie := c.newCookie(true, true) c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) return CompositeGetOverlayWindowCookie{cookie} } -func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Id) CompositeGetOverlayWindowCookie { +func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Window) CompositeGetOverlayWindowCookie { cookie := c.newCookie(false, true) c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) return CompositeGetOverlayWindowCookie{cookie} @@ -476,7 +474,7 @@ type CompositeGetOverlayWindowReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - OverlayWin Id + OverlayWin Window // padding: 20 bytes } @@ -505,7 +503,7 @@ func compositeGetOverlayWindowReply(buf []byte) *CompositeGetOverlayWindowReply v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.OverlayWin = Id(Get32(buf[b:])) + v.OverlayWin = Window(Get32(buf[b:])) b += 4 b += 20 // padding @@ -518,7 +516,7 @@ func (cook CompositeGetOverlayWindowCookie) Check() error { } // Write request to wire for CompositeGetOverlayWindow -func (c *Conn) compositeGetOverlayWindowRequest(Window Id) []byte { +func (c *Conn) compositeGetOverlayWindowRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -545,13 +543,13 @@ type CompositeReleaseOverlayWindowCookie struct { } // Write request to wire for CompositeReleaseOverlayWindow -func (c *Conn) CompositeReleaseOverlayWindow(Window Id) CompositeReleaseOverlayWindowCookie { +func (c *Conn) CompositeReleaseOverlayWindow(Window Window) CompositeReleaseOverlayWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) return CompositeReleaseOverlayWindowCookie{cookie} } -func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Id) CompositeReleaseOverlayWindowCookie { +func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Window) CompositeReleaseOverlayWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) return CompositeReleaseOverlayWindowCookie{cookie} @@ -562,7 +560,7 @@ func (cook CompositeReleaseOverlayWindowCookie) Check() error { } // Write request to wire for CompositeReleaseOverlayWindow -func (c *Conn) compositeReleaseOverlayWindowRequest(Window Id) []byte { +func (c *Conn) compositeReleaseOverlayWindowRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index b3130d9..97c76b4 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 8 2012 11:03:23pm EDT. + This file was generated by damage.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,10 +38,6 @@ func init() { newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +60,8 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 @@ -71,7 +69,15 @@ const ( DamageReportLevelNonEmpty = 3 ) -// Skipping resource definition of 'Damage' +type DamageDamage uint32 + +func (c *Conn) NewDamageDamageId() (DamageDamage, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return DamageDamage(id), nil +} // Event definition DamageNotify (0) // Size: 32 @@ -81,8 +87,8 @@ const DamageNotify = 0 type DamageNotifyEvent struct { Sequence uint16 Level byte - Drawable Id - Damage Id + Drawable Drawable + Damage DamageDamage Timestamp Timestamp Area Rectangle Geometry Rectangle @@ -99,10 +105,10 @@ func NewDamageNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 - v.Damage = Id(Get32(buf[b:])) + v.Damage = DamageDamage(Get32(buf[b:])) b += 4 v.Timestamp = Timestamp(Get32(buf[b:])) @@ -205,7 +211,7 @@ func (err DamageBadDamageError) SequenceId() uint16 { return err.Sequence } -func (err DamageBadDamageError) BadId() Id { +func (err DamageBadDamageError) BadId() uint32 { return 0 } @@ -320,13 +326,13 @@ type DamageCreateCookie struct { } // Write request to wire for DamageCreate -func (c *Conn) DamageCreate(Damage Id, Drawable Id, Level byte) DamageCreateCookie { +func (c *Conn) DamageCreate(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) return DamageCreateCookie{cookie} } -func (c *Conn) DamageCreateChecked(Damage Id, Drawable Id, Level byte) DamageCreateCookie { +func (c *Conn) DamageCreateChecked(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) return DamageCreateCookie{cookie} @@ -337,7 +343,7 @@ func (cook DamageCreateCookie) Check() error { } // Write request to wire for DamageCreate -func (c *Conn) damageCreateRequest(Damage Id, Drawable Id, Level byte) []byte { +func (c *Conn) damageCreateRequest(Damage DamageDamage, Drawable Drawable, Level byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -372,13 +378,13 @@ type DamageDestroyCookie struct { } // Write request to wire for DamageDestroy -func (c *Conn) DamageDestroy(Damage Id) DamageDestroyCookie { +func (c *Conn) DamageDestroy(Damage DamageDamage) DamageDestroyCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageDestroyRequest(Damage), cookie) return DamageDestroyCookie{cookie} } -func (c *Conn) DamageDestroyChecked(Damage Id) DamageDestroyCookie { +func (c *Conn) DamageDestroyChecked(Damage DamageDamage) DamageDestroyCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageDestroyRequest(Damage), cookie) return DamageDestroyCookie{cookie} @@ -389,7 +395,7 @@ func (cook DamageDestroyCookie) Check() error { } // Write request to wire for DamageDestroy -func (c *Conn) damageDestroyRequest(Damage Id) []byte { +func (c *Conn) damageDestroyRequest(Damage DamageDamage) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -416,13 +422,13 @@ type DamageSubtractCookie struct { } // Write request to wire for DamageSubtract -func (c *Conn) DamageSubtract(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { +func (c *Conn) DamageSubtract(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) return DamageSubtractCookie{cookie} } -func (c *Conn) DamageSubtractChecked(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { +func (c *Conn) DamageSubtractChecked(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) return DamageSubtractCookie{cookie} @@ -433,7 +439,7 @@ func (cook DamageSubtractCookie) Check() error { } // Write request to wire for DamageSubtract -func (c *Conn) damageSubtractRequest(Damage Id, Repair Id, Parts Id) []byte { +func (c *Conn) damageSubtractRequest(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -466,13 +472,13 @@ type DamageAddCookie struct { } // Write request to wire for DamageAdd -func (c *Conn) DamageAdd(Drawable Id, Region Id) DamageAddCookie { +func (c *Conn) DamageAdd(Drawable Drawable, Region XfixesRegion) DamageAddCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageAddRequest(Drawable, Region), cookie) return DamageAddCookie{cookie} } -func (c *Conn) DamageAddChecked(Drawable Id, Region Id) DamageAddCookie { +func (c *Conn) DamageAddChecked(Drawable Drawable, Region XfixesRegion) DamageAddCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageAddRequest(Drawable, Region), cookie) return DamageAddCookie{cookie} @@ -483,7 +489,7 @@ func (cook DamageAddCookie) Check() error { } // Write request to wire for DamageAdd -func (c *Conn) damageAddRequest(Drawable Id, Region Id) []byte { +func (c *Conn) damageAddRequest(Drawable Drawable, Region XfixesRegion) []byte { size := 12 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go index fb4b170..8ceab58 100644 --- a/nexgb/auto_dpms.go +++ b/nexgb/auto_dpms.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dpms.xml on May 8 2012 11:03:23pm EDT. + This file was generated by dpms.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,20 +33,8 @@ func init() { newExtErrorFuncs["DPMS"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -59,6 +47,16 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( DpmsDPMSModeOn = 0 DpmsDPMSModeStandby = 1 diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go index d48677b..09baef5 100644 --- a/nexgb/auto_dri2.go +++ b/nexgb/auto_dri2.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by dri2.xml on May 8 2012 11:03:23pm EDT. + This file was generated by dri2.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,10 @@ func init() { newExtErrorFuncs["DRI2"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -47,8 +51,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -59,10 +61,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - const ( Dri2AttachmentBufferFrontLeft = 0 Dri2AttachmentBufferBackLeft = 1 @@ -231,7 +229,7 @@ type Dri2BufferSwapCompleteEvent struct { // padding: 1 bytes EventType uint16 // padding: 2 bytes - Drawable Id + Drawable Drawable UstHi uint32 UstLo uint32 MscHi uint32 @@ -254,7 +252,7 @@ func NewDri2BufferSwapCompleteEvent(buf []byte) Event { b += 2 // padding - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 v.UstHi = Get32(buf[b:]) @@ -345,7 +343,7 @@ const Dri2InvalidateBuffers = 1 type Dri2InvalidateBuffersEvent struct { Sequence uint16 // padding: 1 bytes - Drawable Id + Drawable Drawable } // Event read Dri2InvalidateBuffers @@ -358,7 +356,7 @@ func NewDri2InvalidateBuffersEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 return v @@ -496,13 +494,13 @@ type Dri2ConnectCookie struct { *cookie } -func (c *Conn) Dri2Connect(Window Id, DriverType uint32) Dri2ConnectCookie { +func (c *Conn) Dri2Connect(Window Window, DriverType uint32) Dri2ConnectCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) return Dri2ConnectCookie{cookie} } -func (c *Conn) Dri2ConnectUnchecked(Window Id, DriverType uint32) Dri2ConnectCookie { +func (c *Conn) Dri2ConnectUnchecked(Window Window, DriverType uint32) Dri2ConnectCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) return Dri2ConnectCookie{cookie} @@ -581,7 +579,7 @@ func (cook Dri2ConnectCookie) Check() error { } // Write request to wire for Dri2Connect -func (c *Conn) dri2ConnectRequest(Window Id, DriverType uint32) []byte { +func (c *Conn) dri2ConnectRequest(Window Window, DriverType uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -610,13 +608,13 @@ type Dri2AuthenticateCookie struct { *cookie } -func (c *Conn) Dri2Authenticate(Window Id, Magic uint32) Dri2AuthenticateCookie { +func (c *Conn) Dri2Authenticate(Window Window, Magic uint32) Dri2AuthenticateCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) return Dri2AuthenticateCookie{cookie} } -func (c *Conn) Dri2AuthenticateUnchecked(Window Id, Magic uint32) Dri2AuthenticateCookie { +func (c *Conn) Dri2AuthenticateUnchecked(Window Window, Magic uint32) Dri2AuthenticateCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) return Dri2AuthenticateCookie{cookie} @@ -667,7 +665,7 @@ func (cook Dri2AuthenticateCookie) Check() error { } // Write request to wire for Dri2Authenticate -func (c *Conn) dri2AuthenticateRequest(Window Id, Magic uint32) []byte { +func (c *Conn) dri2AuthenticateRequest(Window Window, Magic uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -697,13 +695,13 @@ type Dri2CreateDrawableCookie struct { } // Write request to wire for Dri2CreateDrawable -func (c *Conn) Dri2CreateDrawable(Drawable Id) Dri2CreateDrawableCookie { +func (c *Conn) Dri2CreateDrawable(Drawable Drawable) Dri2CreateDrawableCookie { cookie := c.newCookie(false, false) c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) return Dri2CreateDrawableCookie{cookie} } -func (c *Conn) Dri2CreateDrawableChecked(Drawable Id) Dri2CreateDrawableCookie { +func (c *Conn) Dri2CreateDrawableChecked(Drawable Drawable) Dri2CreateDrawableCookie { cookie := c.newCookie(true, false) c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) return Dri2CreateDrawableCookie{cookie} @@ -714,7 +712,7 @@ func (cook Dri2CreateDrawableCookie) Check() error { } // Write request to wire for Dri2CreateDrawable -func (c *Conn) dri2CreateDrawableRequest(Drawable Id) []byte { +func (c *Conn) dri2CreateDrawableRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -741,13 +739,13 @@ type Dri2DestroyDrawableCookie struct { } // Write request to wire for Dri2DestroyDrawable -func (c *Conn) Dri2DestroyDrawable(Drawable Id) Dri2DestroyDrawableCookie { +func (c *Conn) Dri2DestroyDrawable(Drawable Drawable) Dri2DestroyDrawableCookie { cookie := c.newCookie(false, false) c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) return Dri2DestroyDrawableCookie{cookie} } -func (c *Conn) Dri2DestroyDrawableChecked(Drawable Id) Dri2DestroyDrawableCookie { +func (c *Conn) Dri2DestroyDrawableChecked(Drawable Drawable) Dri2DestroyDrawableCookie { cookie := c.newCookie(true, false) c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) return Dri2DestroyDrawableCookie{cookie} @@ -758,7 +756,7 @@ func (cook Dri2DestroyDrawableCookie) Check() error { } // Write request to wire for Dri2DestroyDrawable -func (c *Conn) dri2DestroyDrawableRequest(Drawable Id) []byte { +func (c *Conn) dri2DestroyDrawableRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -784,13 +782,13 @@ type Dri2GetBuffersCookie struct { *cookie } -func (c *Conn) Dri2GetBuffers(Drawable Id, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { +func (c *Conn) Dri2GetBuffers(Drawable Drawable, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) return Dri2GetBuffersCookie{cookie} } -func (c *Conn) Dri2GetBuffersUnchecked(Drawable Id, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { +func (c *Conn) Dri2GetBuffersUnchecked(Drawable Drawable, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) return Dri2GetBuffersCookie{cookie} @@ -856,7 +854,7 @@ func (cook Dri2GetBuffersCookie) Check() error { } // Write request to wire for Dri2GetBuffers -func (c *Conn) dri2GetBuffersRequest(Drawable Id, Count uint32, Attachments []uint32) []byte { +func (c *Conn) dri2GetBuffersRequest(Drawable Drawable, Count uint32, Attachments []uint32) []byte { size := pad((12 + pad((len(Attachments) * 4)))) b := 0 buf := make([]byte, size) @@ -891,13 +889,13 @@ type Dri2CopyRegionCookie struct { *cookie } -func (c *Conn) Dri2CopyRegion(Drawable Id, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { +func (c *Conn) Dri2CopyRegion(Drawable Drawable, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) return Dri2CopyRegionCookie{cookie} } -func (c *Conn) Dri2CopyRegionUnchecked(Drawable Id, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { +func (c *Conn) Dri2CopyRegionUnchecked(Drawable Drawable, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) return Dri2CopyRegionCookie{cookie} @@ -944,7 +942,7 @@ func (cook Dri2CopyRegionCookie) Check() error { } // Write request to wire for Dri2CopyRegion -func (c *Conn) dri2CopyRegionRequest(Drawable Id, Region uint32, Dest uint32, Src uint32) []byte { +func (c *Conn) dri2CopyRegionRequest(Drawable Drawable, Region uint32, Dest uint32, Src uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -979,13 +977,13 @@ type Dri2GetBuffersWithFormatCookie struct { *cookie } -func (c *Conn) Dri2GetBuffersWithFormat(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { +func (c *Conn) Dri2GetBuffersWithFormat(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) return Dri2GetBuffersWithFormatCookie{cookie} } -func (c *Conn) Dri2GetBuffersWithFormatUnchecked(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { +func (c *Conn) Dri2GetBuffersWithFormatUnchecked(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) return Dri2GetBuffersWithFormatCookie{cookie} @@ -1051,7 +1049,7 @@ func (cook Dri2GetBuffersWithFormatCookie) Check() error { } // Write request to wire for Dri2GetBuffersWithFormat -func (c *Conn) dri2GetBuffersWithFormatRequest(Drawable Id, Count uint32, Attachments []Dri2AttachFormat) []byte { +func (c *Conn) dri2GetBuffersWithFormatRequest(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) []byte { size := pad((12 + pad((len(Attachments) * 8)))) b := 0 buf := make([]byte, size) @@ -1082,13 +1080,13 @@ type Dri2SwapBuffersCookie struct { *cookie } -func (c *Conn) Dri2SwapBuffers(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { +func (c *Conn) Dri2SwapBuffers(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return Dri2SwapBuffersCookie{cookie} } -func (c *Conn) Dri2SwapBuffersUnchecked(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { +func (c *Conn) Dri2SwapBuffersUnchecked(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return Dri2SwapBuffersCookie{cookie} @@ -1143,7 +1141,7 @@ func (cook Dri2SwapBuffersCookie) Check() error { } // Write request to wire for Dri2SwapBuffers -func (c *Conn) dri2SwapBuffersRequest(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { +func (c *Conn) dri2SwapBuffersRequest(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1187,13 +1185,13 @@ type Dri2GetMSCCookie struct { *cookie } -func (c *Conn) Dri2GetMSC(Drawable Id) Dri2GetMSCCookie { +func (c *Conn) Dri2GetMSC(Drawable Drawable) Dri2GetMSCCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) return Dri2GetMSCCookie{cookie} } -func (c *Conn) Dri2GetMSCUnchecked(Drawable Id) Dri2GetMSCCookie { +func (c *Conn) Dri2GetMSCUnchecked(Drawable Drawable) Dri2GetMSCCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) return Dri2GetMSCCookie{cookie} @@ -1264,7 +1262,7 @@ func (cook Dri2GetMSCCookie) Check() error { } // Write request to wire for Dri2GetMSC -func (c *Conn) dri2GetMSCRequest(Drawable Id) []byte { +func (c *Conn) dri2GetMSCRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1290,13 +1288,13 @@ type Dri2WaitMSCCookie struct { *cookie } -func (c *Conn) Dri2WaitMSC(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { +func (c *Conn) Dri2WaitMSC(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return Dri2WaitMSCCookie{cookie} } -func (c *Conn) Dri2WaitMSCUnchecked(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { +func (c *Conn) Dri2WaitMSCUnchecked(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return Dri2WaitMSCCookie{cookie} @@ -1367,7 +1365,7 @@ func (cook Dri2WaitMSCCookie) Check() error { } // Write request to wire for Dri2WaitMSC -func (c *Conn) dri2WaitMSCRequest(Drawable Id, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { +func (c *Conn) dri2WaitMSCRequest(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1411,13 +1409,13 @@ type Dri2WaitSBCCookie struct { *cookie } -func (c *Conn) Dri2WaitSBC(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { +func (c *Conn) Dri2WaitSBC(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { cookie := c.newCookie(true, true) c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) return Dri2WaitSBCCookie{cookie} } -func (c *Conn) Dri2WaitSBCUnchecked(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { +func (c *Conn) Dri2WaitSBCUnchecked(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { cookie := c.newCookie(false, true) c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) return Dri2WaitSBCCookie{cookie} @@ -1488,7 +1486,7 @@ func (cook Dri2WaitSBCCookie) Check() error { } // Write request to wire for Dri2WaitSBC -func (c *Conn) dri2WaitSBCRequest(Drawable Id, TargetSbcHi uint32, TargetSbcLo uint32) []byte { +func (c *Conn) dri2WaitSBCRequest(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1521,13 +1519,13 @@ type Dri2SwapIntervalCookie struct { } // Write request to wire for Dri2SwapInterval -func (c *Conn) Dri2SwapInterval(Drawable Id, Interval uint32) Dri2SwapIntervalCookie { +func (c *Conn) Dri2SwapInterval(Drawable Drawable, Interval uint32) Dri2SwapIntervalCookie { cookie := c.newCookie(false, false) c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) return Dri2SwapIntervalCookie{cookie} } -func (c *Conn) Dri2SwapIntervalChecked(Drawable Id, Interval uint32) Dri2SwapIntervalCookie { +func (c *Conn) Dri2SwapIntervalChecked(Drawable Drawable, Interval uint32) Dri2SwapIntervalCookie { cookie := c.newCookie(true, false) c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) return Dri2SwapIntervalCookie{cookie} @@ -1538,7 +1536,7 @@ func (cook Dri2SwapIntervalCookie) Check() error { } // Write request to wire for Dri2SwapInterval -func (c *Conn) dri2SwapIntervalRequest(Drawable Id, Interval uint32) []byte { +func (c *Conn) dri2SwapIntervalRequest(Drawable Drawable, Interval uint32) []byte { size := 12 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go index 10b4ac0..3d1b00c 100644 --- a/nexgb/auto_ge.go +++ b/nexgb/auto_ge.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by ge.xml on May 8 2012 11:03:23pm EDT. + This file was generated by ge.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -47,8 +47,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go index d88b1c9..0fe0f61 100644 --- a/nexgb/auto_glx.go +++ b/nexgb/auto_glx.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by glx.xml on May 8 2012 11:03:23pm EDT. + This file was generated by glx.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -55,8 +55,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -103,17 +101,65 @@ const ( GlxRmGlSelect = 7170 ) -// Skipping resource definition of 'Pixmap' +type GlxPixmap uint32 -// Skipping resource definition of 'Context' +func (c *Conn) NewGlxPixmapId() (GlxPixmap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxPixmap(id), nil +} -// Skipping resource definition of 'Pbuffer' +type GlxContext uint32 -// Skipping resource definition of 'Window' +func (c *Conn) NewGlxContextId() (GlxContext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxContext(id), nil +} -// Skipping resource definition of 'Fbconfig' +type GlxPbuffer uint32 -// Skipping resource definition of 'Drawable' +func (c *Conn) NewGlxPbufferId() (GlxPbuffer, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxPbuffer(id), nil +} + +type GlxWindow uint32 + +func (c *Conn) NewGlxWindowId() (GlxWindow, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxWindow(id), nil +} + +type GlxFbconfig uint32 + +func (c *Conn) NewGlxFbconfigId() (GlxFbconfig, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxFbconfig(id), nil +} + +type GlxDrawable uint32 + +func (c *Conn) NewGlxDrawableId() (GlxDrawable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return GlxDrawable(id), nil +} type GlxFloat32 float64 @@ -133,7 +179,7 @@ type GlxPbufferClobberEvent struct { // padding: 1 bytes EventType uint16 DrawType uint16 - Drawable Id + Drawable GlxDrawable BMask uint32 AuxBuffer uint16 X uint16 @@ -160,7 +206,7 @@ func NewGlxPbufferClobberEvent(buf []byte) Event { v.DrawType = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = GlxDrawable(Get32(buf[b:])) b += 4 v.BMask = Get32(buf[b:]) @@ -308,7 +354,7 @@ func (err GlxGenericError) SequenceId() uint16 { return err.Sequence } -func (err GlxGenericError) BadId() Id { +func (err GlxGenericError) BadId() uint32 { return 0 } @@ -344,8 +390,8 @@ func (err GlxBadContextError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadContextError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadContextError) BadId() uint32 { + return 0 } func (err GlxBadContextError) Error() string { @@ -380,8 +426,8 @@ func (err GlxBadContextStateError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadContextStateError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadContextStateError) BadId() uint32 { + return 0 } func (err GlxBadContextStateError) Error() string { @@ -416,8 +462,8 @@ func (err GlxBadDrawableError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadDrawableError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadDrawableError) BadId() uint32 { + return 0 } func (err GlxBadDrawableError) Error() string { @@ -452,8 +498,8 @@ func (err GlxBadPixmapError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadPixmapError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadPixmapError) BadId() uint32 { + return 0 } func (err GlxBadPixmapError) Error() string { @@ -488,8 +534,8 @@ func (err GlxBadContextTagError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadContextTagError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadContextTagError) BadId() uint32 { + return 0 } func (err GlxBadContextTagError) Error() string { @@ -524,8 +570,8 @@ func (err GlxBadCurrentWindowError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadCurrentWindowError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadCurrentWindowError) BadId() uint32 { + return 0 } func (err GlxBadCurrentWindowError) Error() string { @@ -560,8 +606,8 @@ func (err GlxBadRenderRequestError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadRenderRequestError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadRenderRequestError) BadId() uint32 { + return 0 } func (err GlxBadRenderRequestError) Error() string { @@ -596,8 +642,8 @@ func (err GlxBadLargeRequestError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadLargeRequestError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadLargeRequestError) BadId() uint32 { + return 0 } func (err GlxBadLargeRequestError) Error() string { @@ -632,8 +678,8 @@ func (err GlxUnsupportedPrivateRequestError) SequenceId() uint16 { return err.Sequence } -func (err GlxUnsupportedPrivateRequestError) BadId() Id { - return Id(err.BadValue) +func (err GlxUnsupportedPrivateRequestError) BadId() uint32 { + return 0 } func (err GlxUnsupportedPrivateRequestError) Error() string { @@ -668,8 +714,8 @@ func (err GlxBadFBConfigError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadFBConfigError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadFBConfigError) BadId() uint32 { + return 0 } func (err GlxBadFBConfigError) Error() string { @@ -704,8 +750,8 @@ func (err GlxBadPbufferError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadPbufferError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadPbufferError) BadId() uint32 { + return 0 } func (err GlxBadPbufferError) Error() string { @@ -740,8 +786,8 @@ func (err GlxBadCurrentDrawableError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadCurrentDrawableError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadCurrentDrawableError) BadId() uint32 { + return 0 } func (err GlxBadCurrentDrawableError) Error() string { @@ -776,8 +822,8 @@ func (err GlxBadWindowError) SequenceId() uint16 { return err.Sequence } -func (err GlxBadWindowError) BadId() Id { - return Id(err.BadValue) +func (err GlxBadWindowError) BadId() uint32 { + return 0 } func (err GlxBadWindowError) Error() string { @@ -812,8 +858,8 @@ func (err GlxGLXBadProfileARBError) SequenceId() uint16 { return err.Sequence } -func (err GlxGLXBadProfileARBError) BadId() Id { - return Id(err.BadValue) +func (err GlxGLXBadProfileARBError) BadId() uint32 { + return 0 } func (err GlxGLXBadProfileARBError) Error() string { @@ -940,13 +986,13 @@ type GlxCreateContextCookie struct { } // Write request to wire for GlxCreateContext -func (c *Conn) GlxCreateContext(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) GlxCreateContextCookie { +func (c *Conn) GlxCreateContext(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) GlxCreateContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) return GlxCreateContextCookie{cookie} } -func (c *Conn) GlxCreateContextChecked(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) GlxCreateContextCookie { +func (c *Conn) GlxCreateContextChecked(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) GlxCreateContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) return GlxCreateContextCookie{cookie} @@ -957,7 +1003,7 @@ func (cook GlxCreateContextCookie) Check() error { } // Write request to wire for GlxCreateContext -func (c *Conn) glxCreateContextRequest(Context Id, Visual Visualid, Screen uint32, ShareList Id, IsDirect bool) []byte { +func (c *Conn) glxCreateContextRequest(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -1002,13 +1048,13 @@ type GlxDestroyContextCookie struct { } // Write request to wire for GlxDestroyContext -func (c *Conn) GlxDestroyContext(Context Id) GlxDestroyContextCookie { +func (c *Conn) GlxDestroyContext(Context GlxContext) GlxDestroyContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxDestroyContextRequest(Context), cookie) return GlxDestroyContextCookie{cookie} } -func (c *Conn) GlxDestroyContextChecked(Context Id) GlxDestroyContextCookie { +func (c *Conn) GlxDestroyContextChecked(Context GlxContext) GlxDestroyContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxDestroyContextRequest(Context), cookie) return GlxDestroyContextCookie{cookie} @@ -1019,7 +1065,7 @@ func (cook GlxDestroyContextCookie) Check() error { } // Write request to wire for GlxDestroyContext -func (c *Conn) glxDestroyContextRequest(Context Id) []byte { +func (c *Conn) glxDestroyContextRequest(Context GlxContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1045,13 +1091,13 @@ type GlxMakeCurrentCookie struct { *cookie } -func (c *Conn) GlxMakeCurrent(Drawable Id, Context Id, OldContextTag GlxContextTag) GlxMakeCurrentCookie { +func (c *Conn) GlxMakeCurrent(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) GlxMakeCurrentCookie { cookie := c.newCookie(true, true) c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) return GlxMakeCurrentCookie{cookie} } -func (c *Conn) GlxMakeCurrentUnchecked(Drawable Id, Context Id, OldContextTag GlxContextTag) GlxMakeCurrentCookie { +func (c *Conn) GlxMakeCurrentUnchecked(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) GlxMakeCurrentCookie { cookie := c.newCookie(false, true) c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) return GlxMakeCurrentCookie{cookie} @@ -1105,7 +1151,7 @@ func (cook GlxMakeCurrentCookie) Check() error { } // Write request to wire for GlxMakeCurrent -func (c *Conn) glxMakeCurrentRequest(Drawable Id, Context Id, OldContextTag GlxContextTag) []byte { +func (c *Conn) glxMakeCurrentRequest(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1137,13 +1183,13 @@ type GlxIsDirectCookie struct { *cookie } -func (c *Conn) GlxIsDirect(Context Id) GlxIsDirectCookie { +func (c *Conn) GlxIsDirect(Context GlxContext) GlxIsDirectCookie { cookie := c.newCookie(true, true) c.newRequest(c.glxIsDirectRequest(Context), cookie) return GlxIsDirectCookie{cookie} } -func (c *Conn) GlxIsDirectUnchecked(Context Id) GlxIsDirectCookie { +func (c *Conn) GlxIsDirectUnchecked(Context GlxContext) GlxIsDirectCookie { cookie := c.newCookie(false, true) c.newRequest(c.glxIsDirectRequest(Context), cookie) return GlxIsDirectCookie{cookie} @@ -1201,7 +1247,7 @@ func (cook GlxIsDirectCookie) Check() error { } // Write request to wire for GlxIsDirect -func (c *Conn) glxIsDirectRequest(Context Id) []byte { +func (c *Conn) glxIsDirectRequest(Context GlxContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1409,13 +1455,13 @@ type GlxCopyContextCookie struct { } // Write request to wire for GlxCopyContext -func (c *Conn) GlxCopyContext(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { +func (c *Conn) GlxCopyContext(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) return GlxCopyContextCookie{cookie} } -func (c *Conn) GlxCopyContextChecked(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { +func (c *Conn) GlxCopyContextChecked(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) return GlxCopyContextCookie{cookie} @@ -1426,7 +1472,7 @@ func (cook GlxCopyContextCookie) Check() error { } // Write request to wire for GlxCopyContext -func (c *Conn) glxCopyContextRequest(Src Id, Dest Id, Mask uint32, SrcContextTag GlxContextTag) []byte { +func (c *Conn) glxCopyContextRequest(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -1462,13 +1508,13 @@ type GlxSwapBuffersCookie struct { } // Write request to wire for GlxSwapBuffers -func (c *Conn) GlxSwapBuffers(ContextTag GlxContextTag, Drawable Id) GlxSwapBuffersCookie { +func (c *Conn) GlxSwapBuffers(ContextTag GlxContextTag, Drawable GlxDrawable) GlxSwapBuffersCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) return GlxSwapBuffersCookie{cookie} } -func (c *Conn) GlxSwapBuffersChecked(ContextTag GlxContextTag, Drawable Id) GlxSwapBuffersCookie { +func (c *Conn) GlxSwapBuffersChecked(ContextTag GlxContextTag, Drawable GlxDrawable) GlxSwapBuffersCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) return GlxSwapBuffersCookie{cookie} @@ -1479,7 +1525,7 @@ func (cook GlxSwapBuffersCookie) Check() error { } // Write request to wire for GlxSwapBuffers -func (c *Conn) glxSwapBuffersRequest(ContextTag GlxContextTag, Drawable Id) []byte { +func (c *Conn) glxSwapBuffersRequest(ContextTag GlxContextTag, Drawable GlxDrawable) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1509,13 +1555,13 @@ type GlxUseXFontCookie struct { } // Write request to wire for GlxUseXFont -func (c *Conn) GlxUseXFont(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { +func (c *Conn) GlxUseXFont(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) return GlxUseXFontCookie{cookie} } -func (c *Conn) GlxUseXFontChecked(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { +func (c *Conn) GlxUseXFontChecked(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) return GlxUseXFontCookie{cookie} @@ -1526,7 +1572,7 @@ func (cook GlxUseXFontCookie) Check() error { } // Write request to wire for GlxUseXFont -func (c *Conn) glxUseXFontRequest(ContextTag GlxContextTag, Font Id, First uint32, Count uint32, ListBase uint32) []byte { +func (c *Conn) glxUseXFontRequest(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -1565,13 +1611,13 @@ type GlxCreateGLXPixmapCookie struct { } // Write request to wire for GlxCreateGLXPixmap -func (c *Conn) GlxCreateGLXPixmap(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) GlxCreateGLXPixmapCookie { +func (c *Conn) GlxCreateGLXPixmap(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) GlxCreateGLXPixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) return GlxCreateGLXPixmapCookie{cookie} } -func (c *Conn) GlxCreateGLXPixmapChecked(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) GlxCreateGLXPixmapCookie { +func (c *Conn) GlxCreateGLXPixmapChecked(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) GlxCreateGLXPixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) return GlxCreateGLXPixmapCookie{cookie} @@ -1582,7 +1628,7 @@ func (cook GlxCreateGLXPixmapCookie) Check() error { } // Write request to wire for GlxCreateGLXPixmap -func (c *Conn) glxCreateGLXPixmapRequest(Screen uint32, Visual Visualid, Pixmap Id, GlxPixmap Id) []byte { +func (c *Conn) glxCreateGLXPixmapRequest(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -1716,13 +1762,13 @@ type GlxDestroyGLXPixmapCookie struct { } // Write request to wire for GlxDestroyGLXPixmap -func (c *Conn) GlxDestroyGLXPixmap(GlxPixmap Id) GlxDestroyGLXPixmapCookie { +func (c *Conn) GlxDestroyGLXPixmap(GlxPixmap GlxPixmap) GlxDestroyGLXPixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) return GlxDestroyGLXPixmapCookie{cookie} } -func (c *Conn) GlxDestroyGLXPixmapChecked(GlxPixmap Id) GlxDestroyGLXPixmapCookie { +func (c *Conn) GlxDestroyGLXPixmapChecked(GlxPixmap GlxPixmap) GlxDestroyGLXPixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) return GlxDestroyGLXPixmapCookie{cookie} @@ -1733,7 +1779,7 @@ func (cook GlxDestroyGLXPixmapCookie) Check() error { } // Write request to wire for GlxDestroyGLXPixmap -func (c *Conn) glxDestroyGLXPixmapRequest(GlxPixmap Id) []byte { +func (c *Conn) glxDestroyGLXPixmapRequest(GlxPixmap GlxPixmap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2249,13 +2295,13 @@ type GlxCreatePixmapCookie struct { } // Write request to wire for GlxCreatePixmap -func (c *Conn) GlxCreatePixmap(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { +func (c *Conn) GlxCreatePixmap(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return GlxCreatePixmapCookie{cookie} } -func (c *Conn) GlxCreatePixmapChecked(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { +func (c *Conn) GlxCreatePixmapChecked(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return GlxCreatePixmapCookie{cookie} @@ -2266,7 +2312,7 @@ func (cook GlxCreatePixmapCookie) Check() error { } // Write request to wire for GlxCreatePixmap -func (c *Conn) glxCreatePixmapRequest(Screen uint32, Fbconfig Id, Pixmap Id, GlxPixmap Id, NumAttribs uint32, Attribs []uint32) []byte { +func (c *Conn) glxCreatePixmapRequest(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) []byte { size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) @@ -2311,13 +2357,13 @@ type GlxDestroyPixmapCookie struct { } // Write request to wire for GlxDestroyPixmap -func (c *Conn) GlxDestroyPixmap(GlxPixmap Id) GlxDestroyPixmapCookie { +func (c *Conn) GlxDestroyPixmap(GlxPixmap GlxPixmap) GlxDestroyPixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) return GlxDestroyPixmapCookie{cookie} } -func (c *Conn) GlxDestroyPixmapChecked(GlxPixmap Id) GlxDestroyPixmapCookie { +func (c *Conn) GlxDestroyPixmapChecked(GlxPixmap GlxPixmap) GlxDestroyPixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) return GlxDestroyPixmapCookie{cookie} @@ -2328,7 +2374,7 @@ func (cook GlxDestroyPixmapCookie) Check() error { } // Write request to wire for GlxDestroyPixmap -func (c *Conn) glxDestroyPixmapRequest(GlxPixmap Id) []byte { +func (c *Conn) glxDestroyPixmapRequest(GlxPixmap GlxPixmap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2355,13 +2401,13 @@ type GlxCreateNewContextCookie struct { } // Write request to wire for GlxCreateNewContext -func (c *Conn) GlxCreateNewContext(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) GlxCreateNewContextCookie { +func (c *Conn) GlxCreateNewContext(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) GlxCreateNewContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return GlxCreateNewContextCookie{cookie} } -func (c *Conn) GlxCreateNewContextChecked(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) GlxCreateNewContextCookie { +func (c *Conn) GlxCreateNewContextChecked(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) GlxCreateNewContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return GlxCreateNewContextCookie{cookie} @@ -2372,7 +2418,7 @@ func (cook GlxCreateNewContextCookie) Check() error { } // Write request to wire for GlxCreateNewContext -func (c *Conn) glxCreateNewContextRequest(Context Id, Fbconfig Id, Screen uint32, RenderType uint32, ShareList Id, IsDirect bool) []byte { +func (c *Conn) glxCreateNewContextRequest(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -2419,13 +2465,13 @@ type GlxQueryContextCookie struct { *cookie } -func (c *Conn) GlxQueryContext(Context Id) GlxQueryContextCookie { +func (c *Conn) GlxQueryContext(Context GlxContext) GlxQueryContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.glxQueryContextRequest(Context), cookie) return GlxQueryContextCookie{cookie} } -func (c *Conn) GlxQueryContextUnchecked(Context Id) GlxQueryContextCookie { +func (c *Conn) GlxQueryContextUnchecked(Context GlxContext) GlxQueryContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.glxQueryContextRequest(Context), cookie) return GlxQueryContextCookie{cookie} @@ -2487,7 +2533,7 @@ func (cook GlxQueryContextCookie) Check() error { } // Write request to wire for GlxQueryContext -func (c *Conn) glxQueryContextRequest(Context Id) []byte { +func (c *Conn) glxQueryContextRequest(Context GlxContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2513,13 +2559,13 @@ type GlxMakeContextCurrentCookie struct { *cookie } -func (c *Conn) GlxMakeContextCurrent(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) GlxMakeContextCurrentCookie { +func (c *Conn) GlxMakeContextCurrent(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) GlxMakeContextCurrentCookie { cookie := c.newCookie(true, true) c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) return GlxMakeContextCurrentCookie{cookie} } -func (c *Conn) GlxMakeContextCurrentUnchecked(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) GlxMakeContextCurrentCookie { +func (c *Conn) GlxMakeContextCurrentUnchecked(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) GlxMakeContextCurrentCookie { cookie := c.newCookie(false, true) c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) return GlxMakeContextCurrentCookie{cookie} @@ -2573,7 +2619,7 @@ func (cook GlxMakeContextCurrentCookie) Check() error { } // Write request to wire for GlxMakeContextCurrent -func (c *Conn) glxMakeContextCurrentRequest(OldContextTag GlxContextTag, Drawable Id, ReadDrawable Id, Context Id) []byte { +func (c *Conn) glxMakeContextCurrentRequest(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -2609,13 +2655,13 @@ type GlxCreatePbufferCookie struct { } // Write request to wire for GlxCreatePbuffer -func (c *Conn) GlxCreatePbuffer(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { +func (c *Conn) GlxCreatePbuffer(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return GlxCreatePbufferCookie{cookie} } -func (c *Conn) GlxCreatePbufferChecked(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { +func (c *Conn) GlxCreatePbufferChecked(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return GlxCreatePbufferCookie{cookie} @@ -2626,7 +2672,7 @@ func (cook GlxCreatePbufferCookie) Check() error { } // Write request to wire for GlxCreatePbuffer -func (c *Conn) glxCreatePbufferRequest(Screen uint32, Fbconfig Id, Pbuffer Id, NumAttribs uint32, Attribs []uint32) []byte { +func (c *Conn) glxCreatePbufferRequest(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) []byte { size := pad((20 + pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) @@ -2668,13 +2714,13 @@ type GlxDestroyPbufferCookie struct { } // Write request to wire for GlxDestroyPbuffer -func (c *Conn) GlxDestroyPbuffer(Pbuffer Id) GlxDestroyPbufferCookie { +func (c *Conn) GlxDestroyPbuffer(Pbuffer GlxPbuffer) GlxDestroyPbufferCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) return GlxDestroyPbufferCookie{cookie} } -func (c *Conn) GlxDestroyPbufferChecked(Pbuffer Id) GlxDestroyPbufferCookie { +func (c *Conn) GlxDestroyPbufferChecked(Pbuffer GlxPbuffer) GlxDestroyPbufferCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) return GlxDestroyPbufferCookie{cookie} @@ -2685,7 +2731,7 @@ func (cook GlxDestroyPbufferCookie) Check() error { } // Write request to wire for GlxDestroyPbuffer -func (c *Conn) glxDestroyPbufferRequest(Pbuffer Id) []byte { +func (c *Conn) glxDestroyPbufferRequest(Pbuffer GlxPbuffer) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2711,13 +2757,13 @@ type GlxGetDrawableAttributesCookie struct { *cookie } -func (c *Conn) GlxGetDrawableAttributes(Drawable Id) GlxGetDrawableAttributesCookie { +func (c *Conn) GlxGetDrawableAttributes(Drawable GlxDrawable) GlxGetDrawableAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) return GlxGetDrawableAttributesCookie{cookie} } -func (c *Conn) GlxGetDrawableAttributesUnchecked(Drawable Id) GlxGetDrawableAttributesCookie { +func (c *Conn) GlxGetDrawableAttributesUnchecked(Drawable GlxDrawable) GlxGetDrawableAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) return GlxGetDrawableAttributesCookie{cookie} @@ -2779,7 +2825,7 @@ func (cook GlxGetDrawableAttributesCookie) Check() error { } // Write request to wire for GlxGetDrawableAttributes -func (c *Conn) glxGetDrawableAttributesRequest(Drawable Id) []byte { +func (c *Conn) glxGetDrawableAttributesRequest(Drawable GlxDrawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2806,13 +2852,13 @@ type GlxChangeDrawableAttributesCookie struct { } // Write request to wire for GlxChangeDrawableAttributes -func (c *Conn) GlxChangeDrawableAttributes(Drawable Id, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { +func (c *Conn) GlxChangeDrawableAttributes(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) return GlxChangeDrawableAttributesCookie{cookie} } -func (c *Conn) GlxChangeDrawableAttributesChecked(Drawable Id, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { +func (c *Conn) GlxChangeDrawableAttributesChecked(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) return GlxChangeDrawableAttributesCookie{cookie} @@ -2823,7 +2869,7 @@ func (cook GlxChangeDrawableAttributesCookie) Check() error { } // Write request to wire for GlxChangeDrawableAttributes -func (c *Conn) glxChangeDrawableAttributesRequest(Drawable Id, NumAttribs uint32, Attribs []uint32) []byte { +func (c *Conn) glxChangeDrawableAttributesRequest(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) []byte { size := pad((12 + pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) @@ -2859,13 +2905,13 @@ type GlxCreateWindowCookie struct { } // Write request to wire for GlxCreateWindow -func (c *Conn) GlxCreateWindow(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { +func (c *Conn) GlxCreateWindow(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return GlxCreateWindowCookie{cookie} } -func (c *Conn) GlxCreateWindowChecked(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { +func (c *Conn) GlxCreateWindowChecked(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return GlxCreateWindowCookie{cookie} @@ -2876,7 +2922,7 @@ func (cook GlxCreateWindowCookie) Check() error { } // Write request to wire for GlxCreateWindow -func (c *Conn) glxCreateWindowRequest(Screen uint32, Fbconfig Id, Window Id, GlxWindow Id, NumAttribs uint32, Attribs []uint32) []byte { +func (c *Conn) glxCreateWindowRequest(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) []byte { size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) @@ -2921,13 +2967,13 @@ type GlxDeleteWindowCookie struct { } // Write request to wire for GlxDeleteWindow -func (c *Conn) GlxDeleteWindow(Glxwindow Id) GlxDeleteWindowCookie { +func (c *Conn) GlxDeleteWindow(Glxwindow GlxWindow) GlxDeleteWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) return GlxDeleteWindowCookie{cookie} } -func (c *Conn) GlxDeleteWindowChecked(Glxwindow Id) GlxDeleteWindowCookie { +func (c *Conn) GlxDeleteWindowChecked(Glxwindow GlxWindow) GlxDeleteWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) return GlxDeleteWindowCookie{cookie} @@ -2938,7 +2984,7 @@ func (cook GlxDeleteWindowCookie) Check() error { } // Write request to wire for GlxDeleteWindow -func (c *Conn) glxDeleteWindowRequest(Glxwindow Id) []byte { +func (c *Conn) glxDeleteWindowRequest(Glxwindow GlxWindow) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3033,13 +3079,13 @@ type GlxCreateContextAttribsARBCookie struct { } // Write request to wire for GlxCreateContextAttribsARB -func (c *Conn) GlxCreateContextAttribsARB(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { +func (c *Conn) GlxCreateContextAttribsARB(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { cookie := c.newCookie(false, false) c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return GlxCreateContextAttribsARBCookie{cookie} } -func (c *Conn) GlxCreateContextAttribsARBChecked(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { +func (c *Conn) GlxCreateContextAttribsARBChecked(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { cookie := c.newCookie(true, false) c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return GlxCreateContextAttribsARBCookie{cookie} @@ -3050,7 +3096,7 @@ func (cook GlxCreateContextAttribsARBCookie) Check() error { } // Write request to wire for GlxCreateContextAttribsARB -func (c *Conn) glxCreateContextAttribsARBRequest(Context Id, Fbconfig Id, Screen uint32, ShareList Id, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { +func (c *Conn) glxCreateContextAttribsARBRequest(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { size := pad((28 + pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go index e086abd..d7e68bd 100644 --- a/nexgb/auto_randr.go +++ b/nexgb/auto_randr.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by randr.xml on May 8 2012 11:03:24pm EDT. + This file was generated by randr.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,10 +38,6 @@ func init() { newExtErrorFuncs["RANDR"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +60,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + const ( RandrRotationRotate0 = 1 RandrRotationRotate90 = 2 @@ -116,11 +114,35 @@ const ( RandrNotifyOutputProperty = 2 ) -// Skipping resource definition of 'Mode' +type RandrMode uint32 -// Skipping resource definition of 'Crtc' +func (c *Conn) NewRandrModeId() (RandrMode, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RandrMode(id), nil +} -// Skipping resource definition of 'Output' +type RandrCrtc uint32 + +func (c *Conn) NewRandrCrtcId() (RandrCrtc, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RandrCrtc(id), nil +} + +type RandrOutput uint32 + +func (c *Conn) NewRandrOutputId() (RandrOutput, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RandrOutput(id), nil +} // 'RandrScreenSize' struct definition // Size: 8 @@ -401,9 +423,9 @@ func RandrModeInfoListBytes(buf []byte, list []RandrModeInfo) int { // Size: 28 type RandrCrtcChange struct { Timestamp Timestamp - Window Id - Crtc Id - Mode Id + Window Window + Crtc RandrCrtc + Mode RandrMode Rotation uint16 // padding: 2 bytes X int16 @@ -419,13 +441,13 @@ func ReadRandrCrtcChange(buf []byte, v *RandrCrtcChange) int { v.Timestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Crtc = Id(Get32(buf[b:])) + v.Crtc = RandrCrtc(Get32(buf[b:])) b += 4 - v.Mode = Id(Get32(buf[b:])) + v.Mode = RandrMode(Get32(buf[b:])) b += 4 v.Rotation = Get16(buf[b:]) @@ -512,10 +534,10 @@ func RandrCrtcChangeListBytes(buf []byte, list []RandrCrtcChange) int { type RandrOutputChange struct { Timestamp Timestamp ConfigTimestamp Timestamp - Window Id - Output Id - Crtc Id - Mode Id + Window Window + Output RandrOutput + Crtc RandrCrtc + Mode RandrMode Rotation uint16 Connection byte SubpixelOrder byte @@ -531,16 +553,16 @@ func ReadRandrOutputChange(buf []byte, v *RandrOutputChange) int { v.ConfigTimestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Output = Id(Get32(buf[b:])) + v.Output = RandrOutput(Get32(buf[b:])) b += 4 - v.Crtc = Id(Get32(buf[b:])) + v.Crtc = RandrCrtc(Get32(buf[b:])) b += 4 - v.Mode = Id(Get32(buf[b:])) + v.Mode = RandrMode(Get32(buf[b:])) b += 4 v.Rotation = Get16(buf[b:]) @@ -615,9 +637,9 @@ func RandrOutputChangeListBytes(buf []byte, list []RandrOutputChange) int { // 'RandrOutputProperty' struct definition // Size: 28 type RandrOutputProperty struct { - Window Id - Output Id - Atom Id + Window Window + Output RandrOutput + Atom Atom Timestamp Timestamp Status byte // padding: 11 bytes @@ -627,13 +649,13 @@ type RandrOutputProperty struct { func ReadRandrOutputProperty(buf []byte, v *RandrOutputProperty) int { b := 0 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Output = Id(Get32(buf[b:])) + v.Output = RandrOutput(Get32(buf[b:])) b += 4 - v.Atom = Id(Get32(buf[b:])) + v.Atom = Atom(Get32(buf[b:])) b += 4 v.Timestamp = Timestamp(Get32(buf[b:])) @@ -866,8 +888,8 @@ type RandrScreenChangeNotifyEvent struct { Rotation byte Timestamp Timestamp ConfigTimestamp Timestamp - Root Id - RequestWindow Id + Root Window + RequestWindow Window SizeID uint16 SubpixelOrder uint16 Width uint16 @@ -893,10 +915,10 @@ func NewRandrScreenChangeNotifyEvent(buf []byte) Event { v.ConfigTimestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.RequestWindow = Id(Get32(buf[b:])) + v.RequestWindow = Window(Get32(buf[b:])) b += 4 v.SizeID = Get16(buf[b:]) @@ -1092,7 +1114,7 @@ func (err RandrBadOutputError) SequenceId() uint16 { return err.Sequence } -func (err RandrBadOutputError) BadId() Id { +func (err RandrBadOutputError) BadId() uint32 { return 0 } @@ -1137,7 +1159,7 @@ func (err RandrBadCrtcError) SequenceId() uint16 { return err.Sequence } -func (err RandrBadCrtcError) BadId() Id { +func (err RandrBadCrtcError) BadId() uint32 { return 0 } @@ -1182,7 +1204,7 @@ func (err RandrBadModeError) SequenceId() uint16 { return err.Sequence } -func (err RandrBadModeError) BadId() Id { +func (err RandrBadModeError) BadId() uint32 { return 0 } @@ -1296,13 +1318,13 @@ type RandrSetScreenConfigCookie struct { *cookie } -func (c *Conn) RandrSetScreenConfig(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { +func (c *Conn) RandrSetScreenConfig(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return RandrSetScreenConfigCookie{cookie} } -func (c *Conn) RandrSetScreenConfigUnchecked(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { +func (c *Conn) RandrSetScreenConfigUnchecked(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return RandrSetScreenConfigCookie{cookie} @@ -1316,7 +1338,7 @@ type RandrSetScreenConfigReply struct { Status byte NewTimestamp Timestamp ConfigTimestamp Timestamp - Root Id + Root Window SubpixelOrder uint16 // padding: 10 bytes } @@ -1353,7 +1375,7 @@ func randrSetScreenConfigReply(buf []byte) *RandrSetScreenConfigReply { v.ConfigTimestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 v.SubpixelOrder = Get16(buf[b:]) @@ -1369,7 +1391,7 @@ func (cook RandrSetScreenConfigCookie) Check() error { } // Write request to wire for RandrSetScreenConfig -func (c *Conn) randrSetScreenConfigRequest(Window Id, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { +func (c *Conn) randrSetScreenConfigRequest(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -1413,13 +1435,13 @@ type RandrSelectInputCookie struct { } // Write request to wire for RandrSelectInput -func (c *Conn) RandrSelectInput(Window Id, Enable uint16) RandrSelectInputCookie { +func (c *Conn) RandrSelectInput(Window Window, Enable uint16) RandrSelectInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) return RandrSelectInputCookie{cookie} } -func (c *Conn) RandrSelectInputChecked(Window Id, Enable uint16) RandrSelectInputCookie { +func (c *Conn) RandrSelectInputChecked(Window Window, Enable uint16) RandrSelectInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) return RandrSelectInputCookie{cookie} @@ -1430,7 +1452,7 @@ func (cook RandrSelectInputCookie) Check() error { } // Write request to wire for RandrSelectInput -func (c *Conn) randrSelectInputRequest(Window Id, Enable uint16) []byte { +func (c *Conn) randrSelectInputRequest(Window Window, Enable uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1461,13 +1483,13 @@ type RandrGetScreenInfoCookie struct { *cookie } -func (c *Conn) RandrGetScreenInfo(Window Id) RandrGetScreenInfoCookie { +func (c *Conn) RandrGetScreenInfo(Window Window) RandrGetScreenInfoCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) return RandrGetScreenInfoCookie{cookie} } -func (c *Conn) RandrGetScreenInfoUnchecked(Window Id) RandrGetScreenInfoCookie { +func (c *Conn) RandrGetScreenInfoUnchecked(Window Window) RandrGetScreenInfoCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) return RandrGetScreenInfoCookie{cookie} @@ -1479,7 +1501,7 @@ type RandrGetScreenInfoReply struct { Sequence uint16 Length uint32 Rotations byte - Root Id + Root Window Timestamp Timestamp ConfigTimestamp Timestamp NSizes uint16 @@ -1518,7 +1540,7 @@ func randrGetScreenInfoReply(buf []byte) *RandrGetScreenInfoReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 v.Timestamp = Timestamp(Get32(buf[b:])) @@ -1558,7 +1580,7 @@ func (cook RandrGetScreenInfoCookie) Check() error { } // Write request to wire for RandrGetScreenInfo -func (c *Conn) randrGetScreenInfoRequest(Window Id) []byte { +func (c *Conn) randrGetScreenInfoRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1584,13 +1606,13 @@ type RandrGetScreenSizeRangeCookie struct { *cookie } -func (c *Conn) RandrGetScreenSizeRange(Window Id) RandrGetScreenSizeRangeCookie { +func (c *Conn) RandrGetScreenSizeRange(Window Window) RandrGetScreenSizeRangeCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) return RandrGetScreenSizeRangeCookie{cookie} } -func (c *Conn) RandrGetScreenSizeRangeUnchecked(Window Id) RandrGetScreenSizeRangeCookie { +func (c *Conn) RandrGetScreenSizeRangeUnchecked(Window Window) RandrGetScreenSizeRangeCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) return RandrGetScreenSizeRangeCookie{cookie} @@ -1656,7 +1678,7 @@ func (cook RandrGetScreenSizeRangeCookie) Check() error { } // Write request to wire for RandrGetScreenSizeRange -func (c *Conn) randrGetScreenSizeRangeRequest(Window Id) []byte { +func (c *Conn) randrGetScreenSizeRangeRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1683,13 +1705,13 @@ type RandrSetScreenSizeCookie struct { } // Write request to wire for RandrSetScreenSize -func (c *Conn) RandrSetScreenSize(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { +func (c *Conn) RandrSetScreenSize(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) return RandrSetScreenSizeCookie{cookie} } -func (c *Conn) RandrSetScreenSizeChecked(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { +func (c *Conn) RandrSetScreenSizeChecked(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) return RandrSetScreenSizeCookie{cookie} @@ -1700,7 +1722,7 @@ func (cook RandrSetScreenSizeCookie) Check() error { } // Write request to wire for RandrSetScreenSize -func (c *Conn) randrSetScreenSizeRequest(Window Id, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { +func (c *Conn) randrSetScreenSizeRequest(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -1738,13 +1760,13 @@ type RandrGetScreenResourcesCookie struct { *cookie } -func (c *Conn) RandrGetScreenResources(Window Id) RandrGetScreenResourcesCookie { +func (c *Conn) RandrGetScreenResources(Window Window) RandrGetScreenResourcesCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) return RandrGetScreenResourcesCookie{cookie} } -func (c *Conn) RandrGetScreenResourcesUnchecked(Window Id) RandrGetScreenResourcesCookie { +func (c *Conn) RandrGetScreenResourcesUnchecked(Window Window) RandrGetScreenResourcesCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) return RandrGetScreenResourcesCookie{cookie} @@ -1763,8 +1785,8 @@ type RandrGetScreenResourcesReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Id // size: pad((int(NumCrtcs) * 4)) - Outputs []Id // size: pad((int(NumOutputs) * 4)) + Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) + Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) Names []byte // size: pad((int(NamesLen) * 1)) } @@ -1814,16 +1836,16 @@ func randrGetScreenResourcesReply(buf []byte) *RandrGetScreenResourcesReply { b += 8 // padding - v.Crtcs = make([]Id, v.NumCrtcs) + v.Crtcs = make([]RandrCrtc, v.NumCrtcs) for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = Id(Get32(buf[b:])) + v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) b += 4 } b = pad(b) - v.Outputs = make([]Id, v.NumOutputs) + v.Outputs = make([]RandrOutput, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = Id(Get32(buf[b:])) + v.Outputs[i] = RandrOutput(Get32(buf[b:])) b += 4 } b = pad(b) @@ -1843,7 +1865,7 @@ func (cook RandrGetScreenResourcesCookie) Check() error { } // Write request to wire for RandrGetScreenResources -func (c *Conn) randrGetScreenResourcesRequest(Window Id) []byte { +func (c *Conn) randrGetScreenResourcesRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1869,13 +1891,13 @@ type RandrGetOutputInfoCookie struct { *cookie } -func (c *Conn) RandrGetOutputInfo(Output Id, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { +func (c *Conn) RandrGetOutputInfo(Output RandrOutput, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) return RandrGetOutputInfoCookie{cookie} } -func (c *Conn) RandrGetOutputInfoUnchecked(Output Id, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { +func (c *Conn) RandrGetOutputInfoUnchecked(Output RandrOutput, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) return RandrGetOutputInfoCookie{cookie} @@ -1888,7 +1910,7 @@ type RandrGetOutputInfoReply struct { Length uint32 Status byte Timestamp Timestamp - Crtc Id + Crtc RandrCrtc MmWidth uint32 MmHeight uint32 Connection byte @@ -1898,10 +1920,10 @@ type RandrGetOutputInfoReply struct { NumPreferred uint16 NumClones uint16 NameLen uint16 - Crtcs []Id // size: pad((int(NumCrtcs) * 4)) - Modes []Id // size: pad((int(NumModes) * 4)) - Clones []Id // size: pad((int(NumClones) * 4)) - Name []byte // size: pad((int(NameLen) * 1)) + Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) + Modes []RandrMode // size: pad((int(NumModes) * 4)) + Clones []RandrOutput // size: pad((int(NumClones) * 4)) + Name []byte // size: pad((int(NameLen) * 1)) } // Waits and reads reply data from request RandrGetOutputInfo @@ -1933,7 +1955,7 @@ func randrGetOutputInfoReply(buf []byte) *RandrGetOutputInfoReply { v.Timestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Crtc = Id(Get32(buf[b:])) + v.Crtc = RandrCrtc(Get32(buf[b:])) b += 4 v.MmWidth = Get32(buf[b:]) @@ -1963,23 +1985,23 @@ func randrGetOutputInfoReply(buf []byte) *RandrGetOutputInfoReply { v.NameLen = Get16(buf[b:]) b += 2 - v.Crtcs = make([]Id, v.NumCrtcs) + v.Crtcs = make([]RandrCrtc, v.NumCrtcs) for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = Id(Get32(buf[b:])) + v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) b += 4 } b = pad(b) - v.Modes = make([]Id, v.NumModes) + v.Modes = make([]RandrMode, v.NumModes) for i := 0; i < int(v.NumModes); i++ { - v.Modes[i] = Id(Get32(buf[b:])) + v.Modes[i] = RandrMode(Get32(buf[b:])) b += 4 } b = pad(b) - v.Clones = make([]Id, v.NumClones) + v.Clones = make([]RandrOutput, v.NumClones) for i := 0; i < int(v.NumClones); i++ { - v.Clones[i] = Id(Get32(buf[b:])) + v.Clones[i] = RandrOutput(Get32(buf[b:])) b += 4 } b = pad(b) @@ -1996,7 +2018,7 @@ func (cook RandrGetOutputInfoCookie) Check() error { } // Write request to wire for RandrGetOutputInfo -func (c *Conn) randrGetOutputInfoRequest(Output Id, ConfigTimestamp Timestamp) []byte { +func (c *Conn) randrGetOutputInfoRequest(Output RandrOutput, ConfigTimestamp Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2025,13 +2047,13 @@ type RandrListOutputPropertiesCookie struct { *cookie } -func (c *Conn) RandrListOutputProperties(Output Id) RandrListOutputPropertiesCookie { +func (c *Conn) RandrListOutputProperties(Output RandrOutput) RandrListOutputPropertiesCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) return RandrListOutputPropertiesCookie{cookie} } -func (c *Conn) RandrListOutputPropertiesUnchecked(Output Id) RandrListOutputPropertiesCookie { +func (c *Conn) RandrListOutputPropertiesUnchecked(Output RandrOutput) RandrListOutputPropertiesCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) return RandrListOutputPropertiesCookie{cookie} @@ -2045,7 +2067,7 @@ type RandrListOutputPropertiesReply struct { // padding: 1 bytes NumAtoms uint16 // padding: 22 bytes - Atoms []Id // size: pad((int(NumAtoms) * 4)) + Atoms []Atom // size: pad((int(NumAtoms) * 4)) } // Waits and reads reply data from request RandrListOutputProperties @@ -2078,9 +2100,9 @@ func randrListOutputPropertiesReply(buf []byte) *RandrListOutputPropertiesReply b += 22 // padding - v.Atoms = make([]Id, v.NumAtoms) + v.Atoms = make([]Atom, v.NumAtoms) for i := 0; i < int(v.NumAtoms); i++ { - v.Atoms[i] = Id(Get32(buf[b:])) + v.Atoms[i] = Atom(Get32(buf[b:])) b += 4 } b = pad(b) @@ -2093,7 +2115,7 @@ func (cook RandrListOutputPropertiesCookie) Check() error { } // Write request to wire for RandrListOutputProperties -func (c *Conn) randrListOutputPropertiesRequest(Output Id) []byte { +func (c *Conn) randrListOutputPropertiesRequest(Output RandrOutput) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2119,13 +2141,13 @@ type RandrQueryOutputPropertyCookie struct { *cookie } -func (c *Conn) RandrQueryOutputProperty(Output Id, Property Id) RandrQueryOutputPropertyCookie { +func (c *Conn) RandrQueryOutputProperty(Output RandrOutput, Property Atom) RandrQueryOutputPropertyCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) return RandrQueryOutputPropertyCookie{cookie} } -func (c *Conn) RandrQueryOutputPropertyUnchecked(Output Id, Property Id) RandrQueryOutputPropertyCookie { +func (c *Conn) RandrQueryOutputPropertyUnchecked(Output RandrOutput, Property Atom) RandrQueryOutputPropertyCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) return RandrQueryOutputPropertyCookie{cookie} @@ -2207,7 +2229,7 @@ func (cook RandrQueryOutputPropertyCookie) Check() error { } // Write request to wire for RandrQueryOutputProperty -func (c *Conn) randrQueryOutputPropertyRequest(Output Id, Property Id) []byte { +func (c *Conn) randrQueryOutputPropertyRequest(Output RandrOutput, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2237,13 +2259,13 @@ type RandrConfigureOutputPropertyCookie struct { } // Write request to wire for RandrConfigureOutputProperty -func (c *Conn) RandrConfigureOutputProperty(Output Id, Property Id, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { +func (c *Conn) RandrConfigureOutputProperty(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) return RandrConfigureOutputPropertyCookie{cookie} } -func (c *Conn) RandrConfigureOutputPropertyChecked(Output Id, Property Id, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { +func (c *Conn) RandrConfigureOutputPropertyChecked(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) return RandrConfigureOutputPropertyCookie{cookie} @@ -2254,7 +2276,7 @@ func (cook RandrConfigureOutputPropertyCookie) Check() error { } // Write request to wire for RandrConfigureOutputProperty -func (c *Conn) randrConfigureOutputPropertyRequest(Output Id, Property Id, Pending bool, Range bool, Values []int32) []byte { +func (c *Conn) randrConfigureOutputPropertyRequest(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) []byte { size := pad((16 + pad((len(Values) * 4)))) b := 0 buf := make([]byte, size) @@ -2306,13 +2328,13 @@ type RandrChangeOutputPropertyCookie struct { } // Write request to wire for RandrChangeOutputProperty -func (c *Conn) RandrChangeOutputProperty(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { +func (c *Conn) RandrChangeOutputProperty(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return RandrChangeOutputPropertyCookie{cookie} } -func (c *Conn) RandrChangeOutputPropertyChecked(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { +func (c *Conn) RandrChangeOutputPropertyChecked(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return RandrChangeOutputPropertyCookie{cookie} @@ -2323,7 +2345,7 @@ func (cook RandrChangeOutputPropertyCookie) Check() error { } // Write request to wire for RandrChangeOutputProperty -func (c *Conn) randrChangeOutputPropertyRequest(Output Id, Property Id, Type Id, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { +func (c *Conn) randrChangeOutputPropertyRequest(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { size := pad((24 + pad((((int(NumUnits) * int(Format)) / 8) * 1)))) b := 0 buf := make([]byte, size) @@ -2370,13 +2392,13 @@ type RandrDeleteOutputPropertyCookie struct { } // Write request to wire for RandrDeleteOutputProperty -func (c *Conn) RandrDeleteOutputProperty(Output Id, Property Id) RandrDeleteOutputPropertyCookie { +func (c *Conn) RandrDeleteOutputProperty(Output RandrOutput, Property Atom) RandrDeleteOutputPropertyCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) return RandrDeleteOutputPropertyCookie{cookie} } -func (c *Conn) RandrDeleteOutputPropertyChecked(Output Id, Property Id) RandrDeleteOutputPropertyCookie { +func (c *Conn) RandrDeleteOutputPropertyChecked(Output RandrOutput, Property Atom) RandrDeleteOutputPropertyCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) return RandrDeleteOutputPropertyCookie{cookie} @@ -2387,7 +2409,7 @@ func (cook RandrDeleteOutputPropertyCookie) Check() error { } // Write request to wire for RandrDeleteOutputProperty -func (c *Conn) randrDeleteOutputPropertyRequest(Output Id, Property Id) []byte { +func (c *Conn) randrDeleteOutputPropertyRequest(Output RandrOutput, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2416,13 +2438,13 @@ type RandrGetOutputPropertyCookie struct { *cookie } -func (c *Conn) RandrGetOutputProperty(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { +func (c *Conn) RandrGetOutputProperty(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return RandrGetOutputPropertyCookie{cookie} } -func (c *Conn) RandrGetOutputPropertyUnchecked(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { +func (c *Conn) RandrGetOutputPropertyUnchecked(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return RandrGetOutputPropertyCookie{cookie} @@ -2434,7 +2456,7 @@ type RandrGetOutputPropertyReply struct { Sequence uint16 Length uint32 Format byte - Type Id + Type Atom BytesAfter uint32 NumItems uint32 // padding: 12 bytes @@ -2467,7 +2489,7 @@ func randrGetOutputPropertyReply(buf []byte) *RandrGetOutputPropertyReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Type = Id(Get32(buf[b:])) + v.Type = Atom(Get32(buf[b:])) b += 4 v.BytesAfter = Get32(buf[b:]) @@ -2490,7 +2512,7 @@ func (cook RandrGetOutputPropertyCookie) Check() error { } // Write request to wire for RandrGetOutputProperty -func (c *Conn) randrGetOutputPropertyRequest(Output Id, Property Id, Type Id, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { +func (c *Conn) randrGetOutputPropertyRequest(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -2544,13 +2566,13 @@ type RandrCreateModeCookie struct { *cookie } -func (c *Conn) RandrCreateMode(Window Id, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { +func (c *Conn) RandrCreateMode(Window Window, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) return RandrCreateModeCookie{cookie} } -func (c *Conn) RandrCreateModeUnchecked(Window Id, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { +func (c *Conn) RandrCreateModeUnchecked(Window Window, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) return RandrCreateModeCookie{cookie} @@ -2562,7 +2584,7 @@ type RandrCreateModeReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Mode Id + Mode RandrMode // padding: 20 bytes } @@ -2591,7 +2613,7 @@ func randrCreateModeReply(buf []byte) *RandrCreateModeReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Mode = Id(Get32(buf[b:])) + v.Mode = RandrMode(Get32(buf[b:])) b += 4 b += 20 // padding @@ -2604,7 +2626,7 @@ func (cook RandrCreateModeCookie) Check() error { } // Write request to wire for RandrCreateMode -func (c *Conn) randrCreateModeRequest(Window Id, ModeInfo RandrModeInfo, Name string) []byte { +func (c *Conn) randrCreateModeRequest(Window Window, ModeInfo RandrModeInfo, Name string) []byte { size := pad((40 + pad((len(Name) * 1)))) b := 0 buf := make([]byte, size) @@ -2640,13 +2662,13 @@ type RandrDestroyModeCookie struct { } // Write request to wire for RandrDestroyMode -func (c *Conn) RandrDestroyMode(Mode Id) RandrDestroyModeCookie { +func (c *Conn) RandrDestroyMode(Mode RandrMode) RandrDestroyModeCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrDestroyModeRequest(Mode), cookie) return RandrDestroyModeCookie{cookie} } -func (c *Conn) RandrDestroyModeChecked(Mode Id) RandrDestroyModeCookie { +func (c *Conn) RandrDestroyModeChecked(Mode RandrMode) RandrDestroyModeCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrDestroyModeRequest(Mode), cookie) return RandrDestroyModeCookie{cookie} @@ -2657,7 +2679,7 @@ func (cook RandrDestroyModeCookie) Check() error { } // Write request to wire for RandrDestroyMode -func (c *Conn) randrDestroyModeRequest(Mode Id) []byte { +func (c *Conn) randrDestroyModeRequest(Mode RandrMode) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2684,13 +2706,13 @@ type RandrAddOutputModeCookie struct { } // Write request to wire for RandrAddOutputMode -func (c *Conn) RandrAddOutputMode(Output Id, Mode Id) RandrAddOutputModeCookie { +func (c *Conn) RandrAddOutputMode(Output RandrOutput, Mode RandrMode) RandrAddOutputModeCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) return RandrAddOutputModeCookie{cookie} } -func (c *Conn) RandrAddOutputModeChecked(Output Id, Mode Id) RandrAddOutputModeCookie { +func (c *Conn) RandrAddOutputModeChecked(Output RandrOutput, Mode RandrMode) RandrAddOutputModeCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) return RandrAddOutputModeCookie{cookie} @@ -2701,7 +2723,7 @@ func (cook RandrAddOutputModeCookie) Check() error { } // Write request to wire for RandrAddOutputMode -func (c *Conn) randrAddOutputModeRequest(Output Id, Mode Id) []byte { +func (c *Conn) randrAddOutputModeRequest(Output RandrOutput, Mode RandrMode) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2731,13 +2753,13 @@ type RandrDeleteOutputModeCookie struct { } // Write request to wire for RandrDeleteOutputMode -func (c *Conn) RandrDeleteOutputMode(Output Id, Mode Id) RandrDeleteOutputModeCookie { +func (c *Conn) RandrDeleteOutputMode(Output RandrOutput, Mode RandrMode) RandrDeleteOutputModeCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) return RandrDeleteOutputModeCookie{cookie} } -func (c *Conn) RandrDeleteOutputModeChecked(Output Id, Mode Id) RandrDeleteOutputModeCookie { +func (c *Conn) RandrDeleteOutputModeChecked(Output RandrOutput, Mode RandrMode) RandrDeleteOutputModeCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) return RandrDeleteOutputModeCookie{cookie} @@ -2748,7 +2770,7 @@ func (cook RandrDeleteOutputModeCookie) Check() error { } // Write request to wire for RandrDeleteOutputMode -func (c *Conn) randrDeleteOutputModeRequest(Output Id, Mode Id) []byte { +func (c *Conn) randrDeleteOutputModeRequest(Output RandrOutput, Mode RandrMode) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2777,13 +2799,13 @@ type RandrGetCrtcInfoCookie struct { *cookie } -func (c *Conn) RandrGetCrtcInfo(Crtc Id, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { +func (c *Conn) RandrGetCrtcInfo(Crtc RandrCrtc, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) return RandrGetCrtcInfoCookie{cookie} } -func (c *Conn) RandrGetCrtcInfoUnchecked(Crtc Id, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { +func (c *Conn) RandrGetCrtcInfoUnchecked(Crtc RandrCrtc, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) return RandrGetCrtcInfoCookie{cookie} @@ -2800,13 +2822,13 @@ type RandrGetCrtcInfoReply struct { Y int16 Width uint16 Height uint16 - Mode Id + Mode RandrMode Rotation uint16 Rotations uint16 NumOutputs uint16 NumPossibleOutputs uint16 - Outputs []Id // size: pad((int(NumOutputs) * 4)) - Possible []Id // size: pad((int(NumPossibleOutputs) * 4)) + Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) + Possible []RandrOutput // size: pad((int(NumPossibleOutputs) * 4)) } // Waits and reads reply data from request RandrGetCrtcInfo @@ -2850,7 +2872,7 @@ func randrGetCrtcInfoReply(buf []byte) *RandrGetCrtcInfoReply { v.Height = Get16(buf[b:]) b += 2 - v.Mode = Id(Get32(buf[b:])) + v.Mode = RandrMode(Get32(buf[b:])) b += 4 v.Rotation = Get16(buf[b:]) @@ -2865,16 +2887,16 @@ func randrGetCrtcInfoReply(buf []byte) *RandrGetCrtcInfoReply { v.NumPossibleOutputs = Get16(buf[b:]) b += 2 - v.Outputs = make([]Id, v.NumOutputs) + v.Outputs = make([]RandrOutput, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = Id(Get32(buf[b:])) + v.Outputs[i] = RandrOutput(Get32(buf[b:])) b += 4 } b = pad(b) - v.Possible = make([]Id, v.NumPossibleOutputs) + v.Possible = make([]RandrOutput, v.NumPossibleOutputs) for i := 0; i < int(v.NumPossibleOutputs); i++ { - v.Possible[i] = Id(Get32(buf[b:])) + v.Possible[i] = RandrOutput(Get32(buf[b:])) b += 4 } b = pad(b) @@ -2887,7 +2909,7 @@ func (cook RandrGetCrtcInfoCookie) Check() error { } // Write request to wire for RandrGetCrtcInfo -func (c *Conn) randrGetCrtcInfoRequest(Crtc Id, ConfigTimestamp Timestamp) []byte { +func (c *Conn) randrGetCrtcInfoRequest(Crtc RandrCrtc, ConfigTimestamp Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2916,13 +2938,13 @@ type RandrSetCrtcConfigCookie struct { *cookie } -func (c *Conn) RandrSetCrtcConfig(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) RandrSetCrtcConfigCookie { +func (c *Conn) RandrSetCrtcConfig(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) RandrSetCrtcConfigCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return RandrSetCrtcConfigCookie{cookie} } -func (c *Conn) RandrSetCrtcConfigUnchecked(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) RandrSetCrtcConfigCookie { +func (c *Conn) RandrSetCrtcConfigUnchecked(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) RandrSetCrtcConfigCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return RandrSetCrtcConfigCookie{cookie} @@ -2977,7 +2999,7 @@ func (cook RandrSetCrtcConfigCookie) Check() error { } // Write request to wire for RandrSetCrtcConfig -func (c *Conn) randrSetCrtcConfigRequest(Crtc Id, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode Id, Rotation uint16, Outputs []Id) []byte { +func (c *Conn) randrSetCrtcConfigRequest(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) []byte { size := pad((28 + pad((len(Outputs) * 4)))) b := 0 buf := make([]byte, size) @@ -3029,13 +3051,13 @@ type RandrGetCrtcGammaSizeCookie struct { *cookie } -func (c *Conn) RandrGetCrtcGammaSize(Crtc Id) RandrGetCrtcGammaSizeCookie { +func (c *Conn) RandrGetCrtcGammaSize(Crtc RandrCrtc) RandrGetCrtcGammaSizeCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) return RandrGetCrtcGammaSizeCookie{cookie} } -func (c *Conn) RandrGetCrtcGammaSizeUnchecked(Crtc Id) RandrGetCrtcGammaSizeCookie { +func (c *Conn) RandrGetCrtcGammaSizeUnchecked(Crtc RandrCrtc) RandrGetCrtcGammaSizeCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) return RandrGetCrtcGammaSizeCookie{cookie} @@ -3089,7 +3111,7 @@ func (cook RandrGetCrtcGammaSizeCookie) Check() error { } // Write request to wire for RandrGetCrtcGammaSize -func (c *Conn) randrGetCrtcGammaSizeRequest(Crtc Id) []byte { +func (c *Conn) randrGetCrtcGammaSizeRequest(Crtc RandrCrtc) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3115,13 +3137,13 @@ type RandrGetCrtcGammaCookie struct { *cookie } -func (c *Conn) RandrGetCrtcGamma(Crtc Id) RandrGetCrtcGammaCookie { +func (c *Conn) RandrGetCrtcGamma(Crtc RandrCrtc) RandrGetCrtcGammaCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) return RandrGetCrtcGammaCookie{cookie} } -func (c *Conn) RandrGetCrtcGammaUnchecked(Crtc Id) RandrGetCrtcGammaCookie { +func (c *Conn) RandrGetCrtcGammaUnchecked(Crtc RandrCrtc) RandrGetCrtcGammaCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) return RandrGetCrtcGammaCookie{cookie} @@ -3199,7 +3221,7 @@ func (cook RandrGetCrtcGammaCookie) Check() error { } // Write request to wire for RandrGetCrtcGamma -func (c *Conn) randrGetCrtcGammaRequest(Crtc Id) []byte { +func (c *Conn) randrGetCrtcGammaRequest(Crtc RandrCrtc) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3226,13 +3248,13 @@ type RandrSetCrtcGammaCookie struct { } // Write request to wire for RandrSetCrtcGamma -func (c *Conn) RandrSetCrtcGamma(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { +func (c *Conn) RandrSetCrtcGamma(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) return RandrSetCrtcGammaCookie{cookie} } -func (c *Conn) RandrSetCrtcGammaChecked(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { +func (c *Conn) RandrSetCrtcGammaChecked(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) return RandrSetCrtcGammaCookie{cookie} @@ -3243,7 +3265,7 @@ func (cook RandrSetCrtcGammaCookie) Check() error { } // Write request to wire for RandrSetCrtcGamma -func (c *Conn) randrSetCrtcGammaRequest(Crtc Id, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { +func (c *Conn) randrSetCrtcGammaRequest(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { size := pad((((12 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2)))) b := 0 buf := make([]byte, size) @@ -3292,13 +3314,13 @@ type RandrGetScreenResourcesCurrentCookie struct { *cookie } -func (c *Conn) RandrGetScreenResourcesCurrent(Window Id) RandrGetScreenResourcesCurrentCookie { +func (c *Conn) RandrGetScreenResourcesCurrent(Window Window) RandrGetScreenResourcesCurrentCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) return RandrGetScreenResourcesCurrentCookie{cookie} } -func (c *Conn) RandrGetScreenResourcesCurrentUnchecked(Window Id) RandrGetScreenResourcesCurrentCookie { +func (c *Conn) RandrGetScreenResourcesCurrentUnchecked(Window Window) RandrGetScreenResourcesCurrentCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) return RandrGetScreenResourcesCurrentCookie{cookie} @@ -3317,8 +3339,8 @@ type RandrGetScreenResourcesCurrentReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Id // size: pad((int(NumCrtcs) * 4)) - Outputs []Id // size: pad((int(NumOutputs) * 4)) + Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) + Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) Names []byte // size: pad((int(NamesLen) * 1)) } @@ -3368,16 +3390,16 @@ func randrGetScreenResourcesCurrentReply(buf []byte) *RandrGetScreenResourcesCur b += 8 // padding - v.Crtcs = make([]Id, v.NumCrtcs) + v.Crtcs = make([]RandrCrtc, v.NumCrtcs) for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = Id(Get32(buf[b:])) + v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) b += 4 } b = pad(b) - v.Outputs = make([]Id, v.NumOutputs) + v.Outputs = make([]RandrOutput, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = Id(Get32(buf[b:])) + v.Outputs[i] = RandrOutput(Get32(buf[b:])) b += 4 } b = pad(b) @@ -3397,7 +3419,7 @@ func (cook RandrGetScreenResourcesCurrentCookie) Check() error { } // Write request to wire for RandrGetScreenResourcesCurrent -func (c *Conn) randrGetScreenResourcesCurrentRequest(Window Id) []byte { +func (c *Conn) randrGetScreenResourcesCurrentRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3424,13 +3446,13 @@ type RandrSetCrtcTransformCookie struct { } // Write request to wire for RandrSetCrtcTransform -func (c *Conn) RandrSetCrtcTransform(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { +func (c *Conn) RandrSetCrtcTransform(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return RandrSetCrtcTransformCookie{cookie} } -func (c *Conn) RandrSetCrtcTransformChecked(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { +func (c *Conn) RandrSetCrtcTransformChecked(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return RandrSetCrtcTransformCookie{cookie} @@ -3441,7 +3463,7 @@ func (cook RandrSetCrtcTransformCookie) Check() error { } // Write request to wire for RandrSetCrtcTransform -func (c *Conn) randrSetCrtcTransformRequest(Crtc Id, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) []byte { +func (c *Conn) randrSetCrtcTransformRequest(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) []byte { size := pad(((48 + pad((int(FilterLen) * 1))) + pad((len(FilterParams) * 4)))) b := 0 buf := make([]byte, size) @@ -3487,13 +3509,13 @@ type RandrGetCrtcTransformCookie struct { *cookie } -func (c *Conn) RandrGetCrtcTransform(Crtc Id) RandrGetCrtcTransformCookie { +func (c *Conn) RandrGetCrtcTransform(Crtc RandrCrtc) RandrGetCrtcTransformCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) return RandrGetCrtcTransformCookie{cookie} } -func (c *Conn) RandrGetCrtcTransformUnchecked(Crtc Id) RandrGetCrtcTransformCookie { +func (c *Conn) RandrGetCrtcTransformUnchecked(Crtc RandrCrtc) RandrGetCrtcTransformCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) return RandrGetCrtcTransformCookie{cookie} @@ -3610,7 +3632,7 @@ func (cook RandrGetCrtcTransformCookie) Check() error { } // Write request to wire for RandrGetCrtcTransform -func (c *Conn) randrGetCrtcTransformRequest(Crtc Id) []byte { +func (c *Conn) randrGetCrtcTransformRequest(Crtc RandrCrtc) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3636,13 +3658,13 @@ type RandrGetPanningCookie struct { *cookie } -func (c *Conn) RandrGetPanning(Crtc Id) RandrGetPanningCookie { +func (c *Conn) RandrGetPanning(Crtc RandrCrtc) RandrGetPanningCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetPanningRequest(Crtc), cookie) return RandrGetPanningCookie{cookie} } -func (c *Conn) RandrGetPanningUnchecked(Crtc Id) RandrGetPanningCookie { +func (c *Conn) RandrGetPanningUnchecked(Crtc RandrCrtc) RandrGetPanningCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetPanningRequest(Crtc), cookie) return RandrGetPanningCookie{cookie} @@ -3742,7 +3764,7 @@ func (cook RandrGetPanningCookie) Check() error { } // Write request to wire for RandrGetPanning -func (c *Conn) randrGetPanningRequest(Crtc Id) []byte { +func (c *Conn) randrGetPanningRequest(Crtc RandrCrtc) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3768,13 +3790,13 @@ type RandrSetPanningCookie struct { *cookie } -func (c *Conn) RandrSetPanning(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { +func (c *Conn) RandrSetPanning(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return RandrSetPanningCookie{cookie} } -func (c *Conn) RandrSetPanningUnchecked(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { +func (c *Conn) RandrSetPanningUnchecked(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return RandrSetPanningCookie{cookie} @@ -3826,7 +3848,7 @@ func (cook RandrSetPanningCookie) Check() error { } // Write request to wire for RandrSetPanning -func (c *Conn) randrSetPanningRequest(Crtc Id, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { +func (c *Conn) randrSetPanningRequest(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { size := 36 b := 0 buf := make([]byte, size) @@ -3892,13 +3914,13 @@ type RandrSetOutputPrimaryCookie struct { } // Write request to wire for RandrSetOutputPrimary -func (c *Conn) RandrSetOutputPrimary(Window Id, Output Id) RandrSetOutputPrimaryCookie { +func (c *Conn) RandrSetOutputPrimary(Window Window, Output RandrOutput) RandrSetOutputPrimaryCookie { cookie := c.newCookie(false, false) c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) return RandrSetOutputPrimaryCookie{cookie} } -func (c *Conn) RandrSetOutputPrimaryChecked(Window Id, Output Id) RandrSetOutputPrimaryCookie { +func (c *Conn) RandrSetOutputPrimaryChecked(Window Window, Output RandrOutput) RandrSetOutputPrimaryCookie { cookie := c.newCookie(true, false) c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) return RandrSetOutputPrimaryCookie{cookie} @@ -3909,7 +3931,7 @@ func (cook RandrSetOutputPrimaryCookie) Check() error { } // Write request to wire for RandrSetOutputPrimary -func (c *Conn) randrSetOutputPrimaryRequest(Window Id, Output Id) []byte { +func (c *Conn) randrSetOutputPrimaryRequest(Window Window, Output RandrOutput) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -3938,13 +3960,13 @@ type RandrGetOutputPrimaryCookie struct { *cookie } -func (c *Conn) RandrGetOutputPrimary(Window Id) RandrGetOutputPrimaryCookie { +func (c *Conn) RandrGetOutputPrimary(Window Window) RandrGetOutputPrimaryCookie { cookie := c.newCookie(true, true) c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) return RandrGetOutputPrimaryCookie{cookie} } -func (c *Conn) RandrGetOutputPrimaryUnchecked(Window Id) RandrGetOutputPrimaryCookie { +func (c *Conn) RandrGetOutputPrimaryUnchecked(Window Window) RandrGetOutputPrimaryCookie { cookie := c.newCookie(false, true) c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) return RandrGetOutputPrimaryCookie{cookie} @@ -3956,7 +3978,7 @@ type RandrGetOutputPrimaryReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Output Id + Output RandrOutput } // Waits and reads reply data from request RandrGetOutputPrimary @@ -3984,7 +4006,7 @@ func randrGetOutputPrimaryReply(buf []byte) *RandrGetOutputPrimaryReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Output = Id(Get32(buf[b:])) + v.Output = RandrOutput(Get32(buf[b:])) b += 4 return v @@ -3995,7 +4017,7 @@ func (cook RandrGetOutputPrimaryCookie) Check() error { } // Write request to wire for RandrGetOutputPrimary -func (c *Conn) randrGetOutputPrimaryRequest(Window Id) []byte { +func (c *Conn) randrGetOutputPrimaryRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go index c92868f..ec936d7 100644 --- a/nexgb/auto_record.go +++ b/nexgb/auto_record.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by record.xml on May 8 2012 11:03:24pm EDT. + This file was generated by record.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,20 +33,6 @@ func init() { newExtErrorFuncs["RECORD"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -59,6 +45,18 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( RecordHTypeFromServerTime = 1 RecordHTypeFromClientTime = 2 @@ -71,7 +69,15 @@ const ( RecordCsAllClients = 3 ) -// Skipping resource definition of 'Context' +type RecordContext uint32 + +func (c *Conn) NewRecordContextId() (RecordContext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RecordContext(id), nil +} type RecordElementHeader byte @@ -498,7 +504,7 @@ func (err RecordBadContextError) SequenceId() uint16 { return err.Sequence } -func (err RecordBadContextError) BadId() Id { +func (err RecordBadContextError) BadId() uint32 { return 0 } @@ -611,13 +617,13 @@ type RecordCreateContextCookie struct { } // Write request to wire for RecordCreateContext -func (c *Conn) RecordCreateContext(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { +func (c *Conn) RecordCreateContext(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RecordCreateContextCookie{cookie} } -func (c *Conn) RecordCreateContextChecked(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { +func (c *Conn) RecordCreateContextChecked(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RecordCreateContextCookie{cookie} @@ -628,7 +634,7 @@ func (cook RecordCreateContextCookie) Check() error { } // Write request to wire for RecordCreateContext -func (c *Conn) recordCreateContextRequest(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { +func (c *Conn) recordCreateContextRequest(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -674,13 +680,13 @@ type RecordRegisterClientsCookie struct { } // Write request to wire for RecordRegisterClients -func (c *Conn) RecordRegisterClients(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { +func (c *Conn) RecordRegisterClients(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { cookie := c.newCookie(false, false) c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RecordRegisterClientsCookie{cookie} } -func (c *Conn) RecordRegisterClientsChecked(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { +func (c *Conn) RecordRegisterClientsChecked(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { cookie := c.newCookie(true, false) c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RecordRegisterClientsCookie{cookie} @@ -691,7 +697,7 @@ func (cook RecordRegisterClientsCookie) Check() error { } // Write request to wire for RecordRegisterClients -func (c *Conn) recordRegisterClientsRequest(Context Id, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { +func (c *Conn) recordRegisterClientsRequest(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -737,13 +743,13 @@ type RecordUnregisterClientsCookie struct { } // Write request to wire for RecordUnregisterClients -func (c *Conn) RecordUnregisterClients(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { +func (c *Conn) RecordUnregisterClients(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { cookie := c.newCookie(false, false) c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) return RecordUnregisterClientsCookie{cookie} } -func (c *Conn) RecordUnregisterClientsChecked(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { +func (c *Conn) RecordUnregisterClientsChecked(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { cookie := c.newCookie(true, false) c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) return RecordUnregisterClientsCookie{cookie} @@ -754,7 +760,7 @@ func (cook RecordUnregisterClientsCookie) Check() error { } // Write request to wire for RecordUnregisterClients -func (c *Conn) recordUnregisterClientsRequest(Context Id, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) []byte { +func (c *Conn) recordUnregisterClientsRequest(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) []byte { size := pad((12 + pad((int(NumClientSpecs) * 4)))) b := 0 buf := make([]byte, size) @@ -789,13 +795,13 @@ type RecordGetContextCookie struct { *cookie } -func (c *Conn) RecordGetContext(Context Id) RecordGetContextCookie { +func (c *Conn) RecordGetContext(Context RecordContext) RecordGetContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.recordGetContextRequest(Context), cookie) return RecordGetContextCookie{cookie} } -func (c *Conn) RecordGetContextUnchecked(Context Id) RecordGetContextCookie { +func (c *Conn) RecordGetContextUnchecked(Context RecordContext) RecordGetContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.recordGetContextRequest(Context), cookie) return RecordGetContextCookie{cookie} @@ -865,7 +871,7 @@ func (cook RecordGetContextCookie) Check() error { } // Write request to wire for RecordGetContext -func (c *Conn) recordGetContextRequest(Context Id) []byte { +func (c *Conn) recordGetContextRequest(Context RecordContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -891,13 +897,13 @@ type RecordEnableContextCookie struct { *cookie } -func (c *Conn) RecordEnableContext(Context Id) RecordEnableContextCookie { +func (c *Conn) RecordEnableContext(Context RecordContext) RecordEnableContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.recordEnableContextRequest(Context), cookie) return RecordEnableContextCookie{cookie} } -func (c *Conn) RecordEnableContextUnchecked(Context Id) RecordEnableContextCookie { +func (c *Conn) RecordEnableContextUnchecked(Context RecordContext) RecordEnableContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.recordEnableContextRequest(Context), cookie) return RecordEnableContextCookie{cookie} @@ -980,7 +986,7 @@ func (cook RecordEnableContextCookie) Check() error { } // Write request to wire for RecordEnableContext -func (c *Conn) recordEnableContextRequest(Context Id) []byte { +func (c *Conn) recordEnableContextRequest(Context RecordContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1007,13 +1013,13 @@ type RecordDisableContextCookie struct { } // Write request to wire for RecordDisableContext -func (c *Conn) RecordDisableContext(Context Id) RecordDisableContextCookie { +func (c *Conn) RecordDisableContext(Context RecordContext) RecordDisableContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.recordDisableContextRequest(Context), cookie) return RecordDisableContextCookie{cookie} } -func (c *Conn) RecordDisableContextChecked(Context Id) RecordDisableContextCookie { +func (c *Conn) RecordDisableContextChecked(Context RecordContext) RecordDisableContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.recordDisableContextRequest(Context), cookie) return RecordDisableContextCookie{cookie} @@ -1024,7 +1030,7 @@ func (cook RecordDisableContextCookie) Check() error { } // Write request to wire for RecordDisableContext -func (c *Conn) recordDisableContextRequest(Context Id) []byte { +func (c *Conn) recordDisableContextRequest(Context RecordContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1051,13 +1057,13 @@ type RecordFreeContextCookie struct { } // Write request to wire for RecordFreeContext -func (c *Conn) RecordFreeContext(Context Id) RecordFreeContextCookie { +func (c *Conn) RecordFreeContext(Context RecordContext) RecordFreeContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.recordFreeContextRequest(Context), cookie) return RecordFreeContextCookie{cookie} } -func (c *Conn) RecordFreeContextChecked(Context Id) RecordFreeContextCookie { +func (c *Conn) RecordFreeContextChecked(Context RecordContext) RecordFreeContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.recordFreeContextRequest(Context), cookie) return RecordFreeContextCookie{cookie} @@ -1068,7 +1074,7 @@ func (cook RecordFreeContextCookie) Check() error { } // Write request to wire for RecordFreeContext -func (c *Conn) recordFreeContextRequest(Context Id) []byte { +func (c *Conn) recordFreeContextRequest(Context RecordContext) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go index bea7d88..5e1ff12 100644 --- a/nexgb/auto_render.go +++ b/nexgb/auto_render.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by render.xml on May 8 2012 11:03:24pm EDT. + This file was generated by render.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,12 @@ func init() { newExtErrorFuncs["RENDER"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -45,8 +51,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -57,12 +61,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - const ( RenderPictTypeIndexed = 0 RenderPictTypeDirect = 1 @@ -170,11 +168,35 @@ const ( RenderRepeatReflect = 3 ) -// Skipping resource definition of 'Glyphset' +type RenderGlyphset uint32 -// Skipping resource definition of 'Picture' +func (c *Conn) NewRenderGlyphsetId() (RenderGlyphset, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RenderGlyphset(id), nil +} -// Skipping resource definition of 'Pictformat' +type RenderPicture uint32 + +func (c *Conn) NewRenderPictureId() (RenderPicture, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RenderPicture(id), nil +} + +type RenderPictformat uint32 + +func (c *Conn) NewRenderPictformatId() (RenderPictformat, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return RenderPictformat(id), nil +} type RenderGlyph uint32 @@ -281,19 +303,19 @@ func RenderDirectformatListBytes(buf []byte, list []RenderDirectformat) int { // 'RenderPictforminfo' struct definition // Size: 28 type RenderPictforminfo struct { - Id Id + Id RenderPictformat Type byte Depth byte // padding: 2 bytes Direct RenderDirectformat - Colormap Id + Colormap Colormap } // Struct read RenderPictforminfo func ReadRenderPictforminfo(buf []byte, v *RenderPictforminfo) int { b := 0 - v.Id = Id(Get32(buf[b:])) + v.Id = RenderPictformat(Get32(buf[b:])) b += 4 v.Type = buf[b] @@ -307,7 +329,7 @@ func ReadRenderPictforminfo(buf []byte, v *RenderPictforminfo) int { v.Direct = RenderDirectformat{} b += ReadRenderDirectformat(buf[b:], &v.Direct) - v.Colormap = Id(Get32(buf[b:])) + v.Colormap = Colormap(Get32(buf[b:])) b += 4 return b @@ -367,7 +389,7 @@ func RenderPictforminfoListBytes(buf []byte, list []RenderPictforminfo) int { // Size: 8 type RenderPictvisual struct { Visual Visualid - Format Id + Format RenderPictformat } // Struct read RenderPictvisual @@ -377,7 +399,7 @@ func ReadRenderPictvisual(buf []byte, v *RenderPictvisual) int { v.Visual = Visualid(Get32(buf[b:])) b += 4 - v.Format = Id(Get32(buf[b:])) + v.Format = RenderPictformat(Get32(buf[b:])) b += 4 return b @@ -504,7 +526,7 @@ func RenderPictdepthListSize(list []RenderPictdepth) int { // Size: (8 + RenderPictdepthListSize(Depths)) type RenderPictscreen struct { NumDepths uint32 - Fallback Id + Fallback RenderPictformat Depths []RenderPictdepth // size: RenderPictdepthListSize(Depths) } @@ -515,7 +537,7 @@ func ReadRenderPictscreen(buf []byte, v *RenderPictscreen) int { v.NumDepths = Get32(buf[b:]) b += 4 - v.Fallback = Id(Get32(buf[b:])) + v.Fallback = RenderPictformat(Get32(buf[b:])) b += 4 v.Depths = make([]RenderPictdepth, v.NumDepths) @@ -1176,7 +1198,7 @@ func RenderTransformListBytes(buf []byte, list []RenderTransform) int { // 'RenderAnimcursorelt' struct definition // Size: 8 type RenderAnimcursorelt struct { - Cursor Id + Cursor Cursor Delay uint32 } @@ -1184,7 +1206,7 @@ type RenderAnimcursorelt struct { func ReadRenderAnimcursorelt(buf []byte, v *RenderAnimcursorelt) int { b := 0 - v.Cursor = Id(Get32(buf[b:])) + v.Cursor = Cursor(Get32(buf[b:])) b += 4 v.Delay = Get32(buf[b:]) @@ -1384,7 +1406,7 @@ func (err RenderPictFormatError) SequenceId() uint16 { return err.Sequence } -func (err RenderPictFormatError) BadId() Id { +func (err RenderPictFormatError) BadId() uint32 { return 0 } @@ -1429,7 +1451,7 @@ func (err RenderPictureError) SequenceId() uint16 { return err.Sequence } -func (err RenderPictureError) BadId() Id { +func (err RenderPictureError) BadId() uint32 { return 0 } @@ -1474,7 +1496,7 @@ func (err RenderPictOpError) SequenceId() uint16 { return err.Sequence } -func (err RenderPictOpError) BadId() Id { +func (err RenderPictOpError) BadId() uint32 { return 0 } @@ -1519,7 +1541,7 @@ func (err RenderGlyphSetError) SequenceId() uint16 { return err.Sequence } -func (err RenderGlyphSetError) BadId() Id { +func (err RenderGlyphSetError) BadId() uint32 { return 0 } @@ -1564,7 +1586,7 @@ func (err RenderGlyphError) SequenceId() uint16 { return err.Sequence } -func (err RenderGlyphError) BadId() Id { +func (err RenderGlyphError) BadId() uint32 { return 0 } @@ -1793,13 +1815,13 @@ type RenderQueryPictIndexValuesCookie struct { *cookie } -func (c *Conn) RenderQueryPictIndexValues(Format Id) RenderQueryPictIndexValuesCookie { +func (c *Conn) RenderQueryPictIndexValues(Format RenderPictformat) RenderQueryPictIndexValuesCookie { cookie := c.newCookie(true, true) c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) return RenderQueryPictIndexValuesCookie{cookie} } -func (c *Conn) RenderQueryPictIndexValuesUnchecked(Format Id) RenderQueryPictIndexValuesCookie { +func (c *Conn) RenderQueryPictIndexValuesUnchecked(Format RenderPictformat) RenderQueryPictIndexValuesCookie { cookie := c.newCookie(false, true) c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) return RenderQueryPictIndexValuesCookie{cookie} @@ -1857,7 +1879,7 @@ func (cook RenderQueryPictIndexValuesCookie) Check() error { } // Write request to wire for RenderQueryPictIndexValues -func (c *Conn) renderQueryPictIndexValuesRequest(Format Id) []byte { +func (c *Conn) renderQueryPictIndexValuesRequest(Format RenderPictformat) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1884,13 +1906,13 @@ type RenderCreatePictureCookie struct { } // Write request to wire for RenderCreatePicture -func (c *Conn) RenderCreatePicture(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { +func (c *Conn) RenderCreatePicture(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) return RenderCreatePictureCookie{cookie} } -func (c *Conn) RenderCreatePictureChecked(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { +func (c *Conn) RenderCreatePictureChecked(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) return RenderCreatePictureCookie{cookie} @@ -1901,7 +1923,7 @@ func (cook RenderCreatePictureCookie) Check() error { } // Write request to wire for RenderCreatePicture -func (c *Conn) renderCreatePictureRequest(Pid Id, Drawable Id, Format Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) renderCreatePictureRequest(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) []byte { size := pad((16 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -1942,13 +1964,13 @@ type RenderChangePictureCookie struct { } // Write request to wire for RenderChangePicture -func (c *Conn) RenderChangePicture(Picture Id, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { +func (c *Conn) RenderChangePicture(Picture RenderPicture, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) return RenderChangePictureCookie{cookie} } -func (c *Conn) RenderChangePictureChecked(Picture Id, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { +func (c *Conn) RenderChangePictureChecked(Picture RenderPicture, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) return RenderChangePictureCookie{cookie} @@ -1959,7 +1981,7 @@ func (cook RenderChangePictureCookie) Check() error { } // Write request to wire for RenderChangePicture -func (c *Conn) renderChangePictureRequest(Picture Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) renderChangePictureRequest(Picture RenderPicture, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -1994,13 +2016,13 @@ type RenderSetPictureClipRectanglesCookie struct { } // Write request to wire for RenderSetPictureClipRectangles -func (c *Conn) RenderSetPictureClipRectangles(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { +func (c *Conn) RenderSetPictureClipRectangles(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return RenderSetPictureClipRectanglesCookie{cookie} } -func (c *Conn) RenderSetPictureClipRectanglesChecked(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { +func (c *Conn) RenderSetPictureClipRectanglesChecked(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return RenderSetPictureClipRectanglesCookie{cookie} @@ -2011,7 +2033,7 @@ func (cook RenderSetPictureClipRectanglesCookie) Check() error { } // Write request to wire for RenderSetPictureClipRectangles -func (c *Conn) renderSetPictureClipRectanglesRequest(Picture Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { +func (c *Conn) renderSetPictureClipRectanglesRequest(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -2046,13 +2068,13 @@ type RenderFreePictureCookie struct { } // Write request to wire for RenderFreePicture -func (c *Conn) RenderFreePicture(Picture Id) RenderFreePictureCookie { +func (c *Conn) RenderFreePicture(Picture RenderPicture) RenderFreePictureCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderFreePictureRequest(Picture), cookie) return RenderFreePictureCookie{cookie} } -func (c *Conn) RenderFreePictureChecked(Picture Id) RenderFreePictureCookie { +func (c *Conn) RenderFreePictureChecked(Picture RenderPicture) RenderFreePictureCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderFreePictureRequest(Picture), cookie) return RenderFreePictureCookie{cookie} @@ -2063,7 +2085,7 @@ func (cook RenderFreePictureCookie) Check() error { } // Write request to wire for RenderFreePicture -func (c *Conn) renderFreePictureRequest(Picture Id) []byte { +func (c *Conn) renderFreePictureRequest(Picture RenderPicture) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2090,13 +2112,13 @@ type RenderCompositeCookie struct { } // Write request to wire for RenderComposite -func (c *Conn) RenderComposite(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { +func (c *Conn) RenderComposite(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return RenderCompositeCookie{cookie} } -func (c *Conn) RenderCompositeChecked(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { +func (c *Conn) RenderCompositeChecked(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return RenderCompositeCookie{cookie} @@ -2107,7 +2129,7 @@ func (cook RenderCompositeCookie) Check() error { } // Write request to wire for RenderComposite -func (c *Conn) renderCompositeRequest(Op byte, Src Id, Mask Id, Dst Id, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { +func (c *Conn) renderCompositeRequest(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 36 b := 0 buf := make([]byte, size) @@ -2169,13 +2191,13 @@ type RenderTrapezoidsCookie struct { } // Write request to wire for RenderTrapezoids -func (c *Conn) RenderTrapezoids(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { +func (c *Conn) RenderTrapezoids(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return RenderTrapezoidsCookie{cookie} } -func (c *Conn) RenderTrapezoidsChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { +func (c *Conn) RenderTrapezoidsChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return RenderTrapezoidsCookie{cookie} @@ -2186,7 +2208,7 @@ func (cook RenderTrapezoidsCookie) Check() error { } // Write request to wire for RenderTrapezoids -func (c *Conn) renderTrapezoidsRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Traps []RenderTrapezoid) []byte { +func (c *Conn) renderTrapezoidsRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) []byte { size := pad((24 + pad((len(Traps) * 40)))) b := 0 buf := make([]byte, size) @@ -2232,13 +2254,13 @@ type RenderTrianglesCookie struct { } // Write request to wire for RenderTriangles -func (c *Conn) RenderTriangles(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { +func (c *Conn) RenderTriangles(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return RenderTrianglesCookie{cookie} } -func (c *Conn) RenderTrianglesChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { +func (c *Conn) RenderTrianglesChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return RenderTrianglesCookie{cookie} @@ -2249,7 +2271,7 @@ func (cook RenderTrianglesCookie) Check() error { } // Write request to wire for RenderTriangles -func (c *Conn) renderTrianglesRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Triangles []RenderTriangle) []byte { +func (c *Conn) renderTrianglesRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) []byte { size := pad((24 + pad((len(Triangles) * 24)))) b := 0 buf := make([]byte, size) @@ -2295,13 +2317,13 @@ type RenderTriStripCookie struct { } // Write request to wire for RenderTriStrip -func (c *Conn) RenderTriStrip(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { +func (c *Conn) RenderTriStrip(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return RenderTriStripCookie{cookie} } -func (c *Conn) RenderTriStripChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { +func (c *Conn) RenderTriStripChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return RenderTriStripCookie{cookie} @@ -2312,7 +2334,7 @@ func (cook RenderTriStripCookie) Check() error { } // Write request to wire for RenderTriStrip -func (c *Conn) renderTriStripRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { +func (c *Conn) renderTriStripRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { size := pad((24 + pad((len(Points) * 8)))) b := 0 buf := make([]byte, size) @@ -2358,13 +2380,13 @@ type RenderTriFanCookie struct { } // Write request to wire for RenderTriFan -func (c *Conn) RenderTriFan(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { +func (c *Conn) RenderTriFan(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return RenderTriFanCookie{cookie} } -func (c *Conn) RenderTriFanChecked(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { +func (c *Conn) RenderTriFanChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return RenderTriFanCookie{cookie} @@ -2375,7 +2397,7 @@ func (cook RenderTriFanCookie) Check() error { } // Write request to wire for RenderTriFan -func (c *Conn) renderTriFanRequest(Op byte, Src Id, Dst Id, MaskFormat Id, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { +func (c *Conn) renderTriFanRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { size := pad((24 + pad((len(Points) * 8)))) b := 0 buf := make([]byte, size) @@ -2421,13 +2443,13 @@ type RenderCreateGlyphSetCookie struct { } // Write request to wire for RenderCreateGlyphSet -func (c *Conn) RenderCreateGlyphSet(Gsid Id, Format Id) RenderCreateGlyphSetCookie { +func (c *Conn) RenderCreateGlyphSet(Gsid RenderGlyphset, Format RenderPictformat) RenderCreateGlyphSetCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) return RenderCreateGlyphSetCookie{cookie} } -func (c *Conn) RenderCreateGlyphSetChecked(Gsid Id, Format Id) RenderCreateGlyphSetCookie { +func (c *Conn) RenderCreateGlyphSetChecked(Gsid RenderGlyphset, Format RenderPictformat) RenderCreateGlyphSetCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) return RenderCreateGlyphSetCookie{cookie} @@ -2438,7 +2460,7 @@ func (cook RenderCreateGlyphSetCookie) Check() error { } // Write request to wire for RenderCreateGlyphSet -func (c *Conn) renderCreateGlyphSetRequest(Gsid Id, Format Id) []byte { +func (c *Conn) renderCreateGlyphSetRequest(Gsid RenderGlyphset, Format RenderPictformat) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2468,13 +2490,13 @@ type RenderReferenceGlyphSetCookie struct { } // Write request to wire for RenderReferenceGlyphSet -func (c *Conn) RenderReferenceGlyphSet(Gsid Id, Existing Id) RenderReferenceGlyphSetCookie { +func (c *Conn) RenderReferenceGlyphSet(Gsid RenderGlyphset, Existing RenderGlyphset) RenderReferenceGlyphSetCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) return RenderReferenceGlyphSetCookie{cookie} } -func (c *Conn) RenderReferenceGlyphSetChecked(Gsid Id, Existing Id) RenderReferenceGlyphSetCookie { +func (c *Conn) RenderReferenceGlyphSetChecked(Gsid RenderGlyphset, Existing RenderGlyphset) RenderReferenceGlyphSetCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) return RenderReferenceGlyphSetCookie{cookie} @@ -2485,7 +2507,7 @@ func (cook RenderReferenceGlyphSetCookie) Check() error { } // Write request to wire for RenderReferenceGlyphSet -func (c *Conn) renderReferenceGlyphSetRequest(Gsid Id, Existing Id) []byte { +func (c *Conn) renderReferenceGlyphSetRequest(Gsid RenderGlyphset, Existing RenderGlyphset) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2515,13 +2537,13 @@ type RenderFreeGlyphSetCookie struct { } // Write request to wire for RenderFreeGlyphSet -func (c *Conn) RenderFreeGlyphSet(Glyphset Id) RenderFreeGlyphSetCookie { +func (c *Conn) RenderFreeGlyphSet(Glyphset RenderGlyphset) RenderFreeGlyphSetCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) return RenderFreeGlyphSetCookie{cookie} } -func (c *Conn) RenderFreeGlyphSetChecked(Glyphset Id) RenderFreeGlyphSetCookie { +func (c *Conn) RenderFreeGlyphSetChecked(Glyphset RenderGlyphset) RenderFreeGlyphSetCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) return RenderFreeGlyphSetCookie{cookie} @@ -2532,7 +2554,7 @@ func (cook RenderFreeGlyphSetCookie) Check() error { } // Write request to wire for RenderFreeGlyphSet -func (c *Conn) renderFreeGlyphSetRequest(Glyphset Id) []byte { +func (c *Conn) renderFreeGlyphSetRequest(Glyphset RenderGlyphset) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2559,13 +2581,13 @@ type RenderAddGlyphsCookie struct { } // Write request to wire for RenderAddGlyphs -func (c *Conn) RenderAddGlyphs(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { +func (c *Conn) RenderAddGlyphs(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return RenderAddGlyphsCookie{cookie} } -func (c *Conn) RenderAddGlyphsChecked(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { +func (c *Conn) RenderAddGlyphsChecked(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return RenderAddGlyphsCookie{cookie} @@ -2576,7 +2598,7 @@ func (cook RenderAddGlyphsCookie) Check() error { } // Write request to wire for RenderAddGlyphs -func (c *Conn) renderAddGlyphsRequest(Glyphset Id, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) []byte { +func (c *Conn) renderAddGlyphsRequest(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) []byte { size := pad((((12 + pad((int(GlyphsLen) * 4))) + pad((int(GlyphsLen) * 12))) + pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -2617,13 +2639,13 @@ type RenderFreeGlyphsCookie struct { } // Write request to wire for RenderFreeGlyphs -func (c *Conn) RenderFreeGlyphs(Glyphset Id, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { +func (c *Conn) RenderFreeGlyphs(Glyphset RenderGlyphset, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) return RenderFreeGlyphsCookie{cookie} } -func (c *Conn) RenderFreeGlyphsChecked(Glyphset Id, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { +func (c *Conn) RenderFreeGlyphsChecked(Glyphset RenderGlyphset, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) return RenderFreeGlyphsCookie{cookie} @@ -2634,7 +2656,7 @@ func (cook RenderFreeGlyphsCookie) Check() error { } // Write request to wire for RenderFreeGlyphs -func (c *Conn) renderFreeGlyphsRequest(Glyphset Id, Glyphs []RenderGlyph) []byte { +func (c *Conn) renderFreeGlyphsRequest(Glyphset RenderGlyphset, Glyphs []RenderGlyph) []byte { size := pad((8 + pad((len(Glyphs) * 4)))) b := 0 buf := make([]byte, size) @@ -2667,13 +2689,13 @@ type RenderCompositeGlyphs8Cookie struct { } // Write request to wire for RenderCompositeGlyphs8 -func (c *Conn) RenderCompositeGlyphs8(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { +func (c *Conn) RenderCompositeGlyphs8(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs8Cookie{cookie} } -func (c *Conn) RenderCompositeGlyphs8Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { +func (c *Conn) RenderCompositeGlyphs8Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs8Cookie{cookie} @@ -2684,7 +2706,7 @@ func (cook RenderCompositeGlyphs8Cookie) Check() error { } // Write request to wire for RenderCompositeGlyphs8 -func (c *Conn) renderCompositeGlyphs8Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { +func (c *Conn) renderCompositeGlyphs8Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := pad((28 + pad((len(Glyphcmds) * 1)))) b := 0 buf := make([]byte, size) @@ -2734,13 +2756,13 @@ type RenderCompositeGlyphs16Cookie struct { } // Write request to wire for RenderCompositeGlyphs16 -func (c *Conn) RenderCompositeGlyphs16(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { +func (c *Conn) RenderCompositeGlyphs16(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs16Cookie{cookie} } -func (c *Conn) RenderCompositeGlyphs16Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { +func (c *Conn) RenderCompositeGlyphs16Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs16Cookie{cookie} @@ -2751,7 +2773,7 @@ func (cook RenderCompositeGlyphs16Cookie) Check() error { } // Write request to wire for RenderCompositeGlyphs16 -func (c *Conn) renderCompositeGlyphs16Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { +func (c *Conn) renderCompositeGlyphs16Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := pad((28 + pad((len(Glyphcmds) * 1)))) b := 0 buf := make([]byte, size) @@ -2801,13 +2823,13 @@ type RenderCompositeGlyphs32Cookie struct { } // Write request to wire for RenderCompositeGlyphs32 -func (c *Conn) RenderCompositeGlyphs32(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { +func (c *Conn) RenderCompositeGlyphs32(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs32Cookie{cookie} } -func (c *Conn) RenderCompositeGlyphs32Checked(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { +func (c *Conn) RenderCompositeGlyphs32Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return RenderCompositeGlyphs32Cookie{cookie} @@ -2818,7 +2840,7 @@ func (cook RenderCompositeGlyphs32Cookie) Check() error { } // Write request to wire for RenderCompositeGlyphs32 -func (c *Conn) renderCompositeGlyphs32Request(Op byte, Src Id, Dst Id, MaskFormat Id, Glyphset Id, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { +func (c *Conn) renderCompositeGlyphs32Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := pad((28 + pad((len(Glyphcmds) * 1)))) b := 0 buf := make([]byte, size) @@ -2868,13 +2890,13 @@ type RenderFillRectanglesCookie struct { } // Write request to wire for RenderFillRectangles -func (c *Conn) RenderFillRectangles(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { +func (c *Conn) RenderFillRectangles(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) return RenderFillRectanglesCookie{cookie} } -func (c *Conn) RenderFillRectanglesChecked(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { +func (c *Conn) RenderFillRectanglesChecked(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) return RenderFillRectanglesCookie{cookie} @@ -2885,7 +2907,7 @@ func (cook RenderFillRectanglesCookie) Check() error { } // Write request to wire for RenderFillRectangles -func (c *Conn) renderFillRectanglesRequest(Op byte, Dst Id, Color RenderColor, Rects []Rectangle) []byte { +func (c *Conn) renderFillRectanglesRequest(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) []byte { size := pad((20 + pad((len(Rects) * 8)))) b := 0 buf := make([]byte, size) @@ -2925,13 +2947,13 @@ type RenderCreateCursorCookie struct { } // Write request to wire for RenderCreateCursor -func (c *Conn) RenderCreateCursor(Cid Id, Source Id, X uint16, Y uint16) RenderCreateCursorCookie { +func (c *Conn) RenderCreateCursor(Cid Cursor, Source RenderPicture, X uint16, Y uint16) RenderCreateCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) return RenderCreateCursorCookie{cookie} } -func (c *Conn) RenderCreateCursorChecked(Cid Id, Source Id, X uint16, Y uint16) RenderCreateCursorCookie { +func (c *Conn) RenderCreateCursorChecked(Cid Cursor, Source RenderPicture, X uint16, Y uint16) RenderCreateCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) return RenderCreateCursorCookie{cookie} @@ -2942,7 +2964,7 @@ func (cook RenderCreateCursorCookie) Check() error { } // Write request to wire for RenderCreateCursor -func (c *Conn) renderCreateCursorRequest(Cid Id, Source Id, X uint16, Y uint16) []byte { +func (c *Conn) renderCreateCursorRequest(Cid Cursor, Source RenderPicture, X uint16, Y uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -2978,13 +3000,13 @@ type RenderSetPictureTransformCookie struct { } // Write request to wire for RenderSetPictureTransform -func (c *Conn) RenderSetPictureTransform(Picture Id, Transform RenderTransform) RenderSetPictureTransformCookie { +func (c *Conn) RenderSetPictureTransform(Picture RenderPicture, Transform RenderTransform) RenderSetPictureTransformCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) return RenderSetPictureTransformCookie{cookie} } -func (c *Conn) RenderSetPictureTransformChecked(Picture Id, Transform RenderTransform) RenderSetPictureTransformCookie { +func (c *Conn) RenderSetPictureTransformChecked(Picture RenderPicture, Transform RenderTransform) RenderSetPictureTransformCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) return RenderSetPictureTransformCookie{cookie} @@ -2995,7 +3017,7 @@ func (cook RenderSetPictureTransformCookie) Check() error { } // Write request to wire for RenderSetPictureTransform -func (c *Conn) renderSetPictureTransformRequest(Picture Id, Transform RenderTransform) []byte { +func (c *Conn) renderSetPictureTransformRequest(Picture RenderPicture, Transform RenderTransform) []byte { size := 44 b := 0 buf := make([]byte, size) @@ -3027,13 +3049,13 @@ type RenderQueryFiltersCookie struct { *cookie } -func (c *Conn) RenderQueryFilters(Drawable Id) RenderQueryFiltersCookie { +func (c *Conn) RenderQueryFilters(Drawable Drawable) RenderQueryFiltersCookie { cookie := c.newCookie(true, true) c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) return RenderQueryFiltersCookie{cookie} } -func (c *Conn) RenderQueryFiltersUnchecked(Drawable Id) RenderQueryFiltersCookie { +func (c *Conn) RenderQueryFiltersUnchecked(Drawable Drawable) RenderQueryFiltersCookie { cookie := c.newCookie(false, true) c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) return RenderQueryFiltersCookie{cookie} @@ -3103,7 +3125,7 @@ func (cook RenderQueryFiltersCookie) Check() error { } // Write request to wire for RenderQueryFilters -func (c *Conn) renderQueryFiltersRequest(Drawable Id) []byte { +func (c *Conn) renderQueryFiltersRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -3130,13 +3152,13 @@ type RenderSetPictureFilterCookie struct { } // Write request to wire for RenderSetPictureFilter -func (c *Conn) RenderSetPictureFilter(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { +func (c *Conn) RenderSetPictureFilter(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) return RenderSetPictureFilterCookie{cookie} } -func (c *Conn) RenderSetPictureFilterChecked(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { +func (c *Conn) RenderSetPictureFilterChecked(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) return RenderSetPictureFilterCookie{cookie} @@ -3147,7 +3169,7 @@ func (cook RenderSetPictureFilterCookie) Check() error { } // Write request to wire for RenderSetPictureFilter -func (c *Conn) renderSetPictureFilterRequest(Picture Id, FilterLen uint16, Filter string, Values []RenderFixed) []byte { +func (c *Conn) renderSetPictureFilterRequest(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) []byte { size := pad(((12 + pad((int(FilterLen) * 1))) + pad((len(Values) * 4)))) b := 0 buf := make([]byte, size) @@ -3188,13 +3210,13 @@ type RenderCreateAnimCursorCookie struct { } // Write request to wire for RenderCreateAnimCursor -func (c *Conn) RenderCreateAnimCursor(Cid Id, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { +func (c *Conn) RenderCreateAnimCursor(Cid Cursor, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) return RenderCreateAnimCursorCookie{cookie} } -func (c *Conn) RenderCreateAnimCursorChecked(Cid Id, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { +func (c *Conn) RenderCreateAnimCursorChecked(Cid Cursor, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) return RenderCreateAnimCursorCookie{cookie} @@ -3205,7 +3227,7 @@ func (cook RenderCreateAnimCursorCookie) Check() error { } // Write request to wire for RenderCreateAnimCursor -func (c *Conn) renderCreateAnimCursorRequest(Cid Id, Cursors []RenderAnimcursorelt) []byte { +func (c *Conn) renderCreateAnimCursorRequest(Cid Cursor, Cursors []RenderAnimcursorelt) []byte { size := pad((8 + pad((len(Cursors) * 8)))) b := 0 buf := make([]byte, size) @@ -3234,13 +3256,13 @@ type RenderAddTrapsCookie struct { } // Write request to wire for RenderAddTraps -func (c *Conn) RenderAddTraps(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { +func (c *Conn) RenderAddTraps(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) return RenderAddTrapsCookie{cookie} } -func (c *Conn) RenderAddTrapsChecked(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { +func (c *Conn) RenderAddTrapsChecked(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) return RenderAddTrapsCookie{cookie} @@ -3251,7 +3273,7 @@ func (cook RenderAddTrapsCookie) Check() error { } // Write request to wire for RenderAddTraps -func (c *Conn) renderAddTrapsRequest(Picture Id, XOff int16, YOff int16, Traps []RenderTrap) []byte { +func (c *Conn) renderAddTrapsRequest(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) []byte { size := pad((12 + pad((len(Traps) * 24)))) b := 0 buf := make([]byte, size) @@ -3286,13 +3308,13 @@ type RenderCreateSolidFillCookie struct { } // Write request to wire for RenderCreateSolidFill -func (c *Conn) RenderCreateSolidFill(Picture Id, Color RenderColor) RenderCreateSolidFillCookie { +func (c *Conn) RenderCreateSolidFill(Picture RenderPicture, Color RenderColor) RenderCreateSolidFillCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) return RenderCreateSolidFillCookie{cookie} } -func (c *Conn) RenderCreateSolidFillChecked(Picture Id, Color RenderColor) RenderCreateSolidFillCookie { +func (c *Conn) RenderCreateSolidFillChecked(Picture RenderPicture, Color RenderColor) RenderCreateSolidFillCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) return RenderCreateSolidFillCookie{cookie} @@ -3303,7 +3325,7 @@ func (cook RenderCreateSolidFillCookie) Check() error { } // Write request to wire for RenderCreateSolidFill -func (c *Conn) renderCreateSolidFillRequest(Picture Id, Color RenderColor) []byte { +func (c *Conn) renderCreateSolidFillRequest(Picture RenderPicture, Color RenderColor) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -3336,13 +3358,13 @@ type RenderCreateLinearGradientCookie struct { } // Write request to wire for RenderCreateLinearGradient -func (c *Conn) RenderCreateLinearGradient(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { +func (c *Conn) RenderCreateLinearGradient(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) return RenderCreateLinearGradientCookie{cookie} } -func (c *Conn) RenderCreateLinearGradientChecked(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { +func (c *Conn) RenderCreateLinearGradientChecked(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) return RenderCreateLinearGradientCookie{cookie} @@ -3353,7 +3375,7 @@ func (cook RenderCreateLinearGradientCookie) Check() error { } // Write request to wire for RenderCreateLinearGradient -func (c *Conn) renderCreateLinearGradientRequest(Picture Id, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { +func (c *Conn) renderCreateLinearGradientRequest(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { size := pad(((28 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -3403,13 +3425,13 @@ type RenderCreateRadialGradientCookie struct { } // Write request to wire for RenderCreateRadialGradient -func (c *Conn) RenderCreateRadialGradient(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { +func (c *Conn) RenderCreateRadialGradient(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return RenderCreateRadialGradientCookie{cookie} } -func (c *Conn) RenderCreateRadialGradientChecked(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { +func (c *Conn) RenderCreateRadialGradientChecked(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return RenderCreateRadialGradientCookie{cookie} @@ -3420,7 +3442,7 @@ func (cook RenderCreateRadialGradientCookie) Check() error { } // Write request to wire for RenderCreateRadialGradient -func (c *Conn) renderCreateRadialGradientRequest(Picture Id, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { +func (c *Conn) renderCreateRadialGradientRequest(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { size := pad(((36 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -3476,13 +3498,13 @@ type RenderCreateConicalGradientCookie struct { } // Write request to wire for RenderCreateConicalGradient -func (c *Conn) RenderCreateConicalGradient(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { +func (c *Conn) RenderCreateConicalGradient(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { cookie := c.newCookie(false, false) c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) return RenderCreateConicalGradientCookie{cookie} } -func (c *Conn) RenderCreateConicalGradientChecked(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { +func (c *Conn) RenderCreateConicalGradientChecked(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { cookie := c.newCookie(true, false) c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) return RenderCreateConicalGradientCookie{cookie} @@ -3493,7 +3515,7 @@ func (cook RenderCreateConicalGradientCookie) Check() error { } // Write request to wire for RenderCreateConicalGradient -func (c *Conn) renderCreateConicalGradientRequest(Picture Id, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { +func (c *Conn) renderCreateConicalGradientRequest(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { size := pad(((24 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go index 3aca143..a2f9914 100644 --- a/nexgb/auto_res.go +++ b/nexgb/auto_res.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by res.xml on May 8 2012 11:03:24pm EDT. + This file was generated by res.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,12 +37,20 @@ func init() { newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -53,16 +61,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - // 'ResClient' struct definition // Size: 8 type ResClient struct { @@ -122,7 +120,7 @@ func ResClientListBytes(buf []byte, list []ResClient) int { // 'ResType' struct definition // Size: 8 type ResType struct { - ResourceType Id + ResourceType Atom Count uint32 } @@ -130,7 +128,7 @@ type ResType struct { func ReadResType(buf []byte, v *ResType) int { b := 0 - v.ResourceType = Id(Get32(buf[b:])) + v.ResourceType = Atom(Get32(buf[b:])) b += 4 v.Count = Get32(buf[b:]) diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go index 9bb8d13..4f6fea0 100644 --- a/nexgb/auto_screensaver.go +++ b/nexgb/auto_screensaver.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by screensaver.xml on May 8 2012 11:03:24pm EDT. + This file was generated by screensaver.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -51,18 +61,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( ScreensaverKindBlanked = 0 ScreensaverKindInternal = 1 @@ -93,8 +91,8 @@ type ScreensaverNotifyEvent struct { // padding: 1 bytes SequenceNumber uint16 Time Timestamp - Root Id - Window Id + Root Window + Window Window Kind byte Forced bool // padding: 14 bytes @@ -122,10 +120,10 @@ func NewScreensaverNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.Kind = buf[b] @@ -314,13 +312,13 @@ type ScreensaverQueryInfoCookie struct { *cookie } -func (c *Conn) ScreensaverQueryInfo(Drawable Id) ScreensaverQueryInfoCookie { +func (c *Conn) ScreensaverQueryInfo(Drawable Drawable) ScreensaverQueryInfoCookie { cookie := c.newCookie(true, true) c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) return ScreensaverQueryInfoCookie{cookie} } -func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Id) ScreensaverQueryInfoCookie { +func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Drawable) ScreensaverQueryInfoCookie { cookie := c.newCookie(false, true) c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) return ScreensaverQueryInfoCookie{cookie} @@ -332,7 +330,7 @@ type ScreensaverQueryInfoReply struct { Sequence uint16 Length uint32 State byte - SaverWindow Id + SaverWindow Window MsUntilServer uint32 MsSinceUserInput uint32 EventMask uint32 @@ -366,7 +364,7 @@ func screensaverQueryInfoReply(buf []byte) *ScreensaverQueryInfoReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.SaverWindow = Id(Get32(buf[b:])) + v.SaverWindow = Window(Get32(buf[b:])) b += 4 v.MsUntilServer = Get32(buf[b:]) @@ -391,7 +389,7 @@ func (cook ScreensaverQueryInfoCookie) Check() error { } // Write request to wire for ScreensaverQueryInfo -func (c *Conn) screensaverQueryInfoRequest(Drawable Id) []byte { +func (c *Conn) screensaverQueryInfoRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -418,13 +416,13 @@ type ScreensaverSelectInputCookie struct { } // Write request to wire for ScreensaverSelectInput -func (c *Conn) ScreensaverSelectInput(Drawable Id, EventMask uint32) ScreensaverSelectInputCookie { +func (c *Conn) ScreensaverSelectInput(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) return ScreensaverSelectInputCookie{cookie} } -func (c *Conn) ScreensaverSelectInputChecked(Drawable Id, EventMask uint32) ScreensaverSelectInputCookie { +func (c *Conn) ScreensaverSelectInputChecked(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) return ScreensaverSelectInputCookie{cookie} @@ -435,7 +433,7 @@ func (cook ScreensaverSelectInputCookie) Check() error { } // Write request to wire for ScreensaverSelectInput -func (c *Conn) screensaverSelectInputRequest(Drawable Id, EventMask uint32) []byte { +func (c *Conn) screensaverSelectInputRequest(Drawable Drawable, EventMask uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -465,13 +463,13 @@ type ScreensaverSetAttributesCookie struct { } // Write request to wire for ScreensaverSetAttributes -func (c *Conn) ScreensaverSetAttributes(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { +func (c *Conn) ScreensaverSetAttributes(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { cookie := c.newCookie(false, false) c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return ScreensaverSetAttributesCookie{cookie} } -func (c *Conn) ScreensaverSetAttributesChecked(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { +func (c *Conn) ScreensaverSetAttributesChecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { cookie := c.newCookie(true, false) c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return ScreensaverSetAttributesCookie{cookie} @@ -482,7 +480,7 @@ func (cook ScreensaverSetAttributesCookie) Check() error { } // Write request to wire for ScreensaverSetAttributes -func (c *Conn) screensaverSetAttributesRequest(Drawable Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) screensaverSetAttributesRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := pad((24 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -541,13 +539,13 @@ type ScreensaverUnsetAttributesCookie struct { } // Write request to wire for ScreensaverUnsetAttributes -func (c *Conn) ScreensaverUnsetAttributes(Drawable Id) ScreensaverUnsetAttributesCookie { +func (c *Conn) ScreensaverUnsetAttributes(Drawable Drawable) ScreensaverUnsetAttributesCookie { cookie := c.newCookie(false, false) c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) return ScreensaverUnsetAttributesCookie{cookie} } -func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Id) ScreensaverUnsetAttributesCookie { +func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Drawable) ScreensaverUnsetAttributesCookie { cookie := c.newCookie(true, false) c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) return ScreensaverUnsetAttributesCookie{cookie} @@ -558,7 +556,7 @@ func (cook ScreensaverUnsetAttributesCookie) Check() error { } // Write request to wire for ScreensaverUnsetAttributes -func (c *Conn) screensaverUnsetAttributesRequest(Drawable Id) []byte { +func (c *Conn) screensaverUnsetAttributesRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go index bad291a..90d67cf 100644 --- a/nexgb/auto_shape.go +++ b/nexgb/auto_shape.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shape.xml on May 8 2012 11:03:24pm EDT. + This file was generated by shape.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,14 @@ func init() { newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -51,18 +59,8 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( ShapeSoSet = 0 ShapeSoUnion = 1 @@ -89,7 +87,7 @@ const ShapeNotify = 0 type ShapeNotifyEvent struct { Sequence uint16 ShapeKind ShapeKind - AffectedWindow Id + AffectedWindow Window ExtentsX int16 ExtentsY int16 ExtentsWidth uint16 @@ -110,7 +108,7 @@ func NewShapeNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.AffectedWindow = Id(Get32(buf[b:])) + v.AffectedWindow = Window(Get32(buf[b:])) b += 4 v.ExtentsX = int16(Get16(buf[b:])) @@ -299,13 +297,13 @@ type ShapeRectanglesCookie struct { } // Write request to wire for ShapeRectangles -func (c *Conn) ShapeRectangles(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { +func (c *Conn) ShapeRectangles(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { cookie := c.newCookie(false, false) c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return ShapeRectanglesCookie{cookie} } -func (c *Conn) ShapeRectanglesChecked(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { +func (c *Conn) ShapeRectanglesChecked(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { cookie := c.newCookie(true, false) c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return ShapeRectanglesCookie{cookie} @@ -316,7 +314,7 @@ func (cook ShapeRectanglesCookie) Check() error { } // Write request to wire for ShapeRectangles -func (c *Conn) shapeRectanglesRequest(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Id, XOffset int16, YOffset int16, Rectangles []Rectangle) []byte { +func (c *Conn) shapeRectanglesRequest(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) []byte { size := pad((16 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -362,13 +360,13 @@ type ShapeMaskCookie struct { } // Write request to wire for ShapeMask -func (c *Conn) ShapeMask(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) ShapeMaskCookie { +func (c *Conn) ShapeMask(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie { cookie := c.newCookie(false, false) c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return ShapeMaskCookie{cookie} } -func (c *Conn) ShapeMaskChecked(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) ShapeMaskCookie { +func (c *Conn) ShapeMaskChecked(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie { cookie := c.newCookie(true, false) c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return ShapeMaskCookie{cookie} @@ -379,7 +377,7 @@ func (cook ShapeMaskCookie) Check() error { } // Write request to wire for ShapeMask -func (c *Conn) shapeMaskRequest(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceBitmap Id) []byte { +func (c *Conn) shapeMaskRequest(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -423,13 +421,13 @@ type ShapeCombineCookie struct { } // Write request to wire for ShapeCombine -func (c *Conn) ShapeCombine(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) ShapeCombineCookie { +func (c *Conn) ShapeCombine(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie { cookie := c.newCookie(false, false) c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return ShapeCombineCookie{cookie} } -func (c *Conn) ShapeCombineChecked(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) ShapeCombineCookie { +func (c *Conn) ShapeCombineChecked(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie { cookie := c.newCookie(true, false) c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return ShapeCombineCookie{cookie} @@ -440,7 +438,7 @@ func (cook ShapeCombineCookie) Check() error { } // Write request to wire for ShapeCombine -func (c *Conn) shapeCombineRequest(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16, SourceWindow Id) []byte { +func (c *Conn) shapeCombineRequest(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -487,13 +485,13 @@ type ShapeOffsetCookie struct { } // Write request to wire for ShapeOffset -func (c *Conn) ShapeOffset(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) ShapeOffsetCookie { +func (c *Conn) ShapeOffset(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie { cookie := c.newCookie(false, false) c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return ShapeOffsetCookie{cookie} } -func (c *Conn) ShapeOffsetChecked(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) ShapeOffsetCookie { +func (c *Conn) ShapeOffsetChecked(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie { cookie := c.newCookie(true, false) c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return ShapeOffsetCookie{cookie} @@ -504,7 +502,7 @@ func (cook ShapeOffsetCookie) Check() error { } // Write request to wire for ShapeOffset -func (c *Conn) shapeOffsetRequest(DestinationKind ShapeKind, DestinationWindow Id, XOffset int16, YOffset int16) []byte { +func (c *Conn) shapeOffsetRequest(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -541,13 +539,13 @@ type ShapeQueryExtentsCookie struct { *cookie } -func (c *Conn) ShapeQueryExtents(DestinationWindow Id) ShapeQueryExtentsCookie { +func (c *Conn) ShapeQueryExtents(DestinationWindow Window) ShapeQueryExtentsCookie { cookie := c.newCookie(true, true) c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) return ShapeQueryExtentsCookie{cookie} } -func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Id) ShapeQueryExtentsCookie { +func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Window) ShapeQueryExtentsCookie { cookie := c.newCookie(false, true) c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) return ShapeQueryExtentsCookie{cookie} @@ -645,7 +643,7 @@ func (cook ShapeQueryExtentsCookie) Check() error { } // Write request to wire for ShapeQueryExtents -func (c *Conn) shapeQueryExtentsRequest(DestinationWindow Id) []byte { +func (c *Conn) shapeQueryExtentsRequest(DestinationWindow Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -672,13 +670,13 @@ type ShapeSelectInputCookie struct { } // Write request to wire for ShapeSelectInput -func (c *Conn) ShapeSelectInput(DestinationWindow Id, Enable bool) ShapeSelectInputCookie { +func (c *Conn) ShapeSelectInput(DestinationWindow Window, Enable bool) ShapeSelectInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) return ShapeSelectInputCookie{cookie} } -func (c *Conn) ShapeSelectInputChecked(DestinationWindow Id, Enable bool) ShapeSelectInputCookie { +func (c *Conn) ShapeSelectInputChecked(DestinationWindow Window, Enable bool) ShapeSelectInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) return ShapeSelectInputCookie{cookie} @@ -689,7 +687,7 @@ func (cook ShapeSelectInputCookie) Check() error { } // Write request to wire for ShapeSelectInput -func (c *Conn) shapeSelectInputRequest(DestinationWindow Id, Enable bool) []byte { +func (c *Conn) shapeSelectInputRequest(DestinationWindow Window, Enable bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -724,13 +722,13 @@ type ShapeInputSelectedCookie struct { *cookie } -func (c *Conn) ShapeInputSelected(DestinationWindow Id) ShapeInputSelectedCookie { +func (c *Conn) ShapeInputSelected(DestinationWindow Window) ShapeInputSelectedCookie { cookie := c.newCookie(true, true) c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) return ShapeInputSelectedCookie{cookie} } -func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Id) ShapeInputSelectedCookie { +func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Window) ShapeInputSelectedCookie { cookie := c.newCookie(false, true) c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) return ShapeInputSelectedCookie{cookie} @@ -782,7 +780,7 @@ func (cook ShapeInputSelectedCookie) Check() error { } // Write request to wire for ShapeInputSelected -func (c *Conn) shapeInputSelectedRequest(DestinationWindow Id) []byte { +func (c *Conn) shapeInputSelectedRequest(DestinationWindow Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -808,13 +806,13 @@ type ShapeGetRectanglesCookie struct { *cookie } -func (c *Conn) ShapeGetRectangles(Window Id, SourceKind ShapeKind) ShapeGetRectanglesCookie { +func (c *Conn) ShapeGetRectangles(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie { cookie := c.newCookie(true, true) c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) return ShapeGetRectanglesCookie{cookie} } -func (c *Conn) ShapeGetRectanglesUnchecked(Window Id, SourceKind ShapeKind) ShapeGetRectanglesCookie { +func (c *Conn) ShapeGetRectanglesUnchecked(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie { cookie := c.newCookie(false, true) c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) return ShapeGetRectanglesCookie{cookie} @@ -873,7 +871,7 @@ func (cook ShapeGetRectanglesCookie) Check() error { } // Write request to wire for ShapeGetRectangles -func (c *Conn) shapeGetRectanglesRequest(Window Id, SourceKind ShapeKind) []byte { +func (c *Conn) shapeGetRectanglesRequest(Window Window, SourceKind ShapeKind) []byte { size := 12 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go index a3dfcf7..392c5ff 100644 --- a/nexgb/auto_shm.go +++ b/nexgb/auto_shm.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by shm.xml on May 8 2012 11:03:24pm EDT. + This file was generated by shm.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,18 +37,6 @@ func init() { newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -61,9 +49,27 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' -// Skipping resource definition of 'Seg' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +type ShmSeg uint32 + +func (c *Conn) NewShmSegId() (ShmSeg, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return ShmSeg(id), nil +} // Event definition ShmCompletion (0) // Size: 32 @@ -73,11 +79,11 @@ const ShmCompletion = 0 type ShmCompletionEvent struct { Sequence uint16 // padding: 1 bytes - Drawable Id + Drawable Drawable MinorEvent uint16 MajorEvent byte // padding: 1 bytes - Shmseg Id + Shmseg ShmSeg Offset uint32 } @@ -91,7 +97,7 @@ func NewShmCompletionEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 v.MinorEvent = Get16(buf[b:]) @@ -102,7 +108,7 @@ func NewShmCompletionEvent(buf []byte) Event { b += 1 // padding - v.Shmseg = Id(Get32(buf[b:])) + v.Shmseg = ShmSeg(Get32(buf[b:])) b += 4 v.Offset = Get32(buf[b:]) @@ -183,8 +189,8 @@ func (err ShmBadSegError) SequenceId() uint16 { return err.Sequence } -func (err ShmBadSegError) BadId() Id { - return Id(err.BadValue) +func (err ShmBadSegError) BadId() uint32 { + return 0 } func (err ShmBadSegError) Error() string { @@ -312,13 +318,13 @@ type ShmAttachCookie struct { } // Write request to wire for ShmAttach -func (c *Conn) ShmAttach(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie { +func (c *Conn) ShmAttach(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie { cookie := c.newCookie(false, false) c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) return ShmAttachCookie{cookie} } -func (c *Conn) ShmAttachChecked(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie { +func (c *Conn) ShmAttachChecked(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie { cookie := c.newCookie(true, false) c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) return ShmAttachCookie{cookie} @@ -329,7 +335,7 @@ func (cook ShmAttachCookie) Check() error { } // Write request to wire for ShmAttach -func (c *Conn) shmAttachRequest(Shmseg Id, Shmid uint32, ReadOnly bool) []byte { +func (c *Conn) shmAttachRequest(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -368,13 +374,13 @@ type ShmDetachCookie struct { } // Write request to wire for ShmDetach -func (c *Conn) ShmDetach(Shmseg Id) ShmDetachCookie { +func (c *Conn) ShmDetach(Shmseg ShmSeg) ShmDetachCookie { cookie := c.newCookie(false, false) c.newRequest(c.shmDetachRequest(Shmseg), cookie) return ShmDetachCookie{cookie} } -func (c *Conn) ShmDetachChecked(Shmseg Id) ShmDetachCookie { +func (c *Conn) ShmDetachChecked(Shmseg ShmSeg) ShmDetachCookie { cookie := c.newCookie(true, false) c.newRequest(c.shmDetachRequest(Shmseg), cookie) return ShmDetachCookie{cookie} @@ -385,7 +391,7 @@ func (cook ShmDetachCookie) Check() error { } // Write request to wire for ShmDetach -func (c *Conn) shmDetachRequest(Shmseg Id) []byte { +func (c *Conn) shmDetachRequest(Shmseg ShmSeg) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -412,13 +418,13 @@ type ShmPutImageCookie struct { } // Write request to wire for ShmPutImage -func (c *Conn) ShmPutImage(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie { +func (c *Conn) ShmPutImage(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie { cookie := c.newCookie(false, false) c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return ShmPutImageCookie{cookie} } -func (c *Conn) ShmPutImageChecked(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie { +func (c *Conn) ShmPutImageChecked(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie { cookie := c.newCookie(true, false) c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return ShmPutImageCookie{cookie} @@ -429,7 +435,7 @@ func (cook ShmPutImageCookie) Check() error { } // Write request to wire for ShmPutImage -func (c *Conn) shmPutImageRequest(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) []byte { +func (c *Conn) shmPutImageRequest(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) []byte { size := 40 b := 0 buf := make([]byte, size) @@ -499,13 +505,13 @@ type ShmGetImageCookie struct { *cookie } -func (c *Conn) ShmGetImage(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie { +func (c *Conn) ShmGetImage(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie { cookie := c.newCookie(true, true) c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return ShmGetImageCookie{cookie} } -func (c *Conn) ShmGetImageUnchecked(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie { +func (c *Conn) ShmGetImageUnchecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie { cookie := c.newCookie(false, true) c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return ShmGetImageCookie{cookie} @@ -561,7 +567,7 @@ func (cook ShmGetImageCookie) Check() error { } // Write request to wire for ShmGetImage -func (c *Conn) shmGetImageRequest(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) []byte { +func (c *Conn) shmGetImageRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -614,13 +620,13 @@ type ShmCreatePixmapCookie struct { } // Write request to wire for ShmCreatePixmap -func (c *Conn) ShmCreatePixmap(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie { +func (c *Conn) ShmCreatePixmap(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return ShmCreatePixmapCookie{cookie} } -func (c *Conn) ShmCreatePixmapChecked(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie { +func (c *Conn) ShmCreatePixmapChecked(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return ShmCreatePixmapCookie{cookie} @@ -631,7 +637,7 @@ func (cook ShmCreatePixmapCookie) Check() error { } // Write request to wire for ShmCreatePixmap -func (c *Conn) shmCreatePixmapRequest(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) []byte { +func (c *Conn) shmCreatePixmapRequest(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) []byte { size := 28 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go index b043b9f..2fc2982 100644 --- a/nexgb/auto_sync.go +++ b/nexgb/auto_sync.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by sync.xml on May 8 2012 11:03:24pm EDT. + This file was generated by sync.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,18 +37,6 @@ func init() { newExtErrorFuncs["SYNC"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -61,7 +49,17 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' const ( SyncAlarmstateActive = 0 @@ -90,11 +88,35 @@ const ( SyncCaEvents = 32 ) -// Skipping resource definition of 'Alarm' +type SyncAlarm uint32 -// Skipping resource definition of 'Counter' +func (c *Conn) NewSyncAlarmId() (SyncAlarm, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return SyncAlarm(id), nil +} -// Skipping resource definition of 'Fence' +type SyncCounter uint32 + +func (c *Conn) NewSyncCounterId() (SyncCounter, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return SyncCounter(id), nil +} + +type SyncFence uint32 + +func (c *Conn) NewSyncFenceId() (SyncFence, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return SyncFence(id), nil +} // 'SyncInt64' struct definition // Size: 8 @@ -155,7 +177,7 @@ func SyncInt64ListBytes(buf []byte, list []SyncInt64) int { // 'SyncSystemcounter' struct definition // Size: (14 + pad((int(NameLen) * 1))) type SyncSystemcounter struct { - Counter Id + Counter SyncCounter Resolution SyncInt64 NameLen uint16 Name string // size: pad((int(NameLen) * 1)) @@ -165,7 +187,7 @@ type SyncSystemcounter struct { func ReadSyncSystemcounter(buf []byte, v *SyncSystemcounter) int { b := 0 - v.Counter = Id(Get32(buf[b:])) + v.Counter = SyncCounter(Get32(buf[b:])) b += 4 v.Resolution = SyncInt64{} @@ -241,7 +263,7 @@ func SyncSystemcounterListSize(list []SyncSystemcounter) int { // 'SyncTrigger' struct definition // Size: 20 type SyncTrigger struct { - Counter Id + Counter SyncCounter WaitType uint32 WaitValue SyncInt64 TestType uint32 @@ -251,7 +273,7 @@ type SyncTrigger struct { func ReadSyncTrigger(buf []byte, v *SyncTrigger) int { b := 0 - v.Counter = Id(Get32(buf[b:])) + v.Counter = SyncCounter(Get32(buf[b:])) b += 4 v.WaitType = Get32(buf[b:]) @@ -381,7 +403,7 @@ const SyncCounterNotify = 0 type SyncCounterNotifyEvent struct { Sequence uint16 Kind byte - Counter Id + Counter SyncCounter WaitValue SyncInt64 CounterValue SyncInt64 Timestamp Timestamp @@ -401,7 +423,7 @@ func NewSyncCounterNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Counter = Id(Get32(buf[b:])) + v.Counter = SyncCounter(Get32(buf[b:])) b += 4 v.WaitValue = SyncInt64{} @@ -504,7 +526,7 @@ const SyncAlarmNotify = 1 type SyncAlarmNotifyEvent struct { Sequence uint16 Kind byte - Alarm Id + Alarm SyncAlarm CounterValue SyncInt64 AlarmValue SyncInt64 Timestamp Timestamp @@ -523,7 +545,7 @@ func NewSyncAlarmNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Alarm = Id(Get32(buf[b:])) + v.Alarm = SyncAlarm(Get32(buf[b:])) b += 4 v.CounterValue = SyncInt64{} @@ -645,7 +667,7 @@ func (err SyncCounterError) SequenceId() uint16 { return err.Sequence } -func (err SyncCounterError) BadId() Id { +func (err SyncCounterError) BadId() uint32 { return 0 } @@ -705,7 +727,7 @@ func (err SyncAlarmError) SequenceId() uint16 { return err.Sequence } -func (err SyncAlarmError) BadId() Id { +func (err SyncAlarmError) BadId() uint32 { return 0 } @@ -910,13 +932,13 @@ type SyncCreateCounterCookie struct { } // Write request to wire for SyncCreateCounter -func (c *Conn) SyncCreateCounter(Id Id, InitialValue SyncInt64) SyncCreateCounterCookie { +func (c *Conn) SyncCreateCounter(Id SyncCounter, InitialValue SyncInt64) SyncCreateCounterCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) return SyncCreateCounterCookie{cookie} } -func (c *Conn) SyncCreateCounterChecked(Id Id, InitialValue SyncInt64) SyncCreateCounterCookie { +func (c *Conn) SyncCreateCounterChecked(Id SyncCounter, InitialValue SyncInt64) SyncCreateCounterCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) return SyncCreateCounterCookie{cookie} @@ -927,7 +949,7 @@ func (cook SyncCreateCounterCookie) Check() error { } // Write request to wire for SyncCreateCounter -func (c *Conn) syncCreateCounterRequest(Id Id, InitialValue SyncInt64) []byte { +func (c *Conn) syncCreateCounterRequest(Id SyncCounter, InitialValue SyncInt64) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -960,13 +982,13 @@ type SyncDestroyCounterCookie struct { } // Write request to wire for SyncDestroyCounter -func (c *Conn) SyncDestroyCounter(Counter Id) SyncDestroyCounterCookie { +func (c *Conn) SyncDestroyCounter(Counter SyncCounter) SyncDestroyCounterCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) return SyncDestroyCounterCookie{cookie} } -func (c *Conn) SyncDestroyCounterChecked(Counter Id) SyncDestroyCounterCookie { +func (c *Conn) SyncDestroyCounterChecked(Counter SyncCounter) SyncDestroyCounterCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) return SyncDestroyCounterCookie{cookie} @@ -977,7 +999,7 @@ func (cook SyncDestroyCounterCookie) Check() error { } // Write request to wire for SyncDestroyCounter -func (c *Conn) syncDestroyCounterRequest(Counter Id) []byte { +func (c *Conn) syncDestroyCounterRequest(Counter SyncCounter) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1003,13 +1025,13 @@ type SyncQueryCounterCookie struct { *cookie } -func (c *Conn) SyncQueryCounter(Counter Id) SyncQueryCounterCookie { +func (c *Conn) SyncQueryCounter(Counter SyncCounter) SyncQueryCounterCookie { cookie := c.newCookie(true, true) c.newRequest(c.syncQueryCounterRequest(Counter), cookie) return SyncQueryCounterCookie{cookie} } -func (c *Conn) SyncQueryCounterUnchecked(Counter Id) SyncQueryCounterCookie { +func (c *Conn) SyncQueryCounterUnchecked(Counter SyncCounter) SyncQueryCounterCookie { cookie := c.newCookie(false, true) c.newRequest(c.syncQueryCounterRequest(Counter), cookie) return SyncQueryCounterCookie{cookie} @@ -1060,7 +1082,7 @@ func (cook SyncQueryCounterCookie) Check() error { } // Write request to wire for SyncQueryCounter -func (c *Conn) syncQueryCounterRequest(Counter Id) []byte { +func (c *Conn) syncQueryCounterRequest(Counter SyncCounter) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1130,13 +1152,13 @@ type SyncChangeCounterCookie struct { } // Write request to wire for SyncChangeCounter -func (c *Conn) SyncChangeCounter(Counter Id, Amount SyncInt64) SyncChangeCounterCookie { +func (c *Conn) SyncChangeCounter(Counter SyncCounter, Amount SyncInt64) SyncChangeCounterCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) return SyncChangeCounterCookie{cookie} } -func (c *Conn) SyncChangeCounterChecked(Counter Id, Amount SyncInt64) SyncChangeCounterCookie { +func (c *Conn) SyncChangeCounterChecked(Counter SyncCounter, Amount SyncInt64) SyncChangeCounterCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) return SyncChangeCounterCookie{cookie} @@ -1147,7 +1169,7 @@ func (cook SyncChangeCounterCookie) Check() error { } // Write request to wire for SyncChangeCounter -func (c *Conn) syncChangeCounterRequest(Counter Id, Amount SyncInt64) []byte { +func (c *Conn) syncChangeCounterRequest(Counter SyncCounter, Amount SyncInt64) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1180,13 +1202,13 @@ type SyncSetCounterCookie struct { } // Write request to wire for SyncSetCounter -func (c *Conn) SyncSetCounter(Counter Id, Value SyncInt64) SyncSetCounterCookie { +func (c *Conn) SyncSetCounter(Counter SyncCounter, Value SyncInt64) SyncSetCounterCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) return SyncSetCounterCookie{cookie} } -func (c *Conn) SyncSetCounterChecked(Counter Id, Value SyncInt64) SyncSetCounterCookie { +func (c *Conn) SyncSetCounterChecked(Counter SyncCounter, Value SyncInt64) SyncSetCounterCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) return SyncSetCounterCookie{cookie} @@ -1197,7 +1219,7 @@ func (cook SyncSetCounterCookie) Check() error { } // Write request to wire for SyncSetCounter -func (c *Conn) syncSetCounterRequest(Counter Id, Value SyncInt64) []byte { +func (c *Conn) syncSetCounterRequest(Counter SyncCounter, Value SyncInt64) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1230,13 +1252,13 @@ type SyncCreateAlarmCookie struct { } // Write request to wire for SyncCreateAlarm -func (c *Conn) SyncCreateAlarm(Id Id, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { +func (c *Conn) SyncCreateAlarm(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) return SyncCreateAlarmCookie{cookie} } -func (c *Conn) SyncCreateAlarmChecked(Id Id, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { +func (c *Conn) SyncCreateAlarmChecked(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) return SyncCreateAlarmCookie{cookie} @@ -1247,7 +1269,7 @@ func (cook SyncCreateAlarmCookie) Check() error { } // Write request to wire for SyncCreateAlarm -func (c *Conn) syncCreateAlarmRequest(Id Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) syncCreateAlarmRequest(Id SyncAlarm, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -1282,13 +1304,13 @@ type SyncChangeAlarmCookie struct { } // Write request to wire for SyncChangeAlarm -func (c *Conn) SyncChangeAlarm(Id Id, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { +func (c *Conn) SyncChangeAlarm(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) return SyncChangeAlarmCookie{cookie} } -func (c *Conn) SyncChangeAlarmChecked(Id Id, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { +func (c *Conn) SyncChangeAlarmChecked(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) return SyncChangeAlarmCookie{cookie} @@ -1299,7 +1321,7 @@ func (cook SyncChangeAlarmCookie) Check() error { } // Write request to wire for SyncChangeAlarm -func (c *Conn) syncChangeAlarmRequest(Id Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) syncChangeAlarmRequest(Id SyncAlarm, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -1334,13 +1356,13 @@ type SyncDestroyAlarmCookie struct { } // Write request to wire for SyncDestroyAlarm -func (c *Conn) SyncDestroyAlarm(Alarm Id) SyncDestroyAlarmCookie { +func (c *Conn) SyncDestroyAlarm(Alarm SyncAlarm) SyncDestroyAlarmCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) return SyncDestroyAlarmCookie{cookie} } -func (c *Conn) SyncDestroyAlarmChecked(Alarm Id) SyncDestroyAlarmCookie { +func (c *Conn) SyncDestroyAlarmChecked(Alarm SyncAlarm) SyncDestroyAlarmCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) return SyncDestroyAlarmCookie{cookie} @@ -1351,7 +1373,7 @@ func (cook SyncDestroyAlarmCookie) Check() error { } // Write request to wire for SyncDestroyAlarm -func (c *Conn) syncDestroyAlarmRequest(Alarm Id) []byte { +func (c *Conn) syncDestroyAlarmRequest(Alarm SyncAlarm) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1377,13 +1399,13 @@ type SyncQueryAlarmCookie struct { *cookie } -func (c *Conn) SyncQueryAlarm(Alarm Id) SyncQueryAlarmCookie { +func (c *Conn) SyncQueryAlarm(Alarm SyncAlarm) SyncQueryAlarmCookie { cookie := c.newCookie(true, true) c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) return SyncQueryAlarmCookie{cookie} } -func (c *Conn) SyncQueryAlarmUnchecked(Alarm Id) SyncQueryAlarmCookie { +func (c *Conn) SyncQueryAlarmUnchecked(Alarm SyncAlarm) SyncQueryAlarmCookie { cookie := c.newCookie(false, true) c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) return SyncQueryAlarmCookie{cookie} @@ -1453,7 +1475,7 @@ func (cook SyncQueryAlarmCookie) Check() error { } // Write request to wire for SyncQueryAlarm -func (c *Conn) syncQueryAlarmRequest(Alarm Id) []byte { +func (c *Conn) syncQueryAlarmRequest(Alarm SyncAlarm) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1610,13 +1632,13 @@ type SyncCreateFenceCookie struct { } // Write request to wire for SyncCreateFence -func (c *Conn) SyncCreateFence(Drawable Id, Fence Id, InitiallyTriggered bool) SyncCreateFenceCookie { +func (c *Conn) SyncCreateFence(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) SyncCreateFenceCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) return SyncCreateFenceCookie{cookie} } -func (c *Conn) SyncCreateFenceChecked(Drawable Id, Fence Id, InitiallyTriggered bool) SyncCreateFenceCookie { +func (c *Conn) SyncCreateFenceChecked(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) SyncCreateFenceCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) return SyncCreateFenceCookie{cookie} @@ -1627,7 +1649,7 @@ func (cook SyncCreateFenceCookie) Check() error { } // Write request to wire for SyncCreateFence -func (c *Conn) syncCreateFenceRequest(Drawable Id, Fence Id, InitiallyTriggered bool) []byte { +func (c *Conn) syncCreateFenceRequest(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1664,13 +1686,13 @@ type SyncTriggerFenceCookie struct { } // Write request to wire for SyncTriggerFence -func (c *Conn) SyncTriggerFence(Fence Id) SyncTriggerFenceCookie { +func (c *Conn) SyncTriggerFence(Fence SyncFence) SyncTriggerFenceCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) return SyncTriggerFenceCookie{cookie} } -func (c *Conn) SyncTriggerFenceChecked(Fence Id) SyncTriggerFenceCookie { +func (c *Conn) SyncTriggerFenceChecked(Fence SyncFence) SyncTriggerFenceCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) return SyncTriggerFenceCookie{cookie} @@ -1681,7 +1703,7 @@ func (cook SyncTriggerFenceCookie) Check() error { } // Write request to wire for SyncTriggerFence -func (c *Conn) syncTriggerFenceRequest(Fence Id) []byte { +func (c *Conn) syncTriggerFenceRequest(Fence SyncFence) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1708,13 +1730,13 @@ type SyncResetFenceCookie struct { } // Write request to wire for SyncResetFence -func (c *Conn) SyncResetFence(Fence Id) SyncResetFenceCookie { +func (c *Conn) SyncResetFence(Fence SyncFence) SyncResetFenceCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncResetFenceRequest(Fence), cookie) return SyncResetFenceCookie{cookie} } -func (c *Conn) SyncResetFenceChecked(Fence Id) SyncResetFenceCookie { +func (c *Conn) SyncResetFenceChecked(Fence SyncFence) SyncResetFenceCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncResetFenceRequest(Fence), cookie) return SyncResetFenceCookie{cookie} @@ -1725,7 +1747,7 @@ func (cook SyncResetFenceCookie) Check() error { } // Write request to wire for SyncResetFence -func (c *Conn) syncResetFenceRequest(Fence Id) []byte { +func (c *Conn) syncResetFenceRequest(Fence SyncFence) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1752,13 +1774,13 @@ type SyncDestroyFenceCookie struct { } // Write request to wire for SyncDestroyFence -func (c *Conn) SyncDestroyFence(Fence Id) SyncDestroyFenceCookie { +func (c *Conn) SyncDestroyFence(Fence SyncFence) SyncDestroyFenceCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) return SyncDestroyFenceCookie{cookie} } -func (c *Conn) SyncDestroyFenceChecked(Fence Id) SyncDestroyFenceCookie { +func (c *Conn) SyncDestroyFenceChecked(Fence SyncFence) SyncDestroyFenceCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) return SyncDestroyFenceCookie{cookie} @@ -1769,7 +1791,7 @@ func (cook SyncDestroyFenceCookie) Check() error { } // Write request to wire for SyncDestroyFence -func (c *Conn) syncDestroyFenceRequest(Fence Id) []byte { +func (c *Conn) syncDestroyFenceRequest(Fence SyncFence) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1795,13 +1817,13 @@ type SyncQueryFenceCookie struct { *cookie } -func (c *Conn) SyncQueryFence(Fence Id) SyncQueryFenceCookie { +func (c *Conn) SyncQueryFence(Fence SyncFence) SyncQueryFenceCookie { cookie := c.newCookie(true, true) c.newRequest(c.syncQueryFenceRequest(Fence), cookie) return SyncQueryFenceCookie{cookie} } -func (c *Conn) SyncQueryFenceUnchecked(Fence Id) SyncQueryFenceCookie { +func (c *Conn) SyncQueryFenceUnchecked(Fence SyncFence) SyncQueryFenceCookie { cookie := c.newCookie(false, true) c.newRequest(c.syncQueryFenceRequest(Fence), cookie) return SyncQueryFenceCookie{cookie} @@ -1859,7 +1881,7 @@ func (cook SyncQueryFenceCookie) Check() error { } // Write request to wire for SyncQueryFence -func (c *Conn) syncQueryFenceRequest(Fence Id) []byte { +func (c *Conn) syncQueryFenceRequest(Fence SyncFence) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1886,13 +1908,13 @@ type SyncAwaitFenceCookie struct { } // Write request to wire for SyncAwaitFence -func (c *Conn) SyncAwaitFence(FenceList []Id) SyncAwaitFenceCookie { +func (c *Conn) SyncAwaitFence(FenceList []SyncFence) SyncAwaitFenceCookie { cookie := c.newCookie(false, false) c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) return SyncAwaitFenceCookie{cookie} } -func (c *Conn) SyncAwaitFenceChecked(FenceList []Id) SyncAwaitFenceCookie { +func (c *Conn) SyncAwaitFenceChecked(FenceList []SyncFence) SyncAwaitFenceCookie { cookie := c.newCookie(true, false) c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) return SyncAwaitFenceCookie{cookie} @@ -1903,7 +1925,7 @@ func (cook SyncAwaitFenceCookie) Check() error { } // Write request to wire for SyncAwaitFence -func (c *Conn) syncAwaitFenceRequest(FenceList []Id) []byte { +func (c *Conn) syncAwaitFenceRequest(FenceList []SyncFence) []byte { size := pad((4 + pad((len(FenceList) * 4)))) b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go index 5088e25..bce7d29 100644 --- a/nexgb/auto_xc_misc.go +++ b/nexgb/auto_xc_misc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xc_misc.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xc_misc.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,10 @@ func init() { newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -53,12 +57,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - // Request Xc_miscGetVersion // size: 8 type Xc_miscGetVersionCookie struct { diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go index 56a8e32..33a05cf 100644 --- a/nexgb/auto_xevie.go +++ b/nexgb/auto_xevie.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xevie.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xevie.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -47,8 +47,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go index eb9b14a..4caa416 100644 --- a/nexgb/auto_xf86dri.go +++ b/nexgb/auto_xf86dri.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86dri.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xf86dri.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,6 +33,8 @@ func init() { newExtErrorFuncs["XFree86-DRI"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -55,10 +57,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Id' - // 'Xf86driDrmClipRect' struct definition // Size: 8 type Xf86driDrmClipRect struct { diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go index 459dc9e..983c021 100644 --- a/nexgb/auto_xf86vidmode.go +++ b/nexgb/auto_xf86vidmode.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xf86vidmode.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xf86vidmode.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -33,8 +33,6 @@ func init() { newExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -47,8 +45,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -59,6 +55,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + const ( Xf86vidmodeModeFlagPositiveHsync = 1 Xf86vidmodeModeFlagNegativeHsync = 2 @@ -254,7 +252,7 @@ func (err Xf86vidmodeBadClockError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeBadClockError) BadId() Id { +func (err Xf86vidmodeBadClockError) BadId() uint32 { return 0 } @@ -299,7 +297,7 @@ func (err Xf86vidmodeBadHTimingsError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeBadHTimingsError) BadId() Id { +func (err Xf86vidmodeBadHTimingsError) BadId() uint32 { return 0 } @@ -344,7 +342,7 @@ func (err Xf86vidmodeBadVTimingsError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeBadVTimingsError) BadId() Id { +func (err Xf86vidmodeBadVTimingsError) BadId() uint32 { return 0 } @@ -389,7 +387,7 @@ func (err Xf86vidmodeModeUnsuitableError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeModeUnsuitableError) BadId() Id { +func (err Xf86vidmodeModeUnsuitableError) BadId() uint32 { return 0 } @@ -434,7 +432,7 @@ func (err Xf86vidmodeExtensionDisabledError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeExtensionDisabledError) BadId() Id { +func (err Xf86vidmodeExtensionDisabledError) BadId() uint32 { return 0 } @@ -479,7 +477,7 @@ func (err Xf86vidmodeClientNotLocalError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeClientNotLocalError) BadId() Id { +func (err Xf86vidmodeClientNotLocalError) BadId() uint32 { return 0 } @@ -524,7 +522,7 @@ func (err Xf86vidmodeZoomLockedError) SequenceId() uint16 { return err.Sequence } -func (err Xf86vidmodeZoomLockedError) BadId() Id { +func (err Xf86vidmodeZoomLockedError) BadId() uint32 { return 0 } diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go index 1518044..9284f6b 100644 --- a/nexgb/auto_xfixes.go +++ b/nexgb/auto_xfixes.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xfixes.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xfixes.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,14 +39,6 @@ func init() { newExtErrorFuncs["XFIXES"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -65,6 +57,12 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( XfixesSaveSetModeInsert = 0 XfixesSaveSetModeDelete = 1 @@ -104,7 +102,15 @@ const ( XfixesRegionNone = 0 ) -// Skipping resource definition of 'Region' +type XfixesRegion uint32 + +func (c *Conn) NewXfixesRegionId() (XfixesRegion, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XfixesRegion(id), nil +} // Event definition XfixesSelectionNotify (0) // Size: 32 @@ -114,9 +120,9 @@ const XfixesSelectionNotify = 0 type XfixesSelectionNotifyEvent struct { Sequence uint16 Subtype byte - Window Id - Owner Id - Selection Id + Window Window + Owner Window + Selection Atom Timestamp Timestamp SelectionTimestamp Timestamp // padding: 8 bytes @@ -133,13 +139,13 @@ func NewXfixesSelectionNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Owner = Id(Get32(buf[b:])) + v.Owner = Window(Get32(buf[b:])) b += 4 - v.Selection = Id(Get32(buf[b:])) + v.Selection = Atom(Get32(buf[b:])) b += 4 v.Timestamp = Timestamp(Get32(buf[b:])) @@ -217,10 +223,10 @@ const XfixesCursorNotify = 1 type XfixesCursorNotifyEvent struct { Sequence uint16 Subtype byte - Window Id + Window Window CursorSerial uint32 Timestamp Timestamp - Name Id + Name Atom // padding: 12 bytes } @@ -235,7 +241,7 @@ func NewXfixesCursorNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.CursorSerial = Get32(buf[b:]) @@ -244,7 +250,7 @@ func NewXfixesCursorNotifyEvent(buf []byte) Event { v.Timestamp = Timestamp(Get32(buf[b:])) b += 4 - v.Name = Id(Get32(buf[b:])) + v.Name = Atom(Get32(buf[b:])) b += 4 b += 12 // padding @@ -334,7 +340,7 @@ func (err XfixesBadRegionError) SequenceId() uint16 { return err.Sequence } -func (err XfixesBadRegionError) BadId() Id { +func (err XfixesBadRegionError) BadId() uint32 { return 0 } @@ -449,13 +455,13 @@ type XfixesChangeSaveSetCookie struct { } // Write request to wire for XfixesChangeSaveSet -func (c *Conn) XfixesChangeSaveSet(Mode byte, Target byte, Map byte, Window Id) XfixesChangeSaveSetCookie { +func (c *Conn) XfixesChangeSaveSet(Mode byte, Target byte, Map byte, Window Window) XfixesChangeSaveSetCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) return XfixesChangeSaveSetCookie{cookie} } -func (c *Conn) XfixesChangeSaveSetChecked(Mode byte, Target byte, Map byte, Window Id) XfixesChangeSaveSetCookie { +func (c *Conn) XfixesChangeSaveSetChecked(Mode byte, Target byte, Map byte, Window Window) XfixesChangeSaveSetCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) return XfixesChangeSaveSetCookie{cookie} @@ -466,7 +472,7 @@ func (cook XfixesChangeSaveSetCookie) Check() error { } // Write request to wire for XfixesChangeSaveSet -func (c *Conn) xfixesChangeSaveSetRequest(Mode byte, Target byte, Map byte, Window Id) []byte { +func (c *Conn) xfixesChangeSaveSetRequest(Mode byte, Target byte, Map byte, Window Window) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -504,13 +510,13 @@ type XfixesSelectSelectionInputCookie struct { } // Write request to wire for XfixesSelectSelectionInput -func (c *Conn) XfixesSelectSelectionInput(Window Id, Selection Id, EventMask uint32) XfixesSelectSelectionInputCookie { +func (c *Conn) XfixesSelectSelectionInput(Window Window, Selection Atom, EventMask uint32) XfixesSelectSelectionInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) return XfixesSelectSelectionInputCookie{cookie} } -func (c *Conn) XfixesSelectSelectionInputChecked(Window Id, Selection Id, EventMask uint32) XfixesSelectSelectionInputCookie { +func (c *Conn) XfixesSelectSelectionInputChecked(Window Window, Selection Atom, EventMask uint32) XfixesSelectSelectionInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) return XfixesSelectSelectionInputCookie{cookie} @@ -521,7 +527,7 @@ func (cook XfixesSelectSelectionInputCookie) Check() error { } // Write request to wire for XfixesSelectSelectionInput -func (c *Conn) xfixesSelectSelectionInputRequest(Window Id, Selection Id, EventMask uint32) []byte { +func (c *Conn) xfixesSelectSelectionInputRequest(Window Window, Selection Atom, EventMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -554,13 +560,13 @@ type XfixesSelectCursorInputCookie struct { } // Write request to wire for XfixesSelectCursorInput -func (c *Conn) XfixesSelectCursorInput(Window Id, EventMask uint32) XfixesSelectCursorInputCookie { +func (c *Conn) XfixesSelectCursorInput(Window Window, EventMask uint32) XfixesSelectCursorInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) return XfixesSelectCursorInputCookie{cookie} } -func (c *Conn) XfixesSelectCursorInputChecked(Window Id, EventMask uint32) XfixesSelectCursorInputCookie { +func (c *Conn) XfixesSelectCursorInputChecked(Window Window, EventMask uint32) XfixesSelectCursorInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) return XfixesSelectCursorInputCookie{cookie} @@ -571,7 +577,7 @@ func (cook XfixesSelectCursorInputCookie) Check() error { } // Write request to wire for XfixesSelectCursorInput -func (c *Conn) xfixesSelectCursorInputRequest(Window Id, EventMask uint32) []byte { +func (c *Conn) xfixesSelectCursorInputRequest(Window Window, EventMask uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -716,13 +722,13 @@ type XfixesCreateRegionCookie struct { } // Write request to wire for XfixesCreateRegion -func (c *Conn) XfixesCreateRegion(Region Id, Rectangles []Rectangle) XfixesCreateRegionCookie { +func (c *Conn) XfixesCreateRegion(Region XfixesRegion, Rectangles []Rectangle) XfixesCreateRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) return XfixesCreateRegionCookie{cookie} } -func (c *Conn) XfixesCreateRegionChecked(Region Id, Rectangles []Rectangle) XfixesCreateRegionCookie { +func (c *Conn) XfixesCreateRegionChecked(Region XfixesRegion, Rectangles []Rectangle) XfixesCreateRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) return XfixesCreateRegionCookie{cookie} @@ -733,7 +739,7 @@ func (cook XfixesCreateRegionCookie) Check() error { } // Write request to wire for XfixesCreateRegion -func (c *Conn) xfixesCreateRegionRequest(Region Id, Rectangles []Rectangle) []byte { +func (c *Conn) xfixesCreateRegionRequest(Region XfixesRegion, Rectangles []Rectangle) []byte { size := pad((8 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -762,13 +768,13 @@ type XfixesCreateRegionFromBitmapCookie struct { } // Write request to wire for XfixesCreateRegionFromBitmap -func (c *Conn) XfixesCreateRegionFromBitmap(Region Id, Bitmap Id) XfixesCreateRegionFromBitmapCookie { +func (c *Conn) XfixesCreateRegionFromBitmap(Region XfixesRegion, Bitmap Pixmap) XfixesCreateRegionFromBitmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) return XfixesCreateRegionFromBitmapCookie{cookie} } -func (c *Conn) XfixesCreateRegionFromBitmapChecked(Region Id, Bitmap Id) XfixesCreateRegionFromBitmapCookie { +func (c *Conn) XfixesCreateRegionFromBitmapChecked(Region XfixesRegion, Bitmap Pixmap) XfixesCreateRegionFromBitmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) return XfixesCreateRegionFromBitmapCookie{cookie} @@ -779,7 +785,7 @@ func (cook XfixesCreateRegionFromBitmapCookie) Check() error { } // Write request to wire for XfixesCreateRegionFromBitmap -func (c *Conn) xfixesCreateRegionFromBitmapRequest(Region Id, Bitmap Id) []byte { +func (c *Conn) xfixesCreateRegionFromBitmapRequest(Region XfixesRegion, Bitmap Pixmap) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -809,13 +815,13 @@ type XfixesCreateRegionFromWindowCookie struct { } // Write request to wire for XfixesCreateRegionFromWindow -func (c *Conn) XfixesCreateRegionFromWindow(Region Id, Window Id, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { +func (c *Conn) XfixesCreateRegionFromWindow(Region XfixesRegion, Window Window, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) return XfixesCreateRegionFromWindowCookie{cookie} } -func (c *Conn) XfixesCreateRegionFromWindowChecked(Region Id, Window Id, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { +func (c *Conn) XfixesCreateRegionFromWindowChecked(Region XfixesRegion, Window Window, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) return XfixesCreateRegionFromWindowCookie{cookie} @@ -826,7 +832,7 @@ func (cook XfixesCreateRegionFromWindowCookie) Check() error { } // Write request to wire for XfixesCreateRegionFromWindow -func (c *Conn) xfixesCreateRegionFromWindowRequest(Region Id, Window Id, Kind ShapeKind) []byte { +func (c *Conn) xfixesCreateRegionFromWindowRequest(Region XfixesRegion, Window Window, Kind ShapeKind) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -861,13 +867,13 @@ type XfixesCreateRegionFromGCCookie struct { } // Write request to wire for XfixesCreateRegionFromGC -func (c *Conn) XfixesCreateRegionFromGC(Region Id, Gc Id) XfixesCreateRegionFromGCCookie { +func (c *Conn) XfixesCreateRegionFromGC(Region XfixesRegion, Gc Gcontext) XfixesCreateRegionFromGCCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) return XfixesCreateRegionFromGCCookie{cookie} } -func (c *Conn) XfixesCreateRegionFromGCChecked(Region Id, Gc Id) XfixesCreateRegionFromGCCookie { +func (c *Conn) XfixesCreateRegionFromGCChecked(Region XfixesRegion, Gc Gcontext) XfixesCreateRegionFromGCCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) return XfixesCreateRegionFromGCCookie{cookie} @@ -878,7 +884,7 @@ func (cook XfixesCreateRegionFromGCCookie) Check() error { } // Write request to wire for XfixesCreateRegionFromGC -func (c *Conn) xfixesCreateRegionFromGCRequest(Region Id, Gc Id) []byte { +func (c *Conn) xfixesCreateRegionFromGCRequest(Region XfixesRegion, Gc Gcontext) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -908,13 +914,13 @@ type XfixesCreateRegionFromPictureCookie struct { } // Write request to wire for XfixesCreateRegionFromPicture -func (c *Conn) XfixesCreateRegionFromPicture(Region Id, Picture Id) XfixesCreateRegionFromPictureCookie { +func (c *Conn) XfixesCreateRegionFromPicture(Region XfixesRegion, Picture RenderPicture) XfixesCreateRegionFromPictureCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) return XfixesCreateRegionFromPictureCookie{cookie} } -func (c *Conn) XfixesCreateRegionFromPictureChecked(Region Id, Picture Id) XfixesCreateRegionFromPictureCookie { +func (c *Conn) XfixesCreateRegionFromPictureChecked(Region XfixesRegion, Picture RenderPicture) XfixesCreateRegionFromPictureCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) return XfixesCreateRegionFromPictureCookie{cookie} @@ -925,7 +931,7 @@ func (cook XfixesCreateRegionFromPictureCookie) Check() error { } // Write request to wire for XfixesCreateRegionFromPicture -func (c *Conn) xfixesCreateRegionFromPictureRequest(Region Id, Picture Id) []byte { +func (c *Conn) xfixesCreateRegionFromPictureRequest(Region XfixesRegion, Picture RenderPicture) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -955,13 +961,13 @@ type XfixesDestroyRegionCookie struct { } // Write request to wire for XfixesDestroyRegion -func (c *Conn) XfixesDestroyRegion(Region Id) XfixesDestroyRegionCookie { +func (c *Conn) XfixesDestroyRegion(Region XfixesRegion) XfixesDestroyRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) return XfixesDestroyRegionCookie{cookie} } -func (c *Conn) XfixesDestroyRegionChecked(Region Id) XfixesDestroyRegionCookie { +func (c *Conn) XfixesDestroyRegionChecked(Region XfixesRegion) XfixesDestroyRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) return XfixesDestroyRegionCookie{cookie} @@ -972,7 +978,7 @@ func (cook XfixesDestroyRegionCookie) Check() error { } // Write request to wire for XfixesDestroyRegion -func (c *Conn) xfixesDestroyRegionRequest(Region Id) []byte { +func (c *Conn) xfixesDestroyRegionRequest(Region XfixesRegion) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -999,13 +1005,13 @@ type XfixesSetRegionCookie struct { } // Write request to wire for XfixesSetRegion -func (c *Conn) XfixesSetRegion(Region Id, Rectangles []Rectangle) XfixesSetRegionCookie { +func (c *Conn) XfixesSetRegion(Region XfixesRegion, Rectangles []Rectangle) XfixesSetRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) return XfixesSetRegionCookie{cookie} } -func (c *Conn) XfixesSetRegionChecked(Region Id, Rectangles []Rectangle) XfixesSetRegionCookie { +func (c *Conn) XfixesSetRegionChecked(Region XfixesRegion, Rectangles []Rectangle) XfixesSetRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) return XfixesSetRegionCookie{cookie} @@ -1016,7 +1022,7 @@ func (cook XfixesSetRegionCookie) Check() error { } // Write request to wire for XfixesSetRegion -func (c *Conn) xfixesSetRegionRequest(Region Id, Rectangles []Rectangle) []byte { +func (c *Conn) xfixesSetRegionRequest(Region XfixesRegion, Rectangles []Rectangle) []byte { size := pad((8 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -1045,13 +1051,13 @@ type XfixesCopyRegionCookie struct { } // Write request to wire for XfixesCopyRegion -func (c *Conn) XfixesCopyRegion(Source Id, Destination Id) XfixesCopyRegionCookie { +func (c *Conn) XfixesCopyRegion(Source XfixesRegion, Destination XfixesRegion) XfixesCopyRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) return XfixesCopyRegionCookie{cookie} } -func (c *Conn) XfixesCopyRegionChecked(Source Id, Destination Id) XfixesCopyRegionCookie { +func (c *Conn) XfixesCopyRegionChecked(Source XfixesRegion, Destination XfixesRegion) XfixesCopyRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) return XfixesCopyRegionCookie{cookie} @@ -1062,7 +1068,7 @@ func (cook XfixesCopyRegionCookie) Check() error { } // Write request to wire for XfixesCopyRegion -func (c *Conn) xfixesCopyRegionRequest(Source Id, Destination Id) []byte { +func (c *Conn) xfixesCopyRegionRequest(Source XfixesRegion, Destination XfixesRegion) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1092,13 +1098,13 @@ type XfixesUnionRegionCookie struct { } // Write request to wire for XfixesUnionRegion -func (c *Conn) XfixesUnionRegion(Source1 Id, Source2 Id, Destination Id) XfixesUnionRegionCookie { +func (c *Conn) XfixesUnionRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesUnionRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) return XfixesUnionRegionCookie{cookie} } -func (c *Conn) XfixesUnionRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesUnionRegionCookie { +func (c *Conn) XfixesUnionRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesUnionRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) return XfixesUnionRegionCookie{cookie} @@ -1109,7 +1115,7 @@ func (cook XfixesUnionRegionCookie) Check() error { } // Write request to wire for XfixesUnionRegion -func (c *Conn) xfixesUnionRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { +func (c *Conn) xfixesUnionRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1142,13 +1148,13 @@ type XfixesIntersectRegionCookie struct { } // Write request to wire for XfixesIntersectRegion -func (c *Conn) XfixesIntersectRegion(Source1 Id, Source2 Id, Destination Id) XfixesIntersectRegionCookie { +func (c *Conn) XfixesIntersectRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesIntersectRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) return XfixesIntersectRegionCookie{cookie} } -func (c *Conn) XfixesIntersectRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesIntersectRegionCookie { +func (c *Conn) XfixesIntersectRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesIntersectRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) return XfixesIntersectRegionCookie{cookie} @@ -1159,7 +1165,7 @@ func (cook XfixesIntersectRegionCookie) Check() error { } // Write request to wire for XfixesIntersectRegion -func (c *Conn) xfixesIntersectRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { +func (c *Conn) xfixesIntersectRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1192,13 +1198,13 @@ type XfixesSubtractRegionCookie struct { } // Write request to wire for XfixesSubtractRegion -func (c *Conn) XfixesSubtractRegion(Source1 Id, Source2 Id, Destination Id) XfixesSubtractRegionCookie { +func (c *Conn) XfixesSubtractRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesSubtractRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) return XfixesSubtractRegionCookie{cookie} } -func (c *Conn) XfixesSubtractRegionChecked(Source1 Id, Source2 Id, Destination Id) XfixesSubtractRegionCookie { +func (c *Conn) XfixesSubtractRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesSubtractRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) return XfixesSubtractRegionCookie{cookie} @@ -1209,7 +1215,7 @@ func (cook XfixesSubtractRegionCookie) Check() error { } // Write request to wire for XfixesSubtractRegion -func (c *Conn) xfixesSubtractRegionRequest(Source1 Id, Source2 Id, Destination Id) []byte { +func (c *Conn) xfixesSubtractRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1242,13 +1248,13 @@ type XfixesInvertRegionCookie struct { } // Write request to wire for XfixesInvertRegion -func (c *Conn) XfixesInvertRegion(Source Id, Bounds Rectangle, Destination Id) XfixesInvertRegionCookie { +func (c *Conn) XfixesInvertRegion(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) XfixesInvertRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) return XfixesInvertRegionCookie{cookie} } -func (c *Conn) XfixesInvertRegionChecked(Source Id, Bounds Rectangle, Destination Id) XfixesInvertRegionCookie { +func (c *Conn) XfixesInvertRegionChecked(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) XfixesInvertRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) return XfixesInvertRegionCookie{cookie} @@ -1259,7 +1265,7 @@ func (cook XfixesInvertRegionCookie) Check() error { } // Write request to wire for XfixesInvertRegion -func (c *Conn) xfixesInvertRegionRequest(Source Id, Bounds Rectangle, Destination Id) []byte { +func (c *Conn) xfixesInvertRegionRequest(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -1295,13 +1301,13 @@ type XfixesTranslateRegionCookie struct { } // Write request to wire for XfixesTranslateRegion -func (c *Conn) XfixesTranslateRegion(Region Id, Dx int16, Dy int16) XfixesTranslateRegionCookie { +func (c *Conn) XfixesTranslateRegion(Region XfixesRegion, Dx int16, Dy int16) XfixesTranslateRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) return XfixesTranslateRegionCookie{cookie} } -func (c *Conn) XfixesTranslateRegionChecked(Region Id, Dx int16, Dy int16) XfixesTranslateRegionCookie { +func (c *Conn) XfixesTranslateRegionChecked(Region XfixesRegion, Dx int16, Dy int16) XfixesTranslateRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) return XfixesTranslateRegionCookie{cookie} @@ -1312,7 +1318,7 @@ func (cook XfixesTranslateRegionCookie) Check() error { } // Write request to wire for XfixesTranslateRegion -func (c *Conn) xfixesTranslateRegionRequest(Region Id, Dx int16, Dy int16) []byte { +func (c *Conn) xfixesTranslateRegionRequest(Region XfixesRegion, Dx int16, Dy int16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1345,13 +1351,13 @@ type XfixesRegionExtentsCookie struct { } // Write request to wire for XfixesRegionExtents -func (c *Conn) XfixesRegionExtents(Source Id, Destination Id) XfixesRegionExtentsCookie { +func (c *Conn) XfixesRegionExtents(Source XfixesRegion, Destination XfixesRegion) XfixesRegionExtentsCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) return XfixesRegionExtentsCookie{cookie} } -func (c *Conn) XfixesRegionExtentsChecked(Source Id, Destination Id) XfixesRegionExtentsCookie { +func (c *Conn) XfixesRegionExtentsChecked(Source XfixesRegion, Destination XfixesRegion) XfixesRegionExtentsCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) return XfixesRegionExtentsCookie{cookie} @@ -1362,7 +1368,7 @@ func (cook XfixesRegionExtentsCookie) Check() error { } // Write request to wire for XfixesRegionExtents -func (c *Conn) xfixesRegionExtentsRequest(Source Id, Destination Id) []byte { +func (c *Conn) xfixesRegionExtentsRequest(Source XfixesRegion, Destination XfixesRegion) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1391,13 +1397,13 @@ type XfixesFetchRegionCookie struct { *cookie } -func (c *Conn) XfixesFetchRegion(Region Id) XfixesFetchRegionCookie { +func (c *Conn) XfixesFetchRegion(Region XfixesRegion) XfixesFetchRegionCookie { cookie := c.newCookie(true, true) c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) return XfixesFetchRegionCookie{cookie} } -func (c *Conn) XfixesFetchRegionUnchecked(Region Id) XfixesFetchRegionCookie { +func (c *Conn) XfixesFetchRegionUnchecked(Region XfixesRegion) XfixesFetchRegionCookie { cookie := c.newCookie(false, true) c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) return XfixesFetchRegionCookie{cookie} @@ -1455,7 +1461,7 @@ func (cook XfixesFetchRegionCookie) Check() error { } // Write request to wire for XfixesFetchRegion -func (c *Conn) xfixesFetchRegionRequest(Region Id) []byte { +func (c *Conn) xfixesFetchRegionRequest(Region XfixesRegion) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1482,13 +1488,13 @@ type XfixesSetGCClipRegionCookie struct { } // Write request to wire for XfixesSetGCClipRegion -func (c *Conn) XfixesSetGCClipRegion(Gc Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { +func (c *Conn) XfixesSetGCClipRegion(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) return XfixesSetGCClipRegionCookie{cookie} } -func (c *Conn) XfixesSetGCClipRegionChecked(Gc Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { +func (c *Conn) XfixesSetGCClipRegionChecked(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) return XfixesSetGCClipRegionCookie{cookie} @@ -1499,7 +1505,7 @@ func (cook XfixesSetGCClipRegionCookie) Check() error { } // Write request to wire for XfixesSetGCClipRegion -func (c *Conn) xfixesSetGCClipRegionRequest(Gc Id, Region Id, XOrigin int16, YOrigin int16) []byte { +func (c *Conn) xfixesSetGCClipRegionRequest(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1535,13 +1541,13 @@ type XfixesSetWindowShapeRegionCookie struct { } // Write request to wire for XfixesSetWindowShapeRegion -func (c *Conn) XfixesSetWindowShapeRegion(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) XfixesSetWindowShapeRegionCookie { +func (c *Conn) XfixesSetWindowShapeRegion(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) XfixesSetWindowShapeRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) return XfixesSetWindowShapeRegionCookie{cookie} } -func (c *Conn) XfixesSetWindowShapeRegionChecked(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) XfixesSetWindowShapeRegionCookie { +func (c *Conn) XfixesSetWindowShapeRegionChecked(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) XfixesSetWindowShapeRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) return XfixesSetWindowShapeRegionCookie{cookie} @@ -1552,7 +1558,7 @@ func (cook XfixesSetWindowShapeRegionCookie) Check() error { } // Write request to wire for XfixesSetWindowShapeRegion -func (c *Conn) xfixesSetWindowShapeRegionRequest(Dest Id, DestKind ShapeKind, XOffset int16, YOffset int16, Region Id) []byte { +func (c *Conn) xfixesSetWindowShapeRegionRequest(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -1593,13 +1599,13 @@ type XfixesSetPictureClipRegionCookie struct { } // Write request to wire for XfixesSetPictureClipRegion -func (c *Conn) XfixesSetPictureClipRegion(Picture Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { +func (c *Conn) XfixesSetPictureClipRegion(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) return XfixesSetPictureClipRegionCookie{cookie} } -func (c *Conn) XfixesSetPictureClipRegionChecked(Picture Id, Region Id, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { +func (c *Conn) XfixesSetPictureClipRegionChecked(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) return XfixesSetPictureClipRegionCookie{cookie} @@ -1610,7 +1616,7 @@ func (cook XfixesSetPictureClipRegionCookie) Check() error { } // Write request to wire for XfixesSetPictureClipRegion -func (c *Conn) xfixesSetPictureClipRegionRequest(Picture Id, Region Id, XOrigin int16, YOrigin int16) []byte { +func (c *Conn) xfixesSetPictureClipRegionRequest(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -1646,13 +1652,13 @@ type XfixesSetCursorNameCookie struct { } // Write request to wire for XfixesSetCursorName -func (c *Conn) XfixesSetCursorName(Cursor Id, Nbytes uint16, Name string) XfixesSetCursorNameCookie { +func (c *Conn) XfixesSetCursorName(Cursor Cursor, Nbytes uint16, Name string) XfixesSetCursorNameCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) return XfixesSetCursorNameCookie{cookie} } -func (c *Conn) XfixesSetCursorNameChecked(Cursor Id, Nbytes uint16, Name string) XfixesSetCursorNameCookie { +func (c *Conn) XfixesSetCursorNameChecked(Cursor Cursor, Nbytes uint16, Name string) XfixesSetCursorNameCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) return XfixesSetCursorNameCookie{cookie} @@ -1663,7 +1669,7 @@ func (cook XfixesSetCursorNameCookie) Check() error { } // Write request to wire for XfixesSetCursorName -func (c *Conn) xfixesSetCursorNameRequest(Cursor Id, Nbytes uint16, Name string) []byte { +func (c *Conn) xfixesSetCursorNameRequest(Cursor Cursor, Nbytes uint16, Name string) []byte { size := pad((12 + pad((int(Nbytes) * 1)))) b := 0 buf := make([]byte, size) @@ -1697,13 +1703,13 @@ type XfixesGetCursorNameCookie struct { *cookie } -func (c *Conn) XfixesGetCursorName(Cursor Id) XfixesGetCursorNameCookie { +func (c *Conn) XfixesGetCursorName(Cursor Cursor) XfixesGetCursorNameCookie { cookie := c.newCookie(true, true) c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) return XfixesGetCursorNameCookie{cookie} } -func (c *Conn) XfixesGetCursorNameUnchecked(Cursor Id) XfixesGetCursorNameCookie { +func (c *Conn) XfixesGetCursorNameUnchecked(Cursor Cursor) XfixesGetCursorNameCookie { cookie := c.newCookie(false, true) c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) return XfixesGetCursorNameCookie{cookie} @@ -1715,7 +1721,7 @@ type XfixesGetCursorNameReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Atom Id + Atom Atom Nbytes uint16 // padding: 18 bytes Name string // size: pad((int(Nbytes) * 1)) @@ -1746,7 +1752,7 @@ func xfixesGetCursorNameReply(buf []byte) *XfixesGetCursorNameReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Atom = Id(Get32(buf[b:])) + v.Atom = Atom(Get32(buf[b:])) b += 4 v.Nbytes = Get16(buf[b:]) @@ -1769,7 +1775,7 @@ func (cook XfixesGetCursorNameCookie) Check() error { } // Write request to wire for XfixesGetCursorName -func (c *Conn) xfixesGetCursorNameRequest(Cursor Id) []byte { +func (c *Conn) xfixesGetCursorNameRequest(Cursor Cursor) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1820,7 +1826,7 @@ type XfixesGetCursorImageAndNameReply struct { Xhot uint16 Yhot uint16 CursorSerial uint32 - CursorAtom Id + CursorAtom Atom Nbytes uint16 // padding: 2 bytes Name string // size: pad((int(Nbytes) * 1)) @@ -1873,7 +1879,7 @@ func xfixesGetCursorImageAndNameReply(buf []byte) *XfixesGetCursorImageAndNameRe v.CursorSerial = Get32(buf[b:]) b += 4 - v.CursorAtom = Id(Get32(buf[b:])) + v.CursorAtom = Atom(Get32(buf[b:])) b += 4 v.Nbytes = Get16(buf[b:]) @@ -1927,13 +1933,13 @@ type XfixesChangeCursorCookie struct { } // Write request to wire for XfixesChangeCursor -func (c *Conn) XfixesChangeCursor(Source Id, Destination Id) XfixesChangeCursorCookie { +func (c *Conn) XfixesChangeCursor(Source Cursor, Destination Cursor) XfixesChangeCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) return XfixesChangeCursorCookie{cookie} } -func (c *Conn) XfixesChangeCursorChecked(Source Id, Destination Id) XfixesChangeCursorCookie { +func (c *Conn) XfixesChangeCursorChecked(Source Cursor, Destination Cursor) XfixesChangeCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) return XfixesChangeCursorCookie{cookie} @@ -1944,7 +1950,7 @@ func (cook XfixesChangeCursorCookie) Check() error { } // Write request to wire for XfixesChangeCursor -func (c *Conn) xfixesChangeCursorRequest(Source Id, Destination Id) []byte { +func (c *Conn) xfixesChangeCursorRequest(Source Cursor, Destination Cursor) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1974,13 +1980,13 @@ type XfixesChangeCursorByNameCookie struct { } // Write request to wire for XfixesChangeCursorByName -func (c *Conn) XfixesChangeCursorByName(Src Id, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { +func (c *Conn) XfixesChangeCursorByName(Src Cursor, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) return XfixesChangeCursorByNameCookie{cookie} } -func (c *Conn) XfixesChangeCursorByNameChecked(Src Id, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { +func (c *Conn) XfixesChangeCursorByNameChecked(Src Cursor, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) return XfixesChangeCursorByNameCookie{cookie} @@ -1991,7 +1997,7 @@ func (cook XfixesChangeCursorByNameCookie) Check() error { } // Write request to wire for XfixesChangeCursorByName -func (c *Conn) xfixesChangeCursorByNameRequest(Src Id, Nbytes uint16, Name string) []byte { +func (c *Conn) xfixesChangeCursorByNameRequest(Src Cursor, Nbytes uint16, Name string) []byte { size := pad((12 + pad((int(Nbytes) * 1)))) b := 0 buf := make([]byte, size) @@ -2026,13 +2032,13 @@ type XfixesExpandRegionCookie struct { } // Write request to wire for XfixesExpandRegion -func (c *Conn) XfixesExpandRegion(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { +func (c *Conn) XfixesExpandRegion(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) return XfixesExpandRegionCookie{cookie} } -func (c *Conn) XfixesExpandRegionChecked(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { +func (c *Conn) XfixesExpandRegionChecked(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) return XfixesExpandRegionCookie{cookie} @@ -2043,7 +2049,7 @@ func (cook XfixesExpandRegionCookie) Check() error { } // Write request to wire for XfixesExpandRegion -func (c *Conn) xfixesExpandRegionRequest(Source Id, Destination Id, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { +func (c *Conn) xfixesExpandRegionRequest(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -2085,13 +2091,13 @@ type XfixesHideCursorCookie struct { } // Write request to wire for XfixesHideCursor -func (c *Conn) XfixesHideCursor(Window Id) XfixesHideCursorCookie { +func (c *Conn) XfixesHideCursor(Window Window) XfixesHideCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesHideCursorRequest(Window), cookie) return XfixesHideCursorCookie{cookie} } -func (c *Conn) XfixesHideCursorChecked(Window Id) XfixesHideCursorCookie { +func (c *Conn) XfixesHideCursorChecked(Window Window) XfixesHideCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesHideCursorRequest(Window), cookie) return XfixesHideCursorCookie{cookie} @@ -2102,7 +2108,7 @@ func (cook XfixesHideCursorCookie) Check() error { } // Write request to wire for XfixesHideCursor -func (c *Conn) xfixesHideCursorRequest(Window Id) []byte { +func (c *Conn) xfixesHideCursorRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2129,13 +2135,13 @@ type XfixesShowCursorCookie struct { } // Write request to wire for XfixesShowCursor -func (c *Conn) XfixesShowCursor(Window Id) XfixesShowCursorCookie { +func (c *Conn) XfixesShowCursor(Window Window) XfixesShowCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.xfixesShowCursorRequest(Window), cookie) return XfixesShowCursorCookie{cookie} } -func (c *Conn) XfixesShowCursorChecked(Window Id) XfixesShowCursorCookie { +func (c *Conn) XfixesShowCursorChecked(Window Window) XfixesShowCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.xfixesShowCursorRequest(Window), cookie) return XfixesShowCursorCookie{cookie} @@ -2146,7 +2152,7 @@ func (cook XfixesShowCursorCookie) Check() error { } // Write request to wire for XfixesShowCursor -func (c *Conn) xfixesShowCursorRequest(Window Id) []byte { +func (c *Conn) xfixesShowCursorRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go index 0f52bf2..fc24ae3 100644 --- a/nexgb/auto_xinerama.go +++ b/nexgb/auto_xinerama.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinerama.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xinerama.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,14 +37,6 @@ func init() { newExtErrorFuncs["XINERAMA"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -59,10 +51,16 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // 'XineramaScreenInfo' struct definition // Size: 8 type XineramaScreenInfo struct { @@ -229,13 +227,13 @@ type XineramaGetStateCookie struct { *cookie } -func (c *Conn) XineramaGetState(Window Id) XineramaGetStateCookie { +func (c *Conn) XineramaGetState(Window Window) XineramaGetStateCookie { cookie := c.newCookie(true, true) c.newRequest(c.xineramaGetStateRequest(Window), cookie) return XineramaGetStateCookie{cookie} } -func (c *Conn) XineramaGetStateUnchecked(Window Id) XineramaGetStateCookie { +func (c *Conn) XineramaGetStateUnchecked(Window Window) XineramaGetStateCookie { cookie := c.newCookie(false, true) c.newRequest(c.xineramaGetStateRequest(Window), cookie) return XineramaGetStateCookie{cookie} @@ -247,7 +245,7 @@ type XineramaGetStateReply struct { Sequence uint16 Length uint32 State byte - Window Id + Window Window } // Waits and reads reply data from request XineramaGetState @@ -276,7 +274,7 @@ func xineramaGetStateReply(buf []byte) *XineramaGetStateReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 return v @@ -287,7 +285,7 @@ func (cook XineramaGetStateCookie) Check() error { } // Write request to wire for XineramaGetState -func (c *Conn) xineramaGetStateRequest(Window Id) []byte { +func (c *Conn) xineramaGetStateRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -313,13 +311,13 @@ type XineramaGetScreenCountCookie struct { *cookie } -func (c *Conn) XineramaGetScreenCount(Window Id) XineramaGetScreenCountCookie { +func (c *Conn) XineramaGetScreenCount(Window Window) XineramaGetScreenCountCookie { cookie := c.newCookie(true, true) c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) return XineramaGetScreenCountCookie{cookie} } -func (c *Conn) XineramaGetScreenCountUnchecked(Window Id) XineramaGetScreenCountCookie { +func (c *Conn) XineramaGetScreenCountUnchecked(Window Window) XineramaGetScreenCountCookie { cookie := c.newCookie(false, true) c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) return XineramaGetScreenCountCookie{cookie} @@ -331,7 +329,7 @@ type XineramaGetScreenCountReply struct { Sequence uint16 Length uint32 ScreenCount byte - Window Id + Window Window } // Waits and reads reply data from request XineramaGetScreenCount @@ -360,7 +358,7 @@ func xineramaGetScreenCountReply(buf []byte) *XineramaGetScreenCountReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 return v @@ -371,7 +369,7 @@ func (cook XineramaGetScreenCountCookie) Check() error { } // Write request to wire for XineramaGetScreenCount -func (c *Conn) xineramaGetScreenCountRequest(Window Id) []byte { +func (c *Conn) xineramaGetScreenCountRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -397,13 +395,13 @@ type XineramaGetScreenSizeCookie struct { *cookie } -func (c *Conn) XineramaGetScreenSize(Window Id, Screen uint32) XineramaGetScreenSizeCookie { +func (c *Conn) XineramaGetScreenSize(Window Window, Screen uint32) XineramaGetScreenSizeCookie { cookie := c.newCookie(true, true) c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) return XineramaGetScreenSizeCookie{cookie} } -func (c *Conn) XineramaGetScreenSizeUnchecked(Window Id, Screen uint32) XineramaGetScreenSizeCookie { +func (c *Conn) XineramaGetScreenSizeUnchecked(Window Window, Screen uint32) XineramaGetScreenSizeCookie { cookie := c.newCookie(false, true) c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) return XineramaGetScreenSizeCookie{cookie} @@ -417,7 +415,7 @@ type XineramaGetScreenSizeReply struct { // padding: 1 bytes Width uint32 Height uint32 - Window Id + Window Window Screen uint32 } @@ -452,7 +450,7 @@ func xineramaGetScreenSizeReply(buf []byte) *XineramaGetScreenSizeReply { v.Height = Get32(buf[b:]) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.Screen = Get32(buf[b:]) @@ -466,7 +464,7 @@ func (cook XineramaGetScreenSizeCookie) Check() error { } // Write request to wire for XineramaGetScreenSize -func (c *Conn) xineramaGetScreenSizeRequest(Window Id, Screen uint32) []byte { +func (c *Conn) xineramaGetScreenSizeRequest(Window Window, Screen uint32) []byte { size := 12 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go index a15c426..78142b6 100644 --- a/nexgb/auto_xinput.go +++ b/nexgb/auto_xinput.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xinput.xml on May 8 2012 11:03:24pm EDT. + This file was generated by xinput.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,10 @@ func init() { newExtErrorFuncs["XInputExtension"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -55,14 +59,8 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( XinputValuatorModeRelative = 0 XinputValuatorModeAbsolute = 1 @@ -116,7 +114,7 @@ type XinputEventClass uint32 // 'XinputDeviceInfo' struct definition // Size: 8 type XinputDeviceInfo struct { - DeviceType Id + DeviceType Atom DeviceId byte NumClassInfo byte DeviceUse byte @@ -127,7 +125,7 @@ type XinputDeviceInfo struct { func ReadXinputDeviceInfo(buf []byte, v *XinputDeviceInfo) int { b := 0 - v.DeviceType = Id(Get32(buf[b:])) + v.DeviceType = Atom(Get32(buf[b:])) b += 4 v.DeviceId = buf[b] @@ -3347,9 +3345,9 @@ type XinputDeviceKeyPressEvent struct { Sequence uint16 Detail byte Time Timestamp - Root Id - Event Id - Child Id + Root Window + Event Window + Child Window RootX int16 RootY int16 EventX int16 @@ -3373,13 +3371,13 @@ func NewXinputDeviceKeyPressEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -3501,7 +3499,7 @@ type XinputFocusInEvent struct { Sequence uint16 Detail byte Time Timestamp - Window Id + Window Window Mode byte DeviceId byte // padding: 18 bytes @@ -3521,7 +3519,7 @@ func NewXinputFocusInEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.Mode = buf[b] @@ -4435,7 +4433,7 @@ func (err XinputDeviceError) SequenceId() uint16 { return err.Sequence } -func (err XinputDeviceError) BadId() Id { +func (err XinputDeviceError) BadId() uint32 { return 0 } @@ -4480,7 +4478,7 @@ func (err XinputEventError) SequenceId() uint16 { return err.Sequence } -func (err XinputEventError) BadId() Id { +func (err XinputEventError) BadId() uint32 { return 0 } @@ -4525,7 +4523,7 @@ func (err XinputModeError) SequenceId() uint16 { return err.Sequence } -func (err XinputModeError) BadId() Id { +func (err XinputModeError) BadId() uint32 { return 0 } @@ -4570,7 +4568,7 @@ func (err XinputDeviceBusyError) SequenceId() uint16 { return err.Sequence } -func (err XinputDeviceBusyError) BadId() Id { +func (err XinputDeviceBusyError) BadId() uint32 { return 0 } @@ -4615,7 +4613,7 @@ func (err XinputClassError) SequenceId() uint16 { return err.Sequence } -func (err XinputClassError) BadId() Id { +func (err XinputClassError) BadId() uint32 { return 0 } @@ -5056,13 +5054,13 @@ type XinputSelectExtensionEventCookie struct { } // Write request to wire for XinputSelectExtensionEvent -func (c *Conn) XinputSelectExtensionEvent(Window Id, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { +func (c *Conn) XinputSelectExtensionEvent(Window Window, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) return XinputSelectExtensionEventCookie{cookie} } -func (c *Conn) XinputSelectExtensionEventChecked(Window Id, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { +func (c *Conn) XinputSelectExtensionEventChecked(Window Window, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) return XinputSelectExtensionEventCookie{cookie} @@ -5073,7 +5071,7 @@ func (cook XinputSelectExtensionEventCookie) Check() error { } // Write request to wire for XinputSelectExtensionEvent -func (c *Conn) xinputSelectExtensionEventRequest(Window Id, NumClasses uint16, Classes []XinputEventClass) []byte { +func (c *Conn) xinputSelectExtensionEventRequest(Window Window, NumClasses uint16, Classes []XinputEventClass) []byte { size := pad((12 + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) @@ -5110,13 +5108,13 @@ type XinputGetSelectedExtensionEventsCookie struct { *cookie } -func (c *Conn) XinputGetSelectedExtensionEvents(Window Id) XinputGetSelectedExtensionEventsCookie { +func (c *Conn) XinputGetSelectedExtensionEvents(Window Window) XinputGetSelectedExtensionEventsCookie { cookie := c.newCookie(true, true) c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) return XinputGetSelectedExtensionEventsCookie{cookie} } -func (c *Conn) XinputGetSelectedExtensionEventsUnchecked(Window Id) XinputGetSelectedExtensionEventsCookie { +func (c *Conn) XinputGetSelectedExtensionEventsUnchecked(Window Window) XinputGetSelectedExtensionEventsCookie { cookie := c.newCookie(false, true) c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) return XinputGetSelectedExtensionEventsCookie{cookie} @@ -5190,7 +5188,7 @@ func (cook XinputGetSelectedExtensionEventsCookie) Check() error { } // Write request to wire for XinputGetSelectedExtensionEvents -func (c *Conn) xinputGetSelectedExtensionEventsRequest(Window Id) []byte { +func (c *Conn) xinputGetSelectedExtensionEventsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -5217,13 +5215,13 @@ type XinputChangeDeviceDontPropagateListCookie struct { } // Write request to wire for XinputChangeDeviceDontPropagateList -func (c *Conn) XinputChangeDeviceDontPropagateList(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { +func (c *Conn) XinputChangeDeviceDontPropagateList(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) return XinputChangeDeviceDontPropagateListCookie{cookie} } -func (c *Conn) XinputChangeDeviceDontPropagateListChecked(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { +func (c *Conn) XinputChangeDeviceDontPropagateListChecked(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) return XinputChangeDeviceDontPropagateListCookie{cookie} @@ -5234,7 +5232,7 @@ func (cook XinputChangeDeviceDontPropagateListCookie) Check() error { } // Write request to wire for XinputChangeDeviceDontPropagateList -func (c *Conn) xinputChangeDeviceDontPropagateListRequest(Window Id, NumClasses uint16, Mode byte, Classes []XinputEventClass) []byte { +func (c *Conn) xinputChangeDeviceDontPropagateListRequest(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) []byte { size := pad((12 + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) @@ -5274,13 +5272,13 @@ type XinputGetDeviceDontPropagateListCookie struct { *cookie } -func (c *Conn) XinputGetDeviceDontPropagateList(Window Id) XinputGetDeviceDontPropagateListCookie { +func (c *Conn) XinputGetDeviceDontPropagateList(Window Window) XinputGetDeviceDontPropagateListCookie { cookie := c.newCookie(true, true) c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) return XinputGetDeviceDontPropagateListCookie{cookie} } -func (c *Conn) XinputGetDeviceDontPropagateListUnchecked(Window Id) XinputGetDeviceDontPropagateListCookie { +func (c *Conn) XinputGetDeviceDontPropagateListUnchecked(Window Window) XinputGetDeviceDontPropagateListCookie { cookie := c.newCookie(false, true) c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) return XinputGetDeviceDontPropagateListCookie{cookie} @@ -5342,7 +5340,7 @@ func (cook XinputGetDeviceDontPropagateListCookie) Check() error { } // Write request to wire for XinputGetDeviceDontPropagateList -func (c *Conn) xinputGetDeviceDontPropagateListRequest(Window Id) []byte { +func (c *Conn) xinputGetDeviceDontPropagateListRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -5650,13 +5648,13 @@ type XinputGrabDeviceCookie struct { *cookie } -func (c *Conn) XinputGrabDevice(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { +func (c *Conn) XinputGrabDevice(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { cookie := c.newCookie(true, true) c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return XinputGrabDeviceCookie{cookie} } -func (c *Conn) XinputGrabDeviceUnchecked(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { +func (c *Conn) XinputGrabDeviceUnchecked(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { cookie := c.newCookie(false, true) c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return XinputGrabDeviceCookie{cookie} @@ -5710,7 +5708,7 @@ func (cook XinputGrabDeviceCookie) Check() error { } // Write request to wire for XinputGrabDevice -func (c *Conn) xinputGrabDeviceRequest(GrabWindow Id, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) []byte { +func (c *Conn) xinputGrabDeviceRequest(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) []byte { size := pad((20 + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) @@ -5814,13 +5812,13 @@ type XinputGrabDeviceKeyCookie struct { } // Write request to wire for XinputGrabDeviceKey -func (c *Conn) XinputGrabDeviceKey(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { +func (c *Conn) XinputGrabDeviceKey(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return XinputGrabDeviceKeyCookie{cookie} } -func (c *Conn) XinputGrabDeviceKeyChecked(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { +func (c *Conn) XinputGrabDeviceKeyChecked(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return XinputGrabDeviceKeyCookie{cookie} @@ -5831,7 +5829,7 @@ func (cook XinputGrabDeviceKeyCookie) Check() error { } // Write request to wire for XinputGrabDeviceKey -func (c *Conn) xinputGrabDeviceKeyRequest(GrabWindow Id, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) []byte { +func (c *Conn) xinputGrabDeviceKeyRequest(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) []byte { size := pad((20 + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) @@ -5894,13 +5892,13 @@ type XinputUngrabDeviceKeyCookie struct { } // Write request to wire for XinputUngrabDeviceKey -func (c *Conn) XinputUngrabDeviceKey(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { +func (c *Conn) XinputUngrabDeviceKey(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return XinputUngrabDeviceKeyCookie{cookie} } -func (c *Conn) XinputUngrabDeviceKeyChecked(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { +func (c *Conn) XinputUngrabDeviceKeyChecked(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return XinputUngrabDeviceKeyCookie{cookie} @@ -5911,7 +5909,7 @@ func (cook XinputUngrabDeviceKeyCookie) Check() error { } // Write request to wire for XinputUngrabDeviceKey -func (c *Conn) xinputUngrabDeviceKeyRequest(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { +func (c *Conn) xinputUngrabDeviceKeyRequest(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -5950,13 +5948,13 @@ type XinputGrabDeviceButtonCookie struct { } // Write request to wire for XinputGrabDeviceButton -func (c *Conn) XinputGrabDeviceButton(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { +func (c *Conn) XinputGrabDeviceButton(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return XinputGrabDeviceButtonCookie{cookie} } -func (c *Conn) XinputGrabDeviceButtonChecked(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { +func (c *Conn) XinputGrabDeviceButtonChecked(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return XinputGrabDeviceButtonCookie{cookie} @@ -5967,7 +5965,7 @@ func (cook XinputGrabDeviceButtonCookie) Check() error { } // Write request to wire for XinputGrabDeviceButton -func (c *Conn) xinputGrabDeviceButtonRequest(GrabWindow Id, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) []byte { +func (c *Conn) xinputGrabDeviceButtonRequest(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) []byte { size := pad((20 + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) @@ -6026,13 +6024,13 @@ type XinputUngrabDeviceButtonCookie struct { } // Write request to wire for XinputUngrabDeviceButton -func (c *Conn) XinputUngrabDeviceButton(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { +func (c *Conn) XinputUngrabDeviceButton(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return XinputUngrabDeviceButtonCookie{cookie} } -func (c *Conn) XinputUngrabDeviceButtonChecked(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { +func (c *Conn) XinputUngrabDeviceButtonChecked(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return XinputUngrabDeviceButtonCookie{cookie} @@ -6043,7 +6041,7 @@ func (cook XinputUngrabDeviceButtonCookie) Check() error { } // Write request to wire for XinputUngrabDeviceButton -func (c *Conn) xinputUngrabDeviceButtonRequest(GrabWindow Id, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { +func (c *Conn) xinputUngrabDeviceButtonRequest(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6149,7 +6147,7 @@ type XinputGetDeviceFocusReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Focus Id + Focus Window Time Timestamp RevertTo byte // padding: 15 bytes @@ -6180,7 +6178,7 @@ func xinputGetDeviceFocusReply(buf []byte) *XinputGetDeviceFocusReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Focus = Id(Get32(buf[b:])) + v.Focus = Window(Get32(buf[b:])) b += 4 v.Time = Timestamp(Get32(buf[b:])) @@ -6228,13 +6226,13 @@ type XinputSetDeviceFocusCookie struct { } // Write request to wire for XinputSetDeviceFocus -func (c *Conn) XinputSetDeviceFocus(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { +func (c *Conn) XinputSetDeviceFocus(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) return XinputSetDeviceFocusCookie{cookie} } -func (c *Conn) XinputSetDeviceFocusChecked(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { +func (c *Conn) XinputSetDeviceFocusChecked(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) return XinputSetDeviceFocusCookie{cookie} @@ -6245,7 +6243,7 @@ func (cook XinputSetDeviceFocusCookie) Check() error { } // Write request to wire for XinputSetDeviceFocus -func (c *Conn) xinputSetDeviceFocusRequest(Focus Id, Time Timestamp, RevertTo byte, DeviceId byte) []byte { +func (c *Conn) xinputSetDeviceFocusRequest(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6990,13 +6988,13 @@ type XinputSendExtensionEventCookie struct { } // Write request to wire for XinputSendExtensionEvent -func (c *Conn) XinputSendExtensionEvent(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { +func (c *Conn) XinputSendExtensionEvent(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { cookie := c.newCookie(false, false) c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return XinputSendExtensionEventCookie{cookie} } -func (c *Conn) XinputSendExtensionEventChecked(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { +func (c *Conn) XinputSendExtensionEventChecked(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { cookie := c.newCookie(true, false) c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return XinputSendExtensionEventCookie{cookie} @@ -7007,7 +7005,7 @@ func (cook XinputSendExtensionEventCookie) Check() error { } // Write request to wire for XinputSendExtensionEvent -func (c *Conn) xinputSendExtensionEventRequest(Destination Id, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) []byte { +func (c *Conn) xinputSendExtensionEventRequest(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) []byte { size := pad(((16 + pad(((int(NumEvents) * 32) * 1))) + pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go index 5cd086a..cab145e 100644 --- a/nexgb/auto_xprint.go +++ b/nexgb/auto_xprint.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xprint.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xprint.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,8 +37,6 @@ func init() { newExtErrorFuncs["XpExtension"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -59,10 +57,10 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + const ( XprintGetDocFinished = 0 XprintGetDocSecondConsumer = 1 @@ -93,7 +91,15 @@ const ( XprintAttrSpoolerAttr = 7 ) -// Skipping resource definition of 'Pcontext' +type XprintPcontext uint32 + +func (c *Conn) NewXprintPcontextId() (XprintPcontext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XprintPcontext(id), nil +} type XprintString8 byte @@ -198,7 +204,7 @@ const XprintNotify = 0 type XprintNotifyEvent struct { Sequence uint16 Detail byte - Context Id + Context XprintPcontext Cancel bool } @@ -213,7 +219,7 @@ func NewXprintNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Context = Id(Get32(buf[b:])) + v.Context = XprintPcontext(Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -280,7 +286,7 @@ const XprintAttributNotify = 1 type XprintAttributNotifyEvent struct { Sequence uint16 Detail byte - Context Id + Context XprintPcontext } // Event read XprintAttributNotify @@ -294,7 +300,7 @@ func NewXprintAttributNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Context = Id(Get32(buf[b:])) + v.Context = XprintPcontext(Get32(buf[b:])) b += 4 return v @@ -368,7 +374,7 @@ func (err XprintBadContextError) SequenceId() uint16 { return err.Sequence } -func (err XprintBadContextError) BadId() Id { +func (err XprintBadContextError) BadId() uint32 { return 0 } @@ -413,7 +419,7 @@ func (err XprintBadSequenceError) SequenceId() uint16 { return err.Sequence } -func (err XprintBadSequenceError) BadId() Id { +func (err XprintBadSequenceError) BadId() uint32 { return 0 } @@ -912,7 +918,7 @@ type XprintPrintGetScreenOfContextReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Root Id + Root Window } // Waits and reads reply data from request XprintPrintGetScreenOfContext @@ -940,7 +946,7 @@ func xprintPrintGetScreenOfContextReply(buf []byte) *XprintPrintGetScreenOfConte v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 return v @@ -1159,13 +1165,13 @@ type XprintPrintPutDocumentDataCookie struct { } // Write request to wire for XprintPrintPutDocumentData -func (c *Conn) XprintPrintPutDocumentData(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { +func (c *Conn) XprintPrintPutDocumentData(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { cookie := c.newCookie(false, false) c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return XprintPrintPutDocumentDataCookie{cookie} } -func (c *Conn) XprintPrintPutDocumentDataChecked(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { +func (c *Conn) XprintPrintPutDocumentDataChecked(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { cookie := c.newCookie(true, false) c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return XprintPrintPutDocumentDataCookie{cookie} @@ -1176,7 +1182,7 @@ func (cook XprintPrintPutDocumentDataCookie) Check() error { } // Write request to wire for XprintPrintPutDocumentData -func (c *Conn) xprintPrintPutDocumentDataRequest(Drawable Id, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) []byte { +func (c *Conn) xprintPrintPutDocumentDataRequest(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) []byte { size := pad((((16 + pad((int(LenData) * 1))) + pad((len(DocFormat) * 1))) + pad((len(Options) * 1)))) b := 0 buf := make([]byte, size) @@ -1226,13 +1232,13 @@ type XprintPrintGetDocumentDataCookie struct { *cookie } -func (c *Conn) XprintPrintGetDocumentData(Context Id, MaxBytes uint32) XprintPrintGetDocumentDataCookie { +func (c *Conn) XprintPrintGetDocumentData(Context XprintPcontext, MaxBytes uint32) XprintPrintGetDocumentDataCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) return XprintPrintGetDocumentDataCookie{cookie} } -func (c *Conn) XprintPrintGetDocumentDataUnchecked(Context Id, MaxBytes uint32) XprintPrintGetDocumentDataCookie { +func (c *Conn) XprintPrintGetDocumentDataUnchecked(Context XprintPcontext, MaxBytes uint32) XprintPrintGetDocumentDataCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) return XprintPrintGetDocumentDataCookie{cookie} @@ -1299,7 +1305,7 @@ func (cook XprintPrintGetDocumentDataCookie) Check() error { } // Write request to wire for XprintPrintGetDocumentData -func (c *Conn) xprintPrintGetDocumentDataRequest(Context Id, MaxBytes uint32) []byte { +func (c *Conn) xprintPrintGetDocumentDataRequest(Context XprintPcontext, MaxBytes uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1329,13 +1335,13 @@ type XprintPrintStartPageCookie struct { } // Write request to wire for XprintPrintStartPage -func (c *Conn) XprintPrintStartPage(Window Id) XprintPrintStartPageCookie { +func (c *Conn) XprintPrintStartPage(Window Window) XprintPrintStartPageCookie { cookie := c.newCookie(false, false) c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) return XprintPrintStartPageCookie{cookie} } -func (c *Conn) XprintPrintStartPageChecked(Window Id) XprintPrintStartPageCookie { +func (c *Conn) XprintPrintStartPageChecked(Window Window) XprintPrintStartPageCookie { cookie := c.newCookie(true, false) c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) return XprintPrintStartPageCookie{cookie} @@ -1346,7 +1352,7 @@ func (cook XprintPrintStartPageCookie) Check() error { } // Write request to wire for XprintPrintStartPage -func (c *Conn) xprintPrintStartPageRequest(Window Id) []byte { +func (c *Conn) xprintPrintStartPageRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1423,13 +1429,13 @@ type XprintPrintSelectInputCookie struct { } // Write request to wire for XprintPrintSelectInput -func (c *Conn) XprintPrintSelectInput(Context Id, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { +func (c *Conn) XprintPrintSelectInput(Context XprintPcontext, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) return XprintPrintSelectInputCookie{cookie} } -func (c *Conn) XprintPrintSelectInputChecked(Context Id, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { +func (c *Conn) XprintPrintSelectInputChecked(Context XprintPcontext, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) return XprintPrintSelectInputCookie{cookie} @@ -1440,7 +1446,7 @@ func (cook XprintPrintSelectInputCookie) Check() error { } // Write request to wire for XprintPrintSelectInput -func (c *Conn) xprintPrintSelectInputRequest(Context Id, EventMask uint32, EventList []uint32) []byte { +func (c *Conn) xprintPrintSelectInputRequest(Context XprintPcontext, EventMask uint32, EventList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(EventMask))))))) b := 0 buf := make([]byte, size) @@ -1474,13 +1480,13 @@ type XprintPrintInputSelectedCookie struct { *cookie } -func (c *Conn) XprintPrintInputSelected(Context Id) XprintPrintInputSelectedCookie { +func (c *Conn) XprintPrintInputSelected(Context XprintPcontext) XprintPrintInputSelectedCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) return XprintPrintInputSelectedCookie{cookie} } -func (c *Conn) XprintPrintInputSelectedUnchecked(Context Id) XprintPrintInputSelectedCookie { +func (c *Conn) XprintPrintInputSelectedUnchecked(Context XprintPcontext) XprintPrintInputSelectedCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) return XprintPrintInputSelectedCookie{cookie} @@ -1551,7 +1557,7 @@ func (cook XprintPrintInputSelectedCookie) Check() error { } // Write request to wire for XprintPrintInputSelected -func (c *Conn) xprintPrintInputSelectedRequest(Context Id) []byte { +func (c *Conn) xprintPrintInputSelectedRequest(Context XprintPcontext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1577,13 +1583,13 @@ type XprintPrintGetAttributesCookie struct { *cookie } -func (c *Conn) XprintPrintGetAttributes(Context Id, Pool byte) XprintPrintGetAttributesCookie { +func (c *Conn) XprintPrintGetAttributes(Context XprintPcontext, Pool byte) XprintPrintGetAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) return XprintPrintGetAttributesCookie{cookie} } -func (c *Conn) XprintPrintGetAttributesUnchecked(Context Id, Pool byte) XprintPrintGetAttributesCookie { +func (c *Conn) XprintPrintGetAttributesUnchecked(Context XprintPcontext, Pool byte) XprintPrintGetAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) return XprintPrintGetAttributesCookie{cookie} @@ -1641,7 +1647,7 @@ func (cook XprintPrintGetAttributesCookie) Check() error { } // Write request to wire for XprintPrintGetAttributes -func (c *Conn) xprintPrintGetAttributesRequest(Context Id, Pool byte) []byte { +func (c *Conn) xprintPrintGetAttributesRequest(Context XprintPcontext, Pool byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1672,13 +1678,13 @@ type XprintPrintGetOneAttributesCookie struct { *cookie } -func (c *Conn) XprintPrintGetOneAttributes(Context Id, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { +func (c *Conn) XprintPrintGetOneAttributes(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) return XprintPrintGetOneAttributesCookie{cookie} } -func (c *Conn) XprintPrintGetOneAttributesUnchecked(Context Id, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { +func (c *Conn) XprintPrintGetOneAttributesUnchecked(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) return XprintPrintGetOneAttributesCookie{cookie} @@ -1740,7 +1746,7 @@ func (cook XprintPrintGetOneAttributesCookie) Check() error { } // Write request to wire for XprintPrintGetOneAttributes -func (c *Conn) xprintPrintGetOneAttributesRequest(Context Id, NameLen uint32, Pool byte, Name []XprintString8) []byte { +func (c *Conn) xprintPrintGetOneAttributesRequest(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) []byte { size := pad((16 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -1781,13 +1787,13 @@ type XprintPrintSetAttributesCookie struct { } // Write request to wire for XprintPrintSetAttributes -func (c *Conn) XprintPrintSetAttributes(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { +func (c *Conn) XprintPrintSetAttributes(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { cookie := c.newCookie(false, false) c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) return XprintPrintSetAttributesCookie{cookie} } -func (c *Conn) XprintPrintSetAttributesChecked(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { +func (c *Conn) XprintPrintSetAttributesChecked(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { cookie := c.newCookie(true, false) c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) return XprintPrintSetAttributesCookie{cookie} @@ -1798,7 +1804,7 @@ func (cook XprintPrintSetAttributesCookie) Check() error { } // Write request to wire for XprintPrintSetAttributes -func (c *Conn) xprintPrintSetAttributesRequest(Context Id, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) []byte { +func (c *Conn) xprintPrintSetAttributesRequest(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) []byte { size := pad((16 + pad((len(Attributes) * 1)))) b := 0 buf := make([]byte, size) @@ -1841,13 +1847,13 @@ type XprintPrintGetPageDimensionsCookie struct { *cookie } -func (c *Conn) XprintPrintGetPageDimensions(Context Id) XprintPrintGetPageDimensionsCookie { +func (c *Conn) XprintPrintGetPageDimensions(Context XprintPcontext) XprintPrintGetPageDimensionsCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) return XprintPrintGetPageDimensionsCookie{cookie} } -func (c *Conn) XprintPrintGetPageDimensionsUnchecked(Context Id) XprintPrintGetPageDimensionsCookie { +func (c *Conn) XprintPrintGetPageDimensionsUnchecked(Context XprintPcontext) XprintPrintGetPageDimensionsCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) return XprintPrintGetPageDimensionsCookie{cookie} @@ -1918,7 +1924,7 @@ func (cook XprintPrintGetPageDimensionsCookie) Check() error { } // Write request to wire for XprintPrintGetPageDimensions -func (c *Conn) xprintPrintGetPageDimensionsRequest(Context Id) []byte { +func (c *Conn) xprintPrintGetPageDimensionsRequest(Context XprintPcontext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1964,7 +1970,7 @@ type XprintPrintQueryScreensReply struct { // padding: 1 bytes ListCount uint32 // padding: 20 bytes - Roots []Id // size: pad((int(ListCount) * 4)) + Roots []Window // size: pad((int(ListCount) * 4)) } // Waits and reads reply data from request XprintPrintQueryScreens @@ -1997,9 +2003,9 @@ func xprintPrintQueryScreensReply(buf []byte) *XprintPrintQueryScreensReply { b += 20 // padding - v.Roots = make([]Id, v.ListCount) + v.Roots = make([]Window, v.ListCount) for i := 0; i < int(v.ListCount); i++ { - v.Roots[i] = Id(Get32(buf[b:])) + v.Roots[i] = Window(Get32(buf[b:])) b += 4 } b = pad(b) @@ -2035,13 +2041,13 @@ type XprintPrintSetImageResolutionCookie struct { *cookie } -func (c *Conn) XprintPrintSetImageResolution(Context Id, ImageResolution uint16) XprintPrintSetImageResolutionCookie { +func (c *Conn) XprintPrintSetImageResolution(Context XprintPcontext, ImageResolution uint16) XprintPrintSetImageResolutionCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) return XprintPrintSetImageResolutionCookie{cookie} } -func (c *Conn) XprintPrintSetImageResolutionUnchecked(Context Id, ImageResolution uint16) XprintPrintSetImageResolutionCookie { +func (c *Conn) XprintPrintSetImageResolutionUnchecked(Context XprintPcontext, ImageResolution uint16) XprintPrintSetImageResolutionCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) return XprintPrintSetImageResolutionCookie{cookie} @@ -2097,7 +2103,7 @@ func (cook XprintPrintSetImageResolutionCookie) Check() error { } // Write request to wire for XprintPrintSetImageResolution -func (c *Conn) xprintPrintSetImageResolutionRequest(Context Id, ImageResolution uint16) []byte { +func (c *Conn) xprintPrintSetImageResolutionRequest(Context XprintPcontext, ImageResolution uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2126,13 +2132,13 @@ type XprintPrintGetImageResolutionCookie struct { *cookie } -func (c *Conn) XprintPrintGetImageResolution(Context Id) XprintPrintGetImageResolutionCookie { +func (c *Conn) XprintPrintGetImageResolution(Context XprintPcontext) XprintPrintGetImageResolutionCookie { cookie := c.newCookie(true, true) c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) return XprintPrintGetImageResolutionCookie{cookie} } -func (c *Conn) XprintPrintGetImageResolutionUnchecked(Context Id) XprintPrintGetImageResolutionCookie { +func (c *Conn) XprintPrintGetImageResolutionUnchecked(Context XprintPcontext) XprintPrintGetImageResolutionCookie { cookie := c.newCookie(false, true) c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) return XprintPrintGetImageResolutionCookie{cookie} @@ -2183,7 +2189,7 @@ func (cook XprintPrintGetImageResolutionCookie) Check() error { } // Write request to wire for XprintPrintGetImageResolution -func (c *Conn) xprintPrintGetImageResolutionRequest(Context Id) []byte { +func (c *Conn) xprintPrintGetImageResolutionRequest(Context XprintPcontext) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xproto.go b/nexgb/auto_xproto.go index 6e8e9ee..8bd39b3 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/auto_xproto.go @@ -1,20 +1,10 @@ package xgb /* - This file was generated by xproto.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xproto.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -29,7 +19,15 @@ package xgb // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' const ( VisualClassStaticGray = 0 @@ -617,23 +615,95 @@ const ( MapIndex5 = 7 ) -// Skipping resource definition of 'Window' +type Window uint32 -// Skipping resource definition of 'Pixmap' +func (c *Conn) NewWindowId() (Window, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Window(id), nil +} -// Skipping resource definition of 'Cursor' +type Pixmap uint32 -// Skipping resource definition of 'Font' +func (c *Conn) NewPixmapId() (Pixmap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pixmap(id), nil +} -// Skipping resource definition of 'Gcontext' +type Cursor uint32 -// Skipping resource definition of 'Colormap' +func (c *Conn) NewCursorId() (Cursor, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Cursor(id), nil +} -// Skipping resource definition of 'Atom' +type Font uint32 -// Skipping resource definition of 'Drawable' +func (c *Conn) NewFontId() (Font, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Font(id), nil +} -// Skipping resource definition of 'Fontable' +type Gcontext uint32 + +func (c *Conn) NewGcontextId() (Gcontext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Gcontext(id), nil +} + +type Colormap uint32 + +func (c *Conn) NewColormapId() (Colormap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Colormap(id), nil +} + +type Atom uint32 + +func (c *Conn) NewAtomId() (Atom, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Atom(id), nil +} + +type Drawable uint32 + +func (c *Conn) NewDrawableId() (Drawable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Drawable(id), nil +} + +type Fontable uint32 + +func (c *Conn) NewFontableId() (Fontable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Fontable(id), nil +} type Visualid uint32 @@ -1159,8 +1229,8 @@ func DepthInfoListSize(list []DepthInfo) int { // 'ScreenInfo' struct definition // Size: (40 + DepthInfoListSize(AllowedDepths)) type ScreenInfo struct { - Root Id - DefaultColormap Id + Root Window + DefaultColormap Colormap WhitePixel uint32 BlackPixel uint32 CurrentInputMasks uint32 @@ -1182,10 +1252,10 @@ type ScreenInfo struct { func ReadScreenInfo(buf []byte, v *ScreenInfo) int { b := 0 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.DefaultColormap = Id(Get32(buf[b:])) + v.DefaultColormap = Colormap(Get32(buf[b:])) b += 4 v.WhitePixel = Get32(buf[b:]) @@ -1905,7 +1975,7 @@ func TimecoordListBytes(buf []byte, list []Timecoord) int { // 'Fontprop' struct definition // Size: 8 type Fontprop struct { - Name Id + Name Atom Value uint32 } @@ -1913,7 +1983,7 @@ type Fontprop struct { func ReadFontprop(buf []byte, v *Fontprop) int { b := 0 - v.Name = Id(Get32(buf[b:])) + v.Name = Atom(Get32(buf[b:])) b += 4 v.Value = Get32(buf[b:]) @@ -2610,9 +2680,9 @@ type KeyPressEvent struct { Sequence uint16 Detail Keycode Time Timestamp - Root Id - Event Id - Child Id + Root Window + Event Window + Child Window RootX int16 RootY int16 EventX int16 @@ -2636,13 +2706,13 @@ func NewKeyPressEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -2761,9 +2831,9 @@ type ButtonPressEvent struct { Sequence uint16 Detail Button Time Timestamp - Root Id - Event Id - Child Id + Root Window + Event Window + Child Window RootX int16 RootY int16 EventX int16 @@ -2787,13 +2857,13 @@ func NewButtonPressEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -2912,9 +2982,9 @@ type MotionNotifyEvent struct { Sequence uint16 Detail byte Time Timestamp - Root Id - Event Id - Child Id + Root Window + Event Window + Child Window RootX int16 RootY int16 EventX int16 @@ -2938,13 +3008,13 @@ func NewMotionNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -3063,9 +3133,9 @@ type EnterNotifyEvent struct { Sequence uint16 Detail byte Time Timestamp - Root Id - Event Id - Child Id + Root Window + Event Window + Child Window RootX int16 RootY int16 EventX int16 @@ -3089,13 +3159,13 @@ func NewEnterNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -3208,7 +3278,7 @@ const FocusIn = 9 type FocusInEvent struct { Sequence uint16 Detail byte - Event Id + Event Window Mode byte // padding: 3 bytes } @@ -3224,7 +3294,7 @@ func NewFocusInEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 v.Mode = buf[b] @@ -3338,7 +3408,7 @@ const Expose = 12 type ExposeEvent struct { Sequence uint16 // padding: 1 bytes - Window Id + Window Window X uint16 Y uint16 Width uint16 @@ -3357,7 +3427,7 @@ func NewExposeEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.X = Get16(buf[b:]) @@ -3446,7 +3516,7 @@ const GraphicsExposure = 13 type GraphicsExposureEvent struct { Sequence uint16 // padding: 1 bytes - Drawable Id + Drawable Drawable X uint16 Y uint16 Width uint16 @@ -3467,7 +3537,7 @@ func NewGraphicsExposureEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 v.X = Get16(buf[b:]) @@ -3570,7 +3640,7 @@ const NoExposure = 14 type NoExposureEvent struct { Sequence uint16 // padding: 1 bytes - Drawable Id + Drawable Drawable MinorOpcode uint16 MajorOpcode byte // padding: 1 bytes @@ -3586,7 +3656,7 @@ func NewNoExposureEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 v.MinorOpcode = Get16(buf[b:]) @@ -3654,7 +3724,7 @@ const VisibilityNotify = 15 type VisibilityNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Id + Window Window State byte // padding: 3 bytes } @@ -3669,7 +3739,7 @@ func NewVisibilityNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.State = buf[b] @@ -3730,8 +3800,8 @@ const CreateNotify = 16 type CreateNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Parent Id - Window Id + Parent Window + Window Window X int16 Y int16 Width uint16 @@ -3751,10 +3821,10 @@ func NewCreateNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Parent = Id(Get32(buf[b:])) + v.Parent = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -3862,8 +3932,8 @@ const DestroyNotify = 17 type DestroyNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id + Event Window + Window Window } // Event read DestroyNotify @@ -3876,10 +3946,10 @@ func NewDestroyNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 return v @@ -3933,8 +4003,8 @@ const UnmapNotify = 18 type UnmapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id + Event Window + Window Window FromConfigure bool // padding: 3 bytes } @@ -3949,10 +4019,10 @@ func NewUnmapNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -4025,8 +4095,8 @@ const MapNotify = 19 type MapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id + Event Window + Window Window OverrideRedirect bool // padding: 3 bytes } @@ -4041,10 +4111,10 @@ func NewMapNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -4117,8 +4187,8 @@ const MapRequest = 20 type MapRequestEvent struct { Sequence uint16 // padding: 1 bytes - Parent Id - Window Id + Parent Window + Window Window } // Event read MapRequest @@ -4131,10 +4201,10 @@ func NewMapRequestEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Parent = Id(Get32(buf[b:])) + v.Parent = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 return v @@ -4188,9 +4258,9 @@ const ReparentNotify = 21 type ReparentNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id - Parent Id + Event Window + Window Window + Parent Window X int16 Y int16 OverrideRedirect bool @@ -4207,13 +4277,13 @@ func NewReparentNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Parent = Id(Get32(buf[b:])) + v.Parent = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -4304,9 +4374,9 @@ const ConfigureNotify = 22 type ConfigureNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id - AboveSibling Id + Event Window + Window Window + AboveSibling Window X int16 Y int16 Width uint16 @@ -4326,13 +4396,13 @@ func NewConfigureNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.AboveSibling = Id(Get32(buf[b:])) + v.AboveSibling = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -4444,9 +4514,9 @@ const ConfigureRequest = 23 type ConfigureRequestEvent struct { Sequence uint16 StackMode byte - Parent Id - Window Id - Sibling Id + Parent Window + Window Window + Sibling Window X int16 Y int16 Width uint16 @@ -4466,13 +4536,13 @@ func NewConfigureRequestEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Parent = Id(Get32(buf[b:])) + v.Parent = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Sibling = Id(Get32(buf[b:])) + v.Sibling = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -4574,8 +4644,8 @@ const GravityNotify = 24 type GravityNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id + Event Window + Window Window X int16 Y int16 } @@ -4590,10 +4660,10 @@ func NewGravityNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -4661,7 +4731,7 @@ const ResizeRequest = 25 type ResizeRequestEvent struct { Sequence uint16 // padding: 1 bytes - Window Id + Window Window Width uint16 Height uint16 } @@ -4676,7 +4746,7 @@ func NewResizeRequestEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 v.Width = Get16(buf[b:]) @@ -4740,8 +4810,8 @@ const CirculateNotify = 26 type CirculateNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Id - Window Id + Event Window + Window Window // padding: 4 bytes Place byte // padding: 3 bytes @@ -4757,10 +4827,10 @@ func NewCirculateNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Event = Id(Get32(buf[b:])) + v.Event = Window(Get32(buf[b:])) b += 4 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 b += 4 // padding @@ -4829,8 +4899,8 @@ const PropertyNotify = 28 type PropertyNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Id - Atom Id + Window Window + Atom Atom Time Timestamp State byte // padding: 3 bytes @@ -4846,10 +4916,10 @@ func NewPropertyNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Atom = Id(Get32(buf[b:])) + v.Atom = Atom(Get32(buf[b:])) b += 4 v.Time = Timestamp(Get32(buf[b:])) @@ -4922,8 +4992,8 @@ type SelectionClearEvent struct { Sequence uint16 // padding: 1 bytes Time Timestamp - Owner Id - Selection Id + Owner Window + Selection Atom } // Event read SelectionClear @@ -4939,10 +5009,10 @@ func NewSelectionClearEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Owner = Id(Get32(buf[b:])) + v.Owner = Window(Get32(buf[b:])) b += 4 - v.Selection = Id(Get32(buf[b:])) + v.Selection = Atom(Get32(buf[b:])) b += 4 return v @@ -5001,11 +5071,11 @@ type SelectionRequestEvent struct { Sequence uint16 // padding: 1 bytes Time Timestamp - Owner Id - Requestor Id - Selection Id - Target Id - Property Id + Owner Window + Requestor Window + Selection Atom + Target Atom + Property Atom } // Event read SelectionRequest @@ -5021,19 +5091,19 @@ func NewSelectionRequestEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Owner = Id(Get32(buf[b:])) + v.Owner = Window(Get32(buf[b:])) b += 4 - v.Requestor = Id(Get32(buf[b:])) + v.Requestor = Window(Get32(buf[b:])) b += 4 - v.Selection = Id(Get32(buf[b:])) + v.Selection = Atom(Get32(buf[b:])) b += 4 - v.Target = Id(Get32(buf[b:])) + v.Target = Atom(Get32(buf[b:])) b += 4 - v.Property = Id(Get32(buf[b:])) + v.Property = Atom(Get32(buf[b:])) b += 4 return v @@ -5104,10 +5174,10 @@ type SelectionNotifyEvent struct { Sequence uint16 // padding: 1 bytes Time Timestamp - Requestor Id - Selection Id - Target Id - Property Id + Requestor Window + Selection Atom + Target Atom + Property Atom } // Event read SelectionNotify @@ -5123,16 +5193,16 @@ func NewSelectionNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Requestor = Id(Get32(buf[b:])) + v.Requestor = Window(Get32(buf[b:])) b += 4 - v.Selection = Id(Get32(buf[b:])) + v.Selection = Atom(Get32(buf[b:])) b += 4 - v.Target = Id(Get32(buf[b:])) + v.Target = Atom(Get32(buf[b:])) b += 4 - v.Property = Id(Get32(buf[b:])) + v.Property = Atom(Get32(buf[b:])) b += 4 return v @@ -5198,8 +5268,8 @@ const ColormapNotify = 32 type ColormapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Id - Colormap Id + Window Window + Colormap Colormap New bool State byte // padding: 2 bytes @@ -5215,10 +5285,10 @@ func NewColormapNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Colormap = Id(Get32(buf[b:])) + v.Colormap = Colormap(Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -5298,8 +5368,8 @@ const ClientMessage = 33 type ClientMessageEvent struct { Sequence uint16 Format byte - Window Id - Type Id + Window Window + Type Atom Data ClientMessageDataUnion } @@ -5314,10 +5384,10 @@ func NewClientMessageEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Window = Id(Get32(buf[b:])) + v.Window = Window(Get32(buf[b:])) b += 4 - v.Type = Id(Get32(buf[b:])) + v.Type = Atom(Get32(buf[b:])) b += 4 v.Data = ClientMessageDataUnion{} @@ -5693,8 +5763,8 @@ func (err RequestError) SequenceId() uint16 { return err.Sequence } -func (err RequestError) BadId() Id { - return Id(err.BadValue) +func (err RequestError) BadId() uint32 { + return err.BadValue } func (err RequestError) Error() string { @@ -5756,8 +5826,8 @@ func (err ValueError) SequenceId() uint16 { return err.Sequence } -func (err ValueError) BadId() Id { - return Id(err.BadValue) +func (err ValueError) BadId() uint32 { + return err.BadValue } func (err ValueError) Error() string { @@ -5792,8 +5862,8 @@ func (err WindowError) SequenceId() uint16 { return err.Sequence } -func (err WindowError) BadId() Id { - return Id(err.BadValue) +func (err WindowError) BadId() uint32 { + return err.BadValue } func (err WindowError) Error() string { @@ -5828,8 +5898,8 @@ func (err PixmapError) SequenceId() uint16 { return err.Sequence } -func (err PixmapError) BadId() Id { - return Id(err.BadValue) +func (err PixmapError) BadId() uint32 { + return err.BadValue } func (err PixmapError) Error() string { @@ -5864,8 +5934,8 @@ func (err AtomError) SequenceId() uint16 { return err.Sequence } -func (err AtomError) BadId() Id { - return Id(err.BadValue) +func (err AtomError) BadId() uint32 { + return err.BadValue } func (err AtomError) Error() string { @@ -5900,8 +5970,8 @@ func (err CursorError) SequenceId() uint16 { return err.Sequence } -func (err CursorError) BadId() Id { - return Id(err.BadValue) +func (err CursorError) BadId() uint32 { + return err.BadValue } func (err CursorError) Error() string { @@ -5936,8 +6006,8 @@ func (err FontError) SequenceId() uint16 { return err.Sequence } -func (err FontError) BadId() Id { - return Id(err.BadValue) +func (err FontError) BadId() uint32 { + return err.BadValue } func (err FontError) Error() string { @@ -5972,8 +6042,8 @@ func (err MatchError) SequenceId() uint16 { return err.Sequence } -func (err MatchError) BadId() Id { - return Id(err.BadValue) +func (err MatchError) BadId() uint32 { + return err.BadValue } func (err MatchError) Error() string { @@ -6008,8 +6078,8 @@ func (err DrawableError) SequenceId() uint16 { return err.Sequence } -func (err DrawableError) BadId() Id { - return Id(err.BadValue) +func (err DrawableError) BadId() uint32 { + return err.BadValue } func (err DrawableError) Error() string { @@ -6044,8 +6114,8 @@ func (err AccessError) SequenceId() uint16 { return err.Sequence } -func (err AccessError) BadId() Id { - return Id(err.BadValue) +func (err AccessError) BadId() uint32 { + return err.BadValue } func (err AccessError) Error() string { @@ -6080,8 +6150,8 @@ func (err AllocError) SequenceId() uint16 { return err.Sequence } -func (err AllocError) BadId() Id { - return Id(err.BadValue) +func (err AllocError) BadId() uint32 { + return err.BadValue } func (err AllocError) Error() string { @@ -6116,8 +6186,8 @@ func (err ColormapError) SequenceId() uint16 { return err.Sequence } -func (err ColormapError) BadId() Id { - return Id(err.BadValue) +func (err ColormapError) BadId() uint32 { + return err.BadValue } func (err ColormapError) Error() string { @@ -6152,8 +6222,8 @@ func (err GContextError) SequenceId() uint16 { return err.Sequence } -func (err GContextError) BadId() Id { - return Id(err.BadValue) +func (err GContextError) BadId() uint32 { + return err.BadValue } func (err GContextError) Error() string { @@ -6188,8 +6258,8 @@ func (err IDChoiceError) SequenceId() uint16 { return err.Sequence } -func (err IDChoiceError) BadId() Id { - return Id(err.BadValue) +func (err IDChoiceError) BadId() uint32 { + return err.BadValue } func (err IDChoiceError) Error() string { @@ -6224,8 +6294,8 @@ func (err NameError) SequenceId() uint16 { return err.Sequence } -func (err NameError) BadId() Id { - return Id(err.BadValue) +func (err NameError) BadId() uint32 { + return err.BadValue } func (err NameError) Error() string { @@ -6260,8 +6330,8 @@ func (err LengthError) SequenceId() uint16 { return err.Sequence } -func (err LengthError) BadId() Id { - return Id(err.BadValue) +func (err LengthError) BadId() uint32 { + return err.BadValue } func (err LengthError) Error() string { @@ -6296,8 +6366,8 @@ func (err ImplementationError) SequenceId() uint16 { return err.Sequence } -func (err ImplementationError) BadId() Id { - return Id(err.BadValue) +func (err ImplementationError) BadId() uint32 { + return err.BadValue } func (err ImplementationError) Error() string { @@ -6321,13 +6391,13 @@ type CreateWindowCookie struct { } // Write request to wire for CreateWindow -func (c *Conn) CreateWindow(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { +func (c *Conn) CreateWindow(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } -func (c *Conn) CreateWindowChecked(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { +func (c *Conn) CreateWindowChecked(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} @@ -6338,7 +6408,7 @@ func (cook CreateWindowCookie) Check() error { } // Write request to wire for CreateWindow -func (c *Conn) createWindowRequest(Depth byte, Wid Id, Parent Id, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) createWindowRequest(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6397,13 +6467,13 @@ type ChangeWindowAttributesCookie struct { } // Write request to wire for ChangeWindowAttributes -func (c *Conn) ChangeWindowAttributes(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { +func (c *Conn) ChangeWindowAttributes(Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.newCookie(false, false) c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } -func (c *Conn) ChangeWindowAttributesChecked(Window Id, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { +func (c *Conn) ChangeWindowAttributesChecked(Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.newCookie(true, false) c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} @@ -6414,7 +6484,7 @@ func (cook ChangeWindowAttributesCookie) Check() error { } // Write request to wire for ChangeWindowAttributes -func (c *Conn) changeWindowAttributesRequest(Window Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) changeWindowAttributesRequest(Window Window, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6447,13 +6517,13 @@ type GetWindowAttributesCookie struct { *cookie } -func (c *Conn) GetWindowAttributes(Window Id) GetWindowAttributesCookie { +func (c *Conn) GetWindowAttributes(Window Window) GetWindowAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.getWindowAttributesRequest(Window), cookie) return GetWindowAttributesCookie{cookie} } -func (c *Conn) GetWindowAttributesUnchecked(Window Id) GetWindowAttributesCookie { +func (c *Conn) GetWindowAttributesUnchecked(Window Window) GetWindowAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.getWindowAttributesRequest(Window), cookie) return GetWindowAttributesCookie{cookie} @@ -6475,7 +6545,7 @@ type GetWindowAttributesReply struct { MapIsInstalled bool MapState byte OverrideRedirect bool - Colormap Id + Colormap Colormap AllEventMasks uint32 YourEventMask uint32 DoNotPropagateMask uint16 @@ -6550,7 +6620,7 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { } b += 1 - v.Colormap = Id(Get32(buf[b:])) + v.Colormap = Colormap(Get32(buf[b:])) b += 4 v.AllEventMasks = Get32(buf[b:]) @@ -6572,7 +6642,7 @@ func (cook GetWindowAttributesCookie) Check() error { } // Write request to wire for GetWindowAttributes -func (c *Conn) getWindowAttributesRequest(Window Id) []byte { +func (c *Conn) getWindowAttributesRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6598,13 +6668,13 @@ type DestroyWindowCookie struct { } // Write request to wire for DestroyWindow -func (c *Conn) DestroyWindow(Window Id) DestroyWindowCookie { +func (c *Conn) DestroyWindow(Window Window) DestroyWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.destroyWindowRequest(Window), cookie) return DestroyWindowCookie{cookie} } -func (c *Conn) DestroyWindowChecked(Window Id) DestroyWindowCookie { +func (c *Conn) DestroyWindowChecked(Window Window) DestroyWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.destroyWindowRequest(Window), cookie) return DestroyWindowCookie{cookie} @@ -6615,7 +6685,7 @@ func (cook DestroyWindowCookie) Check() error { } // Write request to wire for DestroyWindow -func (c *Conn) destroyWindowRequest(Window Id) []byte { +func (c *Conn) destroyWindowRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6641,13 +6711,13 @@ type DestroySubwindowsCookie struct { } // Write request to wire for DestroySubwindows -func (c *Conn) DestroySubwindows(Window Id) DestroySubwindowsCookie { +func (c *Conn) DestroySubwindows(Window Window) DestroySubwindowsCookie { cookie := c.newCookie(false, false) c.newRequest(c.destroySubwindowsRequest(Window), cookie) return DestroySubwindowsCookie{cookie} } -func (c *Conn) DestroySubwindowsChecked(Window Id) DestroySubwindowsCookie { +func (c *Conn) DestroySubwindowsChecked(Window Window) DestroySubwindowsCookie { cookie := c.newCookie(true, false) c.newRequest(c.destroySubwindowsRequest(Window), cookie) return DestroySubwindowsCookie{cookie} @@ -6658,7 +6728,7 @@ func (cook DestroySubwindowsCookie) Check() error { } // Write request to wire for DestroySubwindows -func (c *Conn) destroySubwindowsRequest(Window Id) []byte { +func (c *Conn) destroySubwindowsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6684,13 +6754,13 @@ type ChangeSaveSetCookie struct { } // Write request to wire for ChangeSaveSet -func (c *Conn) ChangeSaveSet(Mode byte, Window Id) ChangeSaveSetCookie { +func (c *Conn) ChangeSaveSet(Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.newCookie(false, false) c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } -func (c *Conn) ChangeSaveSetChecked(Mode byte, Window Id) ChangeSaveSetCookie { +func (c *Conn) ChangeSaveSetChecked(Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.newCookie(true, false) c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) return ChangeSaveSetCookie{cookie} @@ -6701,7 +6771,7 @@ func (cook ChangeSaveSetCookie) Check() error { } // Write request to wire for ChangeSaveSet -func (c *Conn) changeSaveSetRequest(Mode byte, Window Id) []byte { +func (c *Conn) changeSaveSetRequest(Mode byte, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6728,13 +6798,13 @@ type ReparentWindowCookie struct { } // Write request to wire for ReparentWindow -func (c *Conn) ReparentWindow(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { +func (c *Conn) ReparentWindow(Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } -func (c *Conn) ReparentWindowChecked(Window Id, Parent Id, X int16, Y int16) ReparentWindowCookie { +func (c *Conn) ReparentWindowChecked(Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} @@ -6745,7 +6815,7 @@ func (cook ReparentWindowCookie) Check() error { } // Write request to wire for ReparentWindow -func (c *Conn) reparentWindowRequest(Window Id, Parent Id, X int16, Y int16) []byte { +func (c *Conn) reparentWindowRequest(Window Window, Parent Window, X int16, Y int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6780,13 +6850,13 @@ type MapWindowCookie struct { } // Write request to wire for MapWindow -func (c *Conn) MapWindow(Window Id) MapWindowCookie { +func (c *Conn) MapWindow(Window Window) MapWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.mapWindowRequest(Window), cookie) return MapWindowCookie{cookie} } -func (c *Conn) MapWindowChecked(Window Id) MapWindowCookie { +func (c *Conn) MapWindowChecked(Window Window) MapWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.mapWindowRequest(Window), cookie) return MapWindowCookie{cookie} @@ -6797,7 +6867,7 @@ func (cook MapWindowCookie) Check() error { } // Write request to wire for MapWindow -func (c *Conn) mapWindowRequest(Window Id) []byte { +func (c *Conn) mapWindowRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6823,13 +6893,13 @@ type MapSubwindowsCookie struct { } // Write request to wire for MapSubwindows -func (c *Conn) MapSubwindows(Window Id) MapSubwindowsCookie { +func (c *Conn) MapSubwindows(Window Window) MapSubwindowsCookie { cookie := c.newCookie(false, false) c.newRequest(c.mapSubwindowsRequest(Window), cookie) return MapSubwindowsCookie{cookie} } -func (c *Conn) MapSubwindowsChecked(Window Id) MapSubwindowsCookie { +func (c *Conn) MapSubwindowsChecked(Window Window) MapSubwindowsCookie { cookie := c.newCookie(true, false) c.newRequest(c.mapSubwindowsRequest(Window), cookie) return MapSubwindowsCookie{cookie} @@ -6840,7 +6910,7 @@ func (cook MapSubwindowsCookie) Check() error { } // Write request to wire for MapSubwindows -func (c *Conn) mapSubwindowsRequest(Window Id) []byte { +func (c *Conn) mapSubwindowsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6866,13 +6936,13 @@ type UnmapWindowCookie struct { } // Write request to wire for UnmapWindow -func (c *Conn) UnmapWindow(Window Id) UnmapWindowCookie { +func (c *Conn) UnmapWindow(Window Window) UnmapWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.unmapWindowRequest(Window), cookie) return UnmapWindowCookie{cookie} } -func (c *Conn) UnmapWindowChecked(Window Id) UnmapWindowCookie { +func (c *Conn) UnmapWindowChecked(Window Window) UnmapWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.unmapWindowRequest(Window), cookie) return UnmapWindowCookie{cookie} @@ -6883,7 +6953,7 @@ func (cook UnmapWindowCookie) Check() error { } // Write request to wire for UnmapWindow -func (c *Conn) unmapWindowRequest(Window Id) []byte { +func (c *Conn) unmapWindowRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6909,13 +6979,13 @@ type UnmapSubwindowsCookie struct { } // Write request to wire for UnmapSubwindows -func (c *Conn) UnmapSubwindows(Window Id) UnmapSubwindowsCookie { +func (c *Conn) UnmapSubwindows(Window Window) UnmapSubwindowsCookie { cookie := c.newCookie(false, false) c.newRequest(c.unmapSubwindowsRequest(Window), cookie) return UnmapSubwindowsCookie{cookie} } -func (c *Conn) UnmapSubwindowsChecked(Window Id) UnmapSubwindowsCookie { +func (c *Conn) UnmapSubwindowsChecked(Window Window) UnmapSubwindowsCookie { cookie := c.newCookie(true, false) c.newRequest(c.unmapSubwindowsRequest(Window), cookie) return UnmapSubwindowsCookie{cookie} @@ -6926,7 +6996,7 @@ func (cook UnmapSubwindowsCookie) Check() error { } // Write request to wire for UnmapSubwindows -func (c *Conn) unmapSubwindowsRequest(Window Id) []byte { +func (c *Conn) unmapSubwindowsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6952,13 +7022,13 @@ type ConfigureWindowCookie struct { } // Write request to wire for ConfigureWindow -func (c *Conn) ConfigureWindow(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { +func (c *Conn) ConfigureWindow(Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } -func (c *Conn) ConfigureWindowChecked(Window Id, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { +func (c *Conn) ConfigureWindowChecked(Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} @@ -6969,7 +7039,7 @@ func (cook ConfigureWindowCookie) Check() error { } // Write request to wire for ConfigureWindow -func (c *Conn) configureWindowRequest(Window Id, ValueMask uint16, ValueList []uint32) []byte { +func (c *Conn) configureWindowRequest(Window Window, ValueMask uint16, ValueList []uint32) []byte { size := pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -7006,13 +7076,13 @@ type CirculateWindowCookie struct { } // Write request to wire for CirculateWindow -func (c *Conn) CirculateWindow(Direction byte, Window Id) CirculateWindowCookie { +func (c *Conn) CirculateWindow(Direction byte, Window Window) CirculateWindowCookie { cookie := c.newCookie(false, false) c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) return CirculateWindowCookie{cookie} } -func (c *Conn) CirculateWindowChecked(Direction byte, Window Id) CirculateWindowCookie { +func (c *Conn) CirculateWindowChecked(Direction byte, Window Window) CirculateWindowCookie { cookie := c.newCookie(true, false) c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) return CirculateWindowCookie{cookie} @@ -7023,7 +7093,7 @@ func (cook CirculateWindowCookie) Check() error { } // Write request to wire for CirculateWindow -func (c *Conn) circulateWindowRequest(Direction byte, Window Id) []byte { +func (c *Conn) circulateWindowRequest(Direction byte, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7049,13 +7119,13 @@ type GetGeometryCookie struct { *cookie } -func (c *Conn) GetGeometry(Drawable Id) GetGeometryCookie { +func (c *Conn) GetGeometry(Drawable Drawable) GetGeometryCookie { cookie := c.newCookie(true, true) c.newRequest(c.getGeometryRequest(Drawable), cookie) return GetGeometryCookie{cookie} } -func (c *Conn) GetGeometryUnchecked(Drawable Id) GetGeometryCookie { +func (c *Conn) GetGeometryUnchecked(Drawable Drawable) GetGeometryCookie { cookie := c.newCookie(false, true) c.newRequest(c.getGeometryRequest(Drawable), cookie) return GetGeometryCookie{cookie} @@ -7067,7 +7137,7 @@ type GetGeometryReply struct { Sequence uint16 Length uint32 Depth byte - Root Id + Root Window X int16 Y int16 Width uint16 @@ -7102,7 +7172,7 @@ func getGeometryReply(buf []byte) *GetGeometryReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 v.X = int16(Get16(buf[b:])) @@ -7130,7 +7200,7 @@ func (cook GetGeometryCookie) Check() error { } // Write request to wire for GetGeometry -func (c *Conn) getGeometryRequest(Drawable Id) []byte { +func (c *Conn) getGeometryRequest(Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7155,13 +7225,13 @@ type QueryTreeCookie struct { *cookie } -func (c *Conn) QueryTree(Window Id) QueryTreeCookie { +func (c *Conn) QueryTree(Window Window) QueryTreeCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryTreeRequest(Window), cookie) return QueryTreeCookie{cookie} } -func (c *Conn) QueryTreeUnchecked(Window Id) QueryTreeCookie { +func (c *Conn) QueryTreeUnchecked(Window Window) QueryTreeCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryTreeRequest(Window), cookie) return QueryTreeCookie{cookie} @@ -7173,11 +7243,11 @@ type QueryTreeReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Root Id - Parent Id + Root Window + Parent Window ChildrenLen uint16 // padding: 14 bytes - Children []Id // size: pad((int(ChildrenLen) * 4)) + Children []Window // size: pad((int(ChildrenLen) * 4)) } // Waits and reads reply data from request QueryTree @@ -7205,10 +7275,10 @@ func queryTreeReply(buf []byte) *QueryTreeReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Parent = Id(Get32(buf[b:])) + v.Parent = Window(Get32(buf[b:])) b += 4 v.ChildrenLen = Get16(buf[b:]) @@ -7216,9 +7286,9 @@ func queryTreeReply(buf []byte) *QueryTreeReply { b += 14 // padding - v.Children = make([]Id, v.ChildrenLen) + v.Children = make([]Window, v.ChildrenLen) for i := 0; i < int(v.ChildrenLen); i++ { - v.Children[i] = Id(Get32(buf[b:])) + v.Children[i] = Window(Get32(buf[b:])) b += 4 } b = pad(b) @@ -7231,7 +7301,7 @@ func (cook QueryTreeCookie) Check() error { } // Write request to wire for QueryTree -func (c *Conn) queryTreeRequest(Window Id) []byte { +func (c *Conn) queryTreeRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7274,7 +7344,7 @@ type InternAtomReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Atom Id + Atom Atom } // Waits and reads reply data from request InternAtom @@ -7302,7 +7372,7 @@ func internAtomReply(buf []byte) *InternAtomReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Atom = Id(Get32(buf[b:])) + v.Atom = Atom(Get32(buf[b:])) b += 4 return v @@ -7348,13 +7418,13 @@ type GetAtomNameCookie struct { *cookie } -func (c *Conn) GetAtomName(Atom Id) GetAtomNameCookie { +func (c *Conn) GetAtomName(Atom Atom) GetAtomNameCookie { cookie := c.newCookie(true, true) c.newRequest(c.getAtomNameRequest(Atom), cookie) return GetAtomNameCookie{cookie} } -func (c *Conn) GetAtomNameUnchecked(Atom Id) GetAtomNameCookie { +func (c *Conn) GetAtomNameUnchecked(Atom Atom) GetAtomNameCookie { cookie := c.newCookie(false, true) c.newRequest(c.getAtomNameRequest(Atom), cookie) return GetAtomNameCookie{cookie} @@ -7416,7 +7486,7 @@ func (cook GetAtomNameCookie) Check() error { } // Write request to wire for GetAtomName -func (c *Conn) getAtomNameRequest(Atom Id) []byte { +func (c *Conn) getAtomNameRequest(Atom Atom) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7442,13 +7512,13 @@ type ChangePropertyCookie struct { } // Write request to wire for ChangeProperty -func (c *Conn) ChangeProperty(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { +func (c *Conn) ChangeProperty(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.newCookie(false, false) c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } -func (c *Conn) ChangePropertyChecked(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { +func (c *Conn) ChangePropertyChecked(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.newCookie(true, false) c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} @@ -7459,7 +7529,7 @@ func (cook ChangePropertyCookie) Check() error { } // Write request to wire for ChangeProperty -func (c *Conn) changePropertyRequest(Mode byte, Window Id, Property Id, Type Id, Format byte, DataLen uint32, Data []byte) []byte { +func (c *Conn) changePropertyRequest(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { size := pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 buf := make([]byte, size) @@ -7503,13 +7573,13 @@ type DeletePropertyCookie struct { } // Write request to wire for DeleteProperty -func (c *Conn) DeleteProperty(Window Id, Property Id) DeletePropertyCookie { +func (c *Conn) DeleteProperty(Window Window, Property Atom) DeletePropertyCookie { cookie := c.newCookie(false, false) c.newRequest(c.deletePropertyRequest(Window, Property), cookie) return DeletePropertyCookie{cookie} } -func (c *Conn) DeletePropertyChecked(Window Id, Property Id) DeletePropertyCookie { +func (c *Conn) DeletePropertyChecked(Window Window, Property Atom) DeletePropertyCookie { cookie := c.newCookie(true, false) c.newRequest(c.deletePropertyRequest(Window, Property), cookie) return DeletePropertyCookie{cookie} @@ -7520,7 +7590,7 @@ func (cook DeletePropertyCookie) Check() error { } // Write request to wire for DeleteProperty -func (c *Conn) deletePropertyRequest(Window Id, Property Id) []byte { +func (c *Conn) deletePropertyRequest(Window Window, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7548,13 +7618,13 @@ type GetPropertyCookie struct { *cookie } -func (c *Conn) GetProperty(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { +func (c *Conn) GetProperty(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.newCookie(true, true) c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } -func (c *Conn) GetPropertyUnchecked(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) GetPropertyCookie { +func (c *Conn) GetPropertyUnchecked(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.newCookie(false, true) c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} @@ -7566,7 +7636,7 @@ type GetPropertyReply struct { Sequence uint16 Length uint32 Format byte - Type Id + Type Atom BytesAfter uint32 ValueLen uint32 // padding: 12 bytes @@ -7599,7 +7669,7 @@ func getPropertyReply(buf []byte) *GetPropertyReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Type = Id(Get32(buf[b:])) + v.Type = Atom(Get32(buf[b:])) b += 4 v.BytesAfter = Get32(buf[b:]) @@ -7622,7 +7692,7 @@ func (cook GetPropertyCookie) Check() error { } // Write request to wire for GetProperty -func (c *Conn) getPropertyRequest(Delete bool, Window Id, Property Id, Type Id, LongOffset uint32, LongLength uint32) []byte { +func (c *Conn) getPropertyRequest(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7664,13 +7734,13 @@ type ListPropertiesCookie struct { *cookie } -func (c *Conn) ListProperties(Window Id) ListPropertiesCookie { +func (c *Conn) ListProperties(Window Window) ListPropertiesCookie { cookie := c.newCookie(true, true) c.newRequest(c.listPropertiesRequest(Window), cookie) return ListPropertiesCookie{cookie} } -func (c *Conn) ListPropertiesUnchecked(Window Id) ListPropertiesCookie { +func (c *Conn) ListPropertiesUnchecked(Window Window) ListPropertiesCookie { cookie := c.newCookie(false, true) c.newRequest(c.listPropertiesRequest(Window), cookie) return ListPropertiesCookie{cookie} @@ -7684,7 +7754,7 @@ type ListPropertiesReply struct { // padding: 1 bytes AtomsLen uint16 // padding: 22 bytes - Atoms []Id // size: pad((int(AtomsLen) * 4)) + Atoms []Atom // size: pad((int(AtomsLen) * 4)) } // Waits and reads reply data from request ListProperties @@ -7717,9 +7787,9 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { b += 22 // padding - v.Atoms = make([]Id, v.AtomsLen) + v.Atoms = make([]Atom, v.AtomsLen) for i := 0; i < int(v.AtomsLen); i++ { - v.Atoms[i] = Id(Get32(buf[b:])) + v.Atoms[i] = Atom(Get32(buf[b:])) b += 4 } b = pad(b) @@ -7732,7 +7802,7 @@ func (cook ListPropertiesCookie) Check() error { } // Write request to wire for ListProperties -func (c *Conn) listPropertiesRequest(Window Id) []byte { +func (c *Conn) listPropertiesRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7758,13 +7828,13 @@ type SetSelectionOwnerCookie struct { } // Write request to wire for SetSelectionOwner -func (c *Conn) SetSelectionOwner(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { +func (c *Conn) SetSelectionOwner(Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.newCookie(false, false) c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } -func (c *Conn) SetSelectionOwnerChecked(Owner Id, Selection Id, Time Timestamp) SetSelectionOwnerCookie { +func (c *Conn) SetSelectionOwnerChecked(Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.newCookie(true, false) c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} @@ -7775,7 +7845,7 @@ func (cook SetSelectionOwnerCookie) Check() error { } // Write request to wire for SetSelectionOwner -func (c *Conn) setSelectionOwnerRequest(Owner Id, Selection Id, Time Timestamp) []byte { +func (c *Conn) setSelectionOwnerRequest(Owner Window, Selection Atom, Time Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7806,13 +7876,13 @@ type GetSelectionOwnerCookie struct { *cookie } -func (c *Conn) GetSelectionOwner(Selection Id) GetSelectionOwnerCookie { +func (c *Conn) GetSelectionOwner(Selection Atom) GetSelectionOwnerCookie { cookie := c.newCookie(true, true) c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) return GetSelectionOwnerCookie{cookie} } -func (c *Conn) GetSelectionOwnerUnchecked(Selection Id) GetSelectionOwnerCookie { +func (c *Conn) GetSelectionOwnerUnchecked(Selection Atom) GetSelectionOwnerCookie { cookie := c.newCookie(false, true) c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) return GetSelectionOwnerCookie{cookie} @@ -7824,7 +7894,7 @@ type GetSelectionOwnerReply struct { Sequence uint16 Length uint32 // padding: 1 bytes - Owner Id + Owner Window } // Waits and reads reply data from request GetSelectionOwner @@ -7852,7 +7922,7 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Owner = Id(Get32(buf[b:])) + v.Owner = Window(Get32(buf[b:])) b += 4 return v @@ -7863,7 +7933,7 @@ func (cook GetSelectionOwnerCookie) Check() error { } // Write request to wire for GetSelectionOwner -func (c *Conn) getSelectionOwnerRequest(Selection Id) []byte { +func (c *Conn) getSelectionOwnerRequest(Selection Atom) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7889,13 +7959,13 @@ type ConvertSelectionCookie struct { } // Write request to wire for ConvertSelection -func (c *Conn) ConvertSelection(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { +func (c *Conn) ConvertSelection(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.newCookie(false, false) c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } -func (c *Conn) ConvertSelectionChecked(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) ConvertSelectionCookie { +func (c *Conn) ConvertSelectionChecked(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.newCookie(true, false) c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} @@ -7906,7 +7976,7 @@ func (cook ConvertSelectionCookie) Check() error { } // Write request to wire for ConvertSelection -func (c *Conn) convertSelectionRequest(Requestor Id, Selection Id, Target Id, Property Id, Time Timestamp) []byte { +func (c *Conn) convertSelectionRequest(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7944,13 +8014,13 @@ type SendEventCookie struct { } // Write request to wire for SendEvent -func (c *Conn) SendEvent(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { +func (c *Conn) SendEvent(Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.newCookie(false, false) c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } -func (c *Conn) SendEventChecked(Propagate bool, Destination Id, EventMask uint32, Event string) SendEventCookie { +func (c *Conn) SendEventChecked(Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.newCookie(true, false) c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} @@ -7961,7 +8031,7 @@ func (cook SendEventCookie) Check() error { } // Write request to wire for SendEvent -func (c *Conn) sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte { +func (c *Conn) sendEventRequest(Propagate bool, Destination Window, EventMask uint32, Event string) []byte { size := 44 b := 0 buf := make([]byte, size) @@ -7997,13 +8067,13 @@ type GrabPointerCookie struct { *cookie } -func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { +func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.newCookie(true, true) c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } -func (c *Conn) GrabPointerUnchecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) GrabPointerCookie { +func (c *Conn) GrabPointerUnchecked(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.newCookie(false, true) c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} @@ -8051,7 +8121,7 @@ func (cook GrabPointerCookie) Check() error { } // Write request to wire for GrabPointer -func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Time Timestamp) []byte { +func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -8143,13 +8213,13 @@ type GrabButtonCookie struct { } // Write request to wire for GrabButton -func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { +func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.newCookie(false, false) c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } -func (c *Conn) GrabButtonChecked(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) GrabButtonCookie { +func (c *Conn) GrabButtonChecked(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.newCookie(true, false) c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} @@ -8160,7 +8230,7 @@ func (cook GrabButtonCookie) Check() error { } // Write request to wire for GrabButton -func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Id, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Id, Cursor Id, Button byte, Modifiers uint16) []byte { +func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -8214,13 +8284,13 @@ type UngrabButtonCookie struct { } // Write request to wire for UngrabButton -func (c *Conn) UngrabButton(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { +func (c *Conn) UngrabButton(Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.newCookie(false, false) c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } -func (c *Conn) UngrabButtonChecked(Button byte, GrabWindow Id, Modifiers uint16) UngrabButtonCookie { +func (c *Conn) UngrabButtonChecked(Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.newCookie(true, false) c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} @@ -8231,7 +8301,7 @@ func (cook UngrabButtonCookie) Check() error { } // Write request to wire for UngrabButton -func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Id, Modifiers uint16) []byte { +func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -8263,13 +8333,13 @@ type ChangeActivePointerGrabCookie struct { } // Write request to wire for ChangeActivePointerGrab -func (c *Conn) ChangeActivePointerGrab(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { +func (c *Conn) ChangeActivePointerGrab(Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.newCookie(false, false) c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } -func (c *Conn) ChangeActivePointerGrabChecked(Cursor Id, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { +func (c *Conn) ChangeActivePointerGrabChecked(Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.newCookie(true, false) c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} @@ -8280,7 +8350,7 @@ func (cook ChangeActivePointerGrabCookie) Check() error { } // Write request to wire for ChangeActivePointerGrab -func (c *Conn) changeActivePointerGrabRequest(Cursor Id, Time Timestamp, EventMask uint16) []byte { +func (c *Conn) changeActivePointerGrabRequest(Cursor Cursor, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8313,13 +8383,13 @@ type GrabKeyboardCookie struct { *cookie } -func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { +func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.newCookie(true, true) c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } -func (c *Conn) GrabKeyboardUnchecked(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { +func (c *Conn) GrabKeyboardUnchecked(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.newCookie(false, true) c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} @@ -8367,7 +8437,7 @@ func (cook GrabKeyboardCookie) Check() error { } // Write request to wire for GrabKeyboard -func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Id, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { +func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8452,13 +8522,13 @@ type GrabKeyCookie struct { } // Write request to wire for GrabKey -func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { +func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.newCookie(false, false) c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } -func (c *Conn) GrabKeyChecked(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { +func (c *Conn) GrabKeyChecked(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.newCookie(true, false) c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} @@ -8469,7 +8539,7 @@ func (cook GrabKeyCookie) Check() error { } // Write request to wire for GrabKey -func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Id, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { +func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8514,13 +8584,13 @@ type UngrabKeyCookie struct { } // Write request to wire for UngrabKey -func (c *Conn) UngrabKey(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { +func (c *Conn) UngrabKey(Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.newCookie(false, false) c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } -func (c *Conn) UngrabKeyChecked(Key Keycode, GrabWindow Id, Modifiers uint16) UngrabKeyCookie { +func (c *Conn) UngrabKeyChecked(Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.newCookie(true, false) c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} @@ -8531,7 +8601,7 @@ func (cook UngrabKeyCookie) Check() error { } // Write request to wire for UngrabKey -func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Id, Modifiers uint16) []byte { +func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -8684,13 +8754,13 @@ type QueryPointerCookie struct { *cookie } -func (c *Conn) QueryPointer(Window Id) QueryPointerCookie { +func (c *Conn) QueryPointer(Window Window) QueryPointerCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryPointerRequest(Window), cookie) return QueryPointerCookie{cookie} } -func (c *Conn) QueryPointerUnchecked(Window Id) QueryPointerCookie { +func (c *Conn) QueryPointerUnchecked(Window Window) QueryPointerCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryPointerRequest(Window), cookie) return QueryPointerCookie{cookie} @@ -8702,8 +8772,8 @@ type QueryPointerReply struct { Sequence uint16 Length uint32 SameScreen bool - Root Id - Child Id + Root Window + Child Window RootX int16 RootY int16 WinX int16 @@ -8742,10 +8812,10 @@ func queryPointerReply(buf []byte) *QueryPointerReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Id(Get32(buf[b:])) + v.Root = Window(Get32(buf[b:])) b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.RootX = int16(Get16(buf[b:])) @@ -8773,7 +8843,7 @@ func (cook QueryPointerCookie) Check() error { } // Write request to wire for QueryPointer -func (c *Conn) queryPointerRequest(Window Id) []byte { +func (c *Conn) queryPointerRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8798,13 +8868,13 @@ type GetMotionEventsCookie struct { *cookie } -func (c *Conn) GetMotionEvents(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { +func (c *Conn) GetMotionEvents(Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.newCookie(true, true) c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } -func (c *Conn) GetMotionEventsUnchecked(Window Id, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { +func (c *Conn) GetMotionEventsUnchecked(Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.newCookie(false, true) c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} @@ -8862,7 +8932,7 @@ func (cook GetMotionEventsCookie) Check() error { } // Write request to wire for GetMotionEvents -func (c *Conn) getMotionEventsRequest(Window Id, Start Timestamp, Stop Timestamp) []byte { +func (c *Conn) getMotionEventsRequest(Window Window, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8893,13 +8963,13 @@ type TranslateCoordinatesCookie struct { *cookie } -func (c *Conn) TranslateCoordinates(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { +func (c *Conn) TranslateCoordinates(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.newCookie(true, true) c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } -func (c *Conn) TranslateCoordinatesUnchecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) TranslateCoordinatesCookie { +func (c *Conn) TranslateCoordinatesUnchecked(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.newCookie(false, true) c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} @@ -8911,7 +8981,7 @@ type TranslateCoordinatesReply struct { Sequence uint16 Length uint32 SameScreen bool - Child Id + Child Window DstX int16 DstY int16 } @@ -8946,7 +9016,7 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Child = Id(Get32(buf[b:])) + v.Child = Window(Get32(buf[b:])) b += 4 v.DstX = int16(Get16(buf[b:])) @@ -8963,7 +9033,7 @@ func (cook TranslateCoordinatesCookie) Check() error { } // Write request to wire for TranslateCoordinates -func (c *Conn) translateCoordinatesRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16) []byte { +func (c *Conn) translateCoordinatesRequest(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8998,13 +9068,13 @@ type WarpPointerCookie struct { } // Write request to wire for WarpPointer -func (c *Conn) WarpPointer(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { +func (c *Conn) WarpPointer(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.newCookie(false, false) c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } -func (c *Conn) WarpPointerChecked(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { +func (c *Conn) WarpPointerChecked(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.newCookie(true, false) c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} @@ -9015,7 +9085,7 @@ func (cook WarpPointerCookie) Check() error { } // Write request to wire for WarpPointer -func (c *Conn) warpPointerRequest(SrcWindow Id, DstWindow Id, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { +func (c *Conn) warpPointerRequest(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -9062,13 +9132,13 @@ type SetInputFocusCookie struct { } // Write request to wire for SetInputFocus -func (c *Conn) SetInputFocus(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { +func (c *Conn) SetInputFocus(RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.newCookie(false, false) c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } -func (c *Conn) SetInputFocusChecked(RevertTo byte, Focus Id, Time Timestamp) SetInputFocusCookie { +func (c *Conn) SetInputFocusChecked(RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.newCookie(true, false) c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} @@ -9079,7 +9149,7 @@ func (cook SetInputFocusCookie) Check() error { } // Write request to wire for SetInputFocus -func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Id, Time Timestamp) []byte { +func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Window, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -9126,7 +9196,7 @@ type GetInputFocusReply struct { Sequence uint16 Length uint32 RevertTo byte - Focus Id + Focus Window } // Waits and reads reply data from request GetInputFocus @@ -9155,7 +9225,7 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { v.Length = Get32(buf[b:]) // 4-byte units b += 4 - v.Focus = Id(Get32(buf[b:])) + v.Focus = Window(Get32(buf[b:])) b += 4 return v @@ -9267,13 +9337,13 @@ type OpenFontCookie struct { } // Write request to wire for OpenFont -func (c *Conn) OpenFont(Fid Id, NameLen uint16, Name string) OpenFontCookie { +func (c *Conn) OpenFont(Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.newCookie(false, false) c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } -func (c *Conn) OpenFontChecked(Fid Id, NameLen uint16, Name string) OpenFontCookie { +func (c *Conn) OpenFontChecked(Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.newCookie(true, false) c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} @@ -9284,7 +9354,7 @@ func (cook OpenFontCookie) Check() error { } // Write request to wire for OpenFont -func (c *Conn) openFontRequest(Fid Id, NameLen uint16, Name string) []byte { +func (c *Conn) openFontRequest(Fid Font, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9318,13 +9388,13 @@ type CloseFontCookie struct { } // Write request to wire for CloseFont -func (c *Conn) CloseFont(Font Id) CloseFontCookie { +func (c *Conn) CloseFont(Font Font) CloseFontCookie { cookie := c.newCookie(false, false) c.newRequest(c.closeFontRequest(Font), cookie) return CloseFontCookie{cookie} } -func (c *Conn) CloseFontChecked(Font Id) CloseFontCookie { +func (c *Conn) CloseFontChecked(Font Font) CloseFontCookie { cookie := c.newCookie(true, false) c.newRequest(c.closeFontRequest(Font), cookie) return CloseFontCookie{cookie} @@ -9335,7 +9405,7 @@ func (cook CloseFontCookie) Check() error { } // Write request to wire for CloseFont -func (c *Conn) closeFontRequest(Font Id) []byte { +func (c *Conn) closeFontRequest(Font Font) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9360,13 +9430,13 @@ type QueryFontCookie struct { *cookie } -func (c *Conn) QueryFont(Font Id) QueryFontCookie { +func (c *Conn) QueryFont(Font Fontable) QueryFontCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryFontRequest(Font), cookie) return QueryFontCookie{cookie} } -func (c *Conn) QueryFontUnchecked(Font Id) QueryFontCookie { +func (c *Conn) QueryFontUnchecked(Font Fontable) QueryFontCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryFontRequest(Font), cookie) return QueryFontCookie{cookie} @@ -9483,7 +9553,7 @@ func (cook QueryFontCookie) Check() error { } // Write request to wire for QueryFont -func (c *Conn) queryFontRequest(Font Id) []byte { +func (c *Conn) queryFontRequest(Font Fontable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9508,13 +9578,13 @@ type QueryTextExtentsCookie struct { *cookie } -func (c *Conn) QueryTextExtents(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { +func (c *Conn) QueryTextExtents(Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } -func (c *Conn) QueryTextExtentsUnchecked(Font Id, String []Char2b, StringLen uint16) QueryTextExtentsCookie { +func (c *Conn) QueryTextExtentsUnchecked(Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} @@ -9590,7 +9660,7 @@ func (cook QueryTextExtentsCookie) Check() error { } // Write request to wire for QueryTextExtents -func (c *Conn) queryTextExtentsRequest(Font Id, String []Char2b, StringLen uint16) []byte { +func (c *Conn) queryTextExtentsRequest(Font Fontable, String []Char2b, StringLen uint16) []byte { size := pad((8 + pad((len(String) * 2)))) b := 0 buf := make([]byte, size) @@ -10007,13 +10077,13 @@ type CreatePixmapCookie struct { } // Write request to wire for CreatePixmap -func (c *Conn) CreatePixmap(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { +func (c *Conn) CreatePixmap(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } -func (c *Conn) CreatePixmapChecked(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) CreatePixmapCookie { +func (c *Conn) CreatePixmapChecked(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} @@ -10024,7 +10094,7 @@ func (cook CreatePixmapCookie) Check() error { } // Write request to wire for CreatePixmap -func (c *Conn) createPixmapRequest(Depth byte, Pid Id, Drawable Id, Width uint16, Height uint16) []byte { +func (c *Conn) createPixmapRequest(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10060,13 +10130,13 @@ type FreePixmapCookie struct { } // Write request to wire for FreePixmap -func (c *Conn) FreePixmap(Pixmap Id) FreePixmapCookie { +func (c *Conn) FreePixmap(Pixmap Pixmap) FreePixmapCookie { cookie := c.newCookie(false, false) c.newRequest(c.freePixmapRequest(Pixmap), cookie) return FreePixmapCookie{cookie} } -func (c *Conn) FreePixmapChecked(Pixmap Id) FreePixmapCookie { +func (c *Conn) FreePixmapChecked(Pixmap Pixmap) FreePixmapCookie { cookie := c.newCookie(true, false) c.newRequest(c.freePixmapRequest(Pixmap), cookie) return FreePixmapCookie{cookie} @@ -10077,7 +10147,7 @@ func (cook FreePixmapCookie) Check() error { } // Write request to wire for FreePixmap -func (c *Conn) freePixmapRequest(Pixmap Id) []byte { +func (c *Conn) freePixmapRequest(Pixmap Pixmap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10103,13 +10173,13 @@ type CreateGCCookie struct { } // Write request to wire for CreateGC -func (c *Conn) CreateGC(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { +func (c *Conn) CreateGC(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.newCookie(false, false) c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } -func (c *Conn) CreateGCChecked(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) CreateGCCookie { +func (c *Conn) CreateGCChecked(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.newCookie(true, false) c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} @@ -10120,7 +10190,7 @@ func (cook CreateGCCookie) Check() error { } // Write request to wire for CreateGC -func (c *Conn) createGCRequest(Cid Id, Drawable Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) createGCRequest(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { size := pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -10157,13 +10227,13 @@ type ChangeGCCookie struct { } // Write request to wire for ChangeGC -func (c *Conn) ChangeGC(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { +func (c *Conn) ChangeGC(Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.newCookie(false, false) c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } -func (c *Conn) ChangeGCChecked(Gc Id, ValueMask uint32, ValueList []uint32) ChangeGCCookie { +func (c *Conn) ChangeGCChecked(Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.newCookie(true, false) c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} @@ -10174,7 +10244,7 @@ func (cook ChangeGCCookie) Check() error { } // Write request to wire for ChangeGC -func (c *Conn) changeGCRequest(Gc Id, ValueMask uint32, ValueList []uint32) []byte { +func (c *Conn) changeGCRequest(Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -10208,13 +10278,13 @@ type CopyGCCookie struct { } // Write request to wire for CopyGC -func (c *Conn) CopyGC(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { +func (c *Conn) CopyGC(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.newCookie(false, false) c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } -func (c *Conn) CopyGCChecked(SrcGc Id, DstGc Id, ValueMask uint32) CopyGCCookie { +func (c *Conn) CopyGCChecked(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.newCookie(true, false) c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} @@ -10225,7 +10295,7 @@ func (cook CopyGCCookie) Check() error { } // Write request to wire for CopyGC -func (c *Conn) copyGCRequest(SrcGc Id, DstGc Id, ValueMask uint32) []byte { +func (c *Conn) copyGCRequest(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10257,13 +10327,13 @@ type SetDashesCookie struct { } // Write request to wire for SetDashes -func (c *Conn) SetDashes(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { +func (c *Conn) SetDashes(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.newCookie(false, false) c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } -func (c *Conn) SetDashesChecked(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { +func (c *Conn) SetDashesChecked(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.newCookie(true, false) c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} @@ -10274,7 +10344,7 @@ func (cook SetDashesCookie) Check() error { } // Write request to wire for SetDashes -func (c *Conn) setDashesRequest(Gc Id, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { +func (c *Conn) setDashesRequest(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { size := pad((12 + pad((int(DashesLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10309,13 +10379,13 @@ type SetClipRectanglesCookie struct { } // Write request to wire for SetClipRectangles -func (c *Conn) SetClipRectangles(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { +func (c *Conn) SetClipRectangles(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.newCookie(false, false) c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } -func (c *Conn) SetClipRectanglesChecked(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { +func (c *Conn) SetClipRectanglesChecked(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.newCookie(true, false) c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} @@ -10326,7 +10396,7 @@ func (cook SetClipRectanglesCookie) Check() error { } // Write request to wire for SetClipRectangles -func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Id, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { +func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10361,13 +10431,13 @@ type FreeGCCookie struct { } // Write request to wire for FreeGC -func (c *Conn) FreeGC(Gc Id) FreeGCCookie { +func (c *Conn) FreeGC(Gc Gcontext) FreeGCCookie { cookie := c.newCookie(false, false) c.newRequest(c.freeGCRequest(Gc), cookie) return FreeGCCookie{cookie} } -func (c *Conn) FreeGCChecked(Gc Id) FreeGCCookie { +func (c *Conn) FreeGCChecked(Gc Gcontext) FreeGCCookie { cookie := c.newCookie(true, false) c.newRequest(c.freeGCRequest(Gc), cookie) return FreeGCCookie{cookie} @@ -10378,7 +10448,7 @@ func (cook FreeGCCookie) Check() error { } // Write request to wire for FreeGC -func (c *Conn) freeGCRequest(Gc Id) []byte { +func (c *Conn) freeGCRequest(Gc Gcontext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10404,13 +10474,13 @@ type ClearAreaCookie struct { } // Write request to wire for ClearArea -func (c *Conn) ClearArea(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { +func (c *Conn) ClearArea(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.newCookie(false, false) c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } -func (c *Conn) ClearAreaChecked(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { +func (c *Conn) ClearAreaChecked(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.newCookie(true, false) c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} @@ -10421,7 +10491,7 @@ func (cook ClearAreaCookie) Check() error { } // Write request to wire for ClearArea -func (c *Conn) clearAreaRequest(Exposures bool, Window Id, X int16, Y int16, Width uint16, Height uint16) []byte { +func (c *Conn) clearAreaRequest(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10464,13 +10534,13 @@ type CopyAreaCookie struct { } // Write request to wire for CopyArea -func (c *Conn) CopyArea(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { +func (c *Conn) CopyArea(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.newCookie(false, false) c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } -func (c *Conn) CopyAreaChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { +func (c *Conn) CopyAreaChecked(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.newCookie(true, false) c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} @@ -10481,7 +10551,7 @@ func (cook CopyAreaCookie) Check() error { } // Write request to wire for CopyArea -func (c *Conn) copyAreaRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { +func (c *Conn) copyAreaRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -10531,13 +10601,13 @@ type CopyPlaneCookie struct { } // Write request to wire for CopyPlane -func (c *Conn) CopyPlane(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { +func (c *Conn) CopyPlane(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.newCookie(false, false) c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } -func (c *Conn) CopyPlaneChecked(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { +func (c *Conn) CopyPlaneChecked(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.newCookie(true, false) c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} @@ -10548,7 +10618,7 @@ func (cook CopyPlaneCookie) Check() error { } // Write request to wire for CopyPlane -func (c *Conn) copyPlaneRequest(SrcDrawable Id, DstDrawable Id, Gc Id, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { +func (c *Conn) copyPlaneRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -10601,13 +10671,13 @@ type PolyPointCookie struct { } // Write request to wire for PolyPoint -func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { +func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } -func (c *Conn) PolyPointChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyPointCookie { +func (c *Conn) PolyPointChecked(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} @@ -10618,7 +10688,7 @@ func (cook PolyPointCookie) Check() error { } // Write request to wire for PolyPoint -func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { +func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10650,13 +10720,13 @@ type PolyLineCookie struct { } // Write request to wire for PolyLine -func (c *Conn) PolyLine(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { +func (c *Conn) PolyLine(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } -func (c *Conn) PolyLineChecked(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) PolyLineCookie { +func (c *Conn) PolyLineChecked(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} @@ -10667,7 +10737,7 @@ func (cook PolyLineCookie) Check() error { } // Write request to wire for PolyLine -func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Id, Gc Id, Points []Point) []byte { +func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := pad((12 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10699,13 +10769,13 @@ type PolySegmentCookie struct { } // Write request to wire for PolySegment -func (c *Conn) PolySegment(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { +func (c *Conn) PolySegment(Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.newCookie(false, false) c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } -func (c *Conn) PolySegmentChecked(Drawable Id, Gc Id, Segments []Segment) PolySegmentCookie { +func (c *Conn) PolySegmentChecked(Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.newCookie(true, false) c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} @@ -10716,7 +10786,7 @@ func (cook PolySegmentCookie) Check() error { } // Write request to wire for PolySegment -func (c *Conn) polySegmentRequest(Drawable Id, Gc Id, Segments []Segment) []byte { +func (c *Conn) polySegmentRequest(Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { size := pad((12 + pad((len(Segments) * 8)))) b := 0 buf := make([]byte, size) @@ -10747,13 +10817,13 @@ type PolyRectangleCookie struct { } // Write request to wire for PolyRectangle -func (c *Conn) PolyRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { +func (c *Conn) PolyRectangle(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } -func (c *Conn) PolyRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyRectangleCookie { +func (c *Conn) PolyRectangleChecked(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} @@ -10764,7 +10834,7 @@ func (cook PolyRectangleCookie) Check() error { } // Write request to wire for PolyRectangle -func (c *Conn) polyRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { +func (c *Conn) polyRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10795,13 +10865,13 @@ type PolyArcCookie struct { } // Write request to wire for PolyArc -func (c *Conn) PolyArc(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { +func (c *Conn) PolyArc(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } -func (c *Conn) PolyArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyArcCookie { +func (c *Conn) PolyArcChecked(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} @@ -10812,7 +10882,7 @@ func (cook PolyArcCookie) Check() error { } // Write request to wire for PolyArc -func (c *Conn) polyArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { +func (c *Conn) polyArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -10843,13 +10913,13 @@ type FillPolyCookie struct { } // Write request to wire for FillPoly -func (c *Conn) FillPoly(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { +func (c *Conn) FillPoly(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.newCookie(false, false) c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } -func (c *Conn) FillPolyChecked(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { +func (c *Conn) FillPolyChecked(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.newCookie(true, false) c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} @@ -10860,7 +10930,7 @@ func (cook FillPolyCookie) Check() error { } // Write request to wire for FillPoly -func (c *Conn) fillPolyRequest(Drawable Id, Gc Id, Shape byte, CoordinateMode byte, Points []Point) []byte { +func (c *Conn) fillPolyRequest(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { size := pad((16 + pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10899,13 +10969,13 @@ type PolyFillRectangleCookie struct { } // Write request to wire for PolyFillRectangle -func (c *Conn) PolyFillRectangle(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { +func (c *Conn) PolyFillRectangle(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } -func (c *Conn) PolyFillRectangleChecked(Drawable Id, Gc Id, Rectangles []Rectangle) PolyFillRectangleCookie { +func (c *Conn) PolyFillRectangleChecked(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} @@ -10916,7 +10986,7 @@ func (cook PolyFillRectangleCookie) Check() error { } // Write request to wire for PolyFillRectangle -func (c *Conn) polyFillRectangleRequest(Drawable Id, Gc Id, Rectangles []Rectangle) []byte { +func (c *Conn) polyFillRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := pad((12 + pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10947,13 +11017,13 @@ type PolyFillArcCookie struct { } // Write request to wire for PolyFillArc -func (c *Conn) PolyFillArc(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { +func (c *Conn) PolyFillArc(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.newCookie(false, false) c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } -func (c *Conn) PolyFillArcChecked(Drawable Id, Gc Id, Arcs []Arc) PolyFillArcCookie { +func (c *Conn) PolyFillArcChecked(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.newCookie(true, false) c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} @@ -10964,7 +11034,7 @@ func (cook PolyFillArcCookie) Check() error { } // Write request to wire for PolyFillArc -func (c *Conn) polyFillArcRequest(Drawable Id, Gc Id, Arcs []Arc) []byte { +func (c *Conn) polyFillArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := pad((12 + pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -10995,13 +11065,13 @@ type PutImageCookie struct { } // Write request to wire for PutImage -func (c *Conn) PutImage(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { +func (c *Conn) PutImage(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.newCookie(false, false) c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } -func (c *Conn) PutImageChecked(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { +func (c *Conn) PutImageChecked(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.newCookie(true, false) c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} @@ -11012,7 +11082,7 @@ func (cook PutImageCookie) Check() error { } // Write request to wire for PutImage -func (c *Conn) putImageRequest(Format byte, Drawable Id, Gc Id, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { +func (c *Conn) putImageRequest(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { size := pad((24 + pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -11064,13 +11134,13 @@ type GetImageCookie struct { *cookie } -func (c *Conn) GetImage(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { +func (c *Conn) GetImage(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.newCookie(true, true) c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } -func (c *Conn) GetImageUnchecked(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { +func (c *Conn) GetImageUnchecked(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.newCookie(false, true) c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} @@ -11130,7 +11200,7 @@ func (cook GetImageCookie) Check() error { } // Write request to wire for GetImage -func (c *Conn) getImageRequest(Format byte, Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { +func (c *Conn) getImageRequest(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -11172,13 +11242,13 @@ type PolyText8Cookie struct { } // Write request to wire for PolyText8 -func (c *Conn) PolyText8(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { +func (c *Conn) PolyText8(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.newCookie(false, false) c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } -func (c *Conn) PolyText8Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText8Cookie { +func (c *Conn) PolyText8Checked(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.newCookie(true, false) c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} @@ -11189,7 +11259,7 @@ func (cook PolyText8Cookie) Check() error { } // Write request to wire for PolyText8 -func (c *Conn) polyText8Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { +func (c *Conn) polyText8Request(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -11227,13 +11297,13 @@ type PolyText16Cookie struct { } // Write request to wire for PolyText16 -func (c *Conn) PolyText16(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { +func (c *Conn) PolyText16(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.newCookie(false, false) c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } -func (c *Conn) PolyText16Checked(Drawable Id, Gc Id, X int16, Y int16, Items []byte) PolyText16Cookie { +func (c *Conn) PolyText16Checked(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.newCookie(true, false) c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} @@ -11244,7 +11314,7 @@ func (cook PolyText16Cookie) Check() error { } // Write request to wire for PolyText16 -func (c *Conn) polyText16Request(Drawable Id, Gc Id, X int16, Y int16, Items []byte) []byte { +func (c *Conn) polyText16Request(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := pad((16 + pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -11282,13 +11352,13 @@ type ImageText8Cookie struct { } // Write request to wire for ImageText8 -func (c *Conn) ImageText8(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { +func (c *Conn) ImageText8(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.newCookie(false, false) c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } -func (c *Conn) ImageText8Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) ImageText8Cookie { +func (c *Conn) ImageText8Checked(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.newCookie(true, false) c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} @@ -11299,7 +11369,7 @@ func (cook ImageText8Cookie) Check() error { } // Write request to wire for ImageText8 -func (c *Conn) imageText8Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String string) []byte { +func (c *Conn) imageText8Request(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { size := pad((16 + pad((int(StringLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11338,13 +11408,13 @@ type ImageText16Cookie struct { } // Write request to wire for ImageText16 -func (c *Conn) ImageText16(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { +func (c *Conn) ImageText16(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.newCookie(false, false) c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } -func (c *Conn) ImageText16Checked(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) ImageText16Cookie { +func (c *Conn) ImageText16Checked(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.newCookie(true, false) c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} @@ -11355,7 +11425,7 @@ func (cook ImageText16Cookie) Check() error { } // Write request to wire for ImageText16 -func (c *Conn) imageText16Request(StringLen byte, Drawable Id, Gc Id, X int16, Y int16, String []Char2b) []byte { +func (c *Conn) imageText16Request(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { size := pad((16 + pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) @@ -11393,13 +11463,13 @@ type CreateColormapCookie struct { } // Write request to wire for CreateColormap -func (c *Conn) CreateColormap(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { +func (c *Conn) CreateColormap(Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.newCookie(false, false) c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } -func (c *Conn) CreateColormapChecked(Alloc byte, Mid Id, Window Id, Visual Visualid) CreateColormapCookie { +func (c *Conn) CreateColormapChecked(Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.newCookie(true, false) c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} @@ -11410,7 +11480,7 @@ func (cook CreateColormapCookie) Check() error { } // Write request to wire for CreateColormap -func (c *Conn) createColormapRequest(Alloc byte, Mid Id, Window Id, Visual Visualid) []byte { +func (c *Conn) createColormapRequest(Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -11443,13 +11513,13 @@ type FreeColormapCookie struct { } // Write request to wire for FreeColormap -func (c *Conn) FreeColormap(Cmap Id) FreeColormapCookie { +func (c *Conn) FreeColormap(Cmap Colormap) FreeColormapCookie { cookie := c.newCookie(false, false) c.newRequest(c.freeColormapRequest(Cmap), cookie) return FreeColormapCookie{cookie} } -func (c *Conn) FreeColormapChecked(Cmap Id) FreeColormapCookie { +func (c *Conn) FreeColormapChecked(Cmap Colormap) FreeColormapCookie { cookie := c.newCookie(true, false) c.newRequest(c.freeColormapRequest(Cmap), cookie) return FreeColormapCookie{cookie} @@ -11460,7 +11530,7 @@ func (cook FreeColormapCookie) Check() error { } // Write request to wire for FreeColormap -func (c *Conn) freeColormapRequest(Cmap Id) []byte { +func (c *Conn) freeColormapRequest(Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11486,13 +11556,13 @@ type CopyColormapAndFreeCookie struct { } // Write request to wire for CopyColormapAndFree -func (c *Conn) CopyColormapAndFree(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { +func (c *Conn) CopyColormapAndFree(Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.newCookie(false, false) c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } -func (c *Conn) CopyColormapAndFreeChecked(Mid Id, SrcCmap Id) CopyColormapAndFreeCookie { +func (c *Conn) CopyColormapAndFreeChecked(Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.newCookie(true, false) c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} @@ -11503,7 +11573,7 @@ func (cook CopyColormapAndFreeCookie) Check() error { } // Write request to wire for CopyColormapAndFree -func (c *Conn) copyColormapAndFreeRequest(Mid Id, SrcCmap Id) []byte { +func (c *Conn) copyColormapAndFreeRequest(Mid Colormap, SrcCmap Colormap) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -11532,13 +11602,13 @@ type InstallColormapCookie struct { } // Write request to wire for InstallColormap -func (c *Conn) InstallColormap(Cmap Id) InstallColormapCookie { +func (c *Conn) InstallColormap(Cmap Colormap) InstallColormapCookie { cookie := c.newCookie(false, false) c.newRequest(c.installColormapRequest(Cmap), cookie) return InstallColormapCookie{cookie} } -func (c *Conn) InstallColormapChecked(Cmap Id) InstallColormapCookie { +func (c *Conn) InstallColormapChecked(Cmap Colormap) InstallColormapCookie { cookie := c.newCookie(true, false) c.newRequest(c.installColormapRequest(Cmap), cookie) return InstallColormapCookie{cookie} @@ -11549,7 +11619,7 @@ func (cook InstallColormapCookie) Check() error { } // Write request to wire for InstallColormap -func (c *Conn) installColormapRequest(Cmap Id) []byte { +func (c *Conn) installColormapRequest(Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11575,13 +11645,13 @@ type UninstallColormapCookie struct { } // Write request to wire for UninstallColormap -func (c *Conn) UninstallColormap(Cmap Id) UninstallColormapCookie { +func (c *Conn) UninstallColormap(Cmap Colormap) UninstallColormapCookie { cookie := c.newCookie(false, false) c.newRequest(c.uninstallColormapRequest(Cmap), cookie) return UninstallColormapCookie{cookie} } -func (c *Conn) UninstallColormapChecked(Cmap Id) UninstallColormapCookie { +func (c *Conn) UninstallColormapChecked(Cmap Colormap) UninstallColormapCookie { cookie := c.newCookie(true, false) c.newRequest(c.uninstallColormapRequest(Cmap), cookie) return UninstallColormapCookie{cookie} @@ -11592,7 +11662,7 @@ func (cook UninstallColormapCookie) Check() error { } // Write request to wire for UninstallColormap -func (c *Conn) uninstallColormapRequest(Cmap Id) []byte { +func (c *Conn) uninstallColormapRequest(Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11617,13 +11687,13 @@ type ListInstalledColormapsCookie struct { *cookie } -func (c *Conn) ListInstalledColormaps(Window Id) ListInstalledColormapsCookie { +func (c *Conn) ListInstalledColormaps(Window Window) ListInstalledColormapsCookie { cookie := c.newCookie(true, true) c.newRequest(c.listInstalledColormapsRequest(Window), cookie) return ListInstalledColormapsCookie{cookie} } -func (c *Conn) ListInstalledColormapsUnchecked(Window Id) ListInstalledColormapsCookie { +func (c *Conn) ListInstalledColormapsUnchecked(Window Window) ListInstalledColormapsCookie { cookie := c.newCookie(false, true) c.newRequest(c.listInstalledColormapsRequest(Window), cookie) return ListInstalledColormapsCookie{cookie} @@ -11637,7 +11707,7 @@ type ListInstalledColormapsReply struct { // padding: 1 bytes CmapsLen uint16 // padding: 22 bytes - Cmaps []Id // size: pad((int(CmapsLen) * 4)) + Cmaps []Colormap // size: pad((int(CmapsLen) * 4)) } // Waits and reads reply data from request ListInstalledColormaps @@ -11670,9 +11740,9 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { b += 22 // padding - v.Cmaps = make([]Id, v.CmapsLen) + v.Cmaps = make([]Colormap, v.CmapsLen) for i := 0; i < int(v.CmapsLen); i++ { - v.Cmaps[i] = Id(Get32(buf[b:])) + v.Cmaps[i] = Colormap(Get32(buf[b:])) b += 4 } b = pad(b) @@ -11685,7 +11755,7 @@ func (cook ListInstalledColormapsCookie) Check() error { } // Write request to wire for ListInstalledColormaps -func (c *Conn) listInstalledColormapsRequest(Window Id) []byte { +func (c *Conn) listInstalledColormapsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11710,13 +11780,13 @@ type AllocColorCookie struct { *cookie } -func (c *Conn) AllocColor(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { +func (c *Conn) AllocColor(Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.newCookie(true, true) c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } -func (c *Conn) AllocColorUnchecked(Cmap Id, Red uint16, Green uint16, Blue uint16) AllocColorCookie { +func (c *Conn) AllocColorUnchecked(Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.newCookie(false, true) c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} @@ -11782,7 +11852,7 @@ func (cook AllocColorCookie) Check() error { } // Write request to wire for AllocColor -func (c *Conn) allocColorRequest(Cmap Id, Red uint16, Green uint16, Blue uint16) []byte { +func (c *Conn) allocColorRequest(Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -11818,13 +11888,13 @@ type AllocNamedColorCookie struct { *cookie } -func (c *Conn) AllocNamedColor(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { +func (c *Conn) AllocNamedColor(Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.newCookie(true, true) c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } -func (c *Conn) AllocNamedColorUnchecked(Cmap Id, NameLen uint16, Name string) AllocNamedColorCookie { +func (c *Conn) AllocNamedColorUnchecked(Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.newCookie(false, true) c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} @@ -11899,7 +11969,7 @@ func (cook AllocNamedColorCookie) Check() error { } // Write request to wire for AllocNamedColor -func (c *Conn) allocNamedColorRequest(Cmap Id, NameLen uint16, Name string) []byte { +func (c *Conn) allocNamedColorRequest(Cmap Colormap, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11932,13 +12002,13 @@ type AllocColorCellsCookie struct { *cookie } -func (c *Conn) AllocColorCells(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { +func (c *Conn) AllocColorCells(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.newCookie(true, true) c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } -func (c *Conn) AllocColorCellsUnchecked(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) AllocColorCellsCookie { +func (c *Conn) AllocColorCellsUnchecked(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.newCookie(false, true) c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} @@ -12012,7 +12082,7 @@ func (cook AllocColorCellsCookie) Check() error { } // Write request to wire for AllocColorCells -func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Id, Colors uint16, Planes uint16) []byte { +func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12048,13 +12118,13 @@ type AllocColorPlanesCookie struct { *cookie } -func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { +func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.newCookie(true, true) c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } -func (c *Conn) AllocColorPlanesUnchecked(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { +func (c *Conn) AllocColorPlanesUnchecked(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.newCookie(false, true) c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} @@ -12131,7 +12201,7 @@ func (cook AllocColorPlanesCookie) Check() error { } // Write request to wire for AllocColorPlanes -func (c *Conn) allocColorPlanesRequest(Contiguous bool, Cmap Id, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { +func (c *Conn) allocColorPlanesRequest(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -12174,13 +12244,13 @@ type FreeColorsCookie struct { } // Write request to wire for FreeColors -func (c *Conn) FreeColors(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { +func (c *Conn) FreeColors(Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.newCookie(false, false) c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } -func (c *Conn) FreeColorsChecked(Cmap Id, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { +func (c *Conn) FreeColorsChecked(Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.newCookie(true, false) c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} @@ -12191,7 +12261,7 @@ func (cook FreeColorsCookie) Check() error { } // Write request to wire for FreeColors -func (c *Conn) freeColorsRequest(Cmap Id, PlaneMask uint32, Pixels []uint32) []byte { +func (c *Conn) freeColorsRequest(Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { size := pad((12 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -12226,13 +12296,13 @@ type StoreColorsCookie struct { } // Write request to wire for StoreColors -func (c *Conn) StoreColors(Cmap Id, Items []Coloritem) StoreColorsCookie { +func (c *Conn) StoreColors(Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.newCookie(false, false) c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) return StoreColorsCookie{cookie} } -func (c *Conn) StoreColorsChecked(Cmap Id, Items []Coloritem) StoreColorsCookie { +func (c *Conn) StoreColorsChecked(Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.newCookie(true, false) c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) return StoreColorsCookie{cookie} @@ -12243,7 +12313,7 @@ func (cook StoreColorsCookie) Check() error { } // Write request to wire for StoreColors -func (c *Conn) storeColorsRequest(Cmap Id, Items []Coloritem) []byte { +func (c *Conn) storeColorsRequest(Cmap Colormap, Items []Coloritem) []byte { size := pad((8 + pad((len(Items) * 12)))) b := 0 buf := make([]byte, size) @@ -12271,13 +12341,13 @@ type StoreNamedColorCookie struct { } // Write request to wire for StoreNamedColor -func (c *Conn) StoreNamedColor(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { +func (c *Conn) StoreNamedColor(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.newCookie(false, false) c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } -func (c *Conn) StoreNamedColorChecked(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { +func (c *Conn) StoreNamedColorChecked(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.newCookie(true, false) c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} @@ -12288,7 +12358,7 @@ func (cook StoreNamedColorCookie) Check() error { } // Write request to wire for StoreNamedColor -func (c *Conn) storeNamedColorRequest(Flags byte, Cmap Id, Pixel uint32, NameLen uint16, Name string) []byte { +func (c *Conn) storeNamedColorRequest(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) []byte { size := pad((16 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12325,13 +12395,13 @@ type QueryColorsCookie struct { *cookie } -func (c *Conn) QueryColors(Cmap Id, Pixels []uint32) QueryColorsCookie { +func (c *Conn) QueryColors(Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } -func (c *Conn) QueryColorsUnchecked(Cmap Id, Pixels []uint32) QueryColorsCookie { +func (c *Conn) QueryColorsUnchecked(Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) return QueryColorsCookie{cookie} @@ -12389,7 +12459,7 @@ func (cook QueryColorsCookie) Check() error { } // Write request to wire for QueryColors -func (c *Conn) queryColorsRequest(Cmap Id, Pixels []uint32) []byte { +func (c *Conn) queryColorsRequest(Cmap Colormap, Pixels []uint32) []byte { size := pad((8 + pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -12420,13 +12490,13 @@ type LookupColorCookie struct { *cookie } -func (c *Conn) LookupColor(Cmap Id, NameLen uint16, Name string) LookupColorCookie { +func (c *Conn) LookupColor(Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.newCookie(true, true) c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } -func (c *Conn) LookupColorUnchecked(Cmap Id, NameLen uint16, Name string) LookupColorCookie { +func (c *Conn) LookupColorUnchecked(Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.newCookie(false, true) c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} @@ -12497,7 +12567,7 @@ func (cook LookupColorCookie) Check() error { } // Write request to wire for LookupColor -func (c *Conn) lookupColorRequest(Cmap Id, NameLen uint16, Name string) []byte { +func (c *Conn) lookupColorRequest(Cmap Colormap, NameLen uint16, Name string) []byte { size := pad((12 + pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12531,13 +12601,13 @@ type CreateCursorCookie struct { } // Write request to wire for CreateCursor -func (c *Conn) CreateCursor(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { +func (c *Conn) CreateCursor(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } -func (c *Conn) CreateCursorChecked(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { +func (c *Conn) CreateCursorChecked(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} @@ -12548,7 +12618,7 @@ func (cook CreateCursorCookie) Check() error { } // Write request to wire for CreateCursor -func (c *Conn) createCursorRequest(Cid Id, Source Id, Mask Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { +func (c *Conn) createCursorRequest(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -12604,13 +12674,13 @@ type CreateGlyphCursorCookie struct { } // Write request to wire for CreateGlyphCursor -func (c *Conn) CreateGlyphCursor(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { +func (c *Conn) CreateGlyphCursor(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } -func (c *Conn) CreateGlyphCursorChecked(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { +func (c *Conn) CreateGlyphCursorChecked(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} @@ -12621,7 +12691,7 @@ func (cook CreateGlyphCursorCookie) Check() error { } // Write request to wire for CreateGlyphCursor -func (c *Conn) createGlyphCursorRequest(Cid Id, SourceFont Id, MaskFont Id, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func (c *Conn) createGlyphCursorRequest(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -12677,13 +12747,13 @@ type FreeCursorCookie struct { } // Write request to wire for FreeCursor -func (c *Conn) FreeCursor(Cursor Id) FreeCursorCookie { +func (c *Conn) FreeCursor(Cursor Cursor) FreeCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.freeCursorRequest(Cursor), cookie) return FreeCursorCookie{cookie} } -func (c *Conn) FreeCursorChecked(Cursor Id) FreeCursorCookie { +func (c *Conn) FreeCursorChecked(Cursor Cursor) FreeCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.freeCursorRequest(Cursor), cookie) return FreeCursorCookie{cookie} @@ -12694,7 +12764,7 @@ func (cook FreeCursorCookie) Check() error { } // Write request to wire for FreeCursor -func (c *Conn) freeCursorRequest(Cursor Id) []byte { +func (c *Conn) freeCursorRequest(Cursor Cursor) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -12720,13 +12790,13 @@ type RecolorCursorCookie struct { } // Write request to wire for RecolorCursor -func (c *Conn) RecolorCursor(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { +func (c *Conn) RecolorCursor(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.newCookie(false, false) c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } -func (c *Conn) RecolorCursorChecked(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { +func (c *Conn) RecolorCursorChecked(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.newCookie(true, false) c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} @@ -12737,7 +12807,7 @@ func (cook RecolorCursorCookie) Check() error { } // Write request to wire for RecolorCursor -func (c *Conn) recolorCursorRequest(Cursor Id, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func (c *Conn) recolorCursorRequest(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -12780,13 +12850,13 @@ type QueryBestSizeCookie struct { *cookie } -func (c *Conn) QueryBestSize(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { +func (c *Conn) QueryBestSize(Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.newCookie(true, true) c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } -func (c *Conn) QueryBestSizeUnchecked(Class byte, Drawable Id, Width uint16, Height uint16) QueryBestSizeCookie { +func (c *Conn) QueryBestSizeUnchecked(Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.newCookie(false, true) c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} @@ -12841,7 +12911,7 @@ func (cook QueryBestSizeCookie) Check() error { } // Write request to wire for QueryBestSize -func (c *Conn) queryBestSizeRequest(Class byte, Drawable Id, Width uint16, Height uint16) []byte { +func (c *Conn) queryBestSizeRequest(Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -13959,13 +14029,13 @@ type RotatePropertiesCookie struct { } // Write request to wire for RotateProperties -func (c *Conn) RotateProperties(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { +func (c *Conn) RotateProperties(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.newCookie(false, false) c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } -func (c *Conn) RotatePropertiesChecked(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) RotatePropertiesCookie { +func (c *Conn) RotatePropertiesChecked(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.newCookie(true, false) c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} @@ -13976,7 +14046,7 @@ func (cook RotatePropertiesCookie) Check() error { } // Write request to wire for RotateProperties -func (c *Conn) rotatePropertiesRequest(Window Id, AtomsLen uint16, Delta int16, Atoms []Id) []byte { +func (c *Conn) rotatePropertiesRequest(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { size := pad((12 + pad((int(AtomsLen) * 4)))) b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go index 34d40fd..4e7ee81 100644 --- a/nexgb/auto_xselinux.go +++ b/nexgb/auto_xselinux.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xselinux.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xselinux.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["SELinux"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -51,22 +61,10 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // 'XselinuxListItem' struct definition // Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) type XselinuxListItem struct { - Name Id + Name Atom ObjectContextLen uint32 DataContextLen uint32 ObjectContext string // size: pad((int(ObjectContextLen) * 1)) @@ -77,7 +75,7 @@ type XselinuxListItem struct { func ReadXselinuxListItem(buf []byte, v *XselinuxListItem) int { b := 0 - v.Name = Id(Get32(buf[b:])) + v.Name = Atom(Get32(buf[b:])) b += 4 v.ObjectContextLen = Get32(buf[b:]) @@ -673,13 +671,13 @@ type XselinuxGetWindowContextCookie struct { *cookie } -func (c *Conn) XselinuxGetWindowContext(Window Id) XselinuxGetWindowContextCookie { +func (c *Conn) XselinuxGetWindowContext(Window Window) XselinuxGetWindowContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) return XselinuxGetWindowContextCookie{cookie} } -func (c *Conn) XselinuxGetWindowContextUnchecked(Window Id) XselinuxGetWindowContextCookie { +func (c *Conn) XselinuxGetWindowContextUnchecked(Window Window) XselinuxGetWindowContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) return XselinuxGetWindowContextCookie{cookie} @@ -741,7 +739,7 @@ func (cook XselinuxGetWindowContextCookie) Check() error { } // Write request to wire for XselinuxGetWindowContext -func (c *Conn) xselinuxGetWindowContextRequest(Window Id) []byte { +func (c *Conn) xselinuxGetWindowContextRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1043,13 +1041,13 @@ type XselinuxGetPropertyContextCookie struct { *cookie } -func (c *Conn) XselinuxGetPropertyContext(Window Id, Property Id) XselinuxGetPropertyContextCookie { +func (c *Conn) XselinuxGetPropertyContext(Window Window, Property Atom) XselinuxGetPropertyContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) return XselinuxGetPropertyContextCookie{cookie} } -func (c *Conn) XselinuxGetPropertyContextUnchecked(Window Id, Property Id) XselinuxGetPropertyContextCookie { +func (c *Conn) XselinuxGetPropertyContextUnchecked(Window Window, Property Atom) XselinuxGetPropertyContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) return XselinuxGetPropertyContextCookie{cookie} @@ -1111,7 +1109,7 @@ func (cook XselinuxGetPropertyContextCookie) Check() error { } // Write request to wire for XselinuxGetPropertyContext -func (c *Conn) xselinuxGetPropertyContextRequest(Window Id, Property Id) []byte { +func (c *Conn) xselinuxGetPropertyContextRequest(Window Window, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1140,13 +1138,13 @@ type XselinuxGetPropertyDataContextCookie struct { *cookie } -func (c *Conn) XselinuxGetPropertyDataContext(Window Id, Property Id) XselinuxGetPropertyDataContextCookie { +func (c *Conn) XselinuxGetPropertyDataContext(Window Window, Property Atom) XselinuxGetPropertyDataContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) return XselinuxGetPropertyDataContextCookie{cookie} } -func (c *Conn) XselinuxGetPropertyDataContextUnchecked(Window Id, Property Id) XselinuxGetPropertyDataContextCookie { +func (c *Conn) XselinuxGetPropertyDataContextUnchecked(Window Window, Property Atom) XselinuxGetPropertyDataContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) return XselinuxGetPropertyDataContextCookie{cookie} @@ -1208,7 +1206,7 @@ func (cook XselinuxGetPropertyDataContextCookie) Check() error { } // Write request to wire for XselinuxGetPropertyDataContext -func (c *Conn) xselinuxGetPropertyDataContextRequest(Window Id, Property Id) []byte { +func (c *Conn) xselinuxGetPropertyDataContextRequest(Window Window, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1237,13 +1235,13 @@ type XselinuxListPropertiesCookie struct { *cookie } -func (c *Conn) XselinuxListProperties(Window Id) XselinuxListPropertiesCookie { +func (c *Conn) XselinuxListProperties(Window Window) XselinuxListPropertiesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) return XselinuxListPropertiesCookie{cookie} } -func (c *Conn) XselinuxListPropertiesUnchecked(Window Id) XselinuxListPropertiesCookie { +func (c *Conn) XselinuxListPropertiesUnchecked(Window Window) XselinuxListPropertiesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) return XselinuxListPropertiesCookie{cookie} @@ -1301,7 +1299,7 @@ func (cook XselinuxListPropertiesCookie) Check() error { } // Write request to wire for XselinuxListProperties -func (c *Conn) xselinuxListPropertiesRequest(Window Id) []byte { +func (c *Conn) xselinuxListPropertiesRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1603,13 +1601,13 @@ type XselinuxGetSelectionContextCookie struct { *cookie } -func (c *Conn) XselinuxGetSelectionContext(Selection Id) XselinuxGetSelectionContextCookie { +func (c *Conn) XselinuxGetSelectionContext(Selection Atom) XselinuxGetSelectionContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) return XselinuxGetSelectionContextCookie{cookie} } -func (c *Conn) XselinuxGetSelectionContextUnchecked(Selection Id) XselinuxGetSelectionContextCookie { +func (c *Conn) XselinuxGetSelectionContextUnchecked(Selection Atom) XselinuxGetSelectionContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) return XselinuxGetSelectionContextCookie{cookie} @@ -1671,7 +1669,7 @@ func (cook XselinuxGetSelectionContextCookie) Check() error { } // Write request to wire for XselinuxGetSelectionContext -func (c *Conn) xselinuxGetSelectionContextRequest(Selection Id) []byte { +func (c *Conn) xselinuxGetSelectionContextRequest(Selection Atom) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1697,13 +1695,13 @@ type XselinuxGetSelectionDataContextCookie struct { *cookie } -func (c *Conn) XselinuxGetSelectionDataContext(Selection Id) XselinuxGetSelectionDataContextCookie { +func (c *Conn) XselinuxGetSelectionDataContext(Selection Atom) XselinuxGetSelectionDataContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) return XselinuxGetSelectionDataContextCookie{cookie} } -func (c *Conn) XselinuxGetSelectionDataContextUnchecked(Selection Id) XselinuxGetSelectionDataContextCookie { +func (c *Conn) XselinuxGetSelectionDataContextUnchecked(Selection Atom) XselinuxGetSelectionDataContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) return XselinuxGetSelectionDataContextCookie{cookie} @@ -1765,7 +1763,7 @@ func (cook XselinuxGetSelectionDataContextCookie) Check() error { } // Write request to wire for XselinuxGetSelectionDataContext -func (c *Conn) xselinuxGetSelectionDataContextRequest(Selection Id) []byte { +func (c *Conn) xselinuxGetSelectionDataContextRequest(Selection Atom) []byte { size := 8 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go index 6410831..f3b92a2 100644 --- a/nexgb/auto_xtest.go +++ b/nexgb/auto_xtest.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xtest.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xtest.xml on May 10 2012 12:39:34pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,6 +37,16 @@ func init() { newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -49,20 +59,8 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( XtestCursorNone = 0 XtestCursorCurrent = 1 @@ -163,13 +161,13 @@ type XtestCompareCursorCookie struct { *cookie } -func (c *Conn) XtestCompareCursor(Window Id, Cursor Id) XtestCompareCursorCookie { +func (c *Conn) XtestCompareCursor(Window Window, Cursor Cursor) XtestCompareCursorCookie { cookie := c.newCookie(true, true) c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) return XtestCompareCursorCookie{cookie} } -func (c *Conn) XtestCompareCursorUnchecked(Window Id, Cursor Id) XtestCompareCursorCookie { +func (c *Conn) XtestCompareCursorUnchecked(Window Window, Cursor Cursor) XtestCompareCursorCookie { cookie := c.newCookie(false, true) c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) return XtestCompareCursorCookie{cookie} @@ -221,7 +219,7 @@ func (cook XtestCompareCursorCookie) Check() error { } // Write request to wire for XtestCompareCursor -func (c *Conn) xtestCompareCursorRequest(Window Id, Cursor Id) []byte { +func (c *Conn) xtestCompareCursorRequest(Window Window, Cursor Cursor) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -251,13 +249,13 @@ type XtestFakeInputCookie struct { } // Write request to wire for XtestFakeInput -func (c *Conn) XtestFakeInput(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { +func (c *Conn) XtestFakeInput(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { cookie := c.newCookie(false, false) c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return XtestFakeInputCookie{cookie} } -func (c *Conn) XtestFakeInputChecked(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { +func (c *Conn) XtestFakeInputChecked(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { cookie := c.newCookie(true, false) c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return XtestFakeInputCookie{cookie} @@ -268,7 +266,7 @@ func (cook XtestFakeInputCookie) Check() error { } // Write request to wire for XtestFakeInput -func (c *Conn) xtestFakeInputRequest(Type byte, Detail byte, Time uint32, Root Id, RootX int16, RootY int16, Deviceid byte) []byte { +func (c *Conn) xtestFakeInputRequest(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) []byte { size := 36 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go index 615c540..25f0491 100644 --- a/nexgb/auto_xv.go +++ b/nexgb/auto_xv.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xv.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xv.xml on May 10 2012 12:39:35pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,18 +38,8 @@ func init() { newExtErrorFuncs["XVideo"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +54,14 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( XvTypeInputMask = 1 XvTypeOutputMask = 2 @@ -109,9 +107,25 @@ const ( XvGrabPortStatusBadAlloc = 5 ) -// Skipping resource definition of 'Port' +type XvPort uint32 -// Skipping resource definition of 'Encoding' +func (c *Conn) NewXvPortId() (XvPort, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XvPort(id), nil +} + +type XvEncoding uint32 + +func (c *Conn) NewXvEncodingId() (XvEncoding, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XvEncoding(id), nil +} // 'XvRational' struct definition // Size: 8 @@ -233,7 +247,7 @@ func XvFormatListBytes(buf []byte, list []XvFormat) int { // 'XvAdaptorInfo' struct definition // Size: ((12 + pad((int(NameSize) * 1))) + pad((int(NumFormats) * 8))) type XvAdaptorInfo struct { - BaseId Id + BaseId XvPort NameSize uint16 NumPorts uint16 NumFormats uint16 @@ -247,7 +261,7 @@ type XvAdaptorInfo struct { func ReadXvAdaptorInfo(buf []byte, v *XvAdaptorInfo) int { b := 0 - v.BaseId = Id(Get32(buf[b:])) + v.BaseId = XvPort(Get32(buf[b:])) b += 4 v.NameSize = Get16(buf[b:]) @@ -341,7 +355,7 @@ func XvAdaptorInfoListSize(list []XvAdaptorInfo) int { // 'XvEncodingInfo' struct definition // Size: (20 + pad((int(NameSize) * 1))) type XvEncodingInfo struct { - Encoding Id + Encoding XvEncoding NameSize uint16 Width uint16 Height uint16 @@ -354,7 +368,7 @@ type XvEncodingInfo struct { func ReadXvEncodingInfo(buf []byte, v *XvEncodingInfo) int { b := 0 - v.Encoding = Id(Get32(buf[b:])) + v.Encoding = XvEncoding(Get32(buf[b:])) b += 4 v.NameSize = Get16(buf[b:]) @@ -896,8 +910,8 @@ type XvVideoNotifyEvent struct { Sequence uint16 Reason byte Time Timestamp - Drawable Id - Port Id + Drawable Drawable + Port XvPort } // Event read XvVideoNotify @@ -914,10 +928,10 @@ func NewXvVideoNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 - v.Port = Id(Get32(buf[b:])) + v.Port = XvPort(Get32(buf[b:])) b += 4 return v @@ -978,8 +992,8 @@ type XvPortNotifyEvent struct { Sequence uint16 // padding: 1 bytes Time Timestamp - Port Id - Attribute Id + Port XvPort + Attribute Atom Value int32 } @@ -996,10 +1010,10 @@ func NewXvPortNotifyEvent(buf []byte) Event { v.Time = Timestamp(Get32(buf[b:])) b += 4 - v.Port = Id(Get32(buf[b:])) + v.Port = XvPort(Get32(buf[b:])) b += 4 - v.Attribute = Id(Get32(buf[b:])) + v.Attribute = Atom(Get32(buf[b:])) b += 4 v.Value = int32(Get32(buf[b:])) @@ -1086,7 +1100,7 @@ func (err XvBadPortError) SequenceId() uint16 { return err.Sequence } -func (err XvBadPortError) BadId() Id { +func (err XvBadPortError) BadId() uint32 { return 0 } @@ -1131,7 +1145,7 @@ func (err XvBadEncodingError) SequenceId() uint16 { return err.Sequence } -func (err XvBadEncodingError) BadId() Id { +func (err XvBadEncodingError) BadId() uint32 { return 0 } @@ -1176,7 +1190,7 @@ func (err XvBadControlError) SequenceId() uint16 { return err.Sequence } -func (err XvBadControlError) BadId() Id { +func (err XvBadControlError) BadId() uint32 { return 0 } @@ -1281,13 +1295,13 @@ type XvQueryAdaptorsCookie struct { *cookie } -func (c *Conn) XvQueryAdaptors(Window Id) XvQueryAdaptorsCookie { +func (c *Conn) XvQueryAdaptors(Window Window) XvQueryAdaptorsCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) return XvQueryAdaptorsCookie{cookie} } -func (c *Conn) XvQueryAdaptorsUnchecked(Window Id) XvQueryAdaptorsCookie { +func (c *Conn) XvQueryAdaptorsUnchecked(Window Window) XvQueryAdaptorsCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) return XvQueryAdaptorsCookie{cookie} @@ -1345,7 +1359,7 @@ func (cook XvQueryAdaptorsCookie) Check() error { } // Write request to wire for XvQueryAdaptors -func (c *Conn) xvQueryAdaptorsRequest(Window Id) []byte { +func (c *Conn) xvQueryAdaptorsRequest(Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1371,13 +1385,13 @@ type XvQueryEncodingsCookie struct { *cookie } -func (c *Conn) XvQueryEncodings(Port Id) XvQueryEncodingsCookie { +func (c *Conn) XvQueryEncodings(Port XvPort) XvQueryEncodingsCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) return XvQueryEncodingsCookie{cookie} } -func (c *Conn) XvQueryEncodingsUnchecked(Port Id) XvQueryEncodingsCookie { +func (c *Conn) XvQueryEncodingsUnchecked(Port XvPort) XvQueryEncodingsCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) return XvQueryEncodingsCookie{cookie} @@ -1435,7 +1449,7 @@ func (cook XvQueryEncodingsCookie) Check() error { } // Write request to wire for XvQueryEncodings -func (c *Conn) xvQueryEncodingsRequest(Port Id) []byte { +func (c *Conn) xvQueryEncodingsRequest(Port XvPort) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1461,13 +1475,13 @@ type XvGrabPortCookie struct { *cookie } -func (c *Conn) XvGrabPort(Port Id, Time Timestamp) XvGrabPortCookie { +func (c *Conn) XvGrabPort(Port XvPort, Time Timestamp) XvGrabPortCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) return XvGrabPortCookie{cookie} } -func (c *Conn) XvGrabPortUnchecked(Port Id, Time Timestamp) XvGrabPortCookie { +func (c *Conn) XvGrabPortUnchecked(Port XvPort, Time Timestamp) XvGrabPortCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) return XvGrabPortCookie{cookie} @@ -1515,7 +1529,7 @@ func (cook XvGrabPortCookie) Check() error { } // Write request to wire for XvGrabPort -func (c *Conn) xvGrabPortRequest(Port Id, Time Timestamp) []byte { +func (c *Conn) xvGrabPortRequest(Port XvPort, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1545,13 +1559,13 @@ type XvUngrabPortCookie struct { } // Write request to wire for XvUngrabPort -func (c *Conn) XvUngrabPort(Port Id, Time Timestamp) XvUngrabPortCookie { +func (c *Conn) XvUngrabPort(Port XvPort, Time Timestamp) XvUngrabPortCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) return XvUngrabPortCookie{cookie} } -func (c *Conn) XvUngrabPortChecked(Port Id, Time Timestamp) XvUngrabPortCookie { +func (c *Conn) XvUngrabPortChecked(Port XvPort, Time Timestamp) XvUngrabPortCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) return XvUngrabPortCookie{cookie} @@ -1562,7 +1576,7 @@ func (cook XvUngrabPortCookie) Check() error { } // Write request to wire for XvUngrabPort -func (c *Conn) xvUngrabPortRequest(Port Id, Time Timestamp) []byte { +func (c *Conn) xvUngrabPortRequest(Port XvPort, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1592,13 +1606,13 @@ type XvPutVideoCookie struct { } // Write request to wire for XvPutVideo -func (c *Conn) XvPutVideo(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { +func (c *Conn) XvPutVideo(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvPutVideoCookie{cookie} } -func (c *Conn) XvPutVideoChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { +func (c *Conn) XvPutVideoChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvPutVideoCookie{cookie} @@ -1609,7 +1623,7 @@ func (cook XvPutVideoCookie) Check() error { } // Write request to wire for XvPutVideo -func (c *Conn) xvPutVideoRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +func (c *Conn) xvPutVideoRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1666,13 +1680,13 @@ type XvPutStillCookie struct { } // Write request to wire for XvPutStill -func (c *Conn) XvPutStill(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { +func (c *Conn) XvPutStill(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvPutStillCookie{cookie} } -func (c *Conn) XvPutStillChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { +func (c *Conn) XvPutStillChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvPutStillCookie{cookie} @@ -1683,7 +1697,7 @@ func (cook XvPutStillCookie) Check() error { } // Write request to wire for XvPutStill -func (c *Conn) xvPutStillRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +func (c *Conn) xvPutStillRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1740,13 +1754,13 @@ type XvGetVideoCookie struct { } // Write request to wire for XvGetVideo -func (c *Conn) XvGetVideo(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { +func (c *Conn) XvGetVideo(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvGetVideoCookie{cookie} } -func (c *Conn) XvGetVideoChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { +func (c *Conn) XvGetVideoChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvGetVideoCookie{cookie} @@ -1757,7 +1771,7 @@ func (cook XvGetVideoCookie) Check() error { } // Write request to wire for XvGetVideo -func (c *Conn) xvGetVideoRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +func (c *Conn) xvGetVideoRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1814,13 +1828,13 @@ type XvGetStillCookie struct { } // Write request to wire for XvGetStill -func (c *Conn) XvGetStill(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { +func (c *Conn) XvGetStill(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvGetStillCookie{cookie} } -func (c *Conn) XvGetStillChecked(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { +func (c *Conn) XvGetStillChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return XvGetStillCookie{cookie} @@ -1831,7 +1845,7 @@ func (cook XvGetStillCookie) Check() error { } // Write request to wire for XvGetStill -func (c *Conn) xvGetStillRequest(Port Id, Drawable Id, Gc Id, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +func (c *Conn) xvGetStillRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1888,13 +1902,13 @@ type XvStopVideoCookie struct { } // Write request to wire for XvStopVideo -func (c *Conn) XvStopVideo(Port Id, Drawable Id) XvStopVideoCookie { +func (c *Conn) XvStopVideo(Port XvPort, Drawable Drawable) XvStopVideoCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) return XvStopVideoCookie{cookie} } -func (c *Conn) XvStopVideoChecked(Port Id, Drawable Id) XvStopVideoCookie { +func (c *Conn) XvStopVideoChecked(Port XvPort, Drawable Drawable) XvStopVideoCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) return XvStopVideoCookie{cookie} @@ -1905,7 +1919,7 @@ func (cook XvStopVideoCookie) Check() error { } // Write request to wire for XvStopVideo -func (c *Conn) xvStopVideoRequest(Port Id, Drawable Id) []byte { +func (c *Conn) xvStopVideoRequest(Port XvPort, Drawable Drawable) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1935,13 +1949,13 @@ type XvSelectVideoNotifyCookie struct { } // Write request to wire for XvSelectVideoNotify -func (c *Conn) XvSelectVideoNotify(Drawable Id, Onoff bool) XvSelectVideoNotifyCookie { +func (c *Conn) XvSelectVideoNotify(Drawable Drawable, Onoff bool) XvSelectVideoNotifyCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) return XvSelectVideoNotifyCookie{cookie} } -func (c *Conn) XvSelectVideoNotifyChecked(Drawable Id, Onoff bool) XvSelectVideoNotifyCookie { +func (c *Conn) XvSelectVideoNotifyChecked(Drawable Drawable, Onoff bool) XvSelectVideoNotifyCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) return XvSelectVideoNotifyCookie{cookie} @@ -1952,7 +1966,7 @@ func (cook XvSelectVideoNotifyCookie) Check() error { } // Write request to wire for XvSelectVideoNotify -func (c *Conn) xvSelectVideoNotifyRequest(Drawable Id, Onoff bool) []byte { +func (c *Conn) xvSelectVideoNotifyRequest(Drawable Drawable, Onoff bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1988,13 +2002,13 @@ type XvSelectPortNotifyCookie struct { } // Write request to wire for XvSelectPortNotify -func (c *Conn) XvSelectPortNotify(Port Id, Onoff bool) XvSelectPortNotifyCookie { +func (c *Conn) XvSelectPortNotify(Port XvPort, Onoff bool) XvSelectPortNotifyCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) return XvSelectPortNotifyCookie{cookie} } -func (c *Conn) XvSelectPortNotifyChecked(Port Id, Onoff bool) XvSelectPortNotifyCookie { +func (c *Conn) XvSelectPortNotifyChecked(Port XvPort, Onoff bool) XvSelectPortNotifyCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) return XvSelectPortNotifyCookie{cookie} @@ -2005,7 +2019,7 @@ func (cook XvSelectPortNotifyCookie) Check() error { } // Write request to wire for XvSelectPortNotify -func (c *Conn) xvSelectPortNotifyRequest(Port Id, Onoff bool) []byte { +func (c *Conn) xvSelectPortNotifyRequest(Port XvPort, Onoff bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2040,13 +2054,13 @@ type XvQueryBestSizeCookie struct { *cookie } -func (c *Conn) XvQueryBestSize(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { +func (c *Conn) XvQueryBestSize(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return XvQueryBestSizeCookie{cookie} } -func (c *Conn) XvQueryBestSizeUnchecked(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { +func (c *Conn) XvQueryBestSizeUnchecked(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return XvQueryBestSizeCookie{cookie} @@ -2101,7 +2115,7 @@ func (cook XvQueryBestSizeCookie) Check() error { } // Write request to wire for XvQueryBestSize -func (c *Conn) xvQueryBestSizeRequest(Port Id, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { +func (c *Conn) xvQueryBestSizeRequest(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -2149,13 +2163,13 @@ type XvSetPortAttributeCookie struct { } // Write request to wire for XvSetPortAttribute -func (c *Conn) XvSetPortAttribute(Port Id, Attribute Id, Value int32) XvSetPortAttributeCookie { +func (c *Conn) XvSetPortAttribute(Port XvPort, Attribute Atom, Value int32) XvSetPortAttributeCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) return XvSetPortAttributeCookie{cookie} } -func (c *Conn) XvSetPortAttributeChecked(Port Id, Attribute Id, Value int32) XvSetPortAttributeCookie { +func (c *Conn) XvSetPortAttributeChecked(Port XvPort, Attribute Atom, Value int32) XvSetPortAttributeCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) return XvSetPortAttributeCookie{cookie} @@ -2166,7 +2180,7 @@ func (cook XvSetPortAttributeCookie) Check() error { } // Write request to wire for XvSetPortAttribute -func (c *Conn) xvSetPortAttributeRequest(Port Id, Attribute Id, Value int32) []byte { +func (c *Conn) xvSetPortAttributeRequest(Port XvPort, Attribute Atom, Value int32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -2198,13 +2212,13 @@ type XvGetPortAttributeCookie struct { *cookie } -func (c *Conn) XvGetPortAttribute(Port Id, Attribute Id) XvGetPortAttributeCookie { +func (c *Conn) XvGetPortAttribute(Port XvPort, Attribute Atom) XvGetPortAttributeCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) return XvGetPortAttributeCookie{cookie} } -func (c *Conn) XvGetPortAttributeUnchecked(Port Id, Attribute Id) XvGetPortAttributeCookie { +func (c *Conn) XvGetPortAttributeUnchecked(Port XvPort, Attribute Atom) XvGetPortAttributeCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) return XvGetPortAttributeCookie{cookie} @@ -2255,7 +2269,7 @@ func (cook XvGetPortAttributeCookie) Check() error { } // Write request to wire for XvGetPortAttribute -func (c *Conn) xvGetPortAttributeRequest(Port Id, Attribute Id) []byte { +func (c *Conn) xvGetPortAttributeRequest(Port XvPort, Attribute Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -2284,13 +2298,13 @@ type XvQueryPortAttributesCookie struct { *cookie } -func (c *Conn) XvQueryPortAttributes(Port Id) XvQueryPortAttributesCookie { +func (c *Conn) XvQueryPortAttributes(Port XvPort) XvQueryPortAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) return XvQueryPortAttributesCookie{cookie} } -func (c *Conn) XvQueryPortAttributesUnchecked(Port Id) XvQueryPortAttributesCookie { +func (c *Conn) XvQueryPortAttributesUnchecked(Port XvPort) XvQueryPortAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) return XvQueryPortAttributesCookie{cookie} @@ -2352,7 +2366,7 @@ func (cook XvQueryPortAttributesCookie) Check() error { } // Write request to wire for XvQueryPortAttributes -func (c *Conn) xvQueryPortAttributesRequest(Port Id) []byte { +func (c *Conn) xvQueryPortAttributesRequest(Port XvPort) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2378,13 +2392,13 @@ type XvListImageFormatsCookie struct { *cookie } -func (c *Conn) XvListImageFormats(Port Id) XvListImageFormatsCookie { +func (c *Conn) XvListImageFormats(Port XvPort) XvListImageFormatsCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvListImageFormatsRequest(Port), cookie) return XvListImageFormatsCookie{cookie} } -func (c *Conn) XvListImageFormatsUnchecked(Port Id) XvListImageFormatsCookie { +func (c *Conn) XvListImageFormatsUnchecked(Port XvPort) XvListImageFormatsCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvListImageFormatsRequest(Port), cookie) return XvListImageFormatsCookie{cookie} @@ -2442,7 +2456,7 @@ func (cook XvListImageFormatsCookie) Check() error { } // Write request to wire for XvListImageFormats -func (c *Conn) xvListImageFormatsRequest(Port Id) []byte { +func (c *Conn) xvListImageFormatsRequest(Port XvPort) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2468,13 +2482,13 @@ type XvQueryImageAttributesCookie struct { *cookie } -func (c *Conn) XvQueryImageAttributes(Port Id, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { +func (c *Conn) XvQueryImageAttributes(Port XvPort, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) return XvQueryImageAttributesCookie{cookie} } -func (c *Conn) XvQueryImageAttributesUnchecked(Port Id, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { +func (c *Conn) XvQueryImageAttributesUnchecked(Port XvPort, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) return XvQueryImageAttributesCookie{cookie} @@ -2556,7 +2570,7 @@ func (cook XvQueryImageAttributesCookie) Check() error { } // Write request to wire for XvQueryImageAttributes -func (c *Conn) xvQueryImageAttributesRequest(Port Id, Id uint32, Width uint16, Height uint16) []byte { +func (c *Conn) xvQueryImageAttributesRequest(Port XvPort, Id uint32, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -2592,13 +2606,13 @@ type XvPutImageCookie struct { } // Write request to wire for XvPutImage -func (c *Conn) XvPutImage(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { +func (c *Conn) XvPutImage(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return XvPutImageCookie{cookie} } -func (c *Conn) XvPutImageChecked(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { +func (c *Conn) XvPutImageChecked(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return XvPutImageCookie{cookie} @@ -2609,7 +2623,7 @@ func (cook XvPutImageCookie) Check() error { } // Write request to wire for XvPutImage -func (c *Conn) xvPutImageRequest(Port Id, Drawable Id, Gc Id, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { +func (c *Conn) xvPutImageRequest(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { size := pad((40 + pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -2678,13 +2692,13 @@ type XvShmPutImageCookie struct { } // Write request to wire for XvShmPutImage -func (c *Conn) XvShmPutImage(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { +func (c *Conn) XvShmPutImage(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return XvShmPutImageCookie{cookie} } -func (c *Conn) XvShmPutImageChecked(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { +func (c *Conn) XvShmPutImageChecked(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return XvShmPutImageCookie{cookie} @@ -2695,7 +2709,7 @@ func (cook XvShmPutImageCookie) Check() error { } // Write request to wire for XvShmPutImage -func (c *Conn) xvShmPutImageRequest(Port Id, Drawable Id, Gc Id, Shmseg Id, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { +func (c *Conn) xvShmPutImageRequest(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { size := 52 b := 0 buf := make([]byte, size) diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go index 4797488..ba4bd44 100644 --- a/nexgb/auto_xvmc.go +++ b/nexgb/auto_xvmc.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by xvmc.xml on May 8 2012 11:03:25pm EDT. + This file was generated by xvmc.xml on May 10 2012 12:39:35pm EDT. This file is automatically generated. Edit at your peril! */ @@ -37,14 +37,6 @@ func init() { newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -59,20 +51,50 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Id' - // Skipping definition for base type 'Card8' -// Skipping resource definition of 'Context' +// Skipping definition for base type 'Int16' -// Skipping resource definition of 'Surface' +// Skipping definition for base type 'Int32' -// Skipping resource definition of 'Subpicture' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +type XvmcContext uint32 + +func (c *Conn) NewXvmcContextId() (XvmcContext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XvmcContext(id), nil +} + +type XvmcSurface uint32 + +func (c *Conn) NewXvmcSurfaceId() (XvmcSurface, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XvmcSurface(id), nil +} + +type XvmcSubpicture uint32 + +func (c *Conn) NewXvmcSubpictureId() (XvmcSubpicture, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return XvmcSubpicture(id), nil +} // 'XvmcSurfaceInfo' struct definition // Size: 24 type XvmcSurfaceInfo struct { - Id Id + Id XvmcSurface ChromaFormat uint16 Pad0 uint16 MaxWidth uint16 @@ -87,7 +109,7 @@ type XvmcSurfaceInfo struct { func ReadXvmcSurfaceInfo(buf []byte, v *XvmcSurfaceInfo) int { b := 0 - v.Id = Id(Get32(buf[b:])) + v.Id = XvmcSurface(Get32(buf[b:])) b += 4 v.ChromaFormat = Get16(buf[b:]) @@ -264,13 +286,13 @@ type XvmcListSurfaceTypesCookie struct { *cookie } -func (c *Conn) XvmcListSurfaceTypes(PortId Id) XvmcListSurfaceTypesCookie { +func (c *Conn) XvmcListSurfaceTypes(PortId XvPort) XvmcListSurfaceTypesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) return XvmcListSurfaceTypesCookie{cookie} } -func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId Id) XvmcListSurfaceTypesCookie { +func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId XvPort) XvmcListSurfaceTypesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) return XvmcListSurfaceTypesCookie{cookie} @@ -328,7 +350,7 @@ func (cook XvmcListSurfaceTypesCookie) Check() error { } // Write request to wire for XvmcListSurfaceTypes -func (c *Conn) xvmcListSurfaceTypesRequest(PortId Id) []byte { +func (c *Conn) xvmcListSurfaceTypesRequest(PortId XvPort) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -354,13 +376,13 @@ type XvmcCreateContextCookie struct { *cookie } -func (c *Conn) XvmcCreateContext(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { +func (c *Conn) XvmcCreateContext(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return XvmcCreateContextCookie{cookie} } -func (c *Conn) XvmcCreateContextUnchecked(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { +func (c *Conn) XvmcCreateContextUnchecked(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return XvmcCreateContextCookie{cookie} @@ -430,7 +452,7 @@ func (cook XvmcCreateContextCookie) Check() error { } // Write request to wire for XvmcCreateContext -func (c *Conn) xvmcCreateContextRequest(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) []byte { +func (c *Conn) xvmcCreateContextRequest(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -472,13 +494,13 @@ type XvmcDestroyContextCookie struct { } // Write request to wire for XvmcDestroyContext -func (c *Conn) XvmcDestroyContext(ContextId Id) XvmcDestroyContextCookie { +func (c *Conn) XvmcDestroyContext(ContextId XvmcContext) XvmcDestroyContextCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) return XvmcDestroyContextCookie{cookie} } -func (c *Conn) XvmcDestroyContextChecked(ContextId Id) XvmcDestroyContextCookie { +func (c *Conn) XvmcDestroyContextChecked(ContextId XvmcContext) XvmcDestroyContextCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) return XvmcDestroyContextCookie{cookie} @@ -489,7 +511,7 @@ func (cook XvmcDestroyContextCookie) Check() error { } // Write request to wire for XvmcDestroyContext -func (c *Conn) xvmcDestroyContextRequest(ContextId Id) []byte { +func (c *Conn) xvmcDestroyContextRequest(ContextId XvmcContext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -515,13 +537,13 @@ type XvmcCreateSurfaceCookie struct { *cookie } -func (c *Conn) XvmcCreateSurface(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie { +func (c *Conn) XvmcCreateSurface(SurfaceId XvmcSurface, ContextId XvmcContext) XvmcCreateSurfaceCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) return XvmcCreateSurfaceCookie{cookie} } -func (c *Conn) XvmcCreateSurfaceUnchecked(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie { +func (c *Conn) XvmcCreateSurfaceUnchecked(SurfaceId XvmcSurface, ContextId XvmcContext) XvmcCreateSurfaceCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) return XvmcCreateSurfaceCookie{cookie} @@ -579,7 +601,7 @@ func (cook XvmcCreateSurfaceCookie) Check() error { } // Write request to wire for XvmcCreateSurface -func (c *Conn) xvmcCreateSurfaceRequest(SurfaceId Id, ContextId Id) []byte { +func (c *Conn) xvmcCreateSurfaceRequest(SurfaceId XvmcSurface, ContextId XvmcContext) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -609,13 +631,13 @@ type XvmcDestroySurfaceCookie struct { } // Write request to wire for XvmcDestroySurface -func (c *Conn) XvmcDestroySurface(SurfaceId Id) XvmcDestroySurfaceCookie { +func (c *Conn) XvmcDestroySurface(SurfaceId XvmcSurface) XvmcDestroySurfaceCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) return XvmcDestroySurfaceCookie{cookie} } -func (c *Conn) XvmcDestroySurfaceChecked(SurfaceId Id) XvmcDestroySurfaceCookie { +func (c *Conn) XvmcDestroySurfaceChecked(SurfaceId XvmcSurface) XvmcDestroySurfaceCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) return XvmcDestroySurfaceCookie{cookie} @@ -626,7 +648,7 @@ func (cook XvmcDestroySurfaceCookie) Check() error { } // Write request to wire for XvmcDestroySurface -func (c *Conn) xvmcDestroySurfaceRequest(SurfaceId Id) []byte { +func (c *Conn) xvmcDestroySurfaceRequest(SurfaceId XvmcSurface) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -652,13 +674,13 @@ type XvmcCreateSubpictureCookie struct { *cookie } -func (c *Conn) XvmcCreateSubpicture(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { +func (c *Conn) XvmcCreateSubpicture(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) return XvmcCreateSubpictureCookie{cookie} } -func (c *Conn) XvmcCreateSubpictureUnchecked(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { +func (c *Conn) XvmcCreateSubpictureUnchecked(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) return XvmcCreateSubpictureCookie{cookie} @@ -737,7 +759,7 @@ func (cook XvmcCreateSubpictureCookie) Check() error { } // Write request to wire for XvmcCreateSubpicture -func (c *Conn) xvmcCreateSubpictureRequest(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) []byte { +func (c *Conn) xvmcCreateSubpictureRequest(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -776,13 +798,13 @@ type XvmcDestroySubpictureCookie struct { } // Write request to wire for XvmcDestroySubpicture -func (c *Conn) XvmcDestroySubpicture(SubpictureId Id) XvmcDestroySubpictureCookie { +func (c *Conn) XvmcDestroySubpicture(SubpictureId XvmcSubpicture) XvmcDestroySubpictureCookie { cookie := c.newCookie(false, false) c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) return XvmcDestroySubpictureCookie{cookie} } -func (c *Conn) XvmcDestroySubpictureChecked(SubpictureId Id) XvmcDestroySubpictureCookie { +func (c *Conn) XvmcDestroySubpictureChecked(SubpictureId XvmcSubpicture) XvmcDestroySubpictureCookie { cookie := c.newCookie(true, false) c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) return XvmcDestroySubpictureCookie{cookie} @@ -793,7 +815,7 @@ func (cook XvmcDestroySubpictureCookie) Check() error { } // Write request to wire for XvmcDestroySubpicture -func (c *Conn) xvmcDestroySubpictureRequest(SubpictureId Id) []byte { +func (c *Conn) xvmcDestroySubpictureRequest(SubpictureId XvmcSubpicture) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -819,13 +841,13 @@ type XvmcListSubpictureTypesCookie struct { *cookie } -func (c *Conn) XvmcListSubpictureTypes(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie { +func (c *Conn) XvmcListSubpictureTypes(PortId XvPort, SurfaceId XvmcSurface) XvmcListSubpictureTypesCookie { cookie := c.newCookie(true, true) c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) return XvmcListSubpictureTypesCookie{cookie} } -func (c *Conn) XvmcListSubpictureTypesUnchecked(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie { +func (c *Conn) XvmcListSubpictureTypesUnchecked(PortId XvPort, SurfaceId XvmcSurface) XvmcListSubpictureTypesCookie { cookie := c.newCookie(false, true) c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) return XvmcListSubpictureTypesCookie{cookie} @@ -883,7 +905,7 @@ func (cook XvmcListSubpictureTypesCookie) Check() error { } // Write request to wire for XvmcListSubpictureTypes -func (c *Conn) xvmcListSubpictureTypesRequest(PortId Id, SurfaceId Id) []byte { +func (c *Conn) xvmcListSubpictureTypesRequest(PortId XvPort, SurfaceId XvmcSurface) []byte { size := 12 b := 0 buf := make([]byte, size) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 8baa208..6a71187 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -110,9 +110,6 @@ func (c *Conn) DefaultScreen() *ScreenInfo { return &c.Setup.Roots[c.defaultScreen] } -// Id is used for all X identifiers, such as windows, pixmaps, and GCs. -type Id uint32 - // Event is an interface that can contain any of the events returned by the // server. Use a type assertion switch to extract the Event structs. type Event interface { @@ -137,7 +134,7 @@ var newExtEventFuncs = make(map[string]map[int]newEventFun) type Error interface { ImplementsError() SequenceId() uint16 - BadId() Id + BadId() uint32 Error() string } @@ -158,7 +155,9 @@ type eventOrError interface{} // NewID generates a new unused ID for use with requests like CreateWindow. // If no new ids can be generated, the id returned is 0 and error is non-nil. -func (c *Conn) NewId() (Id, error) { +// Note that the value returned will need to be converted to the proper +// type. i.e., xproto.Window(id). +func (c *Conn) NewId() (uint32, error) { xid := <-c.xidChan if xid.err != nil { return 0, xid.err @@ -170,7 +169,7 @@ func (c *Conn) NewId() (Id, error) { // channel. If no new resource id can be generated, id is set to 0 and a // non-nil error is set in xid.err. type xid struct { - id Id + id uint32 err error } @@ -202,7 +201,7 @@ func (conn *Conn) generateXIds() { // TODO: Use the XC Misc extension to look for released ids. if last > 0 && last >= max-inc+1 { conn.xidChan <- xid{ - id: Id(0), + id: 0, err: errors.New("There are no more available resource" + "identifiers."), } @@ -210,7 +209,7 @@ func (conn *Conn) generateXIds() { last += inc conn.xidChan <- xid{ - id: Id(last | conn.Setup.ResourceIdBase), + id: last | conn.Setup.ResourceIdBase, err: nil, } } diff --git a/nexgb/xgb_test.go b/nexgb/xgb_test.go index 7eea19b..d0e840a 100644 --- a/nexgb/xgb_test.go +++ b/nexgb/xgb_test.go @@ -127,7 +127,7 @@ func TestWindowEvents(t *testing.T) { // The geometry to set the window. gx, gy, gw, gh := 200, 400, 1000, 300 - wid, err := X.NewId() + wid, err := X.NewWindowId() if err != nil { t.Fatalf("NewId: %s", err) } diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index e0d4579..2b2c191 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -4,10 +4,6 @@ import ( "fmt" ) -// xgbResourceIdName is the name of the type used for all resource identifiers. -// As of right now, it needs to be declared somewhere manually. -var xgbGenResourceIdName = "Id" - // BaseTypeMap is a map from X base types to Go types. // X base types should correspond to the smallest set of X types // that can be used to rewrite ALL X types in terms of Go types. @@ -27,7 +23,6 @@ var BaseTypeMap = map[string]string{ "double": "float64", "char": "byte", "void": "byte", - "Id": "Id", } // BaseTypeSizes should have precisely the same keys as in BaseTypeMap, @@ -45,7 +40,10 @@ var BaseTypeSizes = map[string]uint{ "double": 8, "char": 1, "void": 1, - "Id": 4, + + // Id is a special type used to determine the size of all Xid types. + // "Id" is not actually written in the source. + "Id": 4, } // TypeMap is a map from types in the XML to type names that is used @@ -82,8 +80,16 @@ func (enum *Enum) Define(c *Context) { // Resource types func (res *Resource) Define(c *Context) { - c.Putln("// Skipping resource definition of '%s'", - SrcName(c.protocol, res.XmlName())) + c.Putln("type %s uint32", res.SrcName()) + c.Putln("") + c.Putln("func (c *Conn) New%sId() (%s, error) {", + res.SrcName(), res.SrcName()) + c.Putln("id, err := c.NewId()") + c.Putln("if err != nil {") + c.Putln("return 0, err") + c.Putln("}") + c.Putln("return %s(id), nil", res.SrcName()) + c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index c96866c..f4577ef 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -68,9 +68,9 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") - c.Putln("func (err %s) BadId() Id {", e.ErrType()) + c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) if !c.protocol.isExt() { - c.Putln("return Id(err.BadValue)") + c.Putln("return err.BadValue") } else { c.Putln("return 0") } @@ -128,8 +128,12 @@ func (e *ErrorCopy) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") - c.Putln("func (err %s) BadId() Id {", e.ErrType()) - c.Putln("return Id(err.BadValue)") + c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) + if !c.protocol.isExt() { + c.Putln("return err.BadValue") + } else { + c.Putln("return 0") + } c.Putln("}") c.Putln("") c.Putln("func (err %s) Error() string {", e.ErrType()) diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index ad859bb..b01519b 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -16,7 +16,8 @@ func (f *ListField) Read(c *Context, prefix string) { switch t := f.Type.(type) { case *Resource: length := f.LengthExpr.Reduce(prefix) - c.Putln("%s%s = make([]Id, %s)", prefix, f.SrcName(), length) + c.Putln("%s%s = make([]%s, %s)", + prefix, f.SrcName(), t.SrcName(), length) c.Putln("for i := 0; i < int(%s); i++ {", length) ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go index ea43d55..433ebe3 100644 --- a/nexgb/xgbgen/go_single_field.go +++ b/nexgb/xgbgen/go_single_field.go @@ -12,7 +12,7 @@ func (f *SingleField) Define(c *Context) { func ReadSimpleSingleField(c *Context, name string, typ Type) { switch t := typ.(type) { case *Resource: - c.Putln("%s = Id(Get32(buf[b:]))", name) + c.Putln("%s = %s(Get32(buf[b:]))", name, t.SrcName()) case *TypeDef: switch t.Size().Eval() { case 1: diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index e4d81bc..44d615d 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -395,11 +395,6 @@ func TypeSrcName(p *Protocol, typ Type) string { return newt } - // If it's a resource type, just use 'Id'. - if _, ok := typ.(*Resource); ok { - return xgbGenResourceIdName - } - // If there's a namespace to this type, just use it and be done. if colon := strings.Index(t, ":"); colon > -1 { namespace := t[:colon] From 0c50dc6241fa21712e041cfa2bfb9db4ccaef10a Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 17:01:42 -0400 Subject: [PATCH 34/90] a huge commit. splitting extensions into their own sub-packages. --- nexgb/Makefile | 25 +- nexgb/auto_bigreq.go | 138 - nexgb/auto_composite.go | 581 -- nexgb/auto_damage.go | 513 - nexgb/auto_dpms.go | 600 -- nexgb/auto_dri2.go | 1560 --- nexgb/auto_ge.go | 151 - nexgb/auto_glx.go | 9430 ------------------ nexgb/auto_randr.go | 4038 -------- nexgb/auto_record.go | 1095 -- nexgb/auto_render.go | 3556 ------- nexgb/auto_res.go | 528 - nexgb/auto_screensaver.go | 627 -- nexgb/auto_shape.go | 897 -- nexgb/auto_shm.go | 678 -- nexgb/auto_sync.go | 1949 ---- nexgb/auto_xc_misc.go | 326 - nexgb/auto_xevie.go | 539 - nexgb/auto_xf86dri.go | 1151 --- nexgb/auto_xf86vidmode.go | 2398 ----- nexgb/auto_xfixes.go | 2173 ---- nexgb/auto_xinerama.go | 655 -- nexgb/auto_xinput.go | 7297 -------------- nexgb/auto_xprint.go | 2210 ---- nexgb/auto_xselinux.go | 1965 ---- nexgb/auto_xtest.go | 361 - nexgb/auto_xv.go | 2780 ------ nexgb/auto_xvmc.go | 929 -- nexgb/bigreq/bigreq.go | 140 + nexgb/composite/composite.go | 575 ++ nexgb/conn.go | 17 +- nexgb/cookie.go | 36 +- nexgb/damage/damage.go | 511 + nexgb/doc.go | 23 +- nexgb/dpms/dpms.go | 590 ++ nexgb/dri2/dri2.go | 1522 +++ nexgb/examples/create-window/main.go | 33 +- nexgb/examples/get-active-window/main.go | 20 +- nexgb/examples/randr/main.go | 23 +- nexgb/examples/xinerama/main.go | 5 +- nexgb/ge/ge.go | 153 + nexgb/glx/glx.go | 9168 +++++++++++++++++ nexgb/randr/randr.go | 3964 ++++++++ nexgb/record/record.go | 1089 ++ nexgb/render/render.go | 3542 +++++++ nexgb/res/res.go | 514 + nexgb/screensaver/screensaver.go | 621 ++ nexgb/shape/shape.go | 883 ++ nexgb/shm/shm.go | 672 ++ nexgb/sync.go | 29 + nexgb/sync/sync.go | 1927 ++++ nexgb/xcmisc/xcmisc.go | 320 + nexgb/xevie/xevie.go | 525 + nexgb/xf86dri/xf86dri.go | 1121 +++ nexgb/xf86vidmode/xf86vidmode.go | 2360 +++++ nexgb/xfixes/xfixes.go | 2155 ++++ nexgb/xgb.go | 89 +- nexgb/xgb_help.go | 16 +- nexgb/xgbgen/context.go | 78 +- nexgb/xgbgen/expression.go | 4 +- nexgb/xgbgen/field.go | 2 +- nexgb/xgbgen/go.go | 10 +- nexgb/xgbgen/go_error.go | 23 +- nexgb/xgbgen/go_event.go | 27 +- nexgb/xgbgen/go_list.go | 22 +- nexgb/xgbgen/go_request_reply.go | 53 +- nexgb/xgbgen/go_single_field.go | 42 +- nexgb/xgbgen/go_struct.go | 10 +- nexgb/xgbgen/go_union.go | 14 +- nexgb/xgbgen/protocol.go | 24 + nexgb/xgbgen/request_reply.go | 3 +- nexgb/xgbgen/translation.go | 36 +- nexgb/xinerama/xinerama.go | 633 ++ nexgb/xinput/xinput.go | 7219 ++++++++++++++ nexgb/xprint/xprint.go | 2164 ++++ nexgb/{auto_xproto.go => xproto/xproto.go} | 6023 ++++++----- nexgb/{xgb_test.go => xproto/xproto_test.go} | 69 +- nexgb/xselinux/xselinux.go | 1903 ++++ nexgb/xtest/xtest.go | 355 + nexgb/xv/xv.go | 2746 +++++ nexgb/xvmc/xvmc.go | 908 ++ 81 files changed, 51645 insertions(+), 52516 deletions(-) delete mode 100644 nexgb/auto_bigreq.go delete mode 100644 nexgb/auto_composite.go delete mode 100644 nexgb/auto_damage.go delete mode 100644 nexgb/auto_dpms.go delete mode 100644 nexgb/auto_dri2.go delete mode 100644 nexgb/auto_ge.go delete mode 100644 nexgb/auto_glx.go delete mode 100644 nexgb/auto_randr.go delete mode 100644 nexgb/auto_record.go delete mode 100644 nexgb/auto_render.go delete mode 100644 nexgb/auto_res.go delete mode 100644 nexgb/auto_screensaver.go delete mode 100644 nexgb/auto_shape.go delete mode 100644 nexgb/auto_shm.go delete mode 100644 nexgb/auto_sync.go delete mode 100644 nexgb/auto_xc_misc.go delete mode 100644 nexgb/auto_xevie.go delete mode 100644 nexgb/auto_xf86dri.go delete mode 100644 nexgb/auto_xf86vidmode.go delete mode 100644 nexgb/auto_xfixes.go delete mode 100644 nexgb/auto_xinerama.go delete mode 100644 nexgb/auto_xinput.go delete mode 100644 nexgb/auto_xprint.go delete mode 100644 nexgb/auto_xselinux.go delete mode 100644 nexgb/auto_xtest.go delete mode 100644 nexgb/auto_xv.go delete mode 100644 nexgb/auto_xvmc.go create mode 100644 nexgb/bigreq/bigreq.go create mode 100644 nexgb/composite/composite.go create mode 100644 nexgb/damage/damage.go create mode 100644 nexgb/dpms/dpms.go create mode 100644 nexgb/dri2/dri2.go create mode 100644 nexgb/ge/ge.go create mode 100644 nexgb/glx/glx.go create mode 100644 nexgb/randr/randr.go create mode 100644 nexgb/record/record.go create mode 100644 nexgb/render/render.go create mode 100644 nexgb/res/res.go create mode 100644 nexgb/screensaver/screensaver.go create mode 100644 nexgb/shape/shape.go create mode 100644 nexgb/shm/shm.go create mode 100644 nexgb/sync.go create mode 100644 nexgb/sync/sync.go create mode 100644 nexgb/xcmisc/xcmisc.go create mode 100644 nexgb/xevie/xevie.go create mode 100644 nexgb/xf86dri/xf86dri.go create mode 100644 nexgb/xf86vidmode/xf86vidmode.go create mode 100644 nexgb/xfixes/xfixes.go create mode 100644 nexgb/xinerama/xinerama.go create mode 100644 nexgb/xinput/xinput.go create mode 100644 nexgb/xprint/xprint.go rename nexgb/{auto_xproto.go => xproto/xproto.go} (51%) rename nexgb/{xgb_test.go => xproto/xproto_test.go} (86%) create mode 100644 nexgb/xselinux/xselinux.go create mode 100644 nexgb/xtest/xtest.go create mode 100644 nexgb/xv/xv.go create mode 100644 nexgb/xvmc/xvmc.go diff --git a/nexgb/Makefile b/nexgb/Makefile index 56738f4..7fa8b9b 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -16,17 +16,30 @@ all: build-xgbgen \ build-xgbgen: (cd xgbgen && go build) -%.xml: - xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > auto_$*.go +build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ + record.b render.b res.b screensaver.b shape.b shm.b sync.b xcmisc.b \ + xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \ + xprint.b xproto.b xselinux.b xtest.b xv.b xvmc.b + +%.b: + (cd $* ; go build) + +xc_misc.xml: build-xgbgen + mkdir -p xcmisc + xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go + +%.xml: build-xgbgen + mkdir -p $* + xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go test: - go test + (cd xproto ; go test) bench: - go test -run 'nomatch' -bench '.*' -cpu 1,2,6 + (cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,6) gofmt: gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go - colcheck xgbgen/*.go examples/*.go examples/*/*.go \ - auth.go conn.go cookie.go doc.go xgb.go xgb_help.go xgb_test.go + colcheck xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go \ + auth.go conn.go cookie.go doc.go xgb.go xgb_help.go diff --git a/nexgb/auto_bigreq.go b/nexgb/auto_bigreq.go deleted file mode 100644 index e8bbaef..0000000 --- a/nexgb/auto_bigreq.go +++ /dev/null @@ -1,138 +0,0 @@ -package xgb - -/* - This file was generated by bigreq.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// BigreqInit must be called before using the BIG-REQUESTS extension. -func (c *Conn) BigreqInit() error { - reply, err := c.QueryExtension(12, "BIG-REQUESTS").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named BIG-REQUESTS could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["BIG-REQUESTS"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["BIG-REQUESTS"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["BIG-REQUESTS"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["BIG-REQUESTS"] = make(map[int]newEventFun) - newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Request BigreqEnable -// size: 4 -type BigreqEnableCookie struct { - *cookie -} - -func (c *Conn) BigreqEnable() BigreqEnableCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.bigreqEnableRequest(), cookie) - return BigreqEnableCookie{cookie} -} - -func (c *Conn) BigreqEnableUnchecked() BigreqEnableCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.bigreqEnableRequest(), cookie) - return BigreqEnableCookie{cookie} -} - -// Request reply for BigreqEnable -// size: 12 -type BigreqEnableReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MaximumRequestLength uint32 -} - -// Waits and reads reply data from request BigreqEnable -func (cook BigreqEnableCookie) Reply() (*BigreqEnableReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return bigreqEnableReply(buf), nil -} - -// Read reply into structure from buffer for BigreqEnable -func bigreqEnableReply(buf []byte) *BigreqEnableReply { - v := new(BigreqEnableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MaximumRequestLength = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook BigreqEnableCookie) Check() error { - return cook.check() -} - -// Write request to wire for BigreqEnable -func (c *Conn) bigreqEnableRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["BIG-REQUESTS"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} diff --git a/nexgb/auto_composite.go b/nexgb/auto_composite.go deleted file mode 100644 index 836436f..0000000 --- a/nexgb/auto_composite.go +++ /dev/null @@ -1,581 +0,0 @@ -package xgb - -/* - This file was generated by composite.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" -// import "xfixes" - -// CompositeInit must be called before using the Composite extension. -func (c *Conn) CompositeInit() error { - reply, err := c.QueryExtension(9, "Composite").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named Composite could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["Composite"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["Composite"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["Composite"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["Composite"] = make(map[int]newEventFun) - newExtErrorFuncs["Composite"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -const ( - CompositeRedirectAutomatic = 0 - CompositeRedirectManual = 1 -) - -// Request CompositeQueryVersion -// size: 12 -type CompositeQueryVersionCookie struct { - *cookie -} - -func (c *Conn) CompositeQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return CompositeQueryVersionCookie{cookie} -} - -func (c *Conn) CompositeQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return CompositeQueryVersionCookie{cookie} -} - -// Request reply for CompositeQueryVersion -// size: 32 -type CompositeQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request CompositeQueryVersion -func (cook CompositeQueryVersionCookie) Reply() (*CompositeQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return compositeQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for CompositeQueryVersion -func compositeQueryVersionReply(buf []byte) *CompositeQueryVersionReply { - v := new(CompositeQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook CompositeQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeQueryVersion -func (c *Conn) compositeQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ClientMajorVersion) - b += 4 - - Put32(buf[b:], ClientMinorVersion) - b += 4 - - return buf -} - -// Request CompositeRedirectWindow -// size: 12 -type CompositeRedirectWindowCookie struct { - *cookie -} - -// Write request to wire for CompositeRedirectWindow -func (c *Conn) CompositeRedirectWindow(Window Window, Update byte) CompositeRedirectWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) - return CompositeRedirectWindowCookie{cookie} -} - -func (c *Conn) CompositeRedirectWindowChecked(Window Window, Update byte) CompositeRedirectWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie) - return CompositeRedirectWindowCookie{cookie} -} - -func (cook CompositeRedirectWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeRedirectWindow -func (c *Conn) compositeRedirectWindowRequest(Window Window, Update byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = Update - b += 1 - - b += 3 // padding - - return buf -} - -// Request CompositeRedirectSubwindows -// size: 12 -type CompositeRedirectSubwindowsCookie struct { - *cookie -} - -// Write request to wire for CompositeRedirectSubwindows -func (c *Conn) CompositeRedirectSubwindows(Window Window, Update byte) CompositeRedirectSubwindowsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) - return CompositeRedirectSubwindowsCookie{cookie} -} - -func (c *Conn) CompositeRedirectSubwindowsChecked(Window Window, Update byte) CompositeRedirectSubwindowsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie) - return CompositeRedirectSubwindowsCookie{cookie} -} - -func (cook CompositeRedirectSubwindowsCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeRedirectSubwindows -func (c *Conn) compositeRedirectSubwindowsRequest(Window Window, Update byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = Update - b += 1 - - b += 3 // padding - - return buf -} - -// Request CompositeUnredirectWindow -// size: 12 -type CompositeUnredirectWindowCookie struct { - *cookie -} - -// Write request to wire for CompositeUnredirectWindow -func (c *Conn) CompositeUnredirectWindow(Window Window, Update byte) CompositeUnredirectWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) - return CompositeUnredirectWindowCookie{cookie} -} - -func (c *Conn) CompositeUnredirectWindowChecked(Window Window, Update byte) CompositeUnredirectWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie) - return CompositeUnredirectWindowCookie{cookie} -} - -func (cook CompositeUnredirectWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeUnredirectWindow -func (c *Conn) compositeUnredirectWindowRequest(Window Window, Update byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = Update - b += 1 - - b += 3 // padding - - return buf -} - -// Request CompositeUnredirectSubwindows -// size: 12 -type CompositeUnredirectSubwindowsCookie struct { - *cookie -} - -// Write request to wire for CompositeUnredirectSubwindows -func (c *Conn) CompositeUnredirectSubwindows(Window Window, Update byte) CompositeUnredirectSubwindowsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) - return CompositeUnredirectSubwindowsCookie{cookie} -} - -func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Window, Update byte) CompositeUnredirectSubwindowsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie) - return CompositeUnredirectSubwindowsCookie{cookie} -} - -func (cook CompositeUnredirectSubwindowsCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeUnredirectSubwindows -func (c *Conn) compositeUnredirectSubwindowsRequest(Window Window, Update byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = Update - b += 1 - - b += 3 // padding - - return buf -} - -// Request CompositeCreateRegionFromBorderClip -// size: 12 -type CompositeCreateRegionFromBorderClipCookie struct { - *cookie -} - -// Write request to wire for CompositeCreateRegionFromBorderClip -func (c *Conn) CompositeCreateRegionFromBorderClip(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) - return CompositeCreateRegionFromBorderClipCookie{cookie} -} - -func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie) - return CompositeCreateRegionFromBorderClipCookie{cookie} -} - -func (cook CompositeCreateRegionFromBorderClipCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeCreateRegionFromBorderClip -func (c *Conn) compositeCreateRegionFromBorderClipRequest(Region XfixesRegion, Window Window) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request CompositeNameWindowPixmap -// size: 12 -type CompositeNameWindowPixmapCookie struct { - *cookie -} - -// Write request to wire for CompositeNameWindowPixmap -func (c *Conn) CompositeNameWindowPixmap(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) - return CompositeNameWindowPixmapCookie{cookie} -} - -func (c *Conn) CompositeNameWindowPixmapChecked(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie) - return CompositeNameWindowPixmapCookie{cookie} -} - -func (cook CompositeNameWindowPixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeNameWindowPixmap -func (c *Conn) compositeNameWindowPixmapRequest(Window Window, Pixmap Pixmap) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Pixmap)) - b += 4 - - return buf -} - -// Request CompositeGetOverlayWindow -// size: 8 -type CompositeGetOverlayWindowCookie struct { - *cookie -} - -func (c *Conn) CompositeGetOverlayWindow(Window Window) CompositeGetOverlayWindowCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) - return CompositeGetOverlayWindowCookie{cookie} -} - -func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Window) CompositeGetOverlayWindowCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie) - return CompositeGetOverlayWindowCookie{cookie} -} - -// Request reply for CompositeGetOverlayWindow -// size: 32 -type CompositeGetOverlayWindowReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - OverlayWin Window - // padding: 20 bytes -} - -// Waits and reads reply data from request CompositeGetOverlayWindow -func (cook CompositeGetOverlayWindowCookie) Reply() (*CompositeGetOverlayWindowReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return compositeGetOverlayWindowReply(buf), nil -} - -// Read reply into structure from buffer for CompositeGetOverlayWindow -func compositeGetOverlayWindowReply(buf []byte) *CompositeGetOverlayWindowReply { - v := new(CompositeGetOverlayWindowReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.OverlayWin = Window(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -func (cook CompositeGetOverlayWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeGetOverlayWindow -func (c *Conn) compositeGetOverlayWindowRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request CompositeReleaseOverlayWindow -// size: 8 -type CompositeReleaseOverlayWindowCookie struct { - *cookie -} - -// Write request to wire for CompositeReleaseOverlayWindow -func (c *Conn) CompositeReleaseOverlayWindow(Window Window) CompositeReleaseOverlayWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) - return CompositeReleaseOverlayWindowCookie{cookie} -} - -func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Window) CompositeReleaseOverlayWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie) - return CompositeReleaseOverlayWindowCookie{cookie} -} - -func (cook CompositeReleaseOverlayWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for CompositeReleaseOverlayWindow -func (c *Conn) compositeReleaseOverlayWindowRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["COMPOSITE"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go deleted file mode 100644 index 97c76b4..0000000 --- a/nexgb/auto_damage.go +++ /dev/null @@ -1,513 +0,0 @@ -package xgb - -/* - This file was generated by damage.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" -// import "xfixes" - -// DamageInit must be called before using the DAMAGE extension. -func (c *Conn) DamageInit() error { - reply, err := c.QueryExtension(6, "DAMAGE").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named DAMAGE could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["DAMAGE"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["DAMAGE"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["DAMAGE"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["DAMAGE"] = make(map[int]newEventFun) - newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - DamageReportLevelRawRectangles = 0 - DamageReportLevelDeltaRectangles = 1 - DamageReportLevelBoundingBox = 2 - DamageReportLevelNonEmpty = 3 -) - -type DamageDamage uint32 - -func (c *Conn) NewDamageDamageId() (DamageDamage, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return DamageDamage(id), nil -} - -// Event definition DamageNotify (0) -// Size: 32 - -const DamageNotify = 0 - -type DamageNotifyEvent struct { - Sequence uint16 - Level byte - Drawable Drawable - Damage DamageDamage - Timestamp Timestamp - Area Rectangle - Geometry Rectangle -} - -// Event read DamageNotify -func NewDamageNotifyEvent(buf []byte) Event { - v := DamageNotifyEvent{} - b := 1 // don't read event number - - v.Level = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Drawable = Drawable(Get32(buf[b:])) - b += 4 - - v.Damage = DamageDamage(Get32(buf[b:])) - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Area = Rectangle{} - b += ReadRectangle(buf[b:], &v.Area) - - v.Geometry = Rectangle{} - b += ReadRectangle(buf[b:], &v.Geometry) - - return v -} - -// Event write DamageNotify -func (v DamageNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Level - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - Put32(buf[b:], uint32(v.Damage)) - b += 4 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - { - structBytes := v.Area.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.Geometry.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -func (v DamageNotifyEvent) ImplementsEvent() {} - -func (v DamageNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DamageNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Level: %d", v.Level)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("Damage: %d", v.Damage)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - return "DamageNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["DAMAGE"][0] = NewDamageNotifyEvent -} - -// Error definition DamageBadDamage (0) -// Size: 32 - -const BadDamageBadDamage = 0 - -type DamageBadDamageError struct { - Sequence uint16 - NiceName string -} - -// Error read DamageBadDamage -func NewDamageBadDamageError(buf []byte) Error { - v := DamageBadDamageError{} - v.NiceName = "DamageBadDamage" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err DamageBadDamageError) ImplementsError() {} - -func (err DamageBadDamageError) SequenceId() uint16 { - return err.Sequence -} - -func (err DamageBadDamageError) BadId() uint32 { - return 0 -} - -func (err DamageBadDamageError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadDamageBadDamage {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["DAMAGE"][0] = NewDamageBadDamageError -} - -// Request DamageQueryVersion -// size: 12 -type DamageQueryVersionCookie struct { - *cookie -} - -func (c *Conn) DamageQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return DamageQueryVersionCookie{cookie} -} - -func (c *Conn) DamageQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return DamageQueryVersionCookie{cookie} -} - -// Request reply for DamageQueryVersion -// size: 32 -type DamageQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request DamageQueryVersion -func (cook DamageQueryVersionCookie) Reply() (*DamageQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return damageQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for DamageQueryVersion -func damageQueryVersionReply(buf []byte) *DamageQueryVersionReply { - v := new(DamageQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook DamageQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for DamageQueryVersion -func (c *Conn) damageQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DAMAGE"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ClientMajorVersion) - b += 4 - - Put32(buf[b:], ClientMinorVersion) - b += 4 - - return buf -} - -// Request DamageCreate -// size: 16 -type DamageCreateCookie struct { - *cookie -} - -// Write request to wire for DamageCreate -func (c *Conn) DamageCreate(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) - return DamageCreateCookie{cookie} -} - -func (c *Conn) DamageCreateChecked(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) - return DamageCreateCookie{cookie} -} - -func (cook DamageCreateCookie) Check() error { - return cook.check() -} - -// Write request to wire for DamageCreate -func (c *Conn) damageCreateRequest(Damage DamageDamage, Drawable Drawable, Level byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DAMAGE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Damage)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - buf[b] = Level - b += 1 - - b += 3 // padding - - return buf -} - -// Request DamageDestroy -// size: 8 -type DamageDestroyCookie struct { - *cookie -} - -// Write request to wire for DamageDestroy -func (c *Conn) DamageDestroy(Damage DamageDamage) DamageDestroyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.damageDestroyRequest(Damage), cookie) - return DamageDestroyCookie{cookie} -} - -func (c *Conn) DamageDestroyChecked(Damage DamageDamage) DamageDestroyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.damageDestroyRequest(Damage), cookie) - return DamageDestroyCookie{cookie} -} - -func (cook DamageDestroyCookie) Check() error { - return cook.check() -} - -// Write request to wire for DamageDestroy -func (c *Conn) damageDestroyRequest(Damage DamageDamage) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DAMAGE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Damage)) - b += 4 - - return buf -} - -// Request DamageSubtract -// size: 16 -type DamageSubtractCookie struct { - *cookie -} - -// Write request to wire for DamageSubtract -func (c *Conn) DamageSubtract(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) - return DamageSubtractCookie{cookie} -} - -func (c *Conn) DamageSubtractChecked(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) - return DamageSubtractCookie{cookie} -} - -func (cook DamageSubtractCookie) Check() error { - return cook.check() -} - -// Write request to wire for DamageSubtract -func (c *Conn) damageSubtractRequest(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DAMAGE"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Damage)) - b += 4 - - Put32(buf[b:], uint32(Repair)) - b += 4 - - Put32(buf[b:], uint32(Parts)) - b += 4 - - return buf -} - -// Request DamageAdd -// size: 12 -type DamageAddCookie struct { - *cookie -} - -// Write request to wire for DamageAdd -func (c *Conn) DamageAdd(Drawable Drawable, Region XfixesRegion) DamageAddCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.damageAddRequest(Drawable, Region), cookie) - return DamageAddCookie{cookie} -} - -func (c *Conn) DamageAddChecked(Drawable Drawable, Region XfixesRegion) DamageAddCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.damageAddRequest(Drawable, Region), cookie) - return DamageAddCookie{cookie} -} - -func (cook DamageAddCookie) Check() error { - return cook.check() -} - -// Write request to wire for DamageAdd -func (c *Conn) damageAddRequest(Drawable Drawable, Region XfixesRegion) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DAMAGE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} diff --git a/nexgb/auto_dpms.go b/nexgb/auto_dpms.go deleted file mode 100644 index 8ceab58..0000000 --- a/nexgb/auto_dpms.go +++ /dev/null @@ -1,600 +0,0 @@ -package xgb - -/* - This file was generated by dpms.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// DpmsInit must be called before using the DPMS extension. -func (c *Conn) DpmsInit() error { - reply, err := c.QueryExtension(4, "DPMS").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named DPMS could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["DPMS"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["DPMS"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["DPMS"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["DPMS"] = make(map[int]newEventFun) - newExtErrorFuncs["DPMS"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -const ( - DpmsDPMSModeOn = 0 - DpmsDPMSModeStandby = 1 - DpmsDPMSModeSuspend = 2 - DpmsDPMSModeOff = 3 -) - -// Request DpmsGetVersion -// size: 8 -type DpmsGetVersionCookie struct { - *cookie -} - -func (c *Conn) DpmsGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return DpmsGetVersionCookie{cookie} -} - -func (c *Conn) DpmsGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return DpmsGetVersionCookie{cookie} -} - -// Request reply for DpmsGetVersion -// size: 12 -type DpmsGetVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 -} - -// Waits and reads reply data from request DpmsGetVersion -func (cook DpmsGetVersionCookie) Reply() (*DpmsGetVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dpmsGetVersionReply(buf), nil -} - -// Read reply into structure from buffer for DpmsGetVersion -func dpmsGetVersionReply(buf []byte) *DpmsGetVersionReply { - v := new(DpmsGetVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajorVersion = Get16(buf[b:]) - b += 2 - - v.ServerMinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook DpmsGetVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsGetVersion -func (c *Conn) dpmsGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], ClientMajorVersion) - b += 2 - - Put16(buf[b:], ClientMinorVersion) - b += 2 - - return buf -} - -// Request DpmsCapable -// size: 4 -type DpmsCapableCookie struct { - *cookie -} - -func (c *Conn) DpmsCapable() DpmsCapableCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dpmsCapableRequest(), cookie) - return DpmsCapableCookie{cookie} -} - -func (c *Conn) DpmsCapableUnchecked() DpmsCapableCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dpmsCapableRequest(), cookie) - return DpmsCapableCookie{cookie} -} - -// Request reply for DpmsCapable -// size: 32 -type DpmsCapableReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Capable bool - // padding: 23 bytes -} - -// Waits and reads reply data from request DpmsCapable -func (cook DpmsCapableCookie) Reply() (*DpmsCapableReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dpmsCapableReply(buf), nil -} - -// Read reply into structure from buffer for DpmsCapable -func dpmsCapableReply(buf []byte) *DpmsCapableReply { - v := new(DpmsCapableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.Capable = true - } else { - v.Capable = false - } - b += 1 - - b += 23 // padding - - return v -} - -func (cook DpmsCapableCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsCapable -func (c *Conn) dpmsCapableRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request DpmsGetTimeouts -// size: 4 -type DpmsGetTimeoutsCookie struct { - *cookie -} - -func (c *Conn) DpmsGetTimeouts() DpmsGetTimeoutsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dpmsGetTimeoutsRequest(), cookie) - return DpmsGetTimeoutsCookie{cookie} -} - -func (c *Conn) DpmsGetTimeoutsUnchecked() DpmsGetTimeoutsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dpmsGetTimeoutsRequest(), cookie) - return DpmsGetTimeoutsCookie{cookie} -} - -// Request reply for DpmsGetTimeouts -// size: 32 -type DpmsGetTimeoutsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - StandbyTimeout uint16 - SuspendTimeout uint16 - OffTimeout uint16 - // padding: 18 bytes -} - -// Waits and reads reply data from request DpmsGetTimeouts -func (cook DpmsGetTimeoutsCookie) Reply() (*DpmsGetTimeoutsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dpmsGetTimeoutsReply(buf), nil -} - -// Read reply into structure from buffer for DpmsGetTimeouts -func dpmsGetTimeoutsReply(buf []byte) *DpmsGetTimeoutsReply { - v := new(DpmsGetTimeoutsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.StandbyTimeout = Get16(buf[b:]) - b += 2 - - v.SuspendTimeout = Get16(buf[b:]) - b += 2 - - v.OffTimeout = Get16(buf[b:]) - b += 2 - - b += 18 // padding - - return v -} - -func (cook DpmsGetTimeoutsCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsGetTimeouts -func (c *Conn) dpmsGetTimeoutsRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request DpmsSetTimeouts -// size: 12 -type DpmsSetTimeoutsCookie struct { - *cookie -} - -// Write request to wire for DpmsSetTimeouts -func (c *Conn) DpmsSetTimeouts(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie) - return DpmsSetTimeoutsCookie{cookie} -} - -func (c *Conn) DpmsSetTimeoutsChecked(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie) - return DpmsSetTimeoutsCookie{cookie} -} - -func (cook DpmsSetTimeoutsCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsSetTimeouts -func (c *Conn) dpmsSetTimeoutsRequest(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], StandbyTimeout) - b += 2 - - Put16(buf[b:], SuspendTimeout) - b += 2 - - Put16(buf[b:], OffTimeout) - b += 2 - - return buf -} - -// Request DpmsEnable -// size: 4 -type DpmsEnableCookie struct { - *cookie -} - -// Write request to wire for DpmsEnable -func (c *Conn) DpmsEnable() DpmsEnableCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dpmsEnableRequest(), cookie) - return DpmsEnableCookie{cookie} -} - -func (c *Conn) DpmsEnableChecked() DpmsEnableCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dpmsEnableRequest(), cookie) - return DpmsEnableCookie{cookie} -} - -func (cook DpmsEnableCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsEnable -func (c *Conn) dpmsEnableRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request DpmsDisable -// size: 4 -type DpmsDisableCookie struct { - *cookie -} - -// Write request to wire for DpmsDisable -func (c *Conn) DpmsDisable() DpmsDisableCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dpmsDisableRequest(), cookie) - return DpmsDisableCookie{cookie} -} - -func (c *Conn) DpmsDisableChecked() DpmsDisableCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dpmsDisableRequest(), cookie) - return DpmsDisableCookie{cookie} -} - -func (cook DpmsDisableCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsDisable -func (c *Conn) dpmsDisableRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request DpmsForceLevel -// size: 8 -type DpmsForceLevelCookie struct { - *cookie -} - -// Write request to wire for DpmsForceLevel -func (c *Conn) DpmsForceLevel(PowerLevel uint16) DpmsForceLevelCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie) - return DpmsForceLevelCookie{cookie} -} - -func (c *Conn) DpmsForceLevelChecked(PowerLevel uint16) DpmsForceLevelCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie) - return DpmsForceLevelCookie{cookie} -} - -func (cook DpmsForceLevelCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsForceLevel -func (c *Conn) dpmsForceLevelRequest(PowerLevel uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], PowerLevel) - b += 2 - - return buf -} - -// Request DpmsInfo -// size: 4 -type DpmsInfoCookie struct { - *cookie -} - -func (c *Conn) DpmsInfo() DpmsInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dpmsInfoRequest(), cookie) - return DpmsInfoCookie{cookie} -} - -func (c *Conn) DpmsInfoUnchecked() DpmsInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dpmsInfoRequest(), cookie) - return DpmsInfoCookie{cookie} -} - -// Request reply for DpmsInfo -// size: 32 -type DpmsInfoReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - PowerLevel uint16 - State bool - // padding: 21 bytes -} - -// Waits and reads reply data from request DpmsInfo -func (cook DpmsInfoCookie) Reply() (*DpmsInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dpmsInfoReply(buf), nil -} - -// Read reply into structure from buffer for DpmsInfo -func dpmsInfoReply(buf []byte) *DpmsInfoReply { - v := new(DpmsInfoReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.PowerLevel = Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.State = true - } else { - v.State = false - } - b += 1 - - b += 21 // padding - - return v -} - -func (cook DpmsInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for DpmsInfo -func (c *Conn) dpmsInfoRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DPMS"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} diff --git a/nexgb/auto_dri2.go b/nexgb/auto_dri2.go deleted file mode 100644 index 09baef5..0000000 --- a/nexgb/auto_dri2.go +++ /dev/null @@ -1,1560 +0,0 @@ -package xgb - -/* - This file was generated by dri2.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// Dri2Init must be called before using the DRI2 extension. -func (c *Conn) Dri2Init() error { - reply, err := c.QueryExtension(4, "DRI2").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named DRI2 could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["DRI2"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["DRI2"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["DRI2"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["DRI2"] = make(map[int]newEventFun) - newExtErrorFuncs["DRI2"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -const ( - Dri2AttachmentBufferFrontLeft = 0 - Dri2AttachmentBufferBackLeft = 1 - Dri2AttachmentBufferFrontRight = 2 - Dri2AttachmentBufferBackRight = 3 - Dri2AttachmentBufferDepth = 4 - Dri2AttachmentBufferStencil = 5 - Dri2AttachmentBufferAccum = 6 - Dri2AttachmentBufferFakeFrontLeft = 7 - Dri2AttachmentBufferFakeFrontRight = 8 - Dri2AttachmentBufferDepthStencil = 9 - Dri2AttachmentBufferHiz = 10 -) - -const ( - Dri2DriverTypeDri = 0 - Dri2DriverTypeVdpau = 1 -) - -const ( - Dri2EventTypeExchangeComplete = 1 - Dri2EventTypeBlitComplete = 2 - Dri2EventTypeFlipComplete = 3 -) - -// 'Dri2DRI2Buffer' struct definition -// Size: 20 -type Dri2DRI2Buffer struct { - Attachment uint32 - Name uint32 - Pitch uint32 - Cpp uint32 - Flags uint32 -} - -// Struct read Dri2DRI2Buffer -func ReadDri2DRI2Buffer(buf []byte, v *Dri2DRI2Buffer) int { - b := 0 - - v.Attachment = Get32(buf[b:]) - b += 4 - - v.Name = Get32(buf[b:]) - b += 4 - - v.Pitch = Get32(buf[b:]) - b += 4 - - v.Cpp = Get32(buf[b:]) - b += 4 - - v.Flags = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read Dri2DRI2Buffer -func ReadDri2DRI2BufferList(buf []byte, dest []Dri2DRI2Buffer) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Dri2DRI2Buffer{} - b += ReadDri2DRI2Buffer(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write Dri2DRI2Buffer -func (v Dri2DRI2Buffer) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - Put32(buf[b:], v.Attachment) - b += 4 - - Put32(buf[b:], v.Name) - b += 4 - - Put32(buf[b:], v.Pitch) - b += 4 - - Put32(buf[b:], v.Cpp) - b += 4 - - Put32(buf[b:], v.Flags) - b += 4 - - return buf -} - -// Write struct list Dri2DRI2Buffer -func Dri2DRI2BufferListBytes(buf []byte, list []Dri2DRI2Buffer) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'Dri2AttachFormat' struct definition -// Size: 8 -type Dri2AttachFormat struct { - Attachment uint32 - Format uint32 -} - -// Struct read Dri2AttachFormat -func ReadDri2AttachFormat(buf []byte, v *Dri2AttachFormat) int { - b := 0 - - v.Attachment = Get32(buf[b:]) - b += 4 - - v.Format = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read Dri2AttachFormat -func ReadDri2AttachFormatList(buf []byte, dest []Dri2AttachFormat) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Dri2AttachFormat{} - b += ReadDri2AttachFormat(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write Dri2AttachFormat -func (v Dri2AttachFormat) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], v.Attachment) - b += 4 - - Put32(buf[b:], v.Format) - b += 4 - - return buf -} - -// Write struct list Dri2AttachFormat -func Dri2AttachFormatListBytes(buf []byte, list []Dri2AttachFormat) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Event definition Dri2BufferSwapComplete (0) -// Size: 32 - -const Dri2BufferSwapComplete = 0 - -type Dri2BufferSwapCompleteEvent struct { - Sequence uint16 - // padding: 1 bytes - EventType uint16 - // padding: 2 bytes - Drawable Drawable - UstHi uint32 - UstLo uint32 - MscHi uint32 - MscLo uint32 - Sbc uint32 -} - -// Event read Dri2BufferSwapComplete -func NewDri2BufferSwapCompleteEvent(buf []byte) Event { - v := Dri2BufferSwapCompleteEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.EventType = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Drawable = Drawable(Get32(buf[b:])) - b += 4 - - v.UstHi = Get32(buf[b:]) - b += 4 - - v.UstLo = Get32(buf[b:]) - b += 4 - - v.MscHi = Get32(buf[b:]) - b += 4 - - v.MscLo = Get32(buf[b:]) - b += 4 - - v.Sbc = Get32(buf[b:]) - b += 4 - - return v -} - -// Event write Dri2BufferSwapComplete -func (v Dri2BufferSwapCompleteEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put16(buf[b:], v.EventType) - b += 2 - - b += 2 // padding - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - Put32(buf[b:], v.UstHi) - b += 4 - - Put32(buf[b:], v.UstLo) - b += 4 - - Put32(buf[b:], v.MscHi) - b += 4 - - Put32(buf[b:], v.MscLo) - b += 4 - - Put32(buf[b:], v.Sbc) - b += 4 - - return buf -} - -func (v Dri2BufferSwapCompleteEvent) ImplementsEvent() {} - -func (v Dri2BufferSwapCompleteEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v Dri2BufferSwapCompleteEvent) String() string { - fieldVals := make([]string, 0, 9) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("EventType: %d", v.EventType)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("UstHi: %d", v.UstHi)) - fieldVals = append(fieldVals, sprintf("UstLo: %d", v.UstLo)) - fieldVals = append(fieldVals, sprintf("MscHi: %d", v.MscHi)) - fieldVals = append(fieldVals, sprintf("MscLo: %d", v.MscLo)) - fieldVals = append(fieldVals, sprintf("Sbc: %d", v.Sbc)) - return "Dri2BufferSwapComplete {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["DRI2"][0] = NewDri2BufferSwapCompleteEvent -} - -// Event definition Dri2InvalidateBuffers (1) -// Size: 32 - -const Dri2InvalidateBuffers = 1 - -type Dri2InvalidateBuffersEvent struct { - Sequence uint16 - // padding: 1 bytes - Drawable Drawable -} - -// Event read Dri2InvalidateBuffers -func NewDri2InvalidateBuffersEvent(buf []byte) Event { - v := Dri2InvalidateBuffersEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Drawable = Drawable(Get32(buf[b:])) - b += 4 - - return v -} - -// Event write Dri2InvalidateBuffers -func (v Dri2InvalidateBuffersEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - return buf -} - -func (v Dri2InvalidateBuffersEvent) ImplementsEvent() {} - -func (v Dri2InvalidateBuffersEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v Dri2InvalidateBuffersEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - return "Dri2InvalidateBuffers {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["DRI2"][1] = NewDri2InvalidateBuffersEvent -} - -// Request Dri2QueryVersion -// size: 12 -type Dri2QueryVersionCookie struct { - *cookie -} - -func (c *Conn) Dri2QueryVersion(MajorVersion uint32, MinorVersion uint32) Dri2QueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2QueryVersionRequest(MajorVersion, MinorVersion), cookie) - return Dri2QueryVersionCookie{cookie} -} - -func (c *Conn) Dri2QueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) Dri2QueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2QueryVersionRequest(MajorVersion, MinorVersion), cookie) - return Dri2QueryVersionCookie{cookie} -} - -// Request reply for Dri2QueryVersion -// size: 16 -type Dri2QueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 -} - -// Waits and reads reply data from request Dri2QueryVersion -func (cook Dri2QueryVersionCookie) Reply() (*Dri2QueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2QueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for Dri2QueryVersion -func dri2QueryVersionReply(buf []byte) *Dri2QueryVersionReply { - v := new(Dri2QueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2QueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2QueryVersion -func (c *Conn) dri2QueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - return buf -} - -// Request Dri2Connect -// size: 12 -type Dri2ConnectCookie struct { - *cookie -} - -func (c *Conn) Dri2Connect(Window Window, DriverType uint32) Dri2ConnectCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) - return Dri2ConnectCookie{cookie} -} - -func (c *Conn) Dri2ConnectUnchecked(Window Window, DriverType uint32) Dri2ConnectCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2ConnectRequest(Window, DriverType), cookie) - return Dri2ConnectCookie{cookie} -} - -// Request reply for Dri2Connect -// size: (((32 + pad((int(DriverNameLength) * 1))) + pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + pad((int(DeviceNameLength) * 1))) -type Dri2ConnectReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - DriverNameLength uint32 - DeviceNameLength uint32 - // padding: 16 bytes - DriverName string // size: pad((int(DriverNameLength) * 1)) - AlignmentPad []byte // size: pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1)) - DeviceName string // size: pad((int(DeviceNameLength) * 1)) -} - -// Waits and reads reply data from request Dri2Connect -func (cook Dri2ConnectCookie) Reply() (*Dri2ConnectReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2ConnectReply(buf), nil -} - -// Read reply into structure from buffer for Dri2Connect -func dri2ConnectReply(buf []byte) *Dri2ConnectReply { - v := new(Dri2ConnectReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.DriverNameLength = Get32(buf[b:]) - b += 4 - - v.DeviceNameLength = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - { - byteString := make([]byte, v.DriverNameLength) - copy(byteString[:v.DriverNameLength], buf[b:]) - v.DriverName = string(byteString) - b += pad(int(v.DriverNameLength)) - } - - v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) - copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:]) - b += pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))) - - { - byteString := make([]byte, v.DeviceNameLength) - copy(byteString[:v.DeviceNameLength], buf[b:]) - v.DeviceName = string(byteString) - b += pad(int(v.DeviceNameLength)) - } - - return v -} - -func (cook Dri2ConnectCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2Connect -func (c *Conn) dri2ConnectRequest(Window Window, DriverType uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], DriverType) - b += 4 - - return buf -} - -// Request Dri2Authenticate -// size: 12 -type Dri2AuthenticateCookie struct { - *cookie -} - -func (c *Conn) Dri2Authenticate(Window Window, Magic uint32) Dri2AuthenticateCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) - return Dri2AuthenticateCookie{cookie} -} - -func (c *Conn) Dri2AuthenticateUnchecked(Window Window, Magic uint32) Dri2AuthenticateCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2AuthenticateRequest(Window, Magic), cookie) - return Dri2AuthenticateCookie{cookie} -} - -// Request reply for Dri2Authenticate -// size: 12 -type Dri2AuthenticateReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Authenticated uint32 -} - -// Waits and reads reply data from request Dri2Authenticate -func (cook Dri2AuthenticateCookie) Reply() (*Dri2AuthenticateReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2AuthenticateReply(buf), nil -} - -// Read reply into structure from buffer for Dri2Authenticate -func dri2AuthenticateReply(buf []byte) *Dri2AuthenticateReply { - v := new(Dri2AuthenticateReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Authenticated = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2AuthenticateCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2Authenticate -func (c *Conn) dri2AuthenticateRequest(Window Window, Magic uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], Magic) - b += 4 - - return buf -} - -// Request Dri2CreateDrawable -// size: 8 -type Dri2CreateDrawableCookie struct { - *cookie -} - -// Write request to wire for Dri2CreateDrawable -func (c *Conn) Dri2CreateDrawable(Drawable Drawable) Dri2CreateDrawableCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) - return Dri2CreateDrawableCookie{cookie} -} - -func (c *Conn) Dri2CreateDrawableChecked(Drawable Drawable) Dri2CreateDrawableCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dri2CreateDrawableRequest(Drawable), cookie) - return Dri2CreateDrawableCookie{cookie} -} - -func (cook Dri2CreateDrawableCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2CreateDrawable -func (c *Conn) dri2CreateDrawableRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request Dri2DestroyDrawable -// size: 8 -type Dri2DestroyDrawableCookie struct { - *cookie -} - -// Write request to wire for Dri2DestroyDrawable -func (c *Conn) Dri2DestroyDrawable(Drawable Drawable) Dri2DestroyDrawableCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) - return Dri2DestroyDrawableCookie{cookie} -} - -func (c *Conn) Dri2DestroyDrawableChecked(Drawable Drawable) Dri2DestroyDrawableCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dri2DestroyDrawableRequest(Drawable), cookie) - return Dri2DestroyDrawableCookie{cookie} -} - -func (cook Dri2DestroyDrawableCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2DestroyDrawable -func (c *Conn) dri2DestroyDrawableRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request Dri2GetBuffers -// size: pad((12 + pad((len(Attachments) * 4)))) -type Dri2GetBuffersCookie struct { - *cookie -} - -func (c *Conn) Dri2GetBuffers(Drawable Drawable, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) - return Dri2GetBuffersCookie{cookie} -} - -func (c *Conn) Dri2GetBuffersUnchecked(Drawable Drawable, Count uint32, Attachments []uint32) Dri2GetBuffersCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2GetBuffersRequest(Drawable, Count, Attachments), cookie) - return Dri2GetBuffersCookie{cookie} -} - -// Request reply for Dri2GetBuffers -// size: (32 + pad((int(Count) * 20))) -type Dri2GetBuffersReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Width uint32 - Height uint32 - Count uint32 - // padding: 12 bytes - Buffers []Dri2DRI2Buffer // size: pad((int(Count) * 20)) -} - -// Waits and reads reply data from request Dri2GetBuffers -func (cook Dri2GetBuffersCookie) Reply() (*Dri2GetBuffersReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2GetBuffersReply(buf), nil -} - -// Read reply into structure from buffer for Dri2GetBuffers -func dri2GetBuffersReply(buf []byte) *Dri2GetBuffersReply { - v := new(Dri2GetBuffersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = Get32(buf[b:]) - b += 4 - - v.Height = Get32(buf[b:]) - b += 4 - - v.Count = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Buffers = make([]Dri2DRI2Buffer, v.Count) - b += ReadDri2DRI2BufferList(buf[b:], v.Buffers) - - return v -} - -func (cook Dri2GetBuffersCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2GetBuffers -func (c *Conn) dri2GetBuffersRequest(Drawable Drawable, Count uint32, Attachments []uint32) []byte { - size := pad((12 + pad((len(Attachments) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], Count) - b += 4 - - for i := 0; i < int(len(Attachments)); i++ { - Put32(buf[b:], Attachments[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request Dri2CopyRegion -// size: 20 -type Dri2CopyRegionCookie struct { - *cookie -} - -func (c *Conn) Dri2CopyRegion(Drawable Drawable, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) - return Dri2CopyRegionCookie{cookie} -} - -func (c *Conn) Dri2CopyRegionUnchecked(Drawable Drawable, Region uint32, Dest uint32, Src uint32) Dri2CopyRegionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2CopyRegionRequest(Drawable, Region, Dest, Src), cookie) - return Dri2CopyRegionCookie{cookie} -} - -// Request reply for Dri2CopyRegion -// size: 8 -type Dri2CopyRegionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes -} - -// Waits and reads reply data from request Dri2CopyRegion -func (cook Dri2CopyRegionCookie) Reply() (*Dri2CopyRegionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2CopyRegionReply(buf), nil -} - -// Read reply into structure from buffer for Dri2CopyRegion -func dri2CopyRegionReply(buf []byte) *Dri2CopyRegionReply { - v := new(Dri2CopyRegionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -func (cook Dri2CopyRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2CopyRegion -func (c *Conn) dri2CopyRegionRequest(Drawable Drawable, Region uint32, Dest uint32, Src uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], Region) - b += 4 - - Put32(buf[b:], Dest) - b += 4 - - Put32(buf[b:], Src) - b += 4 - - return buf -} - -// Request Dri2GetBuffersWithFormat -// size: pad((12 + pad((len(Attachments) * 8)))) -type Dri2GetBuffersWithFormatCookie struct { - *cookie -} - -func (c *Conn) Dri2GetBuffersWithFormat(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) - return Dri2GetBuffersWithFormatCookie{cookie} -} - -func (c *Conn) Dri2GetBuffersWithFormatUnchecked(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) Dri2GetBuffersWithFormatCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2GetBuffersWithFormatRequest(Drawable, Count, Attachments), cookie) - return Dri2GetBuffersWithFormatCookie{cookie} -} - -// Request reply for Dri2GetBuffersWithFormat -// size: (32 + pad((int(Count) * 20))) -type Dri2GetBuffersWithFormatReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Width uint32 - Height uint32 - Count uint32 - // padding: 12 bytes - Buffers []Dri2DRI2Buffer // size: pad((int(Count) * 20)) -} - -// Waits and reads reply data from request Dri2GetBuffersWithFormat -func (cook Dri2GetBuffersWithFormatCookie) Reply() (*Dri2GetBuffersWithFormatReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2GetBuffersWithFormatReply(buf), nil -} - -// Read reply into structure from buffer for Dri2GetBuffersWithFormat -func dri2GetBuffersWithFormatReply(buf []byte) *Dri2GetBuffersWithFormatReply { - v := new(Dri2GetBuffersWithFormatReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = Get32(buf[b:]) - b += 4 - - v.Height = Get32(buf[b:]) - b += 4 - - v.Count = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Buffers = make([]Dri2DRI2Buffer, v.Count) - b += ReadDri2DRI2BufferList(buf[b:], v.Buffers) - - return v -} - -func (cook Dri2GetBuffersWithFormatCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2GetBuffersWithFormat -func (c *Conn) dri2GetBuffersWithFormatRequest(Drawable Drawable, Count uint32, Attachments []Dri2AttachFormat) []byte { - size := pad((12 + pad((len(Attachments) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], Count) - b += 4 - - b += Dri2AttachFormatListBytes(buf[b:], Attachments) - - return buf -} - -// Request Dri2SwapBuffers -// size: 32 -type Dri2SwapBuffersCookie struct { - *cookie -} - -func (c *Conn) Dri2SwapBuffers(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) - return Dri2SwapBuffersCookie{cookie} -} - -func (c *Conn) Dri2SwapBuffersUnchecked(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2SwapBuffersCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2SwapBuffersRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) - return Dri2SwapBuffersCookie{cookie} -} - -// Request reply for Dri2SwapBuffers -// size: 16 -type Dri2SwapBuffersReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - SwapHi uint32 - SwapLo uint32 -} - -// Waits and reads reply data from request Dri2SwapBuffers -func (cook Dri2SwapBuffersCookie) Reply() (*Dri2SwapBuffersReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2SwapBuffersReply(buf), nil -} - -// Read reply into structure from buffer for Dri2SwapBuffers -func dri2SwapBuffersReply(buf []byte) *Dri2SwapBuffersReply { - v := new(Dri2SwapBuffersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.SwapHi = Get32(buf[b:]) - b += 4 - - v.SwapLo = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2SwapBuffersCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2SwapBuffers -func (c *Conn) dri2SwapBuffersRequest(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], TargetMscHi) - b += 4 - - Put32(buf[b:], TargetMscLo) - b += 4 - - Put32(buf[b:], DivisorHi) - b += 4 - - Put32(buf[b:], DivisorLo) - b += 4 - - Put32(buf[b:], RemainderHi) - b += 4 - - Put32(buf[b:], RemainderLo) - b += 4 - - return buf -} - -// Request Dri2GetMSC -// size: 8 -type Dri2GetMSCCookie struct { - *cookie -} - -func (c *Conn) Dri2GetMSC(Drawable Drawable) Dri2GetMSCCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) - return Dri2GetMSCCookie{cookie} -} - -func (c *Conn) Dri2GetMSCUnchecked(Drawable Drawable) Dri2GetMSCCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2GetMSCRequest(Drawable), cookie) - return Dri2GetMSCCookie{cookie} -} - -// Request reply for Dri2GetMSC -// size: 32 -type Dri2GetMSCReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - UstHi uint32 - UstLo uint32 - MscHi uint32 - MscLo uint32 - SbcHi uint32 - SbcLo uint32 -} - -// Waits and reads reply data from request Dri2GetMSC -func (cook Dri2GetMSCCookie) Reply() (*Dri2GetMSCReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2GetMSCReply(buf), nil -} - -// Read reply into structure from buffer for Dri2GetMSC -func dri2GetMSCReply(buf []byte) *Dri2GetMSCReply { - v := new(Dri2GetMSCReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.UstHi = Get32(buf[b:]) - b += 4 - - v.UstLo = Get32(buf[b:]) - b += 4 - - v.MscHi = Get32(buf[b:]) - b += 4 - - v.MscLo = Get32(buf[b:]) - b += 4 - - v.SbcHi = Get32(buf[b:]) - b += 4 - - v.SbcLo = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2GetMSCCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2GetMSC -func (c *Conn) dri2GetMSCRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request Dri2WaitMSC -// size: 32 -type Dri2WaitMSCCookie struct { - *cookie -} - -func (c *Conn) Dri2WaitMSC(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) - return Dri2WaitMSCCookie{cookie} -} - -func (c *Conn) Dri2WaitMSCUnchecked(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) Dri2WaitMSCCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2WaitMSCRequest(Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) - return Dri2WaitMSCCookie{cookie} -} - -// Request reply for Dri2WaitMSC -// size: 32 -type Dri2WaitMSCReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - UstHi uint32 - UstLo uint32 - MscHi uint32 - MscLo uint32 - SbcHi uint32 - SbcLo uint32 -} - -// Waits and reads reply data from request Dri2WaitMSC -func (cook Dri2WaitMSCCookie) Reply() (*Dri2WaitMSCReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2WaitMSCReply(buf), nil -} - -// Read reply into structure from buffer for Dri2WaitMSC -func dri2WaitMSCReply(buf []byte) *Dri2WaitMSCReply { - v := new(Dri2WaitMSCReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.UstHi = Get32(buf[b:]) - b += 4 - - v.UstLo = Get32(buf[b:]) - b += 4 - - v.MscHi = Get32(buf[b:]) - b += 4 - - v.MscLo = Get32(buf[b:]) - b += 4 - - v.SbcHi = Get32(buf[b:]) - b += 4 - - v.SbcLo = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2WaitMSCCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2WaitMSC -func (c *Conn) dri2WaitMSCRequest(Drawable Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], TargetMscHi) - b += 4 - - Put32(buf[b:], TargetMscLo) - b += 4 - - Put32(buf[b:], DivisorHi) - b += 4 - - Put32(buf[b:], DivisorLo) - b += 4 - - Put32(buf[b:], RemainderHi) - b += 4 - - Put32(buf[b:], RemainderLo) - b += 4 - - return buf -} - -// Request Dri2WaitSBC -// size: 16 -type Dri2WaitSBCCookie struct { - *cookie -} - -func (c *Conn) Dri2WaitSBC(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) - return Dri2WaitSBCCookie{cookie} -} - -func (c *Conn) Dri2WaitSBCUnchecked(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) Dri2WaitSBCCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.dri2WaitSBCRequest(Drawable, TargetSbcHi, TargetSbcLo), cookie) - return Dri2WaitSBCCookie{cookie} -} - -// Request reply for Dri2WaitSBC -// size: 32 -type Dri2WaitSBCReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - UstHi uint32 - UstLo uint32 - MscHi uint32 - MscLo uint32 - SbcHi uint32 - SbcLo uint32 -} - -// Waits and reads reply data from request Dri2WaitSBC -func (cook Dri2WaitSBCCookie) Reply() (*Dri2WaitSBCReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return dri2WaitSBCReply(buf), nil -} - -// Read reply into structure from buffer for Dri2WaitSBC -func dri2WaitSBCReply(buf []byte) *Dri2WaitSBCReply { - v := new(Dri2WaitSBCReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.UstHi = Get32(buf[b:]) - b += 4 - - v.UstLo = Get32(buf[b:]) - b += 4 - - v.MscHi = Get32(buf[b:]) - b += 4 - - v.MscLo = Get32(buf[b:]) - b += 4 - - v.SbcHi = Get32(buf[b:]) - b += 4 - - v.SbcLo = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Dri2WaitSBCCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2WaitSBC -func (c *Conn) dri2WaitSBCRequest(Drawable Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], TargetSbcHi) - b += 4 - - Put32(buf[b:], TargetSbcLo) - b += 4 - - return buf -} - -// Request Dri2SwapInterval -// size: 12 -type Dri2SwapIntervalCookie struct { - *cookie -} - -// Write request to wire for Dri2SwapInterval -func (c *Conn) Dri2SwapInterval(Drawable Drawable, Interval uint32) Dri2SwapIntervalCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) - return Dri2SwapIntervalCookie{cookie} -} - -func (c *Conn) Dri2SwapIntervalChecked(Drawable Drawable, Interval uint32) Dri2SwapIntervalCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.dri2SwapIntervalRequest(Drawable, Interval), cookie) - return Dri2SwapIntervalCookie{cookie} -} - -func (cook Dri2SwapIntervalCookie) Check() error { - return cook.check() -} - -// Write request to wire for Dri2SwapInterval -func (c *Conn) dri2SwapIntervalRequest(Drawable Drawable, Interval uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["DRI2"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], Interval) - b += 4 - - return buf -} diff --git a/nexgb/auto_ge.go b/nexgb/auto_ge.go deleted file mode 100644 index 3d1b00c..0000000 --- a/nexgb/auto_ge.go +++ /dev/null @@ -1,151 +0,0 @@ -package xgb - -/* - This file was generated by ge.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// GeInit must be called before using the Generic Event Extension extension. -func (c *Conn) GeInit() error { - reply, err := c.QueryExtension(23, "Generic Event Extension").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named Generic Event Extension could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["Generic Event Extension"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["Generic Event Extension"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["Generic Event Extension"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["Generic Event Extension"] = make(map[int]newEventFun) - newExtErrorFuncs["Generic Event Extension"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Request GeQueryVersion -// size: 8 -type GeQueryVersionCookie struct { - *cookie -} - -func (c *Conn) GeQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return GeQueryVersionCookie{cookie} -} - -func (c *Conn) GeQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return GeQueryVersionCookie{cookie} -} - -// Request reply for GeQueryVersion -// size: 32 -type GeQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 - // padding: 20 bytes -} - -// Waits and reads reply data from request GeQueryVersion -func (cook GeQueryVersionCookie) Reply() (*GeQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return geQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for GeQueryVersion -func geQueryVersionReply(buf []byte) *GeQueryVersionReply { - v := new(GeQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -func (cook GeQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for GeQueryVersion -func (c *Conn) geQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GENERIC EVENT EXTENSION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], ClientMajorVersion) - b += 2 - - Put16(buf[b:], ClientMinorVersion) - b += 2 - - return buf -} diff --git a/nexgb/auto_glx.go b/nexgb/auto_glx.go deleted file mode 100644 index 0fe0f61..0000000 --- a/nexgb/auto_glx.go +++ /dev/null @@ -1,9430 +0,0 @@ -package xgb - -/* - This file was generated by glx.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// GlxInit must be called before using the GLX extension. -func (c *Conn) GlxInit() error { - reply, err := c.QueryExtension(3, "GLX").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named GLX could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["GLX"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["GLX"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["GLX"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["GLX"] = make(map[int]newEventFun) - newExtErrorFuncs["GLX"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -const ( - GlxPbcetDamaged = 32791 - GlxPbcetSaved = 32792 -) - -const ( - GlxPbcdtWindow = 32793 - GlxPbcdtPbuffer = 32794 -) - -const ( - GlxGcGlCurrentBit = 1 - GlxGcGlPointBit = 2 - GlxGcGlLineBit = 4 - GlxGcGlPolygonBit = 8 - GlxGcGlPolygonStippleBit = 16 - GlxGcGlPixelModeBit = 32 - GlxGcGlLightingBit = 64 - GlxGcGlFogBit = 128 - GlxGcGlDepthBufferBit = 256 - GlxGcGlAccumBufferBit = 512 - GlxGcGlStencilBufferBit = 1024 - GlxGcGlViewportBit = 2048 - GlxGcGlTransformBit = 4096 - GlxGcGlEnableBit = 8192 - GlxGcGlColorBufferBit = 16384 - GlxGcGlHintBit = 32768 - GlxGcGlEvalBit = 65536 - GlxGcGlListBit = 131072 - GlxGcGlTextureBit = 262144 - GlxGcGlScissorBit = 524288 - GlxGcGlAllAttribBits = 16777215 -) - -const ( - GlxRmGlRender = 7168 - GlxRmGlFeedback = 7169 - GlxRmGlSelect = 7170 -) - -type GlxPixmap uint32 - -func (c *Conn) NewGlxPixmapId() (GlxPixmap, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxPixmap(id), nil -} - -type GlxContext uint32 - -func (c *Conn) NewGlxContextId() (GlxContext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxContext(id), nil -} - -type GlxPbuffer uint32 - -func (c *Conn) NewGlxPbufferId() (GlxPbuffer, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxPbuffer(id), nil -} - -type GlxWindow uint32 - -func (c *Conn) NewGlxWindowId() (GlxWindow, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxWindow(id), nil -} - -type GlxFbconfig uint32 - -func (c *Conn) NewGlxFbconfigId() (GlxFbconfig, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxFbconfig(id), nil -} - -type GlxDrawable uint32 - -func (c *Conn) NewGlxDrawableId() (GlxDrawable, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return GlxDrawable(id), nil -} - -type GlxFloat32 float64 - -type GlxFloat64 float64 - -type GlxBool32 uint32 - -type GlxContextTag uint32 - -// Event definition GlxPbufferClobber (0) -// Size: 32 - -const GlxPbufferClobber = 0 - -type GlxPbufferClobberEvent struct { - Sequence uint16 - // padding: 1 bytes - EventType uint16 - DrawType uint16 - Drawable GlxDrawable - BMask uint32 - AuxBuffer uint16 - X uint16 - Y uint16 - Width uint16 - Height uint16 - Count uint16 - // padding: 4 bytes -} - -// Event read GlxPbufferClobber -func NewGlxPbufferClobberEvent(buf []byte) Event { - v := GlxPbufferClobberEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.EventType = Get16(buf[b:]) - b += 2 - - v.DrawType = Get16(buf[b:]) - b += 2 - - v.Drawable = GlxDrawable(Get32(buf[b:])) - b += 4 - - v.BMask = Get32(buf[b:]) - b += 4 - - v.AuxBuffer = Get16(buf[b:]) - b += 2 - - v.X = Get16(buf[b:]) - b += 2 - - v.Y = Get16(buf[b:]) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Count = Get16(buf[b:]) - b += 2 - - b += 4 // padding - - return v -} - -// Event write GlxPbufferClobber -func (v GlxPbufferClobberEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put16(buf[b:], v.EventType) - b += 2 - - Put16(buf[b:], v.DrawType) - b += 2 - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - Put32(buf[b:], v.BMask) - b += 4 - - Put16(buf[b:], v.AuxBuffer) - b += 2 - - Put16(buf[b:], v.X) - b += 2 - - Put16(buf[b:], v.Y) - b += 2 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put16(buf[b:], v.Count) - b += 2 - - b += 4 // padding - - return buf -} - -func (v GlxPbufferClobberEvent) ImplementsEvent() {} - -func (v GlxPbufferClobberEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v GlxPbufferClobberEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("EventType: %d", v.EventType)) - fieldVals = append(fieldVals, sprintf("DrawType: %d", v.DrawType)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("BMask: %d", v.BMask)) - fieldVals = append(fieldVals, sprintf("AuxBuffer: %d", v.AuxBuffer)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - return "GlxPbufferClobber {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["GLX"][0] = NewGlxPbufferClobberEvent -} - -// Error definition GlxGeneric (-1) -// Size: 32 - -const BadGlxGeneric = -1 - -type GlxGenericError struct { - Sequence uint16 - NiceName string - BadValue uint32 - MinorOpcode uint16 - MajorOpcode byte - // padding: 21 bytes -} - -// Error read GlxGeneric -func NewGlxGenericError(buf []byte) Error { - v := GlxGenericError{} - v.NiceName = "GlxGeneric" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.BadValue = Get32(buf[b:]) - b += 4 - - v.MinorOpcode = Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - b += 21 // padding - - return v -} - -func (err GlxGenericError) ImplementsError() {} - -func (err GlxGenericError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxGenericError) BadId() uint32 { - return 0 -} - -func (err GlxGenericError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxGeneric {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][-1] = NewGlxGenericError -} - -// ErrorCopy definition GlxBadContext (0) - -const BadGlxBadContext = 0 - -type GlxBadContextError GlxGenericError - -func NewGlxBadContextError(buf []byte) Error { - v := GlxBadContextError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadContext" - return v -} - -func (err GlxBadContextError) ImplementsError() {} - -func (err GlxBadContextError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadContextError) BadId() uint32 { - return 0 -} - -func (err GlxBadContextError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadContext {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][0] = NewGlxBadContextError -} - -// ErrorCopy definition GlxBadContextState (1) - -const BadGlxBadContextState = 1 - -type GlxBadContextStateError GlxGenericError - -func NewGlxBadContextStateError(buf []byte) Error { - v := GlxBadContextStateError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadContextState" - return v -} - -func (err GlxBadContextStateError) ImplementsError() {} - -func (err GlxBadContextStateError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadContextStateError) BadId() uint32 { - return 0 -} - -func (err GlxBadContextStateError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadContextState {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][1] = NewGlxBadContextStateError -} - -// ErrorCopy definition GlxBadDrawable (2) - -const BadGlxBadDrawable = 2 - -type GlxBadDrawableError GlxGenericError - -func NewGlxBadDrawableError(buf []byte) Error { - v := GlxBadDrawableError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadDrawable" - return v -} - -func (err GlxBadDrawableError) ImplementsError() {} - -func (err GlxBadDrawableError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadDrawableError) BadId() uint32 { - return 0 -} - -func (err GlxBadDrawableError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadDrawable {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][2] = NewGlxBadDrawableError -} - -// ErrorCopy definition GlxBadPixmap (3) - -const BadGlxBadPixmap = 3 - -type GlxBadPixmapError GlxGenericError - -func NewGlxBadPixmapError(buf []byte) Error { - v := GlxBadPixmapError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadPixmap" - return v -} - -func (err GlxBadPixmapError) ImplementsError() {} - -func (err GlxBadPixmapError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadPixmapError) BadId() uint32 { - return 0 -} - -func (err GlxBadPixmapError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadPixmap {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][3] = NewGlxBadPixmapError -} - -// ErrorCopy definition GlxBadContextTag (4) - -const BadGlxBadContextTag = 4 - -type GlxBadContextTagError GlxGenericError - -func NewGlxBadContextTagError(buf []byte) Error { - v := GlxBadContextTagError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadContextTag" - return v -} - -func (err GlxBadContextTagError) ImplementsError() {} - -func (err GlxBadContextTagError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadContextTagError) BadId() uint32 { - return 0 -} - -func (err GlxBadContextTagError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadContextTag {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][4] = NewGlxBadContextTagError -} - -// ErrorCopy definition GlxBadCurrentWindow (5) - -const BadGlxBadCurrentWindow = 5 - -type GlxBadCurrentWindowError GlxGenericError - -func NewGlxBadCurrentWindowError(buf []byte) Error { - v := GlxBadCurrentWindowError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadCurrentWindow" - return v -} - -func (err GlxBadCurrentWindowError) ImplementsError() {} - -func (err GlxBadCurrentWindowError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadCurrentWindowError) BadId() uint32 { - return 0 -} - -func (err GlxBadCurrentWindowError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadCurrentWindow {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][5] = NewGlxBadCurrentWindowError -} - -// ErrorCopy definition GlxBadRenderRequest (6) - -const BadGlxBadRenderRequest = 6 - -type GlxBadRenderRequestError GlxGenericError - -func NewGlxBadRenderRequestError(buf []byte) Error { - v := GlxBadRenderRequestError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadRenderRequest" - return v -} - -func (err GlxBadRenderRequestError) ImplementsError() {} - -func (err GlxBadRenderRequestError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadRenderRequestError) BadId() uint32 { - return 0 -} - -func (err GlxBadRenderRequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadRenderRequest {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][6] = NewGlxBadRenderRequestError -} - -// ErrorCopy definition GlxBadLargeRequest (7) - -const BadGlxBadLargeRequest = 7 - -type GlxBadLargeRequestError GlxGenericError - -func NewGlxBadLargeRequestError(buf []byte) Error { - v := GlxBadLargeRequestError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadLargeRequest" - return v -} - -func (err GlxBadLargeRequestError) ImplementsError() {} - -func (err GlxBadLargeRequestError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadLargeRequestError) BadId() uint32 { - return 0 -} - -func (err GlxBadLargeRequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadLargeRequest {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][7] = NewGlxBadLargeRequestError -} - -// ErrorCopy definition GlxUnsupportedPrivateRequest (8) - -const BadGlxUnsupportedPrivateRequest = 8 - -type GlxUnsupportedPrivateRequestError GlxGenericError - -func NewGlxUnsupportedPrivateRequestError(buf []byte) Error { - v := GlxUnsupportedPrivateRequestError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxUnsupportedPrivateRequest" - return v -} - -func (err GlxUnsupportedPrivateRequestError) ImplementsError() {} - -func (err GlxUnsupportedPrivateRequestError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxUnsupportedPrivateRequestError) BadId() uint32 { - return 0 -} - -func (err GlxUnsupportedPrivateRequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxUnsupportedPrivateRequest {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][8] = NewGlxUnsupportedPrivateRequestError -} - -// ErrorCopy definition GlxBadFBConfig (9) - -const BadGlxBadFBConfig = 9 - -type GlxBadFBConfigError GlxGenericError - -func NewGlxBadFBConfigError(buf []byte) Error { - v := GlxBadFBConfigError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadFBConfig" - return v -} - -func (err GlxBadFBConfigError) ImplementsError() {} - -func (err GlxBadFBConfigError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadFBConfigError) BadId() uint32 { - return 0 -} - -func (err GlxBadFBConfigError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadFBConfig {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][9] = NewGlxBadFBConfigError -} - -// ErrorCopy definition GlxBadPbuffer (10) - -const BadGlxBadPbuffer = 10 - -type GlxBadPbufferError GlxGenericError - -func NewGlxBadPbufferError(buf []byte) Error { - v := GlxBadPbufferError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadPbuffer" - return v -} - -func (err GlxBadPbufferError) ImplementsError() {} - -func (err GlxBadPbufferError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadPbufferError) BadId() uint32 { - return 0 -} - -func (err GlxBadPbufferError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadPbuffer {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][10] = NewGlxBadPbufferError -} - -// ErrorCopy definition GlxBadCurrentDrawable (11) - -const BadGlxBadCurrentDrawable = 11 - -type GlxBadCurrentDrawableError GlxGenericError - -func NewGlxBadCurrentDrawableError(buf []byte) Error { - v := GlxBadCurrentDrawableError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadCurrentDrawable" - return v -} - -func (err GlxBadCurrentDrawableError) ImplementsError() {} - -func (err GlxBadCurrentDrawableError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadCurrentDrawableError) BadId() uint32 { - return 0 -} - -func (err GlxBadCurrentDrawableError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadCurrentDrawable {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][11] = NewGlxBadCurrentDrawableError -} - -// ErrorCopy definition GlxBadWindow (12) - -const BadGlxBadWindow = 12 - -type GlxBadWindowError GlxGenericError - -func NewGlxBadWindowError(buf []byte) Error { - v := GlxBadWindowError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxBadWindow" - return v -} - -func (err GlxBadWindowError) ImplementsError() {} - -func (err GlxBadWindowError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxBadWindowError) BadId() uint32 { - return 0 -} - -func (err GlxBadWindowError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxBadWindow {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][12] = NewGlxBadWindowError -} - -// ErrorCopy definition GlxGLXBadProfileARB (13) - -const BadGlxGLXBadProfileARB = 13 - -type GlxGLXBadProfileARBError GlxGenericError - -func NewGlxGLXBadProfileARBError(buf []byte) Error { - v := GlxGLXBadProfileARBError(NewGlxGenericError(buf).(GlxGenericError)) - v.NiceName = "GlxGLXBadProfileARB" - return v -} - -func (err GlxGLXBadProfileARBError) ImplementsError() {} - -func (err GlxGLXBadProfileARBError) SequenceId() uint16 { - return err.Sequence -} - -func (err GlxGLXBadProfileARBError) BadId() uint32 { - return 0 -} - -func (err GlxGLXBadProfileARBError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGlxGLXBadProfileARB {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["GLX"][13] = NewGlxGLXBadProfileARBError -} - -// Request GlxRender -// size: pad((8 + pad((len(Data) * 1)))) -type GlxRenderCookie struct { - *cookie -} - -// Write request to wire for GlxRender -func (c *Conn) GlxRender(ContextTag GlxContextTag, Data []byte) GlxRenderCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxRenderRequest(ContextTag, Data), cookie) - return GlxRenderCookie{cookie} -} - -func (c *Conn) GlxRenderChecked(ContextTag GlxContextTag, Data []byte) GlxRenderCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxRenderRequest(ContextTag, Data), cookie) - return GlxRenderCookie{cookie} -} - -func (cook GlxRenderCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxRender -func (c *Conn) glxRenderRequest(ContextTag GlxContextTag, Data []byte) []byte { - size := pad((8 + pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) - - return buf -} - -// Request GlxRenderLarge -// size: pad((16 + pad((int(DataLen) * 1)))) -type GlxRenderLargeCookie struct { - *cookie -} - -// Write request to wire for GlxRenderLarge -func (c *Conn) GlxRenderLarge(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) GlxRenderLargeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxRenderLargeRequest(ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) - return GlxRenderLargeCookie{cookie} -} - -func (c *Conn) GlxRenderLargeChecked(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) GlxRenderLargeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxRenderLargeRequest(ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) - return GlxRenderLargeCookie{cookie} -} - -func (cook GlxRenderLargeCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxRenderLarge -func (c *Conn) glxRenderLargeRequest(ContextTag GlxContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { - size := pad((16 + pad((int(DataLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put16(buf[b:], RequestNum) - b += 2 - - Put16(buf[b:], RequestTotal) - b += 2 - - Put32(buf[b:], DataLen) - b += 4 - - copy(buf[b:], Data[:DataLen]) - b += pad(int(DataLen)) - - return buf -} - -// Request GlxCreateContext -// size: 24 -type GlxCreateContextCookie struct { - *cookie -} - -// Write request to wire for GlxCreateContext -func (c *Conn) GlxCreateContext(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) GlxCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) - return GlxCreateContextCookie{cookie} -} - -func (c *Conn) GlxCreateContextChecked(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) GlxCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreateContextRequest(Context, Visual, Screen, ShareList, IsDirect), cookie) - return GlxCreateContextCookie{cookie} -} - -func (cook GlxCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreateContext -func (c *Conn) glxCreateContextRequest(Context GlxContext, Visual Visualid, Screen uint32, ShareList GlxContext, IsDirect bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], uint32(Visual)) - b += 4 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(ShareList)) - b += 4 - - if IsDirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request GlxDestroyContext -// size: 8 -type GlxDestroyContextCookie struct { - *cookie -} - -// Write request to wire for GlxDestroyContext -func (c *Conn) GlxDestroyContext(Context GlxContext) GlxDestroyContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDestroyContextRequest(Context), cookie) - return GlxDestroyContextCookie{cookie} -} - -func (c *Conn) GlxDestroyContextChecked(Context GlxContext) GlxDestroyContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDestroyContextRequest(Context), cookie) - return GlxDestroyContextCookie{cookie} -} - -func (cook GlxDestroyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDestroyContext -func (c *Conn) glxDestroyContextRequest(Context GlxContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request GlxMakeCurrent -// size: 16 -type GlxMakeCurrentCookie struct { - *cookie -} - -func (c *Conn) GlxMakeCurrent(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) GlxMakeCurrentCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) - return GlxMakeCurrentCookie{cookie} -} - -func (c *Conn) GlxMakeCurrentUnchecked(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) GlxMakeCurrentCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxMakeCurrentRequest(Drawable, Context, OldContextTag), cookie) - return GlxMakeCurrentCookie{cookie} -} - -// Request reply for GlxMakeCurrent -// size: 32 -type GlxMakeCurrentReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextTag GlxContextTag - // padding: 20 bytes -} - -// Waits and reads reply data from request GlxMakeCurrent -func (cook GlxMakeCurrentCookie) Reply() (*GlxMakeCurrentReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxMakeCurrentReply(buf), nil -} - -// Read reply into structure from buffer for GlxMakeCurrent -func glxMakeCurrentReply(buf []byte) *GlxMakeCurrentReply { - v := new(GlxMakeCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextTag = GlxContextTag(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -func (cook GlxMakeCurrentCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxMakeCurrent -func (c *Conn) glxMakeCurrentRequest(Drawable GlxDrawable, Context GlxContext, OldContextTag GlxContextTag) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], uint32(OldContextTag)) - b += 4 - - return buf -} - -// Request GlxIsDirect -// size: 8 -type GlxIsDirectCookie struct { - *cookie -} - -func (c *Conn) GlxIsDirect(Context GlxContext) GlxIsDirectCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxIsDirectRequest(Context), cookie) - return GlxIsDirectCookie{cookie} -} - -func (c *Conn) GlxIsDirectUnchecked(Context GlxContext) GlxIsDirectCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxIsDirectRequest(Context), cookie) - return GlxIsDirectCookie{cookie} -} - -// Request reply for GlxIsDirect -// size: 32 -type GlxIsDirectReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - IsDirect bool - // padding: 23 bytes -} - -// Waits and reads reply data from request GlxIsDirect -func (cook GlxIsDirectCookie) Reply() (*GlxIsDirectReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxIsDirectReply(buf), nil -} - -// Read reply into structure from buffer for GlxIsDirect -func glxIsDirectReply(buf []byte) *GlxIsDirectReply { - v := new(GlxIsDirectReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.IsDirect = true - } else { - v.IsDirect = false - } - b += 1 - - b += 23 // padding - - return v -} - -func (cook GlxIsDirectCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxIsDirect -func (c *Conn) glxIsDirectRequest(Context GlxContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request GlxQueryVersion -// size: 12 -type GlxQueryVersionCookie struct { - *cookie -} - -func (c *Conn) GlxQueryVersion(MajorVersion uint32, MinorVersion uint32) GlxQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return GlxQueryVersionCookie{cookie} -} - -func (c *Conn) GlxQueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) GlxQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return GlxQueryVersionCookie{cookie} -} - -// Request reply for GlxQueryVersion -// size: 32 -type GlxQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request GlxQueryVersion -func (cook GlxQueryVersionCookie) Reply() (*GlxQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for GlxQueryVersion -func glxQueryVersionReply(buf []byte) *GlxQueryVersionReply { - v := new(GlxQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook GlxQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxQueryVersion -func (c *Conn) glxQueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - return buf -} - -// Request GlxWaitGL -// size: 8 -type GlxWaitGLCookie struct { - *cookie -} - -// Write request to wire for GlxWaitGL -func (c *Conn) GlxWaitGL(ContextTag GlxContextTag) GlxWaitGLCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxWaitGLRequest(ContextTag), cookie) - return GlxWaitGLCookie{cookie} -} - -func (c *Conn) GlxWaitGLChecked(ContextTag GlxContextTag) GlxWaitGLCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxWaitGLRequest(ContextTag), cookie) - return GlxWaitGLCookie{cookie} -} - -func (cook GlxWaitGLCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxWaitGL -func (c *Conn) glxWaitGLRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxWaitX -// size: 8 -type GlxWaitXCookie struct { - *cookie -} - -// Write request to wire for GlxWaitX -func (c *Conn) GlxWaitX(ContextTag GlxContextTag) GlxWaitXCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxWaitXRequest(ContextTag), cookie) - return GlxWaitXCookie{cookie} -} - -func (c *Conn) GlxWaitXChecked(ContextTag GlxContextTag) GlxWaitXCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxWaitXRequest(ContextTag), cookie) - return GlxWaitXCookie{cookie} -} - -func (cook GlxWaitXCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxWaitX -func (c *Conn) glxWaitXRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxCopyContext -// size: 20 -type GlxCopyContextCookie struct { - *cookie -} - -// Write request to wire for GlxCopyContext -func (c *Conn) GlxCopyContext(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) - return GlxCopyContextCookie{cookie} -} - -func (c *Conn) GlxCopyContextChecked(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) GlxCopyContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCopyContextRequest(Src, Dest, Mask, SrcContextTag), cookie) - return GlxCopyContextCookie{cookie} -} - -func (cook GlxCopyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCopyContext -func (c *Conn) glxCopyContextRequest(Src GlxContext, Dest GlxContext, Mask uint32, SrcContextTag GlxContextTag) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dest)) - b += 4 - - Put32(buf[b:], Mask) - b += 4 - - Put32(buf[b:], uint32(SrcContextTag)) - b += 4 - - return buf -} - -// Request GlxSwapBuffers -// size: 12 -type GlxSwapBuffersCookie struct { - *cookie -} - -// Write request to wire for GlxSwapBuffers -func (c *Conn) GlxSwapBuffers(ContextTag GlxContextTag, Drawable GlxDrawable) GlxSwapBuffersCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) - return GlxSwapBuffersCookie{cookie} -} - -func (c *Conn) GlxSwapBuffersChecked(ContextTag GlxContextTag, Drawable GlxDrawable) GlxSwapBuffersCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxSwapBuffersRequest(ContextTag, Drawable), cookie) - return GlxSwapBuffersCookie{cookie} -} - -func (cook GlxSwapBuffersCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxSwapBuffers -func (c *Conn) glxSwapBuffersRequest(ContextTag GlxContextTag, Drawable GlxDrawable) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request GlxUseXFont -// size: 24 -type GlxUseXFontCookie struct { - *cookie -} - -// Write request to wire for GlxUseXFont -func (c *Conn) GlxUseXFont(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) - return GlxUseXFontCookie{cookie} -} - -func (c *Conn) GlxUseXFontChecked(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) GlxUseXFontCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxUseXFontRequest(ContextTag, Font, First, Count, ListBase), cookie) - return GlxUseXFontCookie{cookie} -} - -func (cook GlxUseXFontCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxUseXFont -func (c *Conn) glxUseXFontRequest(ContextTag GlxContextTag, Font Font, First uint32, Count uint32, ListBase uint32) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Font)) - b += 4 - - Put32(buf[b:], First) - b += 4 - - Put32(buf[b:], Count) - b += 4 - - Put32(buf[b:], ListBase) - b += 4 - - return buf -} - -// Request GlxCreateGLXPixmap -// size: 20 -type GlxCreateGLXPixmapCookie struct { - *cookie -} - -// Write request to wire for GlxCreateGLXPixmap -func (c *Conn) GlxCreateGLXPixmap(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) GlxCreateGLXPixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) - return GlxCreateGLXPixmapCookie{cookie} -} - -func (c *Conn) GlxCreateGLXPixmapChecked(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) GlxCreateGLXPixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreateGLXPixmapRequest(Screen, Visual, Pixmap, GlxPixmap), cookie) - return GlxCreateGLXPixmapCookie{cookie} -} - -func (cook GlxCreateGLXPixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreateGLXPixmap -func (c *Conn) glxCreateGLXPixmapRequest(Screen uint32, Visual Visualid, Pixmap Pixmap, GlxPixmap GlxPixmap) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Visual)) - b += 4 - - Put32(buf[b:], uint32(Pixmap)) - b += 4 - - Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - return buf -} - -// Request GlxGetVisualConfigs -// size: 8 -type GlxGetVisualConfigsCookie struct { - *cookie -} - -func (c *Conn) GlxGetVisualConfigs(Screen uint32) GlxGetVisualConfigsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetVisualConfigsRequest(Screen), cookie) - return GlxGetVisualConfigsCookie{cookie} -} - -func (c *Conn) GlxGetVisualConfigsUnchecked(Screen uint32) GlxGetVisualConfigsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetVisualConfigsRequest(Screen), cookie) - return GlxGetVisualConfigsCookie{cookie} -} - -// Request reply for GlxGetVisualConfigs -// size: (32 + pad((int(Length) * 4))) -type GlxGetVisualConfigsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumVisuals uint32 - NumProperties uint32 - // padding: 16 bytes - PropertyList []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request GlxGetVisualConfigs -func (cook GlxGetVisualConfigsCookie) Reply() (*GlxGetVisualConfigsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetVisualConfigsReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetVisualConfigs -func glxGetVisualConfigsReply(buf []byte) *GlxGetVisualConfigsReply { - v := new(GlxGetVisualConfigsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumVisuals = Get32(buf[b:]) - b += 4 - - v.NumProperties = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.PropertyList = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PropertyList[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetVisualConfigsCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetVisualConfigs -func (c *Conn) glxGetVisualConfigsRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request GlxDestroyGLXPixmap -// size: 8 -type GlxDestroyGLXPixmapCookie struct { - *cookie -} - -// Write request to wire for GlxDestroyGLXPixmap -func (c *Conn) GlxDestroyGLXPixmap(GlxPixmap GlxPixmap) GlxDestroyGLXPixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) - return GlxDestroyGLXPixmapCookie{cookie} -} - -func (c *Conn) GlxDestroyGLXPixmapChecked(GlxPixmap GlxPixmap) GlxDestroyGLXPixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDestroyGLXPixmapRequest(GlxPixmap), cookie) - return GlxDestroyGLXPixmapCookie{cookie} -} - -func (cook GlxDestroyGLXPixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDestroyGLXPixmap -func (c *Conn) glxDestroyGLXPixmapRequest(GlxPixmap GlxPixmap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - return buf -} - -// Request GlxVendorPrivate -// size: pad((12 + pad((len(Data) * 1)))) -type GlxVendorPrivateCookie struct { - *cookie -} - -// Write request to wire for GlxVendorPrivate -func (c *Conn) GlxVendorPrivate(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxVendorPrivateRequest(VendorCode, ContextTag, Data), cookie) - return GlxVendorPrivateCookie{cookie} -} - -func (c *Conn) GlxVendorPrivateChecked(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxVendorPrivateRequest(VendorCode, ContextTag, Data), cookie) - return GlxVendorPrivateCookie{cookie} -} - -func (cook GlxVendorPrivateCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxVendorPrivate -func (c *Conn) glxVendorPrivateRequest(VendorCode uint32, ContextTag GlxContextTag, Data []byte) []byte { - size := pad((12 + pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], VendorCode) - b += 4 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) - - return buf -} - -// Request GlxVendorPrivateWithReply -// size: pad((12 + pad((len(Data) * 1)))) -type GlxVendorPrivateWithReplyCookie struct { - *cookie -} - -func (c *Conn) GlxVendorPrivateWithReply(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateWithReplyCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxVendorPrivateWithReplyRequest(VendorCode, ContextTag, Data), cookie) - return GlxVendorPrivateWithReplyCookie{cookie} -} - -func (c *Conn) GlxVendorPrivateWithReplyUnchecked(VendorCode uint32, ContextTag GlxContextTag, Data []byte) GlxVendorPrivateWithReplyCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxVendorPrivateWithReplyRequest(VendorCode, ContextTag, Data), cookie) - return GlxVendorPrivateWithReplyCookie{cookie} -} - -// Request reply for GlxVendorPrivateWithReply -// size: (36 + pad(((int(Length) * 4) * 1))) -type GlxVendorPrivateWithReplyReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Retval uint32 - Data1 []byte // size: 24 - Data2 []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxVendorPrivateWithReply -func (cook GlxVendorPrivateWithReplyCookie) Reply() (*GlxVendorPrivateWithReplyReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxVendorPrivateWithReplyReply(buf), nil -} - -// Read reply into structure from buffer for GlxVendorPrivateWithReply -func glxVendorPrivateWithReplyReply(buf []byte) *GlxVendorPrivateWithReplyReply { - v := new(GlxVendorPrivateWithReplyReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Retval = Get32(buf[b:]) - b += 4 - - v.Data1 = make([]byte, 24) - copy(v.Data1[:24], buf[b:]) - b += pad(int(24)) - - v.Data2 = make([]byte, (int(v.Length) * 4)) - copy(v.Data2[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxVendorPrivateWithReplyCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxVendorPrivateWithReply -func (c *Conn) glxVendorPrivateWithReplyRequest(VendorCode uint32, ContextTag GlxContextTag, Data []byte) []byte { - size := pad((12 + pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], VendorCode) - b += 4 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) - - return buf -} - -// Request GlxQueryExtensionsString -// size: 8 -type GlxQueryExtensionsStringCookie struct { - *cookie -} - -func (c *Conn) GlxQueryExtensionsString(Screen uint32) GlxQueryExtensionsStringCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxQueryExtensionsStringRequest(Screen), cookie) - return GlxQueryExtensionsStringCookie{cookie} -} - -func (c *Conn) GlxQueryExtensionsStringUnchecked(Screen uint32) GlxQueryExtensionsStringCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxQueryExtensionsStringRequest(Screen), cookie) - return GlxQueryExtensionsStringCookie{cookie} -} - -// Request reply for GlxQueryExtensionsString -// size: 32 -type GlxQueryExtensionsStringReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request GlxQueryExtensionsString -func (cook GlxQueryExtensionsStringCookie) Reply() (*GlxQueryExtensionsStringReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxQueryExtensionsStringReply(buf), nil -} - -// Read reply into structure from buffer for GlxQueryExtensionsString -func glxQueryExtensionsStringReply(buf []byte) *GlxQueryExtensionsStringReply { - v := new(GlxQueryExtensionsStringReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook GlxQueryExtensionsStringCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxQueryExtensionsString -func (c *Conn) glxQueryExtensionsStringRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request GlxQueryServerString -// size: 12 -type GlxQueryServerStringCookie struct { - *cookie -} - -func (c *Conn) GlxQueryServerString(Screen uint32, Name uint32) GlxQueryServerStringCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxQueryServerStringRequest(Screen, Name), cookie) - return GlxQueryServerStringCookie{cookie} -} - -func (c *Conn) GlxQueryServerStringUnchecked(Screen uint32, Name uint32) GlxQueryServerStringCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxQueryServerStringRequest(Screen, Name), cookie) - return GlxQueryServerStringCookie{cookie} -} - -// Request reply for GlxQueryServerString -// size: (32 + pad((int(StrLen) * 1))) -type GlxQueryServerStringReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - StrLen uint32 - // padding: 16 bytes - String string // size: pad((int(StrLen) * 1)) -} - -// Waits and reads reply data from request GlxQueryServerString -func (cook GlxQueryServerStringCookie) Reply() (*GlxQueryServerStringReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxQueryServerStringReply(buf), nil -} - -// Read reply into structure from buffer for GlxQueryServerString -func glxQueryServerStringReply(buf []byte) *GlxQueryServerStringReply { - v := new(GlxQueryServerStringReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.StrLen = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - { - byteString := make([]byte, v.StrLen) - copy(byteString[:v.StrLen], buf[b:]) - v.String = string(byteString) - b += pad(int(v.StrLen)) - } - - return v -} - -func (cook GlxQueryServerStringCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxQueryServerString -func (c *Conn) glxQueryServerStringRequest(Screen uint32, Name uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Name) - b += 4 - - return buf -} - -// Request GlxClientInfo -// size: pad((16 + pad((int(StrLen) * 1)))) -type GlxClientInfoCookie struct { - *cookie -} - -// Write request to wire for GlxClientInfo -func (c *Conn) GlxClientInfo(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) GlxClientInfoCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxClientInfoRequest(MajorVersion, MinorVersion, StrLen, String), cookie) - return GlxClientInfoCookie{cookie} -} - -func (c *Conn) GlxClientInfoChecked(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) GlxClientInfoCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxClientInfoRequest(MajorVersion, MinorVersion, StrLen, String), cookie) - return GlxClientInfoCookie{cookie} -} - -func (cook GlxClientInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxClientInfo -func (c *Conn) glxClientInfoRequest(MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { - size := pad((16 + pad((int(StrLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - Put32(buf[b:], StrLen) - b += 4 - - copy(buf[b:], String[:StrLen]) - b += pad(int(StrLen)) - - return buf -} - -// Request GlxGetFBConfigs -// size: 8 -type GlxGetFBConfigsCookie struct { - *cookie -} - -func (c *Conn) GlxGetFBConfigs(Screen uint32) GlxGetFBConfigsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetFBConfigsRequest(Screen), cookie) - return GlxGetFBConfigsCookie{cookie} -} - -func (c *Conn) GlxGetFBConfigsUnchecked(Screen uint32) GlxGetFBConfigsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetFBConfigsRequest(Screen), cookie) - return GlxGetFBConfigsCookie{cookie} -} - -// Request reply for GlxGetFBConfigs -// size: (32 + pad((int(Length) * 4))) -type GlxGetFBConfigsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumFbConfigs uint32 - NumProperties uint32 - // padding: 16 bytes - PropertyList []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request GlxGetFBConfigs -func (cook GlxGetFBConfigsCookie) Reply() (*GlxGetFBConfigsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetFBConfigsReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetFBConfigs -func glxGetFBConfigsReply(buf []byte) *GlxGetFBConfigsReply { - v := new(GlxGetFBConfigsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFbConfigs = Get32(buf[b:]) - b += 4 - - v.NumProperties = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.PropertyList = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PropertyList[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetFBConfigsCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetFBConfigs -func (c *Conn) glxGetFBConfigsRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request GlxCreatePixmap -// size: pad((24 + pad(((int(NumAttribs) * 2) * 4)))) -type GlxCreatePixmapCookie struct { - *cookie -} - -// Write request to wire for GlxCreatePixmap -func (c *Conn) GlxCreatePixmap(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) - return GlxCreatePixmapCookie{cookie} -} - -func (c *Conn) GlxCreatePixmapChecked(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) GlxCreatePixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreatePixmapRequest(Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) - return GlxCreatePixmapCookie{cookie} -} - -func (cook GlxCreatePixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreatePixmap -func (c *Conn) glxCreatePixmapRequest(Screen uint32, Fbconfig GlxFbconfig, Pixmap Pixmap, GlxPixmap GlxPixmap, NumAttribs uint32, Attribs []uint32) []byte { - size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - Put32(buf[b:], uint32(Pixmap)) - b += 4 - - Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - Put32(buf[b:], Attribs[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxDestroyPixmap -// size: 8 -type GlxDestroyPixmapCookie struct { - *cookie -} - -// Write request to wire for GlxDestroyPixmap -func (c *Conn) GlxDestroyPixmap(GlxPixmap GlxPixmap) GlxDestroyPixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) - return GlxDestroyPixmapCookie{cookie} -} - -func (c *Conn) GlxDestroyPixmapChecked(GlxPixmap GlxPixmap) GlxDestroyPixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDestroyPixmapRequest(GlxPixmap), cookie) - return GlxDestroyPixmapCookie{cookie} -} - -func (cook GlxDestroyPixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDestroyPixmap -func (c *Conn) glxDestroyPixmapRequest(GlxPixmap GlxPixmap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - return buf -} - -// Request GlxCreateNewContext -// size: 28 -type GlxCreateNewContextCookie struct { - *cookie -} - -// Write request to wire for GlxCreateNewContext -func (c *Conn) GlxCreateNewContext(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) GlxCreateNewContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) - return GlxCreateNewContextCookie{cookie} -} - -func (c *Conn) GlxCreateNewContextChecked(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) GlxCreateNewContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreateNewContextRequest(Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) - return GlxCreateNewContextCookie{cookie} -} - -func (cook GlxCreateNewContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreateNewContext -func (c *Conn) glxCreateNewContextRequest(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, RenderType uint32, ShareList GlxContext, IsDirect bool) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], RenderType) - b += 4 - - Put32(buf[b:], uint32(ShareList)) - b += 4 - - if IsDirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request GlxQueryContext -// size: 8 -type GlxQueryContextCookie struct { - *cookie -} - -func (c *Conn) GlxQueryContext(Context GlxContext) GlxQueryContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxQueryContextRequest(Context), cookie) - return GlxQueryContextCookie{cookie} -} - -func (c *Conn) GlxQueryContextUnchecked(Context GlxContext) GlxQueryContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxQueryContextRequest(Context), cookie) - return GlxQueryContextCookie{cookie} -} - -// Request reply for GlxQueryContext -// size: (32 + pad(((int(NumAttribs) * 2) * 4))) -type GlxQueryContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAttribs uint32 - // padding: 20 bytes - Attribs []uint32 // size: pad(((int(NumAttribs) * 2) * 4)) -} - -// Waits and reads reply data from request GlxQueryContext -func (cook GlxQueryContextCookie) Reply() (*GlxQueryContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxQueryContextReply(buf), nil -} - -// Read reply into structure from buffer for GlxQueryContext -func glxQueryContextReply(buf []byte) *GlxQueryContextReply { - v := new(GlxQueryContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAttribs = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) - for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { - v.Attribs[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxQueryContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxQueryContext -func (c *Conn) glxQueryContextRequest(Context GlxContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request GlxMakeContextCurrent -// size: 20 -type GlxMakeContextCurrentCookie struct { - *cookie -} - -func (c *Conn) GlxMakeContextCurrent(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) GlxMakeContextCurrentCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) - return GlxMakeContextCurrentCookie{cookie} -} - -func (c *Conn) GlxMakeContextCurrentUnchecked(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) GlxMakeContextCurrentCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxMakeContextCurrentRequest(OldContextTag, Drawable, ReadDrawable, Context), cookie) - return GlxMakeContextCurrentCookie{cookie} -} - -// Request reply for GlxMakeContextCurrent -// size: 32 -type GlxMakeContextCurrentReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextTag GlxContextTag - // padding: 20 bytes -} - -// Waits and reads reply data from request GlxMakeContextCurrent -func (cook GlxMakeContextCurrentCookie) Reply() (*GlxMakeContextCurrentReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxMakeContextCurrentReply(buf), nil -} - -// Read reply into structure from buffer for GlxMakeContextCurrent -func glxMakeContextCurrentReply(buf []byte) *GlxMakeContextCurrentReply { - v := new(GlxMakeContextCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextTag = GlxContextTag(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -func (cook GlxMakeContextCurrentCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxMakeContextCurrent -func (c *Conn) glxMakeContextCurrentRequest(OldContextTag GlxContextTag, Drawable GlxDrawable, ReadDrawable GlxDrawable, Context GlxContext) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(OldContextTag)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(ReadDrawable)) - b += 4 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request GlxCreatePbuffer -// size: pad((20 + pad(((int(NumAttribs) * 2) * 4)))) -type GlxCreatePbufferCookie struct { - *cookie -} - -// Write request to wire for GlxCreatePbuffer -func (c *Conn) GlxCreatePbuffer(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) - return GlxCreatePbufferCookie{cookie} -} - -func (c *Conn) GlxCreatePbufferChecked(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) GlxCreatePbufferCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreatePbufferRequest(Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) - return GlxCreatePbufferCookie{cookie} -} - -func (cook GlxCreatePbufferCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreatePbuffer -func (c *Conn) glxCreatePbufferRequest(Screen uint32, Fbconfig GlxFbconfig, Pbuffer GlxPbuffer, NumAttribs uint32, Attribs []uint32) []byte { - size := pad((20 + pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - Put32(buf[b:], uint32(Pbuffer)) - b += 4 - - Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - Put32(buf[b:], Attribs[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxDestroyPbuffer -// size: 8 -type GlxDestroyPbufferCookie struct { - *cookie -} - -// Write request to wire for GlxDestroyPbuffer -func (c *Conn) GlxDestroyPbuffer(Pbuffer GlxPbuffer) GlxDestroyPbufferCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) - return GlxDestroyPbufferCookie{cookie} -} - -func (c *Conn) GlxDestroyPbufferChecked(Pbuffer GlxPbuffer) GlxDestroyPbufferCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDestroyPbufferRequest(Pbuffer), cookie) - return GlxDestroyPbufferCookie{cookie} -} - -func (cook GlxDestroyPbufferCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDestroyPbuffer -func (c *Conn) glxDestroyPbufferRequest(Pbuffer GlxPbuffer) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Pbuffer)) - b += 4 - - return buf -} - -// Request GlxGetDrawableAttributes -// size: 8 -type GlxGetDrawableAttributesCookie struct { - *cookie -} - -func (c *Conn) GlxGetDrawableAttributes(Drawable GlxDrawable) GlxGetDrawableAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) - return GlxGetDrawableAttributesCookie{cookie} -} - -func (c *Conn) GlxGetDrawableAttributesUnchecked(Drawable GlxDrawable) GlxGetDrawableAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetDrawableAttributesRequest(Drawable), cookie) - return GlxGetDrawableAttributesCookie{cookie} -} - -// Request reply for GlxGetDrawableAttributes -// size: (32 + pad(((int(NumAttribs) * 2) * 4))) -type GlxGetDrawableAttributesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAttribs uint32 - // padding: 20 bytes - Attribs []uint32 // size: pad(((int(NumAttribs) * 2) * 4)) -} - -// Waits and reads reply data from request GlxGetDrawableAttributes -func (cook GlxGetDrawableAttributesCookie) Reply() (*GlxGetDrawableAttributesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetDrawableAttributesReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetDrawableAttributes -func glxGetDrawableAttributesReply(buf []byte) *GlxGetDrawableAttributesReply { - v := new(GlxGetDrawableAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAttribs = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) - for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { - v.Attribs[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetDrawableAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetDrawableAttributes -func (c *Conn) glxGetDrawableAttributesRequest(Drawable GlxDrawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request GlxChangeDrawableAttributes -// size: pad((12 + pad(((int(NumAttribs) * 2) * 4)))) -type GlxChangeDrawableAttributesCookie struct { - *cookie -} - -// Write request to wire for GlxChangeDrawableAttributes -func (c *Conn) GlxChangeDrawableAttributes(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) - return GlxChangeDrawableAttributesCookie{cookie} -} - -func (c *Conn) GlxChangeDrawableAttributesChecked(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) GlxChangeDrawableAttributesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxChangeDrawableAttributesRequest(Drawable, NumAttribs, Attribs), cookie) - return GlxChangeDrawableAttributesCookie{cookie} -} - -func (cook GlxChangeDrawableAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxChangeDrawableAttributes -func (c *Conn) glxChangeDrawableAttributesRequest(Drawable GlxDrawable, NumAttribs uint32, Attribs []uint32) []byte { - size := pad((12 + pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - Put32(buf[b:], Attribs[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxCreateWindow -// size: pad((24 + pad(((int(NumAttribs) * 2) * 4)))) -type GlxCreateWindowCookie struct { - *cookie -} - -// Write request to wire for GlxCreateWindow -func (c *Conn) GlxCreateWindow(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) - return GlxCreateWindowCookie{cookie} -} - -func (c *Conn) GlxCreateWindowChecked(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) GlxCreateWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreateWindowRequest(Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) - return GlxCreateWindowCookie{cookie} -} - -func (cook GlxCreateWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreateWindow -func (c *Conn) glxCreateWindowRequest(Screen uint32, Fbconfig GlxFbconfig, Window Window, GlxWindow GlxWindow, NumAttribs uint32, Attribs []uint32) []byte { - size := pad((24 + pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(GlxWindow)) - b += 4 - - Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - Put32(buf[b:], Attribs[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxDeleteWindow -// size: 8 -type GlxDeleteWindowCookie struct { - *cookie -} - -// Write request to wire for GlxDeleteWindow -func (c *Conn) GlxDeleteWindow(Glxwindow GlxWindow) GlxDeleteWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) - return GlxDeleteWindowCookie{cookie} -} - -func (c *Conn) GlxDeleteWindowChecked(Glxwindow GlxWindow) GlxDeleteWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDeleteWindowRequest(Glxwindow), cookie) - return GlxDeleteWindowCookie{cookie} -} - -func (cook GlxDeleteWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDeleteWindow -func (c *Conn) glxDeleteWindowRequest(Glxwindow GlxWindow) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 32 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Glxwindow)) - b += 4 - - return buf -} - -// Request GlxSetClientInfoARB -// size: pad((((24 + pad(((int(NumVersions) * 2) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) -type GlxSetClientInfoARBCookie struct { - *cookie -} - -// Write request to wire for GlxSetClientInfoARB -func (c *Conn) GlxSetClientInfoARB(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfoARBCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxSetClientInfoARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return GlxSetClientInfoARBCookie{cookie} -} - -func (c *Conn) GlxSetClientInfoARBChecked(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfoARBCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxSetClientInfoARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return GlxSetClientInfoARBCookie{cookie} -} - -func (cook GlxSetClientInfoARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxSetClientInfoARB -func (c *Conn) glxSetClientInfoARBRequest(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { - size := pad((((24 + pad(((int(NumVersions) * 2) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 33 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - Put32(buf[b:], NumVersions) - b += 4 - - Put32(buf[b:], GlStrLen) - b += 4 - - Put32(buf[b:], GlxStrLen) - b += 4 - - for i := 0; i < int((int(NumVersions) * 2)); i++ { - Put32(buf[b:], GlVersions[i]) - b += 4 - } - b = pad(b) - - copy(buf[b:], GlExtensionString[:GlStrLen]) - b += pad(int(GlStrLen)) - - copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += pad(int(GlxStrLen)) - - return buf -} - -// Request GlxCreateContextAttribsARB -// size: pad((28 + pad(((int(NumAttribs) * 2) * 4)))) -type GlxCreateContextAttribsARBCookie struct { - *cookie -} - -// Write request to wire for GlxCreateContextAttribsARB -func (c *Conn) GlxCreateContextAttribsARB(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) - return GlxCreateContextAttribsARBCookie{cookie} -} - -func (c *Conn) GlxCreateContextAttribsARBChecked(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) GlxCreateContextAttribsARBCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxCreateContextAttribsARBRequest(Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) - return GlxCreateContextAttribsARBCookie{cookie} -} - -func (cook GlxCreateContextAttribsARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxCreateContextAttribsARB -func (c *Conn) glxCreateContextAttribsARBRequest(Context GlxContext, Fbconfig GlxFbconfig, Screen uint32, ShareList GlxContext, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { - size := pad((28 + pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 34 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(ShareList)) - b += 4 - - if IsDirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - Put32(buf[b:], Attribs[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxSetClientInfo2ARB -// size: pad((((24 + pad(((int(NumVersions) * 3) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) -type GlxSetClientInfo2ARBCookie struct { - *cookie -} - -// Write request to wire for GlxSetClientInfo2ARB -func (c *Conn) GlxSetClientInfo2ARB(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfo2ARBCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxSetClientInfo2ARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return GlxSetClientInfo2ARBCookie{cookie} -} - -func (c *Conn) GlxSetClientInfo2ARBChecked(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) GlxSetClientInfo2ARBCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxSetClientInfo2ARBRequest(MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return GlxSetClientInfo2ARBCookie{cookie} -} - -func (cook GlxSetClientInfo2ARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxSetClientInfo2ARB -func (c *Conn) glxSetClientInfo2ARBRequest(MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { - size := pad((((24 + pad(((int(NumVersions) * 3) * 4))) + pad((int(GlStrLen) * 1))) + pad((int(GlxStrLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 35 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - Put32(buf[b:], NumVersions) - b += 4 - - Put32(buf[b:], GlStrLen) - b += 4 - - Put32(buf[b:], GlxStrLen) - b += 4 - - for i := 0; i < int((int(NumVersions) * 3)); i++ { - Put32(buf[b:], GlVersions[i]) - b += 4 - } - b = pad(b) - - copy(buf[b:], GlExtensionString[:GlStrLen]) - b += pad(int(GlStrLen)) - - copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += pad(int(GlxStrLen)) - - return buf -} - -// Request GlxNewList -// size: 16 -type GlxNewListCookie struct { - *cookie -} - -// Write request to wire for GlxNewList -func (c *Conn) GlxNewList(ContextTag GlxContextTag, List uint32, Mode uint32) GlxNewListCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxNewListRequest(ContextTag, List, Mode), cookie) - return GlxNewListCookie{cookie} -} - -func (c *Conn) GlxNewListChecked(ContextTag GlxContextTag, List uint32, Mode uint32) GlxNewListCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxNewListRequest(ContextTag, List, Mode), cookie) - return GlxNewListCookie{cookie} -} - -func (cook GlxNewListCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxNewList -func (c *Conn) glxNewListRequest(ContextTag GlxContextTag, List uint32, Mode uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 101 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], List) - b += 4 - - Put32(buf[b:], Mode) - b += 4 - - return buf -} - -// Request GlxEndList -// size: 8 -type GlxEndListCookie struct { - *cookie -} - -// Write request to wire for GlxEndList -func (c *Conn) GlxEndList(ContextTag GlxContextTag) GlxEndListCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxEndListRequest(ContextTag), cookie) - return GlxEndListCookie{cookie} -} - -func (c *Conn) GlxEndListChecked(ContextTag GlxContextTag) GlxEndListCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxEndListRequest(ContextTag), cookie) - return GlxEndListCookie{cookie} -} - -func (cook GlxEndListCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxEndList -func (c *Conn) glxEndListRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 102 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxDeleteLists -// size: 16 -type GlxDeleteListsCookie struct { - *cookie -} - -// Write request to wire for GlxDeleteLists -func (c *Conn) GlxDeleteLists(ContextTag GlxContextTag, List uint32, Range int32) GlxDeleteListsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDeleteListsRequest(ContextTag, List, Range), cookie) - return GlxDeleteListsCookie{cookie} -} - -func (c *Conn) GlxDeleteListsChecked(ContextTag GlxContextTag, List uint32, Range int32) GlxDeleteListsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDeleteListsRequest(ContextTag, List, Range), cookie) - return GlxDeleteListsCookie{cookie} -} - -func (cook GlxDeleteListsCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDeleteLists -func (c *Conn) glxDeleteListsRequest(ContextTag GlxContextTag, List uint32, Range int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 103 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], List) - b += 4 - - Put32(buf[b:], uint32(Range)) - b += 4 - - return buf -} - -// Request GlxGenLists -// size: 12 -type GlxGenListsCookie struct { - *cookie -} - -func (c *Conn) GlxGenLists(ContextTag GlxContextTag, Range int32) GlxGenListsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGenListsRequest(ContextTag, Range), cookie) - return GlxGenListsCookie{cookie} -} - -func (c *Conn) GlxGenListsUnchecked(ContextTag GlxContextTag, Range int32) GlxGenListsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGenListsRequest(ContextTag, Range), cookie) - return GlxGenListsCookie{cookie} -} - -// Request reply for GlxGenLists -// size: 12 -type GlxGenListsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal uint32 -} - -// Waits and reads reply data from request GlxGenLists -func (cook GlxGenListsCookie) Reply() (*GlxGenListsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGenListsReply(buf), nil -} - -// Read reply into structure from buffer for GlxGenLists -func glxGenListsReply(buf []byte) *GlxGenListsReply { - v := new(GlxGenListsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook GlxGenListsCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGenLists -func (c *Conn) glxGenListsRequest(ContextTag GlxContextTag, Range int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 104 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Range)) - b += 4 - - return buf -} - -// Request GlxFeedbackBuffer -// size: 16 -type GlxFeedbackBufferCookie struct { - *cookie -} - -// Write request to wire for GlxFeedbackBuffer -func (c *Conn) GlxFeedbackBuffer(ContextTag GlxContextTag, Size int32, Type int32) GlxFeedbackBufferCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxFeedbackBufferRequest(ContextTag, Size, Type), cookie) - return GlxFeedbackBufferCookie{cookie} -} - -func (c *Conn) GlxFeedbackBufferChecked(ContextTag GlxContextTag, Size int32, Type int32) GlxFeedbackBufferCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxFeedbackBufferRequest(ContextTag, Size, Type), cookie) - return GlxFeedbackBufferCookie{cookie} -} - -func (cook GlxFeedbackBufferCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxFeedbackBuffer -func (c *Conn) glxFeedbackBufferRequest(ContextTag GlxContextTag, Size int32, Type int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 105 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Size)) - b += 4 - - Put32(buf[b:], uint32(Type)) - b += 4 - - return buf -} - -// Request GlxSelectBuffer -// size: 12 -type GlxSelectBufferCookie struct { - *cookie -} - -// Write request to wire for GlxSelectBuffer -func (c *Conn) GlxSelectBuffer(ContextTag GlxContextTag, Size int32) GlxSelectBufferCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxSelectBufferRequest(ContextTag, Size), cookie) - return GlxSelectBufferCookie{cookie} -} - -func (c *Conn) GlxSelectBufferChecked(ContextTag GlxContextTag, Size int32) GlxSelectBufferCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxSelectBufferRequest(ContextTag, Size), cookie) - return GlxSelectBufferCookie{cookie} -} - -func (cook GlxSelectBufferCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxSelectBuffer -func (c *Conn) glxSelectBufferRequest(ContextTag GlxContextTag, Size int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 106 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Size)) - b += 4 - - return buf -} - -// Request GlxRenderMode -// size: 12 -type GlxRenderModeCookie struct { - *cookie -} - -func (c *Conn) GlxRenderMode(ContextTag GlxContextTag, Mode uint32) GlxRenderModeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxRenderModeRequest(ContextTag, Mode), cookie) - return GlxRenderModeCookie{cookie} -} - -func (c *Conn) GlxRenderModeUnchecked(ContextTag GlxContextTag, Mode uint32) GlxRenderModeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxRenderModeRequest(ContextTag, Mode), cookie) - return GlxRenderModeCookie{cookie} -} - -// Request reply for GlxRenderMode -// size: (32 + pad((int(N) * 4))) -type GlxRenderModeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal uint32 - N uint32 - NewMode uint32 - // padding: 12 bytes - Data []uint32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxRenderMode -func (cook GlxRenderModeCookie) Reply() (*GlxRenderModeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxRenderModeReply(buf), nil -} - -// Read reply into structure from buffer for GlxRenderMode -func glxRenderModeReply(buf []byte) *GlxRenderModeReply { - v := new(GlxRenderModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = Get32(buf[b:]) - b += 4 - - v.N = Get32(buf[b:]) - b += 4 - - v.NewMode = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]uint32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxRenderModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxRenderMode -func (c *Conn) glxRenderModeRequest(ContextTag GlxContextTag, Mode uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 107 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Mode) - b += 4 - - return buf -} - -// Request GlxFinish -// size: 8 -type GlxFinishCookie struct { - *cookie -} - -func (c *Conn) GlxFinish(ContextTag GlxContextTag) GlxFinishCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxFinishRequest(ContextTag), cookie) - return GlxFinishCookie{cookie} -} - -func (c *Conn) GlxFinishUnchecked(ContextTag GlxContextTag) GlxFinishCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxFinishRequest(ContextTag), cookie) - return GlxFinishCookie{cookie} -} - -// Request reply for GlxFinish -// size: 8 -type GlxFinishReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes -} - -// Waits and reads reply data from request GlxFinish -func (cook GlxFinishCookie) Reply() (*GlxFinishReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxFinishReply(buf), nil -} - -// Read reply into structure from buffer for GlxFinish -func glxFinishReply(buf []byte) *GlxFinishReply { - v := new(GlxFinishReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -func (cook GlxFinishCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxFinish -func (c *Conn) glxFinishRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 108 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxPixelStoref -// size: 16 -type GlxPixelStorefCookie struct { - *cookie -} - -// Write request to wire for GlxPixelStoref -func (c *Conn) GlxPixelStoref(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) GlxPixelStorefCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxPixelStorefRequest(ContextTag, Pname, Datum), cookie) - return GlxPixelStorefCookie{cookie} -} - -func (c *Conn) GlxPixelStorefChecked(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) GlxPixelStorefCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxPixelStorefRequest(ContextTag, Pname, Datum), cookie) - return GlxPixelStorefCookie{cookie} -} - -func (cook GlxPixelStorefCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxPixelStoref -func (c *Conn) glxPixelStorefRequest(ContextTag GlxContextTag, Pname uint32, Datum GlxFloat32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 109 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - Put32(buf[b:], uint32(Datum)) - b += 4 - - return buf -} - -// Request GlxPixelStorei -// size: 16 -type GlxPixelStoreiCookie struct { - *cookie -} - -// Write request to wire for GlxPixelStorei -func (c *Conn) GlxPixelStorei(ContextTag GlxContextTag, Pname uint32, Datum int32) GlxPixelStoreiCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxPixelStoreiRequest(ContextTag, Pname, Datum), cookie) - return GlxPixelStoreiCookie{cookie} -} - -func (c *Conn) GlxPixelStoreiChecked(ContextTag GlxContextTag, Pname uint32, Datum int32) GlxPixelStoreiCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxPixelStoreiRequest(ContextTag, Pname, Datum), cookie) - return GlxPixelStoreiCookie{cookie} -} - -func (cook GlxPixelStoreiCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxPixelStorei -func (c *Conn) glxPixelStoreiRequest(ContextTag GlxContextTag, Pname uint32, Datum int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 110 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - Put32(buf[b:], uint32(Datum)) - b += 4 - - return buf -} - -// Request GlxReadPixels -// size: 36 -type GlxReadPixelsCookie struct { - *cookie -} - -func (c *Conn) GlxReadPixels(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) GlxReadPixelsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxReadPixelsRequest(ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) - return GlxReadPixelsCookie{cookie} -} - -func (c *Conn) GlxReadPixelsUnchecked(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) GlxReadPixelsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxReadPixelsRequest(ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) - return GlxReadPixelsCookie{cookie} -} - -// Request reply for GlxReadPixels -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxReadPixelsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxReadPixels -func (cook GlxReadPixelsCookie) Reply() (*GlxReadPixelsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxReadPixelsReply(buf), nil -} - -// Read reply into structure from buffer for GlxReadPixels -func glxReadPixelsReply(buf []byte) *GlxReadPixelsReply { - v := new(GlxReadPixelsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxReadPixelsCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxReadPixels -func (c *Conn) glxReadPixelsRequest(ContextTag GlxContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { - size := 36 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 111 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(X)) - b += 4 - - Put32(buf[b:], uint32(Y)) - b += 4 - - Put32(buf[b:], uint32(Width)) - b += 4 - - Put32(buf[b:], uint32(Height)) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if LsbFirst { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetBooleanv -// size: 12 -type GlxGetBooleanvCookie struct { - *cookie -} - -func (c *Conn) GlxGetBooleanv(ContextTag GlxContextTag, Pname int32) GlxGetBooleanvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetBooleanvRequest(ContextTag, Pname), cookie) - return GlxGetBooleanvCookie{cookie} -} - -func (c *Conn) GlxGetBooleanvUnchecked(ContextTag GlxContextTag, Pname int32) GlxGetBooleanvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetBooleanvRequest(ContextTag, Pname), cookie) - return GlxGetBooleanvCookie{cookie} -} - -// Request reply for GlxGetBooleanv -// size: (32 + pad((int(N) * 1))) -type GlxGetBooleanvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum bool - // padding: 15 bytes - Data []bool // size: pad((int(N) * 1)) -} - -// Waits and reads reply data from request GlxGetBooleanv -func (cook GlxGetBooleanvCookie) Reply() (*GlxGetBooleanvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetBooleanvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetBooleanv -func glxGetBooleanvReply(buf []byte) *GlxGetBooleanvReply { - v := new(GlxGetBooleanvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - if buf[b] == 1 { - v.Datum = true - } else { - v.Datum = false - } - b += 1 - - b += 15 // padding - - v.Data = make([]bool, v.N) - for i := 0; i < int(v.N); i++ { - if buf[b] == 1 { - v.Data[i] = true - } else { - v.Data[i] = false - } - b += 1 - } - b = pad(b) - - return v -} - -func (cook GlxGetBooleanvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetBooleanv -func (c *Conn) glxGetBooleanvRequest(ContextTag GlxContextTag, Pname int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 112 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Pname)) - b += 4 - - return buf -} - -// Request GlxGetClipPlane -// size: 12 -type GlxGetClipPlaneCookie struct { - *cookie -} - -func (c *Conn) GlxGetClipPlane(ContextTag GlxContextTag, Plane int32) GlxGetClipPlaneCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetClipPlaneRequest(ContextTag, Plane), cookie) - return GlxGetClipPlaneCookie{cookie} -} - -func (c *Conn) GlxGetClipPlaneUnchecked(ContextTag GlxContextTag, Plane int32) GlxGetClipPlaneCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetClipPlaneRequest(ContextTag, Plane), cookie) - return GlxGetClipPlaneCookie{cookie} -} - -// Request reply for GlxGetClipPlane -// size: (32 + pad(((int(Length) / 2) * 8))) -type GlxGetClipPlaneReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []GlxFloat64 // size: pad(((int(Length) / 2) * 8)) -} - -// Waits and reads reply data from request GlxGetClipPlane -func (cook GlxGetClipPlaneCookie) Reply() (*GlxGetClipPlaneReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetClipPlaneReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetClipPlane -func glxGetClipPlaneReply(buf []byte) *GlxGetClipPlaneReply { - v := new(GlxGetClipPlaneReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]GlxFloat64, (int(v.Length) / 2)) - for i := 0; i < int((int(v.Length) / 2)); i++ { - v.Data[i] = GlxFloat64(Get64(buf[b:])) - b += 8 - } - b = pad(b) - - return v -} - -func (cook GlxGetClipPlaneCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetClipPlane -func (c *Conn) glxGetClipPlaneRequest(ContextTag GlxContextTag, Plane int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 113 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(Plane)) - b += 4 - - return buf -} - -// Request GlxGetDoublev -// size: 12 -type GlxGetDoublevCookie struct { - *cookie -} - -func (c *Conn) GlxGetDoublev(ContextTag GlxContextTag, Pname uint32) GlxGetDoublevCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetDoublevRequest(ContextTag, Pname), cookie) - return GlxGetDoublevCookie{cookie} -} - -func (c *Conn) GlxGetDoublevUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetDoublevCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetDoublevRequest(ContextTag, Pname), cookie) - return GlxGetDoublevCookie{cookie} -} - -// Request reply for GlxGetDoublev -// size: (32 + pad((int(N) * 8))) -type GlxGetDoublevReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat64 - // padding: 8 bytes - Data []GlxFloat64 // size: pad((int(N) * 8)) -} - -// Waits and reads reply data from request GlxGetDoublev -func (cook GlxGetDoublevCookie) Reply() (*GlxGetDoublevReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetDoublevReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetDoublev -func glxGetDoublevReply(buf []byte) *GlxGetDoublevReply { - v := new(GlxGetDoublevReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat64(Get64(buf[b:])) - b += 8 - - b += 8 // padding - - v.Data = make([]GlxFloat64, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat64(Get64(buf[b:])) - b += 8 - } - b = pad(b) - - return v -} - -func (cook GlxGetDoublevCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetDoublev -func (c *Conn) glxGetDoublevRequest(ContextTag GlxContextTag, Pname uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 114 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetError -// size: 8 -type GlxGetErrorCookie struct { - *cookie -} - -func (c *Conn) GlxGetError(ContextTag GlxContextTag) GlxGetErrorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetErrorRequest(ContextTag), cookie) - return GlxGetErrorCookie{cookie} -} - -func (c *Conn) GlxGetErrorUnchecked(ContextTag GlxContextTag) GlxGetErrorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetErrorRequest(ContextTag), cookie) - return GlxGetErrorCookie{cookie} -} - -// Request reply for GlxGetError -// size: 12 -type GlxGetErrorReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Error int32 -} - -// Waits and reads reply data from request GlxGetError -func (cook GlxGetErrorCookie) Reply() (*GlxGetErrorReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetErrorReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetError -func glxGetErrorReply(buf []byte) *GlxGetErrorReply { - v := new(GlxGetErrorReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Error = int32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook GlxGetErrorCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetError -func (c *Conn) glxGetErrorRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 115 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxGetFloatv -// size: 12 -type GlxGetFloatvCookie struct { - *cookie -} - -func (c *Conn) GlxGetFloatv(ContextTag GlxContextTag, Pname uint32) GlxGetFloatvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetFloatvRequest(ContextTag, Pname), cookie) - return GlxGetFloatvCookie{cookie} -} - -func (c *Conn) GlxGetFloatvUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetFloatvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetFloatvRequest(ContextTag, Pname), cookie) - return GlxGetFloatvCookie{cookie} -} - -// Request reply for GlxGetFloatv -// size: (32 + pad((int(N) * 4))) -type GlxGetFloatvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetFloatv -func (cook GlxGetFloatvCookie) Reply() (*GlxGetFloatvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetFloatvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetFloatv -func glxGetFloatvReply(buf []byte) *GlxGetFloatvReply { - v := new(GlxGetFloatvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetFloatvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetFloatv -func (c *Conn) glxGetFloatvRequest(ContextTag GlxContextTag, Pname uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 116 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetIntegerv -// size: 12 -type GlxGetIntegervCookie struct { - *cookie -} - -func (c *Conn) GlxGetIntegerv(ContextTag GlxContextTag, Pname uint32) GlxGetIntegervCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetIntegervRequest(ContextTag, Pname), cookie) - return GlxGetIntegervCookie{cookie} -} - -func (c *Conn) GlxGetIntegervUnchecked(ContextTag GlxContextTag, Pname uint32) GlxGetIntegervCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetIntegervRequest(ContextTag, Pname), cookie) - return GlxGetIntegervCookie{cookie} -} - -// Request reply for GlxGetIntegerv -// size: (32 + pad((int(N) * 4))) -type GlxGetIntegervReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetIntegerv -func (cook GlxGetIntegervCookie) Reply() (*GlxGetIntegervReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetIntegervReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetIntegerv -func glxGetIntegervReply(buf []byte) *GlxGetIntegervReply { - v := new(GlxGetIntegervReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetIntegervCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetIntegerv -func (c *Conn) glxGetIntegervRequest(ContextTag GlxContextTag, Pname uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 117 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetLightfv -// size: 16 -type GlxGetLightfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetLightfv(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetLightfvRequest(ContextTag, Light, Pname), cookie) - return GlxGetLightfvCookie{cookie} -} - -func (c *Conn) GlxGetLightfvUnchecked(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetLightfvRequest(ContextTag, Light, Pname), cookie) - return GlxGetLightfvCookie{cookie} -} - -// Request reply for GlxGetLightfv -// size: (32 + pad((int(N) * 4))) -type GlxGetLightfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetLightfv -func (cook GlxGetLightfvCookie) Reply() (*GlxGetLightfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetLightfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetLightfv -func glxGetLightfvReply(buf []byte) *GlxGetLightfvReply { - v := new(GlxGetLightfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetLightfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetLightfv -func (c *Conn) glxGetLightfvRequest(ContextTag GlxContextTag, Light uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 118 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Light) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetLightiv -// size: 16 -type GlxGetLightivCookie struct { - *cookie -} - -func (c *Conn) GlxGetLightiv(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetLightivRequest(ContextTag, Light, Pname), cookie) - return GlxGetLightivCookie{cookie} -} - -func (c *Conn) GlxGetLightivUnchecked(ContextTag GlxContextTag, Light uint32, Pname uint32) GlxGetLightivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetLightivRequest(ContextTag, Light, Pname), cookie) - return GlxGetLightivCookie{cookie} -} - -// Request reply for GlxGetLightiv -// size: (32 + pad((int(N) * 4))) -type GlxGetLightivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetLightiv -func (cook GlxGetLightivCookie) Reply() (*GlxGetLightivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetLightivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetLightiv -func glxGetLightivReply(buf []byte) *GlxGetLightivReply { - v := new(GlxGetLightivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetLightivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetLightiv -func (c *Conn) glxGetLightivRequest(ContextTag GlxContextTag, Light uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 119 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Light) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetMapdv -// size: 16 -type GlxGetMapdvCookie struct { - *cookie -} - -func (c *Conn) GlxGetMapdv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapdvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMapdvRequest(ContextTag, Target, Query), cookie) - return GlxGetMapdvCookie{cookie} -} - -func (c *Conn) GlxGetMapdvUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapdvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMapdvRequest(ContextTag, Target, Query), cookie) - return GlxGetMapdvCookie{cookie} -} - -// Request reply for GlxGetMapdv -// size: (32 + pad((int(N) * 8))) -type GlxGetMapdvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat64 - // padding: 8 bytes - Data []GlxFloat64 // size: pad((int(N) * 8)) -} - -// Waits and reads reply data from request GlxGetMapdv -func (cook GlxGetMapdvCookie) Reply() (*GlxGetMapdvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMapdvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMapdv -func glxGetMapdvReply(buf []byte) *GlxGetMapdvReply { - v := new(GlxGetMapdvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat64(Get64(buf[b:])) - b += 8 - - b += 8 // padding - - v.Data = make([]GlxFloat64, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat64(Get64(buf[b:])) - b += 8 - } - b = pad(b) - - return v -} - -func (cook GlxGetMapdvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMapdv -func (c *Conn) glxGetMapdvRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 120 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Query) - b += 4 - - return buf -} - -// Request GlxGetMapfv -// size: 16 -type GlxGetMapfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetMapfv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMapfvRequest(ContextTag, Target, Query), cookie) - return GlxGetMapfvCookie{cookie} -} - -func (c *Conn) GlxGetMapfvUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMapfvRequest(ContextTag, Target, Query), cookie) - return GlxGetMapfvCookie{cookie} -} - -// Request reply for GlxGetMapfv -// size: (32 + pad((int(N) * 4))) -type GlxGetMapfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMapfv -func (cook GlxGetMapfvCookie) Reply() (*GlxGetMapfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMapfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMapfv -func glxGetMapfvReply(buf []byte) *GlxGetMapfvReply { - v := new(GlxGetMapfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMapfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMapfv -func (c *Conn) glxGetMapfvRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 121 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Query) - b += 4 - - return buf -} - -// Request GlxGetMapiv -// size: 16 -type GlxGetMapivCookie struct { - *cookie -} - -func (c *Conn) GlxGetMapiv(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMapivRequest(ContextTag, Target, Query), cookie) - return GlxGetMapivCookie{cookie} -} - -func (c *Conn) GlxGetMapivUnchecked(ContextTag GlxContextTag, Target uint32, Query uint32) GlxGetMapivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMapivRequest(ContextTag, Target, Query), cookie) - return GlxGetMapivCookie{cookie} -} - -// Request reply for GlxGetMapiv -// size: (32 + pad((int(N) * 4))) -type GlxGetMapivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMapiv -func (cook GlxGetMapivCookie) Reply() (*GlxGetMapivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMapivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMapiv -func glxGetMapivReply(buf []byte) *GlxGetMapivReply { - v := new(GlxGetMapivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMapivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMapiv -func (c *Conn) glxGetMapivRequest(ContextTag GlxContextTag, Target uint32, Query uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 122 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Query) - b += 4 - - return buf -} - -// Request GlxGetMaterialfv -// size: 16 -type GlxGetMaterialfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetMaterialfv(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMaterialfvRequest(ContextTag, Face, Pname), cookie) - return GlxGetMaterialfvCookie{cookie} -} - -func (c *Conn) GlxGetMaterialfvUnchecked(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMaterialfvRequest(ContextTag, Face, Pname), cookie) - return GlxGetMaterialfvCookie{cookie} -} - -// Request reply for GlxGetMaterialfv -// size: (32 + pad((int(N) * 4))) -type GlxGetMaterialfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMaterialfv -func (cook GlxGetMaterialfvCookie) Reply() (*GlxGetMaterialfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMaterialfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMaterialfv -func glxGetMaterialfvReply(buf []byte) *GlxGetMaterialfvReply { - v := new(GlxGetMaterialfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMaterialfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMaterialfv -func (c *Conn) glxGetMaterialfvRequest(ContextTag GlxContextTag, Face uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 123 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Face) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetMaterialiv -// size: 16 -type GlxGetMaterialivCookie struct { - *cookie -} - -func (c *Conn) GlxGetMaterialiv(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMaterialivRequest(ContextTag, Face, Pname), cookie) - return GlxGetMaterialivCookie{cookie} -} - -func (c *Conn) GlxGetMaterialivUnchecked(ContextTag GlxContextTag, Face uint32, Pname uint32) GlxGetMaterialivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMaterialivRequest(ContextTag, Face, Pname), cookie) - return GlxGetMaterialivCookie{cookie} -} - -// Request reply for GlxGetMaterialiv -// size: (32 + pad((int(N) * 4))) -type GlxGetMaterialivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMaterialiv -func (cook GlxGetMaterialivCookie) Reply() (*GlxGetMaterialivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMaterialivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMaterialiv -func glxGetMaterialivReply(buf []byte) *GlxGetMaterialivReply { - v := new(GlxGetMaterialivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMaterialivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMaterialiv -func (c *Conn) glxGetMaterialivRequest(ContextTag GlxContextTag, Face uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 124 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Face) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetPixelMapfv -// size: 12 -type GlxGetPixelMapfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetPixelMapfv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetPixelMapfvRequest(ContextTag, Map), cookie) - return GlxGetPixelMapfvCookie{cookie} -} - -func (c *Conn) GlxGetPixelMapfvUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetPixelMapfvRequest(ContextTag, Map), cookie) - return GlxGetPixelMapfvCookie{cookie} -} - -// Request reply for GlxGetPixelMapfv -// size: (32 + pad((int(N) * 4))) -type GlxGetPixelMapfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetPixelMapfv -func (cook GlxGetPixelMapfvCookie) Reply() (*GlxGetPixelMapfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetPixelMapfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetPixelMapfv -func glxGetPixelMapfvReply(buf []byte) *GlxGetPixelMapfvReply { - v := new(GlxGetPixelMapfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetPixelMapfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetPixelMapfv -func (c *Conn) glxGetPixelMapfvRequest(ContextTag GlxContextTag, Map uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 125 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Map) - b += 4 - - return buf -} - -// Request GlxGetPixelMapuiv -// size: 12 -type GlxGetPixelMapuivCookie struct { - *cookie -} - -func (c *Conn) GlxGetPixelMapuiv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapuivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetPixelMapuivRequest(ContextTag, Map), cookie) - return GlxGetPixelMapuivCookie{cookie} -} - -func (c *Conn) GlxGetPixelMapuivUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapuivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetPixelMapuivRequest(ContextTag, Map), cookie) - return GlxGetPixelMapuivCookie{cookie} -} - -// Request reply for GlxGetPixelMapuiv -// size: (32 + pad((int(N) * 4))) -type GlxGetPixelMapuivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum uint32 - // padding: 12 bytes - Data []uint32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetPixelMapuiv -func (cook GlxGetPixelMapuivCookie) Reply() (*GlxGetPixelMapuivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetPixelMapuivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetPixelMapuiv -func glxGetPixelMapuivReply(buf []byte) *GlxGetPixelMapuivReply { - v := new(GlxGetPixelMapuivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]uint32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetPixelMapuivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetPixelMapuiv -func (c *Conn) glxGetPixelMapuivRequest(ContextTag GlxContextTag, Map uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 126 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Map) - b += 4 - - return buf -} - -// Request GlxGetPixelMapusv -// size: 12 -type GlxGetPixelMapusvCookie struct { - *cookie -} - -func (c *Conn) GlxGetPixelMapusv(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapusvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetPixelMapusvRequest(ContextTag, Map), cookie) - return GlxGetPixelMapusvCookie{cookie} -} - -func (c *Conn) GlxGetPixelMapusvUnchecked(ContextTag GlxContextTag, Map uint32) GlxGetPixelMapusvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetPixelMapusvRequest(ContextTag, Map), cookie) - return GlxGetPixelMapusvCookie{cookie} -} - -// Request reply for GlxGetPixelMapusv -// size: (34 + pad((int(N) * 2))) -type GlxGetPixelMapusvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum uint16 - // padding: 16 bytes - Data []uint16 // size: pad((int(N) * 2)) -} - -// Waits and reads reply data from request GlxGetPixelMapusv -func (cook GlxGetPixelMapusvCookie) Reply() (*GlxGetPixelMapusvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetPixelMapusvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetPixelMapusv -func glxGetPixelMapusvReply(buf []byte) *GlxGetPixelMapusvReply { - v := new(GlxGetPixelMapusvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = Get16(buf[b:]) - b += 2 - - b += 16 // padding - - v.Data = make([]uint16, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - return v -} - -func (cook GlxGetPixelMapusvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetPixelMapusv -func (c *Conn) glxGetPixelMapusvRequest(ContextTag GlxContextTag, Map uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 127 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Map) - b += 4 - - return buf -} - -// Request GlxGetPolygonStipple -// size: 12 -type GlxGetPolygonStippleCookie struct { - *cookie -} - -func (c *Conn) GlxGetPolygonStipple(ContextTag GlxContextTag, LsbFirst bool) GlxGetPolygonStippleCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetPolygonStippleRequest(ContextTag, LsbFirst), cookie) - return GlxGetPolygonStippleCookie{cookie} -} - -func (c *Conn) GlxGetPolygonStippleUnchecked(ContextTag GlxContextTag, LsbFirst bool) GlxGetPolygonStippleCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetPolygonStippleRequest(ContextTag, LsbFirst), cookie) - return GlxGetPolygonStippleCookie{cookie} -} - -// Request reply for GlxGetPolygonStipple -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetPolygonStippleReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetPolygonStipple -func (cook GlxGetPolygonStippleCookie) Reply() (*GlxGetPolygonStippleReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetPolygonStippleReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetPolygonStipple -func glxGetPolygonStippleReply(buf []byte) *GlxGetPolygonStippleReply { - v := new(GlxGetPolygonStippleReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetPolygonStippleCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetPolygonStipple -func (c *Conn) glxGetPolygonStippleRequest(ContextTag GlxContextTag, LsbFirst bool) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 128 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - if LsbFirst { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetString -// size: 12 -type GlxGetStringCookie struct { - *cookie -} - -func (c *Conn) GlxGetString(ContextTag GlxContextTag, Name uint32) GlxGetStringCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetStringRequest(ContextTag, Name), cookie) - return GlxGetStringCookie{cookie} -} - -func (c *Conn) GlxGetStringUnchecked(ContextTag GlxContextTag, Name uint32) GlxGetStringCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetStringRequest(ContextTag, Name), cookie) - return GlxGetStringCookie{cookie} -} - -// Request reply for GlxGetString -// size: (32 + pad((int(N) * 1))) -type GlxGetStringReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - // padding: 16 bytes - String string // size: pad((int(N) * 1)) -} - -// Waits and reads reply data from request GlxGetString -func (cook GlxGetStringCookie) Reply() (*GlxGetStringReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetStringReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetString -func glxGetStringReply(buf []byte) *GlxGetStringReply { - v := new(GlxGetStringReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - { - byteString := make([]byte, v.N) - copy(byteString[:v.N], buf[b:]) - v.String = string(byteString) - b += pad(int(v.N)) - } - - return v -} - -func (cook GlxGetStringCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetString -func (c *Conn) glxGetStringRequest(ContextTag GlxContextTag, Name uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 129 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Name) - b += 4 - - return buf -} - -// Request GlxGetTexEnvfv -// size: 16 -type GlxGetTexEnvfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexEnvfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexEnvfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexEnvfvCookie{cookie} -} - -func (c *Conn) GlxGetTexEnvfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexEnvfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexEnvfvCookie{cookie} -} - -// Request reply for GlxGetTexEnvfv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexEnvfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexEnvfv -func (cook GlxGetTexEnvfvCookie) Reply() (*GlxGetTexEnvfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexEnvfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexEnvfv -func glxGetTexEnvfvReply(buf []byte) *GlxGetTexEnvfvReply { - v := new(GlxGetTexEnvfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexEnvfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexEnvfv -func (c *Conn) glxGetTexEnvfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 130 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexEnviv -// size: 16 -type GlxGetTexEnvivCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexEnviv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexEnvivRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexEnvivCookie{cookie} -} - -func (c *Conn) GlxGetTexEnvivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexEnvivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexEnvivRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexEnvivCookie{cookie} -} - -// Request reply for GlxGetTexEnviv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexEnvivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexEnviv -func (cook GlxGetTexEnvivCookie) Reply() (*GlxGetTexEnvivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexEnvivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexEnviv -func glxGetTexEnvivReply(buf []byte) *GlxGetTexEnvivReply { - v := new(GlxGetTexEnvivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexEnvivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexEnviv -func (c *Conn) glxGetTexEnvivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 131 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexGendv -// size: 16 -type GlxGetTexGendvCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexGendv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGendvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexGendvRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGendvCookie{cookie} -} - -func (c *Conn) GlxGetTexGendvUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGendvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexGendvRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGendvCookie{cookie} -} - -// Request reply for GlxGetTexGendv -// size: (32 + pad((int(N) * 8))) -type GlxGetTexGendvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat64 - // padding: 8 bytes - Data []GlxFloat64 // size: pad((int(N) * 8)) -} - -// Waits and reads reply data from request GlxGetTexGendv -func (cook GlxGetTexGendvCookie) Reply() (*GlxGetTexGendvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexGendvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexGendv -func glxGetTexGendvReply(buf []byte) *GlxGetTexGendvReply { - v := new(GlxGetTexGendvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat64(Get64(buf[b:])) - b += 8 - - b += 8 // padding - - v.Data = make([]GlxFloat64, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat64(Get64(buf[b:])) - b += 8 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexGendvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexGendv -func (c *Conn) glxGetTexGendvRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 132 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Coord) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexGenfv -// size: 16 -type GlxGetTexGenfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexGenfv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexGenfvRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGenfvCookie{cookie} -} - -func (c *Conn) GlxGetTexGenfvUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexGenfvRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGenfvCookie{cookie} -} - -// Request reply for GlxGetTexGenfv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexGenfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexGenfv -func (cook GlxGetTexGenfvCookie) Reply() (*GlxGetTexGenfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexGenfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexGenfv -func glxGetTexGenfvReply(buf []byte) *GlxGetTexGenfvReply { - v := new(GlxGetTexGenfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexGenfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexGenfv -func (c *Conn) glxGetTexGenfvRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 133 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Coord) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexGeniv -// size: 16 -type GlxGetTexGenivCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexGeniv(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexGenivRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGenivCookie{cookie} -} - -func (c *Conn) GlxGetTexGenivUnchecked(ContextTag GlxContextTag, Coord uint32, Pname uint32) GlxGetTexGenivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexGenivRequest(ContextTag, Coord, Pname), cookie) - return GlxGetTexGenivCookie{cookie} -} - -// Request reply for GlxGetTexGeniv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexGenivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexGeniv -func (cook GlxGetTexGenivCookie) Reply() (*GlxGetTexGenivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexGenivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexGeniv -func glxGetTexGenivReply(buf []byte) *GlxGetTexGenivReply { - v := new(GlxGetTexGenivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexGenivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexGeniv -func (c *Conn) glxGetTexGenivRequest(ContextTag GlxContextTag, Coord uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 134 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Coord) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexImage -// size: 28 -type GlxGetTexImageCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexImage(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GlxGetTexImageCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexImageRequest(ContextTag, Target, Level, Format, Type, SwapBytes), cookie) - return GlxGetTexImageCookie{cookie} -} - -func (c *Conn) GlxGetTexImageUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GlxGetTexImageCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexImageRequest(ContextTag, Target, Level, Format, Type, SwapBytes), cookie) - return GlxGetTexImageCookie{cookie} -} - -// Request reply for GlxGetTexImage -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetTexImageReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - Width int32 - Height int32 - Depth int32 - // padding: 4 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetTexImage -func (cook GlxGetTexImageCookie) Reply() (*GlxGetTexImageReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexImageReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexImage -func glxGetTexImageReply(buf []byte) *GlxGetTexImageReply { - v := new(GlxGetTexImageReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(Get32(buf[b:])) - b += 4 - - v.Height = int32(Get32(buf[b:])) - b += 4 - - v.Depth = int32(Get32(buf[b:])) - b += 4 - - b += 4 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetTexImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexImage -func (c *Conn) glxGetTexImageRequest(ContextTag GlxContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 135 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], uint32(Level)) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetTexParameterfv -// size: 16 -type GlxGetTexParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetTexParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexParameterfvCookie{cookie} -} - -// Request reply for GlxGetTexParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexParameterfv -func (cook GlxGetTexParameterfvCookie) Reply() (*GlxGetTexParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexParameterfv -func glxGetTexParameterfvReply(buf []byte) *GlxGetTexParameterfvReply { - v := new(GlxGetTexParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexParameterfv -func (c *Conn) glxGetTexParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 136 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexParameteriv -// size: 16 -type GlxGetTexParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexParameterivCookie{cookie} -} - -func (c *Conn) GlxGetTexParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetTexParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetTexParameterivCookie{cookie} -} - -// Request reply for GlxGetTexParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexParameteriv -func (cook GlxGetTexParameterivCookie) Reply() (*GlxGetTexParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexParameteriv -func glxGetTexParameterivReply(buf []byte) *GlxGetTexParameterivReply { - v := new(GlxGetTexParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexParameteriv -func (c *Conn) glxGetTexParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 137 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexLevelParameterfv -// size: 20 -type GlxGetTexLevelParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexLevelParameterfv(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexLevelParameterfvRequest(ContextTag, Target, Level, Pname), cookie) - return GlxGetTexLevelParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetTexLevelParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexLevelParameterfvRequest(ContextTag, Target, Level, Pname), cookie) - return GlxGetTexLevelParameterfvCookie{cookie} -} - -// Request reply for GlxGetTexLevelParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexLevelParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexLevelParameterfv -func (cook GlxGetTexLevelParameterfvCookie) Reply() (*GlxGetTexLevelParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexLevelParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexLevelParameterfv -func glxGetTexLevelParameterfvReply(buf []byte) *GlxGetTexLevelParameterfvReply { - v := new(GlxGetTexLevelParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexLevelParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexLevelParameterfv -func (c *Conn) glxGetTexLevelParameterfvRequest(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 138 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], uint32(Level)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetTexLevelParameteriv -// size: 20 -type GlxGetTexLevelParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetTexLevelParameteriv(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetTexLevelParameterivRequest(ContextTag, Target, Level, Pname), cookie) - return GlxGetTexLevelParameterivCookie{cookie} -} - -func (c *Conn) GlxGetTexLevelParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) GlxGetTexLevelParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetTexLevelParameterivRequest(ContextTag, Target, Level, Pname), cookie) - return GlxGetTexLevelParameterivCookie{cookie} -} - -// Request reply for GlxGetTexLevelParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetTexLevelParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetTexLevelParameteriv -func (cook GlxGetTexLevelParameterivCookie) Reply() (*GlxGetTexLevelParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetTexLevelParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetTexLevelParameteriv -func glxGetTexLevelParameterivReply(buf []byte) *GlxGetTexLevelParameterivReply { - v := new(GlxGetTexLevelParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetTexLevelParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetTexLevelParameteriv -func (c *Conn) glxGetTexLevelParameterivRequest(ContextTag GlxContextTag, Target uint32, Level int32, Pname uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 139 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], uint32(Level)) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxIsList -// size: 12 -type GlxIsListCookie struct { - *cookie -} - -func (c *Conn) GlxIsList(ContextTag GlxContextTag, List uint32) GlxIsListCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxIsListRequest(ContextTag, List), cookie) - return GlxIsListCookie{cookie} -} - -func (c *Conn) GlxIsListUnchecked(ContextTag GlxContextTag, List uint32) GlxIsListCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxIsListRequest(ContextTag, List), cookie) - return GlxIsListCookie{cookie} -} - -// Request reply for GlxIsList -// size: 12 -type GlxIsListReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal GlxBool32 -} - -// Waits and reads reply data from request GlxIsList -func (cook GlxIsListCookie) Reply() (*GlxIsListReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxIsListReply(buf), nil -} - -// Read reply into structure from buffer for GlxIsList -func glxIsListReply(buf []byte) *GlxIsListReply { - v := new(GlxIsListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = GlxBool32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook GlxIsListCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxIsList -func (c *Conn) glxIsListRequest(ContextTag GlxContextTag, List uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 141 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], List) - b += 4 - - return buf -} - -// Request GlxFlush -// size: 8 -type GlxFlushCookie struct { - *cookie -} - -// Write request to wire for GlxFlush -func (c *Conn) GlxFlush(ContextTag GlxContextTag) GlxFlushCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxFlushRequest(ContextTag), cookie) - return GlxFlushCookie{cookie} -} - -func (c *Conn) GlxFlushChecked(ContextTag GlxContextTag) GlxFlushCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxFlushRequest(ContextTag), cookie) - return GlxFlushCookie{cookie} -} - -func (cook GlxFlushCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxFlush -func (c *Conn) glxFlushRequest(ContextTag GlxContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 142 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// Request GlxAreTexturesResident -// size: pad((12 + pad((int(N) * 4)))) -type GlxAreTexturesResidentCookie struct { - *cookie -} - -func (c *Conn) GlxAreTexturesResident(ContextTag GlxContextTag, N int32, Textures []uint32) GlxAreTexturesResidentCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxAreTexturesResidentRequest(ContextTag, N, Textures), cookie) - return GlxAreTexturesResidentCookie{cookie} -} - -func (c *Conn) GlxAreTexturesResidentUnchecked(ContextTag GlxContextTag, N int32, Textures []uint32) GlxAreTexturesResidentCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxAreTexturesResidentRequest(ContextTag, N, Textures), cookie) - return GlxAreTexturesResidentCookie{cookie} -} - -// Request reply for GlxAreTexturesResident -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxAreTexturesResidentReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal GlxBool32 - // padding: 20 bytes - Data []bool // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxAreTexturesResident -func (cook GlxAreTexturesResidentCookie) Reply() (*GlxAreTexturesResidentReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxAreTexturesResidentReply(buf), nil -} - -// Read reply into structure from buffer for GlxAreTexturesResident -func glxAreTexturesResidentReply(buf []byte) *GlxAreTexturesResidentReply { - v := new(GlxAreTexturesResidentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = GlxBool32(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - v.Data = make([]bool, (int(v.Length) * 4)) - for i := 0; i < int((int(v.Length) * 4)); i++ { - if buf[b] == 1 { - v.Data[i] = true - } else { - v.Data[i] = false - } - b += 1 - } - b = pad(b) - - return v -} - -func (cook GlxAreTexturesResidentCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxAreTexturesResident -func (c *Conn) glxAreTexturesResidentRequest(ContextTag GlxContextTag, N int32, Textures []uint32) []byte { - size := pad((12 + pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 143 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - Put32(buf[b:], Textures[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxDeleteTextures -// size: pad((12 + pad((int(N) * 4)))) -type GlxDeleteTexturesCookie struct { - *cookie -} - -// Write request to wire for GlxDeleteTextures -func (c *Conn) GlxDeleteTextures(ContextTag GlxContextTag, N int32, Textures []uint32) GlxDeleteTexturesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDeleteTexturesRequest(ContextTag, N, Textures), cookie) - return GlxDeleteTexturesCookie{cookie} -} - -func (c *Conn) GlxDeleteTexturesChecked(ContextTag GlxContextTag, N int32, Textures []uint32) GlxDeleteTexturesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDeleteTexturesRequest(ContextTag, N, Textures), cookie) - return GlxDeleteTexturesCookie{cookie} -} - -func (cook GlxDeleteTexturesCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDeleteTextures -func (c *Conn) glxDeleteTexturesRequest(ContextTag GlxContextTag, N int32, Textures []uint32) []byte { - size := pad((12 + pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 144 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - Put32(buf[b:], Textures[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxGenTextures -// size: 12 -type GlxGenTexturesCookie struct { - *cookie -} - -func (c *Conn) GlxGenTextures(ContextTag GlxContextTag, N int32) GlxGenTexturesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGenTexturesRequest(ContextTag, N), cookie) - return GlxGenTexturesCookie{cookie} -} - -func (c *Conn) GlxGenTexturesUnchecked(ContextTag GlxContextTag, N int32) GlxGenTexturesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGenTexturesRequest(ContextTag, N), cookie) - return GlxGenTexturesCookie{cookie} -} - -// Request reply for GlxGenTextures -// size: (32 + pad((int(Length) * 4))) -type GlxGenTexturesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request GlxGenTextures -func (cook GlxGenTexturesCookie) Reply() (*GlxGenTexturesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGenTexturesReply(buf), nil -} - -// Read reply into structure from buffer for GlxGenTextures -func glxGenTexturesReply(buf []byte) *GlxGenTexturesReply { - v := new(GlxGenTexturesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Data[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGenTexturesCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGenTextures -func (c *Conn) glxGenTexturesRequest(ContextTag GlxContextTag, N int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 145 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(N)) - b += 4 - - return buf -} - -// Request GlxIsTexture -// size: 12 -type GlxIsTextureCookie struct { - *cookie -} - -func (c *Conn) GlxIsTexture(ContextTag GlxContextTag, Texture uint32) GlxIsTextureCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxIsTextureRequest(ContextTag, Texture), cookie) - return GlxIsTextureCookie{cookie} -} - -func (c *Conn) GlxIsTextureUnchecked(ContextTag GlxContextTag, Texture uint32) GlxIsTextureCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxIsTextureRequest(ContextTag, Texture), cookie) - return GlxIsTextureCookie{cookie} -} - -// Request reply for GlxIsTexture -// size: 12 -type GlxIsTextureReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal GlxBool32 -} - -// Waits and reads reply data from request GlxIsTexture -func (cook GlxIsTextureCookie) Reply() (*GlxIsTextureReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxIsTextureReply(buf), nil -} - -// Read reply into structure from buffer for GlxIsTexture -func glxIsTextureReply(buf []byte) *GlxIsTextureReply { - v := new(GlxIsTextureReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = GlxBool32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook GlxIsTextureCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxIsTexture -func (c *Conn) glxIsTextureRequest(ContextTag GlxContextTag, Texture uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 146 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Texture) - b += 4 - - return buf -} - -// Request GlxGetColorTable -// size: 24 -type GlxGetColorTableCookie struct { - *cookie -} - -func (c *Conn) GlxGetColorTable(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetColorTableCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetColorTableRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetColorTableCookie{cookie} -} - -func (c *Conn) GlxGetColorTableUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetColorTableCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetColorTableRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetColorTableCookie{cookie} -} - -// Request reply for GlxGetColorTable -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetColorTableReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - Width int32 - // padding: 12 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetColorTable -func (cook GlxGetColorTableCookie) Reply() (*GlxGetColorTableReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetColorTableReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetColorTable -func glxGetColorTableReply(buf []byte) *GlxGetColorTableReply { - v := new(GlxGetColorTableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetColorTableCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetColorTable -func (c *Conn) glxGetColorTableRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 147 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetColorTableParameterfv -// size: 16 -type GlxGetColorTableParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetColorTableParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetColorTableParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetColorTableParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetColorTableParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetColorTableParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetColorTableParameterfvCookie{cookie} -} - -// Request reply for GlxGetColorTableParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetColorTableParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetColorTableParameterfv -func (cook GlxGetColorTableParameterfvCookie) Reply() (*GlxGetColorTableParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetColorTableParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetColorTableParameterfv -func glxGetColorTableParameterfvReply(buf []byte) *GlxGetColorTableParameterfvReply { - v := new(GlxGetColorTableParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetColorTableParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetColorTableParameterfv -func (c *Conn) glxGetColorTableParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 148 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetColorTableParameteriv -// size: 16 -type GlxGetColorTableParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetColorTableParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetColorTableParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetColorTableParameterivCookie{cookie} -} - -func (c *Conn) GlxGetColorTableParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetColorTableParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetColorTableParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetColorTableParameterivCookie{cookie} -} - -// Request reply for GlxGetColorTableParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetColorTableParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetColorTableParameteriv -func (cook GlxGetColorTableParameterivCookie) Reply() (*GlxGetColorTableParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetColorTableParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetColorTableParameteriv -func glxGetColorTableParameterivReply(buf []byte) *GlxGetColorTableParameterivReply { - v := new(GlxGetColorTableParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetColorTableParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetColorTableParameteriv -func (c *Conn) glxGetColorTableParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 149 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetConvolutionFilter -// size: 24 -type GlxGetConvolutionFilterCookie struct { - *cookie -} - -func (c *Conn) GlxGetConvolutionFilter(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetConvolutionFilterCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetConvolutionFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetConvolutionFilterCookie{cookie} -} - -func (c *Conn) GlxGetConvolutionFilterUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetConvolutionFilterCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetConvolutionFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetConvolutionFilterCookie{cookie} -} - -// Request reply for GlxGetConvolutionFilter -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetConvolutionFilterReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - Width int32 - Height int32 - // padding: 8 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetConvolutionFilter -func (cook GlxGetConvolutionFilterCookie) Reply() (*GlxGetConvolutionFilterReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetConvolutionFilterReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetConvolutionFilter -func glxGetConvolutionFilterReply(buf []byte) *GlxGetConvolutionFilterReply { - v := new(GlxGetConvolutionFilterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(Get32(buf[b:])) - b += 4 - - v.Height = int32(Get32(buf[b:])) - b += 4 - - b += 8 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetConvolutionFilterCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetConvolutionFilter -func (c *Conn) glxGetConvolutionFilterRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 150 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetConvolutionParameterfv -// size: 16 -type GlxGetConvolutionParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetConvolutionParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetConvolutionParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetConvolutionParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetConvolutionParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetConvolutionParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetConvolutionParameterfvCookie{cookie} -} - -// Request reply for GlxGetConvolutionParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetConvolutionParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetConvolutionParameterfv -func (cook GlxGetConvolutionParameterfvCookie) Reply() (*GlxGetConvolutionParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetConvolutionParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetConvolutionParameterfv -func glxGetConvolutionParameterfvReply(buf []byte) *GlxGetConvolutionParameterfvReply { - v := new(GlxGetConvolutionParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetConvolutionParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetConvolutionParameterfv -func (c *Conn) glxGetConvolutionParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 151 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetConvolutionParameteriv -// size: 16 -type GlxGetConvolutionParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetConvolutionParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetConvolutionParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetConvolutionParameterivCookie{cookie} -} - -func (c *Conn) GlxGetConvolutionParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetConvolutionParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetConvolutionParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetConvolutionParameterivCookie{cookie} -} - -// Request reply for GlxGetConvolutionParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetConvolutionParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetConvolutionParameteriv -func (cook GlxGetConvolutionParameterivCookie) Reply() (*GlxGetConvolutionParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetConvolutionParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetConvolutionParameteriv -func glxGetConvolutionParameterivReply(buf []byte) *GlxGetConvolutionParameterivReply { - v := new(GlxGetConvolutionParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetConvolutionParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetConvolutionParameteriv -func (c *Conn) glxGetConvolutionParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 152 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetSeparableFilter -// size: 24 -type GlxGetSeparableFilterCookie struct { - *cookie -} - -func (c *Conn) GlxGetSeparableFilter(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetSeparableFilterCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetSeparableFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetSeparableFilterCookie{cookie} -} - -func (c *Conn) GlxGetSeparableFilterUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GlxGetSeparableFilterCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetSeparableFilterRequest(ContextTag, Target, Format, Type, SwapBytes), cookie) - return GlxGetSeparableFilterCookie{cookie} -} - -// Request reply for GlxGetSeparableFilter -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetSeparableFilterReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - RowW int32 - ColH int32 - // padding: 8 bytes - RowsAndCols []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetSeparableFilter -func (cook GlxGetSeparableFilterCookie) Reply() (*GlxGetSeparableFilterReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetSeparableFilterReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetSeparableFilter -func glxGetSeparableFilterReply(buf []byte) *GlxGetSeparableFilterReply { - v := new(GlxGetSeparableFilterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.RowW = int32(Get32(buf[b:])) - b += 4 - - v.ColH = int32(Get32(buf[b:])) - b += 4 - - b += 8 // padding - - v.RowsAndCols = make([]byte, (int(v.Length) * 4)) - copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetSeparableFilterCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetSeparableFilter -func (c *Conn) glxGetSeparableFilterRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 153 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetHistogram -// size: 24 -type GlxGetHistogramCookie struct { - *cookie -} - -func (c *Conn) GlxGetHistogram(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetHistogramCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetHistogramRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GlxGetHistogramCookie{cookie} -} - -func (c *Conn) GlxGetHistogramUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetHistogramCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetHistogramRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GlxGetHistogramCookie{cookie} -} - -// Request reply for GlxGetHistogram -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetHistogramReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - Width int32 - // padding: 12 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetHistogram -func (cook GlxGetHistogramCookie) Reply() (*GlxGetHistogramReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetHistogramReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetHistogram -func glxGetHistogramReply(buf []byte) *GlxGetHistogramReply { - v := new(GlxGetHistogramReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetHistogramCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetHistogram -func (c *Conn) glxGetHistogramRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 154 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Reset { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetHistogramParameterfv -// size: 16 -type GlxGetHistogramParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetHistogramParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetHistogramParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetHistogramParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetHistogramParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetHistogramParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetHistogramParameterfvCookie{cookie} -} - -// Request reply for GlxGetHistogramParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetHistogramParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetHistogramParameterfv -func (cook GlxGetHistogramParameterfvCookie) Reply() (*GlxGetHistogramParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetHistogramParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetHistogramParameterfv -func glxGetHistogramParameterfvReply(buf []byte) *GlxGetHistogramParameterfvReply { - v := new(GlxGetHistogramParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetHistogramParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetHistogramParameterfv -func (c *Conn) glxGetHistogramParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 155 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetHistogramParameteriv -// size: 16 -type GlxGetHistogramParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetHistogramParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetHistogramParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetHistogramParameterivCookie{cookie} -} - -func (c *Conn) GlxGetHistogramParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetHistogramParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetHistogramParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetHistogramParameterivCookie{cookie} -} - -// Request reply for GlxGetHistogramParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetHistogramParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetHistogramParameteriv -func (cook GlxGetHistogramParameterivCookie) Reply() (*GlxGetHistogramParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetHistogramParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetHistogramParameteriv -func glxGetHistogramParameterivReply(buf []byte) *GlxGetHistogramParameterivReply { - v := new(GlxGetHistogramParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetHistogramParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetHistogramParameteriv -func (c *Conn) glxGetHistogramParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 156 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetMinmax -// size: 24 -type GlxGetMinmaxCookie struct { - *cookie -} - -func (c *Conn) GlxGetMinmax(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetMinmaxCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMinmaxRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GlxGetMinmaxCookie{cookie} -} - -func (c *Conn) GlxGetMinmaxUnchecked(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GlxGetMinmaxCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMinmaxRequest(ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GlxGetMinmaxCookie{cookie} -} - -// Request reply for GlxGetMinmax -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetMinmaxReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetMinmax -func (cook GlxGetMinmaxCookie) Reply() (*GlxGetMinmaxReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMinmaxReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMinmax -func glxGetMinmaxReply(buf []byte) *GlxGetMinmaxReply { - v := new(GlxGetMinmaxReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetMinmaxCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMinmax -func (c *Conn) glxGetMinmaxRequest(ContextTag GlxContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 157 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Format) - b += 4 - - Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Reset { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request GlxGetMinmaxParameterfv -// size: 16 -type GlxGetMinmaxParameterfvCookie struct { - *cookie -} - -func (c *Conn) GlxGetMinmaxParameterfv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterfvCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMinmaxParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetMinmaxParameterfvCookie{cookie} -} - -func (c *Conn) GlxGetMinmaxParameterfvUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterfvCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMinmaxParameterfvRequest(ContextTag, Target, Pname), cookie) - return GlxGetMinmaxParameterfvCookie{cookie} -} - -// Request reply for GlxGetMinmaxParameterfv -// size: (32 + pad((int(N) * 4))) -type GlxGetMinmaxParameterfvReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum GlxFloat32 - // padding: 12 bytes - Data []GlxFloat32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMinmaxParameterfv -func (cook GlxGetMinmaxParameterfvCookie) Reply() (*GlxGetMinmaxParameterfvReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMinmaxParameterfvReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMinmaxParameterfv -func glxGetMinmaxParameterfvReply(buf []byte) *GlxGetMinmaxParameterfvReply { - v := new(GlxGetMinmaxParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = GlxFloat32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]GlxFloat32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = GlxFloat32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMinmaxParameterfvCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMinmaxParameterfv -func (c *Conn) glxGetMinmaxParameterfvRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 158 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetMinmaxParameteriv -// size: 16 -type GlxGetMinmaxParameterivCookie struct { - *cookie -} - -func (c *Conn) GlxGetMinmaxParameteriv(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterivCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetMinmaxParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetMinmaxParameterivCookie{cookie} -} - -func (c *Conn) GlxGetMinmaxParameterivUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetMinmaxParameterivCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetMinmaxParameterivRequest(ContextTag, Target, Pname), cookie) - return GlxGetMinmaxParameterivCookie{cookie} -} - -// Request reply for GlxGetMinmaxParameteriv -// size: (32 + pad((int(N) * 4))) -type GlxGetMinmaxParameterivReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetMinmaxParameteriv -func (cook GlxGetMinmaxParameterivCookie) Reply() (*GlxGetMinmaxParameterivReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetMinmaxParameterivReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetMinmaxParameteriv -func glxGetMinmaxParameterivReply(buf []byte) *GlxGetMinmaxParameterivReply { - v := new(GlxGetMinmaxParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetMinmaxParameterivCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetMinmaxParameteriv -func (c *Conn) glxGetMinmaxParameterivRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 159 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetCompressedTexImageARB -// size: 16 -type GlxGetCompressedTexImageARBCookie struct { - *cookie -} - -func (c *Conn) GlxGetCompressedTexImageARB(ContextTag GlxContextTag, Target uint32, Level int32) GlxGetCompressedTexImageARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetCompressedTexImageARBRequest(ContextTag, Target, Level), cookie) - return GlxGetCompressedTexImageARBCookie{cookie} -} - -func (c *Conn) GlxGetCompressedTexImageARBUnchecked(ContextTag GlxContextTag, Target uint32, Level int32) GlxGetCompressedTexImageARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetCompressedTexImageARBRequest(ContextTag, Target, Level), cookie) - return GlxGetCompressedTexImageARBCookie{cookie} -} - -// Request reply for GlxGetCompressedTexImageARB -// size: (32 + pad(((int(Length) * 4) * 1))) -type GlxGetCompressedTexImageARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 8 bytes - Size int32 - // padding: 12 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request GlxGetCompressedTexImageARB -func (cook GlxGetCompressedTexImageARBCookie) Reply() (*GlxGetCompressedTexImageARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetCompressedTexImageARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetCompressedTexImageARB -func glxGetCompressedTexImageARBReply(buf []byte) *GlxGetCompressedTexImageARBReply { - v := new(GlxGetCompressedTexImageARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Size = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook GlxGetCompressedTexImageARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetCompressedTexImageARB -func (c *Conn) glxGetCompressedTexImageARBRequest(ContextTag GlxContextTag, Target uint32, Level int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 160 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], uint32(Level)) - b += 4 - - return buf -} - -// Request GlxDeleteQueriesARB -// size: pad((12 + pad((int(N) * 4)))) -type GlxDeleteQueriesARBCookie struct { - *cookie -} - -// Write request to wire for GlxDeleteQueriesARB -func (c *Conn) GlxDeleteQueriesARB(ContextTag GlxContextTag, N int32, Ids []uint32) GlxDeleteQueriesARBCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.glxDeleteQueriesARBRequest(ContextTag, N, Ids), cookie) - return GlxDeleteQueriesARBCookie{cookie} -} - -func (c *Conn) GlxDeleteQueriesARBChecked(ContextTag GlxContextTag, N int32, Ids []uint32) GlxDeleteQueriesARBCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.glxDeleteQueriesARBRequest(ContextTag, N, Ids), cookie) - return GlxDeleteQueriesARBCookie{cookie} -} - -func (cook GlxDeleteQueriesARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxDeleteQueriesARB -func (c *Conn) glxDeleteQueriesARBRequest(ContextTag GlxContextTag, N int32, Ids []uint32) []byte { - size := pad((12 + pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 161 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - Put32(buf[b:], Ids[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request GlxGenQueriesARB -// size: 12 -type GlxGenQueriesARBCookie struct { - *cookie -} - -func (c *Conn) GlxGenQueriesARB(ContextTag GlxContextTag, N int32) GlxGenQueriesARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGenQueriesARBRequest(ContextTag, N), cookie) - return GlxGenQueriesARBCookie{cookie} -} - -func (c *Conn) GlxGenQueriesARBUnchecked(ContextTag GlxContextTag, N int32) GlxGenQueriesARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGenQueriesARBRequest(ContextTag, N), cookie) - return GlxGenQueriesARBCookie{cookie} -} - -// Request reply for GlxGenQueriesARB -// size: (32 + pad((int(Length) * 4))) -type GlxGenQueriesARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - Data []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request GlxGenQueriesARB -func (cook GlxGenQueriesARBCookie) Reply() (*GlxGenQueriesARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGenQueriesARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxGenQueriesARB -func glxGenQueriesARBReply(buf []byte) *GlxGenQueriesARBReply { - v := new(GlxGenQueriesARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Data[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGenQueriesARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGenQueriesARB -func (c *Conn) glxGenQueriesARBRequest(ContextTag GlxContextTag, N int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 162 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], uint32(N)) - b += 4 - - return buf -} - -// Request GlxIsQueryARB -// size: 12 -type GlxIsQueryARBCookie struct { - *cookie -} - -func (c *Conn) GlxIsQueryARB(ContextTag GlxContextTag, Id uint32) GlxIsQueryARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxIsQueryARBRequest(ContextTag, Id), cookie) - return GlxIsQueryARBCookie{cookie} -} - -func (c *Conn) GlxIsQueryARBUnchecked(ContextTag GlxContextTag, Id uint32) GlxIsQueryARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxIsQueryARBRequest(ContextTag, Id), cookie) - return GlxIsQueryARBCookie{cookie} -} - -// Request reply for GlxIsQueryARB -// size: 12 -type GlxIsQueryARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - RetVal GlxBool32 -} - -// Waits and reads reply data from request GlxIsQueryARB -func (cook GlxIsQueryARBCookie) Reply() (*GlxIsQueryARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxIsQueryARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxIsQueryARB -func glxIsQueryARBReply(buf []byte) *GlxIsQueryARBReply { - v := new(GlxIsQueryARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = GlxBool32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook GlxIsQueryARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxIsQueryARB -func (c *Conn) glxIsQueryARBRequest(ContextTag GlxContextTag, Id uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 163 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - return buf -} - -// Request GlxGetQueryivARB -// size: 16 -type GlxGetQueryivARBCookie struct { - *cookie -} - -func (c *Conn) GlxGetQueryivARB(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetQueryivARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetQueryivARBRequest(ContextTag, Target, Pname), cookie) - return GlxGetQueryivARBCookie{cookie} -} - -func (c *Conn) GlxGetQueryivARBUnchecked(ContextTag GlxContextTag, Target uint32, Pname uint32) GlxGetQueryivARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetQueryivARBRequest(ContextTag, Target, Pname), cookie) - return GlxGetQueryivARBCookie{cookie} -} - -// Request reply for GlxGetQueryivARB -// size: (32 + pad((int(N) * 4))) -type GlxGetQueryivARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetQueryivARB -func (cook GlxGetQueryivARBCookie) Reply() (*GlxGetQueryivARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetQueryivARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetQueryivARB -func glxGetQueryivARBReply(buf []byte) *GlxGetQueryivARBReply { - v := new(GlxGetQueryivARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetQueryivARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetQueryivARB -func (c *Conn) glxGetQueryivARBRequest(ContextTag GlxContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 164 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Target) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetQueryObjectivARB -// size: 16 -type GlxGetQueryObjectivARBCookie struct { - *cookie -} - -func (c *Conn) GlxGetQueryObjectivARB(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectivARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetQueryObjectivARBRequest(ContextTag, Id, Pname), cookie) - return GlxGetQueryObjectivARBCookie{cookie} -} - -func (c *Conn) GlxGetQueryObjectivARBUnchecked(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectivARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetQueryObjectivARBRequest(ContextTag, Id, Pname), cookie) - return GlxGetQueryObjectivARBCookie{cookie} -} - -// Request reply for GlxGetQueryObjectivARB -// size: (32 + pad((int(N) * 4))) -type GlxGetQueryObjectivARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetQueryObjectivARB -func (cook GlxGetQueryObjectivARBCookie) Reply() (*GlxGetQueryObjectivARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetQueryObjectivARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetQueryObjectivARB -func glxGetQueryObjectivARBReply(buf []byte) *GlxGetQueryObjectivARBReply { - v := new(GlxGetQueryObjectivARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = int32(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetQueryObjectivARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetQueryObjectivARB -func (c *Conn) glxGetQueryObjectivARBRequest(ContextTag GlxContextTag, Id uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 165 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// Request GlxGetQueryObjectuivARB -// size: 16 -type GlxGetQueryObjectuivARBCookie struct { - *cookie -} - -func (c *Conn) GlxGetQueryObjectuivARB(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectuivARBCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.glxGetQueryObjectuivARBRequest(ContextTag, Id, Pname), cookie) - return GlxGetQueryObjectuivARBCookie{cookie} -} - -func (c *Conn) GlxGetQueryObjectuivARBUnchecked(ContextTag GlxContextTag, Id uint32, Pname uint32) GlxGetQueryObjectuivARBCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.glxGetQueryObjectuivARBRequest(ContextTag, Id, Pname), cookie) - return GlxGetQueryObjectuivARBCookie{cookie} -} - -// Request reply for GlxGetQueryObjectuivARB -// size: (32 + pad((int(N) * 4))) -type GlxGetQueryObjectuivARBReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum uint32 - // padding: 12 bytes - Data []uint32 // size: pad((int(N) * 4)) -} - -// Waits and reads reply data from request GlxGetQueryObjectuivARB -func (cook GlxGetQueryObjectuivARBCookie) Reply() (*GlxGetQueryObjectuivARBReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return glxGetQueryObjectuivARBReply(buf), nil -} - -// Read reply into structure from buffer for GlxGetQueryObjectuivARB -func glxGetQueryObjectuivARBReply(buf []byte) *GlxGetQueryObjectuivARBReply { - v := new(GlxGetQueryObjectuivARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = Get32(buf[b:]) - b += 4 - - v.Datum = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]uint32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook GlxGetQueryObjectuivARBCookie) Check() error { - return cook.check() -} - -// Write request to wire for GlxGetQueryObjectuivARB -func (c *Conn) glxGetQueryObjectuivARBRequest(ContextTag GlxContextTag, Id uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["GLX"] - b += 1 - - buf[b] = 166 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextTag)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - Put32(buf[b:], Pname) - b += 4 - - return buf -} diff --git a/nexgb/auto_randr.go b/nexgb/auto_randr.go deleted file mode 100644 index d7e68bd..0000000 --- a/nexgb/auto_randr.go +++ /dev/null @@ -1,4038 +0,0 @@ -package xgb - -/* - This file was generated by randr.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" -// import "render" - -// RandrInit must be called before using the RANDR extension. -func (c *Conn) RandrInit() error { - reply, err := c.QueryExtension(5, "RANDR").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named RANDR could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["RANDR"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["RANDR"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["RANDR"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["RANDR"] = make(map[int]newEventFun) - newExtErrorFuncs["RANDR"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -const ( - RandrRotationRotate0 = 1 - RandrRotationRotate90 = 2 - RandrRotationRotate180 = 4 - RandrRotationRotate270 = 8 - RandrRotationReflectX = 16 - RandrRotationReflectY = 32 -) - -const ( - RandrSetConfigSuccess = 0 - RandrSetConfigInvalidConfigTime = 1 - RandrSetConfigInvalidTime = 2 - RandrSetConfigFailed = 3 -) - -const ( - RandrNotifyMaskScreenChange = 1 - RandrNotifyMaskCrtcChange = 2 - RandrNotifyMaskOutputChange = 4 - RandrNotifyMaskOutputProperty = 8 -) - -const ( - RandrModeFlagHsyncPositive = 1 - RandrModeFlagHsyncNegative = 2 - RandrModeFlagVsyncPositive = 4 - RandrModeFlagVsyncNegative = 8 - RandrModeFlagInterlace = 16 - RandrModeFlagDoubleScan = 32 - RandrModeFlagCsync = 64 - RandrModeFlagCsyncPositive = 128 - RandrModeFlagCsyncNegative = 256 - RandrModeFlagHskewPresent = 512 - RandrModeFlagBcast = 1024 - RandrModeFlagPixelMultiplex = 2048 - RandrModeFlagDoubleClock = 4096 - RandrModeFlagHalveClock = 8192 -) - -const ( - RandrConnectionConnected = 0 - RandrConnectionDisconnected = 1 - RandrConnectionUnknown = 2 -) - -const ( - RandrNotifyCrtcChange = 0 - RandrNotifyOutputChange = 1 - RandrNotifyOutputProperty = 2 -) - -type RandrMode uint32 - -func (c *Conn) NewRandrModeId() (RandrMode, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RandrMode(id), nil -} - -type RandrCrtc uint32 - -func (c *Conn) NewRandrCrtcId() (RandrCrtc, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RandrCrtc(id), nil -} - -type RandrOutput uint32 - -func (c *Conn) NewRandrOutputId() (RandrOutput, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RandrOutput(id), nil -} - -// 'RandrScreenSize' struct definition -// Size: 8 -type RandrScreenSize struct { - Width uint16 - Height uint16 - Mwidth uint16 - Mheight uint16 -} - -// Struct read RandrScreenSize -func ReadRandrScreenSize(buf []byte, v *RandrScreenSize) int { - b := 0 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Mwidth = Get16(buf[b:]) - b += 2 - - v.Mheight = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RandrScreenSize -func ReadRandrScreenSizeList(buf []byte, dest []RandrScreenSize) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrScreenSize{} - b += ReadRandrScreenSize(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrScreenSize -func (v RandrScreenSize) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put16(buf[b:], v.Mwidth) - b += 2 - - Put16(buf[b:], v.Mheight) - b += 2 - - return buf -} - -// Write struct list RandrScreenSize -func RandrScreenSizeListBytes(buf []byte, list []RandrScreenSize) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RandrRefreshRates' struct definition -// Size: (2 + pad((int(NRates) * 2))) -type RandrRefreshRates struct { - NRates uint16 - Rates []uint16 // size: pad((int(NRates) * 2)) -} - -// Struct read RandrRefreshRates -func ReadRandrRefreshRates(buf []byte, v *RandrRefreshRates) int { - b := 0 - - v.NRates = Get16(buf[b:]) - b += 2 - - v.Rates = make([]uint16, v.NRates) - for i := 0; i < int(v.NRates); i++ { - v.Rates[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - return b -} - -// Struct list read RandrRefreshRates -func ReadRandrRefreshRatesList(buf []byte, dest []RandrRefreshRates) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrRefreshRates{} - b += ReadRandrRefreshRates(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrRefreshRates -func (v RandrRefreshRates) Bytes() []byte { - buf := make([]byte, (2 + pad((int(v.NRates) * 2)))) - b := 0 - - Put16(buf[b:], v.NRates) - b += 2 - - for i := 0; i < int(v.NRates); i++ { - Put16(buf[b:], v.Rates[i]) - b += 2 - } - b = pad(b) - - return buf -} - -// Write struct list RandrRefreshRates -func RandrRefreshRatesListBytes(buf []byte, list []RandrRefreshRates) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size RandrRefreshRates -func RandrRefreshRatesListSize(list []RandrRefreshRates) int { - size := 0 - for _, item := range list { - size += (2 + pad((int(item.NRates) * 2))) - } - return size -} - -// 'RandrModeInfo' struct definition -// Size: 32 -type RandrModeInfo struct { - Id uint32 - Width uint16 - Height uint16 - DotClock uint32 - HsyncStart uint16 - HsyncEnd uint16 - Htotal uint16 - Hskew uint16 - VsyncStart uint16 - VsyncEnd uint16 - Vtotal uint16 - NameLen uint16 - ModeFlags uint32 -} - -// Struct read RandrModeInfo -func ReadRandrModeInfo(buf []byte, v *RandrModeInfo) int { - b := 0 - - v.Id = Get32(buf[b:]) - b += 4 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.DotClock = Get32(buf[b:]) - b += 4 - - v.HsyncStart = Get16(buf[b:]) - b += 2 - - v.HsyncEnd = Get16(buf[b:]) - b += 2 - - v.Htotal = Get16(buf[b:]) - b += 2 - - v.Hskew = Get16(buf[b:]) - b += 2 - - v.VsyncStart = Get16(buf[b:]) - b += 2 - - v.VsyncEnd = Get16(buf[b:]) - b += 2 - - v.Vtotal = Get16(buf[b:]) - b += 2 - - v.NameLen = Get16(buf[b:]) - b += 2 - - v.ModeFlags = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read RandrModeInfo -func ReadRandrModeInfoList(buf []byte, dest []RandrModeInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrModeInfo{} - b += ReadRandrModeInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrModeInfo -func (v RandrModeInfo) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - Put32(buf[b:], v.Id) - b += 4 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put32(buf[b:], v.DotClock) - b += 4 - - Put16(buf[b:], v.HsyncStart) - b += 2 - - Put16(buf[b:], v.HsyncEnd) - b += 2 - - Put16(buf[b:], v.Htotal) - b += 2 - - Put16(buf[b:], v.Hskew) - b += 2 - - Put16(buf[b:], v.VsyncStart) - b += 2 - - Put16(buf[b:], v.VsyncEnd) - b += 2 - - Put16(buf[b:], v.Vtotal) - b += 2 - - Put16(buf[b:], v.NameLen) - b += 2 - - Put32(buf[b:], v.ModeFlags) - b += 4 - - return buf -} - -// Write struct list RandrModeInfo -func RandrModeInfoListBytes(buf []byte, list []RandrModeInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RandrCrtcChange' struct definition -// Size: 28 -type RandrCrtcChange struct { - Timestamp Timestamp - Window Window - Crtc RandrCrtc - Mode RandrMode - Rotation uint16 - // padding: 2 bytes - X int16 - Y int16 - Width uint16 - Height uint16 -} - -// Struct read RandrCrtcChange -func ReadRandrCrtcChange(buf []byte, v *RandrCrtcChange) int { - b := 0 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Crtc = RandrCrtc(Get32(buf[b:])) - b += 4 - - v.Mode = RandrMode(Get32(buf[b:])) - b += 4 - - v.Rotation = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.X = int16(Get16(buf[b:])) - b += 2 - - v.Y = int16(Get16(buf[b:])) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RandrCrtcChange -func ReadRandrCrtcChangeList(buf []byte, dest []RandrCrtcChange) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrCrtcChange{} - b += ReadRandrCrtcChange(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrCrtcChange -func (v RandrCrtcChange) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - Put32(buf[b:], uint32(v.Crtc)) - b += 4 - - Put32(buf[b:], uint32(v.Mode)) - b += 4 - - Put16(buf[b:], v.Rotation) - b += 2 - - b += 2 // padding - - Put16(buf[b:], uint16(v.X)) - b += 2 - - Put16(buf[b:], uint16(v.Y)) - b += 2 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - return buf -} - -// Write struct list RandrCrtcChange -func RandrCrtcChangeListBytes(buf []byte, list []RandrCrtcChange) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RandrOutputChange' struct definition -// Size: 28 -type RandrOutputChange struct { - Timestamp Timestamp - ConfigTimestamp Timestamp - Window Window - Output RandrOutput - Crtc RandrCrtc - Mode RandrMode - Rotation uint16 - Connection byte - SubpixelOrder byte -} - -// Struct read RandrOutputChange -func ReadRandrOutputChange(buf []byte, v *RandrOutputChange) int { - b := 0 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Output = RandrOutput(Get32(buf[b:])) - b += 4 - - v.Crtc = RandrCrtc(Get32(buf[b:])) - b += 4 - - v.Mode = RandrMode(Get32(buf[b:])) - b += 4 - - v.Rotation = Get16(buf[b:]) - b += 2 - - v.Connection = buf[b] - b += 1 - - v.SubpixelOrder = buf[b] - b += 1 - - return b -} - -// Struct list read RandrOutputChange -func ReadRandrOutputChangeList(buf []byte, dest []RandrOutputChange) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrOutputChange{} - b += ReadRandrOutputChange(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrOutputChange -func (v RandrOutputChange) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put32(buf[b:], uint32(v.ConfigTimestamp)) - b += 4 - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - Put32(buf[b:], uint32(v.Output)) - b += 4 - - Put32(buf[b:], uint32(v.Crtc)) - b += 4 - - Put32(buf[b:], uint32(v.Mode)) - b += 4 - - Put16(buf[b:], v.Rotation) - b += 2 - - buf[b] = v.Connection - b += 1 - - buf[b] = v.SubpixelOrder - b += 1 - - return buf -} - -// Write struct list RandrOutputChange -func RandrOutputChangeListBytes(buf []byte, list []RandrOutputChange) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RandrOutputProperty' struct definition -// Size: 28 -type RandrOutputProperty struct { - Window Window - Output RandrOutput - Atom Atom - Timestamp Timestamp - Status byte - // padding: 11 bytes -} - -// Struct read RandrOutputProperty -func ReadRandrOutputProperty(buf []byte, v *RandrOutputProperty) int { - b := 0 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Output = RandrOutput(Get32(buf[b:])) - b += 4 - - v.Atom = Atom(Get32(buf[b:])) - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Status = buf[b] - b += 1 - - b += 11 // padding - - return b -} - -// Struct list read RandrOutputProperty -func ReadRandrOutputPropertyList(buf []byte, dest []RandrOutputProperty) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrOutputProperty{} - b += ReadRandrOutputProperty(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RandrOutputProperty -func (v RandrOutputProperty) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - Put32(buf[b:], uint32(v.Output)) - b += 4 - - Put32(buf[b:], uint32(v.Atom)) - b += 4 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - buf[b] = v.Status - b += 1 - - b += 11 // padding - - return buf -} - -// Write struct list RandrOutputProperty -func RandrOutputPropertyListBytes(buf []byte, list []RandrOutputProperty) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Union definition RandrNotifyDataUnion -// Note that to *create* a Union, you should *never* create -// this struct directly (unless you know what you're doing). -// Instead use one of the following constructors for 'RandrNotifyDataUnion': -// NewRandrNotifyDataUnionCc(Cc RandrCrtcChange) RandrNotifyDataUnion -// NewRandrNotifyDataUnionOc(Oc RandrOutputChange) RandrNotifyDataUnion -// NewRandrNotifyDataUnionOp(Op RandrOutputProperty) RandrNotifyDataUnion -type RandrNotifyDataUnion struct { - Cc RandrCrtcChange - Oc RandrOutputChange - Op RandrOutputProperty -} - -// Union constructor for RandrNotifyDataUnion for field Cc. -func NewRandrNotifyDataUnionCc(Cc RandrCrtcChange) RandrNotifyDataUnion { - var b int - buf := make([]byte, 28) - - { - structBytes := Cc.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - // Create the Union type - v := RandrNotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = RandrCrtcChange{} - b += ReadRandrCrtcChange(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = RandrOutputChange{} - b += ReadRandrOutputChange(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = RandrOutputProperty{} - b += ReadRandrOutputProperty(buf[b:], &v.Op) - - return v -} - -// Union constructor for RandrNotifyDataUnion for field Oc. -func NewRandrNotifyDataUnionOc(Oc RandrOutputChange) RandrNotifyDataUnion { - var b int - buf := make([]byte, 28) - - { - structBytes := Oc.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - // Create the Union type - v := RandrNotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = RandrCrtcChange{} - b += ReadRandrCrtcChange(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = RandrOutputChange{} - b += ReadRandrOutputChange(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = RandrOutputProperty{} - b += ReadRandrOutputProperty(buf[b:], &v.Op) - - return v -} - -// Union constructor for RandrNotifyDataUnion for field Op. -func NewRandrNotifyDataUnionOp(Op RandrOutputProperty) RandrNotifyDataUnion { - var b int - buf := make([]byte, 28) - - { - structBytes := Op.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - // Create the Union type - v := RandrNotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = RandrCrtcChange{} - b += ReadRandrCrtcChange(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = RandrOutputChange{} - b += ReadRandrOutputChange(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = RandrOutputProperty{} - b += ReadRandrOutputProperty(buf[b:], &v.Op) - - return v -} - -// Union read RandrNotifyDataUnion -func ReadRandrNotifyDataUnion(buf []byte, v *RandrNotifyDataUnion) int { - var b int - - b = 0 // re-read the same bytes - v.Cc = RandrCrtcChange{} - b += ReadRandrCrtcChange(buf[b:], &v.Cc) - - b = 0 // re-read the same bytes - v.Oc = RandrOutputChange{} - b += ReadRandrOutputChange(buf[b:], &v.Oc) - - b = 0 // re-read the same bytes - v.Op = RandrOutputProperty{} - b += ReadRandrOutputProperty(buf[b:], &v.Op) - - return 28 -} - -// Union list read RandrNotifyDataUnion -func ReadRandrNotifyDataUnionList(buf []byte, dest []RandrNotifyDataUnion) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RandrNotifyDataUnion{} - b += ReadRandrNotifyDataUnion(buf[b:], &dest[i]) - } - return pad(b) -} - -// Union write RandrNotifyDataUnion -// Each field in a union must contain the same data. -// So simply pick the first field and write that to the wire. -func (v RandrNotifyDataUnion) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - { - structBytes := v.Cc.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return buf -} - -// Union list write RandrNotifyDataUnion -func RandrNotifyDataUnionListBytes(buf []byte, list []RandrNotifyDataUnion) int { - b := 0 - var unionBytes []byte - for _, item := range list { - unionBytes = item.Bytes() - copy(buf[b:], unionBytes) - b += pad(len(unionBytes)) - } - return b -} - -// Event definition RandrScreenChangeNotify (0) -// Size: 32 - -const RandrScreenChangeNotify = 0 - -type RandrScreenChangeNotifyEvent struct { - Sequence uint16 - Rotation byte - Timestamp Timestamp - ConfigTimestamp Timestamp - Root Window - RequestWindow Window - SizeID uint16 - SubpixelOrder uint16 - Width uint16 - Height uint16 - Mwidth uint16 - Mheight uint16 -} - -// Event read RandrScreenChangeNotify -func NewRandrScreenChangeNotifyEvent(buf []byte) Event { - v := RandrScreenChangeNotifyEvent{} - b := 1 // don't read event number - - v.Rotation = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - v.RequestWindow = Window(Get32(buf[b:])) - b += 4 - - v.SizeID = Get16(buf[b:]) - b += 2 - - v.SubpixelOrder = Get16(buf[b:]) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Mwidth = Get16(buf[b:]) - b += 2 - - v.Mheight = Get16(buf[b:]) - b += 2 - - return v -} - -// Event write RandrScreenChangeNotify -func (v RandrScreenChangeNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Rotation - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put32(buf[b:], uint32(v.ConfigTimestamp)) - b += 4 - - Put32(buf[b:], uint32(v.Root)) - b += 4 - - Put32(buf[b:], uint32(v.RequestWindow)) - b += 4 - - Put16(buf[b:], v.SizeID) - b += 2 - - Put16(buf[b:], v.SubpixelOrder) - b += 2 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put16(buf[b:], v.Mwidth) - b += 2 - - Put16(buf[b:], v.Mheight) - b += 2 - - return buf -} - -func (v RandrScreenChangeNotifyEvent) ImplementsEvent() {} - -func (v RandrScreenChangeNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v RandrScreenChangeNotifyEvent) String() string { - fieldVals := make([]string, 0, 11) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Rotation: %d", v.Rotation)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, sprintf("ConfigTimestamp: %d", v.ConfigTimestamp)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("RequestWindow: %d", v.RequestWindow)) - fieldVals = append(fieldVals, sprintf("SizeID: %d", v.SizeID)) - fieldVals = append(fieldVals, sprintf("SubpixelOrder: %d", v.SubpixelOrder)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("Mwidth: %d", v.Mwidth)) - fieldVals = append(fieldVals, sprintf("Mheight: %d", v.Mheight)) - return "RandrScreenChangeNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["RANDR"][0] = NewRandrScreenChangeNotifyEvent -} - -// Event definition RandrNotify (1) -// Size: 32 - -const RandrNotify = 1 - -type RandrNotifyEvent struct { - Sequence uint16 - SubCode byte - U RandrNotifyDataUnion -} - -// Event read RandrNotify -func NewRandrNotifyEvent(buf []byte) Event { - v := RandrNotifyEvent{} - b := 1 // don't read event number - - v.SubCode = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.U = RandrNotifyDataUnion{} - b += ReadRandrNotifyDataUnion(buf[b:], &v.U) - - return v -} - -// Event write RandrNotify -func (v RandrNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.SubCode - b += 1 - - b += 2 // skip sequence number - - { - unionBytes := v.U.Bytes() - copy(buf[b:], unionBytes) - b += pad(len(unionBytes)) - } - - return buf -} - -func (v RandrNotifyEvent) ImplementsEvent() {} - -func (v RandrNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v RandrNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("SubCode: %d", v.SubCode)) - return "RandrNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["RANDR"][1] = NewRandrNotifyEvent -} - -// Error definition RandrBadOutput (0) -// Size: 32 - -const BadRandrBadOutput = 0 - -type RandrBadOutputError struct { - Sequence uint16 - NiceName string -} - -// Error read RandrBadOutput -func NewRandrBadOutputError(buf []byte) Error { - v := RandrBadOutputError{} - v.NiceName = "RandrBadOutput" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RandrBadOutputError) ImplementsError() {} - -func (err RandrBadOutputError) SequenceId() uint16 { - return err.Sequence -} - -func (err RandrBadOutputError) BadId() uint32 { - return 0 -} - -func (err RandrBadOutputError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRandrBadOutput {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RANDR"][0] = NewRandrBadOutputError -} - -// Error definition RandrBadCrtc (1) -// Size: 32 - -const BadRandrBadCrtc = 1 - -type RandrBadCrtcError struct { - Sequence uint16 - NiceName string -} - -// Error read RandrBadCrtc -func NewRandrBadCrtcError(buf []byte) Error { - v := RandrBadCrtcError{} - v.NiceName = "RandrBadCrtc" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RandrBadCrtcError) ImplementsError() {} - -func (err RandrBadCrtcError) SequenceId() uint16 { - return err.Sequence -} - -func (err RandrBadCrtcError) BadId() uint32 { - return 0 -} - -func (err RandrBadCrtcError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRandrBadCrtc {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RANDR"][1] = NewRandrBadCrtcError -} - -// Error definition RandrBadMode (2) -// Size: 32 - -const BadRandrBadMode = 2 - -type RandrBadModeError struct { - Sequence uint16 - NiceName string -} - -// Error read RandrBadMode -func NewRandrBadModeError(buf []byte) Error { - v := RandrBadModeError{} - v.NiceName = "RandrBadMode" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RandrBadModeError) ImplementsError() {} - -func (err RandrBadModeError) SequenceId() uint16 { - return err.Sequence -} - -func (err RandrBadModeError) BadId() uint32 { - return 0 -} - -func (err RandrBadModeError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRandrBadMode {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RANDR"][2] = NewRandrBadModeError -} - -// Request RandrQueryVersion -// size: 12 -type RandrQueryVersionCookie struct { - *cookie -} - -func (c *Conn) RandrQueryVersion(MajorVersion uint32, MinorVersion uint32) RandrQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return RandrQueryVersionCookie{cookie} -} - -func (c *Conn) RandrQueryVersionUnchecked(MajorVersion uint32, MinorVersion uint32) RandrQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return RandrQueryVersionCookie{cookie} -} - -// Request reply for RandrQueryVersion -// size: 32 -type RandrQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request RandrQueryVersion -func (cook RandrQueryVersionCookie) Reply() (*RandrQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for RandrQueryVersion -func randrQueryVersionReply(buf []byte) *RandrQueryVersionReply { - v := new(RandrQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook RandrQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrQueryVersion -func (c *Conn) randrQueryVersionRequest(MajorVersion uint32, MinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], MajorVersion) - b += 4 - - Put32(buf[b:], MinorVersion) - b += 4 - - return buf -} - -// Request RandrSetScreenConfig -// size: 24 -type RandrSetScreenConfigCookie struct { - *cookie -} - -func (c *Conn) RandrSetScreenConfig(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) - return RandrSetScreenConfigCookie{cookie} -} - -func (c *Conn) RandrSetScreenConfigUnchecked(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) RandrSetScreenConfigCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrSetScreenConfigRequest(Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) - return RandrSetScreenConfigCookie{cookie} -} - -// Request reply for RandrSetScreenConfig -// size: 32 -type RandrSetScreenConfigReply struct { - Sequence uint16 - Length uint32 - Status byte - NewTimestamp Timestamp - ConfigTimestamp Timestamp - Root Window - SubpixelOrder uint16 - // padding: 10 bytes -} - -// Waits and reads reply data from request RandrSetScreenConfig -func (cook RandrSetScreenConfigCookie) Reply() (*RandrSetScreenConfigReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrSetScreenConfigReply(buf), nil -} - -// Read reply into structure from buffer for RandrSetScreenConfig -func randrSetScreenConfigReply(buf []byte) *RandrSetScreenConfigReply { - v := new(RandrSetScreenConfigReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NewTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - v.SubpixelOrder = Get16(buf[b:]) - b += 2 - - b += 10 // padding - - return v -} - -func (cook RandrSetScreenConfigCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetScreenConfig -func (c *Conn) randrSetScreenConfigRequest(Window Window, Timestamp Timestamp, ConfigTimestamp Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Timestamp)) - b += 4 - - Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 - - Put16(buf[b:], SizeID) - b += 2 - - Put16(buf[b:], Rotation) - b += 2 - - Put16(buf[b:], Rate) - b += 2 - - b += 2 // padding - - return buf -} - -// Request RandrSelectInput -// size: 12 -type RandrSelectInputCookie struct { - *cookie -} - -// Write request to wire for RandrSelectInput -func (c *Conn) RandrSelectInput(Window Window, Enable uint16) RandrSelectInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) - return RandrSelectInputCookie{cookie} -} - -func (c *Conn) RandrSelectInputChecked(Window Window, Enable uint16) RandrSelectInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrSelectInputRequest(Window, Enable), cookie) - return RandrSelectInputCookie{cookie} -} - -func (cook RandrSelectInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSelectInput -func (c *Conn) randrSelectInputRequest(Window Window, Enable uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put16(buf[b:], Enable) - b += 2 - - b += 2 // padding - - return buf -} - -// Request RandrGetScreenInfo -// size: 8 -type RandrGetScreenInfoCookie struct { - *cookie -} - -func (c *Conn) RandrGetScreenInfo(Window Window) RandrGetScreenInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) - return RandrGetScreenInfoCookie{cookie} -} - -func (c *Conn) RandrGetScreenInfoUnchecked(Window Window) RandrGetScreenInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetScreenInfoRequest(Window), cookie) - return RandrGetScreenInfoCookie{cookie} -} - -// Request reply for RandrGetScreenInfo -// size: ((32 + pad((int(NSizes) * 8))) + RandrRefreshRatesListSize(Rates)) -type RandrGetScreenInfoReply struct { - Sequence uint16 - Length uint32 - Rotations byte - Root Window - Timestamp Timestamp - ConfigTimestamp Timestamp - NSizes uint16 - SizeID uint16 - Rotation uint16 - Rate uint16 - NInfo uint16 - // padding: 2 bytes - Sizes []RandrScreenSize // size: pad((int(NSizes) * 8)) - Rates []RandrRefreshRates // size: RandrRefreshRatesListSize(Rates) -} - -// Waits and reads reply data from request RandrGetScreenInfo -func (cook RandrGetScreenInfoCookie) Reply() (*RandrGetScreenInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetScreenInfoReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetScreenInfo -func randrGetScreenInfoReply(buf []byte) *RandrGetScreenInfoReply { - v := new(RandrGetScreenInfoReply) - b := 1 // skip reply determinant - - v.Rotations = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.NSizes = Get16(buf[b:]) - b += 2 - - v.SizeID = Get16(buf[b:]) - b += 2 - - v.Rotation = Get16(buf[b:]) - b += 2 - - v.Rate = Get16(buf[b:]) - b += 2 - - v.NInfo = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Sizes = make([]RandrScreenSize, v.NSizes) - b += ReadRandrScreenSizeList(buf[b:], v.Sizes) - - v.Rates = make([]RandrRefreshRates, (int(v.NInfo) - int(v.NSizes))) - b += ReadRandrRefreshRatesList(buf[b:], v.Rates) - - return v -} - -func (cook RandrGetScreenInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetScreenInfo -func (c *Conn) randrGetScreenInfoRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request RandrGetScreenSizeRange -// size: 8 -type RandrGetScreenSizeRangeCookie struct { - *cookie -} - -func (c *Conn) RandrGetScreenSizeRange(Window Window) RandrGetScreenSizeRangeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) - return RandrGetScreenSizeRangeCookie{cookie} -} - -func (c *Conn) RandrGetScreenSizeRangeUnchecked(Window Window) RandrGetScreenSizeRangeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetScreenSizeRangeRequest(Window), cookie) - return RandrGetScreenSizeRangeCookie{cookie} -} - -// Request reply for RandrGetScreenSizeRange -// size: 32 -type RandrGetScreenSizeRangeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MinWidth uint16 - MinHeight uint16 - MaxWidth uint16 - MaxHeight uint16 - // padding: 16 bytes -} - -// Waits and reads reply data from request RandrGetScreenSizeRange -func (cook RandrGetScreenSizeRangeCookie) Reply() (*RandrGetScreenSizeRangeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetScreenSizeRangeReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetScreenSizeRange -func randrGetScreenSizeRangeReply(buf []byte) *RandrGetScreenSizeRangeReply { - v := new(RandrGetScreenSizeRangeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MinWidth = Get16(buf[b:]) - b += 2 - - v.MinHeight = Get16(buf[b:]) - b += 2 - - v.MaxWidth = Get16(buf[b:]) - b += 2 - - v.MaxHeight = Get16(buf[b:]) - b += 2 - - b += 16 // padding - - return v -} - -func (cook RandrGetScreenSizeRangeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetScreenSizeRange -func (c *Conn) randrGetScreenSizeRangeRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request RandrSetScreenSize -// size: 20 -type RandrSetScreenSizeCookie struct { - *cookie -} - -// Write request to wire for RandrSetScreenSize -func (c *Conn) RandrSetScreenSize(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) - return RandrSetScreenSizeCookie{cookie} -} - -func (c *Conn) RandrSetScreenSizeChecked(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) RandrSetScreenSizeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrSetScreenSizeRequest(Window, Width, Height, MmWidth, MmHeight), cookie) - return RandrSetScreenSizeCookie{cookie} -} - -func (cook RandrSetScreenSizeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetScreenSize -func (c *Conn) randrSetScreenSizeRequest(Window Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - Put32(buf[b:], MmWidth) - b += 4 - - Put32(buf[b:], MmHeight) - b += 4 - - return buf -} - -// Request RandrGetScreenResources -// size: 8 -type RandrGetScreenResourcesCookie struct { - *cookie -} - -func (c *Conn) RandrGetScreenResources(Window Window) RandrGetScreenResourcesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) - return RandrGetScreenResourcesCookie{cookie} -} - -func (c *Conn) RandrGetScreenResourcesUnchecked(Window Window) RandrGetScreenResourcesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetScreenResourcesRequest(Window), cookie) - return RandrGetScreenResourcesCookie{cookie} -} - -// Request reply for RandrGetScreenResources -// size: ((((32 + pad((int(NumCrtcs) * 4))) + pad((int(NumOutputs) * 4))) + pad((int(NumModes) * 32))) + pad((int(NamesLen) * 1))) -type RandrGetScreenResourcesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Timestamp Timestamp - ConfigTimestamp Timestamp - NumCrtcs uint16 - NumOutputs uint16 - NumModes uint16 - NamesLen uint16 - // padding: 8 bytes - Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) - Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) - Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) - Names []byte // size: pad((int(NamesLen) * 1)) -} - -// Waits and reads reply data from request RandrGetScreenResources -func (cook RandrGetScreenResourcesCookie) Reply() (*RandrGetScreenResourcesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetScreenResourcesReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetScreenResources -func randrGetScreenResourcesReply(buf []byte) *RandrGetScreenResourcesReply { - v := new(RandrGetScreenResourcesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.NumCrtcs = Get16(buf[b:]) - b += 2 - - v.NumOutputs = Get16(buf[b:]) - b += 2 - - v.NumModes = Get16(buf[b:]) - b += 2 - - v.NamesLen = Get16(buf[b:]) - b += 2 - - b += 8 // padding - - v.Crtcs = make([]RandrCrtc, v.NumCrtcs) - for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Outputs = make([]RandrOutput, v.NumOutputs) - for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = RandrOutput(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Modes = make([]RandrModeInfo, v.NumModes) - b += ReadRandrModeInfoList(buf[b:], v.Modes) - - v.Names = make([]byte, v.NamesLen) - copy(v.Names[:v.NamesLen], buf[b:]) - b += pad(int(v.NamesLen)) - - return v -} - -func (cook RandrGetScreenResourcesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetScreenResources -func (c *Conn) randrGetScreenResourcesRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request RandrGetOutputInfo -// size: 12 -type RandrGetOutputInfoCookie struct { - *cookie -} - -func (c *Conn) RandrGetOutputInfo(Output RandrOutput, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) - return RandrGetOutputInfoCookie{cookie} -} - -func (c *Conn) RandrGetOutputInfoUnchecked(Output RandrOutput, ConfigTimestamp Timestamp) RandrGetOutputInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetOutputInfoRequest(Output, ConfigTimestamp), cookie) - return RandrGetOutputInfoCookie{cookie} -} - -// Request reply for RandrGetOutputInfo -// size: ((((36 + pad((int(NumCrtcs) * 4))) + pad((int(NumModes) * 4))) + pad((int(NumClones) * 4))) + pad((int(NameLen) * 1))) -type RandrGetOutputInfoReply struct { - Sequence uint16 - Length uint32 - Status byte - Timestamp Timestamp - Crtc RandrCrtc - MmWidth uint32 - MmHeight uint32 - Connection byte - SubpixelOrder byte - NumCrtcs uint16 - NumModes uint16 - NumPreferred uint16 - NumClones uint16 - NameLen uint16 - Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) - Modes []RandrMode // size: pad((int(NumModes) * 4)) - Clones []RandrOutput // size: pad((int(NumClones) * 4)) - Name []byte // size: pad((int(NameLen) * 1)) -} - -// Waits and reads reply data from request RandrGetOutputInfo -func (cook RandrGetOutputInfoCookie) Reply() (*RandrGetOutputInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetOutputInfoReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetOutputInfo -func randrGetOutputInfoReply(buf []byte) *RandrGetOutputInfoReply { - v := new(RandrGetOutputInfoReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Crtc = RandrCrtc(Get32(buf[b:])) - b += 4 - - v.MmWidth = Get32(buf[b:]) - b += 4 - - v.MmHeight = Get32(buf[b:]) - b += 4 - - v.Connection = buf[b] - b += 1 - - v.SubpixelOrder = buf[b] - b += 1 - - v.NumCrtcs = Get16(buf[b:]) - b += 2 - - v.NumModes = Get16(buf[b:]) - b += 2 - - v.NumPreferred = Get16(buf[b:]) - b += 2 - - v.NumClones = Get16(buf[b:]) - b += 2 - - v.NameLen = Get16(buf[b:]) - b += 2 - - v.Crtcs = make([]RandrCrtc, v.NumCrtcs) - for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Modes = make([]RandrMode, v.NumModes) - for i := 0; i < int(v.NumModes); i++ { - v.Modes[i] = RandrMode(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Clones = make([]RandrOutput, v.NumClones) - for i := 0; i < int(v.NumClones); i++ { - v.Clones[i] = RandrOutput(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Name = make([]byte, v.NameLen) - copy(v.Name[:v.NameLen], buf[b:]) - b += pad(int(v.NameLen)) - - return v -} - -func (cook RandrGetOutputInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetOutputInfo -func (c *Conn) randrGetOutputInfoRequest(Output RandrOutput, ConfigTimestamp Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 - - return buf -} - -// Request RandrListOutputProperties -// size: 8 -type RandrListOutputPropertiesCookie struct { - *cookie -} - -func (c *Conn) RandrListOutputProperties(Output RandrOutput) RandrListOutputPropertiesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) - return RandrListOutputPropertiesCookie{cookie} -} - -func (c *Conn) RandrListOutputPropertiesUnchecked(Output RandrOutput) RandrListOutputPropertiesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrListOutputPropertiesRequest(Output), cookie) - return RandrListOutputPropertiesCookie{cookie} -} - -// Request reply for RandrListOutputProperties -// size: (32 + pad((int(NumAtoms) * 4))) -type RandrListOutputPropertiesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAtoms uint16 - // padding: 22 bytes - Atoms []Atom // size: pad((int(NumAtoms) * 4)) -} - -// Waits and reads reply data from request RandrListOutputProperties -func (cook RandrListOutputPropertiesCookie) Reply() (*RandrListOutputPropertiesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrListOutputPropertiesReply(buf), nil -} - -// Read reply into structure from buffer for RandrListOutputProperties -func randrListOutputPropertiesReply(buf []byte) *RandrListOutputPropertiesReply { - v := new(RandrListOutputPropertiesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAtoms = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Atoms = make([]Atom, v.NumAtoms) - for i := 0; i < int(v.NumAtoms); i++ { - v.Atoms[i] = Atom(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook RandrListOutputPropertiesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrListOutputProperties -func (c *Conn) randrListOutputPropertiesRequest(Output RandrOutput) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - return buf -} - -// Request RandrQueryOutputProperty -// size: 12 -type RandrQueryOutputPropertyCookie struct { - *cookie -} - -func (c *Conn) RandrQueryOutputProperty(Output RandrOutput, Property Atom) RandrQueryOutputPropertyCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) - return RandrQueryOutputPropertyCookie{cookie} -} - -func (c *Conn) RandrQueryOutputPropertyUnchecked(Output RandrOutput, Property Atom) RandrQueryOutputPropertyCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrQueryOutputPropertyRequest(Output, Property), cookie) - return RandrQueryOutputPropertyCookie{cookie} -} - -// Request reply for RandrQueryOutputProperty -// size: (32 + pad((int(Length) * 4))) -type RandrQueryOutputPropertyReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Pending bool - Range bool - Immutable bool - // padding: 21 bytes - ValidValues []int32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request RandrQueryOutputProperty -func (cook RandrQueryOutputPropertyCookie) Reply() (*RandrQueryOutputPropertyReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrQueryOutputPropertyReply(buf), nil -} - -// Read reply into structure from buffer for RandrQueryOutputProperty -func randrQueryOutputPropertyReply(buf []byte) *RandrQueryOutputPropertyReply { - v := new(RandrQueryOutputPropertyReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.Pending = true - } else { - v.Pending = false - } - b += 1 - - if buf[b] == 1 { - v.Range = true - } else { - v.Range = false - } - b += 1 - - if buf[b] == 1 { - v.Immutable = true - } else { - v.Immutable = false - } - b += 1 - - b += 21 // padding - - v.ValidValues = make([]int32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.ValidValues[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook RandrQueryOutputPropertyCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrQueryOutputProperty -func (c *Conn) randrQueryOutputPropertyRequest(Output RandrOutput, Property Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// Request RandrConfigureOutputProperty -// size: pad((16 + pad((len(Values) * 4)))) -type RandrConfigureOutputPropertyCookie struct { - *cookie -} - -// Write request to wire for RandrConfigureOutputProperty -func (c *Conn) RandrConfigureOutputProperty(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) - return RandrConfigureOutputPropertyCookie{cookie} -} - -func (c *Conn) RandrConfigureOutputPropertyChecked(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) RandrConfigureOutputPropertyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrConfigureOutputPropertyRequest(Output, Property, Pending, Range, Values), cookie) - return RandrConfigureOutputPropertyCookie{cookie} -} - -func (cook RandrConfigureOutputPropertyCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrConfigureOutputProperty -func (c *Conn) randrConfigureOutputPropertyRequest(Output RandrOutput, Property Atom, Pending bool, Range bool, Values []int32) []byte { - size := pad((16 + pad((len(Values) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - if Pending { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Range { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - for i := 0; i < int(len(Values)); i++ { - Put32(buf[b:], uint32(Values[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RandrChangeOutputProperty -// size: pad((24 + pad((((int(NumUnits) * int(Format)) / 8) * 1)))) -type RandrChangeOutputPropertyCookie struct { - *cookie -} - -// Write request to wire for RandrChangeOutputProperty -func (c *Conn) RandrChangeOutputProperty(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) - return RandrChangeOutputPropertyCookie{cookie} -} - -func (c *Conn) RandrChangeOutputPropertyChecked(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) RandrChangeOutputPropertyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrChangeOutputPropertyRequest(Output, Property, Type, Format, Mode, NumUnits, Data), cookie) - return RandrChangeOutputPropertyCookie{cookie} -} - -func (cook RandrChangeOutputPropertyCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrChangeOutputProperty -func (c *Conn) randrChangeOutputPropertyRequest(Output RandrOutput, Property Atom, Type Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { - size := pad((24 + pad((((int(NumUnits) * int(Format)) / 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - Put32(buf[b:], uint32(Type)) - b += 4 - - buf[b] = Format - b += 1 - - buf[b] = Mode - b += 1 - - b += 2 // padding - - Put32(buf[b:], NumUnits) - b += 4 - - copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) - b += pad(int(((int(NumUnits) * int(Format)) / 8))) - - return buf -} - -// Request RandrDeleteOutputProperty -// size: 12 -type RandrDeleteOutputPropertyCookie struct { - *cookie -} - -// Write request to wire for RandrDeleteOutputProperty -func (c *Conn) RandrDeleteOutputProperty(Output RandrOutput, Property Atom) RandrDeleteOutputPropertyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) - return RandrDeleteOutputPropertyCookie{cookie} -} - -func (c *Conn) RandrDeleteOutputPropertyChecked(Output RandrOutput, Property Atom) RandrDeleteOutputPropertyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrDeleteOutputPropertyRequest(Output, Property), cookie) - return RandrDeleteOutputPropertyCookie{cookie} -} - -func (cook RandrDeleteOutputPropertyCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrDeleteOutputProperty -func (c *Conn) randrDeleteOutputPropertyRequest(Output RandrOutput, Property Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// Request RandrGetOutputProperty -// size: 28 -type RandrGetOutputPropertyCookie struct { - *cookie -} - -func (c *Conn) RandrGetOutputProperty(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) - return RandrGetOutputPropertyCookie{cookie} -} - -func (c *Conn) RandrGetOutputPropertyUnchecked(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) RandrGetOutputPropertyCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetOutputPropertyRequest(Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) - return RandrGetOutputPropertyCookie{cookie} -} - -// Request reply for RandrGetOutputProperty -// size: (32 + pad(((int(NumItems) * (int(Format) / 8)) * 1))) -type RandrGetOutputPropertyReply struct { - Sequence uint16 - Length uint32 - Format byte - Type Atom - BytesAfter uint32 - NumItems uint32 - // padding: 12 bytes - Data []byte // size: pad(((int(NumItems) * (int(Format) / 8)) * 1)) -} - -// Waits and reads reply data from request RandrGetOutputProperty -func (cook RandrGetOutputPropertyCookie) Reply() (*RandrGetOutputPropertyReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetOutputPropertyReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetOutputProperty -func randrGetOutputPropertyReply(buf []byte) *RandrGetOutputPropertyReply { - v := new(RandrGetOutputPropertyReply) - b := 1 // skip reply determinant - - v.Format = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Type = Atom(Get32(buf[b:])) - b += 4 - - v.BytesAfter = Get32(buf[b:]) - b += 4 - - v.NumItems = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) - copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) - b += pad(int((int(v.NumItems) * (int(v.Format) / 8)))) - - return v -} - -func (cook RandrGetOutputPropertyCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetOutputProperty -func (c *Conn) randrGetOutputPropertyRequest(Output RandrOutput, Property Atom, Type Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - Put32(buf[b:], uint32(Type)) - b += 4 - - Put32(buf[b:], LongOffset) - b += 4 - - Put32(buf[b:], LongLength) - b += 4 - - if Delete { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Pending { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - return buf -} - -// Request RandrCreateMode -// size: pad((40 + pad((len(Name) * 1)))) -type RandrCreateModeCookie struct { - *cookie -} - -func (c *Conn) RandrCreateMode(Window Window, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) - return RandrCreateModeCookie{cookie} -} - -func (c *Conn) RandrCreateModeUnchecked(Window Window, ModeInfo RandrModeInfo, Name string) RandrCreateModeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrCreateModeRequest(Window, ModeInfo, Name), cookie) - return RandrCreateModeCookie{cookie} -} - -// Request reply for RandrCreateMode -// size: 32 -type RandrCreateModeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Mode RandrMode - // padding: 20 bytes -} - -// Waits and reads reply data from request RandrCreateMode -func (cook RandrCreateModeCookie) Reply() (*RandrCreateModeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrCreateModeReply(buf), nil -} - -// Read reply into structure from buffer for RandrCreateMode -func randrCreateModeReply(buf []byte) *RandrCreateModeReply { - v := new(RandrCreateModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Mode = RandrMode(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -func (cook RandrCreateModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrCreateMode -func (c *Conn) randrCreateModeRequest(Window Window, ModeInfo RandrModeInfo, Name string) []byte { - size := pad((40 + pad((len(Name) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - { - structBytes := ModeInfo.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - copy(buf[b:], Name[:len(Name)]) - b += pad(int(len(Name))) - - return buf -} - -// Request RandrDestroyMode -// size: 8 -type RandrDestroyModeCookie struct { - *cookie -} - -// Write request to wire for RandrDestroyMode -func (c *Conn) RandrDestroyMode(Mode RandrMode) RandrDestroyModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrDestroyModeRequest(Mode), cookie) - return RandrDestroyModeCookie{cookie} -} - -func (c *Conn) RandrDestroyModeChecked(Mode RandrMode) RandrDestroyModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrDestroyModeRequest(Mode), cookie) - return RandrDestroyModeCookie{cookie} -} - -func (cook RandrDestroyModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrDestroyMode -func (c *Conn) randrDestroyModeRequest(Mode RandrMode) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// Request RandrAddOutputMode -// size: 12 -type RandrAddOutputModeCookie struct { - *cookie -} - -// Write request to wire for RandrAddOutputMode -func (c *Conn) RandrAddOutputMode(Output RandrOutput, Mode RandrMode) RandrAddOutputModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) - return RandrAddOutputModeCookie{cookie} -} - -func (c *Conn) RandrAddOutputModeChecked(Output RandrOutput, Mode RandrMode) RandrAddOutputModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrAddOutputModeRequest(Output, Mode), cookie) - return RandrAddOutputModeCookie{cookie} -} - -func (cook RandrAddOutputModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrAddOutputMode -func (c *Conn) randrAddOutputModeRequest(Output RandrOutput, Mode RandrMode) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// Request RandrDeleteOutputMode -// size: 12 -type RandrDeleteOutputModeCookie struct { - *cookie -} - -// Write request to wire for RandrDeleteOutputMode -func (c *Conn) RandrDeleteOutputMode(Output RandrOutput, Mode RandrMode) RandrDeleteOutputModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) - return RandrDeleteOutputModeCookie{cookie} -} - -func (c *Conn) RandrDeleteOutputModeChecked(Output RandrOutput, Mode RandrMode) RandrDeleteOutputModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrDeleteOutputModeRequest(Output, Mode), cookie) - return RandrDeleteOutputModeCookie{cookie} -} - -func (cook RandrDeleteOutputModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrDeleteOutputMode -func (c *Conn) randrDeleteOutputModeRequest(Output RandrOutput, Mode RandrMode) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Output)) - b += 4 - - Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// Request RandrGetCrtcInfo -// size: 12 -type RandrGetCrtcInfoCookie struct { - *cookie -} - -func (c *Conn) RandrGetCrtcInfo(Crtc RandrCrtc, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) - return RandrGetCrtcInfoCookie{cookie} -} - -func (c *Conn) RandrGetCrtcInfoUnchecked(Crtc RandrCrtc, ConfigTimestamp Timestamp) RandrGetCrtcInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetCrtcInfoRequest(Crtc, ConfigTimestamp), cookie) - return RandrGetCrtcInfoCookie{cookie} -} - -// Request reply for RandrGetCrtcInfo -// size: ((32 + pad((int(NumOutputs) * 4))) + pad((int(NumPossibleOutputs) * 4))) -type RandrGetCrtcInfoReply struct { - Sequence uint16 - Length uint32 - Status byte - Timestamp Timestamp - X int16 - Y int16 - Width uint16 - Height uint16 - Mode RandrMode - Rotation uint16 - Rotations uint16 - NumOutputs uint16 - NumPossibleOutputs uint16 - Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) - Possible []RandrOutput // size: pad((int(NumPossibleOutputs) * 4)) -} - -// Waits and reads reply data from request RandrGetCrtcInfo -func (cook RandrGetCrtcInfoCookie) Reply() (*RandrGetCrtcInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetCrtcInfoReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetCrtcInfo -func randrGetCrtcInfoReply(buf []byte) *RandrGetCrtcInfoReply { - v := new(RandrGetCrtcInfoReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.X = int16(Get16(buf[b:])) - b += 2 - - v.Y = int16(Get16(buf[b:])) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Mode = RandrMode(Get32(buf[b:])) - b += 4 - - v.Rotation = Get16(buf[b:]) - b += 2 - - v.Rotations = Get16(buf[b:]) - b += 2 - - v.NumOutputs = Get16(buf[b:]) - b += 2 - - v.NumPossibleOutputs = Get16(buf[b:]) - b += 2 - - v.Outputs = make([]RandrOutput, v.NumOutputs) - for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = RandrOutput(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Possible = make([]RandrOutput, v.NumPossibleOutputs) - for i := 0; i < int(v.NumPossibleOutputs); i++ { - v.Possible[i] = RandrOutput(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook RandrGetCrtcInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetCrtcInfo -func (c *Conn) randrGetCrtcInfoRequest(Crtc RandrCrtc, ConfigTimestamp Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 - - return buf -} - -// Request RandrSetCrtcConfig -// size: pad((28 + pad((len(Outputs) * 4)))) -type RandrSetCrtcConfigCookie struct { - *cookie -} - -func (c *Conn) RandrSetCrtcConfig(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) RandrSetCrtcConfigCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) - return RandrSetCrtcConfigCookie{cookie} -} - -func (c *Conn) RandrSetCrtcConfigUnchecked(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) RandrSetCrtcConfigCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrSetCrtcConfigRequest(Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) - return RandrSetCrtcConfigCookie{cookie} -} - -// Request reply for RandrSetCrtcConfig -// size: 32 -type RandrSetCrtcConfigReply struct { - Sequence uint16 - Length uint32 - Status byte - Timestamp Timestamp - // padding: 20 bytes -} - -// Waits and reads reply data from request RandrSetCrtcConfig -func (cook RandrSetCrtcConfigCookie) Reply() (*RandrSetCrtcConfigReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrSetCrtcConfigReply(buf), nil -} - -// Read reply into structure from buffer for RandrSetCrtcConfig -func randrSetCrtcConfigReply(buf []byte) *RandrSetCrtcConfigReply { - v := new(RandrSetCrtcConfigReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -func (cook RandrSetCrtcConfigCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetCrtcConfig -func (c *Conn) randrSetCrtcConfigRequest(Crtc RandrCrtc, Timestamp Timestamp, ConfigTimestamp Timestamp, X int16, Y int16, Mode RandrMode, Rotation uint16, Outputs []RandrOutput) []byte { - size := pad((28 + pad((len(Outputs) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - Put32(buf[b:], uint32(Timestamp)) - b += 4 - - Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 - - Put16(buf[b:], uint16(X)) - b += 2 - - Put16(buf[b:], uint16(Y)) - b += 2 - - Put32(buf[b:], uint32(Mode)) - b += 4 - - Put16(buf[b:], Rotation) - b += 2 - - b += 2 // padding - - for i := 0; i < int(len(Outputs)); i++ { - Put32(buf[b:], uint32(Outputs[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RandrGetCrtcGammaSize -// size: 8 -type RandrGetCrtcGammaSizeCookie struct { - *cookie -} - -func (c *Conn) RandrGetCrtcGammaSize(Crtc RandrCrtc) RandrGetCrtcGammaSizeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) - return RandrGetCrtcGammaSizeCookie{cookie} -} - -func (c *Conn) RandrGetCrtcGammaSizeUnchecked(Crtc RandrCrtc) RandrGetCrtcGammaSizeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetCrtcGammaSizeRequest(Crtc), cookie) - return RandrGetCrtcGammaSizeCookie{cookie} -} - -// Request reply for RandrGetCrtcGammaSize -// size: 32 -type RandrGetCrtcGammaSizeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Size uint16 - // padding: 22 bytes -} - -// Waits and reads reply data from request RandrGetCrtcGammaSize -func (cook RandrGetCrtcGammaSizeCookie) Reply() (*RandrGetCrtcGammaSizeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetCrtcGammaSizeReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetCrtcGammaSize -func randrGetCrtcGammaSizeReply(buf []byte) *RandrGetCrtcGammaSizeReply { - v := new(RandrGetCrtcGammaSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -func (cook RandrGetCrtcGammaSizeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetCrtcGammaSize -func (c *Conn) randrGetCrtcGammaSizeRequest(Crtc RandrCrtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - -// Request RandrGetCrtcGamma -// size: 8 -type RandrGetCrtcGammaCookie struct { - *cookie -} - -func (c *Conn) RandrGetCrtcGamma(Crtc RandrCrtc) RandrGetCrtcGammaCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) - return RandrGetCrtcGammaCookie{cookie} -} - -func (c *Conn) RandrGetCrtcGammaUnchecked(Crtc RandrCrtc) RandrGetCrtcGammaCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetCrtcGammaRequest(Crtc), cookie) - return RandrGetCrtcGammaCookie{cookie} -} - -// Request reply for RandrGetCrtcGamma -// size: (((32 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2))) -type RandrGetCrtcGammaReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Size uint16 - // padding: 22 bytes - Red []uint16 // size: pad((int(Size) * 2)) - Green []uint16 // size: pad((int(Size) * 2)) - Blue []uint16 // size: pad((int(Size) * 2)) -} - -// Waits and reads reply data from request RandrGetCrtcGamma -func (cook RandrGetCrtcGammaCookie) Reply() (*RandrGetCrtcGammaReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetCrtcGammaReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetCrtcGamma -func randrGetCrtcGammaReply(buf []byte) *RandrGetCrtcGammaReply { - v := new(RandrGetCrtcGammaReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Red = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Red[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - v.Green = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Green[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - v.Blue = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Blue[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - return v -} - -func (cook RandrGetCrtcGammaCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetCrtcGamma -func (c *Conn) randrGetCrtcGammaRequest(Crtc RandrCrtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - -// Request RandrSetCrtcGamma -// size: pad((((12 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2)))) -type RandrSetCrtcGammaCookie struct { - *cookie -} - -// Write request to wire for RandrSetCrtcGamma -func (c *Conn) RandrSetCrtcGamma(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) - return RandrSetCrtcGammaCookie{cookie} -} - -func (c *Conn) RandrSetCrtcGammaChecked(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) RandrSetCrtcGammaCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrSetCrtcGammaRequest(Crtc, Size, Red, Green, Blue), cookie) - return RandrSetCrtcGammaCookie{cookie} -} - -func (cook RandrSetCrtcGammaCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetCrtcGamma -func (c *Conn) randrSetCrtcGammaRequest(Crtc RandrCrtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := pad((((12 + pad((int(Size) * 2))) + pad((int(Size) * 2))) + pad((int(Size) * 2)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - Put16(buf[b:], Size) - b += 2 - - b += 2 // padding - - for i := 0; i < int(Size); i++ { - Put16(buf[b:], Red[i]) - b += 2 - } - b = pad(b) - - for i := 0; i < int(Size); i++ { - Put16(buf[b:], Green[i]) - b += 2 - } - b = pad(b) - - for i := 0; i < int(Size); i++ { - Put16(buf[b:], Blue[i]) - b += 2 - } - b = pad(b) - - return buf -} - -// Request RandrGetScreenResourcesCurrent -// size: 8 -type RandrGetScreenResourcesCurrentCookie struct { - *cookie -} - -func (c *Conn) RandrGetScreenResourcesCurrent(Window Window) RandrGetScreenResourcesCurrentCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) - return RandrGetScreenResourcesCurrentCookie{cookie} -} - -func (c *Conn) RandrGetScreenResourcesCurrentUnchecked(Window Window) RandrGetScreenResourcesCurrentCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetScreenResourcesCurrentRequest(Window), cookie) - return RandrGetScreenResourcesCurrentCookie{cookie} -} - -// Request reply for RandrGetScreenResourcesCurrent -// size: ((((32 + pad((int(NumCrtcs) * 4))) + pad((int(NumOutputs) * 4))) + pad((int(NumModes) * 32))) + pad((int(NamesLen) * 1))) -type RandrGetScreenResourcesCurrentReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Timestamp Timestamp - ConfigTimestamp Timestamp - NumCrtcs uint16 - NumOutputs uint16 - NumModes uint16 - NamesLen uint16 - // padding: 8 bytes - Crtcs []RandrCrtc // size: pad((int(NumCrtcs) * 4)) - Outputs []RandrOutput // size: pad((int(NumOutputs) * 4)) - Modes []RandrModeInfo // size: pad((int(NumModes) * 32)) - Names []byte // size: pad((int(NamesLen) * 1)) -} - -// Waits and reads reply data from request RandrGetScreenResourcesCurrent -func (cook RandrGetScreenResourcesCurrentCookie) Reply() (*RandrGetScreenResourcesCurrentReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetScreenResourcesCurrentReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetScreenResourcesCurrent -func randrGetScreenResourcesCurrentReply(buf []byte) *RandrGetScreenResourcesCurrentReply { - v := new(RandrGetScreenResourcesCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.NumCrtcs = Get16(buf[b:]) - b += 2 - - v.NumOutputs = Get16(buf[b:]) - b += 2 - - v.NumModes = Get16(buf[b:]) - b += 2 - - v.NamesLen = Get16(buf[b:]) - b += 2 - - b += 8 // padding - - v.Crtcs = make([]RandrCrtc, v.NumCrtcs) - for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = RandrCrtc(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Outputs = make([]RandrOutput, v.NumOutputs) - for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = RandrOutput(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Modes = make([]RandrModeInfo, v.NumModes) - b += ReadRandrModeInfoList(buf[b:], v.Modes) - - v.Names = make([]byte, v.NamesLen) - copy(v.Names[:v.NamesLen], buf[b:]) - b += pad(int(v.NamesLen)) - - return v -} - -func (cook RandrGetScreenResourcesCurrentCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetScreenResourcesCurrent -func (c *Conn) randrGetScreenResourcesCurrentRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request RandrSetCrtcTransform -// size: pad(((48 + pad((int(FilterLen) * 1))) + pad((len(FilterParams) * 4)))) -type RandrSetCrtcTransformCookie struct { - *cookie -} - -// Write request to wire for RandrSetCrtcTransform -func (c *Conn) RandrSetCrtcTransform(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) - return RandrSetCrtcTransformCookie{cookie} -} - -func (c *Conn) RandrSetCrtcTransformChecked(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) RandrSetCrtcTransformCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrSetCrtcTransformRequest(Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) - return RandrSetCrtcTransformCookie{cookie} -} - -func (cook RandrSetCrtcTransformCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetCrtcTransform -func (c *Conn) randrSetCrtcTransformRequest(Crtc RandrCrtc, Transform RenderTransform, FilterLen uint16, FilterName string, FilterParams []RenderFixed) []byte { - size := pad(((48 + pad((int(FilterLen) * 1))) + pad((len(FilterParams) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - { - structBytes := Transform.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put16(buf[b:], FilterLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], FilterName[:FilterLen]) - b += pad(int(FilterLen)) - - for i := 0; i < int(len(FilterParams)); i++ { - Put32(buf[b:], uint32(FilterParams[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RandrGetCrtcTransform -// size: 8 -type RandrGetCrtcTransformCookie struct { - *cookie -} - -func (c *Conn) RandrGetCrtcTransform(Crtc RandrCrtc) RandrGetCrtcTransformCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) - return RandrGetCrtcTransformCookie{cookie} -} - -func (c *Conn) RandrGetCrtcTransformUnchecked(Crtc RandrCrtc) RandrGetCrtcTransformCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetCrtcTransformRequest(Crtc), cookie) - return RandrGetCrtcTransformCookie{cookie} -} - -// Request reply for RandrGetCrtcTransform -// size: ((((96 + pad((int(PendingLen) * 1))) + pad((int(PendingNparams) * 4))) + pad((int(CurrentLen) * 1))) + pad((int(CurrentNparams) * 4))) -type RandrGetCrtcTransformReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - PendingTransform RenderTransform - HasTransforms bool - // padding: 3 bytes - CurrentTransform RenderTransform - // padding: 4 bytes - PendingLen uint16 - PendingNparams uint16 - CurrentLen uint16 - CurrentNparams uint16 - PendingFilterName string // size: pad((int(PendingLen) * 1)) - PendingParams []RenderFixed // size: pad((int(PendingNparams) * 4)) - CurrentFilterName string // size: pad((int(CurrentLen) * 1)) - CurrentParams []RenderFixed // size: pad((int(CurrentNparams) * 4)) -} - -// Waits and reads reply data from request RandrGetCrtcTransform -func (cook RandrGetCrtcTransformCookie) Reply() (*RandrGetCrtcTransformReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetCrtcTransformReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetCrtcTransform -func randrGetCrtcTransformReply(buf []byte) *RandrGetCrtcTransformReply { - v := new(RandrGetCrtcTransformReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.PendingTransform = RenderTransform{} - b += ReadRenderTransform(buf[b:], &v.PendingTransform) - - if buf[b] == 1 { - v.HasTransforms = true - } else { - v.HasTransforms = false - } - b += 1 - - b += 3 // padding - - v.CurrentTransform = RenderTransform{} - b += ReadRenderTransform(buf[b:], &v.CurrentTransform) - - b += 4 // padding - - v.PendingLen = Get16(buf[b:]) - b += 2 - - v.PendingNparams = Get16(buf[b:]) - b += 2 - - v.CurrentLen = Get16(buf[b:]) - b += 2 - - v.CurrentNparams = Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, v.PendingLen) - copy(byteString[:v.PendingLen], buf[b:]) - v.PendingFilterName = string(byteString) - b += pad(int(v.PendingLen)) - } - - v.PendingParams = make([]RenderFixed, v.PendingNparams) - for i := 0; i < int(v.PendingNparams); i++ { - v.PendingParams[i] = RenderFixed(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - { - byteString := make([]byte, v.CurrentLen) - copy(byteString[:v.CurrentLen], buf[b:]) - v.CurrentFilterName = string(byteString) - b += pad(int(v.CurrentLen)) - } - - v.CurrentParams = make([]RenderFixed, v.CurrentNparams) - for i := 0; i < int(v.CurrentNparams); i++ { - v.CurrentParams[i] = RenderFixed(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook RandrGetCrtcTransformCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetCrtcTransform -func (c *Conn) randrGetCrtcTransformRequest(Crtc RandrCrtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - -// Request RandrGetPanning -// size: 8 -type RandrGetPanningCookie struct { - *cookie -} - -func (c *Conn) RandrGetPanning(Crtc RandrCrtc) RandrGetPanningCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetPanningRequest(Crtc), cookie) - return RandrGetPanningCookie{cookie} -} - -func (c *Conn) RandrGetPanningUnchecked(Crtc RandrCrtc) RandrGetPanningCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetPanningRequest(Crtc), cookie) - return RandrGetPanningCookie{cookie} -} - -// Request reply for RandrGetPanning -// size: 36 -type RandrGetPanningReply struct { - Sequence uint16 - Length uint32 - Status byte - Timestamp Timestamp - Left uint16 - Top uint16 - Width uint16 - Height uint16 - TrackLeft uint16 - TrackTop uint16 - TrackWidth uint16 - TrackHeight uint16 - BorderLeft int16 - BorderTop int16 - BorderRight int16 - BorderBottom int16 -} - -// Waits and reads reply data from request RandrGetPanning -func (cook RandrGetPanningCookie) Reply() (*RandrGetPanningReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetPanningReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetPanning -func randrGetPanningReply(buf []byte) *RandrGetPanningReply { - v := new(RandrGetPanningReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Left = Get16(buf[b:]) - b += 2 - - v.Top = Get16(buf[b:]) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.TrackLeft = Get16(buf[b:]) - b += 2 - - v.TrackTop = Get16(buf[b:]) - b += 2 - - v.TrackWidth = Get16(buf[b:]) - b += 2 - - v.TrackHeight = Get16(buf[b:]) - b += 2 - - v.BorderLeft = int16(Get16(buf[b:])) - b += 2 - - v.BorderTop = int16(Get16(buf[b:])) - b += 2 - - v.BorderRight = int16(Get16(buf[b:])) - b += 2 - - v.BorderBottom = int16(Get16(buf[b:])) - b += 2 - - return v -} - -func (cook RandrGetPanningCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetPanning -func (c *Conn) randrGetPanningRequest(Crtc RandrCrtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - -// Request RandrSetPanning -// size: 36 -type RandrSetPanningCookie struct { - *cookie -} - -func (c *Conn) RandrSetPanning(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) - return RandrSetPanningCookie{cookie} -} - -func (c *Conn) RandrSetPanningUnchecked(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) RandrSetPanningCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrSetPanningRequest(Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) - return RandrSetPanningCookie{cookie} -} - -// Request reply for RandrSetPanning -// size: 12 -type RandrSetPanningReply struct { - Sequence uint16 - Length uint32 - Status byte - Timestamp Timestamp -} - -// Waits and reads reply data from request RandrSetPanning -func (cook RandrSetPanningCookie) Reply() (*RandrSetPanningReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrSetPanningReply(buf), nil -} - -// Read reply into structure from buffer for RandrSetPanning -func randrSetPanningReply(buf []byte) *RandrSetPanningReply { - v := new(RandrSetPanningReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook RandrSetPanningCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetPanning -func (c *Conn) randrSetPanningRequest(Crtc RandrCrtc, Timestamp Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { - size := 36 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Crtc)) - b += 4 - - Put32(buf[b:], uint32(Timestamp)) - b += 4 - - Put16(buf[b:], Left) - b += 2 - - Put16(buf[b:], Top) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - Put16(buf[b:], TrackLeft) - b += 2 - - Put16(buf[b:], TrackTop) - b += 2 - - Put16(buf[b:], TrackWidth) - b += 2 - - Put16(buf[b:], TrackHeight) - b += 2 - - Put16(buf[b:], uint16(BorderLeft)) - b += 2 - - Put16(buf[b:], uint16(BorderTop)) - b += 2 - - Put16(buf[b:], uint16(BorderRight)) - b += 2 - - Put16(buf[b:], uint16(BorderBottom)) - b += 2 - - return buf -} - -// Request RandrSetOutputPrimary -// size: 12 -type RandrSetOutputPrimaryCookie struct { - *cookie -} - -// Write request to wire for RandrSetOutputPrimary -func (c *Conn) RandrSetOutputPrimary(Window Window, Output RandrOutput) RandrSetOutputPrimaryCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) - return RandrSetOutputPrimaryCookie{cookie} -} - -func (c *Conn) RandrSetOutputPrimaryChecked(Window Window, Output RandrOutput) RandrSetOutputPrimaryCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.randrSetOutputPrimaryRequest(Window, Output), cookie) - return RandrSetOutputPrimaryCookie{cookie} -} - -func (cook RandrSetOutputPrimaryCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrSetOutputPrimary -func (c *Conn) randrSetOutputPrimaryRequest(Window Window, Output RandrOutput) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Output)) - b += 4 - - return buf -} - -// Request RandrGetOutputPrimary -// size: 8 -type RandrGetOutputPrimaryCookie struct { - *cookie -} - -func (c *Conn) RandrGetOutputPrimary(Window Window) RandrGetOutputPrimaryCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) - return RandrGetOutputPrimaryCookie{cookie} -} - -func (c *Conn) RandrGetOutputPrimaryUnchecked(Window Window) RandrGetOutputPrimaryCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.randrGetOutputPrimaryRequest(Window), cookie) - return RandrGetOutputPrimaryCookie{cookie} -} - -// Request reply for RandrGetOutputPrimary -// size: 12 -type RandrGetOutputPrimaryReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Output RandrOutput -} - -// Waits and reads reply data from request RandrGetOutputPrimary -func (cook RandrGetOutputPrimaryCookie) Reply() (*RandrGetOutputPrimaryReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return randrGetOutputPrimaryReply(buf), nil -} - -// Read reply into structure from buffer for RandrGetOutputPrimary -func randrGetOutputPrimaryReply(buf []byte) *RandrGetOutputPrimaryReply { - v := new(RandrGetOutputPrimaryReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Output = RandrOutput(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook RandrGetOutputPrimaryCookie) Check() error { - return cook.check() -} - -// Write request to wire for RandrGetOutputPrimary -func (c *Conn) randrGetOutputPrimaryRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RANDR"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} diff --git a/nexgb/auto_record.go b/nexgb/auto_record.go deleted file mode 100644 index ec936d7..0000000 --- a/nexgb/auto_record.go +++ /dev/null @@ -1,1095 +0,0 @@ -package xgb - -/* - This file was generated by record.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// RecordInit must be called before using the RECORD extension. -func (c *Conn) RecordInit() error { - reply, err := c.QueryExtension(6, "RECORD").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named RECORD could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["RECORD"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["RECORD"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["RECORD"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["RECORD"] = make(map[int]newEventFun) - newExtErrorFuncs["RECORD"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -const ( - RecordHTypeFromServerTime = 1 - RecordHTypeFromClientTime = 2 - RecordHTypeFromClientSequence = 4 -) - -const ( - RecordCsCurrentClients = 1 - RecordCsFutureClients = 2 - RecordCsAllClients = 3 -) - -type RecordContext uint32 - -func (c *Conn) NewRecordContextId() (RecordContext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RecordContext(id), nil -} - -type RecordElementHeader byte - -type RecordClientSpec uint32 - -// 'RecordRange8' struct definition -// Size: 2 -type RecordRange8 struct { - First byte - Last byte -} - -// Struct read RecordRange8 -func ReadRecordRange8(buf []byte, v *RecordRange8) int { - b := 0 - - v.First = buf[b] - b += 1 - - v.Last = buf[b] - b += 1 - - return b -} - -// Struct list read RecordRange8 -func ReadRecordRange8List(buf []byte, dest []RecordRange8) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RecordRange8{} - b += ReadRecordRange8(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RecordRange8 -func (v RecordRange8) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.First - b += 1 - - buf[b] = v.Last - b += 1 - - return buf -} - -// Write struct list RecordRange8 -func RecordRange8ListBytes(buf []byte, list []RecordRange8) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RecordRange16' struct definition -// Size: 4 -type RecordRange16 struct { - First uint16 - Last uint16 -} - -// Struct read RecordRange16 -func ReadRecordRange16(buf []byte, v *RecordRange16) int { - b := 0 - - v.First = Get16(buf[b:]) - b += 2 - - v.Last = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RecordRange16 -func ReadRecordRange16List(buf []byte, dest []RecordRange16) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RecordRange16{} - b += ReadRecordRange16(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RecordRange16 -func (v RecordRange16) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - Put16(buf[b:], v.First) - b += 2 - - Put16(buf[b:], v.Last) - b += 2 - - return buf -} - -// Write struct list RecordRange16 -func RecordRange16ListBytes(buf []byte, list []RecordRange16) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RecordExtRange' struct definition -// Size: 6 -type RecordExtRange struct { - Major RecordRange8 - Minor RecordRange16 -} - -// Struct read RecordExtRange -func ReadRecordExtRange(buf []byte, v *RecordExtRange) int { - b := 0 - - v.Major = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.Major) - - v.Minor = RecordRange16{} - b += ReadRecordRange16(buf[b:], &v.Minor) - - return b -} - -// Struct list read RecordExtRange -func ReadRecordExtRangeList(buf []byte, dest []RecordExtRange) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RecordExtRange{} - b += ReadRecordExtRange(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RecordExtRange -func (v RecordExtRange) Bytes() []byte { - buf := make([]byte, 6) - b := 0 - - { - structBytes := v.Major.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.Minor.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list RecordExtRange -func RecordExtRangeListBytes(buf []byte, list []RecordExtRange) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RecordRange' struct definition -// Size: 24 -type RecordRange struct { - CoreRequests RecordRange8 - CoreReplies RecordRange8 - ExtRequests RecordExtRange - ExtReplies RecordExtRange - DeliveredEvents RecordRange8 - DeviceEvents RecordRange8 - Errors RecordRange8 - ClientStarted bool - ClientDied bool -} - -// Struct read RecordRange -func ReadRecordRange(buf []byte, v *RecordRange) int { - b := 0 - - v.CoreRequests = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.CoreRequests) - - v.CoreReplies = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.CoreReplies) - - v.ExtRequests = RecordExtRange{} - b += ReadRecordExtRange(buf[b:], &v.ExtRequests) - - v.ExtReplies = RecordExtRange{} - b += ReadRecordExtRange(buf[b:], &v.ExtReplies) - - v.DeliveredEvents = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.DeliveredEvents) - - v.DeviceEvents = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.DeviceEvents) - - v.Errors = RecordRange8{} - b += ReadRecordRange8(buf[b:], &v.Errors) - - if buf[b] == 1 { - v.ClientStarted = true - } else { - v.ClientStarted = false - } - b += 1 - - if buf[b] == 1 { - v.ClientDied = true - } else { - v.ClientDied = false - } - b += 1 - - return b -} - -// Struct list read RecordRange -func ReadRecordRangeList(buf []byte, dest []RecordRange) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RecordRange{} - b += ReadRecordRange(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RecordRange -func (v RecordRange) Bytes() []byte { - buf := make([]byte, 24) - b := 0 - - { - structBytes := v.CoreRequests.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.CoreReplies.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.ExtRequests.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.ExtReplies.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.DeliveredEvents.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.DeviceEvents.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.Errors.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - if v.ClientStarted { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if v.ClientDied { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Write struct list RecordRange -func RecordRangeListBytes(buf []byte, list []RecordRange) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RecordClientInfo' struct definition -// Size: (8 + pad((int(NumRanges) * 24))) -type RecordClientInfo struct { - ClientResource RecordClientSpec - NumRanges uint32 - Ranges []RecordRange // size: pad((int(NumRanges) * 24)) -} - -// Struct read RecordClientInfo -func ReadRecordClientInfo(buf []byte, v *RecordClientInfo) int { - b := 0 - - v.ClientResource = RecordClientSpec(Get32(buf[b:])) - b += 4 - - v.NumRanges = Get32(buf[b:]) - b += 4 - - v.Ranges = make([]RecordRange, v.NumRanges) - b += ReadRecordRangeList(buf[b:], v.Ranges) - - return b -} - -// Struct list read RecordClientInfo -func ReadRecordClientInfoList(buf []byte, dest []RecordClientInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RecordClientInfo{} - b += ReadRecordClientInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RecordClientInfo -func (v RecordClientInfo) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.NumRanges) * 24)))) - b := 0 - - Put32(buf[b:], uint32(v.ClientResource)) - b += 4 - - Put32(buf[b:], v.NumRanges) - b += 4 - - b += RecordRangeListBytes(buf[b:], v.Ranges) - - return buf -} - -// Write struct list RecordClientInfo -func RecordClientInfoListBytes(buf []byte, list []RecordClientInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size RecordClientInfo -func RecordClientInfoListSize(list []RecordClientInfo) int { - size := 0 - for _, item := range list { - size += (8 + pad((int(item.NumRanges) * 24))) - } - return size -} - -// Error definition RecordBadContext (0) -// Size: 32 - -const BadRecordBadContext = 0 - -type RecordBadContextError struct { - Sequence uint16 - NiceName string - InvalidRecord uint32 -} - -// Error read RecordBadContext -func NewRecordBadContextError(buf []byte) Error { - v := RecordBadContextError{} - v.NiceName = "RecordBadContext" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.InvalidRecord = Get32(buf[b:]) - b += 4 - - return v -} - -func (err RecordBadContextError) ImplementsError() {} - -func (err RecordBadContextError) SequenceId() uint16 { - return err.Sequence -} - -func (err RecordBadContextError) BadId() uint32 { - return 0 -} - -func (err RecordBadContextError) Error() string { - fieldVals := make([]string, 0, 1) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("InvalidRecord: %d", err.InvalidRecord)) - return "BadRecordBadContext {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RECORD"][0] = NewRecordBadContextError -} - -// Request RecordQueryVersion -// size: 8 -type RecordQueryVersionCookie struct { - *cookie -} - -func (c *Conn) RecordQueryVersion(MajorVersion uint16, MinorVersion uint16) RecordQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.recordQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return RecordQueryVersionCookie{cookie} -} - -func (c *Conn) RecordQueryVersionUnchecked(MajorVersion uint16, MinorVersion uint16) RecordQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.recordQueryVersionRequest(MajorVersion, MinorVersion), cookie) - return RecordQueryVersionCookie{cookie} -} - -// Request reply for RecordQueryVersion -// size: 12 -type RecordQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} - -// Waits and reads reply data from request RecordQueryVersion -func (cook RecordQueryVersionCookie) Reply() (*RecordQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return recordQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for RecordQueryVersion -func recordQueryVersionReply(buf []byte) *RecordQueryVersionReply { - v := new(RecordQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook RecordQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordQueryVersion -func (c *Conn) recordQueryVersionRequest(MajorVersion uint16, MinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], MajorVersion) - b += 2 - - Put16(buf[b:], MinorVersion) - b += 2 - - return buf -} - -// Request RecordCreateContext -// size: pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) -type RecordCreateContextCookie struct { - *cookie -} - -// Write request to wire for RecordCreateContext -func (c *Conn) RecordCreateContext(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return RecordCreateContextCookie{cookie} -} - -func (c *Conn) RecordCreateContextChecked(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recordCreateContextRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return RecordCreateContextCookie{cookie} -} - -func (cook RecordCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordCreateContext -func (c *Conn) recordCreateContextRequest(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { - size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - buf[b] = byte(ElementHeader) - b += 1 - - b += 3 // padding - - Put32(buf[b:], NumClientSpecs) - b += 4 - - Put32(buf[b:], NumRanges) - b += 4 - - for i := 0; i < int(NumClientSpecs); i++ { - Put32(buf[b:], uint32(ClientSpecs[i])) - b += 4 - } - b = pad(b) - - b += RecordRangeListBytes(buf[b:], Ranges) - - return buf -} - -// Request RecordRegisterClients -// size: pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) -type RecordRegisterClientsCookie struct { - *cookie -} - -// Write request to wire for RecordRegisterClients -func (c *Conn) RecordRegisterClients(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return RecordRegisterClientsCookie{cookie} -} - -func (c *Conn) RecordRegisterClientsChecked(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) RecordRegisterClientsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recordRegisterClientsRequest(Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return RecordRegisterClientsCookie{cookie} -} - -func (cook RecordRegisterClientsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordRegisterClients -func (c *Conn) recordRegisterClientsRequest(Context RecordContext, ElementHeader RecordElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []RecordClientSpec, Ranges []RecordRange) []byte { - size := pad(((20 + pad((int(NumClientSpecs) * 4))) + pad((int(NumRanges) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - buf[b] = byte(ElementHeader) - b += 1 - - b += 3 // padding - - Put32(buf[b:], NumClientSpecs) - b += 4 - - Put32(buf[b:], NumRanges) - b += 4 - - for i := 0; i < int(NumClientSpecs); i++ { - Put32(buf[b:], uint32(ClientSpecs[i])) - b += 4 - } - b = pad(b) - - b += RecordRangeListBytes(buf[b:], Ranges) - - return buf -} - -// Request RecordUnregisterClients -// size: pad((12 + pad((int(NumClientSpecs) * 4)))) -type RecordUnregisterClientsCookie struct { - *cookie -} - -// Write request to wire for RecordUnregisterClients -func (c *Conn) RecordUnregisterClients(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) - return RecordUnregisterClientsCookie{cookie} -} - -func (c *Conn) RecordUnregisterClientsChecked(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) RecordUnregisterClientsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recordUnregisterClientsRequest(Context, NumClientSpecs, ClientSpecs), cookie) - return RecordUnregisterClientsCookie{cookie} -} - -func (cook RecordUnregisterClientsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordUnregisterClients -func (c *Conn) recordUnregisterClientsRequest(Context RecordContext, NumClientSpecs uint32, ClientSpecs []RecordClientSpec) []byte { - size := pad((12 + pad((int(NumClientSpecs) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], NumClientSpecs) - b += 4 - - for i := 0; i < int(NumClientSpecs); i++ { - Put32(buf[b:], uint32(ClientSpecs[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RecordGetContext -// size: 8 -type RecordGetContextCookie struct { - *cookie -} - -func (c *Conn) RecordGetContext(Context RecordContext) RecordGetContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.recordGetContextRequest(Context), cookie) - return RecordGetContextCookie{cookie} -} - -func (c *Conn) RecordGetContextUnchecked(Context RecordContext) RecordGetContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.recordGetContextRequest(Context), cookie) - return RecordGetContextCookie{cookie} -} - -// Request reply for RecordGetContext -// size: (32 + RecordClientInfoListSize(InterceptedClients)) -type RecordGetContextReply struct { - Sequence uint16 - Length uint32 - Enabled bool - ElementHeader RecordElementHeader - // padding: 3 bytes - NumInterceptedClients uint32 - // padding: 16 bytes - InterceptedClients []RecordClientInfo // size: RecordClientInfoListSize(InterceptedClients) -} - -// Waits and reads reply data from request RecordGetContext -func (cook RecordGetContextCookie) Reply() (*RecordGetContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return recordGetContextReply(buf), nil -} - -// Read reply into structure from buffer for RecordGetContext -func recordGetContextReply(buf []byte) *RecordGetContextReply { - v := new(RecordGetContextReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Enabled = true - } else { - v.Enabled = false - } - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ElementHeader = RecordElementHeader(buf[b]) - b += 1 - - b += 3 // padding - - v.NumInterceptedClients = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.InterceptedClients = make([]RecordClientInfo, v.NumInterceptedClients) - b += ReadRecordClientInfoList(buf[b:], v.InterceptedClients) - - return v -} - -func (cook RecordGetContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordGetContext -func (c *Conn) recordGetContextRequest(Context RecordContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request RecordEnableContext -// size: 8 -type RecordEnableContextCookie struct { - *cookie -} - -func (c *Conn) RecordEnableContext(Context RecordContext) RecordEnableContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.recordEnableContextRequest(Context), cookie) - return RecordEnableContextCookie{cookie} -} - -func (c *Conn) RecordEnableContextUnchecked(Context RecordContext) RecordEnableContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.recordEnableContextRequest(Context), cookie) - return RecordEnableContextCookie{cookie} -} - -// Request reply for RecordEnableContext -// size: (32 + pad(((int(Length) * 4) * 1))) -type RecordEnableContextReply struct { - Sequence uint16 - Length uint32 - Category byte - ElementHeader RecordElementHeader - ClientSwapped bool - // padding: 2 bytes - XidBase uint32 - ServerTime uint32 - RecSequenceNum uint32 - // padding: 8 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) -} - -// Waits and reads reply data from request RecordEnableContext -func (cook RecordEnableContextCookie) Reply() (*RecordEnableContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return recordEnableContextReply(buf), nil -} - -// Read reply into structure from buffer for RecordEnableContext -func recordEnableContextReply(buf []byte) *RecordEnableContextReply { - v := new(RecordEnableContextReply) - b := 1 // skip reply determinant - - v.Category = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ElementHeader = RecordElementHeader(buf[b]) - b += 1 - - if buf[b] == 1 { - v.ClientSwapped = true - } else { - v.ClientSwapped = false - } - b += 1 - - b += 2 // padding - - v.XidBase = Get32(buf[b:]) - b += 4 - - v.ServerTime = Get32(buf[b:]) - b += 4 - - v.RecSequenceNum = Get32(buf[b:]) - b += 4 - - b += 8 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) - - return v -} - -func (cook RecordEnableContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordEnableContext -func (c *Conn) recordEnableContextRequest(Context RecordContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request RecordDisableContext -// size: 8 -type RecordDisableContextCookie struct { - *cookie -} - -// Write request to wire for RecordDisableContext -func (c *Conn) RecordDisableContext(Context RecordContext) RecordDisableContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recordDisableContextRequest(Context), cookie) - return RecordDisableContextCookie{cookie} -} - -func (c *Conn) RecordDisableContextChecked(Context RecordContext) RecordDisableContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recordDisableContextRequest(Context), cookie) - return RecordDisableContextCookie{cookie} -} - -func (cook RecordDisableContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordDisableContext -func (c *Conn) recordDisableContextRequest(Context RecordContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request RecordFreeContext -// size: 8 -type RecordFreeContextCookie struct { - *cookie -} - -// Write request to wire for RecordFreeContext -func (c *Conn) RecordFreeContext(Context RecordContext) RecordFreeContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recordFreeContextRequest(Context), cookie) - return RecordFreeContextCookie{cookie} -} - -func (c *Conn) RecordFreeContextChecked(Context RecordContext) RecordFreeContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recordFreeContextRequest(Context), cookie) - return RecordFreeContextCookie{cookie} -} - -func (cook RecordFreeContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for RecordFreeContext -func (c *Conn) recordFreeContextRequest(Context RecordContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RECORD"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} diff --git a/nexgb/auto_render.go b/nexgb/auto_render.go deleted file mode 100644 index 5e1ff12..0000000 --- a/nexgb/auto_render.go +++ /dev/null @@ -1,3556 +0,0 @@ -package xgb - -/* - This file was generated by render.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// RenderInit must be called before using the RENDER extension. -func (c *Conn) RenderInit() error { - reply, err := c.QueryExtension(6, "RENDER").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named RENDER could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["RENDER"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["RENDER"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["RENDER"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["RENDER"] = make(map[int]newEventFun) - newExtErrorFuncs["RENDER"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -const ( - RenderPictTypeIndexed = 0 - RenderPictTypeDirect = 1 -) - -const ( - RenderPictureNone = 0 -) - -const ( - RenderPictOpClear = 0 - RenderPictOpSrc = 1 - RenderPictOpDst = 2 - RenderPictOpOver = 3 - RenderPictOpOverReverse = 4 - RenderPictOpIn = 5 - RenderPictOpInReverse = 6 - RenderPictOpOut = 7 - RenderPictOpOutReverse = 8 - RenderPictOpAtop = 9 - RenderPictOpAtopReverse = 10 - RenderPictOpXor = 11 - RenderPictOpAdd = 12 - RenderPictOpSaturate = 13 - RenderPictOpDisjointClear = 16 - RenderPictOpDisjointSrc = 17 - RenderPictOpDisjointDst = 18 - RenderPictOpDisjointOver = 19 - RenderPictOpDisjointOverReverse = 20 - RenderPictOpDisjointIn = 21 - RenderPictOpDisjointInReverse = 22 - RenderPictOpDisjointOut = 23 - RenderPictOpDisjointOutReverse = 24 - RenderPictOpDisjointAtop = 25 - RenderPictOpDisjointAtopReverse = 26 - RenderPictOpDisjointXor = 27 - RenderPictOpConjointClear = 32 - RenderPictOpConjointSrc = 33 - RenderPictOpConjointDst = 34 - RenderPictOpConjointOver = 35 - RenderPictOpConjointOverReverse = 36 - RenderPictOpConjointIn = 37 - RenderPictOpConjointInReverse = 38 - RenderPictOpConjointOut = 39 - RenderPictOpConjointOutReverse = 40 - RenderPictOpConjointAtop = 41 - RenderPictOpConjointAtopReverse = 42 - RenderPictOpConjointXor = 43 - RenderPictOpMultiply = 48 - RenderPictOpScreen = 49 - RenderPictOpOverlay = 50 - RenderPictOpDarken = 51 - RenderPictOpLighten = 52 - RenderPictOpColorDodge = 53 - RenderPictOpColorBurn = 54 - RenderPictOpHardLight = 55 - RenderPictOpSoftLight = 56 - RenderPictOpDifference = 57 - RenderPictOpExclusion = 58 - RenderPictOpHSLHue = 59 - RenderPictOpHSLSaturation = 60 - RenderPictOpHSLColor = 61 - RenderPictOpHSLLuminosity = 62 -) - -const ( - RenderPolyEdgeSharp = 0 - RenderPolyEdgeSmooth = 1 -) - -const ( - RenderPolyModePrecise = 0 - RenderPolyModeImprecise = 1 -) - -const ( - RenderCpRepeat = 1 - RenderCpAlphaMap = 2 - RenderCpAlphaXOrigin = 4 - RenderCpAlphaYOrigin = 8 - RenderCpClipXOrigin = 16 - RenderCpClipYOrigin = 32 - RenderCpClipMask = 64 - RenderCpGraphicsExposure = 128 - RenderCpSubwindowMode = 256 - RenderCpPolyEdge = 512 - RenderCpPolyMode = 1024 - RenderCpDither = 2048 - RenderCpComponentAlpha = 4096 -) - -const ( - RenderSubPixelUnknown = 0 - RenderSubPixelHorizontalRGB = 1 - RenderSubPixelHorizontalBGR = 2 - RenderSubPixelVerticalRGB = 3 - RenderSubPixelVerticalBGR = 4 - RenderSubPixelNone = 5 -) - -const ( - RenderRepeatNone = 0 - RenderRepeatNormal = 1 - RenderRepeatPad = 2 - RenderRepeatReflect = 3 -) - -type RenderGlyphset uint32 - -func (c *Conn) NewRenderGlyphsetId() (RenderGlyphset, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RenderGlyphset(id), nil -} - -type RenderPicture uint32 - -func (c *Conn) NewRenderPictureId() (RenderPicture, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RenderPicture(id), nil -} - -type RenderPictformat uint32 - -func (c *Conn) NewRenderPictformatId() (RenderPictformat, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return RenderPictformat(id), nil -} - -type RenderGlyph uint32 - -type RenderFixed int32 - -// 'RenderDirectformat' struct definition -// Size: 16 -type RenderDirectformat struct { - RedShift uint16 - RedMask uint16 - GreenShift uint16 - GreenMask uint16 - BlueShift uint16 - BlueMask uint16 - AlphaShift uint16 - AlphaMask uint16 -} - -// Struct read RenderDirectformat -func ReadRenderDirectformat(buf []byte, v *RenderDirectformat) int { - b := 0 - - v.RedShift = Get16(buf[b:]) - b += 2 - - v.RedMask = Get16(buf[b:]) - b += 2 - - v.GreenShift = Get16(buf[b:]) - b += 2 - - v.GreenMask = Get16(buf[b:]) - b += 2 - - v.BlueShift = Get16(buf[b:]) - b += 2 - - v.BlueMask = Get16(buf[b:]) - b += 2 - - v.AlphaShift = Get16(buf[b:]) - b += 2 - - v.AlphaMask = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RenderDirectformat -func ReadRenderDirectformatList(buf []byte, dest []RenderDirectformat) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderDirectformat{} - b += ReadRenderDirectformat(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderDirectformat -func (v RenderDirectformat) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - Put16(buf[b:], v.RedShift) - b += 2 - - Put16(buf[b:], v.RedMask) - b += 2 - - Put16(buf[b:], v.GreenShift) - b += 2 - - Put16(buf[b:], v.GreenMask) - b += 2 - - Put16(buf[b:], v.BlueShift) - b += 2 - - Put16(buf[b:], v.BlueMask) - b += 2 - - Put16(buf[b:], v.AlphaShift) - b += 2 - - Put16(buf[b:], v.AlphaMask) - b += 2 - - return buf -} - -// Write struct list RenderDirectformat -func RenderDirectformatListBytes(buf []byte, list []RenderDirectformat) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderPictforminfo' struct definition -// Size: 28 -type RenderPictforminfo struct { - Id RenderPictformat - Type byte - Depth byte - // padding: 2 bytes - Direct RenderDirectformat - Colormap Colormap -} - -// Struct read RenderPictforminfo -func ReadRenderPictforminfo(buf []byte, v *RenderPictforminfo) int { - b := 0 - - v.Id = RenderPictformat(Get32(buf[b:])) - b += 4 - - v.Type = buf[b] - b += 1 - - v.Depth = buf[b] - b += 1 - - b += 2 // padding - - v.Direct = RenderDirectformat{} - b += ReadRenderDirectformat(buf[b:], &v.Direct) - - v.Colormap = Colormap(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read RenderPictforminfo -func ReadRenderPictforminfoList(buf []byte, dest []RenderPictforminfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderPictforminfo{} - b += ReadRenderPictforminfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderPictforminfo -func (v RenderPictforminfo) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put32(buf[b:], uint32(v.Id)) - b += 4 - - buf[b] = v.Type - b += 1 - - buf[b] = v.Depth - b += 1 - - b += 2 // padding - - { - structBytes := v.Direct.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(v.Colormap)) - b += 4 - - return buf -} - -// Write struct list RenderPictforminfo -func RenderPictforminfoListBytes(buf []byte, list []RenderPictforminfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderPictvisual' struct definition -// Size: 8 -type RenderPictvisual struct { - Visual Visualid - Format RenderPictformat -} - -// Struct read RenderPictvisual -func ReadRenderPictvisual(buf []byte, v *RenderPictvisual) int { - b := 0 - - v.Visual = Visualid(Get32(buf[b:])) - b += 4 - - v.Format = RenderPictformat(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read RenderPictvisual -func ReadRenderPictvisualList(buf []byte, dest []RenderPictvisual) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderPictvisual{} - b += ReadRenderPictvisual(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderPictvisual -func (v RenderPictvisual) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.Visual)) - b += 4 - - Put32(buf[b:], uint32(v.Format)) - b += 4 - - return buf -} - -// Write struct list RenderPictvisual -func RenderPictvisualListBytes(buf []byte, list []RenderPictvisual) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderPictdepth' struct definition -// Size: (8 + pad((int(NumVisuals) * 8))) -type RenderPictdepth struct { - Depth byte - // padding: 1 bytes - NumVisuals uint16 - // padding: 4 bytes - Visuals []RenderPictvisual // size: pad((int(NumVisuals) * 8)) -} - -// Struct read RenderPictdepth -func ReadRenderPictdepth(buf []byte, v *RenderPictdepth) int { - b := 0 - - v.Depth = buf[b] - b += 1 - - b += 1 // padding - - v.NumVisuals = Get16(buf[b:]) - b += 2 - - b += 4 // padding - - v.Visuals = make([]RenderPictvisual, v.NumVisuals) - b += ReadRenderPictvisualList(buf[b:], v.Visuals) - - return b -} - -// Struct list read RenderPictdepth -func ReadRenderPictdepthList(buf []byte, dest []RenderPictdepth) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderPictdepth{} - b += ReadRenderPictdepth(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderPictdepth -func (v RenderPictdepth) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.NumVisuals) * 8)))) - b := 0 - - buf[b] = v.Depth - b += 1 - - b += 1 // padding - - Put16(buf[b:], v.NumVisuals) - b += 2 - - b += 4 // padding - - b += RenderPictvisualListBytes(buf[b:], v.Visuals) - - return buf -} - -// Write struct list RenderPictdepth -func RenderPictdepthListBytes(buf []byte, list []RenderPictdepth) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size RenderPictdepth -func RenderPictdepthListSize(list []RenderPictdepth) int { - size := 0 - for _, item := range list { - size += (8 + pad((int(item.NumVisuals) * 8))) - } - return size -} - -// 'RenderPictscreen' struct definition -// Size: (8 + RenderPictdepthListSize(Depths)) -type RenderPictscreen struct { - NumDepths uint32 - Fallback RenderPictformat - Depths []RenderPictdepth // size: RenderPictdepthListSize(Depths) -} - -// Struct read RenderPictscreen -func ReadRenderPictscreen(buf []byte, v *RenderPictscreen) int { - b := 0 - - v.NumDepths = Get32(buf[b:]) - b += 4 - - v.Fallback = RenderPictformat(Get32(buf[b:])) - b += 4 - - v.Depths = make([]RenderPictdepth, v.NumDepths) - b += ReadRenderPictdepthList(buf[b:], v.Depths) - - return b -} - -// Struct list read RenderPictscreen -func ReadRenderPictscreenList(buf []byte, dest []RenderPictscreen) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderPictscreen{} - b += ReadRenderPictscreen(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderPictscreen -func (v RenderPictscreen) Bytes() []byte { - buf := make([]byte, (8 + RenderPictdepthListSize(v.Depths))) - b := 0 - - Put32(buf[b:], v.NumDepths) - b += 4 - - Put32(buf[b:], uint32(v.Fallback)) - b += 4 - - b += RenderPictdepthListBytes(buf[b:], v.Depths) - - return buf -} - -// Write struct list RenderPictscreen -func RenderPictscreenListBytes(buf []byte, list []RenderPictscreen) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size RenderPictscreen -func RenderPictscreenListSize(list []RenderPictscreen) int { - size := 0 - for _, item := range list { - size += (8 + RenderPictdepthListSize(item.Depths)) - } - return size -} - -// 'RenderIndexvalue' struct definition -// Size: 12 -type RenderIndexvalue struct { - Pixel uint32 - Red uint16 - Green uint16 - Blue uint16 - Alpha uint16 -} - -// Struct read RenderIndexvalue -func ReadRenderIndexvalue(buf []byte, v *RenderIndexvalue) int { - b := 0 - - v.Pixel = Get32(buf[b:]) - b += 4 - - v.Red = Get16(buf[b:]) - b += 2 - - v.Green = Get16(buf[b:]) - b += 2 - - v.Blue = Get16(buf[b:]) - b += 2 - - v.Alpha = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RenderIndexvalue -func ReadRenderIndexvalueList(buf []byte, dest []RenderIndexvalue) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderIndexvalue{} - b += ReadRenderIndexvalue(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderIndexvalue -func (v RenderIndexvalue) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - Put32(buf[b:], v.Pixel) - b += 4 - - Put16(buf[b:], v.Red) - b += 2 - - Put16(buf[b:], v.Green) - b += 2 - - Put16(buf[b:], v.Blue) - b += 2 - - Put16(buf[b:], v.Alpha) - b += 2 - - return buf -} - -// Write struct list RenderIndexvalue -func RenderIndexvalueListBytes(buf []byte, list []RenderIndexvalue) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderColor' struct definition -// Size: 8 -type RenderColor struct { - Red uint16 - Green uint16 - Blue uint16 - Alpha uint16 -} - -// Struct read RenderColor -func ReadRenderColor(buf []byte, v *RenderColor) int { - b := 0 - - v.Red = Get16(buf[b:]) - b += 2 - - v.Green = Get16(buf[b:]) - b += 2 - - v.Blue = Get16(buf[b:]) - b += 2 - - v.Alpha = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read RenderColor -func ReadRenderColorList(buf []byte, dest []RenderColor) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderColor{} - b += ReadRenderColor(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderColor -func (v RenderColor) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.Red) - b += 2 - - Put16(buf[b:], v.Green) - b += 2 - - Put16(buf[b:], v.Blue) - b += 2 - - Put16(buf[b:], v.Alpha) - b += 2 - - return buf -} - -// Write struct list RenderColor -func RenderColorListBytes(buf []byte, list []RenderColor) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderPointfix' struct definition -// Size: 8 -type RenderPointfix struct { - X RenderFixed - Y RenderFixed -} - -// Struct read RenderPointfix -func ReadRenderPointfix(buf []byte, v *RenderPointfix) int { - b := 0 - - v.X = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Y = RenderFixed(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read RenderPointfix -func ReadRenderPointfixList(buf []byte, dest []RenderPointfix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderPointfix -func (v RenderPointfix) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.X)) - b += 4 - - Put32(buf[b:], uint32(v.Y)) - b += 4 - - return buf -} - -// Write struct list RenderPointfix -func RenderPointfixListBytes(buf []byte, list []RenderPointfix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderLinefix' struct definition -// Size: 16 -type RenderLinefix struct { - P1 RenderPointfix - P2 RenderPointfix -} - -// Struct read RenderLinefix -func ReadRenderLinefix(buf []byte, v *RenderLinefix) int { - b := 0 - - v.P1 = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &v.P1) - - v.P2 = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &v.P2) - - return b -} - -// Struct list read RenderLinefix -func ReadRenderLinefixList(buf []byte, dest []RenderLinefix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderLinefix{} - b += ReadRenderLinefix(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderLinefix -func (v RenderLinefix) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - { - structBytes := v.P1.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.P2.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list RenderLinefix -func RenderLinefixListBytes(buf []byte, list []RenderLinefix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderTriangle' struct definition -// Size: 24 -type RenderTriangle struct { - P1 RenderPointfix - P2 RenderPointfix - P3 RenderPointfix -} - -// Struct read RenderTriangle -func ReadRenderTriangle(buf []byte, v *RenderTriangle) int { - b := 0 - - v.P1 = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &v.P1) - - v.P2 = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &v.P2) - - v.P3 = RenderPointfix{} - b += ReadRenderPointfix(buf[b:], &v.P3) - - return b -} - -// Struct list read RenderTriangle -func ReadRenderTriangleList(buf []byte, dest []RenderTriangle) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderTriangle{} - b += ReadRenderTriangle(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderTriangle -func (v RenderTriangle) Bytes() []byte { - buf := make([]byte, 24) - b := 0 - - { - structBytes := v.P1.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.P2.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.P3.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list RenderTriangle -func RenderTriangleListBytes(buf []byte, list []RenderTriangle) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderTrapezoid' struct definition -// Size: 40 -type RenderTrapezoid struct { - Top RenderFixed - Bottom RenderFixed - Left RenderLinefix - Right RenderLinefix -} - -// Struct read RenderTrapezoid -func ReadRenderTrapezoid(buf []byte, v *RenderTrapezoid) int { - b := 0 - - v.Top = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Bottom = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Left = RenderLinefix{} - b += ReadRenderLinefix(buf[b:], &v.Left) - - v.Right = RenderLinefix{} - b += ReadRenderLinefix(buf[b:], &v.Right) - - return b -} - -// Struct list read RenderTrapezoid -func ReadRenderTrapezoidList(buf []byte, dest []RenderTrapezoid) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderTrapezoid{} - b += ReadRenderTrapezoid(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderTrapezoid -func (v RenderTrapezoid) Bytes() []byte { - buf := make([]byte, 40) - b := 0 - - Put32(buf[b:], uint32(v.Top)) - b += 4 - - Put32(buf[b:], uint32(v.Bottom)) - b += 4 - - { - structBytes := v.Left.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.Right.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list RenderTrapezoid -func RenderTrapezoidListBytes(buf []byte, list []RenderTrapezoid) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderGlyphinfo' struct definition -// Size: 12 -type RenderGlyphinfo struct { - Width uint16 - Height uint16 - X int16 - Y int16 - XOff int16 - YOff int16 -} - -// Struct read RenderGlyphinfo -func ReadRenderGlyphinfo(buf []byte, v *RenderGlyphinfo) int { - b := 0 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.X = int16(Get16(buf[b:])) - b += 2 - - v.Y = int16(Get16(buf[b:])) - b += 2 - - v.XOff = int16(Get16(buf[b:])) - b += 2 - - v.YOff = int16(Get16(buf[b:])) - b += 2 - - return b -} - -// Struct list read RenderGlyphinfo -func ReadRenderGlyphinfoList(buf []byte, dest []RenderGlyphinfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderGlyphinfo{} - b += ReadRenderGlyphinfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderGlyphinfo -func (v RenderGlyphinfo) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put16(buf[b:], uint16(v.X)) - b += 2 - - Put16(buf[b:], uint16(v.Y)) - b += 2 - - Put16(buf[b:], uint16(v.XOff)) - b += 2 - - Put16(buf[b:], uint16(v.YOff)) - b += 2 - - return buf -} - -// Write struct list RenderGlyphinfo -func RenderGlyphinfoListBytes(buf []byte, list []RenderGlyphinfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderTransform' struct definition -// Size: 36 -type RenderTransform struct { - Matrix11 RenderFixed - Matrix12 RenderFixed - Matrix13 RenderFixed - Matrix21 RenderFixed - Matrix22 RenderFixed - Matrix23 RenderFixed - Matrix31 RenderFixed - Matrix32 RenderFixed - Matrix33 RenderFixed -} - -// Struct read RenderTransform -func ReadRenderTransform(buf []byte, v *RenderTransform) int { - b := 0 - - v.Matrix11 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix12 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix13 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix21 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix22 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix23 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix31 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix32 = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Matrix33 = RenderFixed(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read RenderTransform -func ReadRenderTransformList(buf []byte, dest []RenderTransform) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderTransform{} - b += ReadRenderTransform(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderTransform -func (v RenderTransform) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - Put32(buf[b:], uint32(v.Matrix11)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix12)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix13)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix21)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix22)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix23)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix31)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix32)) - b += 4 - - Put32(buf[b:], uint32(v.Matrix33)) - b += 4 - - return buf -} - -// Write struct list RenderTransform -func RenderTransformListBytes(buf []byte, list []RenderTransform) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderAnimcursorelt' struct definition -// Size: 8 -type RenderAnimcursorelt struct { - Cursor Cursor - Delay uint32 -} - -// Struct read RenderAnimcursorelt -func ReadRenderAnimcursorelt(buf []byte, v *RenderAnimcursorelt) int { - b := 0 - - v.Cursor = Cursor(Get32(buf[b:])) - b += 4 - - v.Delay = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read RenderAnimcursorelt -func ReadRenderAnimcursoreltList(buf []byte, dest []RenderAnimcursorelt) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderAnimcursorelt{} - b += ReadRenderAnimcursorelt(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderAnimcursorelt -func (v RenderAnimcursorelt) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.Cursor)) - b += 4 - - Put32(buf[b:], v.Delay) - b += 4 - - return buf -} - -// Write struct list RenderAnimcursorelt -func RenderAnimcursoreltListBytes(buf []byte, list []RenderAnimcursorelt) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderSpanfix' struct definition -// Size: 12 -type RenderSpanfix struct { - L RenderFixed - R RenderFixed - Y RenderFixed -} - -// Struct read RenderSpanfix -func ReadRenderSpanfix(buf []byte, v *RenderSpanfix) int { - b := 0 - - v.L = RenderFixed(Get32(buf[b:])) - b += 4 - - v.R = RenderFixed(Get32(buf[b:])) - b += 4 - - v.Y = RenderFixed(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read RenderSpanfix -func ReadRenderSpanfixList(buf []byte, dest []RenderSpanfix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderSpanfix{} - b += ReadRenderSpanfix(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderSpanfix -func (v RenderSpanfix) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - Put32(buf[b:], uint32(v.L)) - b += 4 - - Put32(buf[b:], uint32(v.R)) - b += 4 - - Put32(buf[b:], uint32(v.Y)) - b += 4 - - return buf -} - -// Write struct list RenderSpanfix -func RenderSpanfixListBytes(buf []byte, list []RenderSpanfix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'RenderTrap' struct definition -// Size: 24 -type RenderTrap struct { - Top RenderSpanfix - Bot RenderSpanfix -} - -// Struct read RenderTrap -func ReadRenderTrap(buf []byte, v *RenderTrap) int { - b := 0 - - v.Top = RenderSpanfix{} - b += ReadRenderSpanfix(buf[b:], &v.Top) - - v.Bot = RenderSpanfix{} - b += ReadRenderSpanfix(buf[b:], &v.Bot) - - return b -} - -// Struct list read RenderTrap -func ReadRenderTrapList(buf []byte, dest []RenderTrap) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RenderTrap{} - b += ReadRenderTrap(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write RenderTrap -func (v RenderTrap) Bytes() []byte { - buf := make([]byte, 24) - b := 0 - - { - structBytes := v.Top.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.Bot.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list RenderTrap -func RenderTrapListBytes(buf []byte, list []RenderTrap) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Error definition RenderPictFormat (0) -// Size: 32 - -const BadRenderPictFormat = 0 - -type RenderPictFormatError struct { - Sequence uint16 - NiceName string -} - -// Error read RenderPictFormat -func NewRenderPictFormatError(buf []byte) Error { - v := RenderPictFormatError{} - v.NiceName = "RenderPictFormat" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RenderPictFormatError) ImplementsError() {} - -func (err RenderPictFormatError) SequenceId() uint16 { - return err.Sequence -} - -func (err RenderPictFormatError) BadId() uint32 { - return 0 -} - -func (err RenderPictFormatError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRenderPictFormat {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RENDER"][0] = NewRenderPictFormatError -} - -// Error definition RenderPicture (1) -// Size: 32 - -const BadRenderPicture = 1 - -type RenderPictureError struct { - Sequence uint16 - NiceName string -} - -// Error read RenderPicture -func NewRenderPictureError(buf []byte) Error { - v := RenderPictureError{} - v.NiceName = "RenderPicture" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RenderPictureError) ImplementsError() {} - -func (err RenderPictureError) SequenceId() uint16 { - return err.Sequence -} - -func (err RenderPictureError) BadId() uint32 { - return 0 -} - -func (err RenderPictureError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRenderPicture {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RENDER"][1] = NewRenderPictureError -} - -// Error definition RenderPictOp (2) -// Size: 32 - -const BadRenderPictOp = 2 - -type RenderPictOpError struct { - Sequence uint16 - NiceName string -} - -// Error read RenderPictOp -func NewRenderPictOpError(buf []byte) Error { - v := RenderPictOpError{} - v.NiceName = "RenderPictOp" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RenderPictOpError) ImplementsError() {} - -func (err RenderPictOpError) SequenceId() uint16 { - return err.Sequence -} - -func (err RenderPictOpError) BadId() uint32 { - return 0 -} - -func (err RenderPictOpError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRenderPictOp {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RENDER"][2] = NewRenderPictOpError -} - -// Error definition RenderGlyphSet (3) -// Size: 32 - -const BadRenderGlyphSet = 3 - -type RenderGlyphSetError struct { - Sequence uint16 - NiceName string -} - -// Error read RenderGlyphSet -func NewRenderGlyphSetError(buf []byte) Error { - v := RenderGlyphSetError{} - v.NiceName = "RenderGlyphSet" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RenderGlyphSetError) ImplementsError() {} - -func (err RenderGlyphSetError) SequenceId() uint16 { - return err.Sequence -} - -func (err RenderGlyphSetError) BadId() uint32 { - return 0 -} - -func (err RenderGlyphSetError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRenderGlyphSet {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RENDER"][3] = NewRenderGlyphSetError -} - -// Error definition RenderGlyph (4) -// Size: 32 - -const BadRenderGlyph = 4 - -type RenderGlyphError struct { - Sequence uint16 - NiceName string -} - -// Error read RenderGlyph -func NewRenderGlyphError(buf []byte) Error { - v := RenderGlyphError{} - v.NiceName = "RenderGlyph" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err RenderGlyphError) ImplementsError() {} - -func (err RenderGlyphError) SequenceId() uint16 { - return err.Sequence -} - -func (err RenderGlyphError) BadId() uint32 { - return 0 -} - -func (err RenderGlyphError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadRenderGlyph {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["RENDER"][4] = NewRenderGlyphError -} - -// Request RenderQueryVersion -// size: 12 -type RenderQueryVersionCookie struct { - *cookie -} - -func (c *Conn) RenderQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) RenderQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.renderQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return RenderQueryVersionCookie{cookie} -} - -func (c *Conn) RenderQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) RenderQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.renderQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return RenderQueryVersionCookie{cookie} -} - -// Request reply for RenderQueryVersion -// size: 32 -type RenderQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request RenderQueryVersion -func (cook RenderQueryVersionCookie) Reply() (*RenderQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return renderQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for RenderQueryVersion -func renderQueryVersionReply(buf []byte) *RenderQueryVersionReply { - v := new(RenderQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook RenderQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderQueryVersion -func (c *Conn) renderQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ClientMajorVersion) - b += 4 - - Put32(buf[b:], ClientMinorVersion) - b += 4 - - return buf -} - -// Request RenderQueryPictFormats -// size: 4 -type RenderQueryPictFormatsCookie struct { - *cookie -} - -func (c *Conn) RenderQueryPictFormats() RenderQueryPictFormatsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.renderQueryPictFormatsRequest(), cookie) - return RenderQueryPictFormatsCookie{cookie} -} - -func (c *Conn) RenderQueryPictFormatsUnchecked() RenderQueryPictFormatsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.renderQueryPictFormatsRequest(), cookie) - return RenderQueryPictFormatsCookie{cookie} -} - -// Request reply for RenderQueryPictFormats -// size: (((32 + pad((int(NumFormats) * 28))) + RenderPictscreenListSize(Screens)) + pad((int(NumSubpixel) * 4))) -type RenderQueryPictFormatsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumFormats uint32 - NumScreens uint32 - NumDepths uint32 - NumVisuals uint32 - NumSubpixel uint32 - // padding: 4 bytes - Formats []RenderPictforminfo // size: pad((int(NumFormats) * 28)) - Screens []RenderPictscreen // size: RenderPictscreenListSize(Screens) - Subpixels []uint32 // size: pad((int(NumSubpixel) * 4)) -} - -// Waits and reads reply data from request RenderQueryPictFormats -func (cook RenderQueryPictFormatsCookie) Reply() (*RenderQueryPictFormatsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return renderQueryPictFormatsReply(buf), nil -} - -// Read reply into structure from buffer for RenderQueryPictFormats -func renderQueryPictFormatsReply(buf []byte) *RenderQueryPictFormatsReply { - v := new(RenderQueryPictFormatsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFormats = Get32(buf[b:]) - b += 4 - - v.NumScreens = Get32(buf[b:]) - b += 4 - - v.NumDepths = Get32(buf[b:]) - b += 4 - - v.NumVisuals = Get32(buf[b:]) - b += 4 - - v.NumSubpixel = Get32(buf[b:]) - b += 4 - - b += 4 // padding - - v.Formats = make([]RenderPictforminfo, v.NumFormats) - b += ReadRenderPictforminfoList(buf[b:], v.Formats) - - v.Screens = make([]RenderPictscreen, v.NumScreens) - b += ReadRenderPictscreenList(buf[b:], v.Screens) - - v.Subpixels = make([]uint32, v.NumSubpixel) - for i := 0; i < int(v.NumSubpixel); i++ { - v.Subpixels[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook RenderQueryPictFormatsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderQueryPictFormats -func (c *Conn) renderQueryPictFormatsRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request RenderQueryPictIndexValues -// size: 8 -type RenderQueryPictIndexValuesCookie struct { - *cookie -} - -func (c *Conn) RenderQueryPictIndexValues(Format RenderPictformat) RenderQueryPictIndexValuesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) - return RenderQueryPictIndexValuesCookie{cookie} -} - -func (c *Conn) RenderQueryPictIndexValuesUnchecked(Format RenderPictformat) RenderQueryPictIndexValuesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.renderQueryPictIndexValuesRequest(Format), cookie) - return RenderQueryPictIndexValuesCookie{cookie} -} - -// Request reply for RenderQueryPictIndexValues -// size: (32 + pad((int(NumValues) * 12))) -type RenderQueryPictIndexValuesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumValues uint32 - // padding: 20 bytes - Values []RenderIndexvalue // size: pad((int(NumValues) * 12)) -} - -// Waits and reads reply data from request RenderQueryPictIndexValues -func (cook RenderQueryPictIndexValuesCookie) Reply() (*RenderQueryPictIndexValuesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return renderQueryPictIndexValuesReply(buf), nil -} - -// Read reply into structure from buffer for RenderQueryPictIndexValues -func renderQueryPictIndexValuesReply(buf []byte) *RenderQueryPictIndexValuesReply { - v := new(RenderQueryPictIndexValuesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumValues = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Values = make([]RenderIndexvalue, v.NumValues) - b += ReadRenderIndexvalueList(buf[b:], v.Values) - - return v -} - -func (cook RenderQueryPictIndexValuesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderQueryPictIndexValues -func (c *Conn) renderQueryPictIndexValuesRequest(Format RenderPictformat) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Format)) - b += 4 - - return buf -} - -// Request RenderCreatePicture -// size: pad((16 + (4 + pad((4 * popCount(int(ValueMask))))))) -type RenderCreatePictureCookie struct { - *cookie -} - -// Write request to wire for RenderCreatePicture -func (c *Conn) RenderCreatePicture(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) - return RenderCreatePictureCookie{cookie} -} - -func (c *Conn) RenderCreatePictureChecked(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) RenderCreatePictureCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreatePictureRequest(Pid, Drawable, Format, ValueMask, ValueList), cookie) - return RenderCreatePictureCookie{cookie} -} - -func (cook RenderCreatePictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreatePicture -func (c *Conn) renderCreatePictureRequest(Pid RenderPicture, Drawable Drawable, Format RenderPictformat, ValueMask uint32, ValueList []uint32) []byte { - size := pad((16 + (4 + pad((4 * popCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Pid)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Format)) - b += 4 - - Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RenderChangePicture -// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) -type RenderChangePictureCookie struct { - *cookie -} - -// Write request to wire for RenderChangePicture -func (c *Conn) RenderChangePicture(Picture RenderPicture, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) - return RenderChangePictureCookie{cookie} -} - -func (c *Conn) RenderChangePictureChecked(Picture RenderPicture, ValueMask uint32, ValueList []uint32) RenderChangePictureCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderChangePictureRequest(Picture, ValueMask, ValueList), cookie) - return RenderChangePictureCookie{cookie} -} - -func (cook RenderChangePictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderChangePicture -func (c *Conn) renderChangePictureRequest(Picture RenderPicture, ValueMask uint32, ValueList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RenderSetPictureClipRectangles -// size: pad((12 + pad((len(Rectangles) * 8)))) -type RenderSetPictureClipRectanglesCookie struct { - *cookie -} - -// Write request to wire for RenderSetPictureClipRectangles -func (c *Conn) RenderSetPictureClipRectangles(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return RenderSetPictureClipRectanglesCookie{cookie} -} - -func (c *Conn) RenderSetPictureClipRectanglesChecked(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) RenderSetPictureClipRectanglesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderSetPictureClipRectanglesRequest(Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return RenderSetPictureClipRectanglesCookie{cookie} -} - -func (cook RenderSetPictureClipRectanglesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderSetPictureClipRectangles -func (c *Conn) renderSetPictureClipRectanglesRequest(Picture RenderPicture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { - size := pad((12 + pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - Put16(buf[b:], uint16(ClipXOrigin)) - b += 2 - - Put16(buf[b:], uint16(ClipYOrigin)) - b += 2 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// Request RenderFreePicture -// size: 8 -type RenderFreePictureCookie struct { - *cookie -} - -// Write request to wire for RenderFreePicture -func (c *Conn) RenderFreePicture(Picture RenderPicture) RenderFreePictureCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderFreePictureRequest(Picture), cookie) - return RenderFreePictureCookie{cookie} -} - -func (c *Conn) RenderFreePictureChecked(Picture RenderPicture) RenderFreePictureCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderFreePictureRequest(Picture), cookie) - return RenderFreePictureCookie{cookie} -} - -func (cook RenderFreePictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderFreePicture -func (c *Conn) renderFreePictureRequest(Picture RenderPicture) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - return buf -} - -// Request RenderComposite -// size: 36 -type RenderCompositeCookie struct { - *cookie -} - -// Write request to wire for RenderComposite -func (c *Conn) RenderComposite(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) - return RenderCompositeCookie{cookie} -} - -func (c *Conn) RenderCompositeChecked(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) RenderCompositeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCompositeRequest(Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) - return RenderCompositeCookie{cookie} -} - -func (cook RenderCompositeCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderComposite -func (c *Conn) renderCompositeRequest(Op byte, Src RenderPicture, Mask RenderPicture, Dst RenderPicture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { - size := 36 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Mask)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - Put16(buf[b:], uint16(MaskX)) - b += 2 - - Put16(buf[b:], uint16(MaskY)) - b += 2 - - Put16(buf[b:], uint16(DstX)) - b += 2 - - Put16(buf[b:], uint16(DstY)) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - return buf -} - -// Request RenderTrapezoids -// size: pad((24 + pad((len(Traps) * 40)))) -type RenderTrapezoidsCookie struct { - *cookie -} - -// Write request to wire for RenderTrapezoids -func (c *Conn) RenderTrapezoids(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) - return RenderTrapezoidsCookie{cookie} -} - -func (c *Conn) RenderTrapezoidsChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) RenderTrapezoidsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderTrapezoidsRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) - return RenderTrapezoidsCookie{cookie} -} - -func (cook RenderTrapezoidsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderTrapezoids -func (c *Conn) renderTrapezoidsRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Traps []RenderTrapezoid) []byte { - size := pad((24 + pad((len(Traps) * 40)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - b += RenderTrapezoidListBytes(buf[b:], Traps) - - return buf -} - -// Request RenderTriangles -// size: pad((24 + pad((len(Triangles) * 24)))) -type RenderTrianglesCookie struct { - *cookie -} - -// Write request to wire for RenderTriangles -func (c *Conn) RenderTriangles(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) - return RenderTrianglesCookie{cookie} -} - -func (c *Conn) RenderTrianglesChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) RenderTrianglesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderTrianglesRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) - return RenderTrianglesCookie{cookie} -} - -func (cook RenderTrianglesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderTriangles -func (c *Conn) renderTrianglesRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Triangles []RenderTriangle) []byte { - size := pad((24 + pad((len(Triangles) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - b += RenderTriangleListBytes(buf[b:], Triangles) - - return buf -} - -// Request RenderTriStrip -// size: pad((24 + pad((len(Points) * 8)))) -type RenderTriStripCookie struct { - *cookie -} - -// Write request to wire for RenderTriStrip -func (c *Conn) RenderTriStrip(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return RenderTriStripCookie{cookie} -} - -func (c *Conn) RenderTriStripChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriStripCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderTriStripRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return RenderTriStripCookie{cookie} -} - -func (cook RenderTriStripCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderTriStrip -func (c *Conn) renderTriStripRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { - size := pad((24 + pad((len(Points) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - b += RenderPointfixListBytes(buf[b:], Points) - - return buf -} - -// Request RenderTriFan -// size: pad((24 + pad((len(Points) * 8)))) -type RenderTriFanCookie struct { - *cookie -} - -// Write request to wire for RenderTriFan -func (c *Conn) RenderTriFan(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return RenderTriFanCookie{cookie} -} - -func (c *Conn) RenderTriFanChecked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) RenderTriFanCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderTriFanRequest(Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return RenderTriFanCookie{cookie} -} - -func (cook RenderTriFanCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderTriFan -func (c *Conn) renderTriFanRequest(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, SrcX int16, SrcY int16, Points []RenderPointfix) []byte { - size := pad((24 + pad((len(Points) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - b += RenderPointfixListBytes(buf[b:], Points) - - return buf -} - -// Request RenderCreateGlyphSet -// size: 12 -type RenderCreateGlyphSetCookie struct { - *cookie -} - -// Write request to wire for RenderCreateGlyphSet -func (c *Conn) RenderCreateGlyphSet(Gsid RenderGlyphset, Format RenderPictformat) RenderCreateGlyphSetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) - return RenderCreateGlyphSetCookie{cookie} -} - -func (c *Conn) RenderCreateGlyphSetChecked(Gsid RenderGlyphset, Format RenderPictformat) RenderCreateGlyphSetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateGlyphSetRequest(Gsid, Format), cookie) - return RenderCreateGlyphSetCookie{cookie} -} - -func (cook RenderCreateGlyphSetCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateGlyphSet -func (c *Conn) renderCreateGlyphSetRequest(Gsid RenderGlyphset, Format RenderPictformat) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Gsid)) - b += 4 - - Put32(buf[b:], uint32(Format)) - b += 4 - - return buf -} - -// Request RenderReferenceGlyphSet -// size: 12 -type RenderReferenceGlyphSetCookie struct { - *cookie -} - -// Write request to wire for RenderReferenceGlyphSet -func (c *Conn) RenderReferenceGlyphSet(Gsid RenderGlyphset, Existing RenderGlyphset) RenderReferenceGlyphSetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) - return RenderReferenceGlyphSetCookie{cookie} -} - -func (c *Conn) RenderReferenceGlyphSetChecked(Gsid RenderGlyphset, Existing RenderGlyphset) RenderReferenceGlyphSetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderReferenceGlyphSetRequest(Gsid, Existing), cookie) - return RenderReferenceGlyphSetCookie{cookie} -} - -func (cook RenderReferenceGlyphSetCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderReferenceGlyphSet -func (c *Conn) renderReferenceGlyphSetRequest(Gsid RenderGlyphset, Existing RenderGlyphset) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Gsid)) - b += 4 - - Put32(buf[b:], uint32(Existing)) - b += 4 - - return buf -} - -// Request RenderFreeGlyphSet -// size: 8 -type RenderFreeGlyphSetCookie struct { - *cookie -} - -// Write request to wire for RenderFreeGlyphSet -func (c *Conn) RenderFreeGlyphSet(Glyphset RenderGlyphset) RenderFreeGlyphSetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) - return RenderFreeGlyphSetCookie{cookie} -} - -func (c *Conn) RenderFreeGlyphSetChecked(Glyphset RenderGlyphset) RenderFreeGlyphSetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderFreeGlyphSetRequest(Glyphset), cookie) - return RenderFreeGlyphSetCookie{cookie} -} - -func (cook RenderFreeGlyphSetCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderFreeGlyphSet -func (c *Conn) renderFreeGlyphSetRequest(Glyphset RenderGlyphset) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - return buf -} - -// Request RenderAddGlyphs -// size: pad((((12 + pad((int(GlyphsLen) * 4))) + pad((int(GlyphsLen) * 12))) + pad((len(Data) * 1)))) -type RenderAddGlyphsCookie struct { - *cookie -} - -// Write request to wire for RenderAddGlyphs -func (c *Conn) RenderAddGlyphs(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) - return RenderAddGlyphsCookie{cookie} -} - -func (c *Conn) RenderAddGlyphsChecked(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) RenderAddGlyphsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderAddGlyphsRequest(Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) - return RenderAddGlyphsCookie{cookie} -} - -func (cook RenderAddGlyphsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderAddGlyphs -func (c *Conn) renderAddGlyphsRequest(Glyphset RenderGlyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []RenderGlyphinfo, Data []byte) []byte { - size := pad((((12 + pad((int(GlyphsLen) * 4))) + pad((int(GlyphsLen) * 12))) + pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - Put32(buf[b:], GlyphsLen) - b += 4 - - for i := 0; i < int(GlyphsLen); i++ { - Put32(buf[b:], Glyphids[i]) - b += 4 - } - b = pad(b) - - b += RenderGlyphinfoListBytes(buf[b:], Glyphs) - - copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) - - return buf -} - -// Request RenderFreeGlyphs -// size: pad((8 + pad((len(Glyphs) * 4)))) -type RenderFreeGlyphsCookie struct { - *cookie -} - -// Write request to wire for RenderFreeGlyphs -func (c *Conn) RenderFreeGlyphs(Glyphset RenderGlyphset, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) - return RenderFreeGlyphsCookie{cookie} -} - -func (c *Conn) RenderFreeGlyphsChecked(Glyphset RenderGlyphset, Glyphs []RenderGlyph) RenderFreeGlyphsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderFreeGlyphsRequest(Glyphset, Glyphs), cookie) - return RenderFreeGlyphsCookie{cookie} -} - -func (cook RenderFreeGlyphsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderFreeGlyphs -func (c *Conn) renderFreeGlyphsRequest(Glyphset RenderGlyphset, Glyphs []RenderGlyph) []byte { - size := pad((8 + pad((len(Glyphs) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - for i := 0; i < int(len(Glyphs)); i++ { - Put32(buf[b:], uint32(Glyphs[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RenderCompositeGlyphs8 -// size: pad((28 + pad((len(Glyphcmds) * 1)))) -type RenderCompositeGlyphs8Cookie struct { - *cookie -} - -// Write request to wire for RenderCompositeGlyphs8 -func (c *Conn) RenderCompositeGlyphs8(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs8Cookie{cookie} -} - -func (c *Conn) RenderCompositeGlyphs8Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs8Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCompositeGlyphs8Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs8Cookie{cookie} -} - -func (cook RenderCompositeGlyphs8Cookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCompositeGlyphs8 -func (c *Conn) renderCompositeGlyphs8Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := pad((28 + pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += pad(int(len(Glyphcmds))) - - return buf -} - -// Request RenderCompositeGlyphs16 -// size: pad((28 + pad((len(Glyphcmds) * 1)))) -type RenderCompositeGlyphs16Cookie struct { - *cookie -} - -// Write request to wire for RenderCompositeGlyphs16 -func (c *Conn) RenderCompositeGlyphs16(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs16Cookie{cookie} -} - -func (c *Conn) RenderCompositeGlyphs16Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs16Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCompositeGlyphs16Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs16Cookie{cookie} -} - -func (cook RenderCompositeGlyphs16Cookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCompositeGlyphs16 -func (c *Conn) renderCompositeGlyphs16Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := pad((28 + pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += pad(int(len(Glyphcmds))) - - return buf -} - -// Request RenderCompositeGlyphs32 -// size: pad((28 + pad((len(Glyphcmds) * 1)))) -type RenderCompositeGlyphs32Cookie struct { - *cookie -} - -// Write request to wire for RenderCompositeGlyphs32 -func (c *Conn) RenderCompositeGlyphs32(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs32Cookie{cookie} -} - -func (c *Conn) RenderCompositeGlyphs32Checked(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) RenderCompositeGlyphs32Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCompositeGlyphs32Request(Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return RenderCompositeGlyphs32Cookie{cookie} -} - -func (cook RenderCompositeGlyphs32Cookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCompositeGlyphs32 -func (c *Conn) renderCompositeGlyphs32Request(Op byte, Src RenderPicture, Dst RenderPicture, MaskFormat RenderPictformat, Glyphset RenderGlyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := pad((28 + pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put32(buf[b:], uint32(Dst)) - b += 4 - - Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - Put32(buf[b:], uint32(Glyphset)) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += pad(int(len(Glyphcmds))) - - return buf -} - -// Request RenderFillRectangles -// size: pad((20 + pad((len(Rects) * 8)))) -type RenderFillRectanglesCookie struct { - *cookie -} - -// Write request to wire for RenderFillRectangles -func (c *Conn) RenderFillRectangles(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) - return RenderFillRectanglesCookie{cookie} -} - -func (c *Conn) RenderFillRectanglesChecked(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) RenderFillRectanglesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderFillRectanglesRequest(Op, Dst, Color, Rects), cookie) - return RenderFillRectanglesCookie{cookie} -} - -func (cook RenderFillRectanglesCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderFillRectangles -func (c *Conn) renderFillRectanglesRequest(Op byte, Dst RenderPicture, Color RenderColor, Rects []Rectangle) []byte { - size := pad((20 + pad((len(Rects) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Dst)) - b += 4 - - { - structBytes := Color.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - b += RectangleListBytes(buf[b:], Rects) - - return buf -} - -// Request RenderCreateCursor -// size: 16 -type RenderCreateCursorCookie struct { - *cookie -} - -// Write request to wire for RenderCreateCursor -func (c *Conn) RenderCreateCursor(Cid Cursor, Source RenderPicture, X uint16, Y uint16) RenderCreateCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) - return RenderCreateCursorCookie{cookie} -} - -func (c *Conn) RenderCreateCursorChecked(Cid Cursor, Source RenderPicture, X uint16, Y uint16) RenderCreateCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateCursorRequest(Cid, Source, X, Y), cookie) - return RenderCreateCursorCookie{cookie} -} - -func (cook RenderCreateCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateCursor -func (c *Conn) renderCreateCursorRequest(Cid Cursor, Source RenderPicture, X uint16, Y uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cid)) - b += 4 - - Put32(buf[b:], uint32(Source)) - b += 4 - - Put16(buf[b:], X) - b += 2 - - Put16(buf[b:], Y) - b += 2 - - return buf -} - -// Request RenderSetPictureTransform -// size: 44 -type RenderSetPictureTransformCookie struct { - *cookie -} - -// Write request to wire for RenderSetPictureTransform -func (c *Conn) RenderSetPictureTransform(Picture RenderPicture, Transform RenderTransform) RenderSetPictureTransformCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) - return RenderSetPictureTransformCookie{cookie} -} - -func (c *Conn) RenderSetPictureTransformChecked(Picture RenderPicture, Transform RenderTransform) RenderSetPictureTransformCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderSetPictureTransformRequest(Picture, Transform), cookie) - return RenderSetPictureTransformCookie{cookie} -} - -func (cook RenderSetPictureTransformCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderSetPictureTransform -func (c *Conn) renderSetPictureTransformRequest(Picture RenderPicture, Transform RenderTransform) []byte { - size := 44 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Transform.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Request RenderQueryFilters -// size: 8 -type RenderQueryFiltersCookie struct { - *cookie -} - -func (c *Conn) RenderQueryFilters(Drawable Drawable) RenderQueryFiltersCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) - return RenderQueryFiltersCookie{cookie} -} - -func (c *Conn) RenderQueryFiltersUnchecked(Drawable Drawable) RenderQueryFiltersCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.renderQueryFiltersRequest(Drawable), cookie) - return RenderQueryFiltersCookie{cookie} -} - -// Request reply for RenderQueryFilters -// size: ((32 + pad((int(NumAliases) * 2))) + StrListSize(Filters)) -type RenderQueryFiltersReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAliases uint32 - NumFilters uint32 - // padding: 16 bytes - Aliases []uint16 // size: pad((int(NumAliases) * 2)) - Filters []Str // size: StrListSize(Filters) -} - -// Waits and reads reply data from request RenderQueryFilters -func (cook RenderQueryFiltersCookie) Reply() (*RenderQueryFiltersReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return renderQueryFiltersReply(buf), nil -} - -// Read reply into structure from buffer for RenderQueryFilters -func renderQueryFiltersReply(buf []byte) *RenderQueryFiltersReply { - v := new(RenderQueryFiltersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAliases = Get32(buf[b:]) - b += 4 - - v.NumFilters = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.Aliases = make([]uint16, v.NumAliases) - for i := 0; i < int(v.NumAliases); i++ { - v.Aliases[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - v.Filters = make([]Str, v.NumFilters) - b += ReadStrList(buf[b:], v.Filters) - - return v -} - -func (cook RenderQueryFiltersCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderQueryFilters -func (c *Conn) renderQueryFiltersRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request RenderSetPictureFilter -// size: pad(((12 + pad((int(FilterLen) * 1))) + pad((len(Values) * 4)))) -type RenderSetPictureFilterCookie struct { - *cookie -} - -// Write request to wire for RenderSetPictureFilter -func (c *Conn) RenderSetPictureFilter(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) - return RenderSetPictureFilterCookie{cookie} -} - -func (c *Conn) RenderSetPictureFilterChecked(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) RenderSetPictureFilterCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderSetPictureFilterRequest(Picture, FilterLen, Filter, Values), cookie) - return RenderSetPictureFilterCookie{cookie} -} - -func (cook RenderSetPictureFilterCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderSetPictureFilter -func (c *Conn) renderSetPictureFilterRequest(Picture RenderPicture, FilterLen uint16, Filter string, Values []RenderFixed) []byte { - size := pad(((12 + pad((int(FilterLen) * 1))) + pad((len(Values) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - Put16(buf[b:], FilterLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Filter[:FilterLen]) - b += pad(int(FilterLen)) - - for i := 0; i < int(len(Values)); i++ { - Put32(buf[b:], uint32(Values[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request RenderCreateAnimCursor -// size: pad((8 + pad((len(Cursors) * 8)))) -type RenderCreateAnimCursorCookie struct { - *cookie -} - -// Write request to wire for RenderCreateAnimCursor -func (c *Conn) RenderCreateAnimCursor(Cid Cursor, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) - return RenderCreateAnimCursorCookie{cookie} -} - -func (c *Conn) RenderCreateAnimCursorChecked(Cid Cursor, Cursors []RenderAnimcursorelt) RenderCreateAnimCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateAnimCursorRequest(Cid, Cursors), cookie) - return RenderCreateAnimCursorCookie{cookie} -} - -func (cook RenderCreateAnimCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateAnimCursor -func (c *Conn) renderCreateAnimCursorRequest(Cid Cursor, Cursors []RenderAnimcursorelt) []byte { - size := pad((8 + pad((len(Cursors) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cid)) - b += 4 - - b += RenderAnimcursoreltListBytes(buf[b:], Cursors) - - return buf -} - -// Request RenderAddTraps -// size: pad((12 + pad((len(Traps) * 24)))) -type RenderAddTrapsCookie struct { - *cookie -} - -// Write request to wire for RenderAddTraps -func (c *Conn) RenderAddTraps(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) - return RenderAddTrapsCookie{cookie} -} - -func (c *Conn) RenderAddTrapsChecked(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) RenderAddTrapsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderAddTrapsRequest(Picture, XOff, YOff, Traps), cookie) - return RenderAddTrapsCookie{cookie} -} - -func (cook RenderAddTrapsCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderAddTraps -func (c *Conn) renderAddTrapsRequest(Picture RenderPicture, XOff int16, YOff int16, Traps []RenderTrap) []byte { - size := pad((12 + pad((len(Traps) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 32 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - Put16(buf[b:], uint16(XOff)) - b += 2 - - Put16(buf[b:], uint16(YOff)) - b += 2 - - b += RenderTrapListBytes(buf[b:], Traps) - - return buf -} - -// Request RenderCreateSolidFill -// size: 16 -type RenderCreateSolidFillCookie struct { - *cookie -} - -// Write request to wire for RenderCreateSolidFill -func (c *Conn) RenderCreateSolidFill(Picture RenderPicture, Color RenderColor) RenderCreateSolidFillCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) - return RenderCreateSolidFillCookie{cookie} -} - -func (c *Conn) RenderCreateSolidFillChecked(Picture RenderPicture, Color RenderColor) RenderCreateSolidFillCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateSolidFillRequest(Picture, Color), cookie) - return RenderCreateSolidFillCookie{cookie} -} - -func (cook RenderCreateSolidFillCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateSolidFill -func (c *Conn) renderCreateSolidFillRequest(Picture RenderPicture, Color RenderColor) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 33 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Color.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Request RenderCreateLinearGradient -// size: pad(((28 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) -type RenderCreateLinearGradientCookie struct { - *cookie -} - -// Write request to wire for RenderCreateLinearGradient -func (c *Conn) RenderCreateLinearGradient(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) - return RenderCreateLinearGradientCookie{cookie} -} - -func (c *Conn) RenderCreateLinearGradientChecked(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateLinearGradientCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateLinearGradientRequest(Picture, P1, P2, NumStops, Stops, Colors), cookie) - return RenderCreateLinearGradientCookie{cookie} -} - -func (cook RenderCreateLinearGradientCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateLinearGradient -func (c *Conn) renderCreateLinearGradientRequest(Picture RenderPicture, P1 RenderPointfix, P2 RenderPointfix, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { - size := pad(((28 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 34 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := P1.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := P2.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = pad(b) - - b += RenderColorListBytes(buf[b:], Colors) - - return buf -} - -// Request RenderCreateRadialGradient -// size: pad(((36 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) -type RenderCreateRadialGradientCookie struct { - *cookie -} - -// Write request to wire for RenderCreateRadialGradient -func (c *Conn) RenderCreateRadialGradient(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) - return RenderCreateRadialGradientCookie{cookie} -} - -func (c *Conn) RenderCreateRadialGradientChecked(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateRadialGradientCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateRadialGradientRequest(Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) - return RenderCreateRadialGradientCookie{cookie} -} - -func (cook RenderCreateRadialGradientCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateRadialGradient -func (c *Conn) renderCreateRadialGradientRequest(Picture RenderPicture, Inner RenderPointfix, Outer RenderPointfix, InnerRadius RenderFixed, OuterRadius RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { - size := pad(((36 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 35 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Inner.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := Outer.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(InnerRadius)) - b += 4 - - Put32(buf[b:], uint32(OuterRadius)) - b += 4 - - Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = pad(b) - - b += RenderColorListBytes(buf[b:], Colors) - - return buf -} - -// Request RenderCreateConicalGradient -// size: pad(((24 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) -type RenderCreateConicalGradientCookie struct { - *cookie -} - -// Write request to wire for RenderCreateConicalGradient -func (c *Conn) RenderCreateConicalGradient(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) - return RenderCreateConicalGradientCookie{cookie} -} - -func (c *Conn) RenderCreateConicalGradientChecked(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) RenderCreateConicalGradientCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.renderCreateConicalGradientRequest(Picture, Center, Angle, NumStops, Stops, Colors), cookie) - return RenderCreateConicalGradientCookie{cookie} -} - -func (cook RenderCreateConicalGradientCookie) Check() error { - return cook.check() -} - -// Write request to wire for RenderCreateConicalGradient -func (c *Conn) renderCreateConicalGradientRequest(Picture RenderPicture, Center RenderPointfix, Angle RenderFixed, NumStops uint32, Stops []RenderFixed, Colors []RenderColor) []byte { - size := pad(((24 + pad((int(NumStops) * 4))) + pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["RENDER"] - b += 1 - - buf[b] = 36 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Center.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(Angle)) - b += 4 - - Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = pad(b) - - b += RenderColorListBytes(buf[b:], Colors) - - return buf -} diff --git a/nexgb/auto_res.go b/nexgb/auto_res.go deleted file mode 100644 index a2f9914..0000000 --- a/nexgb/auto_res.go +++ /dev/null @@ -1,528 +0,0 @@ -package xgb - -/* - This file was generated by res.xml on May 10 2012 12:39:33pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// ResInit must be called before using the X-Resource extension. -func (c *Conn) ResInit() error { - reply, err := c.QueryExtension(10, "X-Resource").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named X-Resource could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["X-Resource"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["X-Resource"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["X-Resource"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["X-Resource"] = make(map[int]newEventFun) - newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// 'ResClient' struct definition -// Size: 8 -type ResClient struct { - ResourceBase uint32 - ResourceMask uint32 -} - -// Struct read ResClient -func ReadResClient(buf []byte, v *ResClient) int { - b := 0 - - v.ResourceBase = Get32(buf[b:]) - b += 4 - - v.ResourceMask = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read ResClient -func ReadResClientList(buf []byte, dest []ResClient) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ResClient{} - b += ReadResClient(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write ResClient -func (v ResClient) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], v.ResourceBase) - b += 4 - - Put32(buf[b:], v.ResourceMask) - b += 4 - - return buf -} - -// Write struct list ResClient -func ResClientListBytes(buf []byte, list []ResClient) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'ResType' struct definition -// Size: 8 -type ResType struct { - ResourceType Atom - Count uint32 -} - -// Struct read ResType -func ReadResType(buf []byte, v *ResType) int { - b := 0 - - v.ResourceType = Atom(Get32(buf[b:])) - b += 4 - - v.Count = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read ResType -func ReadResTypeList(buf []byte, dest []ResType) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ResType{} - b += ReadResType(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write ResType -func (v ResType) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.ResourceType)) - b += 4 - - Put32(buf[b:], v.Count) - b += 4 - - return buf -} - -// Write struct list ResType -func ResTypeListBytes(buf []byte, list []ResType) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Request ResQueryVersion -// size: 8 -type ResQueryVersionCookie struct { - *cookie -} - -func (c *Conn) ResQueryVersion(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie) - return ResQueryVersionCookie{cookie} -} - -func (c *Conn) ResQueryVersionUnchecked(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie) - return ResQueryVersionCookie{cookie} -} - -// Request reply for ResQueryVersion -// size: 12 -type ResQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 -} - -// Waits and reads reply data from request ResQueryVersion -func (cook ResQueryVersionCookie) Reply() (*ResQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return resQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for ResQueryVersion -func resQueryVersionReply(buf []byte) *ResQueryVersionReply { - v := new(ResQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = Get16(buf[b:]) - b += 2 - - v.ServerMinor = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook ResQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for ResQueryVersion -func (c *Conn) resQueryVersionRequest(ClientMajor byte, ClientMinor byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["X-RESOURCE"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = ClientMajor - b += 1 - - buf[b] = ClientMinor - b += 1 - - return buf -} - -// Request ResQueryClients -// size: 4 -type ResQueryClientsCookie struct { - *cookie -} - -func (c *Conn) ResQueryClients() ResQueryClientsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.resQueryClientsRequest(), cookie) - return ResQueryClientsCookie{cookie} -} - -func (c *Conn) ResQueryClientsUnchecked() ResQueryClientsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.resQueryClientsRequest(), cookie) - return ResQueryClientsCookie{cookie} -} - -// Request reply for ResQueryClients -// size: (32 + pad((int(NumClients) * 8))) -type ResQueryClientsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumClients uint32 - // padding: 20 bytes - Clients []ResClient // size: pad((int(NumClients) * 8)) -} - -// Waits and reads reply data from request ResQueryClients -func (cook ResQueryClientsCookie) Reply() (*ResQueryClientsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return resQueryClientsReply(buf), nil -} - -// Read reply into structure from buffer for ResQueryClients -func resQueryClientsReply(buf []byte) *ResQueryClientsReply { - v := new(ResQueryClientsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClients = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Clients = make([]ResClient, v.NumClients) - b += ReadResClientList(buf[b:], v.Clients) - - return v -} - -func (cook ResQueryClientsCookie) Check() error { - return cook.check() -} - -// Write request to wire for ResQueryClients -func (c *Conn) resQueryClientsRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["X-RESOURCE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request ResQueryClientResources -// size: 8 -type ResQueryClientResourcesCookie struct { - *cookie -} - -func (c *Conn) ResQueryClientResources(Xid uint32) ResQueryClientResourcesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie) - return ResQueryClientResourcesCookie{cookie} -} - -func (c *Conn) ResQueryClientResourcesUnchecked(Xid uint32) ResQueryClientResourcesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie) - return ResQueryClientResourcesCookie{cookie} -} - -// Request reply for ResQueryClientResources -// size: (32 + pad((int(NumTypes) * 8))) -type ResQueryClientResourcesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumTypes uint32 - // padding: 20 bytes - Types []ResType // size: pad((int(NumTypes) * 8)) -} - -// Waits and reads reply data from request ResQueryClientResources -func (cook ResQueryClientResourcesCookie) Reply() (*ResQueryClientResourcesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return resQueryClientResourcesReply(buf), nil -} - -// Read reply into structure from buffer for ResQueryClientResources -func resQueryClientResourcesReply(buf []byte) *ResQueryClientResourcesReply { - v := new(ResQueryClientResourcesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumTypes = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Types = make([]ResType, v.NumTypes) - b += ReadResTypeList(buf[b:], v.Types) - - return v -} - -func (cook ResQueryClientResourcesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ResQueryClientResources -func (c *Conn) resQueryClientResourcesRequest(Xid uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["X-RESOURCE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Xid) - b += 4 - - return buf -} - -// Request ResQueryClientPixmapBytes -// size: 8 -type ResQueryClientPixmapBytesCookie struct { - *cookie -} - -func (c *Conn) ResQueryClientPixmapBytes(Xid uint32) ResQueryClientPixmapBytesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie) - return ResQueryClientPixmapBytesCookie{cookie} -} - -func (c *Conn) ResQueryClientPixmapBytesUnchecked(Xid uint32) ResQueryClientPixmapBytesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie) - return ResQueryClientPixmapBytesCookie{cookie} -} - -// Request reply for ResQueryClientPixmapBytes -// size: 16 -type ResQueryClientPixmapBytesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Bytes uint32 - BytesOverflow uint32 -} - -// Waits and reads reply data from request ResQueryClientPixmapBytes -func (cook ResQueryClientPixmapBytesCookie) Reply() (*ResQueryClientPixmapBytesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return resQueryClientPixmapBytesReply(buf), nil -} - -// Read reply into structure from buffer for ResQueryClientPixmapBytes -func resQueryClientPixmapBytesReply(buf []byte) *ResQueryClientPixmapBytesReply { - v := new(ResQueryClientPixmapBytesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Bytes = Get32(buf[b:]) - b += 4 - - v.BytesOverflow = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook ResQueryClientPixmapBytesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ResQueryClientPixmapBytes -func (c *Conn) resQueryClientPixmapBytesRequest(Xid uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["X-RESOURCE"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Xid) - b += 4 - - return buf -} diff --git a/nexgb/auto_screensaver.go b/nexgb/auto_screensaver.go deleted file mode 100644 index 4f6fea0..0000000 --- a/nexgb/auto_screensaver.go +++ /dev/null @@ -1,627 +0,0 @@ -package xgb - -/* - This file was generated by screensaver.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// ScreensaverInit must be called before using the MIT-SCREEN-SAVER extension. -func (c *Conn) ScreensaverInit() error { - reply, err := c.QueryExtension(16, "MIT-SCREEN-SAVER").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named MIT-SCREEN-SAVER could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["MIT-SCREEN-SAVER"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["MIT-SCREEN-SAVER"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]newEventFun) - newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -const ( - ScreensaverKindBlanked = 0 - ScreensaverKindInternal = 1 - ScreensaverKindExternal = 2 -) - -const ( - ScreensaverEventNotifyMask = 1 - ScreensaverEventCycleMask = 2 -) - -const ( - ScreensaverStateOff = 0 - ScreensaverStateOn = 1 - ScreensaverStateCycle = 2 - ScreensaverStateDisabled = 3 -) - -// Event definition ScreensaverNotify (0) -// Size: 32 - -const ScreensaverNotify = 0 - -type ScreensaverNotifyEvent struct { - Sequence uint16 - Code byte - State byte - // padding: 1 bytes - SequenceNumber uint16 - Time Timestamp - Root Window - Window Window - Kind byte - Forced bool - // padding: 14 bytes -} - -// Event read ScreensaverNotify -func NewScreensaverNotifyEvent(buf []byte) Event { - v := ScreensaverNotifyEvent{} - b := 1 // don't read event number - - v.Code = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.State = buf[b] - b += 1 - - b += 1 // padding - - v.SequenceNumber = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Kind = buf[b] - b += 1 - - if buf[b] == 1 { - v.Forced = true - } else { - v.Forced = false - } - b += 1 - - b += 14 // padding - - return v -} - -// Event write ScreensaverNotify -func (v ScreensaverNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Code - b += 1 - - b += 2 // skip sequence number - - buf[b] = v.State - b += 1 - - b += 1 // padding - - Put16(buf[b:], v.SequenceNumber) - b += 2 - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - Put32(buf[b:], uint32(v.Root)) - b += 4 - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - buf[b] = v.Kind - b += 1 - - if v.Forced { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 14 // padding - - return buf -} - -func (v ScreensaverNotifyEvent) ImplementsEvent() {} - -func (v ScreensaverNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ScreensaverNotifyEvent) String() string { - fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Code: %d", v.Code)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SequenceNumber: %d", v.SequenceNumber)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, sprintf("Forced: %t", v.Forced)) - return "ScreensaverNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["MIT-SCREEN-SAVER"][0] = NewScreensaverNotifyEvent -} - -// Request ScreensaverQueryVersion -// size: 8 -type ScreensaverQueryVersionCookie struct { - *cookie -} - -func (c *Conn) ScreensaverQueryVersion(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return ScreensaverQueryVersionCookie{cookie} -} - -func (c *Conn) ScreensaverQueryVersionUnchecked(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return ScreensaverQueryVersionCookie{cookie} -} - -// Request reply for ScreensaverQueryVersion -// size: 32 -type ScreensaverQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 - // padding: 20 bytes -} - -// Waits and reads reply data from request ScreensaverQueryVersion -func (cook ScreensaverQueryVersionCookie) Reply() (*ScreensaverQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return screensaverQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for ScreensaverQueryVersion -func screensaverQueryVersionReply(buf []byte) *ScreensaverQueryVersionReply { - v := new(ScreensaverQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajorVersion = Get16(buf[b:]) - b += 2 - - v.ServerMinorVersion = Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -func (cook ScreensaverQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverQueryVersion -func (c *Conn) screensaverQueryVersionRequest(ClientMajorVersion byte, ClientMinorVersion byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = ClientMajorVersion - b += 1 - - buf[b] = ClientMinorVersion - b += 1 - - b += 2 // padding - - return buf -} - -// Request ScreensaverQueryInfo -// size: 8 -type ScreensaverQueryInfoCookie struct { - *cookie -} - -func (c *Conn) ScreensaverQueryInfo(Drawable Drawable) ScreensaverQueryInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) - return ScreensaverQueryInfoCookie{cookie} -} - -func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Drawable) ScreensaverQueryInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie) - return ScreensaverQueryInfoCookie{cookie} -} - -// Request reply for ScreensaverQueryInfo -// size: 32 -type ScreensaverQueryInfoReply struct { - Sequence uint16 - Length uint32 - State byte - SaverWindow Window - MsUntilServer uint32 - MsSinceUserInput uint32 - EventMask uint32 - Kind byte - // padding: 7 bytes -} - -// Waits and reads reply data from request ScreensaverQueryInfo -func (cook ScreensaverQueryInfoCookie) Reply() (*ScreensaverQueryInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return screensaverQueryInfoReply(buf), nil -} - -// Read reply into structure from buffer for ScreensaverQueryInfo -func screensaverQueryInfoReply(buf []byte) *ScreensaverQueryInfoReply { - v := new(ScreensaverQueryInfoReply) - b := 1 // skip reply determinant - - v.State = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.SaverWindow = Window(Get32(buf[b:])) - b += 4 - - v.MsUntilServer = Get32(buf[b:]) - b += 4 - - v.MsSinceUserInput = Get32(buf[b:]) - b += 4 - - v.EventMask = Get32(buf[b:]) - b += 4 - - v.Kind = buf[b] - b += 1 - - b += 7 // padding - - return v -} - -func (cook ScreensaverQueryInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverQueryInfo -func (c *Conn) screensaverQueryInfoRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request ScreensaverSelectInput -// size: 12 -type ScreensaverSelectInputCookie struct { - *cookie -} - -// Write request to wire for ScreensaverSelectInput -func (c *Conn) ScreensaverSelectInput(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) - return ScreensaverSelectInputCookie{cookie} -} - -func (c *Conn) ScreensaverSelectInputChecked(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie) - return ScreensaverSelectInputCookie{cookie} -} - -func (cook ScreensaverSelectInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverSelectInput -func (c *Conn) screensaverSelectInputRequest(Drawable Drawable, EventMask uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], EventMask) - b += 4 - - return buf -} - -// Request ScreensaverSetAttributes -// size: pad((24 + (4 + pad((4 * popCount(int(ValueMask))))))) -type ScreensaverSetAttributesCookie struct { - *cookie -} - -// Write request to wire for ScreensaverSetAttributes -func (c *Conn) ScreensaverSetAttributes(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) - return ScreensaverSetAttributesCookie{cookie} -} - -func (c *Conn) ScreensaverSetAttributesChecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) - return ScreensaverSetAttributesCookie{cookie} -} - -func (cook ScreensaverSetAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverSetAttributes -func (c *Conn) screensaverSetAttributesRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { - size := pad((24 + (4 + pad((4 * popCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put16(buf[b:], uint16(X)) - b += 2 - - Put16(buf[b:], uint16(Y)) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - Put16(buf[b:], BorderWidth) - b += 2 - - buf[b] = Class - b += 1 - - buf[b] = Depth - b += 1 - - Put32(buf[b:], uint32(Visual)) - b += 4 - - Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request ScreensaverUnsetAttributes -// size: 8 -type ScreensaverUnsetAttributesCookie struct { - *cookie -} - -// Write request to wire for ScreensaverUnsetAttributes -func (c *Conn) ScreensaverUnsetAttributes(Drawable Drawable) ScreensaverUnsetAttributesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) - return ScreensaverUnsetAttributesCookie{cookie} -} - -func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Drawable) ScreensaverUnsetAttributesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie) - return ScreensaverUnsetAttributesCookie{cookie} -} - -func (cook ScreensaverUnsetAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverUnsetAttributes -func (c *Conn) screensaverUnsetAttributesRequest(Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request ScreensaverSuspend -// size: 8 -type ScreensaverSuspendCookie struct { - *cookie -} - -// Write request to wire for ScreensaverSuspend -func (c *Conn) ScreensaverSuspend(Suspend bool) ScreensaverSuspendCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.screensaverSuspendRequest(Suspend), cookie) - return ScreensaverSuspendCookie{cookie} -} - -func (c *Conn) ScreensaverSuspendChecked(Suspend bool) ScreensaverSuspendCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.screensaverSuspendRequest(Suspend), cookie) - return ScreensaverSuspendCookie{cookie} -} - -func (cook ScreensaverSuspendCookie) Check() error { - return cook.check() -} - -// Write request to wire for ScreensaverSuspend -func (c *Conn) screensaverSuspendRequest(Suspend bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Suspend { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} diff --git a/nexgb/auto_shape.go b/nexgb/auto_shape.go deleted file mode 100644 index 90d67cf..0000000 --- a/nexgb/auto_shape.go +++ /dev/null @@ -1,897 +0,0 @@ -package xgb - -/* - This file was generated by shape.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// ShapeInit must be called before using the SHAPE extension. -func (c *Conn) ShapeInit() error { - reply, err := c.QueryExtension(5, "SHAPE").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named SHAPE could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["SHAPE"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["SHAPE"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["SHAPE"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["SHAPE"] = make(map[int]newEventFun) - newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - ShapeSoSet = 0 - ShapeSoUnion = 1 - ShapeSoIntersect = 2 - ShapeSoSubtract = 3 - ShapeSoInvert = 4 -) - -const ( - ShapeSkBounding = 0 - ShapeSkClip = 1 - ShapeSkInput = 2 -) - -type ShapeOp byte - -type ShapeKind byte - -// Event definition ShapeNotify (0) -// Size: 32 - -const ShapeNotify = 0 - -type ShapeNotifyEvent struct { - Sequence uint16 - ShapeKind ShapeKind - AffectedWindow Window - ExtentsX int16 - ExtentsY int16 - ExtentsWidth uint16 - ExtentsHeight uint16 - ServerTime Timestamp - Shaped bool - // padding: 11 bytes -} - -// Event read ShapeNotify -func NewShapeNotifyEvent(buf []byte) Event { - v := ShapeNotifyEvent{} - b := 1 // don't read event number - - v.ShapeKind = ShapeKind(buf[b]) - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.AffectedWindow = Window(Get32(buf[b:])) - b += 4 - - v.ExtentsX = int16(Get16(buf[b:])) - b += 2 - - v.ExtentsY = int16(Get16(buf[b:])) - b += 2 - - v.ExtentsWidth = Get16(buf[b:]) - b += 2 - - v.ExtentsHeight = Get16(buf[b:]) - b += 2 - - v.ServerTime = Timestamp(Get32(buf[b:])) - b += 4 - - if buf[b] == 1 { - v.Shaped = true - } else { - v.Shaped = false - } - b += 1 - - b += 11 // padding - - return v -} - -// Event write ShapeNotify -func (v ShapeNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = byte(v.ShapeKind) - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.AffectedWindow)) - b += 4 - - Put16(buf[b:], uint16(v.ExtentsX)) - b += 2 - - Put16(buf[b:], uint16(v.ExtentsY)) - b += 2 - - Put16(buf[b:], v.ExtentsWidth) - b += 2 - - Put16(buf[b:], v.ExtentsHeight) - b += 2 - - Put32(buf[b:], uint32(v.ServerTime)) - b += 4 - - if v.Shaped { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 11 // padding - - return buf -} - -func (v ShapeNotifyEvent) ImplementsEvent() {} - -func (v ShapeNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ShapeNotifyEvent) String() string { - fieldVals := make([]string, 0, 9) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("ShapeKind: %d", v.ShapeKind)) - fieldVals = append(fieldVals, sprintf("AffectedWindow: %d", v.AffectedWindow)) - fieldVals = append(fieldVals, sprintf("ExtentsX: %d", v.ExtentsX)) - fieldVals = append(fieldVals, sprintf("ExtentsY: %d", v.ExtentsY)) - fieldVals = append(fieldVals, sprintf("ExtentsWidth: %d", v.ExtentsWidth)) - fieldVals = append(fieldVals, sprintf("ExtentsHeight: %d", v.ExtentsHeight)) - fieldVals = append(fieldVals, sprintf("ServerTime: %d", v.ServerTime)) - fieldVals = append(fieldVals, sprintf("Shaped: %t", v.Shaped)) - return "ShapeNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["SHAPE"][0] = NewShapeNotifyEvent -} - -// Request ShapeQueryVersion -// size: 4 -type ShapeQueryVersionCookie struct { - *cookie -} - -func (c *Conn) ShapeQueryVersion() ShapeQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shapeQueryVersionRequest(), cookie) - return ShapeQueryVersionCookie{cookie} -} - -func (c *Conn) ShapeQueryVersionUnchecked() ShapeQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shapeQueryVersionRequest(), cookie) - return ShapeQueryVersionCookie{cookie} -} - -// Request reply for ShapeQueryVersion -// size: 12 -type ShapeQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} - -// Waits and reads reply data from request ShapeQueryVersion -func (cook ShapeQueryVersionCookie) Reply() (*ShapeQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shapeQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for ShapeQueryVersion -func shapeQueryVersionReply(buf []byte) *ShapeQueryVersionReply { - v := new(ShapeQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook ShapeQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeQueryVersion -func (c *Conn) shapeQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request ShapeRectangles -// size: pad((16 + pad((len(Rectangles) * 8)))) -type ShapeRectanglesCookie struct { - *cookie -} - -// Write request to wire for ShapeRectangles -func (c *Conn) ShapeRectangles(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) - return ShapeRectanglesCookie{cookie} -} - -func (c *Conn) ShapeRectanglesChecked(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) - return ShapeRectanglesCookie{cookie} -} - -func (cook ShapeRectanglesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeRectangles -func (c *Conn) shapeRectanglesRequest(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) []byte { - size := pad((16 + pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(Operation) - b += 1 - - buf[b] = byte(DestinationKind) - b += 1 - - buf[b] = Ordering - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - Put16(buf[b:], uint16(XOffset)) - b += 2 - - Put16(buf[b:], uint16(YOffset)) - b += 2 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// Request ShapeMask -// size: 20 -type ShapeMaskCookie struct { - *cookie -} - -// Write request to wire for ShapeMask -func (c *Conn) ShapeMask(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) - return ShapeMaskCookie{cookie} -} - -func (c *Conn) ShapeMaskChecked(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) - return ShapeMaskCookie{cookie} -} - -func (cook ShapeMaskCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeMask -func (c *Conn) shapeMaskRequest(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(Operation) - b += 1 - - buf[b] = byte(DestinationKind) - b += 1 - - b += 2 // padding - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - Put16(buf[b:], uint16(XOffset)) - b += 2 - - Put16(buf[b:], uint16(YOffset)) - b += 2 - - Put32(buf[b:], uint32(SourceBitmap)) - b += 4 - - return buf -} - -// Request ShapeCombine -// size: 20 -type ShapeCombineCookie struct { - *cookie -} - -// Write request to wire for ShapeCombine -func (c *Conn) ShapeCombine(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) - return ShapeCombineCookie{cookie} -} - -func (c *Conn) ShapeCombineChecked(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) - return ShapeCombineCookie{cookie} -} - -func (cook ShapeCombineCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeCombine -func (c *Conn) shapeCombineRequest(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(Operation) - b += 1 - - buf[b] = byte(DestinationKind) - b += 1 - - buf[b] = byte(SourceKind) - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - Put16(buf[b:], uint16(XOffset)) - b += 2 - - Put16(buf[b:], uint16(YOffset)) - b += 2 - - Put32(buf[b:], uint32(SourceWindow)) - b += 4 - - return buf -} - -// Request ShapeOffset -// size: 16 -type ShapeOffsetCookie struct { - *cookie -} - -// Write request to wire for ShapeOffset -func (c *Conn) ShapeOffset(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) - return ShapeOffsetCookie{cookie} -} - -func (c *Conn) ShapeOffsetChecked(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie) - return ShapeOffsetCookie{cookie} -} - -func (cook ShapeOffsetCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeOffset -func (c *Conn) shapeOffsetRequest(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(DestinationKind) - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - Put16(buf[b:], uint16(XOffset)) - b += 2 - - Put16(buf[b:], uint16(YOffset)) - b += 2 - - return buf -} - -// Request ShapeQueryExtents -// size: 8 -type ShapeQueryExtentsCookie struct { - *cookie -} - -func (c *Conn) ShapeQueryExtents(DestinationWindow Window) ShapeQueryExtentsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) - return ShapeQueryExtentsCookie{cookie} -} - -func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Window) ShapeQueryExtentsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie) - return ShapeQueryExtentsCookie{cookie} -} - -// Request reply for ShapeQueryExtents -// size: 28 -type ShapeQueryExtentsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - BoundingShaped bool - ClipShaped bool - // padding: 2 bytes - BoundingShapeExtentsX int16 - BoundingShapeExtentsY int16 - BoundingShapeExtentsWidth uint16 - BoundingShapeExtentsHeight uint16 - ClipShapeExtentsX int16 - ClipShapeExtentsY int16 - ClipShapeExtentsWidth uint16 - ClipShapeExtentsHeight uint16 -} - -// Waits and reads reply data from request ShapeQueryExtents -func (cook ShapeQueryExtentsCookie) Reply() (*ShapeQueryExtentsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shapeQueryExtentsReply(buf), nil -} - -// Read reply into structure from buffer for ShapeQueryExtents -func shapeQueryExtentsReply(buf []byte) *ShapeQueryExtentsReply { - v := new(ShapeQueryExtentsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.BoundingShaped = true - } else { - v.BoundingShaped = false - } - b += 1 - - if buf[b] == 1 { - v.ClipShaped = true - } else { - v.ClipShaped = false - } - b += 1 - - b += 2 // padding - - v.BoundingShapeExtentsX = int16(Get16(buf[b:])) - b += 2 - - v.BoundingShapeExtentsY = int16(Get16(buf[b:])) - b += 2 - - v.BoundingShapeExtentsWidth = Get16(buf[b:]) - b += 2 - - v.BoundingShapeExtentsHeight = Get16(buf[b:]) - b += 2 - - v.ClipShapeExtentsX = int16(Get16(buf[b:])) - b += 2 - - v.ClipShapeExtentsY = int16(Get16(buf[b:])) - b += 2 - - v.ClipShapeExtentsWidth = Get16(buf[b:]) - b += 2 - - v.ClipShapeExtentsHeight = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook ShapeQueryExtentsCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeQueryExtents -func (c *Conn) shapeQueryExtentsRequest(DestinationWindow Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - return buf -} - -// Request ShapeSelectInput -// size: 12 -type ShapeSelectInputCookie struct { - *cookie -} - -// Write request to wire for ShapeSelectInput -func (c *Conn) ShapeSelectInput(DestinationWindow Window, Enable bool) ShapeSelectInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) - return ShapeSelectInputCookie{cookie} -} - -func (c *Conn) ShapeSelectInputChecked(DestinationWindow Window, Enable bool) ShapeSelectInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie) - return ShapeSelectInputCookie{cookie} -} - -func (cook ShapeSelectInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeSelectInput -func (c *Conn) shapeSelectInputRequest(DestinationWindow Window, Enable bool) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - if Enable { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request ShapeInputSelected -// size: 8 -type ShapeInputSelectedCookie struct { - *cookie -} - -func (c *Conn) ShapeInputSelected(DestinationWindow Window) ShapeInputSelectedCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) - return ShapeInputSelectedCookie{cookie} -} - -func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Window) ShapeInputSelectedCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie) - return ShapeInputSelectedCookie{cookie} -} - -// Request reply for ShapeInputSelected -// size: 8 -type ShapeInputSelectedReply struct { - Sequence uint16 - Length uint32 - Enabled bool -} - -// Waits and reads reply data from request ShapeInputSelected -func (cook ShapeInputSelectedCookie) Reply() (*ShapeInputSelectedReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shapeInputSelectedReply(buf), nil -} - -// Read reply into structure from buffer for ShapeInputSelected -func shapeInputSelectedReply(buf []byte) *ShapeInputSelectedReply { - v := new(ShapeInputSelectedReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Enabled = true - } else { - v.Enabled = false - } - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -func (cook ShapeInputSelectedCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeInputSelected -func (c *Conn) shapeInputSelectedRequest(DestinationWindow Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - return buf -} - -// Request ShapeGetRectangles -// size: 12 -type ShapeGetRectanglesCookie struct { - *cookie -} - -func (c *Conn) ShapeGetRectangles(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) - return ShapeGetRectanglesCookie{cookie} -} - -func (c *Conn) ShapeGetRectanglesUnchecked(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie) - return ShapeGetRectanglesCookie{cookie} -} - -// Request reply for ShapeGetRectangles -// size: (32 + pad((int(RectanglesLen) * 8))) -type ShapeGetRectanglesReply struct { - Sequence uint16 - Length uint32 - Ordering byte - RectanglesLen uint32 - // padding: 20 bytes - Rectangles []Rectangle // size: pad((int(RectanglesLen) * 8)) -} - -// Waits and reads reply data from request ShapeGetRectangles -func (cook ShapeGetRectanglesCookie) Reply() (*ShapeGetRectanglesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shapeGetRectanglesReply(buf), nil -} - -// Read reply into structure from buffer for ShapeGetRectangles -func shapeGetRectanglesReply(buf []byte) *ShapeGetRectanglesReply { - v := new(ShapeGetRectanglesReply) - b := 1 // skip reply determinant - - v.Ordering = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.RectanglesLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Rectangles = make([]Rectangle, v.RectanglesLen) - b += ReadRectangleList(buf[b:], v.Rectangles) - - return v -} - -func (cook ShapeGetRectanglesCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShapeGetRectangles -func (c *Conn) shapeGetRectanglesRequest(Window Window, SourceKind ShapeKind) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SHAPE"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = byte(SourceKind) - b += 1 - - b += 3 // padding - - return buf -} diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go deleted file mode 100644 index 392c5ff..0000000 --- a/nexgb/auto_shm.go +++ /dev/null @@ -1,678 +0,0 @@ -package xgb - -/* - This file was generated by shm.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// ShmInit must be called before using the MIT-SHM extension. -func (c *Conn) ShmInit() error { - reply, err := c.QueryExtension(7, "MIT-SHM").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named MIT-SHM could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["MIT-SHM"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["MIT-SHM"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["MIT-SHM"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["MIT-SHM"] = make(map[int]newEventFun) - newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -type ShmSeg uint32 - -func (c *Conn) NewShmSegId() (ShmSeg, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return ShmSeg(id), nil -} - -// Event definition ShmCompletion (0) -// Size: 32 - -const ShmCompletion = 0 - -type ShmCompletionEvent struct { - Sequence uint16 - // padding: 1 bytes - Drawable Drawable - MinorEvent uint16 - MajorEvent byte - // padding: 1 bytes - Shmseg ShmSeg - Offset uint32 -} - -// Event read ShmCompletion -func NewShmCompletionEvent(buf []byte) Event { - v := ShmCompletionEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Drawable = Drawable(Get32(buf[b:])) - b += 4 - - v.MinorEvent = Get16(buf[b:]) - b += 2 - - v.MajorEvent = buf[b] - b += 1 - - b += 1 // padding - - v.Shmseg = ShmSeg(Get32(buf[b:])) - b += 4 - - v.Offset = Get32(buf[b:]) - b += 4 - - return v -} - -// Event write ShmCompletion -func (v ShmCompletionEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - Put16(buf[b:], v.MinorEvent) - b += 2 - - buf[b] = v.MajorEvent - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(v.Shmseg)) - b += 4 - - Put32(buf[b:], v.Offset) - b += 4 - - return buf -} - -func (v ShmCompletionEvent) ImplementsEvent() {} - -func (v ShmCompletionEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ShmCompletionEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("MinorEvent: %d", v.MinorEvent)) - fieldVals = append(fieldVals, sprintf("MajorEvent: %d", v.MajorEvent)) - fieldVals = append(fieldVals, sprintf("Shmseg: %d", v.Shmseg)) - fieldVals = append(fieldVals, sprintf("Offset: %d", v.Offset)) - return "ShmCompletion {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["MIT-SHM"][0] = NewShmCompletionEvent -} - -// ErrorCopy definition ShmBadSeg (0) - -const BadShmBadSeg = 0 - -type ShmBadSegError ValueError - -func NewShmBadSegError(buf []byte) Error { - v := ShmBadSegError(NewValueError(buf).(ValueError)) - v.NiceName = "ShmBadSeg" - return v -} - -func (err ShmBadSegError) ImplementsError() {} - -func (err ShmBadSegError) SequenceId() uint16 { - return err.Sequence -} - -func (err ShmBadSegError) BadId() uint32 { - return 0 -} - -func (err ShmBadSegError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadShmBadSeg {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["MIT-SHM"][0] = NewShmBadSegError -} - -// Request ShmQueryVersion -// size: 4 -type ShmQueryVersionCookie struct { - *cookie -} - -func (c *Conn) ShmQueryVersion() ShmQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shmQueryVersionRequest(), cookie) - return ShmQueryVersionCookie{cookie} -} - -func (c *Conn) ShmQueryVersionUnchecked() ShmQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shmQueryVersionRequest(), cookie) - return ShmQueryVersionCookie{cookie} -} - -// Request reply for ShmQueryVersion -// size: 32 -type ShmQueryVersionReply struct { - Sequence uint16 - Length uint32 - SharedPixmaps bool - MajorVersion uint16 - MinorVersion uint16 - Uid uint16 - Gid uint16 - PixmapFormat byte - // padding: 15 bytes -} - -// Waits and reads reply data from request ShmQueryVersion -func (cook ShmQueryVersionCookie) Reply() (*ShmQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shmQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for ShmQueryVersion -func shmQueryVersionReply(buf []byte) *ShmQueryVersionReply { - v := new(ShmQueryVersionReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.SharedPixmaps = true - } else { - v.SharedPixmaps = false - } - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - v.Uid = Get16(buf[b:]) - b += 2 - - v.Gid = Get16(buf[b:]) - b += 2 - - v.PixmapFormat = buf[b] - b += 1 - - b += 15 // padding - - return v -} - -func (cook ShmQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmQueryVersion -func (c *Conn) shmQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request ShmAttach -// size: 16 -type ShmAttachCookie struct { - *cookie -} - -// Write request to wire for ShmAttach -func (c *Conn) ShmAttach(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) - return ShmAttachCookie{cookie} -} - -func (c *Conn) ShmAttachChecked(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie) - return ShmAttachCookie{cookie} -} - -func (cook ShmAttachCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmAttach -func (c *Conn) shmAttachRequest(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - Put32(buf[b:], Shmid) - b += 4 - - if ReadOnly { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request ShmDetach -// size: 8 -type ShmDetachCookie struct { - *cookie -} - -// Write request to wire for ShmDetach -func (c *Conn) ShmDetach(Shmseg ShmSeg) ShmDetachCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shmDetachRequest(Shmseg), cookie) - return ShmDetachCookie{cookie} -} - -func (c *Conn) ShmDetachChecked(Shmseg ShmSeg) ShmDetachCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shmDetachRequest(Shmseg), cookie) - return ShmDetachCookie{cookie} -} - -func (cook ShmDetachCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmDetach -func (c *Conn) shmDetachRequest(Shmseg ShmSeg) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - return buf -} - -// Request ShmPutImage -// size: 40 -type ShmPutImageCookie struct { - *cookie -} - -// Write request to wire for ShmPutImage -func (c *Conn) ShmPutImage(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) - return ShmPutImageCookie{cookie} -} - -func (c *Conn) ShmPutImageChecked(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) - return ShmPutImageCookie{cookie} -} - -func (cook ShmPutImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmPutImage -func (c *Conn) shmPutImageRequest(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) []byte { - size := 40 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put16(buf[b:], TotalWidth) - b += 2 - - Put16(buf[b:], TotalHeight) - b += 2 - - Put16(buf[b:], SrcX) - b += 2 - - Put16(buf[b:], SrcY) - b += 2 - - Put16(buf[b:], SrcWidth) - b += 2 - - Put16(buf[b:], SrcHeight) - b += 2 - - Put16(buf[b:], uint16(DstX)) - b += 2 - - Put16(buf[b:], uint16(DstY)) - b += 2 - - buf[b] = Depth - b += 1 - - buf[b] = Format - b += 1 - - buf[b] = SendEvent - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - Put32(buf[b:], Offset) - b += 4 - - return buf -} - -// Request ShmGetImage -// size: 32 -type ShmGetImageCookie struct { - *cookie -} - -func (c *Conn) ShmGetImage(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) - return ShmGetImageCookie{cookie} -} - -func (c *Conn) ShmGetImageUnchecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) - return ShmGetImageCookie{cookie} -} - -// Request reply for ShmGetImage -// size: 16 -type ShmGetImageReply struct { - Sequence uint16 - Length uint32 - Depth byte - Visual Visualid - Size uint32 -} - -// Waits and reads reply data from request ShmGetImage -func (cook ShmGetImageCookie) Reply() (*ShmGetImageReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return shmGetImageReply(buf), nil -} - -// Read reply into structure from buffer for ShmGetImage -func shmGetImageReply(buf []byte) *ShmGetImageReply { - v := new(ShmGetImageReply) - b := 1 // skip reply determinant - - v.Depth = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Visual = Visualid(Get32(buf[b:])) - b += 4 - - v.Size = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook ShmGetImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmGetImage -func (c *Conn) shmGetImageRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put16(buf[b:], uint16(X)) - b += 2 - - Put16(buf[b:], uint16(Y)) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - Put32(buf[b:], PlaneMask) - b += 4 - - buf[b] = Format - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - Put32(buf[b:], Offset) - b += 4 - - return buf -} - -// Request ShmCreatePixmap -// size: 28 -type ShmCreatePixmapCookie struct { - *cookie -} - -// Write request to wire for ShmCreatePixmap -func (c *Conn) ShmCreatePixmap(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) - return ShmCreatePixmapCookie{cookie} -} - -func (c *Conn) ShmCreatePixmapChecked(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) - return ShmCreatePixmapCookie{cookie} -} - -func (cook ShmCreatePixmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for ShmCreatePixmap -func (c *Conn) shmCreatePixmapRequest(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["MIT-SHM"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Pid)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - buf[b] = Depth - b += 1 - - b += 3 // padding - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - Put32(buf[b:], Offset) - b += 4 - - return buf -} diff --git a/nexgb/auto_sync.go b/nexgb/auto_sync.go deleted file mode 100644 index 2fc2982..0000000 --- a/nexgb/auto_sync.go +++ /dev/null @@ -1,1949 +0,0 @@ -package xgb - -/* - This file was generated by sync.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// SyncInit must be called before using the SYNC extension. -func (c *Conn) SyncInit() error { - reply, err := c.QueryExtension(4, "SYNC").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named SYNC could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["SYNC"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["SYNC"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["SYNC"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["SYNC"] = make(map[int]newEventFun) - newExtErrorFuncs["SYNC"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -const ( - SyncAlarmstateActive = 0 - SyncAlarmstateInactive = 1 - SyncAlarmstateDestroyed = 2 -) - -const ( - SyncTesttypePositiveTransition = 0 - SyncTesttypeNegativeTransition = 1 - SyncTesttypePositiveComparison = 2 - SyncTesttypeNegativeComparison = 3 -) - -const ( - SyncValuetypeAbsolute = 0 - SyncValuetypeRelative = 1 -) - -const ( - SyncCaCounter = 1 - SyncCaValueType = 2 - SyncCaValue = 4 - SyncCaTestType = 8 - SyncCaDelta = 16 - SyncCaEvents = 32 -) - -type SyncAlarm uint32 - -func (c *Conn) NewSyncAlarmId() (SyncAlarm, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return SyncAlarm(id), nil -} - -type SyncCounter uint32 - -func (c *Conn) NewSyncCounterId() (SyncCounter, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return SyncCounter(id), nil -} - -type SyncFence uint32 - -func (c *Conn) NewSyncFenceId() (SyncFence, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return SyncFence(id), nil -} - -// 'SyncInt64' struct definition -// Size: 8 -type SyncInt64 struct { - Hi int32 - Lo uint32 -} - -// Struct read SyncInt64 -func ReadSyncInt64(buf []byte, v *SyncInt64) int { - b := 0 - - v.Hi = int32(Get32(buf[b:])) - b += 4 - - v.Lo = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read SyncInt64 -func ReadSyncInt64List(buf []byte, dest []SyncInt64) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SyncInt64{} - b += ReadSyncInt64(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write SyncInt64 -func (v SyncInt64) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.Hi)) - b += 4 - - Put32(buf[b:], v.Lo) - b += 4 - - return buf -} - -// Write struct list SyncInt64 -func SyncInt64ListBytes(buf []byte, list []SyncInt64) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'SyncSystemcounter' struct definition -// Size: (14 + pad((int(NameLen) * 1))) -type SyncSystemcounter struct { - Counter SyncCounter - Resolution SyncInt64 - NameLen uint16 - Name string // size: pad((int(NameLen) * 1)) -} - -// Struct read SyncSystemcounter -func ReadSyncSystemcounter(buf []byte, v *SyncSystemcounter) int { - b := 0 - - v.Counter = SyncCounter(Get32(buf[b:])) - b += 4 - - v.Resolution = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.Resolution) - - v.NameLen = Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, v.NameLen) - copy(byteString[:v.NameLen], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.NameLen)) - } - - return b -} - -// Struct list read SyncSystemcounter -func ReadSyncSystemcounterList(buf []byte, dest []SyncSystemcounter) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SyncSystemcounter{} - b += ReadSyncSystemcounter(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write SyncSystemcounter -func (v SyncSystemcounter) Bytes() []byte { - buf := make([]byte, (14 + pad((int(v.NameLen) * 1)))) - b := 0 - - Put32(buf[b:], uint32(v.Counter)) - b += 4 - - { - structBytes := v.Resolution.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put16(buf[b:], v.NameLen) - b += 2 - - copy(buf[b:], v.Name[:v.NameLen]) - b += pad(int(v.NameLen)) - - return buf -} - -// Write struct list SyncSystemcounter -func SyncSystemcounterListBytes(buf []byte, list []SyncSystemcounter) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size SyncSystemcounter -func SyncSystemcounterListSize(list []SyncSystemcounter) int { - size := 0 - for _, item := range list { - size += (14 + pad((int(item.NameLen) * 1))) - } - return size -} - -// 'SyncTrigger' struct definition -// Size: 20 -type SyncTrigger struct { - Counter SyncCounter - WaitType uint32 - WaitValue SyncInt64 - TestType uint32 -} - -// Struct read SyncTrigger -func ReadSyncTrigger(buf []byte, v *SyncTrigger) int { - b := 0 - - v.Counter = SyncCounter(Get32(buf[b:])) - b += 4 - - v.WaitType = Get32(buf[b:]) - b += 4 - - v.WaitValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.WaitValue) - - v.TestType = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read SyncTrigger -func ReadSyncTriggerList(buf []byte, dest []SyncTrigger) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SyncTrigger{} - b += ReadSyncTrigger(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write SyncTrigger -func (v SyncTrigger) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - Put32(buf[b:], uint32(v.Counter)) - b += 4 - - Put32(buf[b:], v.WaitType) - b += 4 - - { - structBytes := v.WaitValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], v.TestType) - b += 4 - - return buf -} - -// Write struct list SyncTrigger -func SyncTriggerListBytes(buf []byte, list []SyncTrigger) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'SyncWaitcondition' struct definition -// Size: 28 -type SyncWaitcondition struct { - Trigger SyncTrigger - EventThreshold SyncInt64 -} - -// Struct read SyncWaitcondition -func ReadSyncWaitcondition(buf []byte, v *SyncWaitcondition) int { - b := 0 - - v.Trigger = SyncTrigger{} - b += ReadSyncTrigger(buf[b:], &v.Trigger) - - v.EventThreshold = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.EventThreshold) - - return b -} - -// Struct list read SyncWaitcondition -func ReadSyncWaitconditionList(buf []byte, dest []SyncWaitcondition) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SyncWaitcondition{} - b += ReadSyncWaitcondition(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write SyncWaitcondition -func (v SyncWaitcondition) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - { - structBytes := v.Trigger.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.EventThreshold.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Write struct list SyncWaitcondition -func SyncWaitconditionListBytes(buf []byte, list []SyncWaitcondition) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Event definition SyncCounterNotify (0) -// Size: 32 - -const SyncCounterNotify = 0 - -type SyncCounterNotifyEvent struct { - Sequence uint16 - Kind byte - Counter SyncCounter - WaitValue SyncInt64 - CounterValue SyncInt64 - Timestamp Timestamp - Count uint16 - Destroyed bool - // padding: 1 bytes -} - -// Event read SyncCounterNotify -func NewSyncCounterNotifyEvent(buf []byte) Event { - v := SyncCounterNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Counter = SyncCounter(Get32(buf[b:])) - b += 4 - - v.WaitValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.WaitValue) - - v.CounterValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.CounterValue) - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Count = Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Destroyed = true - } else { - v.Destroyed = false - } - b += 1 - - b += 1 // padding - - return v -} - -// Event write SyncCounterNotify -func (v SyncCounterNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Kind - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Counter)) - b += 4 - - { - structBytes := v.WaitValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put16(buf[b:], v.Count) - b += 2 - - if v.Destroyed { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 1 // padding - - return buf -} - -func (v SyncCounterNotifyEvent) ImplementsEvent() {} - -func (v SyncCounterNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v SyncCounterNotifyEvent) String() string { - fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, sprintf("Counter: %d", v.Counter)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, sprintf("Destroyed: %t", v.Destroyed)) - return "SyncCounterNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["SYNC"][0] = NewSyncCounterNotifyEvent -} - -// Event definition SyncAlarmNotify (1) -// Size: 32 - -const SyncAlarmNotify = 1 - -type SyncAlarmNotifyEvent struct { - Sequence uint16 - Kind byte - Alarm SyncAlarm - CounterValue SyncInt64 - AlarmValue SyncInt64 - Timestamp Timestamp - State byte - // padding: 3 bytes -} - -// Event read SyncAlarmNotify -func NewSyncAlarmNotifyEvent(buf []byte) Event { - v := SyncAlarmNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Alarm = SyncAlarm(Get32(buf[b:])) - b += 4 - - v.CounterValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.CounterValue) - - v.AlarmValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.AlarmValue) - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.State = buf[b] - b += 1 - - b += 3 // padding - - return v -} - -// Event write SyncAlarmNotify -func (v SyncAlarmNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Kind - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Alarm)) - b += 4 - - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - { - structBytes := v.AlarmValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - buf[b] = v.State - b += 1 - - b += 3 // padding - - return buf -} - -func (v SyncAlarmNotifyEvent) ImplementsEvent() {} - -func (v SyncAlarmNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v SyncAlarmNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, sprintf("Alarm: %d", v.Alarm)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - return "SyncAlarmNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["SYNC"][1] = NewSyncAlarmNotifyEvent -} - -// Error definition SyncCounter (0) -// Size: 32 - -const BadSyncCounter = 0 - -type SyncCounterError struct { - Sequence uint16 - NiceName string - BadCounter uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// Error read SyncCounter -func NewSyncCounterError(buf []byte) Error { - v := SyncCounterError{} - v.NiceName = "SyncCounter" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.BadCounter = Get32(buf[b:]) - b += 4 - - v.MinorOpcode = Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -func (err SyncCounterError) ImplementsError() {} - -func (err SyncCounterError) SequenceId() uint16 { - return err.Sequence -} - -func (err SyncCounterError) BadId() uint32 { - return 0 -} - -func (err SyncCounterError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadCounter: %d", err.BadCounter)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadSyncCounter {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["SYNC"][0] = NewSyncCounterError -} - -// Error definition SyncAlarm (1) -// Size: 32 - -const BadSyncAlarm = 1 - -type SyncAlarmError struct { - Sequence uint16 - NiceName string - BadAlarm uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// Error read SyncAlarm -func NewSyncAlarmError(buf []byte) Error { - v := SyncAlarmError{} - v.NiceName = "SyncAlarm" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.BadAlarm = Get32(buf[b:]) - b += 4 - - v.MinorOpcode = Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -func (err SyncAlarmError) ImplementsError() {} - -func (err SyncAlarmError) SequenceId() uint16 { - return err.Sequence -} - -func (err SyncAlarmError) BadId() uint32 { - return 0 -} - -func (err SyncAlarmError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadAlarm: %d", err.BadAlarm)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadSyncAlarm {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["SYNC"][1] = NewSyncAlarmError -} - -// Request SyncInitialize -// size: 8 -type SyncInitializeCookie struct { - *cookie -} - -func (c *Conn) SyncInitialize(DesiredMajorVersion byte, DesiredMinorVersion byte) SyncInitializeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncInitializeRequest(DesiredMajorVersion, DesiredMinorVersion), cookie) - return SyncInitializeCookie{cookie} -} - -func (c *Conn) SyncInitializeUnchecked(DesiredMajorVersion byte, DesiredMinorVersion byte) SyncInitializeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncInitializeRequest(DesiredMajorVersion, DesiredMinorVersion), cookie) - return SyncInitializeCookie{cookie} -} - -// Request reply for SyncInitialize -// size: 32 -type SyncInitializeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion byte - MinorVersion byte - // padding: 22 bytes -} - -// Waits and reads reply data from request SyncInitialize -func (cook SyncInitializeCookie) Reply() (*SyncInitializeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncInitializeReply(buf), nil -} - -// Read reply into structure from buffer for SyncInitialize -func syncInitializeReply(buf []byte) *SyncInitializeReply { - v := new(SyncInitializeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = buf[b] - b += 1 - - v.MinorVersion = buf[b] - b += 1 - - b += 22 // padding - - return v -} - -func (cook SyncInitializeCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncInitialize -func (c *Conn) syncInitializeRequest(DesiredMajorVersion byte, DesiredMinorVersion byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DesiredMajorVersion - b += 1 - - buf[b] = DesiredMinorVersion - b += 1 - - return buf -} - -// Request SyncListSystemCounters -// size: 4 -type SyncListSystemCountersCookie struct { - *cookie -} - -func (c *Conn) SyncListSystemCounters() SyncListSystemCountersCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncListSystemCountersRequest(), cookie) - return SyncListSystemCountersCookie{cookie} -} - -func (c *Conn) SyncListSystemCountersUnchecked() SyncListSystemCountersCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncListSystemCountersRequest(), cookie) - return SyncListSystemCountersCookie{cookie} -} - -// Request reply for SyncListSystemCounters -// size: (32 + SyncSystemcounterListSize(Counters)) -type SyncListSystemCountersReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - CountersLen uint32 - // padding: 20 bytes - Counters []SyncSystemcounter // size: SyncSystemcounterListSize(Counters) -} - -// Waits and reads reply data from request SyncListSystemCounters -func (cook SyncListSystemCountersCookie) Reply() (*SyncListSystemCountersReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncListSystemCountersReply(buf), nil -} - -// Read reply into structure from buffer for SyncListSystemCounters -func syncListSystemCountersReply(buf []byte) *SyncListSystemCountersReply { - v := new(SyncListSystemCountersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.CountersLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Counters = make([]SyncSystemcounter, v.CountersLen) - b += ReadSyncSystemcounterList(buf[b:], v.Counters) - - return v -} - -func (cook SyncListSystemCountersCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncListSystemCounters -func (c *Conn) syncListSystemCountersRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request SyncCreateCounter -// size: 16 -type SyncCreateCounterCookie struct { - *cookie -} - -// Write request to wire for SyncCreateCounter -func (c *Conn) SyncCreateCounter(Id SyncCounter, InitialValue SyncInt64) SyncCreateCounterCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) - return SyncCreateCounterCookie{cookie} -} - -func (c *Conn) SyncCreateCounterChecked(Id SyncCounter, InitialValue SyncInt64) SyncCreateCounterCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncCreateCounterRequest(Id, InitialValue), cookie) - return SyncCreateCounterCookie{cookie} -} - -func (cook SyncCreateCounterCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncCreateCounter -func (c *Conn) syncCreateCounterRequest(Id SyncCounter, InitialValue SyncInt64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Id)) - b += 4 - - { - structBytes := InitialValue.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Request SyncDestroyCounter -// size: 8 -type SyncDestroyCounterCookie struct { - *cookie -} - -// Write request to wire for SyncDestroyCounter -func (c *Conn) SyncDestroyCounter(Counter SyncCounter) SyncDestroyCounterCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) - return SyncDestroyCounterCookie{cookie} -} - -func (c *Conn) SyncDestroyCounterChecked(Counter SyncCounter) SyncDestroyCounterCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncDestroyCounterRequest(Counter), cookie) - return SyncDestroyCounterCookie{cookie} -} - -func (cook SyncDestroyCounterCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncDestroyCounter -func (c *Conn) syncDestroyCounterRequest(Counter SyncCounter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// Request SyncQueryCounter -// size: 8 -type SyncQueryCounterCookie struct { - *cookie -} - -func (c *Conn) SyncQueryCounter(Counter SyncCounter) SyncQueryCounterCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncQueryCounterRequest(Counter), cookie) - return SyncQueryCounterCookie{cookie} -} - -func (c *Conn) SyncQueryCounterUnchecked(Counter SyncCounter) SyncQueryCounterCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncQueryCounterRequest(Counter), cookie) - return SyncQueryCounterCookie{cookie} -} - -// Request reply for SyncQueryCounter -// size: 16 -type SyncQueryCounterReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - CounterValue SyncInt64 -} - -// Waits and reads reply data from request SyncQueryCounter -func (cook SyncQueryCounterCookie) Reply() (*SyncQueryCounterReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncQueryCounterReply(buf), nil -} - -// Read reply into structure from buffer for SyncQueryCounter -func syncQueryCounterReply(buf []byte) *SyncQueryCounterReply { - v := new(SyncQueryCounterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.CounterValue = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.CounterValue) - - return v -} - -func (cook SyncQueryCounterCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncQueryCounter -func (c *Conn) syncQueryCounterRequest(Counter SyncCounter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// Request SyncAwait -// size: pad((4 + pad((len(WaitList) * 28)))) -type SyncAwaitCookie struct { - *cookie -} - -// Write request to wire for SyncAwait -func (c *Conn) SyncAwait(WaitList []SyncWaitcondition) SyncAwaitCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncAwaitRequest(WaitList), cookie) - return SyncAwaitCookie{cookie} -} - -func (c *Conn) SyncAwaitChecked(WaitList []SyncWaitcondition) SyncAwaitCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncAwaitRequest(WaitList), cookie) - return SyncAwaitCookie{cookie} -} - -func (cook SyncAwaitCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncAwait -func (c *Conn) syncAwaitRequest(WaitList []SyncWaitcondition) []byte { - size := pad((4 + pad((len(WaitList) * 28)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - b += SyncWaitconditionListBytes(buf[b:], WaitList) - - return buf -} - -// Request SyncChangeCounter -// size: 16 -type SyncChangeCounterCookie struct { - *cookie -} - -// Write request to wire for SyncChangeCounter -func (c *Conn) SyncChangeCounter(Counter SyncCounter, Amount SyncInt64) SyncChangeCounterCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) - return SyncChangeCounterCookie{cookie} -} - -func (c *Conn) SyncChangeCounterChecked(Counter SyncCounter, Amount SyncInt64) SyncChangeCounterCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncChangeCounterRequest(Counter, Amount), cookie) - return SyncChangeCounterCookie{cookie} -} - -func (cook SyncChangeCounterCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncChangeCounter -func (c *Conn) syncChangeCounterRequest(Counter SyncCounter, Amount SyncInt64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Amount.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Request SyncSetCounter -// size: 16 -type SyncSetCounterCookie struct { - *cookie -} - -// Write request to wire for SyncSetCounter -func (c *Conn) SyncSetCounter(Counter SyncCounter, Value SyncInt64) SyncSetCounterCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) - return SyncSetCounterCookie{cookie} -} - -func (c *Conn) SyncSetCounterChecked(Counter SyncCounter, Value SyncInt64) SyncSetCounterCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncSetCounterRequest(Counter, Value), cookie) - return SyncSetCounterCookie{cookie} -} - -func (cook SyncSetCounterCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncSetCounter -func (c *Conn) syncSetCounterRequest(Counter SyncCounter, Value SyncInt64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Value.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - return buf -} - -// Request SyncCreateAlarm -// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) -type SyncCreateAlarmCookie struct { - *cookie -} - -// Write request to wire for SyncCreateAlarm -func (c *Conn) SyncCreateAlarm(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) - return SyncCreateAlarmCookie{cookie} -} - -func (c *Conn) SyncCreateAlarmChecked(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncCreateAlarmCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncCreateAlarmRequest(Id, ValueMask, ValueList), cookie) - return SyncCreateAlarmCookie{cookie} -} - -func (cook SyncCreateAlarmCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncCreateAlarm -func (c *Conn) syncCreateAlarmRequest(Id SyncAlarm, ValueMask uint32, ValueList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Id)) - b += 4 - - Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request SyncChangeAlarm -// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) -type SyncChangeAlarmCookie struct { - *cookie -} - -// Write request to wire for SyncChangeAlarm -func (c *Conn) SyncChangeAlarm(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) - return SyncChangeAlarmCookie{cookie} -} - -func (c *Conn) SyncChangeAlarmChecked(Id SyncAlarm, ValueMask uint32, ValueList []uint32) SyncChangeAlarmCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncChangeAlarmRequest(Id, ValueMask, ValueList), cookie) - return SyncChangeAlarmCookie{cookie} -} - -func (cook SyncChangeAlarmCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncChangeAlarm -func (c *Conn) syncChangeAlarmRequest(Id SyncAlarm, ValueMask uint32, ValueList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Id)) - b += 4 - - Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request SyncDestroyAlarm -// size: 8 -type SyncDestroyAlarmCookie struct { - *cookie -} - -// Write request to wire for SyncDestroyAlarm -func (c *Conn) SyncDestroyAlarm(Alarm SyncAlarm) SyncDestroyAlarmCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) - return SyncDestroyAlarmCookie{cookie} -} - -func (c *Conn) SyncDestroyAlarmChecked(Alarm SyncAlarm) SyncDestroyAlarmCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncDestroyAlarmRequest(Alarm), cookie) - return SyncDestroyAlarmCookie{cookie} -} - -func (cook SyncDestroyAlarmCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncDestroyAlarm -func (c *Conn) syncDestroyAlarmRequest(Alarm SyncAlarm) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Alarm)) - b += 4 - - return buf -} - -// Request SyncQueryAlarm -// size: 8 -type SyncQueryAlarmCookie struct { - *cookie -} - -func (c *Conn) SyncQueryAlarm(Alarm SyncAlarm) SyncQueryAlarmCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) - return SyncQueryAlarmCookie{cookie} -} - -func (c *Conn) SyncQueryAlarmUnchecked(Alarm SyncAlarm) SyncQueryAlarmCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncQueryAlarmRequest(Alarm), cookie) - return SyncQueryAlarmCookie{cookie} -} - -// Request reply for SyncQueryAlarm -// size: 40 -type SyncQueryAlarmReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Trigger SyncTrigger - Delta SyncInt64 - Events bool - State byte - // padding: 2 bytes -} - -// Waits and reads reply data from request SyncQueryAlarm -func (cook SyncQueryAlarmCookie) Reply() (*SyncQueryAlarmReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncQueryAlarmReply(buf), nil -} - -// Read reply into structure from buffer for SyncQueryAlarm -func syncQueryAlarmReply(buf []byte) *SyncQueryAlarmReply { - v := new(SyncQueryAlarmReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Trigger = SyncTrigger{} - b += ReadSyncTrigger(buf[b:], &v.Trigger) - - v.Delta = SyncInt64{} - b += ReadSyncInt64(buf[b:], &v.Delta) - - if buf[b] == 1 { - v.Events = true - } else { - v.Events = false - } - b += 1 - - v.State = buf[b] - b += 1 - - b += 2 // padding - - return v -} - -func (cook SyncQueryAlarmCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncQueryAlarm -func (c *Conn) syncQueryAlarmRequest(Alarm SyncAlarm) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Alarm)) - b += 4 - - return buf -} - -// Request SyncSetPriority -// size: 12 -type SyncSetPriorityCookie struct { - *cookie -} - -// Write request to wire for SyncSetPriority -func (c *Conn) SyncSetPriority(Id uint32, Priority int32) SyncSetPriorityCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncSetPriorityRequest(Id, Priority), cookie) - return SyncSetPriorityCookie{cookie} -} - -func (c *Conn) SyncSetPriorityChecked(Id uint32, Priority int32) SyncSetPriorityCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncSetPriorityRequest(Id, Priority), cookie) - return SyncSetPriorityCookie{cookie} -} - -func (cook SyncSetPriorityCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncSetPriority -func (c *Conn) syncSetPriorityRequest(Id uint32, Priority int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Id) - b += 4 - - Put32(buf[b:], uint32(Priority)) - b += 4 - - return buf -} - -// Request SyncGetPriority -// size: 8 -type SyncGetPriorityCookie struct { - *cookie -} - -func (c *Conn) SyncGetPriority(Id uint32) SyncGetPriorityCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncGetPriorityRequest(Id), cookie) - return SyncGetPriorityCookie{cookie} -} - -func (c *Conn) SyncGetPriorityUnchecked(Id uint32) SyncGetPriorityCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncGetPriorityRequest(Id), cookie) - return SyncGetPriorityCookie{cookie} -} - -// Request reply for SyncGetPriority -// size: 12 -type SyncGetPriorityReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Priority int32 -} - -// Waits and reads reply data from request SyncGetPriority -func (cook SyncGetPriorityCookie) Reply() (*SyncGetPriorityReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncGetPriorityReply(buf), nil -} - -// Read reply into structure from buffer for SyncGetPriority -func syncGetPriorityReply(buf []byte) *SyncGetPriorityReply { - v := new(SyncGetPriorityReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Priority = int32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook SyncGetPriorityCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncGetPriority -func (c *Conn) syncGetPriorityRequest(Id uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Id) - b += 4 - - return buf -} - -// Request SyncCreateFence -// size: 16 -type SyncCreateFenceCookie struct { - *cookie -} - -// Write request to wire for SyncCreateFence -func (c *Conn) SyncCreateFence(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) SyncCreateFenceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) - return SyncCreateFenceCookie{cookie} -} - -func (c *Conn) SyncCreateFenceChecked(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) SyncCreateFenceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncCreateFenceRequest(Drawable, Fence, InitiallyTriggered), cookie) - return SyncCreateFenceCookie{cookie} -} - -func (cook SyncCreateFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncCreateFence -func (c *Conn) syncCreateFenceRequest(Drawable Drawable, Fence SyncFence, InitiallyTriggered bool) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Fence)) - b += 4 - - if InitiallyTriggered { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request SyncTriggerFence -// size: 8 -type SyncTriggerFenceCookie struct { - *cookie -} - -// Write request to wire for SyncTriggerFence -func (c *Conn) SyncTriggerFence(Fence SyncFence) SyncTriggerFenceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) - return SyncTriggerFenceCookie{cookie} -} - -func (c *Conn) SyncTriggerFenceChecked(Fence SyncFence) SyncTriggerFenceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncTriggerFenceRequest(Fence), cookie) - return SyncTriggerFenceCookie{cookie} -} - -func (cook SyncTriggerFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncTriggerFence -func (c *Conn) syncTriggerFenceRequest(Fence SyncFence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// Request SyncResetFence -// size: 8 -type SyncResetFenceCookie struct { - *cookie -} - -// Write request to wire for SyncResetFence -func (c *Conn) SyncResetFence(Fence SyncFence) SyncResetFenceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncResetFenceRequest(Fence), cookie) - return SyncResetFenceCookie{cookie} -} - -func (c *Conn) SyncResetFenceChecked(Fence SyncFence) SyncResetFenceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncResetFenceRequest(Fence), cookie) - return SyncResetFenceCookie{cookie} -} - -func (cook SyncResetFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncResetFence -func (c *Conn) syncResetFenceRequest(Fence SyncFence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// Request SyncDestroyFence -// size: 8 -type SyncDestroyFenceCookie struct { - *cookie -} - -// Write request to wire for SyncDestroyFence -func (c *Conn) SyncDestroyFence(Fence SyncFence) SyncDestroyFenceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) - return SyncDestroyFenceCookie{cookie} -} - -func (c *Conn) SyncDestroyFenceChecked(Fence SyncFence) SyncDestroyFenceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncDestroyFenceRequest(Fence), cookie) - return SyncDestroyFenceCookie{cookie} -} - -func (cook SyncDestroyFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncDestroyFence -func (c *Conn) syncDestroyFenceRequest(Fence SyncFence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// Request SyncQueryFence -// size: 8 -type SyncQueryFenceCookie struct { - *cookie -} - -func (c *Conn) SyncQueryFence(Fence SyncFence) SyncQueryFenceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.syncQueryFenceRequest(Fence), cookie) - return SyncQueryFenceCookie{cookie} -} - -func (c *Conn) SyncQueryFenceUnchecked(Fence SyncFence) SyncQueryFenceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.syncQueryFenceRequest(Fence), cookie) - return SyncQueryFenceCookie{cookie} -} - -// Request reply for SyncQueryFence -// size: 32 -type SyncQueryFenceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Triggered bool - // padding: 23 bytes -} - -// Waits and reads reply data from request SyncQueryFence -func (cook SyncQueryFenceCookie) Reply() (*SyncQueryFenceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return syncQueryFenceReply(buf), nil -} - -// Read reply into structure from buffer for SyncQueryFence -func syncQueryFenceReply(buf []byte) *SyncQueryFenceReply { - v := new(SyncQueryFenceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.Triggered = true - } else { - v.Triggered = false - } - b += 1 - - b += 23 // padding - - return v -} - -func (cook SyncQueryFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncQueryFence -func (c *Conn) syncQueryFenceRequest(Fence SyncFence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// Request SyncAwaitFence -// size: pad((4 + pad((len(FenceList) * 4)))) -type SyncAwaitFenceCookie struct { - *cookie -} - -// Write request to wire for SyncAwaitFence -func (c *Conn) SyncAwaitFence(FenceList []SyncFence) SyncAwaitFenceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) - return SyncAwaitFenceCookie{cookie} -} - -func (c *Conn) SyncAwaitFenceChecked(FenceList []SyncFence) SyncAwaitFenceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.syncAwaitFenceRequest(FenceList), cookie) - return SyncAwaitFenceCookie{cookie} -} - -func (cook SyncAwaitFenceCookie) Check() error { - return cook.check() -} - -// Write request to wire for SyncAwaitFence -func (c *Conn) syncAwaitFenceRequest(FenceList []SyncFence) []byte { - size := pad((4 + pad((len(FenceList) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SYNC"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - for i := 0; i < int(len(FenceList)); i++ { - Put32(buf[b:], uint32(FenceList[i])) - b += 4 - } - b = pad(b) - - return buf -} diff --git a/nexgb/auto_xc_misc.go b/nexgb/auto_xc_misc.go deleted file mode 100644 index bce7d29..0000000 --- a/nexgb/auto_xc_misc.go +++ /dev/null @@ -1,326 +0,0 @@ -package xgb - -/* - This file was generated by xc_misc.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Xc_miscInit must be called before using the XC-MISC extension. -func (c *Conn) Xc_miscInit() error { - reply, err := c.QueryExtension(7, "XC-MISC").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XC-MISC could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XC-MISC"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XC-MISC"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XC-MISC"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XC-MISC"] = make(map[int]newEventFun) - newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Request Xc_miscGetVersion -// size: 8 -type Xc_miscGetVersionCookie struct { - *cookie -} - -func (c *Conn) Xc_miscGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return Xc_miscGetVersionCookie{cookie} -} - -func (c *Conn) Xc_miscGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return Xc_miscGetVersionCookie{cookie} -} - -// Request reply for Xc_miscGetVersion -// size: 12 -type Xc_miscGetVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 -} - -// Waits and reads reply data from request Xc_miscGetVersion -func (cook Xc_miscGetVersionCookie) Reply() (*Xc_miscGetVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xc_miscGetVersionReply(buf), nil -} - -// Read reply into structure from buffer for Xc_miscGetVersion -func xc_miscGetVersionReply(buf []byte) *Xc_miscGetVersionReply { - v := new(Xc_miscGetVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajorVersion = Get16(buf[b:]) - b += 2 - - v.ServerMinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook Xc_miscGetVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xc_miscGetVersion -func (c *Conn) xc_miscGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XC-MISC"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], ClientMajorVersion) - b += 2 - - Put16(buf[b:], ClientMinorVersion) - b += 2 - - return buf -} - -// Request Xc_miscGetXIDRange -// size: 4 -type Xc_miscGetXIDRangeCookie struct { - *cookie -} - -func (c *Conn) Xc_miscGetXIDRange() Xc_miscGetXIDRangeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie) - return Xc_miscGetXIDRangeCookie{cookie} -} - -func (c *Conn) Xc_miscGetXIDRangeUnchecked() Xc_miscGetXIDRangeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie) - return Xc_miscGetXIDRangeCookie{cookie} -} - -// Request reply for Xc_miscGetXIDRange -// size: 16 -type Xc_miscGetXIDRangeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - StartId uint32 - Count uint32 -} - -// Waits and reads reply data from request Xc_miscGetXIDRange -func (cook Xc_miscGetXIDRangeCookie) Reply() (*Xc_miscGetXIDRangeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xc_miscGetXIDRangeReply(buf), nil -} - -// Read reply into structure from buffer for Xc_miscGetXIDRange -func xc_miscGetXIDRangeReply(buf []byte) *Xc_miscGetXIDRangeReply { - v := new(Xc_miscGetXIDRangeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.StartId = Get32(buf[b:]) - b += 4 - - v.Count = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Xc_miscGetXIDRangeCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xc_miscGetXIDRange -func (c *Conn) xc_miscGetXIDRangeRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XC-MISC"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request Xc_miscGetXIDList -// size: 8 -type Xc_miscGetXIDListCookie struct { - *cookie -} - -func (c *Conn) Xc_miscGetXIDList(Count uint32) Xc_miscGetXIDListCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie) - return Xc_miscGetXIDListCookie{cookie} -} - -func (c *Conn) Xc_miscGetXIDListUnchecked(Count uint32) Xc_miscGetXIDListCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie) - return Xc_miscGetXIDListCookie{cookie} -} - -// Request reply for Xc_miscGetXIDList -// size: (32 + pad((int(IdsLen) * 4))) -type Xc_miscGetXIDListReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - IdsLen uint32 - // padding: 20 bytes - Ids []uint32 // size: pad((int(IdsLen) * 4)) -} - -// Waits and reads reply data from request Xc_miscGetXIDList -func (cook Xc_miscGetXIDListCookie) Reply() (*Xc_miscGetXIDListReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xc_miscGetXIDListReply(buf), nil -} - -// Read reply into structure from buffer for Xc_miscGetXIDList -func xc_miscGetXIDListReply(buf []byte) *Xc_miscGetXIDListReply { - v := new(Xc_miscGetXIDListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.IdsLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Ids = make([]uint32, v.IdsLen) - for i := 0; i < int(v.IdsLen); i++ { - v.Ids[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook Xc_miscGetXIDListCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xc_miscGetXIDList -func (c *Conn) xc_miscGetXIDListRequest(Count uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XC-MISC"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Count) - b += 4 - - return buf -} diff --git a/nexgb/auto_xevie.go b/nexgb/auto_xevie.go deleted file mode 100644 index 33a05cf..0000000 --- a/nexgb/auto_xevie.go +++ /dev/null @@ -1,539 +0,0 @@ -package xgb - -/* - This file was generated by xevie.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// XevieInit must be called before using the XEVIE extension. -func (c *Conn) XevieInit() error { - reply, err := c.QueryExtension(5, "XEVIE").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XEVIE could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XEVIE"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XEVIE"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XEVIE"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XEVIE"] = make(map[int]newEventFun) - newExtErrorFuncs["XEVIE"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -const ( - XevieDatatypeUnmodified = 0 - XevieDatatypeModified = 1 -) - -// 'XevieEvent' struct definition -// Size: 32 -type XevieEvent struct { - // padding: 32 bytes -} - -// Struct read XevieEvent -func ReadXevieEvent(buf []byte, v *XevieEvent) int { - b := 0 - - b += 32 // padding - - return b -} - -// Struct list read XevieEvent -func ReadXevieEventList(buf []byte, dest []XevieEvent) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XevieEvent{} - b += ReadXevieEvent(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XevieEvent -func (v XevieEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - b += 32 // padding - - return buf -} - -// Write struct list XevieEvent -func XevieEventListBytes(buf []byte, list []XevieEvent) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Request XevieQueryVersion -// size: 8 -type XevieQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XevieQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return XevieQueryVersionCookie{cookie} -} - -func (c *Conn) XevieQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return XevieQueryVersionCookie{cookie} -} - -// Request reply for XevieQueryVersion -// size: 32 -type XevieQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 - // padding: 20 bytes -} - -// Waits and reads reply data from request XevieQueryVersion -func (cook XevieQueryVersionCookie) Reply() (*XevieQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xevieQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XevieQueryVersion -func xevieQueryVersionReply(buf []byte) *XevieQueryVersionReply { - v := new(XevieQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajorVersion = Get16(buf[b:]) - b += 2 - - v.ServerMinorVersion = Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -func (cook XevieQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XevieQueryVersion -func (c *Conn) xevieQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XEVIE"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], ClientMajorVersion) - b += 2 - - Put16(buf[b:], ClientMinorVersion) - b += 2 - - return buf -} - -// Request XevieStart -// size: 8 -type XevieStartCookie struct { - *cookie -} - -func (c *Conn) XevieStart(Screen uint32) XevieStartCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xevieStartRequest(Screen), cookie) - return XevieStartCookie{cookie} -} - -func (c *Conn) XevieStartUnchecked(Screen uint32) XevieStartCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xevieStartRequest(Screen), cookie) - return XevieStartCookie{cookie} -} - -// Request reply for XevieStart -// size: 32 -type XevieStartReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes -} - -// Waits and reads reply data from request XevieStart -func (cook XevieStartCookie) Reply() (*XevieStartReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xevieStartReply(buf), nil -} - -// Read reply into structure from buffer for XevieStart -func xevieStartReply(buf []byte) *XevieStartReply { - v := new(XevieStartReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - return v -} - -func (cook XevieStartCookie) Check() error { - return cook.check() -} - -// Write request to wire for XevieStart -func (c *Conn) xevieStartRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XEVIE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request XevieEnd -// size: 8 -type XevieEndCookie struct { - *cookie -} - -func (c *Conn) XevieEnd(Cmap uint32) XevieEndCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xevieEndRequest(Cmap), cookie) - return XevieEndCookie{cookie} -} - -func (c *Conn) XevieEndUnchecked(Cmap uint32) XevieEndCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xevieEndRequest(Cmap), cookie) - return XevieEndCookie{cookie} -} - -// Request reply for XevieEnd -// size: 32 -type XevieEndReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes -} - -// Waits and reads reply data from request XevieEnd -func (cook XevieEndCookie) Reply() (*XevieEndReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xevieEndReply(buf), nil -} - -// Read reply into structure from buffer for XevieEnd -func xevieEndReply(buf []byte) *XevieEndReply { - v := new(XevieEndReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - return v -} - -func (cook XevieEndCookie) Check() error { - return cook.check() -} - -// Write request to wire for XevieEnd -func (c *Conn) xevieEndRequest(Cmap uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XEVIE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Cmap) - b += 4 - - return buf -} - -// Request XevieSend -// size: 104 -type XevieSendCookie struct { - *cookie -} - -func (c *Conn) XevieSend(Event XevieEvent, DataType uint32) XevieSendCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xevieSendRequest(Event, DataType), cookie) - return XevieSendCookie{cookie} -} - -func (c *Conn) XevieSendUnchecked(Event XevieEvent, DataType uint32) XevieSendCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xevieSendRequest(Event, DataType), cookie) - return XevieSendCookie{cookie} -} - -// Request reply for XevieSend -// size: 32 -type XevieSendReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes -} - -// Waits and reads reply data from request XevieSend -func (cook XevieSendCookie) Reply() (*XevieSendReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xevieSendReply(buf), nil -} - -// Read reply into structure from buffer for XevieSend -func xevieSendReply(buf []byte) *XevieSendReply { - v := new(XevieSendReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - return v -} - -func (cook XevieSendCookie) Check() error { - return cook.check() -} - -// Write request to wire for XevieSend -func (c *Conn) xevieSendRequest(Event XevieEvent, DataType uint32) []byte { - size := 104 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XEVIE"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - { - structBytes := Event.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], DataType) - b += 4 - - b += 64 // padding - - return buf -} - -// Request XevieSelectInput -// size: 8 -type XevieSelectInputCookie struct { - *cookie -} - -func (c *Conn) XevieSelectInput(EventMask uint32) XevieSelectInputCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xevieSelectInputRequest(EventMask), cookie) - return XevieSelectInputCookie{cookie} -} - -func (c *Conn) XevieSelectInputUnchecked(EventMask uint32) XevieSelectInputCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xevieSelectInputRequest(EventMask), cookie) - return XevieSelectInputCookie{cookie} -} - -// Request reply for XevieSelectInput -// size: 32 -type XevieSelectInputReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes -} - -// Waits and reads reply data from request XevieSelectInput -func (cook XevieSelectInputCookie) Reply() (*XevieSelectInputReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xevieSelectInputReply(buf), nil -} - -// Read reply into structure from buffer for XevieSelectInput -func xevieSelectInputReply(buf []byte) *XevieSelectInputReply { - v := new(XevieSelectInputReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - return v -} - -func (cook XevieSelectInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for XevieSelectInput -func (c *Conn) xevieSelectInputRequest(EventMask uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XEVIE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], EventMask) - b += 4 - - return buf -} diff --git a/nexgb/auto_xf86dri.go b/nexgb/auto_xf86dri.go deleted file mode 100644 index 4caa416..0000000 --- a/nexgb/auto_xf86dri.go +++ /dev/null @@ -1,1151 +0,0 @@ -package xgb - -/* - This file was generated by xf86dri.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Xf86driInit must be called before using the XFree86-DRI extension. -func (c *Conn) Xf86driInit() error { - reply, err := c.QueryExtension(11, "XFree86-DRI").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XFree86-DRI could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XFree86-DRI"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XFree86-DRI"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XFree86-DRI"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XFree86-DRI"] = make(map[int]newEventFun) - newExtErrorFuncs["XFree86-DRI"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// 'Xf86driDrmClipRect' struct definition -// Size: 8 -type Xf86driDrmClipRect struct { - X1 int16 - Y1 int16 - X2 int16 - X3 int16 -} - -// Struct read Xf86driDrmClipRect -func ReadXf86driDrmClipRect(buf []byte, v *Xf86driDrmClipRect) int { - b := 0 - - v.X1 = int16(Get16(buf[b:])) - b += 2 - - v.Y1 = int16(Get16(buf[b:])) - b += 2 - - v.X2 = int16(Get16(buf[b:])) - b += 2 - - v.X3 = int16(Get16(buf[b:])) - b += 2 - - return b -} - -// Struct list read Xf86driDrmClipRect -func ReadXf86driDrmClipRectList(buf []byte, dest []Xf86driDrmClipRect) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Xf86driDrmClipRect{} - b += ReadXf86driDrmClipRect(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write Xf86driDrmClipRect -func (v Xf86driDrmClipRect) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], uint16(v.X1)) - b += 2 - - Put16(buf[b:], uint16(v.Y1)) - b += 2 - - Put16(buf[b:], uint16(v.X2)) - b += 2 - - Put16(buf[b:], uint16(v.X3)) - b += 2 - - return buf -} - -// Write struct list Xf86driDrmClipRect -func Xf86driDrmClipRectListBytes(buf []byte, list []Xf86driDrmClipRect) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Request Xf86driQueryVersion -// size: 4 -type Xf86driQueryVersionCookie struct { - *cookie -} - -func (c *Conn) Xf86driQueryVersion() Xf86driQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driQueryVersionRequest(), cookie) - return Xf86driQueryVersionCookie{cookie} -} - -func (c *Conn) Xf86driQueryVersionUnchecked() Xf86driQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driQueryVersionRequest(), cookie) - return Xf86driQueryVersionCookie{cookie} -} - -// Request reply for Xf86driQueryVersion -// size: 16 -type Xf86driQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - DriMajorVersion uint16 - DriMinorVersion uint16 - DriMinorPatch uint32 -} - -// Waits and reads reply data from request Xf86driQueryVersion -func (cook Xf86driQueryVersionCookie) Reply() (*Xf86driQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driQueryVersion -func xf86driQueryVersionReply(buf []byte) *Xf86driQueryVersionReply { - v := new(Xf86driQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.DriMajorVersion = Get16(buf[b:]) - b += 2 - - v.DriMinorVersion = Get16(buf[b:]) - b += 2 - - v.DriMinorPatch = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Xf86driQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driQueryVersion -func (c *Conn) xf86driQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request Xf86driQueryDirectRenderingCapable -// size: 8 -type Xf86driQueryDirectRenderingCapableCookie struct { - *cookie -} - -func (c *Conn) Xf86driQueryDirectRenderingCapable(Screen uint32) Xf86driQueryDirectRenderingCapableCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driQueryDirectRenderingCapableRequest(Screen), cookie) - return Xf86driQueryDirectRenderingCapableCookie{cookie} -} - -func (c *Conn) Xf86driQueryDirectRenderingCapableUnchecked(Screen uint32) Xf86driQueryDirectRenderingCapableCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driQueryDirectRenderingCapableRequest(Screen), cookie) - return Xf86driQueryDirectRenderingCapableCookie{cookie} -} - -// Request reply for Xf86driQueryDirectRenderingCapable -// size: 9 -type Xf86driQueryDirectRenderingCapableReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - IsCapable bool -} - -// Waits and reads reply data from request Xf86driQueryDirectRenderingCapable -func (cook Xf86driQueryDirectRenderingCapableCookie) Reply() (*Xf86driQueryDirectRenderingCapableReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driQueryDirectRenderingCapableReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driQueryDirectRenderingCapable -func xf86driQueryDirectRenderingCapableReply(buf []byte) *Xf86driQueryDirectRenderingCapableReply { - v := new(Xf86driQueryDirectRenderingCapableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.IsCapable = true - } else { - v.IsCapable = false - } - b += 1 - - return v -} - -func (cook Xf86driQueryDirectRenderingCapableCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driQueryDirectRenderingCapable -func (c *Conn) xf86driQueryDirectRenderingCapableRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request Xf86driOpenConnection -// size: 8 -type Xf86driOpenConnectionCookie struct { - *cookie -} - -func (c *Conn) Xf86driOpenConnection(Screen uint32) Xf86driOpenConnectionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driOpenConnectionRequest(Screen), cookie) - return Xf86driOpenConnectionCookie{cookie} -} - -func (c *Conn) Xf86driOpenConnectionUnchecked(Screen uint32) Xf86driOpenConnectionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driOpenConnectionRequest(Screen), cookie) - return Xf86driOpenConnectionCookie{cookie} -} - -// Request reply for Xf86driOpenConnection -// size: (32 + pad((int(BusIdLen) * 1))) -type Xf86driOpenConnectionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - SareaHandleLow uint32 - SareaHandleHigh uint32 - BusIdLen uint32 - // padding: 12 bytes - BusId string // size: pad((int(BusIdLen) * 1)) -} - -// Waits and reads reply data from request Xf86driOpenConnection -func (cook Xf86driOpenConnectionCookie) Reply() (*Xf86driOpenConnectionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driOpenConnectionReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driOpenConnection -func xf86driOpenConnectionReply(buf []byte) *Xf86driOpenConnectionReply { - v := new(Xf86driOpenConnectionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.SareaHandleLow = Get32(buf[b:]) - b += 4 - - v.SareaHandleHigh = Get32(buf[b:]) - b += 4 - - v.BusIdLen = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - { - byteString := make([]byte, v.BusIdLen) - copy(byteString[:v.BusIdLen], buf[b:]) - v.BusId = string(byteString) - b += pad(int(v.BusIdLen)) - } - - return v -} - -func (cook Xf86driOpenConnectionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driOpenConnection -func (c *Conn) xf86driOpenConnectionRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request Xf86driCloseConnection -// size: 8 -type Xf86driCloseConnectionCookie struct { - *cookie -} - -// Write request to wire for Xf86driCloseConnection -func (c *Conn) Xf86driCloseConnection(Screen uint32) Xf86driCloseConnectionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86driCloseConnectionRequest(Screen), cookie) - return Xf86driCloseConnectionCookie{cookie} -} - -func (c *Conn) Xf86driCloseConnectionChecked(Screen uint32) Xf86driCloseConnectionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86driCloseConnectionRequest(Screen), cookie) - return Xf86driCloseConnectionCookie{cookie} -} - -func (cook Xf86driCloseConnectionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driCloseConnection -func (c *Conn) xf86driCloseConnectionRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request Xf86driGetClientDriverName -// size: 8 -type Xf86driGetClientDriverNameCookie struct { - *cookie -} - -func (c *Conn) Xf86driGetClientDriverName(Screen uint32) Xf86driGetClientDriverNameCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driGetClientDriverNameRequest(Screen), cookie) - return Xf86driGetClientDriverNameCookie{cookie} -} - -func (c *Conn) Xf86driGetClientDriverNameUnchecked(Screen uint32) Xf86driGetClientDriverNameCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driGetClientDriverNameRequest(Screen), cookie) - return Xf86driGetClientDriverNameCookie{cookie} -} - -// Request reply for Xf86driGetClientDriverName -// size: (32 + pad((int(ClientDriverNameLen) * 1))) -type Xf86driGetClientDriverNameReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ClientDriverMajorVersion uint32 - ClientDriverMinorVersion uint32 - ClientDriverPatchVersion uint32 - ClientDriverNameLen uint32 - // padding: 8 bytes - ClientDriverName string // size: pad((int(ClientDriverNameLen) * 1)) -} - -// Waits and reads reply data from request Xf86driGetClientDriverName -func (cook Xf86driGetClientDriverNameCookie) Reply() (*Xf86driGetClientDriverNameReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driGetClientDriverNameReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driGetClientDriverName -func xf86driGetClientDriverNameReply(buf []byte) *Xf86driGetClientDriverNameReply { - v := new(Xf86driGetClientDriverNameReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ClientDriverMajorVersion = Get32(buf[b:]) - b += 4 - - v.ClientDriverMinorVersion = Get32(buf[b:]) - b += 4 - - v.ClientDriverPatchVersion = Get32(buf[b:]) - b += 4 - - v.ClientDriverNameLen = Get32(buf[b:]) - b += 4 - - b += 8 // padding - - { - byteString := make([]byte, v.ClientDriverNameLen) - copy(byteString[:v.ClientDriverNameLen], buf[b:]) - v.ClientDriverName = string(byteString) - b += pad(int(v.ClientDriverNameLen)) - } - - return v -} - -func (cook Xf86driGetClientDriverNameCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driGetClientDriverName -func (c *Conn) xf86driGetClientDriverNameRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request Xf86driCreateContext -// size: 16 -type Xf86driCreateContextCookie struct { - *cookie -} - -func (c *Conn) Xf86driCreateContext(Screen uint32, Visual uint32, Context uint32) Xf86driCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driCreateContextRequest(Screen, Visual, Context), cookie) - return Xf86driCreateContextCookie{cookie} -} - -func (c *Conn) Xf86driCreateContextUnchecked(Screen uint32, Visual uint32, Context uint32) Xf86driCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driCreateContextRequest(Screen, Visual, Context), cookie) - return Xf86driCreateContextCookie{cookie} -} - -// Request reply for Xf86driCreateContext -// size: 12 -type Xf86driCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - HwContext uint32 -} - -// Waits and reads reply data from request Xf86driCreateContext -func (cook Xf86driCreateContextCookie) Reply() (*Xf86driCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driCreateContext -func xf86driCreateContextReply(buf []byte) *Xf86driCreateContextReply { - v := new(Xf86driCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.HwContext = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Xf86driCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driCreateContext -func (c *Conn) xf86driCreateContextRequest(Screen uint32, Visual uint32, Context uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Visual) - b += 4 - - Put32(buf[b:], Context) - b += 4 - - return buf -} - -// Request Xf86driDestroyContext -// size: 12 -type Xf86driDestroyContextCookie struct { - *cookie -} - -// Write request to wire for Xf86driDestroyContext -func (c *Conn) Xf86driDestroyContext(Screen uint32, Context uint32) Xf86driDestroyContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86driDestroyContextRequest(Screen, Context), cookie) - return Xf86driDestroyContextCookie{cookie} -} - -func (c *Conn) Xf86driDestroyContextChecked(Screen uint32, Context uint32) Xf86driDestroyContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86driDestroyContextRequest(Screen, Context), cookie) - return Xf86driDestroyContextCookie{cookie} -} - -func (cook Xf86driDestroyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driDestroyContext -func (c *Conn) xf86driDestroyContextRequest(Screen uint32, Context uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Context) - b += 4 - - return buf -} - -// Request Xf86driCreateDrawable -// size: 12 -type Xf86driCreateDrawableCookie struct { - *cookie -} - -func (c *Conn) Xf86driCreateDrawable(Screen uint32, Drawable uint32) Xf86driCreateDrawableCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driCreateDrawableRequest(Screen, Drawable), cookie) - return Xf86driCreateDrawableCookie{cookie} -} - -func (c *Conn) Xf86driCreateDrawableUnchecked(Screen uint32, Drawable uint32) Xf86driCreateDrawableCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driCreateDrawableRequest(Screen, Drawable), cookie) - return Xf86driCreateDrawableCookie{cookie} -} - -// Request reply for Xf86driCreateDrawable -// size: 12 -type Xf86driCreateDrawableReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - HwDrawableHandle uint32 -} - -// Waits and reads reply data from request Xf86driCreateDrawable -func (cook Xf86driCreateDrawableCookie) Reply() (*Xf86driCreateDrawableReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driCreateDrawableReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driCreateDrawable -func xf86driCreateDrawableReply(buf []byte) *Xf86driCreateDrawableReply { - v := new(Xf86driCreateDrawableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.HwDrawableHandle = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Xf86driCreateDrawableCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driCreateDrawable -func (c *Conn) xf86driCreateDrawableRequest(Screen uint32, Drawable uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Drawable) - b += 4 - - return buf -} - -// Request Xf86driDestroyDrawable -// size: 12 -type Xf86driDestroyDrawableCookie struct { - *cookie -} - -// Write request to wire for Xf86driDestroyDrawable -func (c *Conn) Xf86driDestroyDrawable(Screen uint32, Drawable uint32) Xf86driDestroyDrawableCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86driDestroyDrawableRequest(Screen, Drawable), cookie) - return Xf86driDestroyDrawableCookie{cookie} -} - -func (c *Conn) Xf86driDestroyDrawableChecked(Screen uint32, Drawable uint32) Xf86driDestroyDrawableCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86driDestroyDrawableRequest(Screen, Drawable), cookie) - return Xf86driDestroyDrawableCookie{cookie} -} - -func (cook Xf86driDestroyDrawableCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driDestroyDrawable -func (c *Conn) xf86driDestroyDrawableRequest(Screen uint32, Drawable uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Drawable) - b += 4 - - return buf -} - -// Request Xf86driGetDrawableInfo -// size: 12 -type Xf86driGetDrawableInfoCookie struct { - *cookie -} - -func (c *Conn) Xf86driGetDrawableInfo(Screen uint32, Drawable uint32) Xf86driGetDrawableInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driGetDrawableInfoRequest(Screen, Drawable), cookie) - return Xf86driGetDrawableInfoCookie{cookie} -} - -func (c *Conn) Xf86driGetDrawableInfoUnchecked(Screen uint32, Drawable uint32) Xf86driGetDrawableInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driGetDrawableInfoRequest(Screen, Drawable), cookie) - return Xf86driGetDrawableInfoCookie{cookie} -} - -// Request reply for Xf86driGetDrawableInfo -// size: ((36 + pad((int(NumClipRects) * 8))) + pad((int(NumBackClipRects) * 8))) -type Xf86driGetDrawableInfoReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - DrawableTableIndex uint32 - DrawableTableStamp uint32 - DrawableOriginX int16 - DrawableOriginY int16 - DrawableSizeW int16 - DrawableSizeH int16 - NumClipRects uint32 - BackX int16 - BackY int16 - NumBackClipRects uint32 - ClipRects []Xf86driDrmClipRect // size: pad((int(NumClipRects) * 8)) - BackClipRects []Xf86driDrmClipRect // size: pad((int(NumBackClipRects) * 8)) -} - -// Waits and reads reply data from request Xf86driGetDrawableInfo -func (cook Xf86driGetDrawableInfoCookie) Reply() (*Xf86driGetDrawableInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driGetDrawableInfoReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driGetDrawableInfo -func xf86driGetDrawableInfoReply(buf []byte) *Xf86driGetDrawableInfoReply { - v := new(Xf86driGetDrawableInfoReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.DrawableTableIndex = Get32(buf[b:]) - b += 4 - - v.DrawableTableStamp = Get32(buf[b:]) - b += 4 - - v.DrawableOriginX = int16(Get16(buf[b:])) - b += 2 - - v.DrawableOriginY = int16(Get16(buf[b:])) - b += 2 - - v.DrawableSizeW = int16(Get16(buf[b:])) - b += 2 - - v.DrawableSizeH = int16(Get16(buf[b:])) - b += 2 - - v.NumClipRects = Get32(buf[b:]) - b += 4 - - v.BackX = int16(Get16(buf[b:])) - b += 2 - - v.BackY = int16(Get16(buf[b:])) - b += 2 - - v.NumBackClipRects = Get32(buf[b:]) - b += 4 - - v.ClipRects = make([]Xf86driDrmClipRect, v.NumClipRects) - b += ReadXf86driDrmClipRectList(buf[b:], v.ClipRects) - - v.BackClipRects = make([]Xf86driDrmClipRect, v.NumBackClipRects) - b += ReadXf86driDrmClipRectList(buf[b:], v.BackClipRects) - - return v -} - -func (cook Xf86driGetDrawableInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driGetDrawableInfo -func (c *Conn) xf86driGetDrawableInfoRequest(Screen uint32, Drawable uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Drawable) - b += 4 - - return buf -} - -// Request Xf86driGetDeviceInfo -// size: 8 -type Xf86driGetDeviceInfoCookie struct { - *cookie -} - -func (c *Conn) Xf86driGetDeviceInfo(Screen uint32) Xf86driGetDeviceInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driGetDeviceInfoRequest(Screen), cookie) - return Xf86driGetDeviceInfoCookie{cookie} -} - -func (c *Conn) Xf86driGetDeviceInfoUnchecked(Screen uint32) Xf86driGetDeviceInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driGetDeviceInfoRequest(Screen), cookie) - return Xf86driGetDeviceInfoCookie{cookie} -} - -// Request reply for Xf86driGetDeviceInfo -// size: (32 + pad((int(DevicePrivateSize) * 4))) -type Xf86driGetDeviceInfoReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - FramebufferHandleLow uint32 - FramebufferHandleHigh uint32 - FramebufferOriginOffset uint32 - FramebufferSize uint32 - FramebufferStride uint32 - DevicePrivateSize uint32 - DevicePrivate []uint32 // size: pad((int(DevicePrivateSize) * 4)) -} - -// Waits and reads reply data from request Xf86driGetDeviceInfo -func (cook Xf86driGetDeviceInfoCookie) Reply() (*Xf86driGetDeviceInfoReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driGetDeviceInfoReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driGetDeviceInfo -func xf86driGetDeviceInfoReply(buf []byte) *Xf86driGetDeviceInfoReply { - v := new(Xf86driGetDeviceInfoReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.FramebufferHandleLow = Get32(buf[b:]) - b += 4 - - v.FramebufferHandleHigh = Get32(buf[b:]) - b += 4 - - v.FramebufferOriginOffset = Get32(buf[b:]) - b += 4 - - v.FramebufferSize = Get32(buf[b:]) - b += 4 - - v.FramebufferStride = Get32(buf[b:]) - b += 4 - - v.DevicePrivateSize = Get32(buf[b:]) - b += 4 - - v.DevicePrivate = make([]uint32, v.DevicePrivateSize) - for i := 0; i < int(v.DevicePrivateSize); i++ { - v.DevicePrivate[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook Xf86driGetDeviceInfoCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driGetDeviceInfo -func (c *Conn) xf86driGetDeviceInfoRequest(Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request Xf86driAuthConnection -// size: 12 -type Xf86driAuthConnectionCookie struct { - *cookie -} - -func (c *Conn) Xf86driAuthConnection(Screen uint32, Magic uint32) Xf86driAuthConnectionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86driAuthConnectionRequest(Screen, Magic), cookie) - return Xf86driAuthConnectionCookie{cookie} -} - -func (c *Conn) Xf86driAuthConnectionUnchecked(Screen uint32, Magic uint32) Xf86driAuthConnectionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86driAuthConnectionRequest(Screen, Magic), cookie) - return Xf86driAuthConnectionCookie{cookie} -} - -// Request reply for Xf86driAuthConnection -// size: 12 -type Xf86driAuthConnectionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Authenticated uint32 -} - -// Waits and reads reply data from request Xf86driAuthConnection -func (cook Xf86driAuthConnectionCookie) Reply() (*Xf86driAuthConnectionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86driAuthConnectionReply(buf), nil -} - -// Read reply into structure from buffer for Xf86driAuthConnection -func xf86driAuthConnectionReply(buf []byte) *Xf86driAuthConnectionReply { - v := new(Xf86driAuthConnectionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Authenticated = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook Xf86driAuthConnectionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86driAuthConnection -func (c *Conn) xf86driAuthConnectionRequest(Screen uint32, Magic uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], Magic) - b += 4 - - return buf -} diff --git a/nexgb/auto_xf86vidmode.go b/nexgb/auto_xf86vidmode.go deleted file mode 100644 index 983c021..0000000 --- a/nexgb/auto_xf86vidmode.go +++ /dev/null @@ -1,2398 +0,0 @@ -package xgb - -/* - This file was generated by xf86vidmode.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Xf86vidmodeInit must be called before using the XFree86-VidModeExtension extension. -func (c *Conn) Xf86vidmodeInit() error { - reply, err := c.QueryExtension(24, "XFree86-VidModeExtension").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XFree86-VidModeExtension could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XFree86-VidModeExtension"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XFree86-VidModeExtension"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XFree86-VidModeExtension"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XFree86-VidModeExtension"] = make(map[int]newEventFun) - newExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -const ( - Xf86vidmodeModeFlagPositiveHsync = 1 - Xf86vidmodeModeFlagNegativeHsync = 2 - Xf86vidmodeModeFlagPositiveVsync = 4 - Xf86vidmodeModeFlagNegativeVsync = 8 - Xf86vidmodeModeFlagInterlace = 16 - Xf86vidmodeModeFlagCompositeSync = 32 - Xf86vidmodeModeFlagPositiveCsync = 64 - Xf86vidmodeModeFlagNegativeCsync = 128 - Xf86vidmodeModeFlagHSkew = 256 - Xf86vidmodeModeFlagBroadcast = 512 - Xf86vidmodeModeFlagPixmux = 1024 - Xf86vidmodeModeFlagDoubleClock = 2048 - Xf86vidmodeModeFlagHalfClock = 4096 -) - -const ( - Xf86vidmodeClockFlagProgramable = 1 -) - -const ( - Xf86vidmodePermissionRead = 1 - Xf86vidmodePermissionWrite = 2 -) - -type Xf86vidmodeSyncrange uint32 - -type Xf86vidmodeDotclock uint32 - -// 'Xf86vidmodeModeInfo' struct definition -// Size: 48 -type Xf86vidmodeModeInfo struct { - Dotclock Xf86vidmodeDotclock - Hdisplay uint16 - Hsyncstart uint16 - Hsyncend uint16 - Htotal uint16 - Hskew uint32 - Vdisplay uint16 - Vsyncstart uint16 - Vsyncend uint16 - Vtotal uint16 - // padding: 4 bytes - Flags uint32 - // padding: 12 bytes - Privsize uint32 -} - -// Struct read Xf86vidmodeModeInfo -func ReadXf86vidmodeModeInfo(buf []byte, v *Xf86vidmodeModeInfo) int { - b := 0 - - v.Dotclock = Xf86vidmodeDotclock(Get32(buf[b:])) - b += 4 - - v.Hdisplay = Get16(buf[b:]) - b += 2 - - v.Hsyncstart = Get16(buf[b:]) - b += 2 - - v.Hsyncend = Get16(buf[b:]) - b += 2 - - v.Htotal = Get16(buf[b:]) - b += 2 - - v.Hskew = Get32(buf[b:]) - b += 4 - - v.Vdisplay = Get16(buf[b:]) - b += 2 - - v.Vsyncstart = Get16(buf[b:]) - b += 2 - - v.Vsyncend = Get16(buf[b:]) - b += 2 - - v.Vtotal = Get16(buf[b:]) - b += 2 - - b += 4 // padding - - v.Flags = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Privsize = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read Xf86vidmodeModeInfo -func ReadXf86vidmodeModeInfoList(buf []byte, dest []Xf86vidmodeModeInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Xf86vidmodeModeInfo{} - b += ReadXf86vidmodeModeInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write Xf86vidmodeModeInfo -func (v Xf86vidmodeModeInfo) Bytes() []byte { - buf := make([]byte, 48) - b := 0 - - Put32(buf[b:], uint32(v.Dotclock)) - b += 4 - - Put16(buf[b:], v.Hdisplay) - b += 2 - - Put16(buf[b:], v.Hsyncstart) - b += 2 - - Put16(buf[b:], v.Hsyncend) - b += 2 - - Put16(buf[b:], v.Htotal) - b += 2 - - Put32(buf[b:], v.Hskew) - b += 4 - - Put16(buf[b:], v.Vdisplay) - b += 2 - - Put16(buf[b:], v.Vsyncstart) - b += 2 - - Put16(buf[b:], v.Vsyncend) - b += 2 - - Put16(buf[b:], v.Vtotal) - b += 2 - - b += 4 // padding - - Put32(buf[b:], v.Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], v.Privsize) - b += 4 - - return buf -} - -// Write struct list Xf86vidmodeModeInfo -func Xf86vidmodeModeInfoListBytes(buf []byte, list []Xf86vidmodeModeInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Error definition Xf86vidmodeBadClock (0) -// Size: 32 - -const BadXf86vidmodeBadClock = 0 - -type Xf86vidmodeBadClockError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeBadClock -func NewXf86vidmodeBadClockError(buf []byte) Error { - v := Xf86vidmodeBadClockError{} - v.NiceName = "Xf86vidmodeBadClock" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeBadClockError) ImplementsError() {} - -func (err Xf86vidmodeBadClockError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeBadClockError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeBadClockError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeBadClock {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][0] = NewXf86vidmodeBadClockError -} - -// Error definition Xf86vidmodeBadHTimings (1) -// Size: 32 - -const BadXf86vidmodeBadHTimings = 1 - -type Xf86vidmodeBadHTimingsError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeBadHTimings -func NewXf86vidmodeBadHTimingsError(buf []byte) Error { - v := Xf86vidmodeBadHTimingsError{} - v.NiceName = "Xf86vidmodeBadHTimings" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeBadHTimingsError) ImplementsError() {} - -func (err Xf86vidmodeBadHTimingsError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeBadHTimingsError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeBadHTimingsError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeBadHTimings {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][1] = NewXf86vidmodeBadHTimingsError -} - -// Error definition Xf86vidmodeBadVTimings (2) -// Size: 32 - -const BadXf86vidmodeBadVTimings = 2 - -type Xf86vidmodeBadVTimingsError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeBadVTimings -func NewXf86vidmodeBadVTimingsError(buf []byte) Error { - v := Xf86vidmodeBadVTimingsError{} - v.NiceName = "Xf86vidmodeBadVTimings" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeBadVTimingsError) ImplementsError() {} - -func (err Xf86vidmodeBadVTimingsError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeBadVTimingsError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeBadVTimingsError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeBadVTimings {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][2] = NewXf86vidmodeBadVTimingsError -} - -// Error definition Xf86vidmodeModeUnsuitable (3) -// Size: 32 - -const BadXf86vidmodeModeUnsuitable = 3 - -type Xf86vidmodeModeUnsuitableError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeModeUnsuitable -func NewXf86vidmodeModeUnsuitableError(buf []byte) Error { - v := Xf86vidmodeModeUnsuitableError{} - v.NiceName = "Xf86vidmodeModeUnsuitable" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeModeUnsuitableError) ImplementsError() {} - -func (err Xf86vidmodeModeUnsuitableError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeModeUnsuitableError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeModeUnsuitableError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeModeUnsuitable {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][3] = NewXf86vidmodeModeUnsuitableError -} - -// Error definition Xf86vidmodeExtensionDisabled (4) -// Size: 32 - -const BadXf86vidmodeExtensionDisabled = 4 - -type Xf86vidmodeExtensionDisabledError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeExtensionDisabled -func NewXf86vidmodeExtensionDisabledError(buf []byte) Error { - v := Xf86vidmodeExtensionDisabledError{} - v.NiceName = "Xf86vidmodeExtensionDisabled" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeExtensionDisabledError) ImplementsError() {} - -func (err Xf86vidmodeExtensionDisabledError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeExtensionDisabledError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeExtensionDisabledError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeExtensionDisabled {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][4] = NewXf86vidmodeExtensionDisabledError -} - -// Error definition Xf86vidmodeClientNotLocal (5) -// Size: 32 - -const BadXf86vidmodeClientNotLocal = 5 - -type Xf86vidmodeClientNotLocalError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeClientNotLocal -func NewXf86vidmodeClientNotLocalError(buf []byte) Error { - v := Xf86vidmodeClientNotLocalError{} - v.NiceName = "Xf86vidmodeClientNotLocal" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeClientNotLocalError) ImplementsError() {} - -func (err Xf86vidmodeClientNotLocalError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeClientNotLocalError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeClientNotLocalError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeClientNotLocal {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][5] = NewXf86vidmodeClientNotLocalError -} - -// Error definition Xf86vidmodeZoomLocked (6) -// Size: 32 - -const BadXf86vidmodeZoomLocked = 6 - -type Xf86vidmodeZoomLockedError struct { - Sequence uint16 - NiceName string -} - -// Error read Xf86vidmodeZoomLocked -func NewXf86vidmodeZoomLockedError(buf []byte) Error { - v := Xf86vidmodeZoomLockedError{} - v.NiceName = "Xf86vidmodeZoomLocked" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err Xf86vidmodeZoomLockedError) ImplementsError() {} - -func (err Xf86vidmodeZoomLockedError) SequenceId() uint16 { - return err.Sequence -} - -func (err Xf86vidmodeZoomLockedError) BadId() uint32 { - return 0 -} - -func (err Xf86vidmodeZoomLockedError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXf86vidmodeZoomLocked {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFree86-VidModeExtension"][6] = NewXf86vidmodeZoomLockedError -} - -// Request Xf86vidmodeQueryVersion -// size: 4 -type Xf86vidmodeQueryVersionCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeQueryVersion() Xf86vidmodeQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeQueryVersionRequest(), cookie) - return Xf86vidmodeQueryVersionCookie{cookie} -} - -func (c *Conn) Xf86vidmodeQueryVersionUnchecked() Xf86vidmodeQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeQueryVersionRequest(), cookie) - return Xf86vidmodeQueryVersionCookie{cookie} -} - -// Request reply for Xf86vidmodeQueryVersion -// size: 12 -type Xf86vidmodeQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} - -// Waits and reads reply data from request Xf86vidmodeQueryVersion -func (cook Xf86vidmodeQueryVersionCookie) Reply() (*Xf86vidmodeQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeQueryVersion -func xf86vidmodeQueryVersionReply(buf []byte) *Xf86vidmodeQueryVersionReply { - v := new(Xf86vidmodeQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook Xf86vidmodeQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeQueryVersion -func (c *Conn) xf86vidmodeQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request Xf86vidmodeGetModeLine -// size: 8 -type Xf86vidmodeGetModeLineCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetModeLine(Screen uint16) Xf86vidmodeGetModeLineCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetModeLineRequest(Screen), cookie) - return Xf86vidmodeGetModeLineCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetModeLineUnchecked(Screen uint16) Xf86vidmodeGetModeLineCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetModeLineRequest(Screen), cookie) - return Xf86vidmodeGetModeLineCookie{cookie} -} - -// Request reply for Xf86vidmodeGetModeLine -// size: (52 + pad((int(Privsize) * 1))) -type Xf86vidmodeGetModeLineReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Dotclock Xf86vidmodeDotclock - Hdisplay uint16 - Hsyncstart uint16 - Hsyncend uint16 - Htotal uint16 - Hskew uint16 - Vdisplay uint16 - Vsyncstart uint16 - Vsyncend uint16 - Vtotal uint16 - // padding: 2 bytes - Flags uint32 - // padding: 12 bytes - Privsize uint32 - Private []byte // size: pad((int(Privsize) * 1)) -} - -// Waits and reads reply data from request Xf86vidmodeGetModeLine -func (cook Xf86vidmodeGetModeLineCookie) Reply() (*Xf86vidmodeGetModeLineReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetModeLineReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetModeLine -func xf86vidmodeGetModeLineReply(buf []byte) *Xf86vidmodeGetModeLineReply { - v := new(Xf86vidmodeGetModeLineReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Dotclock = Xf86vidmodeDotclock(Get32(buf[b:])) - b += 4 - - v.Hdisplay = Get16(buf[b:]) - b += 2 - - v.Hsyncstart = Get16(buf[b:]) - b += 2 - - v.Hsyncend = Get16(buf[b:]) - b += 2 - - v.Htotal = Get16(buf[b:]) - b += 2 - - v.Hskew = Get16(buf[b:]) - b += 2 - - v.Vdisplay = Get16(buf[b:]) - b += 2 - - v.Vsyncstart = Get16(buf[b:]) - b += 2 - - v.Vsyncend = Get16(buf[b:]) - b += 2 - - v.Vtotal = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Flags = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Privsize = Get32(buf[b:]) - b += 4 - - v.Private = make([]byte, v.Privsize) - copy(v.Private[:v.Privsize], buf[b:]) - b += pad(int(v.Privsize)) - - return v -} - -func (cook Xf86vidmodeGetModeLineCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetModeLine -func (c *Conn) xf86vidmodeGetModeLineRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeModModeLine -// size: pad((48 + pad((int(Privsize) * 1)))) -type Xf86vidmodeModModeLineCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeModModeLine -func (c *Conn) Xf86vidmodeModModeLine(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeModModeLineCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeModModeLineRequest(Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeModModeLineCookie{cookie} -} - -func (c *Conn) Xf86vidmodeModModeLineChecked(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeModModeLineCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeModModeLineRequest(Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeModModeLineCookie{cookie} -} - -func (cook Xf86vidmodeModModeLineCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeModModeLine -func (c *Conn) xf86vidmodeModModeLineRequest(Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := pad((48 + pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put16(buf[b:], Hdisplay) - b += 2 - - Put16(buf[b:], Hsyncstart) - b += 2 - - Put16(buf[b:], Hsyncend) - b += 2 - - Put16(buf[b:], Htotal) - b += 2 - - Put16(buf[b:], Hskew) - b += 2 - - Put16(buf[b:], Vdisplay) - b += 2 - - Put16(buf[b:], Vsyncstart) - b += 2 - - Put16(buf[b:], Vsyncend) - b += 2 - - Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += pad(int(Privsize)) - - return buf -} - -// Request Xf86vidmodeSwitchMode -// size: 8 -type Xf86vidmodeSwitchModeCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSwitchMode -func (c *Conn) Xf86vidmodeSwitchMode(Screen uint16, Zoom uint16) Xf86vidmodeSwitchModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSwitchModeRequest(Screen, Zoom), cookie) - return Xf86vidmodeSwitchModeCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSwitchModeChecked(Screen uint16, Zoom uint16) Xf86vidmodeSwitchModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSwitchModeRequest(Screen, Zoom), cookie) - return Xf86vidmodeSwitchModeCookie{cookie} -} - -func (cook Xf86vidmodeSwitchModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSwitchMode -func (c *Conn) xf86vidmodeSwitchModeRequest(Screen uint16, Zoom uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - Put16(buf[b:], Zoom) - b += 2 - - return buf -} - -// Request Xf86vidmodeGetMonitor -// size: 8 -type Xf86vidmodeGetMonitorCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetMonitor(Screen uint16) Xf86vidmodeGetMonitorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetMonitorRequest(Screen), cookie) - return Xf86vidmodeGetMonitorCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetMonitorUnchecked(Screen uint16) Xf86vidmodeGetMonitorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetMonitorRequest(Screen), cookie) - return Xf86vidmodeGetMonitorCookie{cookie} -} - -// Request reply for Xf86vidmodeGetMonitor -// size: (((((32 + pad((int(NumHsync) * 4))) + pad((int(NumVsync) * 4))) + pad((int(VendorLength) * 1))) + pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1))) + pad((int(ModelLength) * 1))) -type Xf86vidmodeGetMonitorReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - VendorLength byte - ModelLength byte - NumHsync byte - NumVsync byte - // padding: 20 bytes - Hsync []Xf86vidmodeSyncrange // size: pad((int(NumHsync) * 4)) - Vsync []Xf86vidmodeSyncrange // size: pad((int(NumVsync) * 4)) - Vendor string // size: pad((int(VendorLength) * 1)) - AlignmentPad []byte // size: pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) - Model string // size: pad((int(ModelLength) * 1)) -} - -// Waits and reads reply data from request Xf86vidmodeGetMonitor -func (cook Xf86vidmodeGetMonitorCookie) Reply() (*Xf86vidmodeGetMonitorReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetMonitorReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetMonitor -func xf86vidmodeGetMonitorReply(buf []byte) *Xf86vidmodeGetMonitorReply { - v := new(Xf86vidmodeGetMonitorReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.VendorLength = buf[b] - b += 1 - - v.ModelLength = buf[b] - b += 1 - - v.NumHsync = buf[b] - b += 1 - - v.NumVsync = buf[b] - b += 1 - - b += 20 // padding - - v.Hsync = make([]Xf86vidmodeSyncrange, v.NumHsync) - for i := 0; i < int(v.NumHsync); i++ { - v.Hsync[i] = Xf86vidmodeSyncrange(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.Vsync = make([]Xf86vidmodeSyncrange, v.NumVsync) - for i := 0; i < int(v.NumVsync); i++ { - v.Vsync[i] = Xf86vidmodeSyncrange(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - { - byteString := make([]byte, v.VendorLength) - copy(byteString[:v.VendorLength], buf[b:]) - v.Vendor = string(byteString) - b += pad(int(v.VendorLength)) - } - - v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) - copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) - b += pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) - - { - byteString := make([]byte, v.ModelLength) - copy(byteString[:v.ModelLength], buf[b:]) - v.Model = string(byteString) - b += pad(int(v.ModelLength)) - } - - return v -} - -func (cook Xf86vidmodeGetMonitorCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetMonitor -func (c *Conn) xf86vidmodeGetMonitorRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeLockModeSwitch -// size: 8 -type Xf86vidmodeLockModeSwitchCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeLockModeSwitch -func (c *Conn) Xf86vidmodeLockModeSwitch(Screen uint16, Lock uint16) Xf86vidmodeLockModeSwitchCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeLockModeSwitchRequest(Screen, Lock), cookie) - return Xf86vidmodeLockModeSwitchCookie{cookie} -} - -func (c *Conn) Xf86vidmodeLockModeSwitchChecked(Screen uint16, Lock uint16) Xf86vidmodeLockModeSwitchCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeLockModeSwitchRequest(Screen, Lock), cookie) - return Xf86vidmodeLockModeSwitchCookie{cookie} -} - -func (cook Xf86vidmodeLockModeSwitchCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeLockModeSwitch -func (c *Conn) xf86vidmodeLockModeSwitchRequest(Screen uint16, Lock uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - Put16(buf[b:], Lock) - b += 2 - - return buf -} - -// Request Xf86vidmodeGetAllModeLines -// size: 8 -type Xf86vidmodeGetAllModeLinesCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetAllModeLines(Screen uint16) Xf86vidmodeGetAllModeLinesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetAllModeLinesRequest(Screen), cookie) - return Xf86vidmodeGetAllModeLinesCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetAllModeLinesUnchecked(Screen uint16) Xf86vidmodeGetAllModeLinesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetAllModeLinesRequest(Screen), cookie) - return Xf86vidmodeGetAllModeLinesCookie{cookie} -} - -// Request reply for Xf86vidmodeGetAllModeLines -// size: (32 + pad((int(Modecount) * 48))) -type Xf86vidmodeGetAllModeLinesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Modecount uint32 - // padding: 20 bytes - Modeinfo []Xf86vidmodeModeInfo // size: pad((int(Modecount) * 48)) -} - -// Waits and reads reply data from request Xf86vidmodeGetAllModeLines -func (cook Xf86vidmodeGetAllModeLinesCookie) Reply() (*Xf86vidmodeGetAllModeLinesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetAllModeLinesReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetAllModeLines -func xf86vidmodeGetAllModeLinesReply(buf []byte) *Xf86vidmodeGetAllModeLinesReply { - v := new(Xf86vidmodeGetAllModeLinesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Modecount = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Modeinfo = make([]Xf86vidmodeModeInfo, v.Modecount) - b += ReadXf86vidmodeModeInfoList(buf[b:], v.Modeinfo) - - return v -} - -func (cook Xf86vidmodeGetAllModeLinesCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetAllModeLines -func (c *Conn) xf86vidmodeGetAllModeLinesRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeAddModeLine -// size: pad((92 + pad((int(Privsize) * 1)))) -type Xf86vidmodeAddModeLineCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeAddModeLine -func (c *Conn) Xf86vidmodeAddModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) Xf86vidmodeAddModeLineCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeAddModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) - return Xf86vidmodeAddModeLineCookie{cookie} -} - -func (c *Conn) Xf86vidmodeAddModeLineChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) Xf86vidmodeAddModeLineCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeAddModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) - return Xf86vidmodeAddModeLineCookie{cookie} -} - -func (cook Xf86vidmodeAddModeLineCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeAddModeLine -func (c *Conn) xf86vidmodeAddModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Xf86vidmodeDotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) []byte { - size := pad((92 + pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Dotclock)) - b += 4 - - Put16(buf[b:], Hdisplay) - b += 2 - - Put16(buf[b:], Hsyncstart) - b += 2 - - Put16(buf[b:], Hsyncend) - b += 2 - - Put16(buf[b:], Htotal) - b += 2 - - Put16(buf[b:], Hskew) - b += 2 - - Put16(buf[b:], Vdisplay) - b += 2 - - Put16(buf[b:], Vsyncstart) - b += 2 - - Put16(buf[b:], Vsyncend) - b += 2 - - Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], Privsize) - b += 4 - - Put32(buf[b:], uint32(AfterDotclock)) - b += 4 - - Put16(buf[b:], AfterHdisplay) - b += 2 - - Put16(buf[b:], AfterHsyncstart) - b += 2 - - Put16(buf[b:], AfterHsyncend) - b += 2 - - Put16(buf[b:], AfterHtotal) - b += 2 - - Put16(buf[b:], AfterHskew) - b += 2 - - Put16(buf[b:], AfterVdisplay) - b += 2 - - Put16(buf[b:], AfterVsyncstart) - b += 2 - - Put16(buf[b:], AfterVsyncend) - b += 2 - - Put16(buf[b:], AfterVtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], AfterFlags) - b += 4 - - b += 12 // padding - - copy(buf[b:], Private[:Privsize]) - b += pad(int(Privsize)) - - return buf -} - -// Request Xf86vidmodeDeleteModeLine -// size: pad((52 + pad((int(Privsize) * 1)))) -type Xf86vidmodeDeleteModeLineCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeDeleteModeLine -func (c *Conn) Xf86vidmodeDeleteModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeDeleteModeLineCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeDeleteModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeDeleteModeLineCookie{cookie} -} - -func (c *Conn) Xf86vidmodeDeleteModeLineChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeDeleteModeLineCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeDeleteModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeDeleteModeLineCookie{cookie} -} - -func (cook Xf86vidmodeDeleteModeLineCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeDeleteModeLine -func (c *Conn) xf86vidmodeDeleteModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := pad((52 + pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Dotclock)) - b += 4 - - Put16(buf[b:], Hdisplay) - b += 2 - - Put16(buf[b:], Hsyncstart) - b += 2 - - Put16(buf[b:], Hsyncend) - b += 2 - - Put16(buf[b:], Htotal) - b += 2 - - Put16(buf[b:], Hskew) - b += 2 - - Put16(buf[b:], Vdisplay) - b += 2 - - Put16(buf[b:], Vsyncstart) - b += 2 - - Put16(buf[b:], Vsyncend) - b += 2 - - Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += pad(int(Privsize)) - - return buf -} - -// Request Xf86vidmodeValidateModeLine -// size: pad((52 + pad((int(Privsize) * 1)))) -type Xf86vidmodeValidateModeLineCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeValidateModeLine(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeValidateModeLineCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeValidateModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeValidateModeLineCookie{cookie} -} - -func (c *Conn) Xf86vidmodeValidateModeLineUnchecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeValidateModeLineCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeValidateModeLineRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeValidateModeLineCookie{cookie} -} - -// Request reply for Xf86vidmodeValidateModeLine -// size: 32 -type Xf86vidmodeValidateModeLineReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status uint32 - // padding: 20 bytes -} - -// Waits and reads reply data from request Xf86vidmodeValidateModeLine -func (cook Xf86vidmodeValidateModeLineCookie) Reply() (*Xf86vidmodeValidateModeLineReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeValidateModeLineReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeValidateModeLine -func xf86vidmodeValidateModeLineReply(buf []byte) *Xf86vidmodeValidateModeLineReply { - v := new(Xf86vidmodeValidateModeLineReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - return v -} - -func (cook Xf86vidmodeValidateModeLineCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeValidateModeLine -func (c *Conn) xf86vidmodeValidateModeLineRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := pad((52 + pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Dotclock)) - b += 4 - - Put16(buf[b:], Hdisplay) - b += 2 - - Put16(buf[b:], Hsyncstart) - b += 2 - - Put16(buf[b:], Hsyncend) - b += 2 - - Put16(buf[b:], Htotal) - b += 2 - - Put16(buf[b:], Hskew) - b += 2 - - Put16(buf[b:], Vdisplay) - b += 2 - - Put16(buf[b:], Vsyncstart) - b += 2 - - Put16(buf[b:], Vsyncend) - b += 2 - - Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += pad(int(Privsize)) - - return buf -} - -// Request Xf86vidmodeSwitchToMode -// size: pad((52 + pad((int(Privsize) * 1)))) -type Xf86vidmodeSwitchToModeCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSwitchToMode -func (c *Conn) Xf86vidmodeSwitchToMode(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeSwitchToModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSwitchToModeRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeSwitchToModeCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSwitchToModeChecked(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) Xf86vidmodeSwitchToModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSwitchToModeRequest(Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return Xf86vidmodeSwitchToModeCookie{cookie} -} - -func (cook Xf86vidmodeSwitchToModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSwitchToMode -func (c *Conn) xf86vidmodeSwitchToModeRequest(Screen uint32, Dotclock Xf86vidmodeDotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := pad((52 + pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Screen) - b += 4 - - Put32(buf[b:], uint32(Dotclock)) - b += 4 - - Put16(buf[b:], Hdisplay) - b += 2 - - Put16(buf[b:], Hsyncstart) - b += 2 - - Put16(buf[b:], Hsyncend) - b += 2 - - Put16(buf[b:], Htotal) - b += 2 - - Put16(buf[b:], Hskew) - b += 2 - - Put16(buf[b:], Vdisplay) - b += 2 - - Put16(buf[b:], Vsyncstart) - b += 2 - - Put16(buf[b:], Vsyncend) - b += 2 - - Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += pad(int(Privsize)) - - return buf -} - -// Request Xf86vidmodeGetViewPort -// size: 8 -type Xf86vidmodeGetViewPortCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetViewPort(Screen uint16) Xf86vidmodeGetViewPortCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetViewPortRequest(Screen), cookie) - return Xf86vidmodeGetViewPortCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetViewPortUnchecked(Screen uint16) Xf86vidmodeGetViewPortCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetViewPortRequest(Screen), cookie) - return Xf86vidmodeGetViewPortCookie{cookie} -} - -// Request reply for Xf86vidmodeGetViewPort -// size: 32 -type Xf86vidmodeGetViewPortReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - X uint32 - Y uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request Xf86vidmodeGetViewPort -func (cook Xf86vidmodeGetViewPortCookie) Reply() (*Xf86vidmodeGetViewPortReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetViewPortReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetViewPort -func xf86vidmodeGetViewPortReply(buf []byte) *Xf86vidmodeGetViewPortReply { - v := new(Xf86vidmodeGetViewPortReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.X = Get32(buf[b:]) - b += 4 - - v.Y = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook Xf86vidmodeGetViewPortCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetViewPort -func (c *Conn) xf86vidmodeGetViewPortRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeSetViewPort -// size: 16 -type Xf86vidmodeSetViewPortCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSetViewPort -func (c *Conn) Xf86vidmodeSetViewPort(Screen uint16, X uint32, Y uint32) Xf86vidmodeSetViewPortCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSetViewPortRequest(Screen, X, Y), cookie) - return Xf86vidmodeSetViewPortCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSetViewPortChecked(Screen uint16, X uint32, Y uint32) Xf86vidmodeSetViewPortCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSetViewPortRequest(Screen, X, Y), cookie) - return Xf86vidmodeSetViewPortCookie{cookie} -} - -func (cook Xf86vidmodeSetViewPortCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSetViewPort -func (c *Conn) xf86vidmodeSetViewPortRequest(Screen uint16, X uint32, Y uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - Put32(buf[b:], X) - b += 4 - - Put32(buf[b:], Y) - b += 4 - - return buf -} - -// Request Xf86vidmodeGetDotClocks -// size: 8 -type Xf86vidmodeGetDotClocksCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetDotClocks(Screen uint16) Xf86vidmodeGetDotClocksCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetDotClocksRequest(Screen), cookie) - return Xf86vidmodeGetDotClocksCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetDotClocksUnchecked(Screen uint16) Xf86vidmodeGetDotClocksCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetDotClocksRequest(Screen), cookie) - return Xf86vidmodeGetDotClocksCookie{cookie} -} - -// Request reply for Xf86vidmodeGetDotClocks -// size: (32 + pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4))) -type Xf86vidmodeGetDotClocksReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Flags uint32 - Clocks uint32 - Maxclocks uint32 - // padding: 12 bytes - Clock []uint32 // size: pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4)) -} - -// Waits and reads reply data from request Xf86vidmodeGetDotClocks -func (cook Xf86vidmodeGetDotClocksCookie) Reply() (*Xf86vidmodeGetDotClocksReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetDotClocksReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetDotClocks -func xf86vidmodeGetDotClocksReply(buf []byte) *Xf86vidmodeGetDotClocksReply { - v := new(Xf86vidmodeGetDotClocksReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Flags = Get32(buf[b:]) - b += 4 - - v.Clocks = Get32(buf[b:]) - b += 4 - - v.Maxclocks = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Clock = make([]uint32, ((1 - (int(v.Flags) & 1)) * int(v.Clocks))) - for i := 0; i < int(((1 - (int(v.Flags) & 1)) * int(v.Clocks))); i++ { - v.Clock[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook Xf86vidmodeGetDotClocksCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetDotClocks -func (c *Conn) xf86vidmodeGetDotClocksRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeSetClientVersion -// size: 8 -type Xf86vidmodeSetClientVersionCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSetClientVersion -func (c *Conn) Xf86vidmodeSetClientVersion(Major uint16, Minor uint16) Xf86vidmodeSetClientVersionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSetClientVersionRequest(Major, Minor), cookie) - return Xf86vidmodeSetClientVersionCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSetClientVersionChecked(Major uint16, Minor uint16) Xf86vidmodeSetClientVersionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSetClientVersionRequest(Major, Minor), cookie) - return Xf86vidmodeSetClientVersionCookie{cookie} -} - -func (cook Xf86vidmodeSetClientVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSetClientVersion -func (c *Conn) xf86vidmodeSetClientVersionRequest(Major uint16, Minor uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Major) - b += 2 - - Put16(buf[b:], Minor) - b += 2 - - return buf -} - -// Request Xf86vidmodeSetGamma -// size: 32 -type Xf86vidmodeSetGammaCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSetGamma -func (c *Conn) Xf86vidmodeSetGamma(Screen uint16, Red uint32, Green uint32, Blue uint32) Xf86vidmodeSetGammaCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSetGammaRequest(Screen, Red, Green, Blue), cookie) - return Xf86vidmodeSetGammaCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSetGammaChecked(Screen uint16, Red uint32, Green uint32, Blue uint32) Xf86vidmodeSetGammaCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSetGammaRequest(Screen, Red, Green, Blue), cookie) - return Xf86vidmodeSetGammaCookie{cookie} -} - -func (cook Xf86vidmodeSetGammaCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSetGamma -func (c *Conn) xf86vidmodeSetGammaRequest(Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - Put32(buf[b:], Red) - b += 4 - - Put32(buf[b:], Green) - b += 4 - - Put32(buf[b:], Blue) - b += 4 - - b += 12 // padding - - return buf -} - -// Request Xf86vidmodeGetGamma -// size: 32 -type Xf86vidmodeGetGammaCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetGamma(Screen uint16) Xf86vidmodeGetGammaCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetGammaRequest(Screen), cookie) - return Xf86vidmodeGetGammaCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetGammaUnchecked(Screen uint16) Xf86vidmodeGetGammaCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetGammaRequest(Screen), cookie) - return Xf86vidmodeGetGammaCookie{cookie} -} - -// Request reply for Xf86vidmodeGetGamma -// size: 32 -type Xf86vidmodeGetGammaReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Red uint32 - Green uint32 - Blue uint32 - // padding: 12 bytes -} - -// Waits and reads reply data from request Xf86vidmodeGetGamma -func (cook Xf86vidmodeGetGammaCookie) Reply() (*Xf86vidmodeGetGammaReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetGammaReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetGamma -func xf86vidmodeGetGammaReply(buf []byte) *Xf86vidmodeGetGammaReply { - v := new(Xf86vidmodeGetGammaReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Red = Get32(buf[b:]) - b += 4 - - v.Green = Get32(buf[b:]) - b += 4 - - v.Blue = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - return v -} - -func (cook Xf86vidmodeGetGammaCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetGamma -func (c *Conn) xf86vidmodeGetGammaRequest(Screen uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 26 // padding - - return buf -} - -// Request Xf86vidmodeGetGammaRamp -// size: 8 -type Xf86vidmodeGetGammaRampCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetGammaRamp(Screen uint16, Size uint16) Xf86vidmodeGetGammaRampCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetGammaRampRequest(Screen, Size), cookie) - return Xf86vidmodeGetGammaRampCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetGammaRampUnchecked(Screen uint16, Size uint16) Xf86vidmodeGetGammaRampCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetGammaRampRequest(Screen, Size), cookie) - return Xf86vidmodeGetGammaRampCookie{cookie} -} - -// Request reply for Xf86vidmodeGetGammaRamp -// size: (((32 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) -type Xf86vidmodeGetGammaRampReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Size uint16 - // padding: 22 bytes - Red []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) - Green []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) - Blue []uint16 // size: pad((((int(Size) + 1) & -2) * 2)) -} - -// Waits and reads reply data from request Xf86vidmodeGetGammaRamp -func (cook Xf86vidmodeGetGammaRampCookie) Reply() (*Xf86vidmodeGetGammaRampReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetGammaRampReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetGammaRamp -func xf86vidmodeGetGammaRampReply(buf []byte) *Xf86vidmodeGetGammaRampReply { - v := new(Xf86vidmodeGetGammaRampReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Red = make([]uint16, ((int(v.Size) + 1) & -2)) - for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { - v.Red[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - v.Green = make([]uint16, ((int(v.Size) + 1) & -2)) - for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { - v.Green[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - v.Blue = make([]uint16, ((int(v.Size) + 1) & -2)) - for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { - v.Blue[i] = Get16(buf[b:]) - b += 2 - } - b = pad(b) - - return v -} - -func (cook Xf86vidmodeGetGammaRampCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetGammaRamp -func (c *Conn) xf86vidmodeGetGammaRampRequest(Screen uint16, Size uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - Put16(buf[b:], Size) - b += 2 - - return buf -} - -// Request Xf86vidmodeSetGammaRamp -// size: pad((((8 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2)))) -type Xf86vidmodeSetGammaRampCookie struct { - *cookie -} - -// Write request to wire for Xf86vidmodeSetGammaRamp -func (c *Conn) Xf86vidmodeSetGammaRamp(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) Xf86vidmodeSetGammaRampCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xf86vidmodeSetGammaRampRequest(Screen, Size, Red, Green, Blue), cookie) - return Xf86vidmodeSetGammaRampCookie{cookie} -} - -func (c *Conn) Xf86vidmodeSetGammaRampChecked(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) Xf86vidmodeSetGammaRampCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xf86vidmodeSetGammaRampRequest(Screen, Size, Red, Green, Blue), cookie) - return Xf86vidmodeSetGammaRampCookie{cookie} -} - -func (cook Xf86vidmodeSetGammaRampCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeSetGammaRamp -func (c *Conn) xf86vidmodeSetGammaRampRequest(Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := pad((((8 + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2))) + pad((((int(Size) + 1) & -2) * 2)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - Put16(buf[b:], Size) - b += 2 - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - Put16(buf[b:], Red[i]) - b += 2 - } - b = pad(b) - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - Put16(buf[b:], Green[i]) - b += 2 - } - b = pad(b) - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - Put16(buf[b:], Blue[i]) - b += 2 - } - b = pad(b) - - return buf -} - -// Request Xf86vidmodeGetGammaRampSize -// size: 8 -type Xf86vidmodeGetGammaRampSizeCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetGammaRampSize(Screen uint16) Xf86vidmodeGetGammaRampSizeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetGammaRampSizeRequest(Screen), cookie) - return Xf86vidmodeGetGammaRampSizeCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetGammaRampSizeUnchecked(Screen uint16) Xf86vidmodeGetGammaRampSizeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetGammaRampSizeRequest(Screen), cookie) - return Xf86vidmodeGetGammaRampSizeCookie{cookie} -} - -// Request reply for Xf86vidmodeGetGammaRampSize -// size: 32 -type Xf86vidmodeGetGammaRampSizeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Size uint16 - // padding: 22 bytes -} - -// Waits and reads reply data from request Xf86vidmodeGetGammaRampSize -func (cook Xf86vidmodeGetGammaRampSizeCookie) Reply() (*Xf86vidmodeGetGammaRampSizeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetGammaRampSizeReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetGammaRampSize -func xf86vidmodeGetGammaRampSizeReply(buf []byte) *Xf86vidmodeGetGammaRampSizeReply { - v := new(Xf86vidmodeGetGammaRampSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -func (cook Xf86vidmodeGetGammaRampSizeCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetGammaRampSize -func (c *Conn) xf86vidmodeGetGammaRampSizeRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// Request Xf86vidmodeGetPermissions -// size: 8 -type Xf86vidmodeGetPermissionsCookie struct { - *cookie -} - -func (c *Conn) Xf86vidmodeGetPermissions(Screen uint16) Xf86vidmodeGetPermissionsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xf86vidmodeGetPermissionsRequest(Screen), cookie) - return Xf86vidmodeGetPermissionsCookie{cookie} -} - -func (c *Conn) Xf86vidmodeGetPermissionsUnchecked(Screen uint16) Xf86vidmodeGetPermissionsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xf86vidmodeGetPermissionsRequest(Screen), cookie) - return Xf86vidmodeGetPermissionsCookie{cookie} -} - -// Request reply for Xf86vidmodeGetPermissions -// size: 32 -type Xf86vidmodeGetPermissionsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Permissions uint32 - // padding: 20 bytes -} - -// Waits and reads reply data from request Xf86vidmodeGetPermissions -func (cook Xf86vidmodeGetPermissionsCookie) Reply() (*Xf86vidmodeGetPermissionsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xf86vidmodeGetPermissionsReply(buf), nil -} - -// Read reply into structure from buffer for Xf86vidmodeGetPermissions -func xf86vidmodeGetPermissionsReply(buf []byte) *Xf86vidmodeGetPermissionsReply { - v := new(Xf86vidmodeGetPermissionsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Permissions = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - return v -} - -func (cook Xf86vidmodeGetPermissionsCookie) Check() error { - return cook.check() -} - -// Write request to wire for Xf86vidmodeGetPermissions -func (c *Conn) xf86vidmodeGetPermissionsRequest(Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} diff --git a/nexgb/auto_xfixes.go b/nexgb/auto_xfixes.go deleted file mode 100644 index 9284f6b..0000000 --- a/nexgb/auto_xfixes.go +++ /dev/null @@ -1,2173 +0,0 @@ -package xgb - -/* - This file was generated by xfixes.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" -// import "render" -// import "shape" - -// XfixesInit must be called before using the XFIXES extension. -func (c *Conn) XfixesInit() error { - reply, err := c.QueryExtension(6, "XFIXES").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XFIXES could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XFIXES"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XFIXES"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XFIXES"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XFIXES"] = make(map[int]newEventFun) - newExtErrorFuncs["XFIXES"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -const ( - XfixesSaveSetModeInsert = 0 - XfixesSaveSetModeDelete = 1 -) - -const ( - XfixesSaveSetTargetNearest = 0 - XfixesSaveSetTargetRoot = 1 -) - -const ( - XfixesSaveSetMappingMap = 0 - XfixesSaveSetMappingUnmap = 1 -) - -const ( - XfixesSelectionEventSetSelectionOwner = 0 - XfixesSelectionEventSelectionWindowDestroy = 1 - XfixesSelectionEventSelectionClientClose = 2 -) - -const ( - XfixesSelectionEventMaskSetSelectionOwner = 1 - XfixesSelectionEventMaskSelectionWindowDestroy = 2 - XfixesSelectionEventMaskSelectionClientClose = 4 -) - -const ( - XfixesCursorNotifyDisplayCursor = 0 -) - -const ( - XfixesCursorNotifyMaskDisplayCursor = 1 -) - -const ( - XfixesRegionNone = 0 -) - -type XfixesRegion uint32 - -func (c *Conn) NewXfixesRegionId() (XfixesRegion, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XfixesRegion(id), nil -} - -// Event definition XfixesSelectionNotify (0) -// Size: 32 - -const XfixesSelectionNotify = 0 - -type XfixesSelectionNotifyEvent struct { - Sequence uint16 - Subtype byte - Window Window - Owner Window - Selection Atom - Timestamp Timestamp - SelectionTimestamp Timestamp - // padding: 8 bytes -} - -// Event read XfixesSelectionNotify -func NewXfixesSelectionNotifyEvent(buf []byte) Event { - v := XfixesSelectionNotifyEvent{} - b := 1 // don't read event number - - v.Subtype = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Owner = Window(Get32(buf[b:])) - b += 4 - - v.Selection = Atom(Get32(buf[b:])) - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.SelectionTimestamp = Timestamp(Get32(buf[b:])) - b += 4 - - b += 8 // padding - - return v -} - -// Event write XfixesSelectionNotify -func (v XfixesSelectionNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Subtype - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - Put32(buf[b:], uint32(v.Owner)) - b += 4 - - Put32(buf[b:], uint32(v.Selection)) - b += 4 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put32(buf[b:], uint32(v.SelectionTimestamp)) - b += 4 - - b += 8 // padding - - return buf -} - -func (v XfixesSelectionNotifyEvent) ImplementsEvent() {} - -func (v XfixesSelectionNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XfixesSelectionNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Subtype: %d", v.Subtype)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) - fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, sprintf("SelectionTimestamp: %d", v.SelectionTimestamp)) - return "XfixesSelectionNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XFIXES"][0] = NewXfixesSelectionNotifyEvent -} - -// Event definition XfixesCursorNotify (1) -// Size: 32 - -const XfixesCursorNotify = 1 - -type XfixesCursorNotifyEvent struct { - Sequence uint16 - Subtype byte - Window Window - CursorSerial uint32 - Timestamp Timestamp - Name Atom - // padding: 12 bytes -} - -// Event read XfixesCursorNotify -func NewXfixesCursorNotifyEvent(buf []byte) Event { - v := XfixesCursorNotifyEvent{} - b := 1 // don't read event number - - v.Subtype = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.CursorSerial = Get32(buf[b:]) - b += 4 - - v.Timestamp = Timestamp(Get32(buf[b:])) - b += 4 - - v.Name = Atom(Get32(buf[b:])) - b += 4 - - b += 12 // padding - - return v -} - -// Event write XfixesCursorNotify -func (v XfixesCursorNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Subtype - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - Put32(buf[b:], v.CursorSerial) - b += 4 - - Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - Put32(buf[b:], uint32(v.Name)) - b += 4 - - b += 12 // padding - - return buf -} - -func (v XfixesCursorNotifyEvent) ImplementsEvent() {} - -func (v XfixesCursorNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XfixesCursorNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Subtype: %d", v.Subtype)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("CursorSerial: %d", v.CursorSerial)) - fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, sprintf("Name: %d", v.Name)) - return "XfixesCursorNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XFIXES"][1] = NewXfixesCursorNotifyEvent -} - -// Error definition XfixesBadRegion (0) -// Size: 32 - -const BadXfixesBadRegion = 0 - -type XfixesBadRegionError struct { - Sequence uint16 - NiceName string -} - -// Error read XfixesBadRegion -func NewXfixesBadRegionError(buf []byte) Error { - v := XfixesBadRegionError{} - v.NiceName = "XfixesBadRegion" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XfixesBadRegionError) ImplementsError() {} - -func (err XfixesBadRegionError) SequenceId() uint16 { - return err.Sequence -} - -func (err XfixesBadRegionError) BadId() uint32 { - return 0 -} - -func (err XfixesBadRegionError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXfixesBadRegion {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XFIXES"][0] = NewXfixesBadRegionError -} - -// Request XfixesQueryVersion -// size: 12 -type XfixesQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XfixesQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) XfixesQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xfixesQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return XfixesQueryVersionCookie{cookie} -} - -func (c *Conn) XfixesQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) XfixesQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xfixesQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie) - return XfixesQueryVersionCookie{cookie} -} - -// Request reply for XfixesQueryVersion -// size: 32 -type XfixesQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Waits and reads reply data from request XfixesQueryVersion -func (cook XfixesQueryVersionCookie) Reply() (*XfixesQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xfixesQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XfixesQueryVersion -func xfixesQueryVersionReply(buf []byte) *XfixesQueryVersionReply { - v := new(XfixesQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get32(buf[b:]) - b += 4 - - v.MinorVersion = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -func (cook XfixesQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesQueryVersion -func (c *Conn) xfixesQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ClientMajorVersion) - b += 4 - - Put32(buf[b:], ClientMinorVersion) - b += 4 - - return buf -} - -// Request XfixesChangeSaveSet -// size: 12 -type XfixesChangeSaveSetCookie struct { - *cookie -} - -// Write request to wire for XfixesChangeSaveSet -func (c *Conn) XfixesChangeSaveSet(Mode byte, Target byte, Map byte, Window Window) XfixesChangeSaveSetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) - return XfixesChangeSaveSetCookie{cookie} -} - -func (c *Conn) XfixesChangeSaveSetChecked(Mode byte, Target byte, Map byte, Window Window) XfixesChangeSaveSetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesChangeSaveSetRequest(Mode, Target, Map, Window), cookie) - return XfixesChangeSaveSetCookie{cookie} -} - -func (cook XfixesChangeSaveSetCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesChangeSaveSet -func (c *Conn) xfixesChangeSaveSetRequest(Mode byte, Target byte, Map byte, Window Window) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Mode - b += 1 - - buf[b] = Target - b += 1 - - buf[b] = Map - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XfixesSelectSelectionInput -// size: 16 -type XfixesSelectSelectionInputCookie struct { - *cookie -} - -// Write request to wire for XfixesSelectSelectionInput -func (c *Conn) XfixesSelectSelectionInput(Window Window, Selection Atom, EventMask uint32) XfixesSelectSelectionInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) - return XfixesSelectSelectionInputCookie{cookie} -} - -func (c *Conn) XfixesSelectSelectionInputChecked(Window Window, Selection Atom, EventMask uint32) XfixesSelectSelectionInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSelectSelectionInputRequest(Window, Selection, EventMask), cookie) - return XfixesSelectSelectionInputCookie{cookie} -} - -func (cook XfixesSelectSelectionInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSelectSelectionInput -func (c *Conn) xfixesSelectSelectionInputRequest(Window Window, Selection Atom, EventMask uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Selection)) - b += 4 - - Put32(buf[b:], EventMask) - b += 4 - - return buf -} - -// Request XfixesSelectCursorInput -// size: 12 -type XfixesSelectCursorInputCookie struct { - *cookie -} - -// Write request to wire for XfixesSelectCursorInput -func (c *Conn) XfixesSelectCursorInput(Window Window, EventMask uint32) XfixesSelectCursorInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) - return XfixesSelectCursorInputCookie{cookie} -} - -func (c *Conn) XfixesSelectCursorInputChecked(Window Window, EventMask uint32) XfixesSelectCursorInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSelectCursorInputRequest(Window, EventMask), cookie) - return XfixesSelectCursorInputCookie{cookie} -} - -func (cook XfixesSelectCursorInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSelectCursorInput -func (c *Conn) xfixesSelectCursorInputRequest(Window Window, EventMask uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], EventMask) - b += 4 - - return buf -} - -// Request XfixesGetCursorImage -// size: 4 -type XfixesGetCursorImageCookie struct { - *cookie -} - -func (c *Conn) XfixesGetCursorImage() XfixesGetCursorImageCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xfixesGetCursorImageRequest(), cookie) - return XfixesGetCursorImageCookie{cookie} -} - -func (c *Conn) XfixesGetCursorImageUnchecked() XfixesGetCursorImageCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xfixesGetCursorImageRequest(), cookie) - return XfixesGetCursorImageCookie{cookie} -} - -// Request reply for XfixesGetCursorImage -// size: (32 + pad(((int(Width) * int(Height)) * 4))) -type XfixesGetCursorImageReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - X int16 - Y int16 - Width uint16 - Height uint16 - Xhot uint16 - Yhot uint16 - CursorSerial uint32 - // padding: 8 bytes - CursorImage []uint32 // size: pad(((int(Width) * int(Height)) * 4)) -} - -// Waits and reads reply data from request XfixesGetCursorImage -func (cook XfixesGetCursorImageCookie) Reply() (*XfixesGetCursorImageReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xfixesGetCursorImageReply(buf), nil -} - -// Read reply into structure from buffer for XfixesGetCursorImage -func xfixesGetCursorImageReply(buf []byte) *XfixesGetCursorImageReply { - v := new(XfixesGetCursorImageReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.X = int16(Get16(buf[b:])) - b += 2 - - v.Y = int16(Get16(buf[b:])) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Xhot = Get16(buf[b:]) - b += 2 - - v.Yhot = Get16(buf[b:]) - b += 2 - - v.CursorSerial = Get32(buf[b:]) - b += 4 - - b += 8 // padding - - v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) - for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { - v.CursorImage[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XfixesGetCursorImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesGetCursorImage -func (c *Conn) xfixesGetCursorImageRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XfixesCreateRegion -// size: pad((8 + pad((len(Rectangles) * 8)))) -type XfixesCreateRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesCreateRegion -func (c *Conn) XfixesCreateRegion(Region XfixesRegion, Rectangles []Rectangle) XfixesCreateRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) - return XfixesCreateRegionCookie{cookie} -} - -func (c *Conn) XfixesCreateRegionChecked(Region XfixesRegion, Rectangles []Rectangle) XfixesCreateRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCreateRegionRequest(Region, Rectangles), cookie) - return XfixesCreateRegionCookie{cookie} -} - -func (cook XfixesCreateRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCreateRegion -func (c *Conn) xfixesCreateRegionRequest(Region XfixesRegion, Rectangles []Rectangle) []byte { - size := pad((8 + pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// Request XfixesCreateRegionFromBitmap -// size: 12 -type XfixesCreateRegionFromBitmapCookie struct { - *cookie -} - -// Write request to wire for XfixesCreateRegionFromBitmap -func (c *Conn) XfixesCreateRegionFromBitmap(Region XfixesRegion, Bitmap Pixmap) XfixesCreateRegionFromBitmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) - return XfixesCreateRegionFromBitmapCookie{cookie} -} - -func (c *Conn) XfixesCreateRegionFromBitmapChecked(Region XfixesRegion, Bitmap Pixmap) XfixesCreateRegionFromBitmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCreateRegionFromBitmapRequest(Region, Bitmap), cookie) - return XfixesCreateRegionFromBitmapCookie{cookie} -} - -func (cook XfixesCreateRegionFromBitmapCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCreateRegionFromBitmap -func (c *Conn) xfixesCreateRegionFromBitmapRequest(Region XfixesRegion, Bitmap Pixmap) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put32(buf[b:], uint32(Bitmap)) - b += 4 - - return buf -} - -// Request XfixesCreateRegionFromWindow -// size: 16 -type XfixesCreateRegionFromWindowCookie struct { - *cookie -} - -// Write request to wire for XfixesCreateRegionFromWindow -func (c *Conn) XfixesCreateRegionFromWindow(Region XfixesRegion, Window Window, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) - return XfixesCreateRegionFromWindowCookie{cookie} -} - -func (c *Conn) XfixesCreateRegionFromWindowChecked(Region XfixesRegion, Window Window, Kind ShapeKind) XfixesCreateRegionFromWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCreateRegionFromWindowRequest(Region, Window, Kind), cookie) - return XfixesCreateRegionFromWindowCookie{cookie} -} - -func (cook XfixesCreateRegionFromWindowCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCreateRegionFromWindow -func (c *Conn) xfixesCreateRegionFromWindowRequest(Region XfixesRegion, Window Window, Kind ShapeKind) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = byte(Kind) - b += 1 - - b += 3 // padding - - return buf -} - -// Request XfixesCreateRegionFromGC -// size: 12 -type XfixesCreateRegionFromGCCookie struct { - *cookie -} - -// Write request to wire for XfixesCreateRegionFromGC -func (c *Conn) XfixesCreateRegionFromGC(Region XfixesRegion, Gc Gcontext) XfixesCreateRegionFromGCCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) - return XfixesCreateRegionFromGCCookie{cookie} -} - -func (c *Conn) XfixesCreateRegionFromGCChecked(Region XfixesRegion, Gc Gcontext) XfixesCreateRegionFromGCCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCreateRegionFromGCRequest(Region, Gc), cookie) - return XfixesCreateRegionFromGCCookie{cookie} -} - -func (cook XfixesCreateRegionFromGCCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCreateRegionFromGC -func (c *Conn) xfixesCreateRegionFromGCRequest(Region XfixesRegion, Gc Gcontext) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - return buf -} - -// Request XfixesCreateRegionFromPicture -// size: 12 -type XfixesCreateRegionFromPictureCookie struct { - *cookie -} - -// Write request to wire for XfixesCreateRegionFromPicture -func (c *Conn) XfixesCreateRegionFromPicture(Region XfixesRegion, Picture RenderPicture) XfixesCreateRegionFromPictureCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) - return XfixesCreateRegionFromPictureCookie{cookie} -} - -func (c *Conn) XfixesCreateRegionFromPictureChecked(Region XfixesRegion, Picture RenderPicture) XfixesCreateRegionFromPictureCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCreateRegionFromPictureRequest(Region, Picture), cookie) - return XfixesCreateRegionFromPictureCookie{cookie} -} - -func (cook XfixesCreateRegionFromPictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCreateRegionFromPicture -func (c *Conn) xfixesCreateRegionFromPictureRequest(Region XfixesRegion, Picture RenderPicture) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - return buf -} - -// Request XfixesDestroyRegion -// size: 8 -type XfixesDestroyRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesDestroyRegion -func (c *Conn) XfixesDestroyRegion(Region XfixesRegion) XfixesDestroyRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) - return XfixesDestroyRegionCookie{cookie} -} - -func (c *Conn) XfixesDestroyRegionChecked(Region XfixesRegion) XfixesDestroyRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesDestroyRegionRequest(Region), cookie) - return XfixesDestroyRegionCookie{cookie} -} - -func (cook XfixesDestroyRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesDestroyRegion -func (c *Conn) xfixesDestroyRegionRequest(Region XfixesRegion) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// Request XfixesSetRegion -// size: pad((8 + pad((len(Rectangles) * 8)))) -type XfixesSetRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesSetRegion -func (c *Conn) XfixesSetRegion(Region XfixesRegion, Rectangles []Rectangle) XfixesSetRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) - return XfixesSetRegionCookie{cookie} -} - -func (c *Conn) XfixesSetRegionChecked(Region XfixesRegion, Rectangles []Rectangle) XfixesSetRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSetRegionRequest(Region, Rectangles), cookie) - return XfixesSetRegionCookie{cookie} -} - -func (cook XfixesSetRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSetRegion -func (c *Conn) xfixesSetRegionRequest(Region XfixesRegion, Rectangles []Rectangle) []byte { - size := pad((8 + pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// Request XfixesCopyRegion -// size: 12 -type XfixesCopyRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesCopyRegion -func (c *Conn) XfixesCopyRegion(Source XfixesRegion, Destination XfixesRegion) XfixesCopyRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) - return XfixesCopyRegionCookie{cookie} -} - -func (c *Conn) XfixesCopyRegionChecked(Source XfixesRegion, Destination XfixesRegion) XfixesCopyRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesCopyRegionRequest(Source, Destination), cookie) - return XfixesCopyRegionCookie{cookie} -} - -func (cook XfixesCopyRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesCopyRegion -func (c *Conn) xfixesCopyRegionRequest(Source XfixesRegion, Destination XfixesRegion) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesUnionRegion -// size: 16 -type XfixesUnionRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesUnionRegion -func (c *Conn) XfixesUnionRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesUnionRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) - return XfixesUnionRegionCookie{cookie} -} - -func (c *Conn) XfixesUnionRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesUnionRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesUnionRegionRequest(Source1, Source2, Destination), cookie) - return XfixesUnionRegionCookie{cookie} -} - -func (cook XfixesUnionRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesUnionRegion -func (c *Conn) xfixesUnionRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source1)) - b += 4 - - Put32(buf[b:], uint32(Source2)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesIntersectRegion -// size: 16 -type XfixesIntersectRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesIntersectRegion -func (c *Conn) XfixesIntersectRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesIntersectRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) - return XfixesIntersectRegionCookie{cookie} -} - -func (c *Conn) XfixesIntersectRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesIntersectRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesIntersectRegionRequest(Source1, Source2, Destination), cookie) - return XfixesIntersectRegionCookie{cookie} -} - -func (cook XfixesIntersectRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesIntersectRegion -func (c *Conn) xfixesIntersectRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source1)) - b += 4 - - Put32(buf[b:], uint32(Source2)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesSubtractRegion -// size: 16 -type XfixesSubtractRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesSubtractRegion -func (c *Conn) XfixesSubtractRegion(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesSubtractRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) - return XfixesSubtractRegionCookie{cookie} -} - -func (c *Conn) XfixesSubtractRegionChecked(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) XfixesSubtractRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSubtractRegionRequest(Source1, Source2, Destination), cookie) - return XfixesSubtractRegionCookie{cookie} -} - -func (cook XfixesSubtractRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSubtractRegion -func (c *Conn) xfixesSubtractRegionRequest(Source1 XfixesRegion, Source2 XfixesRegion, Destination XfixesRegion) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source1)) - b += 4 - - Put32(buf[b:], uint32(Source2)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesInvertRegion -// size: 20 -type XfixesInvertRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesInvertRegion -func (c *Conn) XfixesInvertRegion(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) XfixesInvertRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) - return XfixesInvertRegionCookie{cookie} -} - -func (c *Conn) XfixesInvertRegionChecked(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) XfixesInvertRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesInvertRegionRequest(Source, Bounds, Destination), cookie) - return XfixesInvertRegionCookie{cookie} -} - -func (cook XfixesInvertRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesInvertRegion -func (c *Conn) xfixesInvertRegionRequest(Source XfixesRegion, Bounds Rectangle, Destination XfixesRegion) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source)) - b += 4 - - { - structBytes := Bounds.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesTranslateRegion -// size: 12 -type XfixesTranslateRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesTranslateRegion -func (c *Conn) XfixesTranslateRegion(Region XfixesRegion, Dx int16, Dy int16) XfixesTranslateRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) - return XfixesTranslateRegionCookie{cookie} -} - -func (c *Conn) XfixesTranslateRegionChecked(Region XfixesRegion, Dx int16, Dy int16) XfixesTranslateRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesTranslateRegionRequest(Region, Dx, Dy), cookie) - return XfixesTranslateRegionCookie{cookie} -} - -func (cook XfixesTranslateRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesTranslateRegion -func (c *Conn) xfixesTranslateRegionRequest(Region XfixesRegion, Dx int16, Dy int16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put16(buf[b:], uint16(Dx)) - b += 2 - - Put16(buf[b:], uint16(Dy)) - b += 2 - - return buf -} - -// Request XfixesRegionExtents -// size: 12 -type XfixesRegionExtentsCookie struct { - *cookie -} - -// Write request to wire for XfixesRegionExtents -func (c *Conn) XfixesRegionExtents(Source XfixesRegion, Destination XfixesRegion) XfixesRegionExtentsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) - return XfixesRegionExtentsCookie{cookie} -} - -func (c *Conn) XfixesRegionExtentsChecked(Source XfixesRegion, Destination XfixesRegion) XfixesRegionExtentsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesRegionExtentsRequest(Source, Destination), cookie) - return XfixesRegionExtentsCookie{cookie} -} - -func (cook XfixesRegionExtentsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesRegionExtents -func (c *Conn) xfixesRegionExtentsRequest(Source XfixesRegion, Destination XfixesRegion) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesFetchRegion -// size: 8 -type XfixesFetchRegionCookie struct { - *cookie -} - -func (c *Conn) XfixesFetchRegion(Region XfixesRegion) XfixesFetchRegionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) - return XfixesFetchRegionCookie{cookie} -} - -func (c *Conn) XfixesFetchRegionUnchecked(Region XfixesRegion) XfixesFetchRegionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xfixesFetchRegionRequest(Region), cookie) - return XfixesFetchRegionCookie{cookie} -} - -// Request reply for XfixesFetchRegion -// size: (32 + pad(((int(Length) / 2) * 8))) -type XfixesFetchRegionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Extents Rectangle - // padding: 16 bytes - Rectangles []Rectangle // size: pad(((int(Length) / 2) * 8)) -} - -// Waits and reads reply data from request XfixesFetchRegion -func (cook XfixesFetchRegionCookie) Reply() (*XfixesFetchRegionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xfixesFetchRegionReply(buf), nil -} - -// Read reply into structure from buffer for XfixesFetchRegion -func xfixesFetchRegionReply(buf []byte) *XfixesFetchRegionReply { - v := new(XfixesFetchRegionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Extents = Rectangle{} - b += ReadRectangle(buf[b:], &v.Extents) - - b += 16 // padding - - v.Rectangles = make([]Rectangle, (int(v.Length) / 2)) - b += ReadRectangleList(buf[b:], v.Rectangles) - - return v -} - -func (cook XfixesFetchRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesFetchRegion -func (c *Conn) xfixesFetchRegionRequest(Region XfixesRegion) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// Request XfixesSetGCClipRegion -// size: 16 -type XfixesSetGCClipRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesSetGCClipRegion -func (c *Conn) XfixesSetGCClipRegion(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) - return XfixesSetGCClipRegionCookie{cookie} -} - -func (c *Conn) XfixesSetGCClipRegionChecked(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetGCClipRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSetGCClipRegionRequest(Gc, Region, XOrigin, YOrigin), cookie) - return XfixesSetGCClipRegionCookie{cookie} -} - -func (cook XfixesSetGCClipRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSetGCClipRegion -func (c *Conn) xfixesSetGCClipRegionRequest(Gc Gcontext, Region XfixesRegion, XOrigin int16, YOrigin int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put16(buf[b:], uint16(XOrigin)) - b += 2 - - Put16(buf[b:], uint16(YOrigin)) - b += 2 - - return buf -} - -// Request XfixesSetWindowShapeRegion -// size: 20 -type XfixesSetWindowShapeRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesSetWindowShapeRegion -func (c *Conn) XfixesSetWindowShapeRegion(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) XfixesSetWindowShapeRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) - return XfixesSetWindowShapeRegionCookie{cookie} -} - -func (c *Conn) XfixesSetWindowShapeRegionChecked(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) XfixesSetWindowShapeRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSetWindowShapeRegionRequest(Dest, DestKind, XOffset, YOffset, Region), cookie) - return XfixesSetWindowShapeRegionCookie{cookie} -} - -func (cook XfixesSetWindowShapeRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSetWindowShapeRegion -func (c *Conn) xfixesSetWindowShapeRegionRequest(Dest Window, DestKind ShapeKind, XOffset int16, YOffset int16, Region XfixesRegion) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Dest)) - b += 4 - - buf[b] = byte(DestKind) - b += 1 - - b += 3 // padding - - Put16(buf[b:], uint16(XOffset)) - b += 2 - - Put16(buf[b:], uint16(YOffset)) - b += 2 - - Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// Request XfixesSetPictureClipRegion -// size: 16 -type XfixesSetPictureClipRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesSetPictureClipRegion -func (c *Conn) XfixesSetPictureClipRegion(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) - return XfixesSetPictureClipRegionCookie{cookie} -} - -func (c *Conn) XfixesSetPictureClipRegionChecked(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) XfixesSetPictureClipRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSetPictureClipRegionRequest(Picture, Region, XOrigin, YOrigin), cookie) - return XfixesSetPictureClipRegionCookie{cookie} -} - -func (cook XfixesSetPictureClipRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSetPictureClipRegion -func (c *Conn) xfixesSetPictureClipRegionRequest(Picture RenderPicture, Region XfixesRegion, XOrigin int16, YOrigin int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Picture)) - b += 4 - - Put32(buf[b:], uint32(Region)) - b += 4 - - Put16(buf[b:], uint16(XOrigin)) - b += 2 - - Put16(buf[b:], uint16(YOrigin)) - b += 2 - - return buf -} - -// Request XfixesSetCursorName -// size: pad((12 + pad((int(Nbytes) * 1)))) -type XfixesSetCursorNameCookie struct { - *cookie -} - -// Write request to wire for XfixesSetCursorName -func (c *Conn) XfixesSetCursorName(Cursor Cursor, Nbytes uint16, Name string) XfixesSetCursorNameCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) - return XfixesSetCursorNameCookie{cookie} -} - -func (c *Conn) XfixesSetCursorNameChecked(Cursor Cursor, Nbytes uint16, Name string) XfixesSetCursorNameCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesSetCursorNameRequest(Cursor, Nbytes, Name), cookie) - return XfixesSetCursorNameCookie{cookie} -} - -func (cook XfixesSetCursorNameCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesSetCursorName -func (c *Conn) xfixesSetCursorNameRequest(Cursor Cursor, Nbytes uint16, Name string) []byte { - size := pad((12 + pad((int(Nbytes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cursor)) - b += 4 - - Put16(buf[b:], Nbytes) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:Nbytes]) - b += pad(int(Nbytes)) - - return buf -} - -// Request XfixesGetCursorName -// size: 8 -type XfixesGetCursorNameCookie struct { - *cookie -} - -func (c *Conn) XfixesGetCursorName(Cursor Cursor) XfixesGetCursorNameCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) - return XfixesGetCursorNameCookie{cookie} -} - -func (c *Conn) XfixesGetCursorNameUnchecked(Cursor Cursor) XfixesGetCursorNameCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xfixesGetCursorNameRequest(Cursor), cookie) - return XfixesGetCursorNameCookie{cookie} -} - -// Request reply for XfixesGetCursorName -// size: (32 + pad((int(Nbytes) * 1))) -type XfixesGetCursorNameReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Atom Atom - Nbytes uint16 - // padding: 18 bytes - Name string // size: pad((int(Nbytes) * 1)) -} - -// Waits and reads reply data from request XfixesGetCursorName -func (cook XfixesGetCursorNameCookie) Reply() (*XfixesGetCursorNameReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xfixesGetCursorNameReply(buf), nil -} - -// Read reply into structure from buffer for XfixesGetCursorName -func xfixesGetCursorNameReply(buf []byte) *XfixesGetCursorNameReply { - v := new(XfixesGetCursorNameReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Atom = Atom(Get32(buf[b:])) - b += 4 - - v.Nbytes = Get16(buf[b:]) - b += 2 - - b += 18 // padding - - { - byteString := make([]byte, v.Nbytes) - copy(byteString[:v.Nbytes], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.Nbytes)) - } - - return v -} - -func (cook XfixesGetCursorNameCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesGetCursorName -func (c *Conn) xfixesGetCursorNameRequest(Cursor Cursor) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Cursor)) - b += 4 - - return buf -} - -// Request XfixesGetCursorImageAndName -// size: 4 -type XfixesGetCursorImageAndNameCookie struct { - *cookie -} - -func (c *Conn) XfixesGetCursorImageAndName() XfixesGetCursorImageAndNameCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xfixesGetCursorImageAndNameRequest(), cookie) - return XfixesGetCursorImageAndNameCookie{cookie} -} - -func (c *Conn) XfixesGetCursorImageAndNameUnchecked() XfixesGetCursorImageAndNameCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xfixesGetCursorImageAndNameRequest(), cookie) - return XfixesGetCursorImageAndNameCookie{cookie} -} - -// Request reply for XfixesGetCursorImageAndName -// size: ((32 + pad((int(Nbytes) * 1))) + pad(((int(Width) * int(Height)) * 4))) -type XfixesGetCursorImageAndNameReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - X int16 - Y int16 - Width uint16 - Height uint16 - Xhot uint16 - Yhot uint16 - CursorSerial uint32 - CursorAtom Atom - Nbytes uint16 - // padding: 2 bytes - Name string // size: pad((int(Nbytes) * 1)) - CursorImage []uint32 // size: pad(((int(Width) * int(Height)) * 4)) -} - -// Waits and reads reply data from request XfixesGetCursorImageAndName -func (cook XfixesGetCursorImageAndNameCookie) Reply() (*XfixesGetCursorImageAndNameReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xfixesGetCursorImageAndNameReply(buf), nil -} - -// Read reply into structure from buffer for XfixesGetCursorImageAndName -func xfixesGetCursorImageAndNameReply(buf []byte) *XfixesGetCursorImageAndNameReply { - v := new(XfixesGetCursorImageAndNameReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.X = int16(Get16(buf[b:])) - b += 2 - - v.Y = int16(Get16(buf[b:])) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.Xhot = Get16(buf[b:]) - b += 2 - - v.Yhot = Get16(buf[b:]) - b += 2 - - v.CursorSerial = Get32(buf[b:]) - b += 4 - - v.CursorAtom = Atom(Get32(buf[b:])) - b += 4 - - v.Nbytes = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - { - byteString := make([]byte, v.Nbytes) - copy(byteString[:v.Nbytes], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.Nbytes)) - } - - v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) - for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { - v.CursorImage[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XfixesGetCursorImageAndNameCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesGetCursorImageAndName -func (c *Conn) xfixesGetCursorImageAndNameRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XfixesChangeCursor -// size: 12 -type XfixesChangeCursorCookie struct { - *cookie -} - -// Write request to wire for XfixesChangeCursor -func (c *Conn) XfixesChangeCursor(Source Cursor, Destination Cursor) XfixesChangeCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) - return XfixesChangeCursorCookie{cookie} -} - -func (c *Conn) XfixesChangeCursorChecked(Source Cursor, Destination Cursor) XfixesChangeCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesChangeCursorRequest(Source, Destination), cookie) - return XfixesChangeCursorCookie{cookie} -} - -func (cook XfixesChangeCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesChangeCursor -func (c *Conn) xfixesChangeCursorRequest(Source Cursor, Destination Cursor) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// Request XfixesChangeCursorByName -// size: pad((12 + pad((int(Nbytes) * 1)))) -type XfixesChangeCursorByNameCookie struct { - *cookie -} - -// Write request to wire for XfixesChangeCursorByName -func (c *Conn) XfixesChangeCursorByName(Src Cursor, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) - return XfixesChangeCursorByNameCookie{cookie} -} - -func (c *Conn) XfixesChangeCursorByNameChecked(Src Cursor, Nbytes uint16, Name string) XfixesChangeCursorByNameCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesChangeCursorByNameRequest(Src, Nbytes, Name), cookie) - return XfixesChangeCursorByNameCookie{cookie} -} - -func (cook XfixesChangeCursorByNameCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesChangeCursorByName -func (c *Conn) xfixesChangeCursorByNameRequest(Src Cursor, Nbytes uint16, Name string) []byte { - size := pad((12 + pad((int(Nbytes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Src)) - b += 4 - - Put16(buf[b:], Nbytes) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:Nbytes]) - b += pad(int(Nbytes)) - - return buf -} - -// Request XfixesExpandRegion -// size: 20 -type XfixesExpandRegionCookie struct { - *cookie -} - -// Write request to wire for XfixesExpandRegion -func (c *Conn) XfixesExpandRegion(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) - return XfixesExpandRegionCookie{cookie} -} - -func (c *Conn) XfixesExpandRegionChecked(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) XfixesExpandRegionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesExpandRegionRequest(Source, Destination, Left, Right, Top, Bottom), cookie) - return XfixesExpandRegionCookie{cookie} -} - -func (cook XfixesExpandRegionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesExpandRegion -func (c *Conn) xfixesExpandRegionRequest(Source XfixesRegion, Destination XfixesRegion, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Source)) - b += 4 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - Put16(buf[b:], Left) - b += 2 - - Put16(buf[b:], Right) - b += 2 - - Put16(buf[b:], Top) - b += 2 - - Put16(buf[b:], Bottom) - b += 2 - - return buf -} - -// Request XfixesHideCursor -// size: 8 -type XfixesHideCursorCookie struct { - *cookie -} - -// Write request to wire for XfixesHideCursor -func (c *Conn) XfixesHideCursor(Window Window) XfixesHideCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesHideCursorRequest(Window), cookie) - return XfixesHideCursorCookie{cookie} -} - -func (c *Conn) XfixesHideCursorChecked(Window Window) XfixesHideCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesHideCursorRequest(Window), cookie) - return XfixesHideCursorCookie{cookie} -} - -func (cook XfixesHideCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesHideCursor -func (c *Conn) xfixesHideCursorRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XfixesShowCursor -// size: 8 -type XfixesShowCursorCookie struct { - *cookie -} - -// Write request to wire for XfixesShowCursor -func (c *Conn) XfixesShowCursor(Window Window) XfixesShowCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xfixesShowCursorRequest(Window), cookie) - return XfixesShowCursorCookie{cookie} -} - -func (c *Conn) XfixesShowCursorChecked(Window Window) XfixesShowCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xfixesShowCursorRequest(Window), cookie) - return XfixesShowCursorCookie{cookie} -} - -func (cook XfixesShowCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for XfixesShowCursor -func (c *Conn) xfixesShowCursorRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XFIXES"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} diff --git a/nexgb/auto_xinerama.go b/nexgb/auto_xinerama.go deleted file mode 100644 index fc24ae3..0000000 --- a/nexgb/auto_xinerama.go +++ /dev/null @@ -1,655 +0,0 @@ -package xgb - -/* - This file was generated by xinerama.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// XineramaInit must be called before using the XINERAMA extension. -func (c *Conn) XineramaInit() error { - reply, err := c.QueryExtension(8, "XINERAMA").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XINERAMA could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XINERAMA"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XINERAMA"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XINERAMA"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XINERAMA"] = make(map[int]newEventFun) - newExtErrorFuncs["XINERAMA"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// 'XineramaScreenInfo' struct definition -// Size: 8 -type XineramaScreenInfo struct { - XOrg int16 - YOrg int16 - Width uint16 - Height uint16 -} - -// Struct read XineramaScreenInfo -func ReadXineramaScreenInfo(buf []byte, v *XineramaScreenInfo) int { - b := 0 - - v.XOrg = int16(Get16(buf[b:])) - b += 2 - - v.YOrg = int16(Get16(buf[b:])) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XineramaScreenInfo -func ReadXineramaScreenInfoList(buf []byte, dest []XineramaScreenInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XineramaScreenInfo{} - b += ReadXineramaScreenInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XineramaScreenInfo -func (v XineramaScreenInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], uint16(v.XOrg)) - b += 2 - - Put16(buf[b:], uint16(v.YOrg)) - b += 2 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - return buf -} - -// Write struct list XineramaScreenInfo -func XineramaScreenInfoListBytes(buf []byte, list []XineramaScreenInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Request XineramaQueryVersion -// size: 8 -type XineramaQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XineramaQueryVersion(Major byte, Minor byte) XineramaQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie) - return XineramaQueryVersionCookie{cookie} -} - -func (c *Conn) XineramaQueryVersionUnchecked(Major byte, Minor byte) XineramaQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie) - return XineramaQueryVersionCookie{cookie} -} - -// Request reply for XineramaQueryVersion -// size: 12 -type XineramaQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Major uint16 - Minor uint16 -} - -// Waits and reads reply data from request XineramaQueryVersion -func (cook XineramaQueryVersionCookie) Reply() (*XineramaQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XineramaQueryVersion -func xineramaQueryVersionReply(buf []byte) *XineramaQueryVersionReply { - v := new(XineramaQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Major = Get16(buf[b:]) - b += 2 - - v.Minor = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XineramaQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaQueryVersion -func (c *Conn) xineramaQueryVersionRequest(Major byte, Minor byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Major - b += 1 - - buf[b] = Minor - b += 1 - - return buf -} - -// Request XineramaGetState -// size: 8 -type XineramaGetStateCookie struct { - *cookie -} - -func (c *Conn) XineramaGetState(Window Window) XineramaGetStateCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaGetStateRequest(Window), cookie) - return XineramaGetStateCookie{cookie} -} - -func (c *Conn) XineramaGetStateUnchecked(Window Window) XineramaGetStateCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaGetStateRequest(Window), cookie) - return XineramaGetStateCookie{cookie} -} - -// Request reply for XineramaGetState -// size: 12 -type XineramaGetStateReply struct { - Sequence uint16 - Length uint32 - State byte - Window Window -} - -// Waits and reads reply data from request XineramaGetState -func (cook XineramaGetStateCookie) Reply() (*XineramaGetStateReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaGetStateReply(buf), nil -} - -// Read reply into structure from buffer for XineramaGetState -func xineramaGetStateReply(buf []byte) *XineramaGetStateReply { - v := new(XineramaGetStateReply) - b := 1 // skip reply determinant - - v.State = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook XineramaGetStateCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaGetState -func (c *Conn) xineramaGetStateRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XineramaGetScreenCount -// size: 8 -type XineramaGetScreenCountCookie struct { - *cookie -} - -func (c *Conn) XineramaGetScreenCount(Window Window) XineramaGetScreenCountCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) - return XineramaGetScreenCountCookie{cookie} -} - -func (c *Conn) XineramaGetScreenCountUnchecked(Window Window) XineramaGetScreenCountCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie) - return XineramaGetScreenCountCookie{cookie} -} - -// Request reply for XineramaGetScreenCount -// size: 12 -type XineramaGetScreenCountReply struct { - Sequence uint16 - Length uint32 - ScreenCount byte - Window Window -} - -// Waits and reads reply data from request XineramaGetScreenCount -func (cook XineramaGetScreenCountCookie) Reply() (*XineramaGetScreenCountReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaGetScreenCountReply(buf), nil -} - -// Read reply into structure from buffer for XineramaGetScreenCount -func xineramaGetScreenCountReply(buf []byte) *XineramaGetScreenCountReply { - v := new(XineramaGetScreenCountReply) - b := 1 // skip reply determinant - - v.ScreenCount = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook XineramaGetScreenCountCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaGetScreenCount -func (c *Conn) xineramaGetScreenCountRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XineramaGetScreenSize -// size: 12 -type XineramaGetScreenSizeCookie struct { - *cookie -} - -func (c *Conn) XineramaGetScreenSize(Window Window, Screen uint32) XineramaGetScreenSizeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) - return XineramaGetScreenSizeCookie{cookie} -} - -func (c *Conn) XineramaGetScreenSizeUnchecked(Window Window, Screen uint32) XineramaGetScreenSizeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie) - return XineramaGetScreenSizeCookie{cookie} -} - -// Request reply for XineramaGetScreenSize -// size: 24 -type XineramaGetScreenSizeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Width uint32 - Height uint32 - Window Window - Screen uint32 -} - -// Waits and reads reply data from request XineramaGetScreenSize -func (cook XineramaGetScreenSizeCookie) Reply() (*XineramaGetScreenSizeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaGetScreenSizeReply(buf), nil -} - -// Read reply into structure from buffer for XineramaGetScreenSize -func xineramaGetScreenSizeReply(buf []byte) *XineramaGetScreenSizeReply { - v := new(XineramaGetScreenSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = Get32(buf[b:]) - b += 4 - - v.Height = Get32(buf[b:]) - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Screen = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook XineramaGetScreenSizeCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaGetScreenSize -func (c *Conn) xineramaGetScreenSizeRequest(Window Window, Screen uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// Request XineramaIsActive -// size: 4 -type XineramaIsActiveCookie struct { - *cookie -} - -func (c *Conn) XineramaIsActive() XineramaIsActiveCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaIsActiveRequest(), cookie) - return XineramaIsActiveCookie{cookie} -} - -func (c *Conn) XineramaIsActiveUnchecked() XineramaIsActiveCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaIsActiveRequest(), cookie) - return XineramaIsActiveCookie{cookie} -} - -// Request reply for XineramaIsActive -// size: 12 -type XineramaIsActiveReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - State uint32 -} - -// Waits and reads reply data from request XineramaIsActive -func (cook XineramaIsActiveCookie) Reply() (*XineramaIsActiveReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaIsActiveReply(buf), nil -} - -// Read reply into structure from buffer for XineramaIsActive -func xineramaIsActiveReply(buf []byte) *XineramaIsActiveReply { - v := new(XineramaIsActiveReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.State = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook XineramaIsActiveCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaIsActive -func (c *Conn) xineramaIsActiveRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XineramaQueryScreens -// size: 4 -type XineramaQueryScreensCookie struct { - *cookie -} - -func (c *Conn) XineramaQueryScreens() XineramaQueryScreensCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xineramaQueryScreensRequest(), cookie) - return XineramaQueryScreensCookie{cookie} -} - -func (c *Conn) XineramaQueryScreensUnchecked() XineramaQueryScreensCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xineramaQueryScreensRequest(), cookie) - return XineramaQueryScreensCookie{cookie} -} - -// Request reply for XineramaQueryScreens -// size: (32 + pad((int(Number) * 8))) -type XineramaQueryScreensReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Number uint32 - // padding: 20 bytes - ScreenInfo []XineramaScreenInfo // size: pad((int(Number) * 8)) -} - -// Waits and reads reply data from request XineramaQueryScreens -func (cook XineramaQueryScreensCookie) Reply() (*XineramaQueryScreensReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xineramaQueryScreensReply(buf), nil -} - -// Read reply into structure from buffer for XineramaQueryScreens -func xineramaQueryScreensReply(buf []byte) *XineramaQueryScreensReply { - v := new(XineramaQueryScreensReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Number = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.ScreenInfo = make([]XineramaScreenInfo, v.Number) - b += ReadXineramaScreenInfoList(buf[b:], v.ScreenInfo) - - return v -} - -func (cook XineramaQueryScreensCookie) Check() error { - return cook.check() -} - -// Write request to wire for XineramaQueryScreens -func (c *Conn) xineramaQueryScreensRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINERAMA"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go deleted file mode 100644 index 78142b6..0000000 --- a/nexgb/auto_xinput.go +++ /dev/null @@ -1,7297 +0,0 @@ -package xgb - -/* - This file was generated by xinput.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// XinputInit must be called before using the XInputExtension extension. -func (c *Conn) XinputInit() error { - reply, err := c.QueryExtension(15, "XInputExtension").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XInputExtension could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XInputExtension"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XInputExtension"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XInputExtension"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XInputExtension"] = make(map[int]newEventFun) - newExtErrorFuncs["XInputExtension"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - XinputValuatorModeRelative = 0 - XinputValuatorModeAbsolute = 1 -) - -const ( - XinputPropagateModeAddToList = 0 - XinputPropagateModeDeleteFromList = 1 -) - -const ( - XinputDeviceUseIsXPointer = 0 - XinputDeviceUseIsXKeyboard = 1 - XinputDeviceUseIsXExtensionDevice = 2 - XinputDeviceUseIsXExtensionKeyboard = 3 - XinputDeviceUseIsXExtensionPointer = 4 -) - -const ( - XinputInputClassKey = 0 - XinputInputClassButton = 1 - XinputInputClassValuator = 2 - XinputInputClassFeedback = 3 - XinputInputClassProximity = 4 - XinputInputClassFocus = 5 - XinputInputClassOther = 6 -) - -const ( - XinputDeviceInputModeAsyncThisDevice = 0 - XinputDeviceInputModeSyncThisDevice = 1 - XinputDeviceInputModeReplayThisDevice = 2 - XinputDeviceInputModeAsyncOtherDevices = 3 - XinputDeviceInputModeAsyncAll = 4 - XinputDeviceInputModeSyncAll = 5 -) - -const ( - XinputFeedbackClassKeyboard = 0 - XinputFeedbackClassPointer = 1 - XinputFeedbackClassString = 2 - XinputFeedbackClassInteger = 3 - XinputFeedbackClassLed = 4 - XinputFeedbackClassBell = 5 -) - -type XinputKeyCode byte - -type XinputEventClass uint32 - -// 'XinputDeviceInfo' struct definition -// Size: 8 -type XinputDeviceInfo struct { - DeviceType Atom - DeviceId byte - NumClassInfo byte - DeviceUse byte - // padding: 1 bytes -} - -// Struct read XinputDeviceInfo -func ReadXinputDeviceInfo(buf []byte, v *XinputDeviceInfo) int { - b := 0 - - v.DeviceType = Atom(Get32(buf[b:])) - b += 4 - - v.DeviceId = buf[b] - b += 1 - - v.NumClassInfo = buf[b] - b += 1 - - v.DeviceUse = buf[b] - b += 1 - - b += 1 // padding - - return b -} - -// Struct list read XinputDeviceInfo -func ReadXinputDeviceInfoList(buf []byte, dest []XinputDeviceInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceInfo{} - b += ReadXinputDeviceInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceInfo -func (v XinputDeviceInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.DeviceType)) - b += 4 - - buf[b] = v.DeviceId - b += 1 - - buf[b] = v.NumClassInfo - b += 1 - - buf[b] = v.DeviceUse - b += 1 - - b += 1 // padding - - return buf -} - -// Write struct list XinputDeviceInfo -func XinputDeviceInfoListBytes(buf []byte, list []XinputDeviceInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputInputInfo' struct definition -// Size: 2 -type XinputInputInfo struct { - ClassId byte - Len byte -} - -// Struct read XinputInputInfo -func ReadXinputInputInfo(buf []byte, v *XinputInputInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - return b -} - -// Struct list read XinputInputInfo -func ReadXinputInputInfoList(buf []byte, dest []XinputInputInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputInputInfo{} - b += ReadXinputInputInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputInputInfo -func (v XinputInputInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - return buf -} - -// Write struct list XinputInputInfo -func XinputInputInfoListBytes(buf []byte, list []XinputInputInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputKeyInfo' struct definition -// Size: 8 -type XinputKeyInfo struct { - ClassId byte - Len byte - MinKeycode XinputKeyCode - MaxKeycode XinputKeyCode - NumKeys uint16 - // padding: 2 bytes -} - -// Struct read XinputKeyInfo -func ReadXinputKeyInfo(buf []byte, v *XinputKeyInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.MinKeycode = XinputKeyCode(buf[b]) - b += 1 - - v.MaxKeycode = XinputKeyCode(buf[b]) - b += 1 - - v.NumKeys = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return b -} - -// Struct list read XinputKeyInfo -func ReadXinputKeyInfoList(buf []byte, dest []XinputKeyInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputKeyInfo{} - b += ReadXinputKeyInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputKeyInfo -func (v XinputKeyInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = byte(v.MinKeycode) - b += 1 - - buf[b] = byte(v.MaxKeycode) - b += 1 - - Put16(buf[b:], v.NumKeys) - b += 2 - - b += 2 // padding - - return buf -} - -// Write struct list XinputKeyInfo -func XinputKeyInfoListBytes(buf []byte, list []XinputKeyInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputButtonInfo' struct definition -// Size: 4 -type XinputButtonInfo struct { - ClassId byte - Len byte - NumButtons uint16 -} - -// Struct read XinputButtonInfo -func ReadXinputButtonInfo(buf []byte, v *XinputButtonInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumButtons = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputButtonInfo -func ReadXinputButtonInfoList(buf []byte, dest []XinputButtonInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputButtonInfo{} - b += ReadXinputButtonInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputButtonInfo -func (v XinputButtonInfo) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - Put16(buf[b:], v.NumButtons) - b += 2 - - return buf -} - -// Write struct list XinputButtonInfo -func XinputButtonInfoListBytes(buf []byte, list []XinputButtonInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputAxisInfo' struct definition -// Size: 12 -type XinputAxisInfo struct { - Resolution uint32 - Minimum int32 - Maximum int32 -} - -// Struct read XinputAxisInfo -func ReadXinputAxisInfo(buf []byte, v *XinputAxisInfo) int { - b := 0 - - v.Resolution = Get32(buf[b:]) - b += 4 - - v.Minimum = int32(Get32(buf[b:])) - b += 4 - - v.Maximum = int32(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read XinputAxisInfo -func ReadXinputAxisInfoList(buf []byte, dest []XinputAxisInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputAxisInfo{} - b += ReadXinputAxisInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputAxisInfo -func (v XinputAxisInfo) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - Put32(buf[b:], v.Resolution) - b += 4 - - Put32(buf[b:], uint32(v.Minimum)) - b += 4 - - Put32(buf[b:], uint32(v.Maximum)) - b += 4 - - return buf -} - -// Write struct list XinputAxisInfo -func XinputAxisInfoListBytes(buf []byte, list []XinputAxisInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputValuatorInfo' struct definition -// Size: (8 + pad((int(AxesLen) * 12))) -type XinputValuatorInfo struct { - ClassId byte - Len byte - AxesLen byte - Mode byte - MotionSize uint32 - Axes []XinputAxisInfo // size: pad((int(AxesLen) * 12)) -} - -// Struct read XinputValuatorInfo -func ReadXinputValuatorInfo(buf []byte, v *XinputValuatorInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.AxesLen = buf[b] - b += 1 - - v.Mode = buf[b] - b += 1 - - v.MotionSize = Get32(buf[b:]) - b += 4 - - v.Axes = make([]XinputAxisInfo, v.AxesLen) - b += ReadXinputAxisInfoList(buf[b:], v.Axes) - - return b -} - -// Struct list read XinputValuatorInfo -func ReadXinputValuatorInfoList(buf []byte, dest []XinputValuatorInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputValuatorInfo{} - b += ReadXinputValuatorInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputValuatorInfo -func (v XinputValuatorInfo) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.AxesLen) * 12)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.AxesLen - b += 1 - - buf[b] = v.Mode - b += 1 - - Put32(buf[b:], v.MotionSize) - b += 4 - - b += XinputAxisInfoListBytes(buf[b:], v.Axes) - - return buf -} - -// Write struct list XinputValuatorInfo -func XinputValuatorInfoListBytes(buf []byte, list []XinputValuatorInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputValuatorInfo -func XinputValuatorInfoListSize(list []XinputValuatorInfo) int { - size := 0 - for _, item := range list { - size += (8 + pad((int(item.AxesLen) * 12))) - } - return size -} - -// 'XinputInputClassInfo' struct definition -// Size: 2 -type XinputInputClassInfo struct { - ClassId byte - EventTypeBase byte -} - -// Struct read XinputInputClassInfo -func ReadXinputInputClassInfo(buf []byte, v *XinputInputClassInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.EventTypeBase = buf[b] - b += 1 - - return b -} - -// Struct list read XinputInputClassInfo -func ReadXinputInputClassInfoList(buf []byte, dest []XinputInputClassInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputInputClassInfo{} - b += ReadXinputInputClassInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputInputClassInfo -func (v XinputInputClassInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.EventTypeBase - b += 1 - - return buf -} - -// Write struct list XinputInputClassInfo -func XinputInputClassInfoListBytes(buf []byte, list []XinputInputClassInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceTimeCoord' struct definition -// Size: 4 -type XinputDeviceTimeCoord struct { - Time Timestamp -} - -// Struct read XinputDeviceTimeCoord -func ReadXinputDeviceTimeCoord(buf []byte, v *XinputDeviceTimeCoord) int { - b := 0 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read XinputDeviceTimeCoord -func ReadXinputDeviceTimeCoordList(buf []byte, dest []XinputDeviceTimeCoord) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceTimeCoord{} - b += ReadXinputDeviceTimeCoord(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceTimeCoord -func (v XinputDeviceTimeCoord) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - return buf -} - -// Write struct list XinputDeviceTimeCoord -func XinputDeviceTimeCoordListBytes(buf []byte, list []XinputDeviceTimeCoord) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputFeedbackState' struct definition -// Size: 4 -type XinputFeedbackState struct { - ClassId byte - Id byte - Len uint16 -} - -// Struct read XinputFeedbackState -func ReadXinputFeedbackState(buf []byte, v *XinputFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputFeedbackState -func ReadXinputFeedbackStateList(buf []byte, dest []XinputFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputFeedbackState{} - b += ReadXinputFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputFeedbackState -func (v XinputFeedbackState) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// Write struct list XinputFeedbackState -func XinputFeedbackStateListBytes(buf []byte, list []XinputFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputKbdFeedbackState' struct definition -// Size: 52 -type XinputKbdFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Pitch uint16 - Duration uint16 - LedMask uint32 - LedValues uint32 - GlobalAutoRepeat bool - Click byte - Percent byte - // padding: 1 bytes - AutoRepeats []byte // size: 32 -} - -// Struct read XinputKbdFeedbackState -func ReadXinputKbdFeedbackState(buf []byte, v *XinputKbdFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Pitch = Get16(buf[b:]) - b += 2 - - v.Duration = Get16(buf[b:]) - b += 2 - - v.LedMask = Get32(buf[b:]) - b += 4 - - v.LedValues = Get32(buf[b:]) - b += 4 - - if buf[b] == 1 { - v.GlobalAutoRepeat = true - } else { - v.GlobalAutoRepeat = false - } - b += 1 - - v.Click = buf[b] - b += 1 - - v.Percent = buf[b] - b += 1 - - b += 1 // padding - - v.AutoRepeats = make([]byte, 32) - copy(v.AutoRepeats[:32], buf[b:]) - b += pad(int(32)) - - return b -} - -// Struct list read XinputKbdFeedbackState -func ReadXinputKbdFeedbackStateList(buf []byte, dest []XinputKbdFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputKbdFeedbackState{} - b += ReadXinputKbdFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputKbdFeedbackState -func (v XinputKbdFeedbackState) Bytes() []byte { - buf := make([]byte, 52) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put16(buf[b:], v.Pitch) - b += 2 - - Put16(buf[b:], v.Duration) - b += 2 - - Put32(buf[b:], v.LedMask) - b += 4 - - Put32(buf[b:], v.LedValues) - b += 4 - - if v.GlobalAutoRepeat { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = v.Click - b += 1 - - buf[b] = v.Percent - b += 1 - - b += 1 // padding - - copy(buf[b:], v.AutoRepeats[:32]) - b += pad(int(32)) - - return buf -} - -// Write struct list XinputKbdFeedbackState -func XinputKbdFeedbackStateListBytes(buf []byte, list []XinputKbdFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputKbdFeedbackState -func XinputKbdFeedbackStateListSize(list []XinputKbdFeedbackState) int { - size := 0 - for _ = range list { - size += 52 - } - return size -} - -// 'XinputPtrFeedbackState' struct definition -// Size: 12 -type XinputPtrFeedbackState struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - AccelNum uint16 - AccelDenom uint16 - Threshold uint16 -} - -// Struct read XinputPtrFeedbackState -func ReadXinputPtrFeedbackState(buf []byte, v *XinputPtrFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.AccelNum = Get16(buf[b:]) - b += 2 - - v.AccelDenom = Get16(buf[b:]) - b += 2 - - v.Threshold = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputPtrFeedbackState -func ReadXinputPtrFeedbackStateList(buf []byte, dest []XinputPtrFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputPtrFeedbackState{} - b += ReadXinputPtrFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputPtrFeedbackState -func (v XinputPtrFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - Put16(buf[b:], v.AccelNum) - b += 2 - - Put16(buf[b:], v.AccelDenom) - b += 2 - - Put16(buf[b:], v.Threshold) - b += 2 - - return buf -} - -// Write struct list XinputPtrFeedbackState -func XinputPtrFeedbackStateListBytes(buf []byte, list []XinputPtrFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputIntegerFeedbackState' struct definition -// Size: 16 -type XinputIntegerFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Resolution uint32 - MinValue int32 - MaxValue int32 -} - -// Struct read XinputIntegerFeedbackState -func ReadXinputIntegerFeedbackState(buf []byte, v *XinputIntegerFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Resolution = Get32(buf[b:]) - b += 4 - - v.MinValue = int32(Get32(buf[b:])) - b += 4 - - v.MaxValue = int32(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read XinputIntegerFeedbackState -func ReadXinputIntegerFeedbackStateList(buf []byte, dest []XinputIntegerFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputIntegerFeedbackState{} - b += ReadXinputIntegerFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputIntegerFeedbackState -func (v XinputIntegerFeedbackState) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.Resolution) - b += 4 - - Put32(buf[b:], uint32(v.MinValue)) - b += 4 - - Put32(buf[b:], uint32(v.MaxValue)) - b += 4 - - return buf -} - -// Write struct list XinputIntegerFeedbackState -func XinputIntegerFeedbackStateListBytes(buf []byte, list []XinputIntegerFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputStringFeedbackState' struct definition -// Size: (8 + pad((int(NumKeysyms) * 4))) -type XinputStringFeedbackState struct { - ClassId byte - Id byte - Len uint16 - MaxSymbols uint16 - NumKeysyms uint16 - Keysyms []Keysym // size: pad((int(NumKeysyms) * 4)) -} - -// Struct read XinputStringFeedbackState -func ReadXinputStringFeedbackState(buf []byte, v *XinputStringFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.MaxSymbols = Get16(buf[b:]) - b += 2 - - v.NumKeysyms = Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = Keysym(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return b -} - -// Struct list read XinputStringFeedbackState -func ReadXinputStringFeedbackStateList(buf []byte, dest []XinputStringFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputStringFeedbackState{} - b += ReadXinputStringFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputStringFeedbackState -func (v XinputStringFeedbackState) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put16(buf[b:], v.MaxSymbols) - b += 2 - - Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Write struct list XinputStringFeedbackState -func XinputStringFeedbackStateListBytes(buf []byte, list []XinputStringFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputStringFeedbackState -func XinputStringFeedbackStateListSize(list []XinputStringFeedbackState) int { - size := 0 - for _, item := range list { - size += (8 + pad((int(item.NumKeysyms) * 4))) - } - return size -} - -// 'XinputBellFeedbackState' struct definition -// Size: 12 -type XinputBellFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Percent byte - // padding: 3 bytes - Pitch uint16 - Duration uint16 -} - -// Struct read XinputBellFeedbackState -func ReadXinputBellFeedbackState(buf []byte, v *XinputBellFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Percent = buf[b] - b += 1 - - b += 3 // padding - - v.Pitch = Get16(buf[b:]) - b += 2 - - v.Duration = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputBellFeedbackState -func ReadXinputBellFeedbackStateList(buf []byte, dest []XinputBellFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputBellFeedbackState{} - b += ReadXinputBellFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputBellFeedbackState -func (v XinputBellFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Percent - b += 1 - - b += 3 // padding - - Put16(buf[b:], v.Pitch) - b += 2 - - Put16(buf[b:], v.Duration) - b += 2 - - return buf -} - -// Write struct list XinputBellFeedbackState -func XinputBellFeedbackStateListBytes(buf []byte, list []XinputBellFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputLedFeedbackState' struct definition -// Size: 12 -type XinputLedFeedbackState struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 -} - -// Struct read XinputLedFeedbackState -func ReadXinputLedFeedbackState(buf []byte, v *XinputLedFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.LedMask = Get32(buf[b:]) - b += 4 - - v.LedValues = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputLedFeedbackState -func ReadXinputLedFeedbackStateList(buf []byte, dest []XinputLedFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputLedFeedbackState{} - b += ReadXinputLedFeedbackState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputLedFeedbackState -func (v XinputLedFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.LedMask) - b += 4 - - Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// Write struct list XinputLedFeedbackState -func XinputLedFeedbackStateListBytes(buf []byte, list []XinputLedFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputFeedbackCtl' struct definition -// Size: 4 -type XinputFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 -} - -// Struct read XinputFeedbackCtl -func ReadXinputFeedbackCtl(buf []byte, v *XinputFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputFeedbackCtl -func ReadXinputFeedbackCtlList(buf []byte, dest []XinputFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputFeedbackCtl{} - b += ReadXinputFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputFeedbackCtl -func (v XinputFeedbackCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// Write struct list XinputFeedbackCtl -func XinputFeedbackCtlListBytes(buf []byte, list []XinputFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputKbdFeedbackCtl' struct definition -// Size: 20 -type XinputKbdFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - Key XinputKeyCode - AutoRepeatMode byte - KeyClickPercent int8 - BellPercent int8 - BellPitch int16 - BellDuration int16 - LedMask uint32 - LedValues uint32 -} - -// Struct read XinputKbdFeedbackCtl -func ReadXinputKbdFeedbackCtl(buf []byte, v *XinputKbdFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Key = XinputKeyCode(buf[b]) - b += 1 - - v.AutoRepeatMode = buf[b] - b += 1 - - v.KeyClickPercent = int8(buf[b]) - b += 1 - - v.BellPercent = int8(buf[b]) - b += 1 - - v.BellPitch = int16(Get16(buf[b:])) - b += 2 - - v.BellDuration = int16(Get16(buf[b:])) - b += 2 - - v.LedMask = Get32(buf[b:]) - b += 4 - - v.LedValues = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputKbdFeedbackCtl -func ReadXinputKbdFeedbackCtlList(buf []byte, dest []XinputKbdFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputKbdFeedbackCtl{} - b += ReadXinputKbdFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputKbdFeedbackCtl -func (v XinputKbdFeedbackCtl) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = byte(v.Key) - b += 1 - - buf[b] = v.AutoRepeatMode - b += 1 - - buf[b] = byte(v.KeyClickPercent) - b += 1 - - buf[b] = byte(v.BellPercent) - b += 1 - - Put16(buf[b:], uint16(v.BellPitch)) - b += 2 - - Put16(buf[b:], uint16(v.BellDuration)) - b += 2 - - Put32(buf[b:], v.LedMask) - b += 4 - - Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// Write struct list XinputKbdFeedbackCtl -func XinputKbdFeedbackCtlListBytes(buf []byte, list []XinputKbdFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputPtrFeedbackCtl' struct definition -// Size: 12 -type XinputPtrFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - Num int16 - Denom int16 - Threshold int16 -} - -// Struct read XinputPtrFeedbackCtl -func ReadXinputPtrFeedbackCtl(buf []byte, v *XinputPtrFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Num = int16(Get16(buf[b:])) - b += 2 - - v.Denom = int16(Get16(buf[b:])) - b += 2 - - v.Threshold = int16(Get16(buf[b:])) - b += 2 - - return b -} - -// Struct list read XinputPtrFeedbackCtl -func ReadXinputPtrFeedbackCtlList(buf []byte, dest []XinputPtrFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputPtrFeedbackCtl{} - b += ReadXinputPtrFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputPtrFeedbackCtl -func (v XinputPtrFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - Put16(buf[b:], uint16(v.Num)) - b += 2 - - Put16(buf[b:], uint16(v.Denom)) - b += 2 - - Put16(buf[b:], uint16(v.Threshold)) - b += 2 - - return buf -} - -// Write struct list XinputPtrFeedbackCtl -func XinputPtrFeedbackCtlListBytes(buf []byte, list []XinputPtrFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputIntegerFeedbackCtl' struct definition -// Size: 8 -type XinputIntegerFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - IntToDisplay int32 -} - -// Struct read XinputIntegerFeedbackCtl -func ReadXinputIntegerFeedbackCtl(buf []byte, v *XinputIntegerFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.IntToDisplay = int32(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read XinputIntegerFeedbackCtl -func ReadXinputIntegerFeedbackCtlList(buf []byte, dest []XinputIntegerFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputIntegerFeedbackCtl{} - b += ReadXinputIntegerFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputIntegerFeedbackCtl -func (v XinputIntegerFeedbackCtl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], uint32(v.IntToDisplay)) - b += 4 - - return buf -} - -// Write struct list XinputIntegerFeedbackCtl -func XinputIntegerFeedbackCtlListBytes(buf []byte, list []XinputIntegerFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputStringFeedbackCtl' struct definition -// Size: (8 + pad((int(NumKeysyms) * 4))) -type XinputStringFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - NumKeysyms uint16 - Keysyms []Keysym // size: pad((int(NumKeysyms) * 4)) -} - -// Struct read XinputStringFeedbackCtl -func ReadXinputStringFeedbackCtl(buf []byte, v *XinputStringFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.NumKeysyms = Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = Keysym(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return b -} - -// Struct list read XinputStringFeedbackCtl -func ReadXinputStringFeedbackCtlList(buf []byte, dest []XinputStringFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputStringFeedbackCtl{} - b += ReadXinputStringFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputStringFeedbackCtl -func (v XinputStringFeedbackCtl) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Write struct list XinputStringFeedbackCtl -func XinputStringFeedbackCtlListBytes(buf []byte, list []XinputStringFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputStringFeedbackCtl -func XinputStringFeedbackCtlListSize(list []XinputStringFeedbackCtl) int { - size := 0 - for _, item := range list { - size += (8 + pad((int(item.NumKeysyms) * 4))) - } - return size -} - -// 'XinputBellFeedbackCtl' struct definition -// Size: 12 -type XinputBellFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - Percent int8 - // padding: 3 bytes - Pitch int16 - Duration int16 -} - -// Struct read XinputBellFeedbackCtl -func ReadXinputBellFeedbackCtl(buf []byte, v *XinputBellFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Percent = int8(buf[b]) - b += 1 - - b += 3 // padding - - v.Pitch = int16(Get16(buf[b:])) - b += 2 - - v.Duration = int16(Get16(buf[b:])) - b += 2 - - return b -} - -// Struct list read XinputBellFeedbackCtl -func ReadXinputBellFeedbackCtlList(buf []byte, dest []XinputBellFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputBellFeedbackCtl{} - b += ReadXinputBellFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputBellFeedbackCtl -func (v XinputBellFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = byte(v.Percent) - b += 1 - - b += 3 // padding - - Put16(buf[b:], uint16(v.Pitch)) - b += 2 - - Put16(buf[b:], uint16(v.Duration)) - b += 2 - - return buf -} - -// Write struct list XinputBellFeedbackCtl -func XinputBellFeedbackCtlListBytes(buf []byte, list []XinputBellFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputLedFeedbackCtl' struct definition -// Size: 12 -type XinputLedFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 -} - -// Struct read XinputLedFeedbackCtl -func ReadXinputLedFeedbackCtl(buf []byte, v *XinputLedFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = Get16(buf[b:]) - b += 2 - - v.LedMask = Get32(buf[b:]) - b += 4 - - v.LedValues = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputLedFeedbackCtl -func ReadXinputLedFeedbackCtlList(buf []byte, dest []XinputLedFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputLedFeedbackCtl{} - b += ReadXinputLedFeedbackCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputLedFeedbackCtl -func (v XinputLedFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.LedMask) - b += 4 - - Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// Write struct list XinputLedFeedbackCtl -func XinputLedFeedbackCtlListBytes(buf []byte, list []XinputLedFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputInputState' struct definition -// Size: 3 -type XinputInputState struct { - ClassId byte - Len byte - NumItems byte -} - -// Struct read XinputInputState -func ReadXinputInputState(buf []byte, v *XinputInputState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumItems = buf[b] - b += 1 - - return b -} - -// Struct list read XinputInputState -func ReadXinputInputStateList(buf []byte, dest []XinputInputState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputInputState{} - b += ReadXinputInputState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputInputState -func (v XinputInputState) Bytes() []byte { - buf := make([]byte, 3) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumItems - b += 1 - - return buf -} - -// Write struct list XinputInputState -func XinputInputStateListBytes(buf []byte, list []XinputInputState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputKeyState' struct definition -// Size: 36 -type XinputKeyState struct { - ClassId byte - Len byte - NumKeys byte - // padding: 1 bytes - Keys []byte // size: 32 -} - -// Struct read XinputKeyState -func ReadXinputKeyState(buf []byte, v *XinputKeyState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumKeys = buf[b] - b += 1 - - b += 1 // padding - - v.Keys = make([]byte, 32) - copy(v.Keys[:32], buf[b:]) - b += pad(int(32)) - - return b -} - -// Struct list read XinputKeyState -func ReadXinputKeyStateList(buf []byte, dest []XinputKeyState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputKeyState{} - b += ReadXinputKeyState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputKeyState -func (v XinputKeyState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumKeys - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Keys[:32]) - b += pad(int(32)) - - return buf -} - -// Write struct list XinputKeyState -func XinputKeyStateListBytes(buf []byte, list []XinputKeyState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputKeyState -func XinputKeyStateListSize(list []XinputKeyState) int { - size := 0 - for _ = range list { - size += 36 - } - return size -} - -// 'XinputButtonState' struct definition -// Size: 36 -type XinputButtonState struct { - ClassId byte - Len byte - NumButtons byte - // padding: 1 bytes - Buttons []byte // size: 32 -} - -// Struct read XinputButtonState -func ReadXinputButtonState(buf []byte, v *XinputButtonState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumButtons = buf[b] - b += 1 - - b += 1 // padding - - v.Buttons = make([]byte, 32) - copy(v.Buttons[:32], buf[b:]) - b += pad(int(32)) - - return b -} - -// Struct list read XinputButtonState -func ReadXinputButtonStateList(buf []byte, dest []XinputButtonState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputButtonState{} - b += ReadXinputButtonState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputButtonState -func (v XinputButtonState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumButtons - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Buttons[:32]) - b += pad(int(32)) - - return buf -} - -// Write struct list XinputButtonState -func XinputButtonStateListBytes(buf []byte, list []XinputButtonState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputButtonState -func XinputButtonStateListSize(list []XinputButtonState) int { - size := 0 - for _ = range list { - size += 36 - } - return size -} - -// 'XinputValuatorState' struct definition -// Size: (4 + pad((int(NumValuators) * 4))) -type XinputValuatorState struct { - ClassId byte - Len byte - NumValuators byte - Mode byte - Valuators []uint32 // size: pad((int(NumValuators) * 4)) -} - -// Struct read XinputValuatorState -func ReadXinputValuatorState(buf []byte, v *XinputValuatorState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.Mode = buf[b] - b += 1 - - v.Valuators = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.Valuators[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return b -} - -// Struct list read XinputValuatorState -func ReadXinputValuatorStateList(buf []byte, dest []XinputValuatorState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputValuatorState{} - b += ReadXinputValuatorState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputValuatorState -func (v XinputValuatorState) Bytes() []byte { - buf := make([]byte, (4 + pad((int(v.NumValuators) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.Mode - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - Put32(buf[b:], v.Valuators[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Write struct list XinputValuatorState -func XinputValuatorStateListBytes(buf []byte, list []XinputValuatorState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputValuatorState -func XinputValuatorStateListSize(list []XinputValuatorState) int { - size := 0 - for _, item := range list { - size += (4 + pad((int(item.NumValuators) * 4))) - } - return size -} - -// 'XinputDeviceState' struct definition -// Size: 4 -type XinputDeviceState struct { - ControlId uint16 - Len uint16 -} - -// Struct read XinputDeviceState -func ReadXinputDeviceState(buf []byte, v *XinputDeviceState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputDeviceState -func ReadXinputDeviceStateList(buf []byte, dest []XinputDeviceState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceState{} - b += ReadXinputDeviceState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceState -func (v XinputDeviceState) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// Write struct list XinputDeviceState -func XinputDeviceStateListBytes(buf []byte, list []XinputDeviceState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceResolutionState' struct definition -// Size: (((8 + pad((int(NumValuators) * 4))) + pad((int(NumValuators) * 4))) + pad((int(NumValuators) * 4))) -type XinputDeviceResolutionState struct { - ControlId uint16 - Len uint16 - NumValuators uint32 - ResolutionValues []uint32 // size: pad((int(NumValuators) * 4)) - ResolutionMin []uint32 // size: pad((int(NumValuators) * 4)) - ResolutionMax []uint32 // size: pad((int(NumValuators) * 4)) -} - -// Struct read XinputDeviceResolutionState -func ReadXinputDeviceResolutionState(buf []byte, v *XinputDeviceResolutionState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.NumValuators = Get32(buf[b:]) - b += 4 - - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.ResolutionMin = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMin[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.ResolutionMax = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMax[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return b -} - -// Struct list read XinputDeviceResolutionState -func ReadXinputDeviceResolutionStateList(buf []byte, dest []XinputDeviceResolutionState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceResolutionState{} - b += ReadXinputDeviceResolutionState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceResolutionState -func (v XinputDeviceResolutionState) Bytes() []byte { - buf := make([]byte, (((8 + pad((int(v.NumValuators) * 4))) + pad((int(v.NumValuators) * 4))) + pad((int(v.NumValuators) * 4)))) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.NumValuators) - b += 4 - - for i := 0; i < int(v.NumValuators); i++ { - Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - Put32(buf[b:], v.ResolutionMin[i]) - b += 4 - } - b = pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - Put32(buf[b:], v.ResolutionMax[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Write struct list XinputDeviceResolutionState -func XinputDeviceResolutionStateListBytes(buf []byte, list []XinputDeviceResolutionState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputDeviceResolutionState -func XinputDeviceResolutionStateListSize(list []XinputDeviceResolutionState) int { - size := 0 - for _, item := range list { - size += (((8 + pad((int(item.NumValuators) * 4))) + pad((int(item.NumValuators) * 4))) + pad((int(item.NumValuators) * 4))) - } - return size -} - -// 'XinputDeviceAbsCalibState' struct definition -// Size: 36 -type XinputDeviceAbsCalibState struct { - ControlId uint16 - Len uint16 - MinX int32 - MaxX int32 - MinY int32 - MaxY int32 - FlipX uint32 - FlipY uint32 - Rotation uint32 - ButtonThreshold uint32 -} - -// Struct read XinputDeviceAbsCalibState -func ReadXinputDeviceAbsCalibState(buf []byte, v *XinputDeviceAbsCalibState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.MinX = int32(Get32(buf[b:])) - b += 4 - - v.MaxX = int32(Get32(buf[b:])) - b += 4 - - v.MinY = int32(Get32(buf[b:])) - b += 4 - - v.MaxY = int32(Get32(buf[b:])) - b += 4 - - v.FlipX = Get32(buf[b:]) - b += 4 - - v.FlipY = Get32(buf[b:]) - b += 4 - - v.Rotation = Get32(buf[b:]) - b += 4 - - v.ButtonThreshold = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputDeviceAbsCalibState -func ReadXinputDeviceAbsCalibStateList(buf []byte, dest []XinputDeviceAbsCalibState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceAbsCalibState{} - b += ReadXinputDeviceAbsCalibState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceAbsCalibState -func (v XinputDeviceAbsCalibState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], uint32(v.MinX)) - b += 4 - - Put32(buf[b:], uint32(v.MaxX)) - b += 4 - - Put32(buf[b:], uint32(v.MinY)) - b += 4 - - Put32(buf[b:], uint32(v.MaxY)) - b += 4 - - Put32(buf[b:], v.FlipX) - b += 4 - - Put32(buf[b:], v.FlipY) - b += 4 - - Put32(buf[b:], v.Rotation) - b += 4 - - Put32(buf[b:], v.ButtonThreshold) - b += 4 - - return buf -} - -// Write struct list XinputDeviceAbsCalibState -func XinputDeviceAbsCalibStateListBytes(buf []byte, list []XinputDeviceAbsCalibState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceAbsAreaState' struct definition -// Size: 28 -type XinputDeviceAbsAreaState struct { - ControlId uint16 - Len uint16 - OffsetX uint32 - OffsetY uint32 - Width uint32 - Height uint32 - Screen uint32 - Following uint32 -} - -// Struct read XinputDeviceAbsAreaState -func ReadXinputDeviceAbsAreaState(buf []byte, v *XinputDeviceAbsAreaState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.OffsetX = Get32(buf[b:]) - b += 4 - - v.OffsetY = Get32(buf[b:]) - b += 4 - - v.Width = Get32(buf[b:]) - b += 4 - - v.Height = Get32(buf[b:]) - b += 4 - - v.Screen = Get32(buf[b:]) - b += 4 - - v.Following = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputDeviceAbsAreaState -func ReadXinputDeviceAbsAreaStateList(buf []byte, dest []XinputDeviceAbsAreaState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceAbsAreaState{} - b += ReadXinputDeviceAbsAreaState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceAbsAreaState -func (v XinputDeviceAbsAreaState) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.OffsetX) - b += 4 - - Put32(buf[b:], v.OffsetY) - b += 4 - - Put32(buf[b:], v.Width) - b += 4 - - Put32(buf[b:], v.Height) - b += 4 - - Put32(buf[b:], v.Screen) - b += 4 - - Put32(buf[b:], v.Following) - b += 4 - - return buf -} - -// Write struct list XinputDeviceAbsAreaState -func XinputDeviceAbsAreaStateListBytes(buf []byte, list []XinputDeviceAbsAreaState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceCoreState' struct definition -// Size: 8 -type XinputDeviceCoreState struct { - ControlId uint16 - Len uint16 - Status byte - Iscore byte - // padding: 2 bytes -} - -// Struct read XinputDeviceCoreState -func ReadXinputDeviceCoreState(buf []byte, v *XinputDeviceCoreState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Status = buf[b] - b += 1 - - v.Iscore = buf[b] - b += 1 - - b += 2 // padding - - return b -} - -// Struct list read XinputDeviceCoreState -func ReadXinputDeviceCoreStateList(buf []byte, dest []XinputDeviceCoreState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceCoreState{} - b += ReadXinputDeviceCoreState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceCoreState -func (v XinputDeviceCoreState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Status - b += 1 - - buf[b] = v.Iscore - b += 1 - - b += 2 // padding - - return buf -} - -// Write struct list XinputDeviceCoreState -func XinputDeviceCoreStateListBytes(buf []byte, list []XinputDeviceCoreState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceEnableState' struct definition -// Size: 8 -type XinputDeviceEnableState struct { - ControlId uint16 - Len uint16 - Enable byte - // padding: 3 bytes -} - -// Struct read XinputDeviceEnableState -func ReadXinputDeviceEnableState(buf []byte, v *XinputDeviceEnableState) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Enable = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// Struct list read XinputDeviceEnableState -func ReadXinputDeviceEnableStateList(buf []byte, dest []XinputDeviceEnableState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceEnableState{} - b += ReadXinputDeviceEnableState(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceEnableState -func (v XinputDeviceEnableState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Enable - b += 1 - - b += 3 // padding - - return buf -} - -// Write struct list XinputDeviceEnableState -func XinputDeviceEnableStateListBytes(buf []byte, list []XinputDeviceEnableState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceCtl' struct definition -// Size: 4 -type XinputDeviceCtl struct { - ControlId uint16 - Len uint16 -} - -// Struct read XinputDeviceCtl -func ReadXinputDeviceCtl(buf []byte, v *XinputDeviceCtl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - return b -} - -// Struct list read XinputDeviceCtl -func ReadXinputDeviceCtlList(buf []byte, dest []XinputDeviceCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceCtl{} - b += ReadXinputDeviceCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceCtl -func (v XinputDeviceCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// Write struct list XinputDeviceCtl -func XinputDeviceCtlListBytes(buf []byte, list []XinputDeviceCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceResolutionCtl' struct definition -// Size: (6 + pad((int(NumValuators) * 4))) -type XinputDeviceResolutionCtl struct { - ControlId uint16 - Len uint16 - FirstValuator byte - NumValuators byte - ResolutionValues []uint32 // size: pad((int(NumValuators) * 4)) -} - -// Struct read XinputDeviceResolutionCtl -func ReadXinputDeviceResolutionCtl(buf []byte, v *XinputDeviceResolutionCtl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.FirstValuator = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return b -} - -// Struct list read XinputDeviceResolutionCtl -func ReadXinputDeviceResolutionCtlList(buf []byte, dest []XinputDeviceResolutionCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceResolutionCtl{} - b += ReadXinputDeviceResolutionCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceResolutionCtl -func (v XinputDeviceResolutionCtl) Bytes() []byte { - buf := make([]byte, (6 + pad((int(v.NumValuators) * 4)))) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.FirstValuator - b += 1 - - buf[b] = v.NumValuators - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Write struct list XinputDeviceResolutionCtl -func XinputDeviceResolutionCtlListBytes(buf []byte, list []XinputDeviceResolutionCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XinputDeviceResolutionCtl -func XinputDeviceResolutionCtlListSize(list []XinputDeviceResolutionCtl) int { - size := 0 - for _, item := range list { - size += (6 + pad((int(item.NumValuators) * 4))) - } - return size -} - -// 'XinputDeviceAbsCalibCtl' struct definition -// Size: 36 -type XinputDeviceAbsCalibCtl struct { - ControlId uint16 - Len uint16 - MinX int32 - MaxX int32 - MinY int32 - MaxY int32 - FlipX uint32 - FlipY uint32 - Rotation uint32 - ButtonThreshold uint32 -} - -// Struct read XinputDeviceAbsCalibCtl -func ReadXinputDeviceAbsCalibCtl(buf []byte, v *XinputDeviceAbsCalibCtl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.MinX = int32(Get32(buf[b:])) - b += 4 - - v.MaxX = int32(Get32(buf[b:])) - b += 4 - - v.MinY = int32(Get32(buf[b:])) - b += 4 - - v.MaxY = int32(Get32(buf[b:])) - b += 4 - - v.FlipX = Get32(buf[b:]) - b += 4 - - v.FlipY = Get32(buf[b:]) - b += 4 - - v.Rotation = Get32(buf[b:]) - b += 4 - - v.ButtonThreshold = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputDeviceAbsCalibCtl -func ReadXinputDeviceAbsCalibCtlList(buf []byte, dest []XinputDeviceAbsCalibCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceAbsCalibCtl{} - b += ReadXinputDeviceAbsCalibCtl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceAbsCalibCtl -func (v XinputDeviceAbsCalibCtl) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], uint32(v.MinX)) - b += 4 - - Put32(buf[b:], uint32(v.MaxX)) - b += 4 - - Put32(buf[b:], uint32(v.MinY)) - b += 4 - - Put32(buf[b:], uint32(v.MaxY)) - b += 4 - - Put32(buf[b:], v.FlipX) - b += 4 - - Put32(buf[b:], v.FlipY) - b += 4 - - Put32(buf[b:], v.Rotation) - b += 4 - - Put32(buf[b:], v.ButtonThreshold) - b += 4 - - return buf -} - -// Write struct list XinputDeviceAbsCalibCtl -func XinputDeviceAbsCalibCtlListBytes(buf []byte, list []XinputDeviceAbsCalibCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceAbsAreaCtrl' struct definition -// Size: 28 -type XinputDeviceAbsAreaCtrl struct { - ControlId uint16 - Len uint16 - OffsetX uint32 - OffsetY uint32 - Width int32 - Height int32 - Screen int32 - Following uint32 -} - -// Struct read XinputDeviceAbsAreaCtrl -func ReadXinputDeviceAbsAreaCtrl(buf []byte, v *XinputDeviceAbsAreaCtrl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.OffsetX = Get32(buf[b:]) - b += 4 - - v.OffsetY = Get32(buf[b:]) - b += 4 - - v.Width = int32(Get32(buf[b:])) - b += 4 - - v.Height = int32(Get32(buf[b:])) - b += 4 - - v.Screen = int32(Get32(buf[b:])) - b += 4 - - v.Following = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XinputDeviceAbsAreaCtrl -func ReadXinputDeviceAbsAreaCtrlList(buf []byte, dest []XinputDeviceAbsAreaCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceAbsAreaCtrl{} - b += ReadXinputDeviceAbsAreaCtrl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceAbsAreaCtrl -func (v XinputDeviceAbsAreaCtrl) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - Put32(buf[b:], v.OffsetX) - b += 4 - - Put32(buf[b:], v.OffsetY) - b += 4 - - Put32(buf[b:], uint32(v.Width)) - b += 4 - - Put32(buf[b:], uint32(v.Height)) - b += 4 - - Put32(buf[b:], uint32(v.Screen)) - b += 4 - - Put32(buf[b:], v.Following) - b += 4 - - return buf -} - -// Write struct list XinputDeviceAbsAreaCtrl -func XinputDeviceAbsAreaCtrlListBytes(buf []byte, list []XinputDeviceAbsAreaCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceCoreCtrl' struct definition -// Size: 8 -type XinputDeviceCoreCtrl struct { - ControlId uint16 - Len uint16 - Status byte - // padding: 3 bytes -} - -// Struct read XinputDeviceCoreCtrl -func ReadXinputDeviceCoreCtrl(buf []byte, v *XinputDeviceCoreCtrl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Status = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// Struct list read XinputDeviceCoreCtrl -func ReadXinputDeviceCoreCtrlList(buf []byte, dest []XinputDeviceCoreCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceCoreCtrl{} - b += ReadXinputDeviceCoreCtrl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceCoreCtrl -func (v XinputDeviceCoreCtrl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Status - b += 1 - - b += 3 // padding - - return buf -} - -// Write struct list XinputDeviceCoreCtrl -func XinputDeviceCoreCtrlListBytes(buf []byte, list []XinputDeviceCoreCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XinputDeviceEnableCtrl' struct definition -// Size: 8 -type XinputDeviceEnableCtrl struct { - ControlId uint16 - Len uint16 - Enable byte - // padding: 3 bytes -} - -// Struct read XinputDeviceEnableCtrl -func ReadXinputDeviceEnableCtrl(buf []byte, v *XinputDeviceEnableCtrl) int { - b := 0 - - v.ControlId = Get16(buf[b:]) - b += 2 - - v.Len = Get16(buf[b:]) - b += 2 - - v.Enable = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// Struct list read XinputDeviceEnableCtrl -func ReadXinputDeviceEnableCtrlList(buf []byte, dest []XinputDeviceEnableCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XinputDeviceEnableCtrl{} - b += ReadXinputDeviceEnableCtrl(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XinputDeviceEnableCtrl -func (v XinputDeviceEnableCtrl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put16(buf[b:], v.ControlId) - b += 2 - - Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Enable - b += 1 - - b += 3 // padding - - return buf -} - -// Write struct list XinputDeviceEnableCtrl -func XinputDeviceEnableCtrlListBytes(buf []byte, list []XinputDeviceEnableCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Event definition XinputDeviceValuator (0) -// Size: 32 - -const XinputDeviceValuator = 0 - -type XinputDeviceValuatorEvent struct { - Sequence uint16 - DeviceId byte - DeviceState uint16 - NumValuators byte - FirstValuator byte - Valuators []int32 // size: 24 -} - -// Event read XinputDeviceValuator -func NewXinputDeviceValuatorEvent(buf []byte) Event { - v := XinputDeviceValuatorEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.DeviceState = Get16(buf[b:]) - b += 2 - - v.NumValuators = buf[b] - b += 1 - - v.FirstValuator = buf[b] - b += 1 - - v.Valuators = make([]int32, 6) - for i := 0; i < int(6); i++ { - v.Valuators[i] = int32(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -// Event write XinputDeviceValuator -func (v XinputDeviceValuatorEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - Put16(buf[b:], v.DeviceState) - b += 2 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.FirstValuator - b += 1 - - for i := 0; i < int(6); i++ { - Put32(buf[b:], uint32(v.Valuators[i])) - b += 4 - } - b = pad(b) - - return buf -} - -func (v XinputDeviceValuatorEvent) ImplementsEvent() {} - -func (v XinputDeviceValuatorEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceValuatorEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, sprintf("DeviceState: %d", v.DeviceState)) - fieldVals = append(fieldVals, sprintf("NumValuators: %d", v.NumValuators)) - fieldVals = append(fieldVals, sprintf("FirstValuator: %d", v.FirstValuator)) - return "XinputDeviceValuator {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][0] = NewXinputDeviceValuatorEvent -} - -// Event definition XinputDeviceKeyPress (1) -// Size: 32 - -const XinputDeviceKeyPress = 1 - -type XinputDeviceKeyPressEvent struct { - Sequence uint16 - Detail byte - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - SameScreen bool - DeviceId byte -} - -// Event read XinputDeviceKeyPress -func NewXinputDeviceKeyPressEvent(buf []byte) Event { - v := XinputDeviceKeyPressEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - v.Event = Window(Get32(buf[b:])) - b += 4 - - v.Child = Window(Get32(buf[b:])) - b += 4 - - v.RootX = int16(Get16(buf[b:])) - b += 2 - - v.RootY = int16(Get16(buf[b:])) - b += 2 - - v.EventX = int16(Get16(buf[b:])) - b += 2 - - v.EventY = int16(Get16(buf[b:])) - b += 2 - - v.State = Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false - } - b += 1 - - v.DeviceId = buf[b] - b += 1 - - return v -} - -// Event write XinputDeviceKeyPress -func (v XinputDeviceKeyPressEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - Put32(buf[b:], uint32(v.Root)) - b += 4 - - Put32(buf[b:], uint32(v.Event)) - b += 4 - - Put32(buf[b:], uint32(v.Child)) - b += 4 - - Put16(buf[b:], uint16(v.RootX)) - b += 2 - - Put16(buf[b:], uint16(v.RootY)) - b += 2 - - Put16(buf[b:], uint16(v.EventX)) - b += 2 - - Put16(buf[b:], uint16(v.EventY)) - b += 2 - - Put16(buf[b:], v.State) - b += 2 - - if v.SameScreen { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = v.DeviceId - b += 1 - - return buf -} - -func (v XinputDeviceKeyPressEvent) ImplementsEvent() {} - -func (v XinputDeviceKeyPressEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceKeyPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceKeyPress {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][1] = NewXinputDeviceKeyPressEvent -} - -// Event definition XinputFocusIn (6) -// Size: 32 - -const XinputFocusIn = 6 - -type XinputFocusInEvent struct { - Sequence uint16 - Detail byte - Time Timestamp - Window Window - Mode byte - DeviceId byte - // padding: 18 bytes -} - -// Event read XinputFocusIn -func NewXinputFocusInEvent(buf []byte) Event { - v := XinputFocusInEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Window = Window(Get32(buf[b:])) - b += 4 - - v.Mode = buf[b] - b += 1 - - v.DeviceId = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -// Event write XinputFocusIn -func (v XinputFocusInEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 6 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - Put32(buf[b:], uint32(v.Window)) - b += 4 - - buf[b] = v.Mode - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 18 // padding - - return buf -} - -func (v XinputFocusInEvent) ImplementsEvent() {} - -func (v XinputFocusInEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputFocusInEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputFocusIn {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][6] = NewXinputFocusInEvent -} - -// Event definition XinputDeviceStateNotify (10) -// Size: 32 - -const XinputDeviceStateNotify = 10 - -type XinputDeviceStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Time Timestamp - NumKeys byte - NumButtons byte - NumValuators byte - ClassesReported byte - Buttons []byte // size: 4 - Keys []byte // size: 4 - Valuators []uint32 // size: 12 -} - -// Event read XinputDeviceStateNotify -func NewXinputDeviceStateNotifyEvent(buf []byte) Event { - v := XinputDeviceStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.NumKeys = buf[b] - b += 1 - - v.NumButtons = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.ClassesReported = buf[b] - b += 1 - - v.Buttons = make([]byte, 4) - copy(v.Buttons[:4], buf[b:]) - b += pad(int(4)) - - v.Keys = make([]byte, 4) - copy(v.Keys[:4], buf[b:]) - b += pad(int(4)) - - v.Valuators = make([]uint32, 3) - for i := 0; i < int(3); i++ { - v.Valuators[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -// Event write XinputDeviceStateNotify -func (v XinputDeviceStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 10 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.NumKeys - b += 1 - - buf[b] = v.NumButtons - b += 1 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.ClassesReported - b += 1 - - copy(buf[b:], v.Buttons[:4]) - b += pad(int(4)) - - copy(buf[b:], v.Keys[:4]) - b += pad(int(4)) - - for i := 0; i < int(3); i++ { - Put32(buf[b:], v.Valuators[i]) - b += 4 - } - b = pad(b) - - return buf -} - -func (v XinputDeviceStateNotifyEvent) ImplementsEvent() {} - -func (v XinputDeviceStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 9) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("NumKeys: %d", v.NumKeys)) - fieldVals = append(fieldVals, sprintf("NumButtons: %d", v.NumButtons)) - fieldVals = append(fieldVals, sprintf("NumValuators: %d", v.NumValuators)) - fieldVals = append(fieldVals, sprintf("ClassesReported: %d", v.ClassesReported)) - return "XinputDeviceStateNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][10] = NewXinputDeviceStateNotifyEvent -} - -// Event definition XinputDeviceMappingNotify (11) -// Size: 32 - -const XinputDeviceMappingNotify = 11 - -type XinputDeviceMappingNotifyEvent struct { - Sequence uint16 - DeviceId byte - Request byte - FirstKeycode XinputKeyCode - Count byte - // padding: 1 bytes - Time Timestamp - // padding: 20 bytes -} - -// Event read XinputDeviceMappingNotify -func NewXinputDeviceMappingNotifyEvent(buf []byte) Event { - v := XinputDeviceMappingNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Request = buf[b] - b += 1 - - v.FirstKeycode = XinputKeyCode(buf[b]) - b += 1 - - v.Count = buf[b] - b += 1 - - b += 1 // padding - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -// Event write XinputDeviceMappingNotify -func (v XinputDeviceMappingNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 11 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - buf[b] = v.Request - b += 1 - - buf[b] = byte(v.FirstKeycode) - b += 1 - - buf[b] = v.Count - b += 1 - - b += 1 // padding - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - b += 20 // padding - - return buf -} - -func (v XinputDeviceMappingNotifyEvent) ImplementsEvent() {} - -func (v XinputDeviceMappingNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceMappingNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) - fieldVals = append(fieldVals, sprintf("FirstKeycode: %d", v.FirstKeycode)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - return "XinputDeviceMappingNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][11] = NewXinputDeviceMappingNotifyEvent -} - -// Event definition XinputChangeDeviceNotify (12) -// Size: 32 - -const XinputChangeDeviceNotify = 12 - -type XinputChangeDeviceNotifyEvent struct { - Sequence uint16 - DeviceId byte - Time Timestamp - Request byte - // padding: 23 bytes -} - -// Event read XinputChangeDeviceNotify -func NewXinputChangeDeviceNotifyEvent(buf []byte) Event { - v := XinputChangeDeviceNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Request = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Event write XinputChangeDeviceNotify -func (v XinputChangeDeviceNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 12 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.Request - b += 1 - - b += 23 // padding - - return buf -} - -func (v XinputChangeDeviceNotifyEvent) ImplementsEvent() {} - -func (v XinputChangeDeviceNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputChangeDeviceNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) - return "XinputChangeDeviceNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][12] = NewXinputChangeDeviceNotifyEvent -} - -// Event definition XinputDeviceKeyStateNotify (13) -// Size: 32 - -const XinputDeviceKeyStateNotify = 13 - -type XinputDeviceKeyStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Keys []byte // size: 28 -} - -// Event read XinputDeviceKeyStateNotify -func NewXinputDeviceKeyStateNotifyEvent(buf []byte) Event { - v := XinputDeviceKeyStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Keys = make([]byte, 28) - copy(v.Keys[:28], buf[b:]) - b += pad(int(28)) - - return v -} - -// Event write XinputDeviceKeyStateNotify -func (v XinputDeviceKeyStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 13 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Keys[:28]) - b += pad(int(28)) - - return buf -} - -func (v XinputDeviceKeyStateNotifyEvent) ImplementsEvent() {} - -func (v XinputDeviceKeyStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceKeyStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceKeyStateNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][13] = NewXinputDeviceKeyStateNotifyEvent -} - -// Event definition XinputDeviceButtonStateNotify (14) -// Size: 32 - -const XinputDeviceButtonStateNotify = 14 - -type XinputDeviceButtonStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Buttons []byte // size: 28 -} - -// Event read XinputDeviceButtonStateNotify -func NewXinputDeviceButtonStateNotifyEvent(buf []byte) Event { - v := XinputDeviceButtonStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Buttons = make([]byte, 28) - copy(v.Buttons[:28], buf[b:]) - b += pad(int(28)) - - return v -} - -// Event write XinputDeviceButtonStateNotify -func (v XinputDeviceButtonStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 14 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Buttons[:28]) - b += pad(int(28)) - - return buf -} - -func (v XinputDeviceButtonStateNotifyEvent) ImplementsEvent() {} - -func (v XinputDeviceButtonStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceButtonStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceButtonStateNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][14] = NewXinputDeviceButtonStateNotifyEvent -} - -// Event definition XinputDevicePresenceNotify (15) -// Size: 32 - -const XinputDevicePresenceNotify = 15 - -type XinputDevicePresenceNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Time Timestamp - Devchange byte - DeviceId byte - Control uint16 - // padding: 20 bytes -} - -// Event read XinputDevicePresenceNotify -func NewXinputDevicePresenceNotifyEvent(buf []byte) Event { - v := XinputDevicePresenceNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Devchange = buf[b] - b += 1 - - v.DeviceId = buf[b] - b += 1 - - v.Control = Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -// Event write XinputDevicePresenceNotify -func (v XinputDevicePresenceNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 15 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.Devchange - b += 1 - - buf[b] = v.DeviceId - b += 1 - - Put16(buf[b:], v.Control) - b += 2 - - b += 20 // padding - - return buf -} - -func (v XinputDevicePresenceNotifyEvent) ImplementsEvent() {} - -func (v XinputDevicePresenceNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDevicePresenceNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Devchange: %d", v.Devchange)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, sprintf("Control: %d", v.Control)) - return "XinputDevicePresenceNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][15] = NewXinputDevicePresenceNotifyEvent -} - -// EventCopy definition XinputDeviceKeyRelease (2) - -const XinputDeviceKeyRelease = 2 - -type XinputDeviceKeyReleaseEvent XinputDeviceKeyPressEvent - -func NewXinputDeviceKeyReleaseEvent(buf []byte) Event { - return XinputDeviceKeyReleaseEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputDeviceKeyReleaseEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputDeviceKeyReleaseEvent) ImplementsEvent() {} - -func (v XinputDeviceKeyReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceKeyReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceKeyRelease {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][2] = NewXinputDeviceKeyReleaseEvent -} - -// EventCopy definition XinputDeviceButtonPress (3) - -const XinputDeviceButtonPress = 3 - -type XinputDeviceButtonPressEvent XinputDeviceKeyPressEvent - -func NewXinputDeviceButtonPressEvent(buf []byte) Event { - return XinputDeviceButtonPressEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputDeviceButtonPressEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputDeviceButtonPressEvent) ImplementsEvent() {} - -func (v XinputDeviceButtonPressEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceButtonPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceButtonPress {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][3] = NewXinputDeviceButtonPressEvent -} - -// EventCopy definition XinputDeviceButtonRelease (4) - -const XinputDeviceButtonRelease = 4 - -type XinputDeviceButtonReleaseEvent XinputDeviceKeyPressEvent - -func NewXinputDeviceButtonReleaseEvent(buf []byte) Event { - return XinputDeviceButtonReleaseEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputDeviceButtonReleaseEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputDeviceButtonReleaseEvent) ImplementsEvent() {} - -func (v XinputDeviceButtonReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceButtonReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceButtonRelease {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][4] = NewXinputDeviceButtonReleaseEvent -} - -// EventCopy definition XinputDeviceMotionNotify (5) - -const XinputDeviceMotionNotify = 5 - -type XinputDeviceMotionNotifyEvent XinputDeviceKeyPressEvent - -func NewXinputDeviceMotionNotifyEvent(buf []byte) Event { - return XinputDeviceMotionNotifyEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputDeviceMotionNotifyEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputDeviceMotionNotifyEvent) ImplementsEvent() {} - -func (v XinputDeviceMotionNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputDeviceMotionNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputDeviceMotionNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][5] = NewXinputDeviceMotionNotifyEvent -} - -// EventCopy definition XinputProximityIn (8) - -const XinputProximityIn = 8 - -type XinputProximityInEvent XinputDeviceKeyPressEvent - -func NewXinputProximityInEvent(buf []byte) Event { - return XinputProximityInEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputProximityInEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputProximityInEvent) ImplementsEvent() {} - -func (v XinputProximityInEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputProximityInEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputProximityIn {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][8] = NewXinputProximityInEvent -} - -// EventCopy definition XinputProximityOut (9) - -const XinputProximityOut = 9 - -type XinputProximityOutEvent XinputDeviceKeyPressEvent - -func NewXinputProximityOutEvent(buf []byte) Event { - return XinputProximityOutEvent(NewXinputDeviceKeyPressEvent(buf).(XinputDeviceKeyPressEvent)) -} - -func (v XinputProximityOutEvent) Bytes() []byte { - return XinputDeviceKeyPressEvent(v).Bytes() -} - -func (v XinputProximityOutEvent) ImplementsEvent() {} - -func (v XinputProximityOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputProximityOutEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputProximityOut {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][9] = NewXinputProximityOutEvent -} - -// EventCopy definition XinputFocusOut (7) - -const XinputFocusOut = 7 - -type XinputFocusOutEvent XinputFocusInEvent - -func NewXinputFocusOutEvent(buf []byte) Event { - return XinputFocusOutEvent(NewXinputFocusInEvent(buf).(XinputFocusInEvent)) -} - -func (v XinputFocusOutEvent) Bytes() []byte { - return XinputFocusInEvent(v).Bytes() -} - -func (v XinputFocusOutEvent) ImplementsEvent() {} - -func (v XinputFocusOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XinputFocusOutEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, sprintf("DeviceId: %d", v.DeviceId)) - return "XinputFocusOut {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XInputExtension"][7] = NewXinputFocusOutEvent -} - -// Error definition XinputDevice (0) -// Size: 32 - -const BadXinputDevice = 0 - -type XinputDeviceError struct { - Sequence uint16 - NiceName string -} - -// Error read XinputDevice -func NewXinputDeviceError(buf []byte) Error { - v := XinputDeviceError{} - v.NiceName = "XinputDevice" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XinputDeviceError) ImplementsError() {} - -func (err XinputDeviceError) SequenceId() uint16 { - return err.Sequence -} - -func (err XinputDeviceError) BadId() uint32 { - return 0 -} - -func (err XinputDeviceError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXinputDevice {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XInputExtension"][0] = NewXinputDeviceError -} - -// Error definition XinputEvent (1) -// Size: 32 - -const BadXinputEvent = 1 - -type XinputEventError struct { - Sequence uint16 - NiceName string -} - -// Error read XinputEvent -func NewXinputEventError(buf []byte) Error { - v := XinputEventError{} - v.NiceName = "XinputEvent" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XinputEventError) ImplementsError() {} - -func (err XinputEventError) SequenceId() uint16 { - return err.Sequence -} - -func (err XinputEventError) BadId() uint32 { - return 0 -} - -func (err XinputEventError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXinputEvent {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XInputExtension"][1] = NewXinputEventError -} - -// Error definition XinputMode (2) -// Size: 32 - -const BadXinputMode = 2 - -type XinputModeError struct { - Sequence uint16 - NiceName string -} - -// Error read XinputMode -func NewXinputModeError(buf []byte) Error { - v := XinputModeError{} - v.NiceName = "XinputMode" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XinputModeError) ImplementsError() {} - -func (err XinputModeError) SequenceId() uint16 { - return err.Sequence -} - -func (err XinputModeError) BadId() uint32 { - return 0 -} - -func (err XinputModeError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXinputMode {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XInputExtension"][2] = NewXinputModeError -} - -// Error definition XinputDeviceBusy (3) -// Size: 32 - -const BadXinputDeviceBusy = 3 - -type XinputDeviceBusyError struct { - Sequence uint16 - NiceName string -} - -// Error read XinputDeviceBusy -func NewXinputDeviceBusyError(buf []byte) Error { - v := XinputDeviceBusyError{} - v.NiceName = "XinputDeviceBusy" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XinputDeviceBusyError) ImplementsError() {} - -func (err XinputDeviceBusyError) SequenceId() uint16 { - return err.Sequence -} - -func (err XinputDeviceBusyError) BadId() uint32 { - return 0 -} - -func (err XinputDeviceBusyError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXinputDeviceBusy {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XInputExtension"][3] = NewXinputDeviceBusyError -} - -// Error definition XinputClass (4) -// Size: 32 - -const BadXinputClass = 4 - -type XinputClassError struct { - Sequence uint16 - NiceName string -} - -// Error read XinputClass -func NewXinputClassError(buf []byte) Error { - v := XinputClassError{} - v.NiceName = "XinputClass" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XinputClassError) ImplementsError() {} - -func (err XinputClassError) SequenceId() uint16 { - return err.Sequence -} - -func (err XinputClassError) BadId() uint32 { - return 0 -} - -func (err XinputClassError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXinputClass {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XInputExtension"][4] = NewXinputClassError -} - -// Request XinputGetExtensionVersion -// size: pad((8 + pad((int(NameLen) * 1)))) -type XinputGetExtensionVersionCookie struct { - *cookie -} - -func (c *Conn) XinputGetExtensionVersion(NameLen uint16, Name string) XinputGetExtensionVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetExtensionVersionRequest(NameLen, Name), cookie) - return XinputGetExtensionVersionCookie{cookie} -} - -func (c *Conn) XinputGetExtensionVersionUnchecked(NameLen uint16, Name string) XinputGetExtensionVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetExtensionVersionRequest(NameLen, Name), cookie) - return XinputGetExtensionVersionCookie{cookie} -} - -// Request reply for XinputGetExtensionVersion -// size: 32 -type XinputGetExtensionVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 - Present bool - // padding: 19 bytes -} - -// Waits and reads reply data from request XinputGetExtensionVersion -func (cook XinputGetExtensionVersionCookie) Reply() (*XinputGetExtensionVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetExtensionVersionReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetExtensionVersion -func xinputGetExtensionVersionReply(buf []byte) *XinputGetExtensionVersionReply { - v := new(XinputGetExtensionVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = Get16(buf[b:]) - b += 2 - - v.ServerMinor = Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Present = true - } else { - v.Present = false - } - b += 1 - - b += 19 // padding - - return v -} - -func (cook XinputGetExtensionVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetExtensionVersion -func (c *Conn) xinputGetExtensionVersionRequest(NameLen uint16, Name string) []byte { - size := pad((8 + pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) - - return buf -} - -// Request XinputListInputDevices -// size: 4 -type XinputListInputDevicesCookie struct { - *cookie -} - -func (c *Conn) XinputListInputDevices() XinputListInputDevicesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputListInputDevicesRequest(), cookie) - return XinputListInputDevicesCookie{cookie} -} - -func (c *Conn) XinputListInputDevicesUnchecked() XinputListInputDevicesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputListInputDevicesRequest(), cookie) - return XinputListInputDevicesCookie{cookie} -} - -// Request reply for XinputListInputDevices -// size: (32 + pad((int(DevicesLen) * 8))) -type XinputListInputDevicesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - DevicesLen byte - // padding: 23 bytes - Devices []XinputDeviceInfo // size: pad((int(DevicesLen) * 8)) -} - -// Waits and reads reply data from request XinputListInputDevices -func (cook XinputListInputDevicesCookie) Reply() (*XinputListInputDevicesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputListInputDevicesReply(buf), nil -} - -// Read reply into structure from buffer for XinputListInputDevices -func xinputListInputDevicesReply(buf []byte) *XinputListInputDevicesReply { - v := new(XinputListInputDevicesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.DevicesLen = buf[b] - b += 1 - - b += 23 // padding - - v.Devices = make([]XinputDeviceInfo, v.DevicesLen) - b += ReadXinputDeviceInfoList(buf[b:], v.Devices) - - return v -} - -func (cook XinputListInputDevicesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputListInputDevices -func (c *Conn) xinputListInputDevicesRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XinputOpenDevice -// size: 8 -type XinputOpenDeviceCookie struct { - *cookie -} - -func (c *Conn) XinputOpenDevice(DeviceId byte) XinputOpenDeviceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputOpenDeviceRequest(DeviceId), cookie) - return XinputOpenDeviceCookie{cookie} -} - -func (c *Conn) XinputOpenDeviceUnchecked(DeviceId byte) XinputOpenDeviceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputOpenDeviceRequest(DeviceId), cookie) - return XinputOpenDeviceCookie{cookie} -} - -// Request reply for XinputOpenDevice -// size: (32 + pad((int(NumClasses) * 2))) -type XinputOpenDeviceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumClasses byte - // padding: 23 bytes - ClassInfo []XinputInputClassInfo // size: pad((int(NumClasses) * 2)) -} - -// Waits and reads reply data from request XinputOpenDevice -func (cook XinputOpenDeviceCookie) Reply() (*XinputOpenDeviceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputOpenDeviceReply(buf), nil -} - -// Read reply into structure from buffer for XinputOpenDevice -func xinputOpenDeviceReply(buf []byte) *XinputOpenDeviceReply { - v := new(XinputOpenDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = buf[b] - b += 1 - - b += 23 // padding - - v.ClassInfo = make([]XinputInputClassInfo, v.NumClasses) - b += ReadXinputInputClassInfoList(buf[b:], v.ClassInfo) - - return v -} - -func (cook XinputOpenDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputOpenDevice -func (c *Conn) xinputOpenDeviceRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputCloseDevice -// size: 8 -type XinputCloseDeviceCookie struct { - *cookie -} - -// Write request to wire for XinputCloseDevice -func (c *Conn) XinputCloseDevice(DeviceId byte) XinputCloseDeviceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputCloseDeviceRequest(DeviceId), cookie) - return XinputCloseDeviceCookie{cookie} -} - -func (c *Conn) XinputCloseDeviceChecked(DeviceId byte) XinputCloseDeviceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputCloseDeviceRequest(DeviceId), cookie) - return XinputCloseDeviceCookie{cookie} -} - -func (cook XinputCloseDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputCloseDevice -func (c *Conn) xinputCloseDeviceRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputSetDeviceMode -// size: 8 -type XinputSetDeviceModeCookie struct { - *cookie -} - -func (c *Conn) XinputSetDeviceMode(DeviceId byte, Mode byte) XinputSetDeviceModeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputSetDeviceModeRequest(DeviceId, Mode), cookie) - return XinputSetDeviceModeCookie{cookie} -} - -func (c *Conn) XinputSetDeviceModeUnchecked(DeviceId byte, Mode byte) XinputSetDeviceModeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputSetDeviceModeRequest(DeviceId, Mode), cookie) - return XinputSetDeviceModeCookie{cookie} -} - -// Request reply for XinputSetDeviceMode -// size: 32 -type XinputSetDeviceModeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputSetDeviceMode -func (cook XinputSetDeviceModeCookie) Reply() (*XinputSetDeviceModeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputSetDeviceModeReply(buf), nil -} - -// Read reply into structure from buffer for XinputSetDeviceMode -func xinputSetDeviceModeReply(buf []byte) *XinputSetDeviceModeReply { - v := new(XinputSetDeviceModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputSetDeviceModeCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSetDeviceMode -func (c *Conn) xinputSetDeviceModeRequest(DeviceId byte, Mode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = Mode - b += 1 - - b += 2 // padding - - return buf -} - -// Request XinputSelectExtensionEvent -// size: pad((12 + pad((int(NumClasses) * 4)))) -type XinputSelectExtensionEventCookie struct { - *cookie -} - -// Write request to wire for XinputSelectExtensionEvent -func (c *Conn) XinputSelectExtensionEvent(Window Window, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) - return XinputSelectExtensionEventCookie{cookie} -} - -func (c *Conn) XinputSelectExtensionEventChecked(Window Window, NumClasses uint16, Classes []XinputEventClass) XinputSelectExtensionEventCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputSelectExtensionEventRequest(Window, NumClasses, Classes), cookie) - return XinputSelectExtensionEventCookie{cookie} -} - -func (cook XinputSelectExtensionEventCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSelectExtensionEvent -func (c *Conn) xinputSelectExtensionEventRequest(Window Window, NumClasses uint16, Classes []XinputEventClass) []byte { - size := pad((12 + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put16(buf[b:], NumClasses) - b += 2 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputGetSelectedExtensionEvents -// size: 8 -type XinputGetSelectedExtensionEventsCookie struct { - *cookie -} - -func (c *Conn) XinputGetSelectedExtensionEvents(Window Window) XinputGetSelectedExtensionEventsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) - return XinputGetSelectedExtensionEventsCookie{cookie} -} - -func (c *Conn) XinputGetSelectedExtensionEventsUnchecked(Window Window) XinputGetSelectedExtensionEventsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetSelectedExtensionEventsRequest(Window), cookie) - return XinputGetSelectedExtensionEventsCookie{cookie} -} - -// Request reply for XinputGetSelectedExtensionEvents -// size: ((32 + pad((int(NumThisClasses) * 4))) + pad((int(NumAllClasses) * 4))) -type XinputGetSelectedExtensionEventsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumThisClasses uint16 - NumAllClasses uint16 - // padding: 20 bytes - ThisClasses []XinputEventClass // size: pad((int(NumThisClasses) * 4)) - AllClasses []XinputEventClass // size: pad((int(NumAllClasses) * 4)) -} - -// Waits and reads reply data from request XinputGetSelectedExtensionEvents -func (cook XinputGetSelectedExtensionEventsCookie) Reply() (*XinputGetSelectedExtensionEventsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetSelectedExtensionEventsReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetSelectedExtensionEvents -func xinputGetSelectedExtensionEventsReply(buf []byte) *XinputGetSelectedExtensionEventsReply { - v := new(XinputGetSelectedExtensionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumThisClasses = Get16(buf[b:]) - b += 2 - - v.NumAllClasses = Get16(buf[b:]) - b += 2 - - b += 20 // padding - - v.ThisClasses = make([]XinputEventClass, v.NumThisClasses) - for i := 0; i < int(v.NumThisClasses); i++ { - v.ThisClasses[i] = XinputEventClass(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - v.AllClasses = make([]XinputEventClass, v.NumAllClasses) - for i := 0; i < int(v.NumAllClasses); i++ { - v.AllClasses[i] = XinputEventClass(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XinputGetSelectedExtensionEventsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetSelectedExtensionEvents -func (c *Conn) xinputGetSelectedExtensionEventsRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XinputChangeDeviceDontPropagateList -// size: pad((12 + pad((int(NumClasses) * 4)))) -type XinputChangeDeviceDontPropagateListCookie struct { - *cookie -} - -// Write request to wire for XinputChangeDeviceDontPropagateList -func (c *Conn) XinputChangeDeviceDontPropagateList(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) - return XinputChangeDeviceDontPropagateListCookie{cookie} -} - -func (c *Conn) XinputChangeDeviceDontPropagateListChecked(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) XinputChangeDeviceDontPropagateListCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputChangeDeviceDontPropagateListRequest(Window, NumClasses, Mode, Classes), cookie) - return XinputChangeDeviceDontPropagateListCookie{cookie} -} - -func (cook XinputChangeDeviceDontPropagateListCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputChangeDeviceDontPropagateList -func (c *Conn) xinputChangeDeviceDontPropagateListRequest(Window Window, NumClasses uint16, Mode byte, Classes []XinputEventClass) []byte { - size := pad((12 + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = Mode - b += 1 - - b += 1 // padding - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputGetDeviceDontPropagateList -// size: 8 -type XinputGetDeviceDontPropagateListCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceDontPropagateList(Window Window) XinputGetDeviceDontPropagateListCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) - return XinputGetDeviceDontPropagateListCookie{cookie} -} - -func (c *Conn) XinputGetDeviceDontPropagateListUnchecked(Window Window) XinputGetDeviceDontPropagateListCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceDontPropagateListRequest(Window), cookie) - return XinputGetDeviceDontPropagateListCookie{cookie} -} - -// Request reply for XinputGetDeviceDontPropagateList -// size: (32 + pad((int(NumClasses) * 4))) -type XinputGetDeviceDontPropagateListReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumClasses uint16 - // padding: 22 bytes - Classes []XinputEventClass // size: pad((int(NumClasses) * 4)) -} - -// Waits and reads reply data from request XinputGetDeviceDontPropagateList -func (cook XinputGetDeviceDontPropagateListCookie) Reply() (*XinputGetDeviceDontPropagateListReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceDontPropagateListReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceDontPropagateList -func xinputGetDeviceDontPropagateListReply(buf []byte) *XinputGetDeviceDontPropagateListReply { - v := new(XinputGetDeviceDontPropagateListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Classes = make([]XinputEventClass, v.NumClasses) - for i := 0; i < int(v.NumClasses); i++ { - v.Classes[i] = XinputEventClass(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XinputGetDeviceDontPropagateListCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceDontPropagateList -func (c *Conn) xinputGetDeviceDontPropagateListRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XinputGetDeviceMotionEvents -// size: 16 -type XinputGetDeviceMotionEventsCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceMotionEvents(Start Timestamp, Stop Timestamp, DeviceId byte) XinputGetDeviceMotionEventsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceMotionEventsRequest(Start, Stop, DeviceId), cookie) - return XinputGetDeviceMotionEventsCookie{cookie} -} - -func (c *Conn) XinputGetDeviceMotionEventsUnchecked(Start Timestamp, Stop Timestamp, DeviceId byte) XinputGetDeviceMotionEventsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceMotionEventsRequest(Start, Stop, DeviceId), cookie) - return XinputGetDeviceMotionEventsCookie{cookie} -} - -// Request reply for XinputGetDeviceMotionEvents -// size: 32 -type XinputGetDeviceMotionEventsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumCoords uint32 - NumAxes byte - DeviceMode byte - // padding: 18 bytes -} - -// Waits and reads reply data from request XinputGetDeviceMotionEvents -func (cook XinputGetDeviceMotionEventsCookie) Reply() (*XinputGetDeviceMotionEventsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceMotionEventsReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceMotionEvents -func xinputGetDeviceMotionEventsReply(buf []byte) *XinputGetDeviceMotionEventsReply { - v := new(XinputGetDeviceMotionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumCoords = Get32(buf[b:]) - b += 4 - - v.NumAxes = buf[b] - b += 1 - - v.DeviceMode = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -func (cook XinputGetDeviceMotionEventsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceMotionEvents -func (c *Conn) xinputGetDeviceMotionEventsRequest(Start Timestamp, Stop Timestamp, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Start)) - b += 4 - - Put32(buf[b:], uint32(Stop)) - b += 4 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// Request XinputChangeKeyboardDevice -// size: 8 -type XinputChangeKeyboardDeviceCookie struct { - *cookie -} - -func (c *Conn) XinputChangeKeyboardDevice(DeviceId byte) XinputChangeKeyboardDeviceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputChangeKeyboardDeviceRequest(DeviceId), cookie) - return XinputChangeKeyboardDeviceCookie{cookie} -} - -func (c *Conn) XinputChangeKeyboardDeviceUnchecked(DeviceId byte) XinputChangeKeyboardDeviceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputChangeKeyboardDeviceRequest(DeviceId), cookie) - return XinputChangeKeyboardDeviceCookie{cookie} -} - -// Request reply for XinputChangeKeyboardDevice -// size: 32 -type XinputChangeKeyboardDeviceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputChangeKeyboardDevice -func (cook XinputChangeKeyboardDeviceCookie) Reply() (*XinputChangeKeyboardDeviceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputChangeKeyboardDeviceReply(buf), nil -} - -// Read reply into structure from buffer for XinputChangeKeyboardDevice -func xinputChangeKeyboardDeviceReply(buf []byte) *XinputChangeKeyboardDeviceReply { - v := new(XinputChangeKeyboardDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputChangeKeyboardDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputChangeKeyboardDevice -func (c *Conn) xinputChangeKeyboardDeviceRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputChangePointerDevice -// size: 8 -type XinputChangePointerDeviceCookie struct { - *cookie -} - -func (c *Conn) XinputChangePointerDevice(XAxis byte, YAxis byte, DeviceId byte) XinputChangePointerDeviceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputChangePointerDeviceRequest(XAxis, YAxis, DeviceId), cookie) - return XinputChangePointerDeviceCookie{cookie} -} - -func (c *Conn) XinputChangePointerDeviceUnchecked(XAxis byte, YAxis byte, DeviceId byte) XinputChangePointerDeviceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputChangePointerDeviceRequest(XAxis, YAxis, DeviceId), cookie) - return XinputChangePointerDeviceCookie{cookie} -} - -// Request reply for XinputChangePointerDevice -// size: 32 -type XinputChangePointerDeviceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputChangePointerDevice -func (cook XinputChangePointerDeviceCookie) Reply() (*XinputChangePointerDeviceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputChangePointerDeviceReply(buf), nil -} - -// Read reply into structure from buffer for XinputChangePointerDevice -func xinputChangePointerDeviceReply(buf []byte) *XinputChangePointerDeviceReply { - v := new(XinputChangePointerDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputChangePointerDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputChangePointerDevice -func (c *Conn) xinputChangePointerDeviceRequest(XAxis byte, YAxis byte, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = XAxis - b += 1 - - buf[b] = YAxis - b += 1 - - buf[b] = DeviceId - b += 1 - - b += 1 // padding - - return buf -} - -// Request XinputGrabDevice -// size: pad((20 + pad((int(NumClasses) * 4)))) -type XinputGrabDeviceCookie struct { - *cookie -} - -func (c *Conn) XinputGrabDevice(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) - return XinputGrabDeviceCookie{cookie} -} - -func (c *Conn) XinputGrabDeviceUnchecked(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) XinputGrabDeviceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGrabDeviceRequest(GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) - return XinputGrabDeviceCookie{cookie} -} - -// Request reply for XinputGrabDevice -// size: 32 -type XinputGrabDeviceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputGrabDevice -func (cook XinputGrabDeviceCookie) Reply() (*XinputGrabDeviceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGrabDeviceReply(buf), nil -} - -// Read reply into structure from buffer for XinputGrabDevice -func xinputGrabDeviceReply(buf []byte) *XinputGrabDeviceReply { - v := new(XinputGrabDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputGrabDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGrabDevice -func (c *Conn) xinputGrabDeviceRequest(GrabWindow Window, Time Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []XinputEventClass) []byte { - size := pad((20 + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - Put32(buf[b:], uint32(Time)) - b += 4 - - Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = DeviceId - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputUngrabDevice -// size: 12 -type XinputUngrabDeviceCookie struct { - *cookie -} - -// Write request to wire for XinputUngrabDevice -func (c *Conn) XinputUngrabDevice(Time Timestamp, DeviceId byte) XinputUngrabDeviceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputUngrabDeviceRequest(Time, DeviceId), cookie) - return XinputUngrabDeviceCookie{cookie} -} - -func (c *Conn) XinputUngrabDeviceChecked(Time Timestamp, DeviceId byte) XinputUngrabDeviceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputUngrabDeviceRequest(Time, DeviceId), cookie) - return XinputUngrabDeviceCookie{cookie} -} - -func (cook XinputUngrabDeviceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputUngrabDevice -func (c *Conn) xinputUngrabDeviceRequest(Time Timestamp, DeviceId byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// Request XinputGrabDeviceKey -// size: pad((20 + pad((int(NumClasses) * 4)))) -type XinputGrabDeviceKeyCookie struct { - *cookie -} - -// Write request to wire for XinputGrabDeviceKey -func (c *Conn) XinputGrabDeviceKey(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) - return XinputGrabDeviceKeyCookie{cookie} -} - -func (c *Conn) XinputGrabDeviceKeyChecked(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) XinputGrabDeviceKeyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputGrabDeviceKeyRequest(GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) - return XinputGrabDeviceKeyCookie{cookie} -} - -func (cook XinputGrabDeviceKeyCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGrabDeviceKey -func (c *Conn) xinputGrabDeviceKeyRequest(GrabWindow Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []XinputEventClass) []byte { - size := pad((20 + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - Put16(buf[b:], NumClasses) - b += 2 - - Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - buf[b] = Key - b += 1 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputUngrabDeviceKey -// size: 16 -type XinputUngrabDeviceKeyCookie struct { - *cookie -} - -// Write request to wire for XinputUngrabDeviceKey -func (c *Conn) XinputUngrabDeviceKey(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return XinputUngrabDeviceKeyCookie{cookie} -} - -func (c *Conn) XinputUngrabDeviceKeyChecked(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) XinputUngrabDeviceKeyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputUngrabDeviceKeyRequest(GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return XinputUngrabDeviceKeyCookie{cookie} -} - -func (cook XinputUngrabDeviceKeyCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputUngrabDeviceKey -func (c *Conn) xinputUngrabDeviceKeyRequest(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Key - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - return buf -} - -// Request XinputGrabDeviceButton -// size: pad((20 + pad((int(NumClasses) * 4)))) -type XinputGrabDeviceButtonCookie struct { - *cookie -} - -// Write request to wire for XinputGrabDeviceButton -func (c *Conn) XinputGrabDeviceButton(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return XinputGrabDeviceButtonCookie{cookie} -} - -func (c *Conn) XinputGrabDeviceButtonChecked(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) XinputGrabDeviceButtonCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputGrabDeviceButtonRequest(GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return XinputGrabDeviceButtonCookie{cookie} -} - -func (cook XinputGrabDeviceButtonCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGrabDeviceButton -func (c *Conn) xinputGrabDeviceButtonRequest(GrabWindow Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []XinputEventClass) []byte { - size := pad((20 + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - buf[b] = GrabbedDevice - b += 1 - - buf[b] = ModifierDevice - b += 1 - - Put16(buf[b:], NumClasses) - b += 2 - - Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = OwnerEvents - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputUngrabDeviceButton -// size: 16 -type XinputUngrabDeviceButtonCookie struct { - *cookie -} - -// Write request to wire for XinputUngrabDeviceButton -func (c *Conn) XinputUngrabDeviceButton(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return XinputUngrabDeviceButtonCookie{cookie} -} - -func (c *Conn) XinputUngrabDeviceButtonChecked(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) XinputUngrabDeviceButtonCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputUngrabDeviceButtonRequest(GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return XinputUngrabDeviceButtonCookie{cookie} -} - -func (cook XinputUngrabDeviceButtonCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputUngrabDeviceButton -func (c *Conn) xinputUngrabDeviceButtonRequest(GrabWindow Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - return buf -} - -// Request XinputAllowDeviceEvents -// size: 12 -type XinputAllowDeviceEventsCookie struct { - *cookie -} - -// Write request to wire for XinputAllowDeviceEvents -func (c *Conn) XinputAllowDeviceEvents(Time Timestamp, Mode byte, DeviceId byte) XinputAllowDeviceEventsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputAllowDeviceEventsRequest(Time, Mode, DeviceId), cookie) - return XinputAllowDeviceEventsCookie{cookie} -} - -func (c *Conn) XinputAllowDeviceEventsChecked(Time Timestamp, Mode byte, DeviceId byte) XinputAllowDeviceEventsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputAllowDeviceEventsRequest(Time, Mode, DeviceId), cookie) - return XinputAllowDeviceEventsCookie{cookie} -} - -func (cook XinputAllowDeviceEventsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputAllowDeviceEvents -func (c *Conn) xinputAllowDeviceEventsRequest(Time Timestamp, Mode byte, DeviceId byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = Mode - b += 1 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// Request XinputGetDeviceFocus -// size: 8 -type XinputGetDeviceFocusCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceFocus(DeviceId byte) XinputGetDeviceFocusCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceFocusRequest(DeviceId), cookie) - return XinputGetDeviceFocusCookie{cookie} -} - -func (c *Conn) XinputGetDeviceFocusUnchecked(DeviceId byte) XinputGetDeviceFocusCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceFocusRequest(DeviceId), cookie) - return XinputGetDeviceFocusCookie{cookie} -} - -// Request reply for XinputGetDeviceFocus -// size: 32 -type XinputGetDeviceFocusReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Focus Window - Time Timestamp - RevertTo byte - // padding: 15 bytes -} - -// Waits and reads reply data from request XinputGetDeviceFocus -func (cook XinputGetDeviceFocusCookie) Reply() (*XinputGetDeviceFocusReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceFocusReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceFocus -func xinputGetDeviceFocusReply(buf []byte) *XinputGetDeviceFocusReply { - v := new(XinputGetDeviceFocusReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Focus = Window(Get32(buf[b:])) - b += 4 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.RevertTo = buf[b] - b += 1 - - b += 15 // padding - - return v -} - -func (cook XinputGetDeviceFocusCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceFocus -func (c *Conn) xinputGetDeviceFocusRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputSetDeviceFocus -// size: 16 -type XinputSetDeviceFocusCookie struct { - *cookie -} - -// Write request to wire for XinputSetDeviceFocus -func (c *Conn) XinputSetDeviceFocus(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) - return XinputSetDeviceFocusCookie{cookie} -} - -func (c *Conn) XinputSetDeviceFocusChecked(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) XinputSetDeviceFocusCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputSetDeviceFocusRequest(Focus, Time, RevertTo, DeviceId), cookie) - return XinputSetDeviceFocusCookie{cookie} -} - -func (cook XinputSetDeviceFocusCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSetDeviceFocus -func (c *Conn) xinputSetDeviceFocusRequest(Focus Window, Time Timestamp, RevertTo byte, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Focus)) - b += 4 - - Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = RevertTo - b += 1 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// Request XinputGetFeedbackControl -// size: 8 -type XinputGetFeedbackControlCookie struct { - *cookie -} - -func (c *Conn) XinputGetFeedbackControl(DeviceId byte) XinputGetFeedbackControlCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetFeedbackControlRequest(DeviceId), cookie) - return XinputGetFeedbackControlCookie{cookie} -} - -func (c *Conn) XinputGetFeedbackControlUnchecked(DeviceId byte) XinputGetFeedbackControlCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetFeedbackControlRequest(DeviceId), cookie) - return XinputGetFeedbackControlCookie{cookie} -} - -// Request reply for XinputGetFeedbackControl -// size: 32 -type XinputGetFeedbackControlReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumFeedback uint16 - // padding: 22 bytes -} - -// Waits and reads reply data from request XinputGetFeedbackControl -func (cook XinputGetFeedbackControlCookie) Reply() (*XinputGetFeedbackControlReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetFeedbackControlReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetFeedbackControl -func xinputGetFeedbackControlReply(buf []byte) *XinputGetFeedbackControlReply { - v := new(XinputGetFeedbackControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFeedback = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -func (cook XinputGetFeedbackControlCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetFeedbackControl -func (c *Conn) xinputGetFeedbackControlRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputGetDeviceKeyMapping -// size: 8 -type XinputGetDeviceKeyMappingCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceKeyMapping(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) XinputGetDeviceKeyMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceKeyMappingRequest(DeviceId, FirstKeycode, Count), cookie) - return XinputGetDeviceKeyMappingCookie{cookie} -} - -func (c *Conn) XinputGetDeviceKeyMappingUnchecked(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) XinputGetDeviceKeyMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceKeyMappingRequest(DeviceId, FirstKeycode, Count), cookie) - return XinputGetDeviceKeyMappingCookie{cookie} -} - -// Request reply for XinputGetDeviceKeyMapping -// size: (32 + pad((int(Length) * 4))) -type XinputGetDeviceKeyMappingReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - KeysymsPerKeycode byte - // padding: 23 bytes - Keysyms []Keysym // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request XinputGetDeviceKeyMapping -func (cook XinputGetDeviceKeyMappingCookie) Reply() (*XinputGetDeviceKeyMappingReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceKeyMappingReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceKeyMapping -func xinputGetDeviceKeyMappingReply(buf []byte) *XinputGetDeviceKeyMappingReply { - v := new(XinputGetDeviceKeyMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeysymsPerKeycode = buf[b] - b += 1 - - b += 23 // padding - - v.Keysyms = make([]Keysym, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Keysyms[i] = Keysym(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XinputGetDeviceKeyMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceKeyMapping -func (c *Conn) xinputGetDeviceKeyMappingRequest(DeviceId byte, FirstKeycode XinputKeyCode, Count byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = Count - b += 1 - - return buf -} - -// Request XinputChangeDeviceKeyMapping -// size: pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) -type XinputChangeDeviceKeyMappingCookie struct { - *cookie -} - -// Write request to wire for XinputChangeDeviceKeyMapping -func (c *Conn) XinputChangeDeviceKeyMapping(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) XinputChangeDeviceKeyMappingCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputChangeDeviceKeyMappingRequest(DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return XinputChangeDeviceKeyMappingCookie{cookie} -} - -func (c *Conn) XinputChangeDeviceKeyMappingChecked(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) XinputChangeDeviceKeyMappingCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputChangeDeviceKeyMappingRequest(DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return XinputChangeDeviceKeyMappingCookie{cookie} -} - -func (cook XinputChangeDeviceKeyMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputChangeDeviceKeyMapping -func (c *Conn) xinputChangeDeviceKeyMappingRequest(DeviceId byte, FirstKeycode XinputKeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []Keysym) []byte { - size := pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = KeysymsPerKeycode - b += 1 - - buf[b] = KeycodeCount - b += 1 - - for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { - Put32(buf[b:], uint32(Keysyms[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputGetDeviceModifierMapping -// size: 8 -type XinputGetDeviceModifierMappingCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceModifierMapping(DeviceId byte) XinputGetDeviceModifierMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceModifierMappingRequest(DeviceId), cookie) - return XinputGetDeviceModifierMappingCookie{cookie} -} - -func (c *Conn) XinputGetDeviceModifierMappingUnchecked(DeviceId byte) XinputGetDeviceModifierMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceModifierMappingRequest(DeviceId), cookie) - return XinputGetDeviceModifierMappingCookie{cookie} -} - -// Request reply for XinputGetDeviceModifierMapping -// size: (32 + pad(((int(KeycodesPerModifier) * 8) * 1))) -type XinputGetDeviceModifierMappingReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - KeycodesPerModifier byte - // padding: 23 bytes - Keymaps []byte // size: pad(((int(KeycodesPerModifier) * 8) * 1)) -} - -// Waits and reads reply data from request XinputGetDeviceModifierMapping -func (cook XinputGetDeviceModifierMappingCookie) Reply() (*XinputGetDeviceModifierMappingReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceModifierMappingReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceModifierMapping -func xinputGetDeviceModifierMappingReply(buf []byte) *XinputGetDeviceModifierMappingReply { - v := new(XinputGetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeycodesPerModifier = buf[b] - b += 1 - - b += 23 // padding - - v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) - copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) - b += pad(int((int(v.KeycodesPerModifier) * 8))) - - return v -} - -func (cook XinputGetDeviceModifierMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceModifierMapping -func (c *Conn) xinputGetDeviceModifierMappingRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputSetDeviceModifierMapping -// size: pad((7 + pad(((int(KeycodesPerModifier) * 8) * 1)))) -type XinputSetDeviceModifierMappingCookie struct { - *cookie -} - -func (c *Conn) XinputSetDeviceModifierMapping(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) XinputSetDeviceModifierMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputSetDeviceModifierMappingRequest(DeviceId, KeycodesPerModifier, Keymaps), cookie) - return XinputSetDeviceModifierMappingCookie{cookie} -} - -func (c *Conn) XinputSetDeviceModifierMappingUnchecked(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) XinputSetDeviceModifierMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputSetDeviceModifierMappingRequest(DeviceId, KeycodesPerModifier, Keymaps), cookie) - return XinputSetDeviceModifierMappingCookie{cookie} -} - -// Request reply for XinputSetDeviceModifierMapping -// size: 32 -type XinputSetDeviceModifierMappingReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputSetDeviceModifierMapping -func (cook XinputSetDeviceModifierMappingCookie) Reply() (*XinputSetDeviceModifierMappingReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputSetDeviceModifierMappingReply(buf), nil -} - -// Read reply into structure from buffer for XinputSetDeviceModifierMapping -func xinputSetDeviceModifierMappingReply(buf []byte) *XinputSetDeviceModifierMappingReply { - v := new(XinputSetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputSetDeviceModifierMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSetDeviceModifierMapping -func (c *Conn) xinputSetDeviceModifierMappingRequest(DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { - size := pad((7 + pad(((int(KeycodesPerModifier) * 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = KeycodesPerModifier - b += 1 - - b += 1 // padding - - copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) - b += pad(int((int(KeycodesPerModifier) * 8))) - - return buf -} - -// Request XinputGetDeviceButtonMapping -// size: 8 -type XinputGetDeviceButtonMappingCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceButtonMapping(DeviceId byte) XinputGetDeviceButtonMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceButtonMappingRequest(DeviceId), cookie) - return XinputGetDeviceButtonMappingCookie{cookie} -} - -func (c *Conn) XinputGetDeviceButtonMappingUnchecked(DeviceId byte) XinputGetDeviceButtonMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceButtonMappingRequest(DeviceId), cookie) - return XinputGetDeviceButtonMappingCookie{cookie} -} - -// Request reply for XinputGetDeviceButtonMapping -// size: (32 + pad((int(MapSize) * 1))) -type XinputGetDeviceButtonMappingReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MapSize byte - // padding: 23 bytes - Map []byte // size: pad((int(MapSize) * 1)) -} - -// Waits and reads reply data from request XinputGetDeviceButtonMapping -func (cook XinputGetDeviceButtonMappingCookie) Reply() (*XinputGetDeviceButtonMappingReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceButtonMappingReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceButtonMapping -func xinputGetDeviceButtonMappingReply(buf []byte) *XinputGetDeviceButtonMappingReply { - v := new(XinputGetDeviceButtonMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MapSize = buf[b] - b += 1 - - b += 23 // padding - - v.Map = make([]byte, v.MapSize) - copy(v.Map[:v.MapSize], buf[b:]) - b += pad(int(v.MapSize)) - - return v -} - -func (cook XinputGetDeviceButtonMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceButtonMapping -func (c *Conn) xinputGetDeviceButtonMappingRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputSetDeviceButtonMapping -// size: pad((8 + pad((int(MapSize) * 1)))) -type XinputSetDeviceButtonMappingCookie struct { - *cookie -} - -func (c *Conn) XinputSetDeviceButtonMapping(DeviceId byte, MapSize byte, Map []byte) XinputSetDeviceButtonMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputSetDeviceButtonMappingRequest(DeviceId, MapSize, Map), cookie) - return XinputSetDeviceButtonMappingCookie{cookie} -} - -func (c *Conn) XinputSetDeviceButtonMappingUnchecked(DeviceId byte, MapSize byte, Map []byte) XinputSetDeviceButtonMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputSetDeviceButtonMappingRequest(DeviceId, MapSize, Map), cookie) - return XinputSetDeviceButtonMappingCookie{cookie} -} - -// Request reply for XinputSetDeviceButtonMapping -// size: 32 -type XinputSetDeviceButtonMappingReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputSetDeviceButtonMapping -func (cook XinputSetDeviceButtonMappingCookie) Reply() (*XinputSetDeviceButtonMappingReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputSetDeviceButtonMappingReply(buf), nil -} - -// Read reply into structure from buffer for XinputSetDeviceButtonMapping -func xinputSetDeviceButtonMappingReply(buf []byte) *XinputSetDeviceButtonMappingReply { - v := new(XinputSetDeviceButtonMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputSetDeviceButtonMappingCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSetDeviceButtonMapping -func (c *Conn) xinputSetDeviceButtonMappingRequest(DeviceId byte, MapSize byte, Map []byte) []byte { - size := pad((8 + pad((int(MapSize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = MapSize - b += 1 - - b += 2 // padding - - copy(buf[b:], Map[:MapSize]) - b += pad(int(MapSize)) - - return buf -} - -// Request XinputQueryDeviceState -// size: 8 -type XinputQueryDeviceStateCookie struct { - *cookie -} - -func (c *Conn) XinputQueryDeviceState(DeviceId byte) XinputQueryDeviceStateCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputQueryDeviceStateRequest(DeviceId), cookie) - return XinputQueryDeviceStateCookie{cookie} -} - -func (c *Conn) XinputQueryDeviceStateUnchecked(DeviceId byte) XinputQueryDeviceStateCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputQueryDeviceStateRequest(DeviceId), cookie) - return XinputQueryDeviceStateCookie{cookie} -} - -// Request reply for XinputQueryDeviceState -// size: 32 -type XinputQueryDeviceStateReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumClasses byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputQueryDeviceState -func (cook XinputQueryDeviceStateCookie) Reply() (*XinputQueryDeviceStateReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputQueryDeviceStateReply(buf), nil -} - -// Read reply into structure from buffer for XinputQueryDeviceState -func xinputQueryDeviceStateReply(buf []byte) *XinputQueryDeviceStateReply { - v := new(XinputQueryDeviceStateReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputQueryDeviceStateCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputQueryDeviceState -func (c *Conn) xinputQueryDeviceStateRequest(DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// Request XinputSendExtensionEvent -// size: pad(((16 + pad(((int(NumEvents) * 32) * 1))) + pad((int(NumClasses) * 4)))) -type XinputSendExtensionEventCookie struct { - *cookie -} - -// Write request to wire for XinputSendExtensionEvent -func (c *Conn) XinputSendExtensionEvent(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return XinputSendExtensionEventCookie{cookie} -} - -func (c *Conn) XinputSendExtensionEventChecked(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) XinputSendExtensionEventCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputSendExtensionEventRequest(Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return XinputSendExtensionEventCookie{cookie} -} - -func (cook XinputSendExtensionEventCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSendExtensionEvent -func (c *Conn) xinputSendExtensionEventRequest(Destination Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []XinputEventClass) []byte { - size := pad(((16 + pad(((int(NumEvents) * 32) * 1))) + pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Destination)) - b += 4 - - buf[b] = DeviceId - b += 1 - - if Propagate { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = NumEvents - b += 1 - - b += 3 // padding - - copy(buf[b:], Events[:(int(NumEvents)*32)]) - b += pad(int((int(NumEvents) * 32))) - - for i := 0; i < int(NumClasses); i++ { - Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputDeviceBell -// size: 8 -type XinputDeviceBellCookie struct { - *cookie -} - -// Write request to wire for XinputDeviceBell -func (c *Conn) XinputDeviceBell(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) XinputDeviceBellCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xinputDeviceBellRequest(DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return XinputDeviceBellCookie{cookie} -} - -func (c *Conn) XinputDeviceBellChecked(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) XinputDeviceBellCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xinputDeviceBellRequest(DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return XinputDeviceBellCookie{cookie} -} - -func (cook XinputDeviceBellCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputDeviceBell -func (c *Conn) xinputDeviceBellRequest(DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 32 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = FeedbackId - b += 1 - - buf[b] = FeedbackClass - b += 1 - - buf[b] = byte(Percent) - b += 1 - - return buf -} - -// Request XinputSetDeviceValuators -// size: pad((8 + pad((int(NumValuators) * 4)))) -type XinputSetDeviceValuatorsCookie struct { - *cookie -} - -func (c *Conn) XinputSetDeviceValuators(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) XinputSetDeviceValuatorsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputSetDeviceValuatorsRequest(DeviceId, FirstValuator, NumValuators, Valuators), cookie) - return XinputSetDeviceValuatorsCookie{cookie} -} - -func (c *Conn) XinputSetDeviceValuatorsUnchecked(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) XinputSetDeviceValuatorsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputSetDeviceValuatorsRequest(DeviceId, FirstValuator, NumValuators, Valuators), cookie) - return XinputSetDeviceValuatorsCookie{cookie} -} - -// Request reply for XinputSetDeviceValuators -// size: 32 -type XinputSetDeviceValuatorsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputSetDeviceValuators -func (cook XinputSetDeviceValuatorsCookie) Reply() (*XinputSetDeviceValuatorsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputSetDeviceValuatorsReply(buf), nil -} - -// Read reply into structure from buffer for XinputSetDeviceValuators -func xinputSetDeviceValuatorsReply(buf []byte) *XinputSetDeviceValuatorsReply { - v := new(XinputSetDeviceValuatorsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputSetDeviceValuatorsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputSetDeviceValuators -func (c *Conn) xinputSetDeviceValuatorsRequest(DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { - size := pad((8 + pad((int(NumValuators) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 33 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = FirstValuator - b += 1 - - buf[b] = NumValuators - b += 1 - - b += 1 // padding - - for i := 0; i < int(NumValuators); i++ { - Put32(buf[b:], uint32(Valuators[i])) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XinputGetDeviceControl -// size: 8 -type XinputGetDeviceControlCookie struct { - *cookie -} - -func (c *Conn) XinputGetDeviceControl(ControlId uint16, DeviceId byte) XinputGetDeviceControlCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xinputGetDeviceControlRequest(ControlId, DeviceId), cookie) - return XinputGetDeviceControlCookie{cookie} -} - -func (c *Conn) XinputGetDeviceControlUnchecked(ControlId uint16, DeviceId byte) XinputGetDeviceControlCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xinputGetDeviceControlRequest(ControlId, DeviceId), cookie) - return XinputGetDeviceControlCookie{cookie} -} - -// Request reply for XinputGetDeviceControl -// size: 32 -type XinputGetDeviceControlReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Waits and reads reply data from request XinputGetDeviceControl -func (cook XinputGetDeviceControlCookie) Reply() (*XinputGetDeviceControlReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xinputGetDeviceControlReply(buf), nil -} - -// Read reply into structure from buffer for XinputGetDeviceControl -func xinputGetDeviceControlReply(buf []byte) *XinputGetDeviceControlReply { - v := new(XinputGetDeviceControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -func (cook XinputGetDeviceControlCookie) Check() error { - return cook.check() -} - -// Write request to wire for XinputGetDeviceControl -func (c *Conn) xinputGetDeviceControlRequest(ControlId uint16, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 34 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put16(buf[b:], ControlId) - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 1 // padding - - return buf -} diff --git a/nexgb/auto_xprint.go b/nexgb/auto_xprint.go deleted file mode 100644 index cab145e..0000000 --- a/nexgb/auto_xprint.go +++ /dev/null @@ -1,2210 +0,0 @@ -package xgb - -/* - This file was generated by xprint.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// XprintInit must be called before using the XpExtension extension. -func (c *Conn) XprintInit() error { - reply, err := c.QueryExtension(11, "XpExtension").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XpExtension could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XpExtension"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XpExtension"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XpExtension"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XpExtension"] = make(map[int]newEventFun) - newExtErrorFuncs["XpExtension"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -const ( - XprintGetDocFinished = 0 - XprintGetDocSecondConsumer = 1 -) - -const ( - XprintEvMaskNoEventMask = 0 - XprintEvMaskPrintMask = 1 - XprintEvMaskAttributeMask = 2 -) - -const ( - XprintDetailStartJobNotify = 1 - XprintDetailEndJobNotify = 2 - XprintDetailStartDocNotify = 3 - XprintDetailEndDocNotify = 4 - XprintDetailStartPageNotify = 5 - XprintDetailEndPageNotify = 6 -) - -const ( - XprintAttrJobAttr = 1 - XprintAttrDocAttr = 2 - XprintAttrPageAttr = 3 - XprintAttrPrinterAttr = 4 - XprintAttrServerAttr = 5 - XprintAttrMediumAttr = 6 - XprintAttrSpoolerAttr = 7 -) - -type XprintPcontext uint32 - -func (c *Conn) NewXprintPcontextId() (XprintPcontext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XprintPcontext(id), nil -} - -type XprintString8 byte - -// 'XprintPrinter' struct definition -// Size: (((4 + pad((int(NameLen) * 1))) + 4) + pad((int(DescLen) * 1))) -type XprintPrinter struct { - NameLen uint32 - Name []XprintString8 // size: pad((int(NameLen) * 1)) - DescLen uint32 - Description []XprintString8 // size: pad((int(DescLen) * 1)) -} - -// Struct read XprintPrinter -func ReadXprintPrinter(buf []byte, v *XprintPrinter) int { - b := 0 - - v.NameLen = Get32(buf[b:]) - b += 4 - - v.Name = make([]XprintString8, v.NameLen) - for i := 0; i < int(v.NameLen); i++ { - v.Name[i] = XprintString8(buf[b]) - b += 1 - } - b = pad(b) - - v.DescLen = Get32(buf[b:]) - b += 4 - - v.Description = make([]XprintString8, v.DescLen) - for i := 0; i < int(v.DescLen); i++ { - v.Description[i] = XprintString8(buf[b]) - b += 1 - } - b = pad(b) - - return b -} - -// Struct list read XprintPrinter -func ReadXprintPrinterList(buf []byte, dest []XprintPrinter) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XprintPrinter{} - b += ReadXprintPrinter(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XprintPrinter -func (v XprintPrinter) Bytes() []byte { - buf := make([]byte, (((4 + pad((int(v.NameLen) * 1))) + 4) + pad((int(v.DescLen) * 1)))) - b := 0 - - Put32(buf[b:], v.NameLen) - b += 4 - - for i := 0; i < int(v.NameLen); i++ { - buf[b] = byte(v.Name[i]) - b += 1 - } - b = pad(b) - - Put32(buf[b:], v.DescLen) - b += 4 - - for i := 0; i < int(v.DescLen); i++ { - buf[b] = byte(v.Description[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Write struct list XprintPrinter -func XprintPrinterListBytes(buf []byte, list []XprintPrinter) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XprintPrinter -func XprintPrinterListSize(list []XprintPrinter) int { - size := 0 - for _, item := range list { - size += (((4 + pad((int(item.NameLen) * 1))) + 4) + pad((int(item.DescLen) * 1))) - } - return size -} - -// Event definition XprintNotify (0) -// Size: 32 - -const XprintNotify = 0 - -type XprintNotifyEvent struct { - Sequence uint16 - Detail byte - Context XprintPcontext - Cancel bool -} - -// Event read XprintNotify -func NewXprintNotifyEvent(buf []byte) Event { - v := XprintNotifyEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Context = XprintPcontext(Get32(buf[b:])) - b += 4 - - if buf[b] == 1 { - v.Cancel = true - } else { - v.Cancel = false - } - b += 1 - - return v -} - -// Event write XprintNotify -func (v XprintNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Context)) - b += 4 - - if v.Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -func (v XprintNotifyEvent) ImplementsEvent() {} - -func (v XprintNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XprintNotifyEvent) String() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Context: %d", v.Context)) - fieldVals = append(fieldVals, sprintf("Cancel: %t", v.Cancel)) - return "XprintNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XpExtension"][0] = NewXprintNotifyEvent -} - -// Event definition XprintAttributNotify (1) -// Size: 32 - -const XprintAttributNotify = 1 - -type XprintAttributNotifyEvent struct { - Sequence uint16 - Detail byte - Context XprintPcontext -} - -// Event read XprintAttributNotify -func NewXprintAttributNotifyEvent(buf []byte) Event { - v := XprintAttributNotifyEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Context = XprintPcontext(Get32(buf[b:])) - b += 4 - - return v -} - -// Event write XprintAttributNotify -func (v XprintAttributNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Context)) - b += 4 - - return buf -} - -func (v XprintAttributNotifyEvent) ImplementsEvent() {} - -func (v XprintAttributNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XprintAttributNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Context: %d", v.Context)) - return "XprintAttributNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XpExtension"][1] = NewXprintAttributNotifyEvent -} - -// Error definition XprintBadContext (0) -// Size: 32 - -const BadXprintBadContext = 0 - -type XprintBadContextError struct { - Sequence uint16 - NiceName string -} - -// Error read XprintBadContext -func NewXprintBadContextError(buf []byte) Error { - v := XprintBadContextError{} - v.NiceName = "XprintBadContext" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XprintBadContextError) ImplementsError() {} - -func (err XprintBadContextError) SequenceId() uint16 { - return err.Sequence -} - -func (err XprintBadContextError) BadId() uint32 { - return 0 -} - -func (err XprintBadContextError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXprintBadContext {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XpExtension"][0] = NewXprintBadContextError -} - -// Error definition XprintBadSequence (1) -// Size: 32 - -const BadXprintBadSequence = 1 - -type XprintBadSequenceError struct { - Sequence uint16 - NiceName string -} - -// Error read XprintBadSequence -func NewXprintBadSequenceError(buf []byte) Error { - v := XprintBadSequenceError{} - v.NiceName = "XprintBadSequence" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XprintBadSequenceError) ImplementsError() {} - -func (err XprintBadSequenceError) SequenceId() uint16 { - return err.Sequence -} - -func (err XprintBadSequenceError) BadId() uint32 { - return 0 -} - -func (err XprintBadSequenceError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXprintBadSequence {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XpExtension"][1] = NewXprintBadSequenceError -} - -// Request XprintPrintQueryVersion -// size: 4 -type XprintPrintQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XprintPrintQueryVersion() XprintPrintQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintQueryVersionRequest(), cookie) - return XprintPrintQueryVersionCookie{cookie} -} - -func (c *Conn) XprintPrintQueryVersionUnchecked() XprintPrintQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintQueryVersionRequest(), cookie) - return XprintPrintQueryVersionCookie{cookie} -} - -// Request reply for XprintPrintQueryVersion -// size: 12 -type XprintPrintQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} - -// Waits and reads reply data from request XprintPrintQueryVersion -func (cook XprintPrintQueryVersionCookie) Reply() (*XprintPrintQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintQueryVersion -func xprintPrintQueryVersionReply(buf []byte) *XprintPrintQueryVersionReply { - v := new(XprintPrintQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = Get16(buf[b:]) - b += 2 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XprintPrintQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintQueryVersion -func (c *Conn) xprintPrintQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XprintPrintGetPrinterList -// size: pad(((12 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) -type XprintPrintGetPrinterListCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetPrinterList(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintPrintGetPrinterListCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetPrinterListRequest(PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return XprintPrintGetPrinterListCookie{cookie} -} - -func (c *Conn) XprintPrintGetPrinterListUnchecked(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintPrintGetPrinterListCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetPrinterListRequest(PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return XprintPrintGetPrinterListCookie{cookie} -} - -// Request reply for XprintPrintGetPrinterList -// size: (32 + XprintPrinterListSize(Printers)) -type XprintPrintGetPrinterListReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ListCount uint32 - // padding: 20 bytes - Printers []XprintPrinter // size: XprintPrinterListSize(Printers) -} - -// Waits and reads reply data from request XprintPrintGetPrinterList -func (cook XprintPrintGetPrinterListCookie) Reply() (*XprintPrintGetPrinterListReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetPrinterListReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetPrinterList -func xprintPrintGetPrinterListReply(buf []byte) *XprintPrintGetPrinterListReply { - v := new(XprintPrintGetPrinterListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ListCount = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Printers = make([]XprintPrinter, v.ListCount) - b += ReadXprintPrinterList(buf[b:], v.Printers) - - return v -} - -func (cook XprintPrintGetPrinterListCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetPrinterList -func (c *Conn) xprintPrintGetPrinterListRequest(PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) []byte { - size := pad(((12 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], PrinterNameLen) - b += 4 - - Put32(buf[b:], LocaleLen) - b += 4 - - for i := 0; i < int(PrinterNameLen); i++ { - buf[b] = byte(PrinterName[i]) - b += 1 - } - b = pad(b) - - for i := 0; i < int(LocaleLen); i++ { - buf[b] = byte(Locale[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Request XprintPrintRehashPrinterList -// size: 4 -type XprintPrintRehashPrinterListCookie struct { - *cookie -} - -// Write request to wire for XprintPrintRehashPrinterList -func (c *Conn) XprintPrintRehashPrinterList() XprintPrintRehashPrinterListCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintRehashPrinterListRequest(), cookie) - return XprintPrintRehashPrinterListCookie{cookie} -} - -func (c *Conn) XprintPrintRehashPrinterListChecked() XprintPrintRehashPrinterListCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintRehashPrinterListRequest(), cookie) - return XprintPrintRehashPrinterListCookie{cookie} -} - -func (cook XprintPrintRehashPrinterListCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintRehashPrinterList -func (c *Conn) xprintPrintRehashPrinterListRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XprintCreateContext -// size: pad(((16 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) -type XprintCreateContextCookie struct { - *cookie -} - -// Write request to wire for XprintCreateContext -func (c *Conn) XprintCreateContext(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintCreateContextRequest(ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return XprintCreateContextCookie{cookie} -} - -func (c *Conn) XprintCreateContextChecked(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) XprintCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintCreateContextRequest(ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return XprintCreateContextCookie{cookie} -} - -func (cook XprintCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintCreateContext -func (c *Conn) xprintCreateContextRequest(ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []XprintString8, Locale []XprintString8) []byte { - size := pad(((16 + pad((int(PrinterNameLen) * 1))) + pad((int(LocaleLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextId) - b += 4 - - Put32(buf[b:], PrinterNameLen) - b += 4 - - Put32(buf[b:], LocaleLen) - b += 4 - - for i := 0; i < int(PrinterNameLen); i++ { - buf[b] = byte(PrinterName[i]) - b += 1 - } - b = pad(b) - - for i := 0; i < int(LocaleLen); i++ { - buf[b] = byte(Locale[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Request XprintPrintSetContext -// size: 8 -type XprintPrintSetContextCookie struct { - *cookie -} - -// Write request to wire for XprintPrintSetContext -func (c *Conn) XprintPrintSetContext(Context uint32) XprintPrintSetContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintSetContextRequest(Context), cookie) - return XprintPrintSetContextCookie{cookie} -} - -func (c *Conn) XprintPrintSetContextChecked(Context uint32) XprintPrintSetContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintSetContextRequest(Context), cookie) - return XprintPrintSetContextCookie{cookie} -} - -func (cook XprintPrintSetContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintSetContext -func (c *Conn) xprintPrintSetContextRequest(Context uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Context) - b += 4 - - return buf -} - -// Request XprintPrintGetContext -// size: 4 -type XprintPrintGetContextCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetContext() XprintPrintGetContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetContextRequest(), cookie) - return XprintPrintGetContextCookie{cookie} -} - -func (c *Conn) XprintPrintGetContextUnchecked() XprintPrintGetContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetContextRequest(), cookie) - return XprintPrintGetContextCookie{cookie} -} - -// Request reply for XprintPrintGetContext -// size: 12 -type XprintPrintGetContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Context uint32 -} - -// Waits and reads reply data from request XprintPrintGetContext -func (cook XprintPrintGetContextCookie) Reply() (*XprintPrintGetContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetContextReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetContext -func xprintPrintGetContextReply(buf []byte) *XprintPrintGetContextReply { - v := new(XprintPrintGetContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Context = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook XprintPrintGetContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetContext -func (c *Conn) xprintPrintGetContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XprintPrintDestroyContext -// size: 8 -type XprintPrintDestroyContextCookie struct { - *cookie -} - -// Write request to wire for XprintPrintDestroyContext -func (c *Conn) XprintPrintDestroyContext(Context uint32) XprintPrintDestroyContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintDestroyContextRequest(Context), cookie) - return XprintPrintDestroyContextCookie{cookie} -} - -func (c *Conn) XprintPrintDestroyContextChecked(Context uint32) XprintPrintDestroyContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintDestroyContextRequest(Context), cookie) - return XprintPrintDestroyContextCookie{cookie} -} - -func (cook XprintPrintDestroyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintDestroyContext -func (c *Conn) xprintPrintDestroyContextRequest(Context uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Context) - b += 4 - - return buf -} - -// Request XprintPrintGetScreenOfContext -// size: 4 -type XprintPrintGetScreenOfContextCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetScreenOfContext() XprintPrintGetScreenOfContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetScreenOfContextRequest(), cookie) - return XprintPrintGetScreenOfContextCookie{cookie} -} - -func (c *Conn) XprintPrintGetScreenOfContextUnchecked() XprintPrintGetScreenOfContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetScreenOfContextRequest(), cookie) - return XprintPrintGetScreenOfContextCookie{cookie} -} - -// Request reply for XprintPrintGetScreenOfContext -// size: 12 -type XprintPrintGetScreenOfContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Root Window -} - -// Waits and reads reply data from request XprintPrintGetScreenOfContext -func (cook XprintPrintGetScreenOfContextCookie) Reply() (*XprintPrintGetScreenOfContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetScreenOfContextReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetScreenOfContext -func xprintPrintGetScreenOfContextReply(buf []byte) *XprintPrintGetScreenOfContextReply { - v := new(XprintPrintGetScreenOfContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = Window(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook XprintPrintGetScreenOfContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetScreenOfContext -func (c *Conn) xprintPrintGetScreenOfContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XprintPrintStartJob -// size: 8 -type XprintPrintStartJobCookie struct { - *cookie -} - -// Write request to wire for XprintPrintStartJob -func (c *Conn) XprintPrintStartJob(OutputMode byte) XprintPrintStartJobCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintStartJobRequest(OutputMode), cookie) - return XprintPrintStartJobCookie{cookie} -} - -func (c *Conn) XprintPrintStartJobChecked(OutputMode byte) XprintPrintStartJobCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintStartJobRequest(OutputMode), cookie) - return XprintPrintStartJobCookie{cookie} -} - -func (cook XprintPrintStartJobCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintStartJob -func (c *Conn) xprintPrintStartJobRequest(OutputMode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = OutputMode - b += 1 - - return buf -} - -// Request XprintPrintEndJob -// size: 8 -type XprintPrintEndJobCookie struct { - *cookie -} - -// Write request to wire for XprintPrintEndJob -func (c *Conn) XprintPrintEndJob(Cancel bool) XprintPrintEndJobCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintEndJobRequest(Cancel), cookie) - return XprintPrintEndJobCookie{cookie} -} - -func (c *Conn) XprintPrintEndJobChecked(Cancel bool) XprintPrintEndJobCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintEndJobRequest(Cancel), cookie) - return XprintPrintEndJobCookie{cookie} -} - -func (cook XprintPrintEndJobCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintEndJob -func (c *Conn) xprintPrintEndJobRequest(Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request XprintPrintStartDoc -// size: 8 -type XprintPrintStartDocCookie struct { - *cookie -} - -// Write request to wire for XprintPrintStartDoc -func (c *Conn) XprintPrintStartDoc(DriverMode byte) XprintPrintStartDocCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintStartDocRequest(DriverMode), cookie) - return XprintPrintStartDocCookie{cookie} -} - -func (c *Conn) XprintPrintStartDocChecked(DriverMode byte) XprintPrintStartDocCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintStartDocRequest(DriverMode), cookie) - return XprintPrintStartDocCookie{cookie} -} - -func (cook XprintPrintStartDocCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintStartDoc -func (c *Conn) xprintPrintStartDocRequest(DriverMode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DriverMode - b += 1 - - return buf -} - -// Request XprintPrintEndDoc -// size: 8 -type XprintPrintEndDocCookie struct { - *cookie -} - -// Write request to wire for XprintPrintEndDoc -func (c *Conn) XprintPrintEndDoc(Cancel bool) XprintPrintEndDocCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintEndDocRequest(Cancel), cookie) - return XprintPrintEndDocCookie{cookie} -} - -func (c *Conn) XprintPrintEndDocChecked(Cancel bool) XprintPrintEndDocCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintEndDocRequest(Cancel), cookie) - return XprintPrintEndDocCookie{cookie} -} - -func (cook XprintPrintEndDocCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintEndDoc -func (c *Conn) xprintPrintEndDocRequest(Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// Request XprintPrintPutDocumentData -// size: pad((((16 + pad((int(LenData) * 1))) + pad((len(DocFormat) * 1))) + pad((len(Options) * 1)))) -type XprintPrintPutDocumentDataCookie struct { - *cookie -} - -// Write request to wire for XprintPrintPutDocumentData -func (c *Conn) XprintPrintPutDocumentData(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) - return XprintPrintPutDocumentDataCookie{cookie} -} - -func (c *Conn) XprintPrintPutDocumentDataChecked(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) XprintPrintPutDocumentDataCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintPutDocumentDataRequest(Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) - return XprintPrintPutDocumentDataCookie{cookie} -} - -func (cook XprintPrintPutDocumentDataCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintPutDocumentData -func (c *Conn) xprintPrintPutDocumentDataRequest(Drawable Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []XprintString8, Options []XprintString8) []byte { - size := pad((((16 + pad((int(LenData) * 1))) + pad((len(DocFormat) * 1))) + pad((len(Options) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], LenData) - b += 4 - - Put16(buf[b:], LenFmt) - b += 2 - - Put16(buf[b:], LenOptions) - b += 2 - - copy(buf[b:], Data[:LenData]) - b += pad(int(LenData)) - - for i := 0; i < int(len(DocFormat)); i++ { - buf[b] = byte(DocFormat[i]) - b += 1 - } - b = pad(b) - - for i := 0; i < int(len(Options)); i++ { - buf[b] = byte(Options[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Request XprintPrintGetDocumentData -// size: 12 -type XprintPrintGetDocumentDataCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetDocumentData(Context XprintPcontext, MaxBytes uint32) XprintPrintGetDocumentDataCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) - return XprintPrintGetDocumentDataCookie{cookie} -} - -func (c *Conn) XprintPrintGetDocumentDataUnchecked(Context XprintPcontext, MaxBytes uint32) XprintPrintGetDocumentDataCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetDocumentDataRequest(Context, MaxBytes), cookie) - return XprintPrintGetDocumentDataCookie{cookie} -} - -// Request reply for XprintPrintGetDocumentData -// size: (32 + pad((int(DataLen) * 1))) -type XprintPrintGetDocumentDataReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - StatusCode uint32 - FinishedFlag uint32 - DataLen uint32 - // padding: 12 bytes - Data []byte // size: pad((int(DataLen) * 1)) -} - -// Waits and reads reply data from request XprintPrintGetDocumentData -func (cook XprintPrintGetDocumentDataCookie) Reply() (*XprintPrintGetDocumentDataReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetDocumentDataReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetDocumentData -func xprintPrintGetDocumentDataReply(buf []byte) *XprintPrintGetDocumentDataReply { - v := new(XprintPrintGetDocumentDataReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.StatusCode = Get32(buf[b:]) - b += 4 - - v.FinishedFlag = Get32(buf[b:]) - b += 4 - - v.DataLen = Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, v.DataLen) - copy(v.Data[:v.DataLen], buf[b:]) - b += pad(int(v.DataLen)) - - return v -} - -func (cook XprintPrintGetDocumentDataCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetDocumentData -func (c *Conn) xprintPrintGetDocumentDataRequest(Context XprintPcontext, MaxBytes uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], MaxBytes) - b += 4 - - return buf -} - -// Request XprintPrintStartPage -// size: 8 -type XprintPrintStartPageCookie struct { - *cookie -} - -// Write request to wire for XprintPrintStartPage -func (c *Conn) XprintPrintStartPage(Window Window) XprintPrintStartPageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) - return XprintPrintStartPageCookie{cookie} -} - -func (c *Conn) XprintPrintStartPageChecked(Window Window) XprintPrintStartPageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintStartPageRequest(Window), cookie) - return XprintPrintStartPageCookie{cookie} -} - -func (cook XprintPrintStartPageCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintStartPage -func (c *Conn) xprintPrintStartPageRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XprintPrintEndPage -// size: 8 -type XprintPrintEndPageCookie struct { - *cookie -} - -// Write request to wire for XprintPrintEndPage -func (c *Conn) XprintPrintEndPage(Cancel bool) XprintPrintEndPageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintEndPageRequest(Cancel), cookie) - return XprintPrintEndPageCookie{cookie} -} - -func (c *Conn) XprintPrintEndPageChecked(Cancel bool) XprintPrintEndPageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintEndPageRequest(Cancel), cookie) - return XprintPrintEndPageCookie{cookie} -} - -func (cook XprintPrintEndPageCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintEndPage -func (c *Conn) xprintPrintEndPageRequest(Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request XprintPrintSelectInput -// size: pad((8 + (4 + pad((4 * popCount(int(EventMask))))))) -type XprintPrintSelectInputCookie struct { - *cookie -} - -// Write request to wire for XprintPrintSelectInput -func (c *Conn) XprintPrintSelectInput(Context XprintPcontext, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) - return XprintPrintSelectInputCookie{cookie} -} - -func (c *Conn) XprintPrintSelectInputChecked(Context XprintPcontext, EventMask uint32, EventList []uint32) XprintPrintSelectInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintSelectInputRequest(Context, EventMask, EventList), cookie) - return XprintPrintSelectInputCookie{cookie} -} - -func (cook XprintPrintSelectInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintSelectInput -func (c *Conn) xprintPrintSelectInputRequest(Context XprintPcontext, EventMask uint32, EventList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(EventMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], EventMask) - b += 4 - for i := 0; i < popCount(int(EventMask)); i++ { - Put32(buf[b:], EventList[i]) - b += 4 - } - b = pad(b) - - return buf -} - -// Request XprintPrintInputSelected -// size: 8 -type XprintPrintInputSelectedCookie struct { - *cookie -} - -func (c *Conn) XprintPrintInputSelected(Context XprintPcontext) XprintPrintInputSelectedCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) - return XprintPrintInputSelectedCookie{cookie} -} - -func (c *Conn) XprintPrintInputSelectedUnchecked(Context XprintPcontext) XprintPrintInputSelectedCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintInputSelectedRequest(Context), cookie) - return XprintPrintInputSelectedCookie{cookie} -} - -// Request reply for XprintPrintInputSelected -// size: ((8 + (4 + pad((4 * popCount(int(EventMask)))))) + (4 + pad((4 * popCount(int(AllEventsMask)))))) -type XprintPrintInputSelectedReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - EventMask uint32 - EventList []uint32 - AllEventsMask uint32 - AllEventsList []uint32 -} - -// Waits and reads reply data from request XprintPrintInputSelected -func (cook XprintPrintInputSelectedCookie) Reply() (*XprintPrintInputSelectedReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintInputSelectedReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintInputSelected -func xprintPrintInputSelectedReply(buf []byte) *XprintPrintInputSelectedReply { - v := new(XprintPrintInputSelectedReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.EventMask = Get32(buf[b:]) - b += 4 - - v.EventList = make([]uint32, popCount(int(v.EventMask))) - for i := 0; i < popCount(int(v.EventMask)); i++ { - v.EventList[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.AllEventsMask = Get32(buf[b:]) - b += 4 - - v.AllEventsList = make([]uint32, popCount(int(v.AllEventsMask))) - for i := 0; i < popCount(int(v.AllEventsMask)); i++ { - v.AllEventsList[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XprintPrintInputSelectedCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintInputSelected -func (c *Conn) xprintPrintInputSelectedRequest(Context XprintPcontext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request XprintPrintGetAttributes -// size: 12 -type XprintPrintGetAttributesCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetAttributes(Context XprintPcontext, Pool byte) XprintPrintGetAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) - return XprintPrintGetAttributesCookie{cookie} -} - -func (c *Conn) XprintPrintGetAttributesUnchecked(Context XprintPcontext, Pool byte) XprintPrintGetAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetAttributesRequest(Context, Pool), cookie) - return XprintPrintGetAttributesCookie{cookie} -} - -// Request reply for XprintPrintGetAttributes -// size: 33 -type XprintPrintGetAttributesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - StringLen uint32 - // padding: 20 bytes - Attributes XprintString8 -} - -// Waits and reads reply data from request XprintPrintGetAttributes -func (cook XprintPrintGetAttributesCookie) Reply() (*XprintPrintGetAttributesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetAttributesReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetAttributes -func xprintPrintGetAttributesReply(buf []byte) *XprintPrintGetAttributesReply { - v := new(XprintPrintGetAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.StringLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Attributes = XprintString8(buf[b]) - b += 1 - - return v -} - -func (cook XprintPrintGetAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetAttributes -func (c *Conn) xprintPrintGetAttributesRequest(Context XprintPcontext, Pool byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - buf[b] = Pool - b += 1 - - b += 3 // padding - - return buf -} - -// Request XprintPrintGetOneAttributes -// size: pad((16 + pad((int(NameLen) * 1)))) -type XprintPrintGetOneAttributesCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetOneAttributes(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) - return XprintPrintGetOneAttributesCookie{cookie} -} - -func (c *Conn) XprintPrintGetOneAttributesUnchecked(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) XprintPrintGetOneAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetOneAttributesRequest(Context, NameLen, Pool, Name), cookie) - return XprintPrintGetOneAttributesCookie{cookie} -} - -// Request reply for XprintPrintGetOneAttributes -// size: (32 + pad((int(ValueLen) * 1))) -type XprintPrintGetOneAttributesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ValueLen uint32 - // padding: 20 bytes - Value []XprintString8 // size: pad((int(ValueLen) * 1)) -} - -// Waits and reads reply data from request XprintPrintGetOneAttributes -func (cook XprintPrintGetOneAttributesCookie) Reply() (*XprintPrintGetOneAttributesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetOneAttributesReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetOneAttributes -func xprintPrintGetOneAttributesReply(buf []byte) *XprintPrintGetOneAttributesReply { - v := new(XprintPrintGetOneAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ValueLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Value = make([]XprintString8, v.ValueLen) - for i := 0; i < int(v.ValueLen); i++ { - v.Value[i] = XprintString8(buf[b]) - b += 1 - } - b = pad(b) - - return v -} - -func (cook XprintPrintGetOneAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetOneAttributes -func (c *Conn) xprintPrintGetOneAttributesRequest(Context XprintPcontext, NameLen uint32, Pool byte, Name []XprintString8) []byte { - size := pad((16 + pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], NameLen) - b += 4 - - buf[b] = Pool - b += 1 - - b += 3 // padding - - for i := 0; i < int(NameLen); i++ { - buf[b] = byte(Name[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Request XprintPrintSetAttributes -// size: pad((16 + pad((len(Attributes) * 1)))) -type XprintPrintSetAttributesCookie struct { - *cookie -} - -// Write request to wire for XprintPrintSetAttributes -func (c *Conn) XprintPrintSetAttributes(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) - return XprintPrintSetAttributesCookie{cookie} -} - -func (c *Conn) XprintPrintSetAttributesChecked(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) XprintPrintSetAttributesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xprintPrintSetAttributesRequest(Context, StringLen, Pool, Rule, Attributes), cookie) - return XprintPrintSetAttributesCookie{cookie} -} - -func (cook XprintPrintSetAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintSetAttributes -func (c *Conn) xprintPrintSetAttributesRequest(Context XprintPcontext, StringLen uint32, Pool byte, Rule byte, Attributes []XprintString8) []byte { - size := pad((16 + pad((len(Attributes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], StringLen) - b += 4 - - buf[b] = Pool - b += 1 - - buf[b] = Rule - b += 1 - - b += 2 // padding - - for i := 0; i < int(len(Attributes)); i++ { - buf[b] = byte(Attributes[i]) - b += 1 - } - b = pad(b) - - return buf -} - -// Request XprintPrintGetPageDimensions -// size: 8 -type XprintPrintGetPageDimensionsCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetPageDimensions(Context XprintPcontext) XprintPrintGetPageDimensionsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) - return XprintPrintGetPageDimensionsCookie{cookie} -} - -func (c *Conn) XprintPrintGetPageDimensionsUnchecked(Context XprintPcontext) XprintPrintGetPageDimensionsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetPageDimensionsRequest(Context), cookie) - return XprintPrintGetPageDimensionsCookie{cookie} -} - -// Request reply for XprintPrintGetPageDimensions -// size: 20 -type XprintPrintGetPageDimensionsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Width uint16 - Height uint16 - OffsetX uint16 - OffsetY uint16 - ReproducibleWidth uint16 - ReproducibleHeight uint16 -} - -// Waits and reads reply data from request XprintPrintGetPageDimensions -func (cook XprintPrintGetPageDimensionsCookie) Reply() (*XprintPrintGetPageDimensionsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetPageDimensionsReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetPageDimensions -func xprintPrintGetPageDimensionsReply(buf []byte) *XprintPrintGetPageDimensionsReply { - v := new(XprintPrintGetPageDimensionsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.OffsetX = Get16(buf[b:]) - b += 2 - - v.OffsetY = Get16(buf[b:]) - b += 2 - - v.ReproducibleWidth = Get16(buf[b:]) - b += 2 - - v.ReproducibleHeight = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XprintPrintGetPageDimensionsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetPageDimensions -func (c *Conn) xprintPrintGetPageDimensionsRequest(Context XprintPcontext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// Request XprintPrintQueryScreens -// size: 4 -type XprintPrintQueryScreensCookie struct { - *cookie -} - -func (c *Conn) XprintPrintQueryScreens() XprintPrintQueryScreensCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintQueryScreensRequest(), cookie) - return XprintPrintQueryScreensCookie{cookie} -} - -func (c *Conn) XprintPrintQueryScreensUnchecked() XprintPrintQueryScreensCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintQueryScreensRequest(), cookie) - return XprintPrintQueryScreensCookie{cookie} -} - -// Request reply for XprintPrintQueryScreens -// size: (32 + pad((int(ListCount) * 4))) -type XprintPrintQueryScreensReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ListCount uint32 - // padding: 20 bytes - Roots []Window // size: pad((int(ListCount) * 4)) -} - -// Waits and reads reply data from request XprintPrintQueryScreens -func (cook XprintPrintQueryScreensCookie) Reply() (*XprintPrintQueryScreensReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintQueryScreensReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintQueryScreens -func xprintPrintQueryScreensReply(buf []byte) *XprintPrintQueryScreensReply { - v := new(XprintPrintQueryScreensReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ListCount = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Roots = make([]Window, v.ListCount) - for i := 0; i < int(v.ListCount); i++ { - v.Roots[i] = Window(Get32(buf[b:])) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XprintPrintQueryScreensCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintQueryScreens -func (c *Conn) xprintPrintQueryScreensRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XprintPrintSetImageResolution -// size: 12 -type XprintPrintSetImageResolutionCookie struct { - *cookie -} - -func (c *Conn) XprintPrintSetImageResolution(Context XprintPcontext, ImageResolution uint16) XprintPrintSetImageResolutionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) - return XprintPrintSetImageResolutionCookie{cookie} -} - -func (c *Conn) XprintPrintSetImageResolutionUnchecked(Context XprintPcontext, ImageResolution uint16) XprintPrintSetImageResolutionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintSetImageResolutionRequest(Context, ImageResolution), cookie) - return XprintPrintSetImageResolutionCookie{cookie} -} - -// Request reply for XprintPrintSetImageResolution -// size: 10 -type XprintPrintSetImageResolutionReply struct { - Sequence uint16 - Length uint32 - Status bool - PreviousResolutions uint16 -} - -// Waits and reads reply data from request XprintPrintSetImageResolution -func (cook XprintPrintSetImageResolutionCookie) Reply() (*XprintPrintSetImageResolutionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintSetImageResolutionReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintSetImageResolution -func xprintPrintSetImageResolutionReply(buf []byte) *XprintPrintSetImageResolutionReply { - v := new(XprintPrintSetImageResolutionReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Status = true - } else { - v.Status = false - } - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.PreviousResolutions = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XprintPrintSetImageResolutionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintSetImageResolution -func (c *Conn) xprintPrintSetImageResolutionRequest(Context XprintPcontext, ImageResolution uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put16(buf[b:], ImageResolution) - b += 2 - - return buf -} - -// Request XprintPrintGetImageResolution -// size: 8 -type XprintPrintGetImageResolutionCookie struct { - *cookie -} - -func (c *Conn) XprintPrintGetImageResolution(Context XprintPcontext) XprintPrintGetImageResolutionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) - return XprintPrintGetImageResolutionCookie{cookie} -} - -func (c *Conn) XprintPrintGetImageResolutionUnchecked(Context XprintPcontext) XprintPrintGetImageResolutionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xprintPrintGetImageResolutionRequest(Context), cookie) - return XprintPrintGetImageResolutionCookie{cookie} -} - -// Request reply for XprintPrintGetImageResolution -// size: 10 -type XprintPrintGetImageResolutionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ImageResolution uint16 -} - -// Waits and reads reply data from request XprintPrintGetImageResolution -func (cook XprintPrintGetImageResolutionCookie) Reply() (*XprintPrintGetImageResolutionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xprintPrintGetImageResolutionReply(buf), nil -} - -// Read reply into structure from buffer for XprintPrintGetImageResolution -func xprintPrintGetImageResolutionReply(buf []byte) *XprintPrintGetImageResolutionReply { - v := new(XprintPrintGetImageResolutionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ImageResolution = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XprintPrintGetImageResolutionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XprintPrintGetImageResolution -func (c *Conn) xprintPrintGetImageResolutionRequest(Context XprintPcontext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XPEXTENSION"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} diff --git a/nexgb/auto_xselinux.go b/nexgb/auto_xselinux.go deleted file mode 100644 index 4e7ee81..0000000 --- a/nexgb/auto_xselinux.go +++ /dev/null @@ -1,1965 +0,0 @@ -package xgb - -/* - This file was generated by xselinux.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// XselinuxInit must be called before using the SELinux extension. -func (c *Conn) XselinuxInit() error { - reply, err := c.QueryExtension(7, "SELinux").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named SELinux could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["SELinux"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["SELinux"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["SELinux"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["SELinux"] = make(map[int]newEventFun) - newExtErrorFuncs["SELinux"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// 'XselinuxListItem' struct definition -// Size: ((12 + pad((int(ObjectContextLen) * 1))) + pad((int(DataContextLen) * 1))) -type XselinuxListItem struct { - Name Atom - ObjectContextLen uint32 - DataContextLen uint32 - ObjectContext string // size: pad((int(ObjectContextLen) * 1)) - DataContext string // size: pad((int(DataContextLen) * 1)) -} - -// Struct read XselinuxListItem -func ReadXselinuxListItem(buf []byte, v *XselinuxListItem) int { - b := 0 - - v.Name = Atom(Get32(buf[b:])) - b += 4 - - v.ObjectContextLen = Get32(buf[b:]) - b += 4 - - v.DataContextLen = Get32(buf[b:]) - b += 4 - - { - byteString := make([]byte, v.ObjectContextLen) - copy(byteString[:v.ObjectContextLen], buf[b:]) - v.ObjectContext = string(byteString) - b += pad(int(v.ObjectContextLen)) - } - - { - byteString := make([]byte, v.DataContextLen) - copy(byteString[:v.DataContextLen], buf[b:]) - v.DataContext = string(byteString) - b += pad(int(v.DataContextLen)) - } - - return b -} - -// Struct list read XselinuxListItem -func ReadXselinuxListItemList(buf []byte, dest []XselinuxListItem) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XselinuxListItem{} - b += ReadXselinuxListItem(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XselinuxListItem -func (v XselinuxListItem) Bytes() []byte { - buf := make([]byte, ((12 + pad((int(v.ObjectContextLen) * 1))) + pad((int(v.DataContextLen) * 1)))) - b := 0 - - Put32(buf[b:], uint32(v.Name)) - b += 4 - - Put32(buf[b:], v.ObjectContextLen) - b += 4 - - Put32(buf[b:], v.DataContextLen) - b += 4 - - copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) - b += pad(int(v.ObjectContextLen)) - - copy(buf[b:], v.DataContext[:v.DataContextLen]) - b += pad(int(v.DataContextLen)) - - return buf -} - -// Write struct list XselinuxListItem -func XselinuxListItemListBytes(buf []byte, list []XselinuxListItem) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XselinuxListItem -func XselinuxListItemListSize(list []XselinuxListItem) int { - size := 0 - for _, item := range list { - size += ((12 + pad((int(item.ObjectContextLen) * 1))) + pad((int(item.DataContextLen) * 1))) - } - return size -} - -// Request XselinuxQueryVersion -// size: 8 -type XselinuxQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XselinuxQueryVersion(ClientMajor byte, ClientMinor byte) XselinuxQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxQueryVersionRequest(ClientMajor, ClientMinor), cookie) - return XselinuxQueryVersionCookie{cookie} -} - -func (c *Conn) XselinuxQueryVersionUnchecked(ClientMajor byte, ClientMinor byte) XselinuxQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxQueryVersionRequest(ClientMajor, ClientMinor), cookie) - return XselinuxQueryVersionCookie{cookie} -} - -// Request reply for XselinuxQueryVersion -// size: 12 -type XselinuxQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 -} - -// Waits and reads reply data from request XselinuxQueryVersion -func (cook XselinuxQueryVersionCookie) Reply() (*XselinuxQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxQueryVersion -func xselinuxQueryVersionReply(buf []byte) *XselinuxQueryVersionReply { - v := new(XselinuxQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = Get16(buf[b:]) - b += 2 - - v.ServerMinor = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XselinuxQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxQueryVersion -func (c *Conn) xselinuxQueryVersionRequest(ClientMajor byte, ClientMinor byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = ClientMajor - b += 1 - - buf[b] = ClientMinor - b += 1 - - return buf -} - -// Request XselinuxSetDeviceCreateContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetDeviceCreateContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetDeviceCreateContext -func (c *Conn) XselinuxSetDeviceCreateContext(ContextLen uint32, Context string) XselinuxSetDeviceCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetDeviceCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetDeviceCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxSetDeviceCreateContextChecked(ContextLen uint32, Context string) XselinuxSetDeviceCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetDeviceCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetDeviceCreateContextCookie{cookie} -} - -func (cook XselinuxSetDeviceCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetDeviceCreateContext -func (c *Conn) xselinuxSetDeviceCreateContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetDeviceCreateContext -// size: 4 -type XselinuxGetDeviceCreateContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetDeviceCreateContext() XselinuxGetDeviceCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetDeviceCreateContextRequest(), cookie) - return XselinuxGetDeviceCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxGetDeviceCreateContextUnchecked() XselinuxGetDeviceCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetDeviceCreateContextRequest(), cookie) - return XselinuxGetDeviceCreateContextCookie{cookie} -} - -// Request reply for XselinuxGetDeviceCreateContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetDeviceCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetDeviceCreateContext -func (cook XselinuxGetDeviceCreateContextCookie) Reply() (*XselinuxGetDeviceCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetDeviceCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetDeviceCreateContext -func xselinuxGetDeviceCreateContextReply(buf []byte) *XselinuxGetDeviceCreateContextReply { - v := new(XselinuxGetDeviceCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetDeviceCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetDeviceCreateContext -func (c *Conn) xselinuxGetDeviceCreateContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxSetDeviceContext -// size: pad((12 + pad((int(ContextLen) * 1)))) -type XselinuxSetDeviceContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetDeviceContext -func (c *Conn) XselinuxSetDeviceContext(Device uint32, ContextLen uint32, Context string) XselinuxSetDeviceContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetDeviceContextRequest(Device, ContextLen, Context), cookie) - return XselinuxSetDeviceContextCookie{cookie} -} - -func (c *Conn) XselinuxSetDeviceContextChecked(Device uint32, ContextLen uint32, Context string) XselinuxSetDeviceContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetDeviceContextRequest(Device, ContextLen, Context), cookie) - return XselinuxSetDeviceContextCookie{cookie} -} - -func (cook XselinuxSetDeviceContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetDeviceContext -func (c *Conn) xselinuxSetDeviceContextRequest(Device uint32, ContextLen uint32, Context string) []byte { - size := pad((12 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Device) - b += 4 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetDeviceContext -// size: 8 -type XselinuxGetDeviceContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetDeviceContext(Device uint32) XselinuxGetDeviceContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetDeviceContextRequest(Device), cookie) - return XselinuxGetDeviceContextCookie{cookie} -} - -func (c *Conn) XselinuxGetDeviceContextUnchecked(Device uint32) XselinuxGetDeviceContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetDeviceContextRequest(Device), cookie) - return XselinuxGetDeviceContextCookie{cookie} -} - -// Request reply for XselinuxGetDeviceContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetDeviceContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetDeviceContext -func (cook XselinuxGetDeviceContextCookie) Reply() (*XselinuxGetDeviceContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetDeviceContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetDeviceContext -func xselinuxGetDeviceContextReply(buf []byte) *XselinuxGetDeviceContextReply { - v := new(XselinuxGetDeviceContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetDeviceContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetDeviceContext -func (c *Conn) xselinuxGetDeviceContextRequest(Device uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Device) - b += 4 - - return buf -} - -// Request XselinuxSetWindowCreateContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetWindowCreateContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetWindowCreateContext -func (c *Conn) XselinuxSetWindowCreateContext(ContextLen uint32, Context string) XselinuxSetWindowCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetWindowCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetWindowCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxSetWindowCreateContextChecked(ContextLen uint32, Context string) XselinuxSetWindowCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetWindowCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetWindowCreateContextCookie{cookie} -} - -func (cook XselinuxSetWindowCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetWindowCreateContext -func (c *Conn) xselinuxSetWindowCreateContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetWindowCreateContext -// size: 4 -type XselinuxGetWindowCreateContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetWindowCreateContext() XselinuxGetWindowCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetWindowCreateContextRequest(), cookie) - return XselinuxGetWindowCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxGetWindowCreateContextUnchecked() XselinuxGetWindowCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetWindowCreateContextRequest(), cookie) - return XselinuxGetWindowCreateContextCookie{cookie} -} - -// Request reply for XselinuxGetWindowCreateContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetWindowCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetWindowCreateContext -func (cook XselinuxGetWindowCreateContextCookie) Reply() (*XselinuxGetWindowCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetWindowCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetWindowCreateContext -func xselinuxGetWindowCreateContextReply(buf []byte) *XselinuxGetWindowCreateContextReply { - v := new(XselinuxGetWindowCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetWindowCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetWindowCreateContext -func (c *Conn) xselinuxGetWindowCreateContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxGetWindowContext -// size: 8 -type XselinuxGetWindowContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetWindowContext(Window Window) XselinuxGetWindowContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) - return XselinuxGetWindowContextCookie{cookie} -} - -func (c *Conn) XselinuxGetWindowContextUnchecked(Window Window) XselinuxGetWindowContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetWindowContextRequest(Window), cookie) - return XselinuxGetWindowContextCookie{cookie} -} - -// Request reply for XselinuxGetWindowContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetWindowContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetWindowContext -func (cook XselinuxGetWindowContextCookie) Reply() (*XselinuxGetWindowContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetWindowContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetWindowContext -func xselinuxGetWindowContextReply(buf []byte) *XselinuxGetWindowContextReply { - v := new(XselinuxGetWindowContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetWindowContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetWindowContext -func (c *Conn) xselinuxGetWindowContextRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XselinuxSetPropertyCreateContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetPropertyCreateContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetPropertyCreateContext -func (c *Conn) XselinuxSetPropertyCreateContext(ContextLen uint32, Context string) XselinuxSetPropertyCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetPropertyCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetPropertyCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxSetPropertyCreateContextChecked(ContextLen uint32, Context string) XselinuxSetPropertyCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetPropertyCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetPropertyCreateContextCookie{cookie} -} - -func (cook XselinuxSetPropertyCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetPropertyCreateContext -func (c *Conn) xselinuxSetPropertyCreateContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetPropertyCreateContext -// size: 4 -type XselinuxGetPropertyCreateContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetPropertyCreateContext() XselinuxGetPropertyCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetPropertyCreateContextRequest(), cookie) - return XselinuxGetPropertyCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxGetPropertyCreateContextUnchecked() XselinuxGetPropertyCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetPropertyCreateContextRequest(), cookie) - return XselinuxGetPropertyCreateContextCookie{cookie} -} - -// Request reply for XselinuxGetPropertyCreateContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetPropertyCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetPropertyCreateContext -func (cook XselinuxGetPropertyCreateContextCookie) Reply() (*XselinuxGetPropertyCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetPropertyCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetPropertyCreateContext -func xselinuxGetPropertyCreateContextReply(buf []byte) *XselinuxGetPropertyCreateContextReply { - v := new(XselinuxGetPropertyCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetPropertyCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetPropertyCreateContext -func (c *Conn) xselinuxGetPropertyCreateContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxSetPropertyUseContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetPropertyUseContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetPropertyUseContext -func (c *Conn) XselinuxSetPropertyUseContext(ContextLen uint32, Context string) XselinuxSetPropertyUseContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetPropertyUseContextRequest(ContextLen, Context), cookie) - return XselinuxSetPropertyUseContextCookie{cookie} -} - -func (c *Conn) XselinuxSetPropertyUseContextChecked(ContextLen uint32, Context string) XselinuxSetPropertyUseContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetPropertyUseContextRequest(ContextLen, Context), cookie) - return XselinuxSetPropertyUseContextCookie{cookie} -} - -func (cook XselinuxSetPropertyUseContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetPropertyUseContext -func (c *Conn) xselinuxSetPropertyUseContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetPropertyUseContext -// size: 4 -type XselinuxGetPropertyUseContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetPropertyUseContext() XselinuxGetPropertyUseContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetPropertyUseContextRequest(), cookie) - return XselinuxGetPropertyUseContextCookie{cookie} -} - -func (c *Conn) XselinuxGetPropertyUseContextUnchecked() XselinuxGetPropertyUseContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetPropertyUseContextRequest(), cookie) - return XselinuxGetPropertyUseContextCookie{cookie} -} - -// Request reply for XselinuxGetPropertyUseContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetPropertyUseContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetPropertyUseContext -func (cook XselinuxGetPropertyUseContextCookie) Reply() (*XselinuxGetPropertyUseContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetPropertyUseContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetPropertyUseContext -func xselinuxGetPropertyUseContextReply(buf []byte) *XselinuxGetPropertyUseContextReply { - v := new(XselinuxGetPropertyUseContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetPropertyUseContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetPropertyUseContext -func (c *Conn) xselinuxGetPropertyUseContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxGetPropertyContext -// size: 12 -type XselinuxGetPropertyContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetPropertyContext(Window Window, Property Atom) XselinuxGetPropertyContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) - return XselinuxGetPropertyContextCookie{cookie} -} - -func (c *Conn) XselinuxGetPropertyContextUnchecked(Window Window, Property Atom) XselinuxGetPropertyContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetPropertyContextRequest(Window, Property), cookie) - return XselinuxGetPropertyContextCookie{cookie} -} - -// Request reply for XselinuxGetPropertyContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetPropertyContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetPropertyContext -func (cook XselinuxGetPropertyContextCookie) Reply() (*XselinuxGetPropertyContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetPropertyContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetPropertyContext -func xselinuxGetPropertyContextReply(buf []byte) *XselinuxGetPropertyContextReply { - v := new(XselinuxGetPropertyContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetPropertyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetPropertyContext -func (c *Conn) xselinuxGetPropertyContextRequest(Window Window, Property Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// Request XselinuxGetPropertyDataContext -// size: 12 -type XselinuxGetPropertyDataContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetPropertyDataContext(Window Window, Property Atom) XselinuxGetPropertyDataContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) - return XselinuxGetPropertyDataContextCookie{cookie} -} - -func (c *Conn) XselinuxGetPropertyDataContextUnchecked(Window Window, Property Atom) XselinuxGetPropertyDataContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetPropertyDataContextRequest(Window, Property), cookie) - return XselinuxGetPropertyDataContextCookie{cookie} -} - -// Request reply for XselinuxGetPropertyDataContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetPropertyDataContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetPropertyDataContext -func (cook XselinuxGetPropertyDataContextCookie) Reply() (*XselinuxGetPropertyDataContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetPropertyDataContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetPropertyDataContext -func xselinuxGetPropertyDataContextReply(buf []byte) *XselinuxGetPropertyDataContextReply { - v := new(XselinuxGetPropertyDataContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetPropertyDataContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetPropertyDataContext -func (c *Conn) xselinuxGetPropertyDataContextRequest(Window Window, Property Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// Request XselinuxListProperties -// size: 8 -type XselinuxListPropertiesCookie struct { - *cookie -} - -func (c *Conn) XselinuxListProperties(Window Window) XselinuxListPropertiesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) - return XselinuxListPropertiesCookie{cookie} -} - -func (c *Conn) XselinuxListPropertiesUnchecked(Window Window) XselinuxListPropertiesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxListPropertiesRequest(Window), cookie) - return XselinuxListPropertiesCookie{cookie} -} - -// Request reply for XselinuxListProperties -// size: (32 + XselinuxListItemListSize(Properties)) -type XselinuxListPropertiesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - PropertiesLen uint32 - // padding: 20 bytes - Properties []XselinuxListItem // size: XselinuxListItemListSize(Properties) -} - -// Waits and reads reply data from request XselinuxListProperties -func (cook XselinuxListPropertiesCookie) Reply() (*XselinuxListPropertiesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxListPropertiesReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxListProperties -func xselinuxListPropertiesReply(buf []byte) *XselinuxListPropertiesReply { - v := new(XselinuxListPropertiesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.PropertiesLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Properties = make([]XselinuxListItem, v.PropertiesLen) - b += ReadXselinuxListItemList(buf[b:], v.Properties) - - return v -} - -func (cook XselinuxListPropertiesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxListProperties -func (c *Conn) xselinuxListPropertiesRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XselinuxSetSelectionCreateContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetSelectionCreateContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetSelectionCreateContext -func (c *Conn) XselinuxSetSelectionCreateContext(ContextLen uint32, Context string) XselinuxSetSelectionCreateContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetSelectionCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetSelectionCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxSetSelectionCreateContextChecked(ContextLen uint32, Context string) XselinuxSetSelectionCreateContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetSelectionCreateContextRequest(ContextLen, Context), cookie) - return XselinuxSetSelectionCreateContextCookie{cookie} -} - -func (cook XselinuxSetSelectionCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetSelectionCreateContext -func (c *Conn) xselinuxSetSelectionCreateContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetSelectionCreateContext -// size: 4 -type XselinuxGetSelectionCreateContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetSelectionCreateContext() XselinuxGetSelectionCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetSelectionCreateContextRequest(), cookie) - return XselinuxGetSelectionCreateContextCookie{cookie} -} - -func (c *Conn) XselinuxGetSelectionCreateContextUnchecked() XselinuxGetSelectionCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetSelectionCreateContextRequest(), cookie) - return XselinuxGetSelectionCreateContextCookie{cookie} -} - -// Request reply for XselinuxGetSelectionCreateContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetSelectionCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetSelectionCreateContext -func (cook XselinuxGetSelectionCreateContextCookie) Reply() (*XselinuxGetSelectionCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetSelectionCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetSelectionCreateContext -func xselinuxGetSelectionCreateContextReply(buf []byte) *XselinuxGetSelectionCreateContextReply { - v := new(XselinuxGetSelectionCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetSelectionCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetSelectionCreateContext -func (c *Conn) xselinuxGetSelectionCreateContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxSetSelectionUseContext -// size: pad((8 + pad((int(ContextLen) * 1)))) -type XselinuxSetSelectionUseContextCookie struct { - *cookie -} - -// Write request to wire for XselinuxSetSelectionUseContext -func (c *Conn) XselinuxSetSelectionUseContext(ContextLen uint32, Context string) XselinuxSetSelectionUseContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xselinuxSetSelectionUseContextRequest(ContextLen, Context), cookie) - return XselinuxSetSelectionUseContextCookie{cookie} -} - -func (c *Conn) XselinuxSetSelectionUseContextChecked(ContextLen uint32, Context string) XselinuxSetSelectionUseContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xselinuxSetSelectionUseContextRequest(ContextLen, Context), cookie) - return XselinuxSetSelectionUseContextCookie{cookie} -} - -func (cook XselinuxSetSelectionUseContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxSetSelectionUseContext -func (c *Conn) xselinuxSetSelectionUseContextRequest(ContextLen uint32, Context string) []byte { - size := pad((8 + pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += pad(int(ContextLen)) - - return buf -} - -// Request XselinuxGetSelectionUseContext -// size: 4 -type XselinuxGetSelectionUseContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetSelectionUseContext() XselinuxGetSelectionUseContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetSelectionUseContextRequest(), cookie) - return XselinuxGetSelectionUseContextCookie{cookie} -} - -func (c *Conn) XselinuxGetSelectionUseContextUnchecked() XselinuxGetSelectionUseContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetSelectionUseContextRequest(), cookie) - return XselinuxGetSelectionUseContextCookie{cookie} -} - -// Request reply for XselinuxGetSelectionUseContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetSelectionUseContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetSelectionUseContext -func (cook XselinuxGetSelectionUseContextCookie) Reply() (*XselinuxGetSelectionUseContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetSelectionUseContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetSelectionUseContext -func xselinuxGetSelectionUseContextReply(buf []byte) *XselinuxGetSelectionUseContextReply { - v := new(XselinuxGetSelectionUseContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetSelectionUseContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetSelectionUseContext -func (c *Conn) xselinuxGetSelectionUseContextRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxGetSelectionContext -// size: 8 -type XselinuxGetSelectionContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetSelectionContext(Selection Atom) XselinuxGetSelectionContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) - return XselinuxGetSelectionContextCookie{cookie} -} - -func (c *Conn) XselinuxGetSelectionContextUnchecked(Selection Atom) XselinuxGetSelectionContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetSelectionContextRequest(Selection), cookie) - return XselinuxGetSelectionContextCookie{cookie} -} - -// Request reply for XselinuxGetSelectionContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetSelectionContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetSelectionContext -func (cook XselinuxGetSelectionContextCookie) Reply() (*XselinuxGetSelectionContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetSelectionContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetSelectionContext -func xselinuxGetSelectionContextReply(buf []byte) *XselinuxGetSelectionContextReply { - v := new(XselinuxGetSelectionContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetSelectionContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetSelectionContext -func (c *Conn) xselinuxGetSelectionContextRequest(Selection Atom) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Selection)) - b += 4 - - return buf -} - -// Request XselinuxGetSelectionDataContext -// size: 8 -type XselinuxGetSelectionDataContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetSelectionDataContext(Selection Atom) XselinuxGetSelectionDataContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) - return XselinuxGetSelectionDataContextCookie{cookie} -} - -func (c *Conn) XselinuxGetSelectionDataContextUnchecked(Selection Atom) XselinuxGetSelectionDataContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetSelectionDataContextRequest(Selection), cookie) - return XselinuxGetSelectionDataContextCookie{cookie} -} - -// Request reply for XselinuxGetSelectionDataContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetSelectionDataContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetSelectionDataContext -func (cook XselinuxGetSelectionDataContextCookie) Reply() (*XselinuxGetSelectionDataContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetSelectionDataContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetSelectionDataContext -func xselinuxGetSelectionDataContextReply(buf []byte) *XselinuxGetSelectionDataContextReply { - v := new(XselinuxGetSelectionDataContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetSelectionDataContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetSelectionDataContext -func (c *Conn) xselinuxGetSelectionDataContextRequest(Selection Atom) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Selection)) - b += 4 - - return buf -} - -// Request XselinuxListSelections -// size: 4 -type XselinuxListSelectionsCookie struct { - *cookie -} - -func (c *Conn) XselinuxListSelections() XselinuxListSelectionsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxListSelectionsRequest(), cookie) - return XselinuxListSelectionsCookie{cookie} -} - -func (c *Conn) XselinuxListSelectionsUnchecked() XselinuxListSelectionsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxListSelectionsRequest(), cookie) - return XselinuxListSelectionsCookie{cookie} -} - -// Request reply for XselinuxListSelections -// size: (32 + XselinuxListItemListSize(Selections)) -type XselinuxListSelectionsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - SelectionsLen uint32 - // padding: 20 bytes - Selections []XselinuxListItem // size: XselinuxListItemListSize(Selections) -} - -// Waits and reads reply data from request XselinuxListSelections -func (cook XselinuxListSelectionsCookie) Reply() (*XselinuxListSelectionsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxListSelectionsReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxListSelections -func xselinuxListSelectionsReply(buf []byte) *XselinuxListSelectionsReply { - v := new(XselinuxListSelectionsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.SelectionsLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Selections = make([]XselinuxListItem, v.SelectionsLen) - b += ReadXselinuxListItemList(buf[b:], v.Selections) - - return v -} - -func (cook XselinuxListSelectionsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxListSelections -func (c *Conn) xselinuxListSelectionsRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XselinuxGetClientContext -// size: 8 -type XselinuxGetClientContextCookie struct { - *cookie -} - -func (c *Conn) XselinuxGetClientContext(Resource uint32) XselinuxGetClientContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xselinuxGetClientContextRequest(Resource), cookie) - return XselinuxGetClientContextCookie{cookie} -} - -func (c *Conn) XselinuxGetClientContextUnchecked(Resource uint32) XselinuxGetClientContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xselinuxGetClientContextRequest(Resource), cookie) - return XselinuxGetClientContextCookie{cookie} -} - -// Request reply for XselinuxGetClientContext -// size: (32 + pad((int(ContextLen) * 1))) -type XselinuxGetClientContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: pad((int(ContextLen) * 1)) -} - -// Waits and reads reply data from request XselinuxGetClientContext -func (cook XselinuxGetClientContextCookie) Reply() (*XselinuxGetClientContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xselinuxGetClientContextReply(buf), nil -} - -// Read reply into structure from buffer for XselinuxGetClientContext -func xselinuxGetClientContextReply(buf []byte) *XselinuxGetClientContextReply { - v := new(XselinuxGetClientContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += pad(int(v.ContextLen)) - } - - return v -} - -func (cook XselinuxGetClientContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XselinuxGetClientContext -func (c *Conn) xselinuxGetClientContextRequest(Resource uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["SELINUX"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], Resource) - b += 4 - - return buf -} diff --git a/nexgb/auto_xtest.go b/nexgb/auto_xtest.go deleted file mode 100644 index f3b92a2..0000000 --- a/nexgb/auto_xtest.go +++ /dev/null @@ -1,361 +0,0 @@ -package xgb - -/* - This file was generated by xtest.xml on May 10 2012 12:39:34pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" - -// XtestInit must be called before using the XTEST extension. -func (c *Conn) XtestInit() error { - reply, err := c.QueryExtension(5, "XTEST").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XTEST could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XTEST"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XTEST"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XTEST"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XTEST"] = make(map[int]newEventFun) - newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - XtestCursorNone = 0 - XtestCursorCurrent = 1 -) - -// Request XtestGetVersion -// size: 8 -type XtestGetVersionCookie struct { - *cookie -} - -func (c *Conn) XtestGetVersion(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie) - return XtestGetVersionCookie{cookie} -} - -func (c *Conn) XtestGetVersionUnchecked(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie) - return XtestGetVersionCookie{cookie} -} - -// Request reply for XtestGetVersion -// size: 10 -type XtestGetVersionReply struct { - Sequence uint16 - Length uint32 - MajorVersion byte - MinorVersion uint16 -} - -// Waits and reads reply data from request XtestGetVersion -func (cook XtestGetVersionCookie) Reply() (*XtestGetVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xtestGetVersionReply(buf), nil -} - -// Read reply into structure from buffer for XtestGetVersion -func xtestGetVersionReply(buf []byte) *XtestGetVersionReply { - v := new(XtestGetVersionReply) - b := 1 // skip reply determinant - - v.MajorVersion = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.MinorVersion = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XtestGetVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XtestGetVersion -func (c *Conn) xtestGetVersionRequest(MajorVersion byte, MinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XTEST"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = MajorVersion - b += 1 - - b += 1 // padding - - Put16(buf[b:], MinorVersion) - b += 2 - - return buf -} - -// Request XtestCompareCursor -// size: 12 -type XtestCompareCursorCookie struct { - *cookie -} - -func (c *Conn) XtestCompareCursor(Window Window, Cursor Cursor) XtestCompareCursorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) - return XtestCompareCursorCookie{cookie} -} - -func (c *Conn) XtestCompareCursorUnchecked(Window Window, Cursor Cursor) XtestCompareCursorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie) - return XtestCompareCursorCookie{cookie} -} - -// Request reply for XtestCompareCursor -// size: 8 -type XtestCompareCursorReply struct { - Sequence uint16 - Length uint32 - Same bool -} - -// Waits and reads reply data from request XtestCompareCursor -func (cook XtestCompareCursorCookie) Reply() (*XtestCompareCursorReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xtestCompareCursorReply(buf), nil -} - -// Read reply into structure from buffer for XtestCompareCursor -func xtestCompareCursorReply(buf []byte) *XtestCompareCursorReply { - v := new(XtestCompareCursorReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Same = true - } else { - v.Same = false - } - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -func (cook XtestCompareCursorCookie) Check() error { - return cook.check() -} - -// Write request to wire for XtestCompareCursor -func (c *Conn) xtestCompareCursorRequest(Window Window, Cursor Cursor) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XTEST"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - Put32(buf[b:], uint32(Cursor)) - b += 4 - - return buf -} - -// Request XtestFakeInput -// size: 36 -type XtestFakeInputCookie struct { - *cookie -} - -// Write request to wire for XtestFakeInput -func (c *Conn) XtestFakeInput(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) - return XtestFakeInputCookie{cookie} -} - -func (c *Conn) XtestFakeInputChecked(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) - return XtestFakeInputCookie{cookie} -} - -func (cook XtestFakeInputCookie) Check() error { - return cook.check() -} - -// Write request to wire for XtestFakeInput -func (c *Conn) xtestFakeInputRequest(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) []byte { - size := 36 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XTEST"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Type - b += 1 - - buf[b] = Detail - b += 1 - - b += 2 // padding - - Put32(buf[b:], Time) - b += 4 - - Put32(buf[b:], uint32(Root)) - b += 4 - - b += 8 // padding - - Put16(buf[b:], uint16(RootX)) - b += 2 - - Put16(buf[b:], uint16(RootY)) - b += 2 - - b += 7 // padding - - buf[b] = Deviceid - b += 1 - - return buf -} - -// Request XtestGrabControl -// size: 8 -type XtestGrabControlCookie struct { - *cookie -} - -// Write request to wire for XtestGrabControl -func (c *Conn) XtestGrabControl(Impervious bool) XtestGrabControlCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xtestGrabControlRequest(Impervious), cookie) - return XtestGrabControlCookie{cookie} -} - -func (c *Conn) XtestGrabControlChecked(Impervious bool) XtestGrabControlCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xtestGrabControlRequest(Impervious), cookie) - return XtestGrabControlCookie{cookie} -} - -func (cook XtestGrabControlCookie) Check() error { - return cook.check() -} - -// Write request to wire for XtestGrabControl -func (c *Conn) xtestGrabControlRequest(Impervious bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XTEST"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Impervious { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} diff --git a/nexgb/auto_xv.go b/nexgb/auto_xv.go deleted file mode 100644 index 25f0491..0000000 --- a/nexgb/auto_xv.go +++ /dev/null @@ -1,2780 +0,0 @@ -package xgb - -/* - This file was generated by xv.xml on May 10 2012 12:39:35pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xproto" -// import "shm" - -// XvInit must be called before using the XVideo extension. -func (c *Conn) XvInit() error { - reply, err := c.QueryExtension(6, "XVideo").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XVideo could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XVideo"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XVideo"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XVideo"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XVideo"] = make(map[int]newEventFun) - newExtErrorFuncs["XVideo"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -const ( - XvTypeInputMask = 1 - XvTypeOutputMask = 2 - XvTypeVideoMask = 4 - XvTypeStillMask = 8 - XvTypeImageMask = 16 -) - -const ( - XvImageFormatInfoTypeRgb = 0 - XvImageFormatInfoTypeYuv = 1 -) - -const ( - XvImageFormatInfoFormatPacked = 0 - XvImageFormatInfoFormatPlanar = 1 -) - -const ( - XvAttributeFlagGettable = 1 - XvAttributeFlagSettable = 2 -) - -const ( - XvVideoNotifyReasonStarted = 0 - XvVideoNotifyReasonStopped = 1 - XvVideoNotifyReasonBusy = 2 - XvVideoNotifyReasonPreempted = 3 - XvVideoNotifyReasonHardError = 4 -) - -const ( - XvScanlineOrderTopToBottom = 0 - XvScanlineOrderBottomToTop = 1 -) - -const ( - XvGrabPortStatusSuccess = 0 - XvGrabPortStatusBadExtension = 1 - XvGrabPortStatusAlreadyGrabbed = 2 - XvGrabPortStatusInvalidTime = 3 - XvGrabPortStatusBadReply = 4 - XvGrabPortStatusBadAlloc = 5 -) - -type XvPort uint32 - -func (c *Conn) NewXvPortId() (XvPort, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XvPort(id), nil -} - -type XvEncoding uint32 - -func (c *Conn) NewXvEncodingId() (XvEncoding, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XvEncoding(id), nil -} - -// 'XvRational' struct definition -// Size: 8 -type XvRational struct { - Numerator int32 - Denominator int32 -} - -// Struct read XvRational -func ReadXvRational(buf []byte, v *XvRational) int { - b := 0 - - v.Numerator = int32(Get32(buf[b:])) - b += 4 - - v.Denominator = int32(Get32(buf[b:])) - b += 4 - - return b -} - -// Struct list read XvRational -func ReadXvRationalList(buf []byte, dest []XvRational) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvRational{} - b += ReadXvRational(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvRational -func (v XvRational) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.Numerator)) - b += 4 - - Put32(buf[b:], uint32(v.Denominator)) - b += 4 - - return buf -} - -// Write struct list XvRational -func XvRationalListBytes(buf []byte, list []XvRational) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XvFormat' struct definition -// Size: 8 -type XvFormat struct { - Visual Visualid - Depth byte - // padding: 3 bytes -} - -// Struct read XvFormat -func ReadXvFormat(buf []byte, v *XvFormat) int { - b := 0 - - v.Visual = Visualid(Get32(buf[b:])) - b += 4 - - v.Depth = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// Struct list read XvFormat -func ReadXvFormatList(buf []byte, dest []XvFormat) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvFormat{} - b += ReadXvFormat(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvFormat -func (v XvFormat) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - Put32(buf[b:], uint32(v.Visual)) - b += 4 - - buf[b] = v.Depth - b += 1 - - b += 3 // padding - - return buf -} - -// Write struct list XvFormat -func XvFormatListBytes(buf []byte, list []XvFormat) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// 'XvAdaptorInfo' struct definition -// Size: ((12 + pad((int(NameSize) * 1))) + pad((int(NumFormats) * 8))) -type XvAdaptorInfo struct { - BaseId XvPort - NameSize uint16 - NumPorts uint16 - NumFormats uint16 - Type byte - // padding: 1 bytes - Name string // size: pad((int(NameSize) * 1)) - Formats []XvFormat // size: pad((int(NumFormats) * 8)) -} - -// Struct read XvAdaptorInfo -func ReadXvAdaptorInfo(buf []byte, v *XvAdaptorInfo) int { - b := 0 - - v.BaseId = XvPort(Get32(buf[b:])) - b += 4 - - v.NameSize = Get16(buf[b:]) - b += 2 - - v.NumPorts = Get16(buf[b:]) - b += 2 - - v.NumFormats = Get16(buf[b:]) - b += 2 - - v.Type = buf[b] - b += 1 - - b += 1 // padding - - { - byteString := make([]byte, v.NameSize) - copy(byteString[:v.NameSize], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.NameSize)) - } - - v.Formats = make([]XvFormat, v.NumFormats) - b += ReadXvFormatList(buf[b:], v.Formats) - - return b -} - -// Struct list read XvAdaptorInfo -func ReadXvAdaptorInfoList(buf []byte, dest []XvAdaptorInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvAdaptorInfo{} - b += ReadXvAdaptorInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvAdaptorInfo -func (v XvAdaptorInfo) Bytes() []byte { - buf := make([]byte, ((12 + pad((int(v.NameSize) * 1))) + pad((int(v.NumFormats) * 8)))) - b := 0 - - Put32(buf[b:], uint32(v.BaseId)) - b += 4 - - Put16(buf[b:], v.NameSize) - b += 2 - - Put16(buf[b:], v.NumPorts) - b += 2 - - Put16(buf[b:], v.NumFormats) - b += 2 - - buf[b] = v.Type - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Name[:v.NameSize]) - b += pad(int(v.NameSize)) - - b += XvFormatListBytes(buf[b:], v.Formats) - - return buf -} - -// Write struct list XvAdaptorInfo -func XvAdaptorInfoListBytes(buf []byte, list []XvAdaptorInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XvAdaptorInfo -func XvAdaptorInfoListSize(list []XvAdaptorInfo) int { - size := 0 - for _, item := range list { - size += ((12 + pad((int(item.NameSize) * 1))) + pad((int(item.NumFormats) * 8))) - } - return size -} - -// 'XvEncodingInfo' struct definition -// Size: (20 + pad((int(NameSize) * 1))) -type XvEncodingInfo struct { - Encoding XvEncoding - NameSize uint16 - Width uint16 - Height uint16 - // padding: 2 bytes - Rate XvRational - Name string // size: pad((int(NameSize) * 1)) -} - -// Struct read XvEncodingInfo -func ReadXvEncodingInfo(buf []byte, v *XvEncodingInfo) int { - b := 0 - - v.Encoding = XvEncoding(Get32(buf[b:])) - b += 4 - - v.NameSize = Get16(buf[b:]) - b += 2 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Rate = XvRational{} - b += ReadXvRational(buf[b:], &v.Rate) - - { - byteString := make([]byte, v.NameSize) - copy(byteString[:v.NameSize], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.NameSize)) - } - - return b -} - -// Struct list read XvEncodingInfo -func ReadXvEncodingInfoList(buf []byte, dest []XvEncodingInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvEncodingInfo{} - b += ReadXvEncodingInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvEncodingInfo -func (v XvEncodingInfo) Bytes() []byte { - buf := make([]byte, (20 + pad((int(v.NameSize) * 1)))) - b := 0 - - Put32(buf[b:], uint32(v.Encoding)) - b += 4 - - Put16(buf[b:], v.NameSize) - b += 2 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - b += 2 // padding - - { - structBytes := v.Rate.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - - copy(buf[b:], v.Name[:v.NameSize]) - b += pad(int(v.NameSize)) - - return buf -} - -// Write struct list XvEncodingInfo -func XvEncodingInfoListBytes(buf []byte, list []XvEncodingInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XvEncodingInfo -func XvEncodingInfoListSize(list []XvEncodingInfo) int { - size := 0 - for _, item := range list { - size += (20 + pad((int(item.NameSize) * 1))) - } - return size -} - -// 'XvImage' struct definition -// Size: (((16 + pad((int(NumPlanes) * 4))) + pad((int(NumPlanes) * 4))) + pad((int(DataSize) * 1))) -type XvImage struct { - Id uint32 - Width uint16 - Height uint16 - DataSize uint32 - NumPlanes uint32 - Pitches []uint32 // size: pad((int(NumPlanes) * 4)) - Offsets []uint32 // size: pad((int(NumPlanes) * 4)) - Data []byte // size: pad((int(DataSize) * 1)) -} - -// Struct read XvImage -func ReadXvImage(buf []byte, v *XvImage) int { - b := 0 - - v.Id = Get32(buf[b:]) - b += 4 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - v.DataSize = Get32(buf[b:]) - b += 4 - - v.NumPlanes = Get32(buf[b:]) - b += 4 - - v.Pitches = make([]uint32, v.NumPlanes) - for i := 0; i < int(v.NumPlanes); i++ { - v.Pitches[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.Offsets = make([]uint32, v.NumPlanes) - for i := 0; i < int(v.NumPlanes); i++ { - v.Offsets[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.Data = make([]byte, v.DataSize) - copy(v.Data[:v.DataSize], buf[b:]) - b += pad(int(v.DataSize)) - - return b -} - -// Struct list read XvImage -func ReadXvImageList(buf []byte, dest []XvImage) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvImage{} - b += ReadXvImage(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvImage -func (v XvImage) Bytes() []byte { - buf := make([]byte, (((16 + pad((int(v.NumPlanes) * 4))) + pad((int(v.NumPlanes) * 4))) + pad((int(v.DataSize) * 1)))) - b := 0 - - Put32(buf[b:], v.Id) - b += 4 - - Put16(buf[b:], v.Width) - b += 2 - - Put16(buf[b:], v.Height) - b += 2 - - Put32(buf[b:], v.DataSize) - b += 4 - - Put32(buf[b:], v.NumPlanes) - b += 4 - - for i := 0; i < int(v.NumPlanes); i++ { - Put32(buf[b:], v.Pitches[i]) - b += 4 - } - b = pad(b) - - for i := 0; i < int(v.NumPlanes); i++ { - Put32(buf[b:], v.Offsets[i]) - b += 4 - } - b = pad(b) - - copy(buf[b:], v.Data[:v.DataSize]) - b += pad(int(v.DataSize)) - - return buf -} - -// Write struct list XvImage -func XvImageListBytes(buf []byte, list []XvImage) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XvImage -func XvImageListSize(list []XvImage) int { - size := 0 - for _, item := range list { - size += (((16 + pad((int(item.NumPlanes) * 4))) + pad((int(item.NumPlanes) * 4))) + pad((int(item.DataSize) * 1))) - } - return size -} - -// 'XvAttributeInfo' struct definition -// Size: (16 + pad((int(Size) * 1))) -type XvAttributeInfo struct { - Flags uint32 - Min int32 - Max int32 - Size uint32 - Name string // size: pad((int(Size) * 1)) -} - -// Struct read XvAttributeInfo -func ReadXvAttributeInfo(buf []byte, v *XvAttributeInfo) int { - b := 0 - - v.Flags = Get32(buf[b:]) - b += 4 - - v.Min = int32(Get32(buf[b:])) - b += 4 - - v.Max = int32(Get32(buf[b:])) - b += 4 - - v.Size = Get32(buf[b:]) - b += 4 - - { - byteString := make([]byte, v.Size) - copy(byteString[:v.Size], buf[b:]) - v.Name = string(byteString) - b += pad(int(v.Size)) - } - - return b -} - -// Struct list read XvAttributeInfo -func ReadXvAttributeInfoList(buf []byte, dest []XvAttributeInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvAttributeInfo{} - b += ReadXvAttributeInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvAttributeInfo -func (v XvAttributeInfo) Bytes() []byte { - buf := make([]byte, (16 + pad((int(v.Size) * 1)))) - b := 0 - - Put32(buf[b:], v.Flags) - b += 4 - - Put32(buf[b:], uint32(v.Min)) - b += 4 - - Put32(buf[b:], uint32(v.Max)) - b += 4 - - Put32(buf[b:], v.Size) - b += 4 - - copy(buf[b:], v.Name[:v.Size]) - b += pad(int(v.Size)) - - return buf -} - -// Write struct list XvAttributeInfo -func XvAttributeInfoListBytes(buf []byte, list []XvAttributeInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XvAttributeInfo -func XvAttributeInfoListSize(list []XvAttributeInfo) int { - size := 0 - for _, item := range list { - size += (16 + pad((int(item.Size) * 1))) - } - return size -} - -// 'XvImageFormatInfo' struct definition -// Size: 128 -type XvImageFormatInfo struct { - Id uint32 - Type byte - ByteOrder byte - // padding: 2 bytes - Guid []byte // size: 16 - Bpp byte - NumPlanes byte - // padding: 2 bytes - Depth byte - // padding: 3 bytes - RedMask uint32 - GreenMask uint32 - BlueMask uint32 - Format byte - // padding: 3 bytes - YSampleBits uint32 - USampleBits uint32 - VSampleBits uint32 - VhorzYPeriod uint32 - VhorzUPeriod uint32 - VhorzVPeriod uint32 - VvertYPeriod uint32 - VvertUPeriod uint32 - VvertVPeriod uint32 - VcompOrder []byte // size: 32 - VscanlineOrder byte - // padding: 11 bytes -} - -// Struct read XvImageFormatInfo -func ReadXvImageFormatInfo(buf []byte, v *XvImageFormatInfo) int { - b := 0 - - v.Id = Get32(buf[b:]) - b += 4 - - v.Type = buf[b] - b += 1 - - v.ByteOrder = buf[b] - b += 1 - - b += 2 // padding - - v.Guid = make([]byte, 16) - copy(v.Guid[:16], buf[b:]) - b += pad(int(16)) - - v.Bpp = buf[b] - b += 1 - - v.NumPlanes = buf[b] - b += 1 - - b += 2 // padding - - v.Depth = buf[b] - b += 1 - - b += 3 // padding - - v.RedMask = Get32(buf[b:]) - b += 4 - - v.GreenMask = Get32(buf[b:]) - b += 4 - - v.BlueMask = Get32(buf[b:]) - b += 4 - - v.Format = buf[b] - b += 1 - - b += 3 // padding - - v.YSampleBits = Get32(buf[b:]) - b += 4 - - v.USampleBits = Get32(buf[b:]) - b += 4 - - v.VSampleBits = Get32(buf[b:]) - b += 4 - - v.VhorzYPeriod = Get32(buf[b:]) - b += 4 - - v.VhorzUPeriod = Get32(buf[b:]) - b += 4 - - v.VhorzVPeriod = Get32(buf[b:]) - b += 4 - - v.VvertYPeriod = Get32(buf[b:]) - b += 4 - - v.VvertUPeriod = Get32(buf[b:]) - b += 4 - - v.VvertVPeriod = Get32(buf[b:]) - b += 4 - - v.VcompOrder = make([]byte, 32) - copy(v.VcompOrder[:32], buf[b:]) - b += pad(int(32)) - - v.VscanlineOrder = buf[b] - b += 1 - - b += 11 // padding - - return b -} - -// Struct list read XvImageFormatInfo -func ReadXvImageFormatInfoList(buf []byte, dest []XvImageFormatInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvImageFormatInfo{} - b += ReadXvImageFormatInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvImageFormatInfo -func (v XvImageFormatInfo) Bytes() []byte { - buf := make([]byte, 128) - b := 0 - - Put32(buf[b:], v.Id) - b += 4 - - buf[b] = v.Type - b += 1 - - buf[b] = v.ByteOrder - b += 1 - - b += 2 // padding - - copy(buf[b:], v.Guid[:16]) - b += pad(int(16)) - - buf[b] = v.Bpp - b += 1 - - buf[b] = v.NumPlanes - b += 1 - - b += 2 // padding - - buf[b] = v.Depth - b += 1 - - b += 3 // padding - - Put32(buf[b:], v.RedMask) - b += 4 - - Put32(buf[b:], v.GreenMask) - b += 4 - - Put32(buf[b:], v.BlueMask) - b += 4 - - buf[b] = v.Format - b += 1 - - b += 3 // padding - - Put32(buf[b:], v.YSampleBits) - b += 4 - - Put32(buf[b:], v.USampleBits) - b += 4 - - Put32(buf[b:], v.VSampleBits) - b += 4 - - Put32(buf[b:], v.VhorzYPeriod) - b += 4 - - Put32(buf[b:], v.VhorzUPeriod) - b += 4 - - Put32(buf[b:], v.VhorzVPeriod) - b += 4 - - Put32(buf[b:], v.VvertYPeriod) - b += 4 - - Put32(buf[b:], v.VvertUPeriod) - b += 4 - - Put32(buf[b:], v.VvertVPeriod) - b += 4 - - copy(buf[b:], v.VcompOrder[:32]) - b += pad(int(32)) - - buf[b] = v.VscanlineOrder - b += 1 - - b += 11 // padding - - return buf -} - -// Write struct list XvImageFormatInfo -func XvImageFormatInfoListBytes(buf []byte, list []XvImageFormatInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Struct list size XvImageFormatInfo -func XvImageFormatInfoListSize(list []XvImageFormatInfo) int { - size := 0 - for _ = range list { - size += 128 - } - return size -} - -// Event definition XvVideoNotify (0) -// Size: 32 - -const XvVideoNotify = 0 - -type XvVideoNotifyEvent struct { - Sequence uint16 - Reason byte - Time Timestamp - Drawable Drawable - Port XvPort -} - -// Event read XvVideoNotify -func NewXvVideoNotifyEvent(buf []byte) Event { - v := XvVideoNotifyEvent{} - b := 1 // don't read event number - - v.Reason = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Drawable = Drawable(Get32(buf[b:])) - b += 4 - - v.Port = XvPort(Get32(buf[b:])) - b += 4 - - return v -} - -// Event write XvVideoNotify -func (v XvVideoNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Reason - b += 1 - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - Put32(buf[b:], uint32(v.Port)) - b += 4 - - return buf -} - -func (v XvVideoNotifyEvent) ImplementsEvent() {} - -func (v XvVideoNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XvVideoNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Reason: %d", v.Reason)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("Port: %d", v.Port)) - return "XvVideoNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XVideo"][0] = NewXvVideoNotifyEvent -} - -// Event definition XvPortNotify (1) -// Size: 32 - -const XvPortNotify = 1 - -type XvPortNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Time Timestamp - Port XvPort - Attribute Atom - Value int32 -} - -// Event read XvPortNotify -func NewXvPortNotifyEvent(buf []byte) Event { - v := XvPortNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(Get32(buf[b:])) - b += 4 - - v.Port = XvPort(Get32(buf[b:])) - b += 4 - - v.Attribute = Atom(Get32(buf[b:])) - b += 4 - - v.Value = int32(Get32(buf[b:])) - b += 4 - - return v -} - -// Event write XvPortNotify -func (v XvPortNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - Put32(buf[b:], uint32(v.Time)) - b += 4 - - Put32(buf[b:], uint32(v.Port)) - b += 4 - - Put32(buf[b:], uint32(v.Attribute)) - b += 4 - - Put32(buf[b:], uint32(v.Value)) - b += 4 - - return buf -} - -func (v XvPortNotifyEvent) ImplementsEvent() {} - -func (v XvPortNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v XvPortNotifyEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Port: %d", v.Port)) - fieldVals = append(fieldVals, sprintf("Attribute: %d", v.Attribute)) - fieldVals = append(fieldVals, sprintf("Value: %d", v.Value)) - return "XvPortNotify {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtEventFuncs["XVideo"][1] = NewXvPortNotifyEvent -} - -// Error definition XvBadPort (0) -// Size: 32 - -const BadXvBadPort = 0 - -type XvBadPortError struct { - Sequence uint16 - NiceName string -} - -// Error read XvBadPort -func NewXvBadPortError(buf []byte) Error { - v := XvBadPortError{} - v.NiceName = "XvBadPort" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XvBadPortError) ImplementsError() {} - -func (err XvBadPortError) SequenceId() uint16 { - return err.Sequence -} - -func (err XvBadPortError) BadId() uint32 { - return 0 -} - -func (err XvBadPortError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXvBadPort {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XVideo"][0] = NewXvBadPortError -} - -// Error definition XvBadEncoding (1) -// Size: 32 - -const BadXvBadEncoding = 1 - -type XvBadEncodingError struct { - Sequence uint16 - NiceName string -} - -// Error read XvBadEncoding -func NewXvBadEncodingError(buf []byte) Error { - v := XvBadEncodingError{} - v.NiceName = "XvBadEncoding" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XvBadEncodingError) ImplementsError() {} - -func (err XvBadEncodingError) SequenceId() uint16 { - return err.Sequence -} - -func (err XvBadEncodingError) BadId() uint32 { - return 0 -} - -func (err XvBadEncodingError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXvBadEncoding {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XVideo"][1] = NewXvBadEncodingError -} - -// Error definition XvBadControl (2) -// Size: 32 - -const BadXvBadControl = 2 - -type XvBadControlError struct { - Sequence uint16 - NiceName string -} - -// Error read XvBadControl -func NewXvBadControlError(buf []byte) Error { - v := XvBadControlError{} - v.NiceName = "XvBadControl" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = Get16(buf[b:]) - b += 2 - - return v -} - -func (err XvBadControlError) ImplementsError() {} - -func (err XvBadControlError) SequenceId() uint16 { - return err.Sequence -} - -func (err XvBadControlError) BadId() uint32 { - return 0 -} - -func (err XvBadControlError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - return "BadXvBadControl {" + stringsJoin(fieldVals, ", ") + "}" -} - -func init() { - newExtErrorFuncs["XVideo"][2] = NewXvBadControlError -} - -// Request XvQueryExtension -// size: 4 -type XvQueryExtensionCookie struct { - *cookie -} - -func (c *Conn) XvQueryExtension() XvQueryExtensionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryExtensionRequest(), cookie) - return XvQueryExtensionCookie{cookie} -} - -func (c *Conn) XvQueryExtensionUnchecked() XvQueryExtensionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryExtensionRequest(), cookie) - return XvQueryExtensionCookie{cookie} -} - -// Request reply for XvQueryExtension -// size: 12 -type XvQueryExtensionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Major uint16 - Minor uint16 -} - -// Waits and reads reply data from request XvQueryExtension -func (cook XvQueryExtensionCookie) Reply() (*XvQueryExtensionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryExtensionReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryExtension -func xvQueryExtensionReply(buf []byte) *XvQueryExtensionReply { - v := new(XvQueryExtensionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Major = Get16(buf[b:]) - b += 2 - - v.Minor = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XvQueryExtensionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryExtension -func (c *Conn) xvQueryExtensionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XvQueryAdaptors -// size: 8 -type XvQueryAdaptorsCookie struct { - *cookie -} - -func (c *Conn) XvQueryAdaptors(Window Window) XvQueryAdaptorsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) - return XvQueryAdaptorsCookie{cookie} -} - -func (c *Conn) XvQueryAdaptorsUnchecked(Window Window) XvQueryAdaptorsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryAdaptorsRequest(Window), cookie) - return XvQueryAdaptorsCookie{cookie} -} - -// Request reply for XvQueryAdaptors -// size: (32 + XvAdaptorInfoListSize(Info)) -type XvQueryAdaptorsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAdaptors uint16 - // padding: 22 bytes - Info []XvAdaptorInfo // size: XvAdaptorInfoListSize(Info) -} - -// Waits and reads reply data from request XvQueryAdaptors -func (cook XvQueryAdaptorsCookie) Reply() (*XvQueryAdaptorsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryAdaptorsReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryAdaptors -func xvQueryAdaptorsReply(buf []byte) *XvQueryAdaptorsReply { - v := new(XvQueryAdaptorsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAdaptors = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Info = make([]XvAdaptorInfo, v.NumAdaptors) - b += ReadXvAdaptorInfoList(buf[b:], v.Info) - - return v -} - -func (cook XvQueryAdaptorsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryAdaptors -func (c *Conn) xvQueryAdaptorsRequest(Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// Request XvQueryEncodings -// size: 8 -type XvQueryEncodingsCookie struct { - *cookie -} - -func (c *Conn) XvQueryEncodings(Port XvPort) XvQueryEncodingsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) - return XvQueryEncodingsCookie{cookie} -} - -func (c *Conn) XvQueryEncodingsUnchecked(Port XvPort) XvQueryEncodingsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryEncodingsRequest(Port), cookie) - return XvQueryEncodingsCookie{cookie} -} - -// Request reply for XvQueryEncodings -// size: (32 + XvEncodingInfoListSize(Info)) -type XvQueryEncodingsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumEncodings uint16 - // padding: 22 bytes - Info []XvEncodingInfo // size: XvEncodingInfoListSize(Info) -} - -// Waits and reads reply data from request XvQueryEncodings -func (cook XvQueryEncodingsCookie) Reply() (*XvQueryEncodingsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryEncodingsReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryEncodings -func xvQueryEncodingsReply(buf []byte) *XvQueryEncodingsReply { - v := new(XvQueryEncodingsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumEncodings = Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Info = make([]XvEncodingInfo, v.NumEncodings) - b += ReadXvEncodingInfoList(buf[b:], v.Info) - - return v -} - -func (cook XvQueryEncodingsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryEncodings -func (c *Conn) xvQueryEncodingsRequest(Port XvPort) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - return buf -} - -// Request XvGrabPort -// size: 12 -type XvGrabPortCookie struct { - *cookie -} - -func (c *Conn) XvGrabPort(Port XvPort, Time Timestamp) XvGrabPortCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) - return XvGrabPortCookie{cookie} -} - -func (c *Conn) XvGrabPortUnchecked(Port XvPort, Time Timestamp) XvGrabPortCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvGrabPortRequest(Port, Time), cookie) - return XvGrabPortCookie{cookie} -} - -// Request reply for XvGrabPort -// size: 8 -type XvGrabPortReply struct { - Sequence uint16 - Length uint32 - Result byte -} - -// Waits and reads reply data from request XvGrabPort -func (cook XvGrabPortCookie) Reply() (*XvGrabPortReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvGrabPortReply(buf), nil -} - -// Read reply into structure from buffer for XvGrabPort -func xvGrabPortReply(buf []byte) *XvGrabPortReply { - v := new(XvGrabPortReply) - b := 1 // skip reply determinant - - v.Result = buf[b] - b += 1 - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -func (cook XvGrabPortCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvGrabPort -func (c *Conn) xvGrabPortRequest(Port XvPort, Time Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// Request XvUngrabPort -// size: 12 -type XvUngrabPortCookie struct { - *cookie -} - -// Write request to wire for XvUngrabPort -func (c *Conn) XvUngrabPort(Port XvPort, Time Timestamp) XvUngrabPortCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) - return XvUngrabPortCookie{cookie} -} - -func (c *Conn) XvUngrabPortChecked(Port XvPort, Time Timestamp) XvUngrabPortCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvUngrabPortRequest(Port, Time), cookie) - return XvUngrabPortCookie{cookie} -} - -func (cook XvUngrabPortCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvUngrabPort -func (c *Conn) xvUngrabPortRequest(Port XvPort, Time Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// Request XvPutVideo -// size: 32 -type XvPutVideoCookie struct { - *cookie -} - -// Write request to wire for XvPutVideo -func (c *Conn) XvPutVideo(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvPutVideoCookie{cookie} -} - -func (c *Conn) XvPutVideoChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutVideoCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvPutVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvPutVideoCookie{cookie} -} - -func (cook XvPutVideoCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvPutVideo -func (c *Conn) xvPutVideoRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put16(buf[b:], uint16(VidX)) - b += 2 - - Put16(buf[b:], uint16(VidY)) - b += 2 - - Put16(buf[b:], VidW) - b += 2 - - Put16(buf[b:], VidH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - return buf -} - -// Request XvPutStill -// size: 32 -type XvPutStillCookie struct { - *cookie -} - -// Write request to wire for XvPutStill -func (c *Conn) XvPutStill(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvPutStillCookie{cookie} -} - -func (c *Conn) XvPutStillChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvPutStillCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvPutStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvPutStillCookie{cookie} -} - -func (cook XvPutStillCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvPutStill -func (c *Conn) xvPutStillRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put16(buf[b:], uint16(VidX)) - b += 2 - - Put16(buf[b:], uint16(VidY)) - b += 2 - - Put16(buf[b:], VidW) - b += 2 - - Put16(buf[b:], VidH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - return buf -} - -// Request XvGetVideo -// size: 32 -type XvGetVideoCookie struct { - *cookie -} - -// Write request to wire for XvGetVideo -func (c *Conn) XvGetVideo(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvGetVideoCookie{cookie} -} - -func (c *Conn) XvGetVideoChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetVideoCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvGetVideoRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvGetVideoCookie{cookie} -} - -func (cook XvGetVideoCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvGetVideo -func (c *Conn) xvGetVideoRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put16(buf[b:], uint16(VidX)) - b += 2 - - Put16(buf[b:], uint16(VidY)) - b += 2 - - Put16(buf[b:], VidW) - b += 2 - - Put16(buf[b:], VidH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - return buf -} - -// Request XvGetStill -// size: 32 -type XvGetStillCookie struct { - *cookie -} - -// Write request to wire for XvGetStill -func (c *Conn) XvGetStill(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvGetStillCookie{cookie} -} - -func (c *Conn) XvGetStillChecked(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) XvGetStillCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvGetStillRequest(Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return XvGetStillCookie{cookie} -} - -func (cook XvGetStillCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvGetStill -func (c *Conn) xvGetStillRequest(Port XvPort, Drawable Drawable, Gc Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put16(buf[b:], uint16(VidX)) - b += 2 - - Put16(buf[b:], uint16(VidY)) - b += 2 - - Put16(buf[b:], VidW) - b += 2 - - Put16(buf[b:], VidH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - return buf -} - -// Request XvStopVideo -// size: 12 -type XvStopVideoCookie struct { - *cookie -} - -// Write request to wire for XvStopVideo -func (c *Conn) XvStopVideo(Port XvPort, Drawable Drawable) XvStopVideoCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) - return XvStopVideoCookie{cookie} -} - -func (c *Conn) XvStopVideoChecked(Port XvPort, Drawable Drawable) XvStopVideoCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvStopVideoRequest(Port, Drawable), cookie) - return XvStopVideoCookie{cookie} -} - -func (cook XvStopVideoCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvStopVideo -func (c *Conn) xvStopVideoRequest(Port XvPort, Drawable Drawable) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// Request XvSelectVideoNotify -// size: 12 -type XvSelectVideoNotifyCookie struct { - *cookie -} - -// Write request to wire for XvSelectVideoNotify -func (c *Conn) XvSelectVideoNotify(Drawable Drawable, Onoff bool) XvSelectVideoNotifyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) - return XvSelectVideoNotifyCookie{cookie} -} - -func (c *Conn) XvSelectVideoNotifyChecked(Drawable Drawable, Onoff bool) XvSelectVideoNotifyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvSelectVideoNotifyRequest(Drawable, Onoff), cookie) - return XvSelectVideoNotifyCookie{cookie} -} - -func (cook XvSelectVideoNotifyCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvSelectVideoNotify -func (c *Conn) xvSelectVideoNotifyRequest(Drawable Drawable, Onoff bool) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - if Onoff { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request XvSelectPortNotify -// size: 12 -type XvSelectPortNotifyCookie struct { - *cookie -} - -// Write request to wire for XvSelectPortNotify -func (c *Conn) XvSelectPortNotify(Port XvPort, Onoff bool) XvSelectPortNotifyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) - return XvSelectPortNotifyCookie{cookie} -} - -func (c *Conn) XvSelectPortNotifyChecked(Port XvPort, Onoff bool) XvSelectPortNotifyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvSelectPortNotifyRequest(Port, Onoff), cookie) - return XvSelectPortNotifyCookie{cookie} -} - -func (cook XvSelectPortNotifyCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvSelectPortNotify -func (c *Conn) xvSelectPortNotifyRequest(Port XvPort, Onoff bool) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - if Onoff { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request XvQueryBestSize -// size: 20 -type XvQueryBestSizeCookie struct { - *cookie -} - -func (c *Conn) XvQueryBestSize(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) - return XvQueryBestSizeCookie{cookie} -} - -func (c *Conn) XvQueryBestSizeUnchecked(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) XvQueryBestSizeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryBestSizeRequest(Port, VidW, VidH, DrwW, DrwH, Motion), cookie) - return XvQueryBestSizeCookie{cookie} -} - -// Request reply for XvQueryBestSize -// size: 12 -type XvQueryBestSizeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - ActualWidth uint16 - ActualHeight uint16 -} - -// Waits and reads reply data from request XvQueryBestSize -func (cook XvQueryBestSizeCookie) Reply() (*XvQueryBestSizeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryBestSizeReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryBestSize -func xvQueryBestSizeReply(buf []byte) *XvQueryBestSizeReply { - v := new(XvQueryBestSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.ActualWidth = Get16(buf[b:]) - b += 2 - - v.ActualHeight = Get16(buf[b:]) - b += 2 - - return v -} - -func (cook XvQueryBestSizeCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryBestSize -func (c *Conn) xvQueryBestSizeRequest(Port XvPort, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put16(buf[b:], VidW) - b += 2 - - Put16(buf[b:], VidH) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - if Motion { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// Request XvSetPortAttribute -// size: 16 -type XvSetPortAttributeCookie struct { - *cookie -} - -// Write request to wire for XvSetPortAttribute -func (c *Conn) XvSetPortAttribute(Port XvPort, Attribute Atom, Value int32) XvSetPortAttributeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) - return XvSetPortAttributeCookie{cookie} -} - -func (c *Conn) XvSetPortAttributeChecked(Port XvPort, Attribute Atom, Value int32) XvSetPortAttributeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvSetPortAttributeRequest(Port, Attribute, Value), cookie) - return XvSetPortAttributeCookie{cookie} -} - -func (cook XvSetPortAttributeCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvSetPortAttribute -func (c *Conn) xvSetPortAttributeRequest(Port XvPort, Attribute Atom, Value int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Attribute)) - b += 4 - - Put32(buf[b:], uint32(Value)) - b += 4 - - return buf -} - -// Request XvGetPortAttribute -// size: 12 -type XvGetPortAttributeCookie struct { - *cookie -} - -func (c *Conn) XvGetPortAttribute(Port XvPort, Attribute Atom) XvGetPortAttributeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) - return XvGetPortAttributeCookie{cookie} -} - -func (c *Conn) XvGetPortAttributeUnchecked(Port XvPort, Attribute Atom) XvGetPortAttributeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvGetPortAttributeRequest(Port, Attribute), cookie) - return XvGetPortAttributeCookie{cookie} -} - -// Request reply for XvGetPortAttribute -// size: 12 -type XvGetPortAttributeReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Value int32 -} - -// Waits and reads reply data from request XvGetPortAttribute -func (cook XvGetPortAttributeCookie) Reply() (*XvGetPortAttributeReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvGetPortAttributeReply(buf), nil -} - -// Read reply into structure from buffer for XvGetPortAttribute -func xvGetPortAttributeReply(buf []byte) *XvGetPortAttributeReply { - v := new(XvGetPortAttributeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Value = int32(Get32(buf[b:])) - b += 4 - - return v -} - -func (cook XvGetPortAttributeCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvGetPortAttribute -func (c *Conn) xvGetPortAttributeRequest(Port XvPort, Attribute Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Attribute)) - b += 4 - - return buf -} - -// Request XvQueryPortAttributes -// size: 8 -type XvQueryPortAttributesCookie struct { - *cookie -} - -func (c *Conn) XvQueryPortAttributes(Port XvPort) XvQueryPortAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) - return XvQueryPortAttributesCookie{cookie} -} - -func (c *Conn) XvQueryPortAttributesUnchecked(Port XvPort) XvQueryPortAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryPortAttributesRequest(Port), cookie) - return XvQueryPortAttributesCookie{cookie} -} - -// Request reply for XvQueryPortAttributes -// size: (32 + XvAttributeInfoListSize(Attributes)) -type XvQueryPortAttributesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumAttributes uint32 - TextSize uint32 - // padding: 16 bytes - Attributes []XvAttributeInfo // size: XvAttributeInfoListSize(Attributes) -} - -// Waits and reads reply data from request XvQueryPortAttributes -func (cook XvQueryPortAttributesCookie) Reply() (*XvQueryPortAttributesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryPortAttributesReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryPortAttributes -func xvQueryPortAttributesReply(buf []byte) *XvQueryPortAttributesReply { - v := new(XvQueryPortAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAttributes = Get32(buf[b:]) - b += 4 - - v.TextSize = Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.Attributes = make([]XvAttributeInfo, v.NumAttributes) - b += ReadXvAttributeInfoList(buf[b:], v.Attributes) - - return v -} - -func (cook XvQueryPortAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryPortAttributes -func (c *Conn) xvQueryPortAttributesRequest(Port XvPort) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - return buf -} - -// Request XvListImageFormats -// size: 8 -type XvListImageFormatsCookie struct { - *cookie -} - -func (c *Conn) XvListImageFormats(Port XvPort) XvListImageFormatsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvListImageFormatsRequest(Port), cookie) - return XvListImageFormatsCookie{cookie} -} - -func (c *Conn) XvListImageFormatsUnchecked(Port XvPort) XvListImageFormatsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvListImageFormatsRequest(Port), cookie) - return XvListImageFormatsCookie{cookie} -} - -// Request reply for XvListImageFormats -// size: (32 + XvImageFormatInfoListSize(Format)) -type XvListImageFormatsReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumFormats uint32 - // padding: 20 bytes - Format []XvImageFormatInfo // size: XvImageFormatInfoListSize(Format) -} - -// Waits and reads reply data from request XvListImageFormats -func (cook XvListImageFormatsCookie) Reply() (*XvListImageFormatsReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvListImageFormatsReply(buf), nil -} - -// Read reply into structure from buffer for XvListImageFormats -func xvListImageFormatsReply(buf []byte) *XvListImageFormatsReply { - v := new(XvListImageFormatsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFormats = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Format = make([]XvImageFormatInfo, v.NumFormats) - b += ReadXvImageFormatInfoList(buf[b:], v.Format) - - return v -} - -func (cook XvListImageFormatsCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvListImageFormats -func (c *Conn) xvListImageFormatsRequest(Port XvPort) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - return buf -} - -// Request XvQueryImageAttributes -// size: 16 -type XvQueryImageAttributesCookie struct { - *cookie -} - -func (c *Conn) XvQueryImageAttributes(Port XvPort, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) - return XvQueryImageAttributesCookie{cookie} -} - -func (c *Conn) XvQueryImageAttributesUnchecked(Port XvPort, Id uint32, Width uint16, Height uint16) XvQueryImageAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvQueryImageAttributesRequest(Port, Id, Width, Height), cookie) - return XvQueryImageAttributesCookie{cookie} -} - -// Request reply for XvQueryImageAttributes -// size: ((32 + pad((int(NumPlanes) * 4))) + pad((int(NumPlanes) * 4))) -type XvQueryImageAttributesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - NumPlanes uint32 - DataSize uint32 - Width uint16 - Height uint16 - // padding: 12 bytes - Pitches []uint32 // size: pad((int(NumPlanes) * 4)) - Offsets []uint32 // size: pad((int(NumPlanes) * 4)) -} - -// Waits and reads reply data from request XvQueryImageAttributes -func (cook XvQueryImageAttributesCookie) Reply() (*XvQueryImageAttributesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvQueryImageAttributesReply(buf), nil -} - -// Read reply into structure from buffer for XvQueryImageAttributes -func xvQueryImageAttributesReply(buf []byte) *XvQueryImageAttributesReply { - v := new(XvQueryImageAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumPlanes = Get32(buf[b:]) - b += 4 - - v.DataSize = Get32(buf[b:]) - b += 4 - - v.Width = Get16(buf[b:]) - b += 2 - - v.Height = Get16(buf[b:]) - b += 2 - - b += 12 // padding - - v.Pitches = make([]uint32, v.NumPlanes) - for i := 0; i < int(v.NumPlanes); i++ { - v.Pitches[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - v.Offsets = make([]uint32, v.NumPlanes) - for i := 0; i < int(v.NumPlanes); i++ { - v.Offsets[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XvQueryImageAttributesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvQueryImageAttributes -func (c *Conn) xvQueryImageAttributesRequest(Port XvPort, Id uint32, Width uint16, Height uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - return buf -} - -// Request XvPutImage -// size: pad((40 + pad((len(Data) * 1)))) -type XvPutImageCookie struct { - *cookie -} - -// Write request to wire for XvPutImage -func (c *Conn) XvPutImage(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) - return XvPutImageCookie{cookie} -} - -func (c *Conn) XvPutImageChecked(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) XvPutImageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvPutImageRequest(Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) - return XvPutImageCookie{cookie} -} - -func (cook XvPutImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvPutImage -func (c *Conn) xvPutImageRequest(Port XvPort, Drawable Drawable, Gc Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { - size := pad((40 + pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - Put16(buf[b:], SrcW) - b += 2 - - Put16(buf[b:], SrcH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) - - return buf -} - -// Request XvShmPutImage -// size: 52 -type XvShmPutImageCookie struct { - *cookie -} - -// Write request to wire for XvShmPutImage -func (c *Conn) XvShmPutImage(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) - return XvShmPutImageCookie{cookie} -} - -func (c *Conn) XvShmPutImageChecked(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) XvShmPutImageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvShmPutImageRequest(Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) - return XvShmPutImageCookie{cookie} -} - -func (cook XvShmPutImageCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvShmPutImage -func (c *Conn) xvShmPutImageRequest(Port XvPort, Drawable Drawable, Gc Gcontext, Shmseg ShmSeg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { - size := 52 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(Port)) - b += 4 - - Put32(buf[b:], uint32(Drawable)) - b += 4 - - Put32(buf[b:], uint32(Gc)) - b += 4 - - Put32(buf[b:], uint32(Shmseg)) - b += 4 - - Put32(buf[b:], Id) - b += 4 - - Put32(buf[b:], Offset) - b += 4 - - Put16(buf[b:], uint16(SrcX)) - b += 2 - - Put16(buf[b:], uint16(SrcY)) - b += 2 - - Put16(buf[b:], SrcW) - b += 2 - - Put16(buf[b:], SrcH) - b += 2 - - Put16(buf[b:], uint16(DrwX)) - b += 2 - - Put16(buf[b:], uint16(DrwY)) - b += 2 - - Put16(buf[b:], DrwW) - b += 2 - - Put16(buf[b:], DrwH) - b += 2 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - buf[b] = SendEvent - b += 1 - - b += 3 // padding - - return buf -} diff --git a/nexgb/auto_xvmc.go b/nexgb/auto_xvmc.go deleted file mode 100644 index ba4bd44..0000000 --- a/nexgb/auto_xvmc.go +++ /dev/null @@ -1,929 +0,0 @@ -package xgb - -/* - This file was generated by xvmc.xml on May 10 2012 12:39:35pm EDT. - This file is automatically generated. Edit at your peril! -*/ - -// Imports are not necessary for XGB because everything is -// in one package. They are still listed here for reference. -// import "xv" - -// XvmcInit must be called before using the XVideo-MotionCompensation extension. -func (c *Conn) XvmcInit() error { - reply, err := c.QueryExtension(25, "XVideo-MotionCompensation").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return errorf("No extension named XVideo-MotionCompensation could be found on on the server.") - } - - c.extLock.Lock() - c.extensions["XVideo-MotionCompensation"] = reply.MajorOpcode - for evNum, fun := range newExtEventFuncs["XVideo-MotionCompensation"] { - newEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range newExtErrorFuncs["XVideo-MotionCompensation"] { - newErrorFuncs[int(reply.FirstError)+errNum] = fun - } - c.extLock.Unlock() - - return nil -} - -func init() { - newExtEventFuncs["XVideo-MotionCompensation"] = make(map[int]newEventFun) - newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun) -} - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -type XvmcContext uint32 - -func (c *Conn) NewXvmcContextId() (XvmcContext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XvmcContext(id), nil -} - -type XvmcSurface uint32 - -func (c *Conn) NewXvmcSurfaceId() (XvmcSurface, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XvmcSurface(id), nil -} - -type XvmcSubpicture uint32 - -func (c *Conn) NewXvmcSubpictureId() (XvmcSubpicture, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return XvmcSubpicture(id), nil -} - -// 'XvmcSurfaceInfo' struct definition -// Size: 24 -type XvmcSurfaceInfo struct { - Id XvmcSurface - ChromaFormat uint16 - Pad0 uint16 - MaxWidth uint16 - MaxHeight uint16 - SubpictureMaxWidth uint16 - SubpictureMaxHeight uint16 - McType uint32 - Flags uint32 -} - -// Struct read XvmcSurfaceInfo -func ReadXvmcSurfaceInfo(buf []byte, v *XvmcSurfaceInfo) int { - b := 0 - - v.Id = XvmcSurface(Get32(buf[b:])) - b += 4 - - v.ChromaFormat = Get16(buf[b:]) - b += 2 - - v.Pad0 = Get16(buf[b:]) - b += 2 - - v.MaxWidth = Get16(buf[b:]) - b += 2 - - v.MaxHeight = Get16(buf[b:]) - b += 2 - - v.SubpictureMaxWidth = Get16(buf[b:]) - b += 2 - - v.SubpictureMaxHeight = Get16(buf[b:]) - b += 2 - - v.McType = Get32(buf[b:]) - b += 4 - - v.Flags = Get32(buf[b:]) - b += 4 - - return b -} - -// Struct list read XvmcSurfaceInfo -func ReadXvmcSurfaceInfoList(buf []byte, dest []XvmcSurfaceInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = XvmcSurfaceInfo{} - b += ReadXvmcSurfaceInfo(buf[b:], &dest[i]) - } - return pad(b) -} - -// Struct write XvmcSurfaceInfo -func (v XvmcSurfaceInfo) Bytes() []byte { - buf := make([]byte, 24) - b := 0 - - Put32(buf[b:], uint32(v.Id)) - b += 4 - - Put16(buf[b:], v.ChromaFormat) - b += 2 - - Put16(buf[b:], v.Pad0) - b += 2 - - Put16(buf[b:], v.MaxWidth) - b += 2 - - Put16(buf[b:], v.MaxHeight) - b += 2 - - Put16(buf[b:], v.SubpictureMaxWidth) - b += 2 - - Put16(buf[b:], v.SubpictureMaxHeight) - b += 2 - - Put32(buf[b:], v.McType) - b += 4 - - Put32(buf[b:], v.Flags) - b += 4 - - return buf -} - -// Write struct list XvmcSurfaceInfo -func XvmcSurfaceInfoListBytes(buf []byte, list []XvmcSurfaceInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += pad(len(structBytes)) - } - return b -} - -// Request XvmcQueryVersion -// size: 4 -type XvmcQueryVersionCookie struct { - *cookie -} - -func (c *Conn) XvmcQueryVersion() XvmcQueryVersionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcQueryVersionRequest(), cookie) - return XvmcQueryVersionCookie{cookie} -} - -func (c *Conn) XvmcQueryVersionUnchecked() XvmcQueryVersionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcQueryVersionRequest(), cookie) - return XvmcQueryVersionCookie{cookie} -} - -// Request reply for XvmcQueryVersion -// size: 16 -type XvmcQueryVersionReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Major uint32 - Minor uint32 -} - -// Waits and reads reply data from request XvmcQueryVersion -func (cook XvmcQueryVersionCookie) Reply() (*XvmcQueryVersionReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcQueryVersionReply(buf), nil -} - -// Read reply into structure from buffer for XvmcQueryVersion -func xvmcQueryVersionReply(buf []byte) *XvmcQueryVersionReply { - v := new(XvmcQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Major = Get32(buf[b:]) - b += 4 - - v.Minor = Get32(buf[b:]) - b += 4 - - return v -} - -func (cook XvmcQueryVersionCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcQueryVersion -func (c *Conn) xvmcQueryVersionRequest() []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// Request XvmcListSurfaceTypes -// size: 8 -type XvmcListSurfaceTypesCookie struct { - *cookie -} - -func (c *Conn) XvmcListSurfaceTypes(PortId XvPort) XvmcListSurfaceTypesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) - return XvmcListSurfaceTypesCookie{cookie} -} - -func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId XvPort) XvmcListSurfaceTypesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie) - return XvmcListSurfaceTypesCookie{cookie} -} - -// Request reply for XvmcListSurfaceTypes -// size: (32 + pad((int(Num) * 24))) -type XvmcListSurfaceTypesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Num uint32 - // padding: 20 bytes - Surfaces []XvmcSurfaceInfo // size: pad((int(Num) * 24)) -} - -// Waits and reads reply data from request XvmcListSurfaceTypes -func (cook XvmcListSurfaceTypesCookie) Reply() (*XvmcListSurfaceTypesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcListSurfaceTypesReply(buf), nil -} - -// Read reply into structure from buffer for XvmcListSurfaceTypes -func xvmcListSurfaceTypesReply(buf []byte) *XvmcListSurfaceTypesReply { - v := new(XvmcListSurfaceTypesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Num = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Surfaces = make([]XvmcSurfaceInfo, v.Num) - b += ReadXvmcSurfaceInfoList(buf[b:], v.Surfaces) - - return v -} - -func (cook XvmcListSurfaceTypesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcListSurfaceTypes -func (c *Conn) xvmcListSurfaceTypesRequest(PortId XvPort) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(PortId)) - b += 4 - - return buf -} - -// Request XvmcCreateContext -// size: 24 -type XvmcCreateContextCookie struct { - *cookie -} - -func (c *Conn) XvmcCreateContext(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) - return XvmcCreateContextCookie{cookie} -} - -func (c *Conn) XvmcCreateContextUnchecked(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) - return XvmcCreateContextCookie{cookie} -} - -// Request reply for XvmcCreateContext -// size: (36 + pad((int(Length) * 4))) -type XvmcCreateContextReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - WidthActual uint16 - HeightActual uint16 - FlagsReturn uint32 - // padding: 20 bytes - PrivData []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request XvmcCreateContext -func (cook XvmcCreateContextCookie) Reply() (*XvmcCreateContextReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcCreateContextReply(buf), nil -} - -// Read reply into structure from buffer for XvmcCreateContext -func xvmcCreateContextReply(buf []byte) *XvmcCreateContextReply { - v := new(XvmcCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.WidthActual = Get16(buf[b:]) - b += 2 - - v.HeightActual = Get16(buf[b:]) - b += 2 - - v.FlagsReturn = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.PrivData = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PrivData[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XvmcCreateContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcCreateContext -func (c *Conn) xvmcCreateContextRequest(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextId)) - b += 4 - - Put32(buf[b:], uint32(PortId)) - b += 4 - - Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - Put32(buf[b:], Flags) - b += 4 - - return buf -} - -// Request XvmcDestroyContext -// size: 8 -type XvmcDestroyContextCookie struct { - *cookie -} - -// Write request to wire for XvmcDestroyContext -func (c *Conn) XvmcDestroyContext(ContextId XvmcContext) XvmcDestroyContextCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) - return XvmcDestroyContextCookie{cookie} -} - -func (c *Conn) XvmcDestroyContextChecked(ContextId XvmcContext) XvmcDestroyContextCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie) - return XvmcDestroyContextCookie{cookie} -} - -func (cook XvmcDestroyContextCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcDestroyContext -func (c *Conn) xvmcDestroyContextRequest(ContextId XvmcContext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(ContextId)) - b += 4 - - return buf -} - -// Request XvmcCreateSurface -// size: 12 -type XvmcCreateSurfaceCookie struct { - *cookie -} - -func (c *Conn) XvmcCreateSurface(SurfaceId XvmcSurface, ContextId XvmcContext) XvmcCreateSurfaceCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) - return XvmcCreateSurfaceCookie{cookie} -} - -func (c *Conn) XvmcCreateSurfaceUnchecked(SurfaceId XvmcSurface, ContextId XvmcContext) XvmcCreateSurfaceCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie) - return XvmcCreateSurfaceCookie{cookie} -} - -// Request reply for XvmcCreateSurface -// size: (32 + pad((int(Length) * 4))) -type XvmcCreateSurfaceReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - // padding: 24 bytes - PrivData []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request XvmcCreateSurface -func (cook XvmcCreateSurfaceCookie) Reply() (*XvmcCreateSurfaceReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcCreateSurfaceReply(buf), nil -} - -// Read reply into structure from buffer for XvmcCreateSurface -func xvmcCreateSurfaceReply(buf []byte) *XvmcCreateSurfaceReply { - v := new(XvmcCreateSurfaceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.PrivData = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PrivData[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XvmcCreateSurfaceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcCreateSurface -func (c *Conn) xvmcCreateSurfaceRequest(SurfaceId XvmcSurface, ContextId XvmcContext) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - Put32(buf[b:], uint32(ContextId)) - b += 4 - - return buf -} - -// Request XvmcDestroySurface -// size: 8 -type XvmcDestroySurfaceCookie struct { - *cookie -} - -// Write request to wire for XvmcDestroySurface -func (c *Conn) XvmcDestroySurface(SurfaceId XvmcSurface) XvmcDestroySurfaceCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) - return XvmcDestroySurfaceCookie{cookie} -} - -func (c *Conn) XvmcDestroySurfaceChecked(SurfaceId XvmcSurface) XvmcDestroySurfaceCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie) - return XvmcDestroySurfaceCookie{cookie} -} - -func (cook XvmcDestroySurfaceCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcDestroySurface -func (c *Conn) xvmcDestroySurfaceRequest(SurfaceId XvmcSurface) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - return buf -} - -// Request XvmcCreateSubpicture -// size: 20 -type XvmcCreateSubpictureCookie struct { - *cookie -} - -func (c *Conn) XvmcCreateSubpicture(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) - return XvmcCreateSubpictureCookie{cookie} -} - -func (c *Conn) XvmcCreateSubpictureUnchecked(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie) - return XvmcCreateSubpictureCookie{cookie} -} - -// Request reply for XvmcCreateSubpicture -// size: (32 + pad((int(Length) * 4))) -type XvmcCreateSubpictureReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - WidthActual uint16 - HeightActual uint16 - NumPaletteEntries uint16 - EntryBytes uint16 - ComponentOrder []byte // size: 4 - // padding: 12 bytes - PrivData []uint32 // size: pad((int(Length) * 4)) -} - -// Waits and reads reply data from request XvmcCreateSubpicture -func (cook XvmcCreateSubpictureCookie) Reply() (*XvmcCreateSubpictureReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcCreateSubpictureReply(buf), nil -} - -// Read reply into structure from buffer for XvmcCreateSubpicture -func xvmcCreateSubpictureReply(buf []byte) *XvmcCreateSubpictureReply { - v := new(XvmcCreateSubpictureReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.WidthActual = Get16(buf[b:]) - b += 2 - - v.HeightActual = Get16(buf[b:]) - b += 2 - - v.NumPaletteEntries = Get16(buf[b:]) - b += 2 - - v.EntryBytes = Get16(buf[b:]) - b += 2 - - v.ComponentOrder = make([]byte, 4) - copy(v.ComponentOrder[:4], buf[b:]) - b += pad(int(4)) - - b += 12 // padding - - v.PrivData = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PrivData[i] = Get32(buf[b:]) - b += 4 - } - b = pad(b) - - return v -} - -func (cook XvmcCreateSubpictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcCreateSubpicture -func (c *Conn) xvmcCreateSubpictureRequest(SubpictureId XvmcSubpicture, Context XvmcContext, XvimageId uint32, Width uint16, Height uint16) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(SubpictureId)) - b += 4 - - Put32(buf[b:], uint32(Context)) - b += 4 - - Put32(buf[b:], XvimageId) - b += 4 - - Put16(buf[b:], Width) - b += 2 - - Put16(buf[b:], Height) - b += 2 - - return buf -} - -// Request XvmcDestroySubpicture -// size: 8 -type XvmcDestroySubpictureCookie struct { - *cookie -} - -// Write request to wire for XvmcDestroySubpicture -func (c *Conn) XvmcDestroySubpicture(SubpictureId XvmcSubpicture) XvmcDestroySubpictureCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) - return XvmcDestroySubpictureCookie{cookie} -} - -func (c *Conn) XvmcDestroySubpictureChecked(SubpictureId XvmcSubpicture) XvmcDestroySubpictureCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie) - return XvmcDestroySubpictureCookie{cookie} -} - -func (cook XvmcDestroySubpictureCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcDestroySubpicture -func (c *Conn) xvmcDestroySubpictureRequest(SubpictureId XvmcSubpicture) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(SubpictureId)) - b += 4 - - return buf -} - -// Request XvmcListSubpictureTypes -// size: 12 -type XvmcListSubpictureTypesCookie struct { - *cookie -} - -func (c *Conn) XvmcListSubpictureTypes(PortId XvPort, SurfaceId XvmcSurface) XvmcListSubpictureTypesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) - return XvmcListSubpictureTypesCookie{cookie} -} - -func (c *Conn) XvmcListSubpictureTypesUnchecked(PortId XvPort, SurfaceId XvmcSurface) XvmcListSubpictureTypesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie) - return XvmcListSubpictureTypesCookie{cookie} -} - -// Request reply for XvmcListSubpictureTypes -// size: (32 + XvImageFormatInfoListSize(Types)) -type XvmcListSubpictureTypesReply struct { - Sequence uint16 - Length uint32 - // padding: 1 bytes - Num uint32 - // padding: 20 bytes - Types []XvImageFormatInfo // size: XvImageFormatInfoListSize(Types) -} - -// Waits and reads reply data from request XvmcListSubpictureTypes -func (cook XvmcListSubpictureTypesCookie) Reply() (*XvmcListSubpictureTypesReply, error) { - buf, err := cook.reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return xvmcListSubpictureTypesReply(buf), nil -} - -// Read reply into structure from buffer for XvmcListSubpictureTypes -func xvmcListSubpictureTypesReply(buf []byte) *XvmcListSubpictureTypesReply { - v := new(XvmcListSubpictureTypesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = Get16(buf[b:]) - b += 2 - - v.Length = Get32(buf[b:]) // 4-byte units - b += 4 - - v.Num = Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Types = make([]XvImageFormatInfo, v.Num) - b += ReadXvImageFormatInfoList(buf[b:], v.Types) - - return v -} - -func (cook XvmcListSubpictureTypesCookie) Check() error { - return cook.check() -} - -// Write request to wire for XvmcListSubpictureTypes -func (c *Conn) xvmcListSubpictureTypesRequest(PortId XvPort, SurfaceId XvmcSurface) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - Put32(buf[b:], uint32(PortId)) - b += 4 - - Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - return buf -} diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go new file mode 100644 index 0000000..8bb05c1 --- /dev/null +++ b/nexgb/bigreq/bigreq.go @@ -0,0 +1,140 @@ +package bigreq + +/* + This file was generated by bigreq.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the BIG-REQUESTS extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 12, "BIG-REQUESTS").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named BIG-REQUESTS could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["BIG-REQUESTS"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["BIG-REQUESTS"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["BIG-REQUESTS"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Request Enable +// size: 4 +type EnableCookie struct { + *xgb.Cookie +} + +func Enable(c *xgb.Conn) EnableCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +func EnableUnchecked(c *xgb.Conn) EnableCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +// Request reply for Enable +// size: 12 +type EnableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MaximumRequestLength uint32 +} + +// Waits and reads reply data from request Enable +func (cook EnableCookie) Reply() (*EnableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return enableReply(buf), nil +} + +// Read reply into structure from buffer for Enable +func enableReply(buf []byte) *EnableReply { + v := new(EnableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MaximumRequestLength = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for Enable +func enableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["BIG-REQUESTS"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go new file mode 100644 index 0000000..266c087 --- /dev/null +++ b/nexgb/composite/composite.go @@ -0,0 +1,575 @@ +package composite + +/* + This file was generated by composite.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xfixes" + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the Composite extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 9, "Composite").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named Composite could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["Composite"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["Composite"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["Composite"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["Composite"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + RedirectAutomatic = 0 + RedirectManual = 1 +) + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request RedirectWindow +// size: 12 +type RedirectWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for RedirectWindow +func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) + return RedirectWindowCookie{cookie} +} + +func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) + return RedirectWindowCookie{cookie} +} + +func (cook RedirectWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RedirectWindow +func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request RedirectSubwindows +// size: 12 +type RedirectSubwindowsCookie struct { + *xgb.Cookie +} + +// Write request to wire for RedirectSubwindows +func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) + return RedirectSubwindowsCookie{cookie} +} + +func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) + return RedirectSubwindowsCookie{cookie} +} + +func (cook RedirectSubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RedirectSubwindows +func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request UnredirectWindow +// size: 12 +type UnredirectWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for UnredirectWindow +func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) + return UnredirectWindowCookie{cookie} +} + +func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) + return UnredirectWindowCookie{cookie} +} + +func (cook UnredirectWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnredirectWindow +func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request UnredirectSubwindows +// size: 12 +type UnredirectSubwindowsCookie struct { + *xgb.Cookie +} + +// Write request to wire for UnredirectSubwindows +func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) + return UnredirectSubwindowsCookie{cookie} +} + +func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) + return UnredirectSubwindowsCookie{cookie} +} + +func (cook UnredirectSubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnredirectSubwindows +func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + +// Request CreateRegionFromBorderClip +// size: 12 +type CreateRegionFromBorderClipCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegionFromBorderClip +func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) + return CreateRegionFromBorderClipCookie{cookie} +} + +func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) + return CreateRegionFromBorderClipCookie{cookie} +} + +func (cook CreateRegionFromBorderClipCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromBorderClip +func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request NameWindowPixmap +// size: 12 +type NameWindowPixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for NameWindowPixmap +func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) + return NameWindowPixmapCookie{cookie} +} + +func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) + return NameWindowPixmapCookie{cookie} +} + +func (cook NameWindowPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for NameWindowPixmap +func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pixmap)) + b += 4 + + return buf +} + +// Request GetOverlayWindow +// size: 8 +type GetOverlayWindowCookie struct { + *xgb.Cookie +} + +func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getOverlayWindowRequest(c, Window), cookie) + return GetOverlayWindowCookie{cookie} +} + +func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getOverlayWindowRequest(c, Window), cookie) + return GetOverlayWindowCookie{cookie} +} + +// Request reply for GetOverlayWindow +// size: 32 +type GetOverlayWindowReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + OverlayWin xproto.Window + // padding: 20 bytes +} + +// Waits and reads reply data from request GetOverlayWindow +func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOverlayWindowReply(buf), nil +} + +// Read reply into structure from buffer for GetOverlayWindow +func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply { + v := new(GetOverlayWindowReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.OverlayWin = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for GetOverlayWindow +func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request ReleaseOverlayWindow +// size: 8 +type ReleaseOverlayWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for ReleaseOverlayWindow +func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) + return ReleaseOverlayWindowCookie{cookie} +} + +func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) + return ReleaseOverlayWindowCookie{cookie} +} + +func (cook ReleaseOverlayWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ReleaseOverlayWindow +func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/conn.go b/nexgb/conn.go index af78be9..662a059 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -38,7 +38,7 @@ func (c *Conn) connect(display string) error { return errors.New("unsupported auth protocol " + authName) } - buf := make([]byte, 12+pad(len(authName))+pad(len(authData))) + buf := make([]byte, 12+Pad(len(authName))+Pad(len(authData))) buf[0] = 0x6c buf[1] = 0 Put16(buf[2:], 11) @@ -47,7 +47,7 @@ func (c *Conn) connect(display string) error { Put16(buf[8:], uint16(len(authData))) Put16(buf[10:], 0) copy(buf[12:], []byte(authName)) - copy(buf[12+pad(len(authName)):], authData) + copy(buf[12+Pad(len(authName)):], authData) if _, err = c.conn.Write(buf); err != nil { return err } @@ -78,11 +78,14 @@ func (c *Conn) connect(display string) error { string(reason)) } - ReadSetupInfo(buf, &c.Setup) + // Unfortunately, it isn't really feasible to read the setup bytes here, + // since the code to do so is in a different package. + // Users must call 'xproto.Setup(X)' to get the setup info. + c.SetupBytes = buf - if c.defaultScreen >= len(c.Setup.Roots) { - c.defaultScreen = 0 - } + // But also read stuff that we *need* to get started. + c.setupResourceIdBase = Get32(buf[12:]) + c.setupResourceIdMask = Get32(buf[16:]) return nil } @@ -137,7 +140,7 @@ func (c *Conn) dial(display string) error { } if len(scr) != 0 { - c.defaultScreen, err = strconv.Atoi(scr) + c.DefaultScreen, err = strconv.Atoi(scr) if err != nil { return errors.New("bad display string: " + display0) } diff --git a/nexgb/cookie.go b/nexgb/cookie.go index 8c0774d..0f32990 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -4,11 +4,11 @@ import ( "errors" ) -// cookie is the internal representation of a cookie, where one is generated +// Cookie is the internal representation of a cookie, where one is generated // for *every* request sent by XGB. // 'cookie' is most frequently used by embedding it into a more specific // kind of cookie, i.e., 'GetInputFocusCookie'. -type cookie struct { +type Cookie struct { conn *Conn Sequence uint16 replyChan chan []byte @@ -22,8 +22,10 @@ type cookie struct { // function for more info on those.) // Note that a sequence number is not set until just before the request // corresponding to this cookie is sent over the wire. -func (c *Conn) newCookie(checked, reply bool) *cookie { - cookie := &cookie{ +// This function should not be used. It is exported for use in the extension +// sub-packages. +func (c *Conn) NewCookie(checked, reply bool) *Cookie { + cookie := &Cookie{ conn: c, Sequence: 0, // we add the sequence id just before sending a request replyChan: nil, @@ -60,21 +62,23 @@ func (c *Conn) newCookie(checked, reply bool) *cookie { return cookie } -// reply detects whether this is a checked or unchecked cookie, and calls +// Reply detects whether this is a checked or unchecked cookie, and calls // 'replyChecked' or 'replyUnchecked' appropriately. -func (c cookie) reply() ([]byte, error) { +// This should not be used. It is exported for use in extension sub-packages. +func (c Cookie) Reply() ([]byte, error) { // checked if c.errorChan != nil { - return c.replyChecked() + return c.ReplyChecked() } - return c.replyUnchecked() + return c.ReplyUnchecked() } -// replyChecked waits for a response on either the replyChan or errorChan +// ReplyChecked waits for a response on either the replyChan or errorChan // channels. If the former arrives, the bytes are returned with a nil error. // If the latter arrives, no bytes are returned (nil) and the error received // is returned. -func (c cookie) replyChecked() ([]byte, error) { +// This should not be used. It is exported for use in extension sub-packages. +func (c Cookie) ReplyChecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyChecked' on a cookie that " + "is not expecting a *reply* or an error.") @@ -93,13 +97,14 @@ func (c cookie) replyChecked() ([]byte, error) { panic("unreachable") } -// replyChecked waits for a response on either the replyChan or pingChan +// ReplyChecked waits for a response on either the replyChan or pingChan // channels. If the former arrives, the bytes are returned with a nil error. // If the latter arrives, no bytes are returned (nil) and a nil error // is returned. (In the latter case, the corresponding error can be retrieved // from (Wait|Poll)ForEvent asynchronously.) // In all honesty, you *probably* don't want to use this method. -func (c cookie) replyUnchecked() ([]byte, error) { +// This should not be used. It is exported for use in extension sub-packages. +func (c Cookie) ReplyUnchecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyUnchecked' on a cookie " + "that is not expecting a *reply*.") @@ -114,7 +119,7 @@ func (c cookie) replyUnchecked() ([]byte, error) { panic("unreachable") } -// check is used for checked requests that have no replies. It is a mechanism +// Check is used for checked requests that have no replies. It is a mechanism // by which to report "success" or "error" in a synchronous fashion. (Therefore, // unchecked requests without replies cannot use this method.) // If the request causes an error, it is sent to this cookie's errorChan. @@ -122,7 +127,8 @@ func (c cookie) replyUnchecked() ([]byte, error) { // Thus, pingChan is sent a value when the *next* reply is read. // If no more replies are being processed, we force a round trip request with // GetInputFocus. -func (c cookie) check() error { +// This should not be used. It is exported for use in extension sub-packages. +func (c Cookie) Check() error { if c.replyChan != nil { return errors.New("Cannot call 'Check' on a cookie that is " + "expecting a *reply*. Use 'Reply' instead.") @@ -142,7 +148,7 @@ func (c cookie) check() error { } // Now force a round trip and try again, but block this time. - c.conn.GetInputFocus().Reply() + c.conn.Sync() select { case err := <-c.errorChan: return err diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go new file mode 100644 index 0000000..8fe1e38 --- /dev/null +++ b/nexgb/damage/damage.go @@ -0,0 +1,511 @@ +package damage + +/* + This file was generated by damage.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xfixes" + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the DAMAGE extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 6, "DAMAGE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named DAMAGE could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["DAMAGE"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["DAMAGE"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["DAMAGE"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["DAMAGE"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +const ( + ReportLevelRawRectangles = 0 + ReportLevelDeltaRectangles = 1 + ReportLevelBoundingBox = 2 + ReportLevelNonEmpty = 3 +) + +type Damage uint32 + +func NewDamageId(c *xgb.Conn) (Damage, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Damage(id), nil +} + +// Event definition Notify (0) +// Size: 32 + +const Notify = 0 + +type NotifyEvent struct { + Sequence uint16 + Level byte + Drawable xproto.Drawable + Damage Damage + Timestamp xproto.Timestamp + Area xproto.Rectangle + Geometry xproto.Rectangle +} + +// Event read Notify +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number + + v.Level = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.Damage = Damage(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Area = xproto.Rectangle{} + b += xproto.RectangleRead(buf[b:], &v.Area) + + v.Geometry = xproto.Rectangle{} + b += xproto.RectangleRead(buf[b:], &v.Geometry) + + return v +} + +// Event write Notify +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Level + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Damage)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + { + structBytes := v.Area.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Geometry.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +func (v NotifyEvent) ImplementsEvent() {} + +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Level: %d", v.Level)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("Damage: %d", v.Damage)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew +} + +// Error definition BadDamage (0) +// Size: 32 + +const BadBadDamage = 0 + +type BadDamageError struct { + Sequence uint16 + NiceName string +} + +// Error read BadDamage +func BadDamageErrorNew(buf []byte) xgb.Error { + v := BadDamageError{} + v.NiceName = "BadDamage" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadDamageError) ImplementsError() {} + +func (err BadDamageError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadDamageError) BadId() uint32 { + return 0 +} + +func (err BadDamageError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadDamage {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request Create +// size: 16 +type CreateCookie struct { + *xgb.Cookie +} + +// Write request to wire for Create +func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) + return CreateCookie{cookie} +} + +func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) + return CreateCookie{cookie} +} + +func (cook CreateCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Create +func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Damage)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + buf[b] = Level + b += 1 + + b += 3 // padding + + return buf +} + +// Request Destroy +// size: 8 +type DestroyCookie struct { + *xgb.Cookie +} + +// Write request to wire for Destroy +func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyRequest(c, Damage), cookie) + return DestroyCookie{cookie} +} + +func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyRequest(c, Damage), cookie) + return DestroyCookie{cookie} +} + +func (cook DestroyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Destroy +func destroyRequest(c *xgb.Conn, Damage Damage) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Damage)) + b += 4 + + return buf +} + +// Request Subtract +// size: 16 +type SubtractCookie struct { + *xgb.Cookie +} + +// Write request to wire for Subtract +func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) + return SubtractCookie{cookie} +} + +func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) + return SubtractCookie{cookie} +} + +func (cook SubtractCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Subtract +func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Damage)) + b += 4 + + xgb.Put32(buf[b:], uint32(Repair)) + b += 4 + + xgb.Put32(buf[b:], uint32(Parts)) + b += 4 + + return buf +} + +// Request Add +// size: 12 +type AddCookie struct { + *xgb.Cookie +} + +// Write request to wire for Add +func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(addRequest(c, Drawable, Region), cookie) + return AddCookie{cookie} +} + +func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(addRequest(c, Drawable, Region), cookie) + return AddCookie{cookie} +} + +func (cook AddCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Add +func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} diff --git a/nexgb/doc.go b/nexgb/doc.go index b6c956f..91c6406 100644 --- a/nexgb/doc.go +++ b/nexgb/doc.go @@ -24,6 +24,7 @@ accompanying documentation can be found in examples/create-window. import ( "fmt" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xproto" ) func main() { @@ -33,18 +34,19 @@ accompanying documentation can be found in examples/create-window. return } - wid, _ := X.NewId() - X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + wid, _ := xproto.NewWindowId(X) + screen := xproto.Setup(X).DefaultScreen(X) + xproto.CreateWindow(X, screen.RootDepth, wid, screen.Root, 0, 0, 500, 500, 0, - xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, - xgb.CwBackPixel | xgb.CwEventMask, + xproto.WindowClassInputOutput, screen.RootVisual, + xproto.CwBackPixel | xproto.CwEventMask, []uint32{ // values must be in the order defined by the protocol 0xffffffff, - xgb.EventMaskStructureNotify | - xgb.EventMaskKeyPress | - xgb.EventMaskKeyRelease}) + xproto.EventMaskStructureNotify | + xproto.EventMaskKeyPress | + xproto.EventMaskKeyRelease}) - X.MapWindow(wid) + xproto.MapWindow(X, wid) for { ev, xerr := X.WaitForEvent() if ev == nil && xerr == nil { @@ -73,6 +75,7 @@ can be found in examples/xinerama. "fmt" "log" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xinerama" ) func main() { @@ -84,12 +87,12 @@ can be found in examples/xinerama. // Initialize the Xinerama extension. // The appropriate 'Init' function must be run for *every* // extension before any of its requests can be used. - err = X.XineramaInit() + err = xinerama.Init(X) if err != nil { log.Fatal(err) } - reply, err := X.XineramaQueryScreens().Reply() + reply, err := xinerama.QueryScreens(X).Reply() if err != nil { log.Fatal(err) } diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go new file mode 100644 index 0000000..01314ac --- /dev/null +++ b/nexgb/dpms/dpms.go @@ -0,0 +1,590 @@ +package dpms + +/* + This file was generated by dpms.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the DPMS extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 4, "DPMS").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named DPMS could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["DPMS"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["DPMS"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["DPMS"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["DPMS"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +const ( + DPMSModeOn = 0 + DPMSModeStandby = 1 + DPMSModeSuspend = 2 + DPMSModeOff = 3 +) + +// Request GetVersion +// size: 8 +type GetVersionCookie struct { + *xgb.Cookie +} + +func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} +} + +func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// Request reply for GetVersion +// size: 12 +type GetVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 +} + +// Waits and reads reply data from request GetVersion +func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVersionReply(buf), nil +} + +// Read reply into structure from buffer for GetVersion +func getVersionReply(buf []byte) *GetVersionReply { + v := new(GetVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for GetVersion +func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ClientMajorVersion) + b += 2 + + xgb.Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request Capable +// size: 4 +type CapableCookie struct { + *xgb.Cookie +} + +func Capable(c *xgb.Conn) CapableCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(capableRequest(c), cookie) + return CapableCookie{cookie} +} + +func CapableUnchecked(c *xgb.Conn) CapableCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(capableRequest(c), cookie) + return CapableCookie{cookie} +} + +// Request reply for Capable +// size: 32 +type CapableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Capable bool + // padding: 23 bytes +} + +// Waits and reads reply data from request Capable +func (cook CapableCookie) Reply() (*CapableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return capableReply(buf), nil +} + +// Read reply into structure from buffer for Capable +func capableReply(buf []byte) *CapableReply { + v := new(CapableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Capable = true + } else { + v.Capable = false + } + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for Capable +func capableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetTimeouts +// size: 4 +type GetTimeoutsCookie struct { + *xgb.Cookie +} + +func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTimeoutsRequest(c), cookie) + return GetTimeoutsCookie{cookie} +} + +func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTimeoutsRequest(c), cookie) + return GetTimeoutsCookie{cookie} +} + +// Request reply for GetTimeouts +// size: 32 +type GetTimeoutsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StandbyTimeout uint16 + SuspendTimeout uint16 + OffTimeout uint16 + // padding: 18 bytes +} + +// Waits and reads reply data from request GetTimeouts +func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTimeoutsReply(buf), nil +} + +// Read reply into structure from buffer for GetTimeouts +func getTimeoutsReply(buf []byte) *GetTimeoutsReply { + v := new(GetTimeoutsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StandbyTimeout = xgb.Get16(buf[b:]) + b += 2 + + v.SuspendTimeout = xgb.Get16(buf[b:]) + b += 2 + + v.OffTimeout = xgb.Get16(buf[b:]) + b += 2 + + b += 18 // padding + + return v +} + +// Write request to wire for GetTimeouts +func getTimeoutsRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request SetTimeouts +// size: 12 +type SetTimeoutsCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetTimeouts +func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return SetTimeoutsCookie{cookie} +} + +func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return SetTimeoutsCookie{cookie} +} + +func (cook SetTimeoutsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetTimeouts +func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], StandbyTimeout) + b += 2 + + xgb.Put16(buf[b:], SuspendTimeout) + b += 2 + + xgb.Put16(buf[b:], OffTimeout) + b += 2 + + return buf +} + +// Request Enable +// size: 4 +type EnableCookie struct { + *xgb.Cookie +} + +// Write request to wire for Enable +func Enable(c *xgb.Conn) EnableCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +func EnableChecked(c *xgb.Conn) EnableCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +func (cook EnableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Enable +func enableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Disable +// size: 4 +type DisableCookie struct { + *xgb.Cookie +} + +// Write request to wire for Disable +func Disable(c *xgb.Conn) DisableCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(disableRequest(c), cookie) + return DisableCookie{cookie} +} + +func DisableChecked(c *xgb.Conn) DisableCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(disableRequest(c), cookie) + return DisableCookie{cookie} +} + +func (cook DisableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Disable +func disableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ForceLevel +// size: 8 +type ForceLevelCookie struct { + *xgb.Cookie +} + +// Write request to wire for ForceLevel +func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) + return ForceLevelCookie{cookie} +} + +func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) + return ForceLevelCookie{cookie} +} + +func (cook ForceLevelCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ForceLevel +func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], PowerLevel) + b += 2 + + return buf +} + +// Request Info +// size: 4 +type InfoCookie struct { + *xgb.Cookie +} + +func Info(c *xgb.Conn) InfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(infoRequest(c), cookie) + return InfoCookie{cookie} +} + +func InfoUnchecked(c *xgb.Conn) InfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(infoRequest(c), cookie) + return InfoCookie{cookie} +} + +// Request reply for Info +// size: 32 +type InfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PowerLevel uint16 + State bool + // padding: 21 bytes +} + +// Waits and reads reply data from request Info +func (cook InfoCookie) Reply() (*InfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return infoReply(buf), nil +} + +// Read reply into structure from buffer for Info +func infoReply(buf []byte) *InfoReply { + v := new(InfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PowerLevel = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.State = true + } else { + v.State = false + } + b += 1 + + b += 21 // padding + + return v +} + +// Write request to wire for Info +func infoRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go new file mode 100644 index 0000000..cffe20e --- /dev/null +++ b/nexgb/dri2/dri2.go @@ -0,0 +1,1522 @@ +package dri2 + +/* + This file was generated by dri2.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the DRI2 extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 4, "DRI2").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named DRI2 could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["DRI2"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["DRI2"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["DRI2"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["DRI2"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +const ( + AttachmentBufferFrontLeft = 0 + AttachmentBufferBackLeft = 1 + AttachmentBufferFrontRight = 2 + AttachmentBufferBackRight = 3 + AttachmentBufferDepth = 4 + AttachmentBufferStencil = 5 + AttachmentBufferAccum = 6 + AttachmentBufferFakeFrontLeft = 7 + AttachmentBufferFakeFrontRight = 8 + AttachmentBufferDepthStencil = 9 + AttachmentBufferHiz = 10 +) + +const ( + DriverTypeDri = 0 + DriverTypeVdpau = 1 +) + +const ( + EventTypeExchangeComplete = 1 + EventTypeBlitComplete = 2 + EventTypeFlipComplete = 3 +) + +// 'DRI2Buffer' struct definition +// Size: 20 +type DRI2Buffer struct { + Attachment uint32 + Name uint32 + Pitch uint32 + Cpp uint32 + Flags uint32 +} + +// Struct read DRI2Buffer +func DRI2BufferRead(buf []byte, v *DRI2Buffer) int { + b := 0 + + v.Attachment = xgb.Get32(buf[b:]) + b += 4 + + v.Name = xgb.Get32(buf[b:]) + b += 4 + + v.Pitch = xgb.Get32(buf[b:]) + b += 4 + + v.Cpp = xgb.Get32(buf[b:]) + b += 4 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read DRI2Buffer +func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DRI2Buffer{} + b += DRI2BufferRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DRI2Buffer +func (v DRI2Buffer) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + xgb.Put32(buf[b:], v.Attachment) + b += 4 + + xgb.Put32(buf[b:], v.Name) + b += 4 + + xgb.Put32(buf[b:], v.Pitch) + b += 4 + + xgb.Put32(buf[b:], v.Cpp) + b += 4 + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + return buf +} + +// Write struct list DRI2Buffer +func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'AttachFormat' struct definition +// Size: 8 +type AttachFormat struct { + Attachment uint32 + Format uint32 +} + +// Struct read AttachFormat +func AttachFormatRead(buf []byte, v *AttachFormat) int { + b := 0 + + v.Attachment = xgb.Get32(buf[b:]) + b += 4 + + v.Format = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read AttachFormat +func AttachFormatReadList(buf []byte, dest []AttachFormat) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = AttachFormat{} + b += AttachFormatRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write AttachFormat +func (v AttachFormat) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], v.Attachment) + b += 4 + + xgb.Put32(buf[b:], v.Format) + b += 4 + + return buf +} + +// Write struct list AttachFormat +func AttachFormatListBytes(buf []byte, list []AttachFormat) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Event definition BufferSwapComplete (0) +// Size: 32 + +const BufferSwapComplete = 0 + +type BufferSwapCompleteEvent struct { + Sequence uint16 + // padding: 1 bytes + EventType uint16 + // padding: 2 bytes + Drawable xproto.Drawable + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + Sbc uint32 +} + +// Event read BufferSwapComplete +func BufferSwapCompleteEventNew(buf []byte) xgb.Event { + v := BufferSwapCompleteEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.EventType = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.Sbc = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Event write BufferSwapComplete +func (v BufferSwapCompleteEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put16(buf[b:], v.EventType) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], v.UstHi) + b += 4 + + xgb.Put32(buf[b:], v.UstLo) + b += 4 + + xgb.Put32(buf[b:], v.MscHi) + b += 4 + + xgb.Put32(buf[b:], v.MscLo) + b += 4 + + xgb.Put32(buf[b:], v.Sbc) + b += 4 + + return buf +} + +func (v BufferSwapCompleteEvent) ImplementsEvent() {} + +func (v BufferSwapCompleteEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v BufferSwapCompleteEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("EventType: %d", v.EventType)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("UstHi: %d", v.UstHi)) + fieldVals = append(fieldVals, xgb.Sprintf("UstLo: %d", v.UstLo)) + fieldVals = append(fieldVals, xgb.Sprintf("MscHi: %d", v.MscHi)) + fieldVals = append(fieldVals, xgb.Sprintf("MscLo: %d", v.MscLo)) + fieldVals = append(fieldVals, xgb.Sprintf("Sbc: %d", v.Sbc)) + return "BufferSwapComplete {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew +} + +// Event definition InvalidateBuffers (1) +// Size: 32 + +const InvalidateBuffers = 1 + +type InvalidateBuffersEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable xproto.Drawable +} + +// Event read InvalidateBuffers +func InvalidateBuffersEventNew(buf []byte) xgb.Event { + v := InvalidateBuffersEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Event write InvalidateBuffers +func (v InvalidateBuffersEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + return buf +} + +func (v InvalidateBuffersEvent) ImplementsEvent() {} + +func (v InvalidateBuffersEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v InvalidateBuffersEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + return "InvalidateBuffers {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 16 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request Connect +// size: 12 +type ConnectCookie struct { + *xgb.Cookie +} + +func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(connectRequest(c, Window, DriverType), cookie) + return ConnectCookie{cookie} +} + +func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(connectRequest(c, Window, DriverType), cookie) + return ConnectCookie{cookie} +} + +// Request reply for Connect +// size: (((32 + xgb.Pad((int(DriverNameLength) * 1))) + xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + xgb.Pad((int(DeviceNameLength) * 1))) +type ConnectReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DriverNameLength uint32 + DeviceNameLength uint32 + // padding: 16 bytes + DriverName string // size: xgb.Pad((int(DriverNameLength) * 1)) + AlignmentPad []byte // size: xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1)) + DeviceName string // size: xgb.Pad((int(DeviceNameLength) * 1)) +} + +// Waits and reads reply data from request Connect +func (cook ConnectCookie) Reply() (*ConnectReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return connectReply(buf), nil +} + +// Read reply into structure from buffer for Connect +func connectReply(buf []byte) *ConnectReply { + v := new(ConnectReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.DriverNameLength = xgb.Get32(buf[b:]) + b += 4 + + v.DeviceNameLength = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.DriverNameLength) + copy(byteString[:v.DriverNameLength], buf[b:]) + v.DriverName = string(byteString) + b += xgb.Pad(int(v.DriverNameLength)) + } + + v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) + copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:]) + b += xgb.Pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))) + + { + byteString := make([]byte, v.DeviceNameLength) + copy(byteString[:v.DeviceNameLength], buf[b:]) + v.DeviceName = string(byteString) + b += xgb.Pad(int(v.DeviceNameLength)) + } + + return v +} + +// Write request to wire for Connect +func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], DriverType) + b += 4 + + return buf +} + +// Request Authenticate +// size: 12 +type AuthenticateCookie struct { + *xgb.Cookie +} + +func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(authenticateRequest(c, Window, Magic), cookie) + return AuthenticateCookie{cookie} +} + +func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(authenticateRequest(c, Window, Magic), cookie) + return AuthenticateCookie{cookie} +} + +// Request reply for Authenticate +// size: 12 +type AuthenticateReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Authenticated uint32 +} + +// Waits and reads reply data from request Authenticate +func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return authenticateReply(buf), nil +} + +// Read reply into structure from buffer for Authenticate +func authenticateReply(buf []byte) *AuthenticateReply { + v := new(AuthenticateReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Authenticated = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for Authenticate +func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], Magic) + b += 4 + + return buf +} + +// Request CreateDrawable +// size: 8 +type CreateDrawableCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateDrawable +func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createDrawableRequest(c, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createDrawableRequest(c, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +func (cook CreateDrawableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateDrawable +func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request DestroyDrawable +// size: 8 +type DestroyDrawableCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyDrawable +func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +func (cook DestroyDrawableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyDrawable +func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request GetBuffers +// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 4)))) +type GetBuffersCookie struct { + *xgb.Cookie +} + +func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) + return GetBuffersCookie{cookie} +} + +func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) + return GetBuffersCookie{cookie} +} + +// Request reply for GetBuffers +// size: (32 + xgb.Pad((int(Count) * 20))) +type GetBuffersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Count uint32 + // padding: 12 bytes + Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20)) +} + +// Waits and reads reply data from request GetBuffers +func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getBuffersReply(buf), nil +} + +// Read reply into structure from buffer for GetBuffers +func getBuffersReply(buf []byte) *GetBuffersReply { + v := new(GetBuffersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = xgb.Get32(buf[b:]) + b += 4 + + v.Height = xgb.Get32(buf[b:]) + b += 4 + + v.Count = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Buffers = make([]DRI2Buffer, v.Count) + b += DRI2BufferReadList(buf[b:], v.Buffers) + + return v +} + +// Write request to wire for GetBuffers +func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], Count) + b += 4 + + for i := 0; i < int(len(Attachments)); i++ { + xgb.Put32(buf[b:], Attachments[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request CopyRegion +// size: 20 +type CopyRegionCookie struct { + *xgb.Cookie +} + +func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) + return CopyRegionCookie{cookie} +} + +func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) + return CopyRegionCookie{cookie} +} + +// Request reply for CopyRegion +// size: 8 +type CopyRegionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes +} + +// Waits and reads reply data from request CopyRegion +func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return copyRegionReply(buf), nil +} + +// Read reply into structure from buffer for CopyRegion +func copyRegionReply(buf []byte) *CopyRegionReply { + v := new(CopyRegionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for CopyRegion +func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], Region) + b += 4 + + xgb.Put32(buf[b:], Dest) + b += 4 + + xgb.Put32(buf[b:], Src) + b += 4 + + return buf +} + +// Request GetBuffersWithFormat +// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 8)))) +type GetBuffersWithFormatCookie struct { + *xgb.Cookie +} + +func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) + return GetBuffersWithFormatCookie{cookie} +} + +func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) + return GetBuffersWithFormatCookie{cookie} +} + +// Request reply for GetBuffersWithFormat +// size: (32 + xgb.Pad((int(Count) * 20))) +type GetBuffersWithFormatReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Count uint32 + // padding: 12 bytes + Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20)) +} + +// Waits and reads reply data from request GetBuffersWithFormat +func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getBuffersWithFormatReply(buf), nil +} + +// Read reply into structure from buffer for GetBuffersWithFormat +func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply { + v := new(GetBuffersWithFormatReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = xgb.Get32(buf[b:]) + b += 4 + + v.Height = xgb.Get32(buf[b:]) + b += 4 + + v.Count = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Buffers = make([]DRI2Buffer, v.Count) + b += DRI2BufferReadList(buf[b:], v.Buffers) + + return v +} + +// Write request to wire for GetBuffersWithFormat +func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], Count) + b += 4 + + b += AttachFormatListBytes(buf[b:], Attachments) + + return buf +} + +// Request SwapBuffers +// size: 32 +type SwapBuffersCookie struct { + *xgb.Cookie +} + +func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return SwapBuffersCookie{cookie} +} + +func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return SwapBuffersCookie{cookie} +} + +// Request reply for SwapBuffers +// size: 16 +type SwapBuffersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SwapHi uint32 + SwapLo uint32 +} + +// Waits and reads reply data from request SwapBuffers +func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return swapBuffersReply(buf), nil +} + +// Read reply into structure from buffer for SwapBuffers +func swapBuffersReply(buf []byte) *SwapBuffersReply { + v := new(SwapBuffersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.SwapHi = xgb.Get32(buf[b:]) + b += 4 + + v.SwapLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for SwapBuffers +func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], TargetMscHi) + b += 4 + + xgb.Put32(buf[b:], TargetMscLo) + b += 4 + + xgb.Put32(buf[b:], DivisorHi) + b += 4 + + xgb.Put32(buf[b:], DivisorLo) + b += 4 + + xgb.Put32(buf[b:], RemainderHi) + b += 4 + + xgb.Put32(buf[b:], RemainderLo) + b += 4 + + return buf +} + +// Request GetMSC +// size: 8 +type GetMSCCookie struct { + *xgb.Cookie +} + +func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMSCRequest(c, Drawable), cookie) + return GetMSCCookie{cookie} +} + +func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMSCRequest(c, Drawable), cookie) + return GetMSCCookie{cookie} +} + +// Request reply for GetMSC +// size: 32 +type GetMSCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request GetMSC +func (cook GetMSCCookie) Reply() (*GetMSCReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMSCReply(buf), nil +} + +// Read reply into structure from buffer for GetMSC +func getMSCReply(buf []byte) *GetMSCReply { + v := new(GetMSCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.SbcHi = xgb.Get32(buf[b:]) + b += 4 + + v.SbcLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetMSC +func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request WaitMSC +// size: 32 +type WaitMSCCookie struct { + *xgb.Cookie +} + +func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return WaitMSCCookie{cookie} +} + +func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) + return WaitMSCCookie{cookie} +} + +// Request reply for WaitMSC +// size: 32 +type WaitMSCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request WaitMSC +func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return waitMSCReply(buf), nil +} + +// Read reply into structure from buffer for WaitMSC +func waitMSCReply(buf []byte) *WaitMSCReply { + v := new(WaitMSCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.SbcHi = xgb.Get32(buf[b:]) + b += 4 + + v.SbcLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for WaitMSC +func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], TargetMscHi) + b += 4 + + xgb.Put32(buf[b:], TargetMscLo) + b += 4 + + xgb.Put32(buf[b:], DivisorHi) + b += 4 + + xgb.Put32(buf[b:], DivisorLo) + b += 4 + + xgb.Put32(buf[b:], RemainderHi) + b += 4 + + xgb.Put32(buf[b:], RemainderLo) + b += 4 + + return buf +} + +// Request WaitSBC +// size: 16 +type WaitSBCCookie struct { + *xgb.Cookie +} + +func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) + return WaitSBCCookie{cookie} +} + +func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) + return WaitSBCCookie{cookie} +} + +// Request reply for WaitSBC +// size: 32 +type WaitSBCReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Waits and reads reply data from request WaitSBC +func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return waitSBCReply(buf), nil +} + +// Read reply into structure from buffer for WaitSBC +func waitSBCReply(buf []byte) *WaitSBCReply { + v := new(WaitSBCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.SbcHi = xgb.Get32(buf[b:]) + b += 4 + + v.SbcLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for WaitSBC +func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], TargetSbcHi) + b += 4 + + xgb.Put32(buf[b:], TargetSbcLo) + b += 4 + + return buf +} + +// Request SwapInterval +// size: 12 +type SwapIntervalCookie struct { + *xgb.Cookie +} + +// Write request to wire for SwapInterval +func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) + return SwapIntervalCookie{cookie} +} + +func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) + return SwapIntervalCookie{cookie} +} + +func (cook SwapIntervalCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwapInterval +func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], Interval) + b += 4 + + return buf +} diff --git a/nexgb/examples/create-window/main.go b/nexgb/examples/create-window/main.go index 6996f37..73a0099 100644 --- a/nexgb/examples/create-window/main.go +++ b/nexgb/examples/create-window/main.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xproto" ) func main() { @@ -17,15 +18,23 @@ func main() { return } + // xproto.Setup retrieves the Setup information from the setup bytes + // gathered during connection. + setup := xproto.Setup(X) + + // This is the default screen with all its associated info. + screen := setup.DefaultScreen(X) + // Any time a new resource (i.e., a window, pixmap, graphics context, etc.) - // is created, we need to generate a resource identifier with NewId. - wid, _ := X.NewId() + // is created, we need to generate a resource identifier. + // If the resource is a window, then use xproto.NewWindowId. If it's for + // a pixmap, then use xproto.NewPixmapId. And so on... + wid, _ := xproto.NewWindowId(X) // CreateWindow takes a boatload of parameters. - X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + xproto.CreateWindow(X, screen.RootDepth, wid, screen.Root, 0, 0, 500, 500, 0, - xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, - 0, []uint32{}) + xproto.WindowClassInputOutput, screen.RootVisual, 0, []uint32{}) // This call to ChangeWindowAttributes could be factored out and // included with the above CreateWindow call, but it is left here for @@ -34,13 +43,13 @@ func main() { // etc.) and when a key press or a key release has been made when the // window has focus. // We also set the 'BackPixel' to white so that the window isn't butt ugly. - X.ChangeWindowAttributes(wid, - xgb.CwBackPixel|xgb.CwEventMask, + xproto.ChangeWindowAttributes(X, wid, + xproto.CwBackPixel|xproto.CwEventMask, []uint32{ // values must be in the order defined by the protocol 0xffffffff, - xgb.EventMaskStructureNotify | - xgb.EventMaskKeyPress | - xgb.EventMaskKeyRelease}) + xproto.EventMaskStructureNotify | + xproto.EventMaskKeyPress | + xproto.EventMaskKeyRelease}) // MapWindow makes the window we've created appear on the screen. // We demonstrated the use of a 'checked' request here. @@ -58,7 +67,7 @@ func main() { // // Note that requests without replies are by default unchecked while // requests *with* replies are checked by default. - err = X.MapWindowChecked(wid).Check() + err = xproto.MapWindowChecked(X, wid).Check() if err != nil { fmt.Printf("Checked Error for mapping window %d: %s\n", wid, err) } else { @@ -67,7 +76,7 @@ func main() { // This is an example of an invalid MapWindow request and what an error // looks like. - err = X.MapWindowChecked(0).Check() + err = xproto.MapWindowChecked(X, 0).Check() if err != nil { fmt.Printf("Checked Error for mapping window 0x1: %s\n", err) } else { // neva diff --git a/nexgb/examples/get-active-window/main.go b/nexgb/examples/get-active-window/main.go index e90563c..48e020c 100644 --- a/nexgb/examples/get-active-window/main.go +++ b/nexgb/examples/get-active-window/main.go @@ -7,6 +7,7 @@ import ( "log" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xproto" ) func main() { @@ -16,18 +17,21 @@ func main() { } // Get the window id of the root window. - root := X.DefaultScreen().Root + setup := xproto.Setup(X) + root := setup.DefaultScreen(X).Root // Get the atom id (i.e., intern an atom) of "_NET_ACTIVE_WINDOW". aname := "_NET_ACTIVE_WINDOW" - activeAtom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + activeAtom, err := xproto.InternAtom(X, true, uint16(len(aname)), + aname).Reply() if err != nil { log.Fatal(err) } // Get the atom id (i.e., intern an atom) of "_NET_WM_NAME". aname = "_NET_WM_NAME" - nameAtom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + nameAtom, err := xproto.InternAtom(X, true, uint16(len(aname)), + aname).Reply() if err != nil { log.Fatal(err) } @@ -37,19 +41,19 @@ func main() { // XGB helper function, 'Get32', to pull an unsigned 32-bit integer out // of the byte slice. We then convert it to an X resource id so it can // be used to get the name of the window in the next GetProperty request. - reply, err := X.GetProperty(false, root, activeAtom.Atom, - xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() + reply, err := xproto.GetProperty(X, false, root, activeAtom.Atom, + xproto.GetPropertyTypeAny, 0, (1<<32)-1).Reply() if err != nil { log.Fatal(err) } - windowId := xgb.Id(xgb.Get32(reply.Value)) + windowId := xproto.Window(xgb.Get32(reply.Value)) fmt.Printf("Active window id: %X\n", windowId) // Now get the value of _NET_WM_NAME for the active window. // Note that this time, we simply convert the resulting byte slice, // reply.Value, to a string. - reply, err = X.GetProperty(false, windowId, nameAtom.Atom, - xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() + reply, err = xproto.GetProperty(X, false, windowId, nameAtom.Atom, + xproto.GetPropertyTypeAny, 0, (1<<32)-1).Reply() if err != nil { log.Fatal(err) } diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index 5c56609..ad575ee 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -15,27 +15,32 @@ import ( "log" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/randr" + "github.com/BurntSushi/xgb/xproto" ) func main() { X, _ := xgb.NewConn() // Every extension must be initialized before it can be used. - err := X.RandrInit() + err := randr.Init(X) if err != nil { log.Fatal(err) } + // Get the root window on the default screen. + root := xproto.Setup(X).DefaultScreen(X).Root + // Gets the current screen resources. Screen resources contains a list // of names, crtcs, outputs and modes, among other things. - resources, err := X.RandrGetScreenResources(X.DefaultScreen().Root).Reply() + resources, err := randr.GetScreenResources(X, root).Reply() if err != nil { log.Fatal(err) } // Iterate through all of the outputs and show some of their info. for _, output := range resources.Outputs { - info, err := X.RandrGetOutputInfo(output, 0).Reply() + info, err := randr.GetOutputInfo(X, output, 0).Reply() if err != nil { log.Fatal(err) } @@ -52,7 +57,7 @@ func main() { // Iterate through all of the crtcs and show some of their info. for _, crtc := range resources.Crtcs { - info, err := X.RandrGetCrtcInfo(crtc, 0).Reply() + info, err := randr.GetCrtcInfo(X, crtc, 0).Reply() if err != nil { log.Fatal(err) } @@ -61,11 +66,11 @@ func main() { } // Tell RandR to send us events. (I think these are all of them, as of 1.3.) - err = X.RandrSelectInputChecked(X.DefaultScreen().Root, - xgb.RandrNotifyMaskScreenChange| - xgb.RandrNotifyMaskCrtcChange| - xgb.RandrNotifyMaskOutputChange| - xgb.RandrNotifyMaskOutputProperty).Check() + err = randr.SelectInputChecked(X, root, + randr.NotifyMaskScreenChange| + randr.NotifyMaskCrtcChange| + randr.NotifyMaskOutputChange| + randr.NotifyMaskOutputProperty).Check() if err != nil { log.Fatal(err) } diff --git a/nexgb/examples/xinerama/main.go b/nexgb/examples/xinerama/main.go index ec7f46a..896bb63 100644 --- a/nexgb/examples/xinerama/main.go +++ b/nexgb/examples/xinerama/main.go @@ -6,6 +6,7 @@ import ( "log" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xinerama" ) func main() { @@ -17,13 +18,13 @@ func main() { // Initialize the Xinerama extension. // The appropriate 'Init' function must be run for *every* // extension before any of its requests can be used. - err = X.XineramaInit() + err = xinerama.Init(X) if err != nil { log.Fatal(err) } // Issue a request to get the screen information. - reply, err := X.XineramaQueryScreens().Reply() + reply, err := xinerama.QueryScreens(X).Reply() if err != nil { log.Fatal(err) } diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go new file mode 100644 index 0000000..7753e28 --- /dev/null +++ b/nexgb/ge/ge.go @@ -0,0 +1,153 @@ +package ge + +/* + This file was generated by ge.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the Generic Event Extension extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 23, "Generic Event Extension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named Generic Event Extension could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["Generic Event Extension"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["Generic Event Extension"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["Generic Event Extension"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["Generic Event Extension"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GENERIC EVENT EXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ClientMajorVersion) + b += 2 + + xgb.Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go new file mode 100644 index 0000000..0aa2e55 --- /dev/null +++ b/nexgb/glx/glx.go @@ -0,0 +1,9168 @@ +package glx + +/* + This file was generated by glx.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the GLX extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 3, "GLX").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named GLX could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["GLX"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["GLX"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["GLX"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["GLX"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + PbcetDamaged = 32791 + PbcetSaved = 32792 +) + +const ( + PbcdtWindow = 32793 + PbcdtPbuffer = 32794 +) + +const ( + GcGlCurrentBit = 1 + GcGlPointBit = 2 + GcGlLineBit = 4 + GcGlPolygonBit = 8 + GcGlPolygonStippleBit = 16 + GcGlPixelModeBit = 32 + GcGlLightingBit = 64 + GcGlFogBit = 128 + GcGlDepthBufferBit = 256 + GcGlAccumBufferBit = 512 + GcGlStencilBufferBit = 1024 + GcGlViewportBit = 2048 + GcGlTransformBit = 4096 + GcGlEnableBit = 8192 + GcGlColorBufferBit = 16384 + GcGlHintBit = 32768 + GcGlEvalBit = 65536 + GcGlListBit = 131072 + GcGlTextureBit = 262144 + GcGlScissorBit = 524288 + GcGlAllAttribBits = 16777215 +) + +const ( + RmGlRender = 7168 + RmGlFeedback = 7169 + RmGlSelect = 7170 +) + +type Pixmap uint32 + +func NewPixmapId(c *xgb.Conn) (Pixmap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pixmap(id), nil +} + +type Context uint32 + +func NewContextId(c *xgb.Conn) (Context, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Context(id), nil +} + +type Pbuffer uint32 + +func NewPbufferId(c *xgb.Conn) (Pbuffer, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pbuffer(id), nil +} + +type Window uint32 + +func NewWindowId(c *xgb.Conn) (Window, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Window(id), nil +} + +type Fbconfig uint32 + +func NewFbconfigId(c *xgb.Conn) (Fbconfig, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Fbconfig(id), nil +} + +type Drawable uint32 + +func NewDrawableId(c *xgb.Conn) (Drawable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Drawable(id), nil +} + +type Float32 float64 + +type Float64 float64 + +type Bool32 uint32 + +type ContextTag uint32 + +// Event definition PbufferClobber (0) +// Size: 32 + +const PbufferClobber = 0 + +type PbufferClobberEvent struct { + Sequence uint16 + // padding: 1 bytes + EventType uint16 + DrawType uint16 + Drawable Drawable + BMask uint32 + AuxBuffer uint16 + X uint16 + Y uint16 + Width uint16 + Height uint16 + Count uint16 + // padding: 4 bytes +} + +// Event read PbufferClobber +func PbufferClobberEventNew(buf []byte) xgb.Event { + v := PbufferClobberEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.EventType = xgb.Get16(buf[b:]) + b += 2 + + v.DrawType = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.BMask = xgb.Get32(buf[b:]) + b += 4 + + v.AuxBuffer = xgb.Get16(buf[b:]) + b += 2 + + v.X = xgb.Get16(buf[b:]) + b += 2 + + v.Y = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Count = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + return v +} + +// Event write PbufferClobber +func (v PbufferClobberEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put16(buf[b:], v.EventType) + b += 2 + + xgb.Put16(buf[b:], v.DrawType) + b += 2 + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], v.BMask) + b += 4 + + xgb.Put16(buf[b:], v.AuxBuffer) + b += 2 + + xgb.Put16(buf[b:], v.X) + b += 2 + + xgb.Put16(buf[b:], v.Y) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.Count) + b += 2 + + b += 4 // padding + + return buf +} + +func (v PbufferClobberEvent) ImplementsEvent() {} + +func (v PbufferClobberEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v PbufferClobberEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("EventType: %d", v.EventType)) + fieldVals = append(fieldVals, xgb.Sprintf("DrawType: %d", v.DrawType)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("BMask: %d", v.BMask)) + fieldVals = append(fieldVals, xgb.Sprintf("AuxBuffer: %d", v.AuxBuffer)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + return "PbufferClobber {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["GLX"][0] = PbufferClobberEventNew +} + +// Error definition Generic (-1) +// Size: 32 + +const BadGeneric = -1 + +type GenericError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 21 bytes +} + +// Error read Generic +func GenericErrorNew(buf []byte) xgb.Error { + v := GenericError{} + v.NiceName = "Generic" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadValue = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 21 // padding + + return v +} + +func (err GenericError) ImplementsError() {} + +func (err GenericError) SequenceId() uint16 { + return err.Sequence +} + +func (err GenericError) BadId() uint32 { + return 0 +} + +func (err GenericError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGeneric {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][-1] = GenericErrorNew +} + +// ErrorCopy definition BadContext (0) + +const BadBadContext = 0 + +type BadContextError GenericError + +func BadContextErrorNew(buf []byte) xgb.Error { + v := BadContextError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContext" + return v +} + +func (err BadContextError) ImplementsError() {} + +func (err BadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadContextError) BadId() uint32 { + return 0 +} + +func (err BadContextError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][0] = BadContextErrorNew +} + +// ErrorCopy definition BadContextState (1) + +const BadBadContextState = 1 + +type BadContextStateError GenericError + +func BadContextStateErrorNew(buf []byte) xgb.Error { + v := BadContextStateError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContextState" + return v +} + +func (err BadContextStateError) ImplementsError() {} + +func (err BadContextStateError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadContextStateError) BadId() uint32 { + return 0 +} + +func (err BadContextStateError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContextState {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][1] = BadContextStateErrorNew +} + +// ErrorCopy definition BadDrawable (2) + +const BadBadDrawable = 2 + +type BadDrawableError GenericError + +func BadDrawableErrorNew(buf []byte) xgb.Error { + v := BadDrawableError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadDrawable" + return v +} + +func (err BadDrawableError) ImplementsError() {} + +func (err BadDrawableError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadDrawableError) BadId() uint32 { + return 0 +} + +func (err BadDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][2] = BadDrawableErrorNew +} + +// ErrorCopy definition BadPixmap (3) + +const BadBadPixmap = 3 + +type BadPixmapError GenericError + +func BadPixmapErrorNew(buf []byte) xgb.Error { + v := BadPixmapError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadPixmap" + return v +} + +func (err BadPixmapError) ImplementsError() {} + +func (err BadPixmapError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadPixmapError) BadId() uint32 { + return 0 +} + +func (err BadPixmapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][3] = BadPixmapErrorNew +} + +// ErrorCopy definition BadContextTag (4) + +const BadBadContextTag = 4 + +type BadContextTagError GenericError + +func BadContextTagErrorNew(buf []byte) xgb.Error { + v := BadContextTagError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContextTag" + return v +} + +func (err BadContextTagError) ImplementsError() {} + +func (err BadContextTagError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadContextTagError) BadId() uint32 { + return 0 +} + +func (err BadContextTagError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContextTag {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][4] = BadContextTagErrorNew +} + +// ErrorCopy definition BadCurrentWindow (5) + +const BadBadCurrentWindow = 5 + +type BadCurrentWindowError GenericError + +func BadCurrentWindowErrorNew(buf []byte) xgb.Error { + v := BadCurrentWindowError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadCurrentWindow" + return v +} + +func (err BadCurrentWindowError) ImplementsError() {} + +func (err BadCurrentWindowError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadCurrentWindowError) BadId() uint32 { + return 0 +} + +func (err BadCurrentWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadCurrentWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][5] = BadCurrentWindowErrorNew +} + +// ErrorCopy definition BadRenderRequest (6) + +const BadBadRenderRequest = 6 + +type BadRenderRequestError GenericError + +func BadRenderRequestErrorNew(buf []byte) xgb.Error { + v := BadRenderRequestError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadRenderRequest" + return v +} + +func (err BadRenderRequestError) ImplementsError() {} + +func (err BadRenderRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadRenderRequestError) BadId() uint32 { + return 0 +} + +func (err BadRenderRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadRenderRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][6] = BadRenderRequestErrorNew +} + +// ErrorCopy definition BadLargeRequest (7) + +const BadBadLargeRequest = 7 + +type BadLargeRequestError GenericError + +func BadLargeRequestErrorNew(buf []byte) xgb.Error { + v := BadLargeRequestError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadLargeRequest" + return v +} + +func (err BadLargeRequestError) ImplementsError() {} + +func (err BadLargeRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadLargeRequestError) BadId() uint32 { + return 0 +} + +func (err BadLargeRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadLargeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][7] = BadLargeRequestErrorNew +} + +// ErrorCopy definition UnsupportedPrivateRequest (8) + +const BadUnsupportedPrivateRequest = 8 + +type UnsupportedPrivateRequestError GenericError + +func UnsupportedPrivateRequestErrorNew(buf []byte) xgb.Error { + v := UnsupportedPrivateRequestError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "UnsupportedPrivateRequest" + return v +} + +func (err UnsupportedPrivateRequestError) ImplementsError() {} + +func (err UnsupportedPrivateRequestError) SequenceId() uint16 { + return err.Sequence +} + +func (err UnsupportedPrivateRequestError) BadId() uint32 { + return 0 +} + +func (err UnsupportedPrivateRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadUnsupportedPrivateRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][8] = UnsupportedPrivateRequestErrorNew +} + +// ErrorCopy definition BadFBConfig (9) + +const BadBadFBConfig = 9 + +type BadFBConfigError GenericError + +func BadFBConfigErrorNew(buf []byte) xgb.Error { + v := BadFBConfigError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadFBConfig" + return v +} + +func (err BadFBConfigError) ImplementsError() {} + +func (err BadFBConfigError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadFBConfigError) BadId() uint32 { + return 0 +} + +func (err BadFBConfigError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadFBConfig {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][9] = BadFBConfigErrorNew +} + +// ErrorCopy definition BadPbuffer (10) + +const BadBadPbuffer = 10 + +type BadPbufferError GenericError + +func BadPbufferErrorNew(buf []byte) xgb.Error { + v := BadPbufferError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadPbuffer" + return v +} + +func (err BadPbufferError) ImplementsError() {} + +func (err BadPbufferError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadPbufferError) BadId() uint32 { + return 0 +} + +func (err BadPbufferError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadPbuffer {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][10] = BadPbufferErrorNew +} + +// ErrorCopy definition BadCurrentDrawable (11) + +const BadBadCurrentDrawable = 11 + +type BadCurrentDrawableError GenericError + +func BadCurrentDrawableErrorNew(buf []byte) xgb.Error { + v := BadCurrentDrawableError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadCurrentDrawable" + return v +} + +func (err BadCurrentDrawableError) ImplementsError() {} + +func (err BadCurrentDrawableError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadCurrentDrawableError) BadId() uint32 { + return 0 +} + +func (err BadCurrentDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadCurrentDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][11] = BadCurrentDrawableErrorNew +} + +// ErrorCopy definition BadWindow (12) + +const BadBadWindow = 12 + +type BadWindowError GenericError + +func BadWindowErrorNew(buf []byte) xgb.Error { + v := BadWindowError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadWindow" + return v +} + +func (err BadWindowError) ImplementsError() {} + +func (err BadWindowError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadWindowError) BadId() uint32 { + return 0 +} + +func (err BadWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][12] = BadWindowErrorNew +} + +// ErrorCopy definition GLXBadProfileARB (13) + +const BadGLXBadProfileARB = 13 + +type GLXBadProfileARBError GenericError + +func GLXBadProfileARBErrorNew(buf []byte) xgb.Error { + v := GLXBadProfileARBError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "GLXBadProfileARB" + return v +} + +func (err GLXBadProfileARBError) ImplementsError() {} + +func (err GLXBadProfileARBError) SequenceId() uint16 { + return err.Sequence +} + +func (err GLXBadProfileARBError) BadId() uint32 { + return 0 +} + +func (err GLXBadProfileARBError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGLXBadProfileARB {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][13] = GLXBadProfileARBErrorNew +} + +// Request Render +// size: xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) +type RenderCookie struct { + *xgb.Cookie +} + +// Write request to wire for Render +func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(renderRequest(c, ContextTag, Data), cookie) + return RenderCookie{cookie} +} + +func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(renderRequest(c, ContextTag, Data), cookie) + return RenderCookie{cookie} +} + +func (cook RenderCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Render +func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// Request RenderLarge +// size: xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) +type RenderLargeCookie struct { + *xgb.Cookie +} + +// Write request to wire for RenderLarge +func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return RenderLargeCookie{cookie} +} + +func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return RenderLargeCookie{cookie} +} + +func (cook RenderLargeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RenderLarge +func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put16(buf[b:], RequestNum) + b += 2 + + xgb.Put16(buf[b:], RequestTotal) + b += 2 + + xgb.Put32(buf[b:], DataLen) + b += 4 + + copy(buf[b:], Data[:DataLen]) + b += xgb.Pad(int(DataLen)) + + return buf +} + +// Request CreateContext +// size: 24 +type CreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateContext +func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) + return CreateContextCookie{cookie} +} + +func CreateContextChecked(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) + return CreateContextCookie{cookie} +} + +func (cook CreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateContext +func createContextRequest(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], uint32(Visual)) + b += 4 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request DestroyContext +// size: 8 +type DestroyContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyContext +func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyContextRequest(c, Context), cookie) + return DestroyContextCookie{cookie} +} + +func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyContextRequest(c, Context), cookie) + return DestroyContextCookie{cookie} +} + +func (cook DestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyContext +func destroyContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request MakeCurrent +// size: 16 +type MakeCurrentCookie struct { + *xgb.Cookie +} + +func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) + return MakeCurrentCookie{cookie} +} + +func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) + return MakeCurrentCookie{cookie} +} + +// Request reply for MakeCurrent +// size: 32 +type MakeCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextTag ContextTag + // padding: 20 bytes +} + +// Waits and reads reply data from request MakeCurrent +func (cook MakeCurrentCookie) Reply() (*MakeCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return makeCurrentReply(buf), nil +} + +// Read reply into structure from buffer for MakeCurrent +func makeCurrentReply(buf []byte) *MakeCurrentReply { + v := new(MakeCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = ContextTag(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for MakeCurrent +func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + return buf +} + +// Request IsDirect +// size: 8 +type IsDirectCookie struct { + *xgb.Cookie +} + +func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(isDirectRequest(c, Context), cookie) + return IsDirectCookie{cookie} +} + +func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(isDirectRequest(c, Context), cookie) + return IsDirectCookie{cookie} +} + +// Request reply for IsDirect +// size: 32 +type IsDirectReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IsDirect bool + // padding: 23 bytes +} + +// Waits and reads reply data from request IsDirect +func (cook IsDirectCookie) Reply() (*IsDirectReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isDirectReply(buf), nil +} + +// Read reply into structure from buffer for IsDirect +func isDirectReply(buf []byte) *IsDirectReply { + v := new(IsDirectReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.IsDirect = true + } else { + v.IsDirect = false + } + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for IsDirect +func isDirectRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request WaitGL +// size: 8 +type WaitGLCookie struct { + *xgb.Cookie +} + +// Write request to wire for WaitGL +func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(waitGLRequest(c, ContextTag), cookie) + return WaitGLCookie{cookie} +} + +func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(waitGLRequest(c, ContextTag), cookie) + return WaitGLCookie{cookie} +} + +func (cook WaitGLCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for WaitGL +func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request WaitX +// size: 8 +type WaitXCookie struct { + *xgb.Cookie +} + +// Write request to wire for WaitX +func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(waitXRequest(c, ContextTag), cookie) + return WaitXCookie{cookie} +} + +func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(waitXRequest(c, ContextTag), cookie) + return WaitXCookie{cookie} +} + +func (cook WaitXCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for WaitX +func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request CopyContext +// size: 20 +type CopyContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for CopyContext +func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) + return CopyContextCookie{cookie} +} + +func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) + return CopyContextCookie{cookie} +} + +func (cook CopyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyContext +func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dest)) + b += 4 + + xgb.Put32(buf[b:], Mask) + b += 4 + + xgb.Put32(buf[b:], uint32(SrcContextTag)) + b += 4 + + return buf +} + +// Request SwapBuffers +// size: 12 +type SwapBuffersCookie struct { + *xgb.Cookie +} + +// Write request to wire for SwapBuffers +func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) + return SwapBuffersCookie{cookie} +} + +func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) + return SwapBuffersCookie{cookie} +} + +func (cook SwapBuffersCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwapBuffers +func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request UseXFont +// size: 24 +type UseXFontCookie struct { + *xgb.Cookie +} + +// Write request to wire for UseXFont +func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) + return UseXFontCookie{cookie} +} + +func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) + return UseXFontCookie{cookie} +} + +func (cook UseXFontCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UseXFont +func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Font)) + b += 4 + + xgb.Put32(buf[b:], First) + b += 4 + + xgb.Put32(buf[b:], Count) + b += 4 + + xgb.Put32(buf[b:], ListBase) + b += 4 + + return buf +} + +// Request CreateGLXPixmap +// size: 20 +type CreateGLXPixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateGLXPixmap +func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) + return CreateGLXPixmapCookie{cookie} +} + +func CreateGLXPixmapChecked(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) + return CreateGLXPixmapCookie{cookie} +} + +func (cook CreateGLXPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateGLXPixmap +func createGLXPixmapRequest(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Visual)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pixmap)) + b += 4 + + xgb.Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request GetVisualConfigs +// size: 8 +type GetVisualConfigsCookie struct { + *xgb.Cookie +} + +func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) + return GetVisualConfigsCookie{cookie} +} + +func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) + return GetVisualConfigsCookie{cookie} +} + +// Request reply for GetVisualConfigs +// size: (32 + xgb.Pad((int(Length) * 4))) +type GetVisualConfigsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumVisuals uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GetVisualConfigs +func (cook GetVisualConfigsCookie) Reply() (*GetVisualConfigsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVisualConfigsReply(buf), nil +} + +// Read reply into structure from buffer for GetVisualConfigs +func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { + v := new(GetVisualConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumVisuals = xgb.Get32(buf[b:]) + b += 4 + + v.NumProperties = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetVisualConfigs +func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request DestroyGLXPixmap +// size: 8 +type DestroyGLXPixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyGLXPixmap +func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) + return DestroyGLXPixmapCookie{cookie} +} + +func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) + return DestroyGLXPixmapCookie{cookie} +} + +func (cook DestroyGLXPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyGLXPixmap +func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request VendorPrivate +// size: xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) +type VendorPrivateCookie struct { + *xgb.Cookie +} + +// Write request to wire for VendorPrivate +func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateCookie{cookie} +} + +func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateCookie{cookie} +} + +func (cook VendorPrivateCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for VendorPrivate +func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], VendorCode) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// Request VendorPrivateWithReply +// size: xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) +type VendorPrivateWithReplyCookie struct { + *xgb.Cookie +} + +func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateWithReplyCookie{cookie} +} + +func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateWithReplyCookie{cookie} +} + +// Request reply for VendorPrivateWithReply +// size: (36 + xgb.Pad(((int(Length) * 4) * 1))) +type VendorPrivateWithReplyReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Retval uint32 + Data1 []byte // size: 24 + Data2 []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request VendorPrivateWithReply +func (cook VendorPrivateWithReplyCookie) Reply() (*VendorPrivateWithReplyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return vendorPrivateWithReplyReply(buf), nil +} + +// Read reply into structure from buffer for VendorPrivateWithReply +func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { + v := new(VendorPrivateWithReplyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Retval = xgb.Get32(buf[b:]) + b += 4 + + v.Data1 = make([]byte, 24) + copy(v.Data1[:24], buf[b:]) + b += xgb.Pad(int(24)) + + v.Data2 = make([]byte, (int(v.Length) * 4)) + copy(v.Data2[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for VendorPrivateWithReply +func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], VendorCode) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// Request QueryExtensionsString +// size: 8 +type QueryExtensionsStringCookie struct { + *xgb.Cookie +} + +func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) + return QueryExtensionsStringCookie{cookie} +} + +func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) + return QueryExtensionsStringCookie{cookie} +} + +// Request reply for QueryExtensionsString +// size: 32 +type QueryExtensionsStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryExtensionsString +func (cook QueryExtensionsStringCookie) Reply() (*QueryExtensionsStringReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryExtensionsStringReply(buf), nil +} + +// Read reply into structure from buffer for QueryExtensionsString +func queryExtensionsStringReply(buf []byte) *QueryExtensionsStringReply { + v := new(QueryExtensionsStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryExtensionsString +func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request QueryServerString +// size: 12 +type QueryServerStringCookie struct { + *xgb.Cookie +} + +func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) + return QueryServerStringCookie{cookie} +} + +func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) + return QueryServerStringCookie{cookie} +} + +// Request reply for QueryServerString +// size: (32 + xgb.Pad((int(StrLen) * 1))) +type QueryServerStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + StrLen uint32 + // padding: 16 bytes + String string // size: xgb.Pad((int(StrLen) * 1)) +} + +// Waits and reads reply data from request QueryServerString +func (cook QueryServerStringCookie) Reply() (*QueryServerStringReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryServerStringReply(buf), nil +} + +// Read reply into structure from buffer for QueryServerString +func queryServerStringReply(buf []byte) *QueryServerStringReply { + v := new(QueryServerStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.StrLen = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.StrLen) + copy(byteString[:v.StrLen], buf[b:]) + v.String = string(byteString) + b += xgb.Pad(int(v.StrLen)) + } + + return v +} + +// Write request to wire for QueryServerString +func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Name) + b += 4 + + return buf +} + +// Request ClientInfo +// size: xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) +type ClientInfoCookie struct { + *xgb.Cookie +} + +// Write request to wire for ClientInfo +func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) + return ClientInfoCookie{cookie} +} + +func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) + return ClientInfoCookie{cookie} +} + +func (cook ClientInfoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ClientInfo +func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], StrLen) + b += 4 + + copy(buf[b:], String[:StrLen]) + b += xgb.Pad(int(StrLen)) + + return buf +} + +// Request GetFBConfigs +// size: 8 +type GetFBConfigsCookie struct { + *xgb.Cookie +} + +func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getFBConfigsRequest(c, Screen), cookie) + return GetFBConfigsCookie{cookie} +} + +func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getFBConfigsRequest(c, Screen), cookie) + return GetFBConfigsCookie{cookie} +} + +// Request reply for GetFBConfigs +// size: (32 + xgb.Pad((int(Length) * 4))) +type GetFBConfigsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFbConfigs uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GetFBConfigs +func (cook GetFBConfigsCookie) Reply() (*GetFBConfigsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFBConfigsReply(buf), nil +} + +// Read reply into structure from buffer for GetFBConfigs +func getFBConfigsReply(buf []byte) *GetFBConfigsReply { + v := new(GetFBConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFbConfigs = xgb.Get32(buf[b:]) + b += 4 + + v.NumProperties = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetFBConfigs +func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request CreatePixmap +// size: xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +type CreatePixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreatePixmap +func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return CreatePixmapCookie{cookie} +} + +func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return CreatePixmapCookie{cookie} +} + +func (cook CreatePixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePixmap +func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pixmap)) + b += 4 + + xgb.Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + xgb.Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DestroyPixmap +// size: 8 +type DestroyPixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyPixmap +func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) + return DestroyPixmapCookie{cookie} +} + +func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) + return DestroyPixmapCookie{cookie} +} + +func (cook DestroyPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyPixmap +func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GlxPixmap)) + b += 4 + + return buf +} + +// Request CreateNewContext +// size: 28 +type CreateNewContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateNewContext +func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) + return CreateNewContextCookie{cookie} +} + +func CreateNewContextChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) + return CreateNewContextCookie{cookie} +} + +func (cook CreateNewContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateNewContext +func createNewContextRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], RenderType) + b += 4 + + xgb.Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request QueryContext +// size: 8 +type QueryContextCookie struct { + *xgb.Cookie +} + +func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryContextRequest(c, Context), cookie) + return QueryContextCookie{cookie} +} + +func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryContextRequest(c, Context), cookie) + return QueryContextCookie{cookie} +} + +// Request reply for QueryContext +// size: (32 + xgb.Pad(((int(NumAttribs) * 2) * 4))) +type QueryContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) +} + +// Waits and reads reply data from request QueryContext +func (cook QueryContextCookie) Reply() (*QueryContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryContextReply(buf), nil +} + +// Read reply into structure from buffer for QueryContext +func queryContextReply(buf []byte) *QueryContextReply { + v := new(QueryContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryContext +func queryContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request MakeContextCurrent +// size: 20 +type MakeContextCurrentCookie struct { + *xgb.Cookie +} + +func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) + return MakeContextCurrentCookie{cookie} +} + +func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) + return MakeContextCurrentCookie{cookie} +} + +// Request reply for MakeContextCurrent +// size: 32 +type MakeContextCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextTag ContextTag + // padding: 20 bytes +} + +// Waits and reads reply data from request MakeContextCurrent +func (cook MakeContextCurrentCookie) Reply() (*MakeContextCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return makeContextCurrentReply(buf), nil +} + +// Read reply into structure from buffer for MakeContextCurrent +func makeContextCurrentReply(buf []byte) *MakeContextCurrentReply { + v := new(MakeContextCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = ContextTag(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for MakeContextCurrent +func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(ReadDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request CreatePbuffer +// size: xgb.Pad((20 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +type CreatePbufferCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreatePbuffer +func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) + return CreatePbufferCookie{cookie} +} + +func CreatePbufferChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) + return CreatePbufferCookie{cookie} +} + +func (cook CreatePbufferCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePbuffer +func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((20 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pbuffer)) + b += 4 + + xgb.Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DestroyPbuffer +// size: 8 +type DestroyPbufferCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyPbuffer +func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) + return DestroyPbufferCookie{cookie} +} + +func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) + return DestroyPbufferCookie{cookie} +} + +func (cook DestroyPbufferCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyPbuffer +func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pbuffer)) + b += 4 + + return buf +} + +// Request GetDrawableAttributes +// size: 8 +type GetDrawableAttributesCookie struct { + *xgb.Cookie +} + +func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) + return GetDrawableAttributesCookie{cookie} +} + +func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) + return GetDrawableAttributesCookie{cookie} +} + +// Request reply for GetDrawableAttributes +// size: (32 + xgb.Pad(((int(NumAttribs) * 2) * 4))) +type GetDrawableAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) +} + +// Waits and reads reply data from request GetDrawableAttributes +func (cook GetDrawableAttributesCookie) Reply() (*GetDrawableAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDrawableAttributesReply(buf), nil +} + +// Read reply into structure from buffer for GetDrawableAttributes +func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { + v := new(GetDrawableAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDrawableAttributes +func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request ChangeDrawableAttributes +// size: xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +type ChangeDrawableAttributesCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeDrawableAttributes +func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) + return ChangeDrawableAttributesCookie{cookie} +} + +func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) + return ChangeDrawableAttributesCookie{cookie} +} + +func (cook ChangeDrawableAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeDrawableAttributes +func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request CreateWindow +// size: xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +type CreateWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateWindow +func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) + return CreateWindowCookie{cookie} +} + +func CreateWindowChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) + return CreateWindowCookie{cookie} +} + +func (cook CreateWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateWindow +func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(GlxWindow)) + b += 4 + + xgb.Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DeleteWindow +// size: 8 +type DeleteWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteWindow +func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) + return DeleteWindowCookie{cookie} +} + +func DeleteWindowChecked(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) + return DeleteWindowCookie{cookie} +} + +func (cook DeleteWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteWindow +func deleteWindowRequest(c *xgb.Conn, Glxwindow Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glxwindow)) + b += 4 + + return buf +} + +// Request SetClientInfoARB +// size: xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +type SetClientInfoARBCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetClientInfoARB +func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfoARBCookie{cookie} +} + +func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfoARBCookie{cookie} +} + +func (cook SetClientInfoARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientInfoARB +func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], NumVersions) + b += 4 + + xgb.Put32(buf[b:], GlStrLen) + b += 4 + + xgb.Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 2)); i++ { + xgb.Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = xgb.Pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += xgb.Pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += xgb.Pad(int(GlxStrLen)) + + return buf +} + +// Request CreateContextAttribsARB +// size: xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +type CreateContextAttribsARBCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateContextAttribsARB +func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return CreateContextAttribsARBCookie{cookie} +} + +func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return CreateContextAttribsARBCookie{cookie} +} + +func (cook CreateContextAttribsARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateContextAttribsARB +func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], uint32(Fbconfig)) + b += 4 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(ShareList)) + b += 4 + + if IsDirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], NumAttribs) + b += 4 + + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request SetClientInfo2ARB +// size: xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +type SetClientInfo2ARBCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetClientInfo2ARB +func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfo2ARBCookie{cookie} +} + +func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfo2ARBCookie{cookie} +} + +func (cook SetClientInfo2ARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientInfo2ARB +func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], NumVersions) + b += 4 + + xgb.Put32(buf[b:], GlStrLen) + b += 4 + + xgb.Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 3)); i++ { + xgb.Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = xgb.Pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += xgb.Pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += xgb.Pad(int(GlxStrLen)) + + return buf +} + +// Request NewList +// size: 16 +type NewListCookie struct { + *xgb.Cookie +} + +// Write request to wire for NewList +func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) + return NewListCookie{cookie} +} + +func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) + return NewListCookie{cookie} +} + +func (cook NewListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for NewList +func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 101 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], List) + b += 4 + + xgb.Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// Request EndList +// size: 8 +type EndListCookie struct { + *xgb.Cookie +} + +// Write request to wire for EndList +func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(endListRequest(c, ContextTag), cookie) + return EndListCookie{cookie} +} + +func EndListChecked(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(endListRequest(c, ContextTag), cookie) + return EndListCookie{cookie} +} + +func (cook EndListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for EndList +func endListRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 102 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request DeleteLists +// size: 16 +type DeleteListsCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteLists +func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) + return DeleteListsCookie{cookie} +} + +func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) + return DeleteListsCookie{cookie} +} + +func (cook DeleteListsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteLists +func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 103 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], List) + b += 4 + + xgb.Put32(buf[b:], uint32(Range)) + b += 4 + + return buf +} + +// Request GenLists +// size: 12 +type GenListsCookie struct { + *xgb.Cookie +} + +func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) + return GenListsCookie{cookie} +} + +func GenListsUnchecked(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) + return GenListsCookie{cookie} +} + +// Request reply for GenLists +// size: 12 +type GenListsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal uint32 +} + +// Waits and reads reply data from request GenLists +func (cook GenListsCookie) Reply() (*GenListsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return genListsReply(buf), nil +} + +// Read reply into structure from buffer for GenLists +func genListsReply(buf []byte) *GenListsReply { + v := new(GenListsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GenLists +func genListsRequest(c *xgb.Conn, ContextTag ContextTag, Range int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 104 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Range)) + b += 4 + + return buf +} + +// Request FeedbackBuffer +// size: 16 +type FeedbackBufferCookie struct { + *xgb.Cookie +} + +// Write request to wire for FeedbackBuffer +func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) + return FeedbackBufferCookie{cookie} +} + +func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) + return FeedbackBufferCookie{cookie} +} + +func (cook FeedbackBufferCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FeedbackBuffer +func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 105 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Size)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + return buf +} + +// Request SelectBuffer +// size: 12 +type SelectBufferCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectBuffer +func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) + return SelectBufferCookie{cookie} +} + +func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) + return SelectBufferCookie{cookie} +} + +func (cook SelectBufferCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectBuffer +func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 106 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Size)) + b += 4 + + return buf +} + +// Request RenderMode +// size: 12 +type RenderModeCookie struct { + *xgb.Cookie +} + +func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) + return RenderModeCookie{cookie} +} + +func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) + return RenderModeCookie{cookie} +} + +// Request reply for RenderMode +// size: (32 + xgb.Pad((int(N) * 4))) +type RenderModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal uint32 + N uint32 + NewMode uint32 + // padding: 12 bytes + Data []uint32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request RenderMode +func (cook RenderModeCookie) Reply() (*RenderModeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return renderModeReply(buf), nil +} + +// Read reply into structure from buffer for RenderMode +func renderModeReply(buf []byte) *RenderModeReply { + v := new(RenderModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = xgb.Get32(buf[b:]) + b += 4 + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.NewMode = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for RenderMode +func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 107 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// Request Finish +// size: 8 +type FinishCookie struct { + *xgb.Cookie +} + +func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(finishRequest(c, ContextTag), cookie) + return FinishCookie{cookie} +} + +func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(finishRequest(c, ContextTag), cookie) + return FinishCookie{cookie} +} + +// Request reply for Finish +// size: 8 +type FinishReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes +} + +// Waits and reads reply data from request Finish +func (cook FinishCookie) Reply() (*FinishReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return finishReply(buf), nil +} + +// Read reply into structure from buffer for Finish +func finishReply(buf []byte) *FinishReply { + v := new(FinishReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for Finish +func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 108 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request PixelStoref +// size: 16 +type PixelStorefCookie struct { + *xgb.Cookie +} + +// Write request to wire for PixelStoref +func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStorefCookie{cookie} +} + +func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStorefCookie{cookie} +} + +func (cook PixelStorefCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PixelStoref +func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 109 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + xgb.Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// Request PixelStorei +// size: 16 +type PixelStoreiCookie struct { + *xgb.Cookie +} + +// Write request to wire for PixelStorei +func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStoreiCookie{cookie} +} + +func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStoreiCookie{cookie} +} + +func (cook PixelStoreiCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PixelStorei +func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 110 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + xgb.Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// Request ReadPixels +// size: 36 +type ReadPixelsCookie struct { + *xgb.Cookie +} + +func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return ReadPixelsCookie{cookie} +} + +func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return ReadPixelsCookie{cookie} +} + +// Request reply for ReadPixels +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type ReadPixelsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request ReadPixels +func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return readPixelsReply(buf), nil +} + +// Read reply into structure from buffer for ReadPixels +func readPixelsReply(buf []byte) *ReadPixelsReply { + v := new(ReadPixelsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for ReadPixels +func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 111 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(X)) + b += 4 + + xgb.Put32(buf[b:], uint32(Y)) + b += 4 + + xgb.Put32(buf[b:], uint32(Width)) + b += 4 + + xgb.Put32(buf[b:], uint32(Height)) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if LsbFirst { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetBooleanv +// size: 12 +type GetBooleanvCookie struct { + *xgb.Cookie +} + +func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) + return GetBooleanvCookie{cookie} +} + +func GetBooleanvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) + return GetBooleanvCookie{cookie} +} + +// Request reply for GetBooleanv +// size: (32 + xgb.Pad((int(N) * 1))) +type GetBooleanvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum bool + // padding: 15 bytes + Data []bool // size: xgb.Pad((int(N) * 1)) +} + +// Waits and reads reply data from request GetBooleanv +func (cook GetBooleanvCookie) Reply() (*GetBooleanvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getBooleanvReply(buf), nil +} + +// Read reply into structure from buffer for GetBooleanv +func getBooleanvReply(buf []byte) *GetBooleanvReply { + v := new(GetBooleanvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.Datum = true + } else { + v.Datum = false + } + b += 1 + + b += 15 // padding + + v.Data = make([]bool, v.N) + for i := 0; i < int(v.N); i++ { + if buf[b] == 1 { + v.Data[i] = true + } else { + v.Data[i] = false + } + b += 1 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetBooleanv +func getBooleanvRequest(c *xgb.Conn, ContextTag ContextTag, Pname int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 112 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pname)) + b += 4 + + return buf +} + +// Request GetClipPlane +// size: 12 +type GetClipPlaneCookie struct { + *xgb.Cookie +} + +func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) + return GetClipPlaneCookie{cookie} +} + +func GetClipPlaneUnchecked(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) + return GetClipPlaneCookie{cookie} +} + +// Request reply for GetClipPlane +// size: (32 + xgb.Pad(((int(Length) / 2) * 8))) +type GetClipPlaneReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []Float64 // size: xgb.Pad(((int(Length) / 2) * 8)) +} + +// Waits and reads reply data from request GetClipPlane +func (cook GetClipPlaneCookie) Reply() (*GetClipPlaneReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getClipPlaneReply(buf), nil +} + +// Read reply into structure from buffer for GetClipPlane +func getClipPlaneReply(buf []byte) *GetClipPlaneReply { + v := new(GetClipPlaneReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]Float64, (int(v.Length) / 2)) + for i := 0; i < int((int(v.Length) / 2)); i++ { + v.Data[i] = Float64(xgb.Get64(buf[b:])) + b += 8 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetClipPlane +func getClipPlaneRequest(c *xgb.Conn, ContextTag ContextTag, Plane int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 113 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Plane)) + b += 4 + + return buf +} + +// Request GetDoublev +// size: 12 +type GetDoublevCookie struct { + *xgb.Cookie +} + +func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) + return GetDoublevCookie{cookie} +} + +func GetDoublevUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) + return GetDoublevCookie{cookie} +} + +// Request reply for GetDoublev +// size: (32 + xgb.Pad((int(N) * 8))) +type GetDoublevReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float64 + // padding: 8 bytes + Data []Float64 // size: xgb.Pad((int(N) * 8)) +} + +// Waits and reads reply data from request GetDoublev +func (cook GetDoublevCookie) Reply() (*GetDoublevReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDoublevReply(buf), nil +} + +// Read reply into structure from buffer for GetDoublev +func getDoublevReply(buf []byte) *GetDoublevReply { + v := new(GetDoublevReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float64(xgb.Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]Float64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float64(xgb.Get64(buf[b:])) + b += 8 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDoublev +func getDoublevRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 114 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetError +// size: 8 +type GetErrorCookie struct { + *xgb.Cookie +} + +func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getErrorRequest(c, ContextTag), cookie) + return GetErrorCookie{cookie} +} + +func GetErrorUnchecked(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getErrorRequest(c, ContextTag), cookie) + return GetErrorCookie{cookie} +} + +// Request reply for GetError +// size: 12 +type GetErrorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Error int32 +} + +// Waits and reads reply data from request GetError +func (cook GetErrorCookie) Reply() (*GetErrorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getErrorReply(buf), nil +} + +// Read reply into structure from buffer for GetError +func getErrorReply(buf []byte) *GetErrorReply { + v := new(GetErrorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Error = int32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetError +func getErrorRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 115 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request GetFloatv +// size: 12 +type GetFloatvCookie struct { + *xgb.Cookie +} + +func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) + return GetFloatvCookie{cookie} +} + +func GetFloatvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) + return GetFloatvCookie{cookie} +} + +// Request reply for GetFloatv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetFloatvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetFloatv +func (cook GetFloatvCookie) Reply() (*GetFloatvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFloatvReply(buf), nil +} + +// Read reply into structure from buffer for GetFloatv +func getFloatvReply(buf []byte) *GetFloatvReply { + v := new(GetFloatvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetFloatv +func getFloatvRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 116 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetIntegerv +// size: 12 +type GetIntegervCookie struct { + *xgb.Cookie +} + +func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) + return GetIntegervCookie{cookie} +} + +func GetIntegervUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) + return GetIntegervCookie{cookie} +} + +// Request reply for GetIntegerv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetIntegervReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetIntegerv +func (cook GetIntegervCookie) Reply() (*GetIntegervReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getIntegervReply(buf), nil +} + +// Read reply into structure from buffer for GetIntegerv +func getIntegervReply(buf []byte) *GetIntegervReply { + v := new(GetIntegervReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetIntegerv +func getIntegervRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 117 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetLightfv +// size: 16 +type GetLightfvCookie struct { + *xgb.Cookie +} + +func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) + return GetLightfvCookie{cookie} +} + +func GetLightfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) + return GetLightfvCookie{cookie} +} + +// Request reply for GetLightfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetLightfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetLightfv +func (cook GetLightfvCookie) Reply() (*GetLightfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getLightfvReply(buf), nil +} + +// Read reply into structure from buffer for GetLightfv +func getLightfvReply(buf []byte) *GetLightfvReply { + v := new(GetLightfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetLightfv +func getLightfvRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 118 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Light) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetLightiv +// size: 16 +type GetLightivCookie struct { + *xgb.Cookie +} + +func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) + return GetLightivCookie{cookie} +} + +func GetLightivUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) + return GetLightivCookie{cookie} +} + +// Request reply for GetLightiv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetLightivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetLightiv +func (cook GetLightivCookie) Reply() (*GetLightivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getLightivReply(buf), nil +} + +// Read reply into structure from buffer for GetLightiv +func getLightivReply(buf []byte) *GetLightivReply { + v := new(GetLightivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetLightiv +func getLightivRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 119 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Light) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetMapdv +// size: 16 +type GetMapdvCookie struct { + *xgb.Cookie +} + +func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) + return GetMapdvCookie{cookie} +} + +func GetMapdvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) + return GetMapdvCookie{cookie} +} + +// Request reply for GetMapdv +// size: (32 + xgb.Pad((int(N) * 8))) +type GetMapdvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float64 + // padding: 8 bytes + Data []Float64 // size: xgb.Pad((int(N) * 8)) +} + +// Waits and reads reply data from request GetMapdv +func (cook GetMapdvCookie) Reply() (*GetMapdvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMapdvReply(buf), nil +} + +// Read reply into structure from buffer for GetMapdv +func getMapdvReply(buf []byte) *GetMapdvReply { + v := new(GetMapdvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float64(xgb.Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]Float64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float64(xgb.Get64(buf[b:])) + b += 8 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMapdv +func getMapdvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 120 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GetMapfv +// size: 16 +type GetMapfvCookie struct { + *xgb.Cookie +} + +func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) + return GetMapfvCookie{cookie} +} + +func GetMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) + return GetMapfvCookie{cookie} +} + +// Request reply for GetMapfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMapfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMapfv +func (cook GetMapfvCookie) Reply() (*GetMapfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMapfvReply(buf), nil +} + +// Read reply into structure from buffer for GetMapfv +func getMapfvReply(buf []byte) *GetMapfvReply { + v := new(GetMapfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMapfv +func getMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 121 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GetMapiv +// size: 16 +type GetMapivCookie struct { + *xgb.Cookie +} + +func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) + return GetMapivCookie{cookie} +} + +func GetMapivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) + return GetMapivCookie{cookie} +} + +// Request reply for GetMapiv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMapivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMapiv +func (cook GetMapivCookie) Reply() (*GetMapivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMapivReply(buf), nil +} + +// Read reply into structure from buffer for GetMapiv +func getMapivReply(buf []byte) *GetMapivReply { + v := new(GetMapivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMapiv +func getMapivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 122 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Query) + b += 4 + + return buf +} + +// Request GetMaterialfv +// size: 16 +type GetMaterialfvCookie struct { + *xgb.Cookie +} + +func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) + return GetMaterialfvCookie{cookie} +} + +func GetMaterialfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) + return GetMaterialfvCookie{cookie} +} + +// Request reply for GetMaterialfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMaterialfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMaterialfv +func (cook GetMaterialfvCookie) Reply() (*GetMaterialfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMaterialfvReply(buf), nil +} + +// Read reply into structure from buffer for GetMaterialfv +func getMaterialfvReply(buf []byte) *GetMaterialfvReply { + v := new(GetMaterialfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMaterialfv +func getMaterialfvRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 123 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Face) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetMaterialiv +// size: 16 +type GetMaterialivCookie struct { + *xgb.Cookie +} + +func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) + return GetMaterialivCookie{cookie} +} + +func GetMaterialivUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) + return GetMaterialivCookie{cookie} +} + +// Request reply for GetMaterialiv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMaterialivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMaterialiv +func (cook GetMaterialivCookie) Reply() (*GetMaterialivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMaterialivReply(buf), nil +} + +// Read reply into structure from buffer for GetMaterialiv +func getMaterialivReply(buf []byte) *GetMaterialivReply { + v := new(GetMaterialivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMaterialiv +func getMaterialivRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 124 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Face) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetPixelMapfv +// size: 12 +type GetPixelMapfvCookie struct { + *xgb.Cookie +} + +func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) + return GetPixelMapfvCookie{cookie} +} + +func GetPixelMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) + return GetPixelMapfvCookie{cookie} +} + +// Request reply for GetPixelMapfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetPixelMapfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetPixelMapfv +func (cook GetPixelMapfvCookie) Reply() (*GetPixelMapfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPixelMapfvReply(buf), nil +} + +// Read reply into structure from buffer for GetPixelMapfv +func getPixelMapfvReply(buf []byte) *GetPixelMapfvReply { + v := new(GetPixelMapfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetPixelMapfv +func getPixelMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 125 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GetPixelMapuiv +// size: 12 +type GetPixelMapuivCookie struct { + *xgb.Cookie +} + +func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) + return GetPixelMapuivCookie{cookie} +} + +func GetPixelMapuivUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) + return GetPixelMapuivCookie{cookie} +} + +// Request reply for GetPixelMapuiv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetPixelMapuivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint32 + // padding: 12 bytes + Data []uint32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetPixelMapuiv +func (cook GetPixelMapuivCookie) Reply() (*GetPixelMapuivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPixelMapuivReply(buf), nil +} + +// Read reply into structure from buffer for GetPixelMapuiv +func getPixelMapuivReply(buf []byte) *GetPixelMapuivReply { + v := new(GetPixelMapuivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetPixelMapuiv +func getPixelMapuivRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 126 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GetPixelMapusv +// size: 12 +type GetPixelMapusvCookie struct { + *xgb.Cookie +} + +func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) + return GetPixelMapusvCookie{cookie} +} + +func GetPixelMapusvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) + return GetPixelMapusvCookie{cookie} +} + +// Request reply for GetPixelMapusv +// size: (34 + xgb.Pad((int(N) * 2))) +type GetPixelMapusvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint16 + // padding: 16 bytes + Data []uint16 // size: xgb.Pad((int(N) * 2)) +} + +// Waits and reads reply data from request GetPixelMapusv +func (cook GetPixelMapusvCookie) Reply() (*GetPixelMapusvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPixelMapusvReply(buf), nil +} + +// Read reply into structure from buffer for GetPixelMapusv +func getPixelMapusvReply(buf []byte) *GetPixelMapusvReply { + v := new(GetPixelMapusvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = xgb.Get16(buf[b:]) + b += 2 + + b += 16 // padding + + v.Data = make([]uint16, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetPixelMapusv +func getPixelMapusvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 127 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Map) + b += 4 + + return buf +} + +// Request GetPolygonStipple +// size: 12 +type GetPolygonStippleCookie struct { + *xgb.Cookie +} + +func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) + return GetPolygonStippleCookie{cookie} +} + +func GetPolygonStippleUnchecked(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) + return GetPolygonStippleCookie{cookie} +} + +// Request reply for GetPolygonStipple +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetPolygonStippleReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetPolygonStipple +func (cook GetPolygonStippleCookie) Reply() (*GetPolygonStippleReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPolygonStippleReply(buf), nil +} + +// Read reply into structure from buffer for GetPolygonStipple +func getPolygonStippleReply(buf []byte) *GetPolygonStippleReply { + v := new(GetPolygonStippleReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetPolygonStipple +func getPolygonStippleRequest(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 128 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + if LsbFirst { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetString +// size: 12 +type GetStringCookie struct { + *xgb.Cookie +} + +func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) + return GetStringCookie{cookie} +} + +func GetStringUnchecked(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) + return GetStringCookie{cookie} +} + +// Request reply for GetString +// size: (32 + xgb.Pad((int(N) * 1))) +type GetStringReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + // padding: 16 bytes + String string // size: xgb.Pad((int(N) * 1)) +} + +// Waits and reads reply data from request GetString +func (cook GetStringCookie) Reply() (*GetStringReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getStringReply(buf), nil +} + +// Read reply into structure from buffer for GetString +func getStringReply(buf []byte) *GetStringReply { + v := new(GetStringReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + { + byteString := make([]byte, v.N) + copy(byteString[:v.N], buf[b:]) + v.String = string(byteString) + b += xgb.Pad(int(v.N)) + } + + return v +} + +// Write request to wire for GetString +func getStringRequest(c *xgb.Conn, ContextTag ContextTag, Name uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 129 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Name) + b += 4 + + return buf +} + +// Request GetTexEnvfv +// size: 16 +type GetTexEnvfvCookie struct { + *xgb.Cookie +} + +func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexEnvfvCookie{cookie} +} + +func GetTexEnvfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexEnvfvCookie{cookie} +} + +// Request reply for GetTexEnvfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexEnvfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexEnvfv +func (cook GetTexEnvfvCookie) Reply() (*GetTexEnvfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexEnvfvReply(buf), nil +} + +// Read reply into structure from buffer for GetTexEnvfv +func getTexEnvfvReply(buf []byte) *GetTexEnvfvReply { + v := new(GetTexEnvfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexEnvfv +func getTexEnvfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 130 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexEnviv +// size: 16 +type GetTexEnvivCookie struct { + *xgb.Cookie +} + +func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexEnvivCookie{cookie} +} + +func GetTexEnvivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexEnvivCookie{cookie} +} + +// Request reply for GetTexEnviv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexEnvivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexEnviv +func (cook GetTexEnvivCookie) Reply() (*GetTexEnvivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexEnvivReply(buf), nil +} + +// Read reply into structure from buffer for GetTexEnviv +func getTexEnvivReply(buf []byte) *GetTexEnvivReply { + v := new(GetTexEnvivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexEnviv +func getTexEnvivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 131 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexGendv +// size: 16 +type GetTexGendvCookie struct { + *xgb.Cookie +} + +func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGendvCookie{cookie} +} + +func GetTexGendvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGendvCookie{cookie} +} + +// Request reply for GetTexGendv +// size: (32 + xgb.Pad((int(N) * 8))) +type GetTexGendvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float64 + // padding: 8 bytes + Data []Float64 // size: xgb.Pad((int(N) * 8)) +} + +// Waits and reads reply data from request GetTexGendv +func (cook GetTexGendvCookie) Reply() (*GetTexGendvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexGendvReply(buf), nil +} + +// Read reply into structure from buffer for GetTexGendv +func getTexGendvReply(buf []byte) *GetTexGendvReply { + v := new(GetTexGendvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float64(xgb.Get64(buf[b:])) + b += 8 + + b += 8 // padding + + v.Data = make([]Float64, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float64(xgb.Get64(buf[b:])) + b += 8 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexGendv +func getTexGendvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 132 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Coord) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexGenfv +// size: 16 +type GetTexGenfvCookie struct { + *xgb.Cookie +} + +func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGenfvCookie{cookie} +} + +func GetTexGenfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGenfvCookie{cookie} +} + +// Request reply for GetTexGenfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexGenfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexGenfv +func (cook GetTexGenfvCookie) Reply() (*GetTexGenfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexGenfvReply(buf), nil +} + +// Read reply into structure from buffer for GetTexGenfv +func getTexGenfvReply(buf []byte) *GetTexGenfvReply { + v := new(GetTexGenfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexGenfv +func getTexGenfvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 133 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Coord) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexGeniv +// size: 16 +type GetTexGenivCookie struct { + *xgb.Cookie +} + +func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGenivCookie{cookie} +} + +func GetTexGenivUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) + return GetTexGenivCookie{cookie} +} + +// Request reply for GetTexGeniv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexGenivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexGeniv +func (cook GetTexGenivCookie) Reply() (*GetTexGenivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexGenivReply(buf), nil +} + +// Read reply into structure from buffer for GetTexGeniv +func getTexGenivReply(buf []byte) *GetTexGenivReply { + v := new(GetTexGenivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexGeniv +func getTexGenivRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 134 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Coord) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexImage +// size: 28 +type GetTexImageCookie struct { + *xgb.Cookie +} + +func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) + return GetTexImageCookie{cookie} +} + +func GetTexImageUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) + return GetTexImageCookie{cookie} +} + +// Request reply for GetTexImage +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetTexImageReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + Height int32 + Depth int32 + // padding: 4 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetTexImage +func (cook GetTexImageCookie) Reply() (*GetTexImageReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexImageReply(buf), nil +} + +// Read reply into structure from buffer for GetTexImage +func getTexImageReply(buf []byte) *GetTexImageReply { + v := new(GetTexImageReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Height = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Depth = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 4 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetTexImage +func getTexImageRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 135 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], uint32(Level)) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetTexParameterfv +// size: 16 +type GetTexParameterfvCookie struct { + *xgb.Cookie +} + +func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterfvCookie{cookie} +} + +func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterfvCookie{cookie} +} + +// Request reply for GetTexParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexParameterfv +func (cook GetTexParameterfvCookie) Reply() (*GetTexParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetTexParameterfv +func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { + v := new(GetTexParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexParameterfv +func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 136 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexParameteriv +// size: 16 +type GetTexParameterivCookie struct { + *xgb.Cookie +} + +func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterivCookie{cookie} +} + +func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterivCookie{cookie} +} + +// Request reply for GetTexParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexParameteriv +func (cook GetTexParameterivCookie) Reply() (*GetTexParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetTexParameteriv +func getTexParameterivReply(buf []byte) *GetTexParameterivReply { + v := new(GetTexParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexParameteriv +func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 137 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexLevelParameterfv +// size: 20 +type GetTexLevelParameterfvCookie struct { + *xgb.Cookie +} + +func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) + return GetTexLevelParameterfvCookie{cookie} +} + +func GetTexLevelParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) + return GetTexLevelParameterfvCookie{cookie} +} + +// Request reply for GetTexLevelParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexLevelParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexLevelParameterfv +func (cook GetTexLevelParameterfvCookie) Reply() (*GetTexLevelParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexLevelParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetTexLevelParameterfv +func getTexLevelParameterfvReply(buf []byte) *GetTexLevelParameterfvReply { + v := new(GetTexLevelParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexLevelParameterfv +func getTexLevelParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 138 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], uint32(Level)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetTexLevelParameteriv +// size: 20 +type GetTexLevelParameterivCookie struct { + *xgb.Cookie +} + +func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) + return GetTexLevelParameterivCookie{cookie} +} + +func GetTexLevelParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) + return GetTexLevelParameterivCookie{cookie} +} + +// Request reply for GetTexLevelParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetTexLevelParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetTexLevelParameteriv +func (cook GetTexLevelParameterivCookie) Reply() (*GetTexLevelParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexLevelParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetTexLevelParameteriv +func getTexLevelParameterivReply(buf []byte) *GetTexLevelParameterivReply { + v := new(GetTexLevelParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexLevelParameteriv +func getTexLevelParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 139 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], uint32(Level)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request IsList +// size: 12 +type IsListCookie struct { + *xgb.Cookie +} + +func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(isListRequest(c, ContextTag, List), cookie) + return IsListCookie{cookie} +} + +func IsListUnchecked(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(isListRequest(c, ContextTag, List), cookie) + return IsListCookie{cookie} +} + +// Request reply for IsList +// size: 12 +type IsListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal Bool32 +} + +// Waits and reads reply data from request IsList +func (cook IsListCookie) Reply() (*IsListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isListReply(buf), nil +} + +// Read reply into structure from buffer for IsList +func isListReply(buf []byte) *IsListReply { + v := new(IsListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for IsList +func isListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 141 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], List) + b += 4 + + return buf +} + +// Request Flush +// size: 8 +type FlushCookie struct { + *xgb.Cookie +} + +// Write request to wire for Flush +func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(flushRequest(c, ContextTag), cookie) + return FlushCookie{cookie} +} + +func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(flushRequest(c, ContextTag), cookie) + return FlushCookie{cookie} +} + +func (cook FlushCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Flush +func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 142 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// Request AreTexturesResident +// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +type AreTexturesResidentCookie struct { + *xgb.Cookie +} + +func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) + return AreTexturesResidentCookie{cookie} +} + +func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) + return AreTexturesResidentCookie{cookie} +} + +// Request reply for AreTexturesResident +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type AreTexturesResidentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal Bool32 + // padding: 20 bytes + Data []bool // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request AreTexturesResident +func (cook AreTexturesResidentCookie) Reply() (*AreTexturesResidentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return areTexturesResidentReply(buf), nil +} + +// Read reply into structure from buffer for AreTexturesResident +func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { + v := new(AreTexturesResidentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]bool, (int(v.Length) * 4)) + for i := 0; i < int((int(v.Length) * 4)); i++ { + if buf[b] == 1 { + v.Data[i] = true + } else { + v.Data[i] = false + } + b += 1 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for AreTexturesResident +func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 143 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Textures[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DeleteTextures +// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +type DeleteTexturesCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteTextures +func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) + return DeleteTexturesCookie{cookie} +} + +func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) + return DeleteTexturesCookie{cookie} +} + +func (cook DeleteTexturesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteTextures +func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 144 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Textures[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GenTextures +// size: 12 +type GenTexturesCookie struct { + *xgb.Cookie +} + +func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) + return GenTexturesCookie{cookie} +} + +func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) + return GenTexturesCookie{cookie} +} + +// Request reply for GenTextures +// size: (32 + xgb.Pad((int(Length) * 4))) +type GenTexturesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GenTextures +func (cook GenTexturesCookie) Reply() (*GenTexturesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return genTexturesReply(buf), nil +} + +// Read reply into structure from buffer for GenTextures +func genTexturesReply(buf []byte) *GenTexturesReply { + v := new(GenTexturesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GenTextures +func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 145 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + return buf +} + +// Request IsTexture +// size: 12 +type IsTextureCookie struct { + *xgb.Cookie +} + +func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) + return IsTextureCookie{cookie} +} + +func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) + return IsTextureCookie{cookie} +} + +// Request reply for IsTexture +// size: 12 +type IsTextureReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal Bool32 +} + +// Waits and reads reply data from request IsTexture +func (cook IsTextureCookie) Reply() (*IsTextureReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isTextureReply(buf), nil +} + +// Read reply into structure from buffer for IsTexture +func isTextureReply(buf []byte) *IsTextureReply { + v := new(IsTextureReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for IsTexture +func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 146 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Texture) + b += 4 + + return buf +} + +// Request GetColorTable +// size: 24 +type GetColorTableCookie struct { + *xgb.Cookie +} + +func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetColorTableCookie{cookie} +} + +func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetColorTableCookie{cookie} +} + +// Request reply for GetColorTable +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetColorTableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetColorTable +func (cook GetColorTableCookie) Reply() (*GetColorTableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableReply(buf), nil +} + +// Read reply into structure from buffer for GetColorTable +func getColorTableReply(buf []byte) *GetColorTableReply { + v := new(GetColorTableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetColorTable +func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 147 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetColorTableParameterfv +// size: 16 +type GetColorTableParameterfvCookie struct { + *xgb.Cookie +} + +func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterfvCookie{cookie} +} + +func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterfvCookie{cookie} +} + +// Request reply for GetColorTableParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetColorTableParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetColorTableParameterfv +func (cook GetColorTableParameterfvCookie) Reply() (*GetColorTableParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetColorTableParameterfv +func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { + v := new(GetColorTableParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetColorTableParameterfv +func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 148 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetColorTableParameteriv +// size: 16 +type GetColorTableParameterivCookie struct { + *xgb.Cookie +} + +func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterivCookie{cookie} +} + +func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterivCookie{cookie} +} + +// Request reply for GetColorTableParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetColorTableParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetColorTableParameteriv +func (cook GetColorTableParameterivCookie) Reply() (*GetColorTableParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetColorTableParameteriv +func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { + v := new(GetColorTableParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetColorTableParameteriv +func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 149 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetConvolutionFilter +// size: 24 +type GetConvolutionFilterCookie struct { + *xgb.Cookie +} + +func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetConvolutionFilterCookie{cookie} +} + +func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetConvolutionFilterCookie{cookie} +} + +// Request reply for GetConvolutionFilter +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetConvolutionFilterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + Height int32 + // padding: 8 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetConvolutionFilter +func (cook GetConvolutionFilterCookie) Reply() (*GetConvolutionFilterReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionFilterReply(buf), nil +} + +// Read reply into structure from buffer for GetConvolutionFilter +func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { + v := new(GetConvolutionFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Height = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetConvolutionFilter +func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 150 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetConvolutionParameterfv +// size: 16 +type GetConvolutionParameterfvCookie struct { + *xgb.Cookie +} + +func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterfvCookie{cookie} +} + +func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterfvCookie{cookie} +} + +// Request reply for GetConvolutionParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetConvolutionParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetConvolutionParameterfv +func (cook GetConvolutionParameterfvCookie) Reply() (*GetConvolutionParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetConvolutionParameterfv +func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply { + v := new(GetConvolutionParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetConvolutionParameterfv +func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 151 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetConvolutionParameteriv +// size: 16 +type GetConvolutionParameterivCookie struct { + *xgb.Cookie +} + +func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterivCookie{cookie} +} + +func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterivCookie{cookie} +} + +// Request reply for GetConvolutionParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetConvolutionParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetConvolutionParameteriv +func (cook GetConvolutionParameterivCookie) Reply() (*GetConvolutionParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetConvolutionParameteriv +func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply { + v := new(GetConvolutionParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetConvolutionParameteriv +func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 152 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetSeparableFilter +// size: 24 +type GetSeparableFilterCookie struct { + *xgb.Cookie +} + +func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetSeparableFilterCookie{cookie} +} + +func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetSeparableFilterCookie{cookie} +} + +// Request reply for GetSeparableFilter +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetSeparableFilterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + RowW int32 + ColH int32 + // padding: 8 bytes + RowsAndCols []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetSeparableFilter +func (cook GetSeparableFilterCookie) Reply() (*GetSeparableFilterReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSeparableFilterReply(buf), nil +} + +// Read reply into structure from buffer for GetSeparableFilter +func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { + v := new(GetSeparableFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.RowW = int32(xgb.Get32(buf[b:])) + b += 4 + + v.ColH = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.RowsAndCols = make([]byte, (int(v.Length) * 4)) + copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetSeparableFilter +func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 153 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetHistogram +// size: 24 +type GetHistogramCookie struct { + *xgb.Cookie +} + +func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetHistogramCookie{cookie} +} + +func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetHistogramCookie{cookie} +} + +// Request reply for GetHistogram +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetHistogramReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetHistogram +func (cook GetHistogramCookie) Reply() (*GetHistogramReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramReply(buf), nil +} + +// Read reply into structure from buffer for GetHistogram +func getHistogramReply(buf []byte) *GetHistogramReply { + v := new(GetHistogramReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetHistogram +func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 154 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetHistogramParameterfv +// size: 16 +type GetHistogramParameterfvCookie struct { + *xgb.Cookie +} + +func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterfvCookie{cookie} +} + +func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterfvCookie{cookie} +} + +// Request reply for GetHistogramParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetHistogramParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetHistogramParameterfv +func (cook GetHistogramParameterfvCookie) Reply() (*GetHistogramParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetHistogramParameterfv +func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { + v := new(GetHistogramParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetHistogramParameterfv +func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 155 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetHistogramParameteriv +// size: 16 +type GetHistogramParameterivCookie struct { + *xgb.Cookie +} + +func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterivCookie{cookie} +} + +func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterivCookie{cookie} +} + +// Request reply for GetHistogramParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetHistogramParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetHistogramParameteriv +func (cook GetHistogramParameterivCookie) Reply() (*GetHistogramParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetHistogramParameteriv +func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { + v := new(GetHistogramParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetHistogramParameteriv +func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 156 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetMinmax +// size: 24 +type GetMinmaxCookie struct { + *xgb.Cookie +} + +func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetMinmaxCookie{cookie} +} + +func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetMinmaxCookie{cookie} +} + +// Request reply for GetMinmax +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetMinmaxReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetMinmax +func (cook GetMinmaxCookie) Reply() (*GetMinmaxReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxReply(buf), nil +} + +// Read reply into structure from buffer for GetMinmax +func getMinmaxReply(buf []byte) *GetMinmaxReply { + v := new(GetMinmaxReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetMinmax +func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 157 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request GetMinmaxParameterfv +// size: 16 +type GetMinmaxParameterfvCookie struct { + *xgb.Cookie +} + +func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterfvCookie{cookie} +} + +func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterfvCookie{cookie} +} + +// Request reply for GetMinmaxParameterfv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMinmaxParameterfvReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMinmaxParameterfv +func (cook GetMinmaxParameterfvCookie) Reply() (*GetMinmaxParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxParameterfvReply(buf), nil +} + +// Read reply into structure from buffer for GetMinmaxParameterfv +func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { + v := new(GetMinmaxParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMinmaxParameterfv +func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 158 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetMinmaxParameteriv +// size: 16 +type GetMinmaxParameterivCookie struct { + *xgb.Cookie +} + +func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterivCookie{cookie} +} + +func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterivCookie{cookie} +} + +// Request reply for GetMinmaxParameteriv +// size: (32 + xgb.Pad((int(N) * 4))) +type GetMinmaxParameterivReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetMinmaxParameteriv +func (cook GetMinmaxParameterivCookie) Reply() (*GetMinmaxParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxParameterivReply(buf), nil +} + +// Read reply into structure from buffer for GetMinmaxParameteriv +func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { + v := new(GetMinmaxParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMinmaxParameteriv +func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 159 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetCompressedTexImageARB +// size: 16 +type GetCompressedTexImageARBCookie struct { + *xgb.Cookie +} + +func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) + return GetCompressedTexImageARBCookie{cookie} +} + +func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) + return GetCompressedTexImageARBCookie{cookie} +} + +// Request reply for GetCompressedTexImageARB +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type GetCompressedTexImageARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 8 bytes + Size int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request GetCompressedTexImageARB +func (cook GetCompressedTexImageARBCookie) Reply() (*GetCompressedTexImageARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCompressedTexImageARBReply(buf), nil +} + +// Read reply into structure from buffer for GetCompressedTexImageARB +func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { + v := new(GetCompressedTexImageARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Size = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetCompressedTexImageARB +func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 160 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], uint32(Level)) + b += 4 + + return buf +} + +// Request DeleteQueriesARB +// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +type DeleteQueriesARBCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteQueriesARB +func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) + return DeleteQueriesARBCookie{cookie} +} + +func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) + return DeleteQueriesARBCookie{cookie} +} + +func (cook DeleteQueriesARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteQueriesARB +func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 161 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Ids[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GenQueriesARB +// size: 12 +type GenQueriesARBCookie struct { + *xgb.Cookie +} + +func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) + return GenQueriesARBCookie{cookie} +} + +func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) + return GenQueriesARBCookie{cookie} +} + +// Request reply for GenQueriesARB +// size: (32 + xgb.Pad((int(Length) * 4))) +type GenQueriesARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + Data []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GenQueriesARB +func (cook GenQueriesARBCookie) Reply() (*GenQueriesARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return genQueriesARBReply(buf), nil +} + +// Read reply into structure from buffer for GenQueriesARB +func genQueriesARBReply(buf []byte) *GenQueriesARBReply { + v := new(GenQueriesARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GenQueriesARB +func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 162 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + return buf +} + +// Request IsQueryARB +// size: 12 +type IsQueryARBCookie struct { + *xgb.Cookie +} + +func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) + return IsQueryARBCookie{cookie} +} + +func IsQueryARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) + return IsQueryARBCookie{cookie} +} + +// Request reply for IsQueryARB +// size: 12 +type IsQueryARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + RetVal Bool32 +} + +// Waits and reads reply data from request IsQueryARB +func (cook IsQueryARBCookie) Reply() (*IsQueryARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isQueryARBReply(buf), nil +} + +// Read reply into structure from buffer for IsQueryARB +func isQueryARBReply(buf []byte) *IsQueryARBReply { + v := new(IsQueryARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for IsQueryARB +func isQueryARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 163 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + return buf +} + +// Request GetQueryivARB +// size: 16 +type GetQueryivARBCookie struct { + *xgb.Cookie +} + +func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) + return GetQueryivARBCookie{cookie} +} + +func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) + return GetQueryivARBCookie{cookie} +} + +// Request reply for GetQueryivARB +// size: (32 + xgb.Pad((int(N) * 4))) +type GetQueryivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetQueryivARB +func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryivARBReply(buf), nil +} + +// Read reply into structure from buffer for GetQueryivARB +func getQueryivARBReply(buf []byte) *GetQueryivARBReply { + v := new(GetQueryivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryivARB +func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 164 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetQueryObjectivARB +// size: 16 +type GetQueryObjectivARBCookie struct { + *xgb.Cookie +} + +func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectivARBCookie{cookie} +} + +func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectivARBCookie{cookie} +} + +// Request reply for GetQueryObjectivARB +// size: (32 + xgb.Pad((int(N) * 4))) +type GetQueryObjectivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetQueryObjectivARB +func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryObjectivARBReply(buf), nil +} + +// Read reply into structure from buffer for GetQueryObjectivARB +func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { + v := new(GetQueryObjectivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryObjectivARB +func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 165 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// Request GetQueryObjectuivARB +// size: 16 +type GetQueryObjectuivARBCookie struct { + *xgb.Cookie +} + +func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectuivARBCookie{cookie} +} + +func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectuivARBCookie{cookie} +} + +// Request reply for GetQueryObjectuivARB +// size: (32 + xgb.Pad((int(N) * 4))) +type GetQueryObjectuivARBReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint32 + // padding: 12 bytes + Data []uint32 // size: xgb.Pad((int(N) * 4)) +} + +// Waits and reads reply data from request GetQueryObjectuivARB +func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryObjectuivARBReply(buf), nil +} + +// Read reply into structure from buffer for GetQueryObjectuivARB +func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { + v := new(GetQueryObjectuivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryObjectuivARB +func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 166 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go new file mode 100644 index 0000000..4d78691 --- /dev/null +++ b/nexgb/randr/randr.go @@ -0,0 +1,3964 @@ +package randr + +/* + This file was generated by randr.xml on May 10 2012 4:20:27pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/render" + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the RANDR extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 5, "RANDR").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named RANDR could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["RANDR"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["RANDR"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["RANDR"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["RANDR"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +const ( + RotationRotate0 = 1 + RotationRotate90 = 2 + RotationRotate180 = 4 + RotationRotate270 = 8 + RotationReflectX = 16 + RotationReflectY = 32 +) + +const ( + SetConfigSuccess = 0 + SetConfigInvalidConfigTime = 1 + SetConfigInvalidTime = 2 + SetConfigFailed = 3 +) + +const ( + NotifyMaskScreenChange = 1 + NotifyMaskCrtcChange = 2 + NotifyMaskOutputChange = 4 + NotifyMaskOutputProperty = 8 +) + +const ( + ModeFlagHsyncPositive = 1 + ModeFlagHsyncNegative = 2 + ModeFlagVsyncPositive = 4 + ModeFlagVsyncNegative = 8 + ModeFlagInterlace = 16 + ModeFlagDoubleScan = 32 + ModeFlagCsync = 64 + ModeFlagCsyncPositive = 128 + ModeFlagCsyncNegative = 256 + ModeFlagHskewPresent = 512 + ModeFlagBcast = 1024 + ModeFlagPixelMultiplex = 2048 + ModeFlagDoubleClock = 4096 + ModeFlagHalveClock = 8192 +) + +const ( + ConnectionConnected = 0 + ConnectionDisconnected = 1 + ConnectionUnknown = 2 +) + +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 +) + +type Mode uint32 + +func NewModeId(c *xgb.Conn) (Mode, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Mode(id), nil +} + +type Crtc uint32 + +func NewCrtcId(c *xgb.Conn) (Crtc, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Crtc(id), nil +} + +type Output uint32 + +func NewOutputId(c *xgb.Conn) (Output, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Output(id), nil +} + +// 'ScreenSize' struct definition +// Size: 8 +type ScreenSize struct { + Width uint16 + Height uint16 + Mwidth uint16 + Mheight uint16 +} + +// Struct read ScreenSize +func ScreenSizeRead(buf []byte, v *ScreenSize) int { + b := 0 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Mwidth = xgb.Get16(buf[b:]) + b += 2 + + v.Mheight = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read ScreenSize +func ScreenSizeReadList(buf []byte, dest []ScreenSize) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ScreenSize{} + b += ScreenSizeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ScreenSize +func (v ScreenSize) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.Mwidth) + b += 2 + + xgb.Put16(buf[b:], v.Mheight) + b += 2 + + return buf +} + +// Write struct list ScreenSize +func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'RefreshRates' struct definition +// Size: (2 + xgb.Pad((int(NRates) * 2))) +type RefreshRates struct { + NRates uint16 + Rates []uint16 // size: xgb.Pad((int(NRates) * 2)) +} + +// Struct read RefreshRates +func RefreshRatesRead(buf []byte, v *RefreshRates) int { + b := 0 + + v.NRates = xgb.Get16(buf[b:]) + b += 2 + + v.Rates = make([]uint16, v.NRates) + for i := 0; i < int(v.NRates); i++ { + v.Rates[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read RefreshRates +func RefreshRatesReadList(buf []byte, dest []RefreshRates) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = RefreshRates{} + b += RefreshRatesRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write RefreshRates +func (v RefreshRates) Bytes() []byte { + buf := make([]byte, (2 + xgb.Pad((int(v.NRates) * 2)))) + b := 0 + + xgb.Put16(buf[b:], v.NRates) + b += 2 + + for i := 0; i < int(v.NRates); i++ { + xgb.Put16(buf[b:], v.Rates[i]) + b += 2 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list RefreshRates +func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size RefreshRates +func RefreshRatesListSize(list []RefreshRates) int { + size := 0 + for _, item := range list { + size += (2 + xgb.Pad((int(item.NRates) * 2))) + } + return size +} + +// 'ModeInfo' struct definition +// Size: 32 +type ModeInfo struct { + Id uint32 + Width uint16 + Height uint16 + DotClock uint32 + HsyncStart uint16 + HsyncEnd uint16 + Htotal uint16 + Hskew uint16 + VsyncStart uint16 + VsyncEnd uint16 + Vtotal uint16 + NameLen uint16 + ModeFlags uint32 +} + +// Struct read ModeInfo +func ModeInfoRead(buf []byte, v *ModeInfo) int { + b := 0 + + v.Id = xgb.Get32(buf[b:]) + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.DotClock = xgb.Get32(buf[b:]) + b += 4 + + v.HsyncStart = xgb.Get16(buf[b:]) + b += 2 + + v.HsyncEnd = xgb.Get16(buf[b:]) + b += 2 + + v.Htotal = xgb.Get16(buf[b:]) + b += 2 + + v.Hskew = xgb.Get16(buf[b:]) + b += 2 + + v.VsyncStart = xgb.Get16(buf[b:]) + b += 2 + + v.VsyncEnd = xgb.Get16(buf[b:]) + b += 2 + + v.Vtotal = xgb.Get16(buf[b:]) + b += 2 + + v.NameLen = xgb.Get16(buf[b:]) + b += 2 + + v.ModeFlags = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read ModeInfo +func ModeInfoReadList(buf []byte, dest []ModeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ModeInfo{} + b += ModeInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ModeInfo +func (v ModeInfo) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + xgb.Put32(buf[b:], v.Id) + b += 4 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put32(buf[b:], v.DotClock) + b += 4 + + xgb.Put16(buf[b:], v.HsyncStart) + b += 2 + + xgb.Put16(buf[b:], v.HsyncEnd) + b += 2 + + xgb.Put16(buf[b:], v.Htotal) + b += 2 + + xgb.Put16(buf[b:], v.Hskew) + b += 2 + + xgb.Put16(buf[b:], v.VsyncStart) + b += 2 + + xgb.Put16(buf[b:], v.VsyncEnd) + b += 2 + + xgb.Put16(buf[b:], v.Vtotal) + b += 2 + + xgb.Put16(buf[b:], v.NameLen) + b += 2 + + xgb.Put32(buf[b:], v.ModeFlags) + b += 4 + + return buf +} + +// Write struct list ModeInfo +func ModeInfoListBytes(buf []byte, list []ModeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'CrtcChange' struct definition +// Size: 28 +type CrtcChange struct { + Timestamp xproto.Timestamp + Window xproto.Window + Crtc Crtc + Mode Mode + Rotation uint16 + // padding: 2 bytes + X int16 + Y int16 + Width uint16 + Height uint16 +} + +// Struct read CrtcChange +func CrtcChangeRead(buf []byte, v *CrtcChange) int { + b := 0 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Crtc = Crtc(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = Mode(xgb.Get32(buf[b:])) + b += 4 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read CrtcChange +func CrtcChangeReadList(buf []byte, dest []CrtcChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = CrtcChange{} + b += CrtcChangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write CrtcChange +func (v CrtcChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Mode)) + b += 4 + + xgb.Put16(buf[b:], v.Rotation) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// Write struct list CrtcChange +func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'OutputChange' struct definition +// Size: 28 +type OutputChange struct { + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + Window xproto.Window + Output Output + Crtc Crtc + Mode Mode + Rotation uint16 + Connection byte + SubpixelOrder byte +} + +// Struct read OutputChange +func OutputChangeRead(buf []byte, v *OutputChange) int { + b := 0 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Output = Output(xgb.Get32(buf[b:])) + b += 4 + + v.Crtc = Crtc(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = Mode(xgb.Get32(buf[b:])) + b += 4 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + v.Connection = buf[b] + b += 1 + + v.SubpixelOrder = buf[b] + b += 1 + + return b +} + +// Struct list read OutputChange +func OutputChangeReadList(buf []byte, dest []OutputChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = OutputChange{} + b += OutputChangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write OutputChange +func (v OutputChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.ConfigTimestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Mode)) + b += 4 + + xgb.Put16(buf[b:], v.Rotation) + b += 2 + + buf[b] = v.Connection + b += 1 + + buf[b] = v.SubpixelOrder + b += 1 + + return buf +} + +// Write struct list OutputChange +func OutputChangeListBytes(buf []byte, list []OutputChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'OutputProperty' struct definition +// Size: 28 +type OutputProperty struct { + Window xproto.Window + Output Output + Atom xproto.Atom + Timestamp xproto.Timestamp + Status byte + // padding: 11 bytes +} + +// Struct read OutputProperty +func OutputPropertyRead(buf []byte, v *OutputProperty) int { + b := 0 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Output = Output(xgb.Get32(buf[b:])) + b += 4 + + v.Atom = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Status = buf[b] + b += 1 + + b += 11 // padding + + return b +} + +// Struct list read OutputProperty +func OutputPropertyReadList(buf []byte, dest []OutputProperty) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = OutputProperty{} + b += OutputPropertyRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write OutputProperty +func (v OutputProperty) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Atom)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.Status + b += 1 + + b += 11 // padding + + return buf +} + +// Write struct list OutputProperty +func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Union definition NotifyDataUnion +// Note that to *create* a Union, you should *never* create +// this struct directly (unless you know what you're doing). +// Instead use one of the following constructors for 'NotifyDataUnion': +// NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion +// NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion +// NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion +type NotifyDataUnion struct { + Cc CrtcChange + Oc OutputChange + Op OutputProperty +} + +// Union constructor for NotifyDataUnion for field Cc. +func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Cc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// Union constructor for NotifyDataUnion for field Oc. +func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Oc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// Union constructor for NotifyDataUnion for field Op. +func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Op.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// Union read NotifyDataUnion +func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { + var b int + + b = 0 // re-read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // re-read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // re-read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return 28 +} + +// Union list read NotifyDataUnion +func NotifyDataUnionReadList(buf []byte, dest []NotifyDataUnion) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = NotifyDataUnion{} + b += NotifyDataUnionRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Union write NotifyDataUnion +// Each field in a union must contain the same data. +// So simply pick the first field and write that to the wire. +func (v NotifyDataUnion) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + { + structBytes := v.Cc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return buf +} + +// Union list write NotifyDataUnion +func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { + b := 0 + var unionBytes []byte + for _, item := range list { + unionBytes = item.Bytes() + copy(buf[b:], unionBytes) + b += xgb.Pad(len(unionBytes)) + } + return b +} + +// Event definition ScreenChangeNotify (0) +// Size: 32 + +const ScreenChangeNotify = 0 + +type ScreenChangeNotifyEvent struct { + Sequence uint16 + Rotation byte + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + Root xproto.Window + RequestWindow xproto.Window + SizeID uint16 + SubpixelOrder uint16 + Width uint16 + Height uint16 + Mwidth uint16 + Mheight uint16 +} + +// Event read ScreenChangeNotify +func ScreenChangeNotifyEventNew(buf []byte) xgb.Event { + v := ScreenChangeNotifyEvent{} + b := 1 // don't read event number + + v.Rotation = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.RequestWindow = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.SizeID = xgb.Get16(buf[b:]) + b += 2 + + v.SubpixelOrder = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Mwidth = xgb.Get16(buf[b:]) + b += 2 + + v.Mheight = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Event write ScreenChangeNotify +func (v ScreenChangeNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Rotation + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.ConfigTimestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.RequestWindow)) + b += 4 + + xgb.Put16(buf[b:], v.SizeID) + b += 2 + + xgb.Put16(buf[b:], v.SubpixelOrder) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.Mwidth) + b += 2 + + xgb.Put16(buf[b:], v.Mheight) + b += 2 + + return buf +} + +func (v ScreenChangeNotifyEvent) ImplementsEvent() {} + +func (v ScreenChangeNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ScreenChangeNotifyEvent) String() string { + fieldVals := make([]string, 0, 11) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Rotation: %d", v.Rotation)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("ConfigTimestamp: %d", v.ConfigTimestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("RequestWindow: %d", v.RequestWindow)) + fieldVals = append(fieldVals, xgb.Sprintf("SizeID: %d", v.SizeID)) + fieldVals = append(fieldVals, xgb.Sprintf("SubpixelOrder: %d", v.SubpixelOrder)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("Mwidth: %d", v.Mwidth)) + fieldVals = append(fieldVals, xgb.Sprintf("Mheight: %d", v.Mheight)) + return "ScreenChangeNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["RANDR"][0] = ScreenChangeNotifyEventNew +} + +// Event definition Notify (1) +// Size: 32 + +const Notify = 1 + +type NotifyEvent struct { + Sequence uint16 + SubCode byte + U NotifyDataUnion +} + +// Event read Notify +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number + + v.SubCode = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.U = NotifyDataUnion{} + b += NotifyDataUnionRead(buf[b:], &v.U) + + return v +} + +// Event write Notify +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.SubCode + b += 1 + + b += 2 // skip sequence number + + { + unionBytes := v.U.Bytes() + copy(buf[b:], unionBytes) + b += xgb.Pad(len(unionBytes)) + } + + return buf +} + +func (v NotifyEvent) ImplementsEvent() {} + +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("SubCode: %d", v.SubCode)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew +} + +// Error definition BadOutput (0) +// Size: 32 + +const BadBadOutput = 0 + +type BadOutputError struct { + Sequence uint16 + NiceName string +} + +// Error read BadOutput +func BadOutputErrorNew(buf []byte) xgb.Error { + v := BadOutputError{} + v.NiceName = "BadOutput" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadOutputError) ImplementsError() {} + +func (err BadOutputError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadOutputError) BadId() uint32 { + return 0 +} + +func (err BadOutputError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadOutput {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][0] = BadOutputErrorNew +} + +// Error definition BadCrtc (1) +// Size: 32 + +const BadBadCrtc = 1 + +type BadCrtcError struct { + Sequence uint16 + NiceName string +} + +// Error read BadCrtc +func BadCrtcErrorNew(buf []byte) xgb.Error { + v := BadCrtcError{} + v.NiceName = "BadCrtc" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadCrtcError) ImplementsError() {} + +func (err BadCrtcError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadCrtcError) BadId() uint32 { + return 0 +} + +func (err BadCrtcError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadCrtc {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][1] = BadCrtcErrorNew +} + +// Error definition BadMode (2) +// Size: 32 + +const BadBadMode = 2 + +type BadModeError struct { + Sequence uint16 + NiceName string +} + +// Error read BadMode +func BadModeErrorNew(buf []byte) xgb.Error { + v := BadModeError{} + v.NiceName = "BadMode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadModeError) ImplementsError() {} + +func (err BadModeError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadModeError) BadId() uint32 { + return 0 +} + +func (err BadModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][2] = BadModeErrorNew +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// Request SetScreenConfig +// size: 24 +type SetScreenConfigCookie struct { + *xgb.Cookie +} + +func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return SetScreenConfigCookie{cookie} +} + +func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return SetScreenConfigCookie{cookie} +} + +// Request reply for SetScreenConfig +// size: 32 +type SetScreenConfigReply struct { + Sequence uint16 + Length uint32 + Status byte + NewTimestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + Root xproto.Window + SubpixelOrder uint16 + // padding: 10 bytes +} + +// Waits and reads reply data from request SetScreenConfig +func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setScreenConfigReply(buf), nil +} + +// Read reply into structure from buffer for SetScreenConfig +func setScreenConfigReply(buf []byte) *SetScreenConfigReply { + v := new(SetScreenConfigReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NewTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.SubpixelOrder = xgb.Get16(buf[b:]) + b += 2 + + b += 10 // padding + + return v +} + +// Write request to wire for SetScreenConfig +func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + xgb.Put16(buf[b:], SizeID) + b += 2 + + xgb.Put16(buf[b:], Rotation) + b += 2 + + xgb.Put16(buf[b:], Rate) + b += 2 + + b += 2 // padding + + return buf +} + +// Request SelectInput +// size: 12 +type SelectInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectInput +func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectInputRequest(c, Window, Enable), cookie) + return SelectInputCookie{cookie} +} + +func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectInputRequest(c, Window, Enable), cookie) + return SelectInputCookie{cookie} +} + +func (cook SelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectInput +func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], Enable) + b += 2 + + b += 2 // padding + + return buf +} + +// Request GetScreenInfo +// size: 8 +type GetScreenInfoCookie struct { + *xgb.Cookie +} + +func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenInfoRequest(c, Window), cookie) + return GetScreenInfoCookie{cookie} +} + +func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenInfoRequest(c, Window), cookie) + return GetScreenInfoCookie{cookie} +} + +// Request reply for GetScreenInfo +// size: ((32 + xgb.Pad((int(NSizes) * 8))) + RefreshRatesListSize(Rates)) +type GetScreenInfoReply struct { + Sequence uint16 + Length uint32 + Rotations byte + Root xproto.Window + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NSizes uint16 + SizeID uint16 + Rotation uint16 + Rate uint16 + NInfo uint16 + // padding: 2 bytes + Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) + Rates []RefreshRates // size: RefreshRatesListSize(Rates) +} + +// Waits and reads reply data from request GetScreenInfo +func (cook GetScreenInfoCookie) Reply() (*GetScreenInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenInfoReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenInfo +func getScreenInfoReply(buf []byte) *GetScreenInfoReply { + v := new(GetScreenInfoReply) + b := 1 // skip reply determinant + + v.Rotations = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NSizes = xgb.Get16(buf[b:]) + b += 2 + + v.SizeID = xgb.Get16(buf[b:]) + b += 2 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + v.Rate = xgb.Get16(buf[b:]) + b += 2 + + v.NInfo = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Sizes = make([]ScreenSize, v.NSizes) + b += ScreenSizeReadList(buf[b:], v.Sizes) + + v.Rates = make([]RefreshRates, (int(v.NInfo) - int(v.NSizes))) + b += RefreshRatesReadList(buf[b:], v.Rates) + + return v +} + +// Write request to wire for GetScreenInfo +func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request GetScreenSizeRange +// size: 8 +type GetScreenSizeRangeCookie struct { + *xgb.Cookie +} + +func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) + return GetScreenSizeRangeCookie{cookie} +} + +func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) + return GetScreenSizeRangeCookie{cookie} +} + +// Request reply for GetScreenSizeRange +// size: 32 +type GetScreenSizeRangeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MinWidth uint16 + MinHeight uint16 + MaxWidth uint16 + MaxHeight uint16 + // padding: 16 bytes +} + +// Waits and reads reply data from request GetScreenSizeRange +func (cook GetScreenSizeRangeCookie) Reply() (*GetScreenSizeRangeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenSizeRangeReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenSizeRange +func getScreenSizeRangeReply(buf []byte) *GetScreenSizeRangeReply { + v := new(GetScreenSizeRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinWidth = xgb.Get16(buf[b:]) + b += 2 + + v.MinHeight = xgb.Get16(buf[b:]) + b += 2 + + v.MaxWidth = xgb.Get16(buf[b:]) + b += 2 + + v.MaxHeight = xgb.Get16(buf[b:]) + b += 2 + + b += 16 // padding + + return v +} + +// Write request to wire for GetScreenSizeRange +func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request SetScreenSize +// size: 20 +type SetScreenSizeCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetScreenSize +func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) + return SetScreenSizeCookie{cookie} +} + +func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) + return SetScreenSizeCookie{cookie} +} + +func (cook SetScreenSizeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetScreenSize +func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], MmWidth) + b += 4 + + xgb.Put32(buf[b:], MmHeight) + b += 4 + + return buf +} + +// Request GetScreenResources +// size: 8 +type GetScreenResourcesCookie struct { + *xgb.Cookie +} + +func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenResourcesRequest(c, Window), cookie) + return GetScreenResourcesCookie{cookie} +} + +func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenResourcesRequest(c, Window), cookie) + return GetScreenResourcesCookie{cookie} +} + +// Request reply for GetScreenResources +// size: ((((32 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumModes) * 32))) + xgb.Pad((int(NamesLen) * 1))) +type GetScreenResourcesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) +} + +// Waits and reads reply data from request GetScreenResources +func (cook GetScreenResourcesCookie) Reply() (*GetScreenResourcesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenResourcesReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenResources +func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { + v := new(GetScreenResourcesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumModes = xgb.Get16(buf[b:]) + b += 2 + + v.NamesLen = xgb.Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Modes = make([]ModeInfo, v.NumModes) + b += ModeInfoReadList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += xgb.Pad(int(v.NamesLen)) + + return v +} + +// Write request to wire for GetScreenResources +func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request GetOutputInfo +// size: 12 +type GetOutputInfoCookie struct { + *xgb.Cookie +} + +func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) + return GetOutputInfoCookie{cookie} +} + +func GetOutputInfoUnchecked(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) + return GetOutputInfoCookie{cookie} +} + +// Request reply for GetOutputInfo +// size: ((((36 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumModes) * 4))) + xgb.Pad((int(NumClones) * 4))) + xgb.Pad((int(NameLen) * 1))) +type GetOutputInfoReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp xproto.Timestamp + Crtc Crtc + MmWidth uint32 + MmHeight uint32 + Connection byte + SubpixelOrder byte + NumCrtcs uint16 + NumModes uint16 + NumPreferred uint16 + NumClones uint16 + NameLen uint16 + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Modes []Mode // size: xgb.Pad((int(NumModes) * 4)) + Clones []Output // size: xgb.Pad((int(NumClones) * 4)) + Name []byte // size: xgb.Pad((int(NameLen) * 1)) +} + +// Waits and reads reply data from request GetOutputInfo +func (cook GetOutputInfoCookie) Reply() (*GetOutputInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOutputInfoReply(buf), nil +} + +// Read reply into structure from buffer for GetOutputInfo +func getOutputInfoReply(buf []byte) *GetOutputInfoReply { + v := new(GetOutputInfoReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Crtc = Crtc(xgb.Get32(buf[b:])) + b += 4 + + v.MmWidth = xgb.Get32(buf[b:]) + b += 4 + + v.MmHeight = xgb.Get32(buf[b:]) + b += 4 + + v.Connection = buf[b] + b += 1 + + v.SubpixelOrder = buf[b] + b += 1 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumModes = xgb.Get16(buf[b:]) + b += 2 + + v.NumPreferred = xgb.Get16(buf[b:]) + b += 2 + + v.NumClones = xgb.Get16(buf[b:]) + b += 2 + + v.NameLen = xgb.Get16(buf[b:]) + b += 2 + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Modes = make([]Mode, v.NumModes) + for i := 0; i < int(v.NumModes); i++ { + v.Modes[i] = Mode(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Clones = make([]Output, v.NumClones) + for i := 0; i < int(v.NumClones); i++ { + v.Clones[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Name = make([]byte, v.NameLen) + copy(v.Name[:v.NameLen], buf[b:]) + b += xgb.Pad(int(v.NameLen)) + + return v +} + +// Write request to wire for GetOutputInfo +func getOutputInfoRequest(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// Request ListOutputProperties +// size: 8 +type ListOutputPropertiesCookie struct { + *xgb.Cookie +} + +func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) + return ListOutputPropertiesCookie{cookie} +} + +func ListOutputPropertiesUnchecked(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) + return ListOutputPropertiesCookie{cookie} +} + +// Request reply for ListOutputProperties +// size: (32 + xgb.Pad((int(NumAtoms) * 4))) +type ListOutputPropertiesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAtoms uint16 + // padding: 22 bytes + Atoms []xproto.Atom // size: xgb.Pad((int(NumAtoms) * 4)) +} + +// Waits and reads reply data from request ListOutputProperties +func (cook ListOutputPropertiesCookie) Reply() (*ListOutputPropertiesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listOutputPropertiesReply(buf), nil +} + +// Read reply into structure from buffer for ListOutputProperties +func listOutputPropertiesReply(buf []byte) *ListOutputPropertiesReply { + v := new(ListOutputPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAtoms = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Atoms = make([]xproto.Atom, v.NumAtoms) + for i := 0; i < int(v.NumAtoms); i++ { + v.Atoms[i] = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for ListOutputProperties +func listOutputPropertiesRequest(c *xgb.Conn, Output Output) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + return buf +} + +// Request QueryOutputProperty +// size: 12 +type QueryOutputPropertyCookie struct { + *xgb.Cookie +} + +func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) + return QueryOutputPropertyCookie{cookie} +} + +func QueryOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) + return QueryOutputPropertyCookie{cookie} +} + +// Request reply for QueryOutputProperty +// size: (32 + xgb.Pad((int(Length) * 4))) +type QueryOutputPropertyReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Pending bool + Range bool + Immutable bool + // padding: 21 bytes + ValidValues []int32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request QueryOutputProperty +func (cook QueryOutputPropertyCookie) Reply() (*QueryOutputPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryOutputPropertyReply(buf), nil +} + +// Read reply into structure from buffer for QueryOutputProperty +func queryOutputPropertyReply(buf []byte) *QueryOutputPropertyReply { + v := new(QueryOutputPropertyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Pending = true + } else { + v.Pending = false + } + b += 1 + + if buf[b] == 1 { + v.Range = true + } else { + v.Range = false + } + b += 1 + + if buf[b] == 1 { + v.Immutable = true + } else { + v.Immutable = false + } + b += 1 + + b += 21 // padding + + v.ValidValues = make([]int32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.ValidValues[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryOutputProperty +func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request ConfigureOutputProperty +// size: xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) +type ConfigureOutputPropertyCookie struct { + *xgb.Cookie +} + +// Write request to wire for ConfigureOutputProperty +func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) + return ConfigureOutputPropertyCookie{cookie} +} + +func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) + return ConfigureOutputPropertyCookie{cookie} +} + +func (cook ConfigureOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ConfigureOutputProperty +func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Range { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Values)); i++ { + xgb.Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request ChangeOutputProperty +// size: xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) +type ChangeOutputPropertyCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeOutputProperty +func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return ChangeOutputPropertyCookie{cookie} +} + +func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return ChangeOutputPropertyCookie{cookie} +} + +func (cook ChangeOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeOutputProperty +func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], NumUnits) + b += 4 + + copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) + b += xgb.Pad(int(((int(NumUnits) * int(Format)) / 8))) + + return buf +} + +// Request DeleteOutputProperty +// size: 12 +type DeleteOutputPropertyCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteOutputProperty +func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) + return DeleteOutputPropertyCookie{cookie} +} + +func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) + return DeleteOutputPropertyCookie{cookie} +} + +func (cook DeleteOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteOutputProperty +func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request GetOutputProperty +// size: 28 +type GetOutputPropertyCookie struct { + *xgb.Cookie +} + +func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetOutputPropertyCookie{cookie} +} + +func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetOutputPropertyCookie{cookie} +} + +// Request reply for GetOutputProperty +// size: (32 + xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1))) +type GetOutputPropertyReply struct { + Sequence uint16 + Length uint32 + Format byte + Type xproto.Atom + BytesAfter uint32 + NumItems uint32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)) +} + +// Waits and reads reply data from request GetOutputProperty +func (cook GetOutputPropertyCookie) Reply() (*GetOutputPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOutputPropertyReply(buf), nil +} + +// Read reply into structure from buffer for GetOutputProperty +func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { + v := new(GetOutputPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.BytesAfter = xgb.Get32(buf[b:]) + b += 4 + + v.NumItems = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) + copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) + b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + + return v +} + +// Write request to wire for GetOutputProperty +func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + xgb.Put32(buf[b:], LongOffset) + b += 4 + + xgb.Put32(buf[b:], LongLength) + b += 4 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + return buf +} + +// Request CreateMode +// size: xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) +type CreateModeCookie struct { + *xgb.Cookie +} + +func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) + return CreateModeCookie{cookie} +} + +func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) + return CreateModeCookie{cookie} +} + +// Request reply for CreateMode +// size: 32 +type CreateModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Mode Mode + // padding: 20 bytes +} + +// Waits and reads reply data from request CreateMode +func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createModeReply(buf), nil +} + +// Read reply into structure from buffer for CreateMode +func createModeReply(buf []byte) *CreateModeReply { + v := new(CreateModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Mode = Mode(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for CreateMode +func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) []byte { + size := xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + { + structBytes := ModeInfo.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + copy(buf[b:], Name[:len(Name)]) + b += xgb.Pad(int(len(Name))) + + return buf +} + +// Request DestroyMode +// size: 8 +type DestroyModeCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyMode +func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyModeRequest(c, Mode), cookie) + return DestroyModeCookie{cookie} +} + +func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyModeRequest(c, Mode), cookie) + return DestroyModeCookie{cookie} +} + +func (cook DestroyModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyMode +func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request AddOutputMode +// size: 12 +type AddOutputModeCookie struct { + *xgb.Cookie +} + +// Write request to wire for AddOutputMode +func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) + return AddOutputModeCookie{cookie} +} + +func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) + return AddOutputModeCookie{cookie} +} + +func (cook AddOutputModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddOutputMode +func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request DeleteOutputMode +// size: 12 +type DeleteOutputModeCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteOutputMode +func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) + return DeleteOutputModeCookie{cookie} +} + +func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) + return DeleteOutputModeCookie{cookie} +} + +func (cook DeleteOutputModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteOutputMode +func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// Request GetCrtcInfo +// size: 12 +type GetCrtcInfoCookie struct { + *xgb.Cookie +} + +func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) + return GetCrtcInfoCookie{cookie} +} + +func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) + return GetCrtcInfoCookie{cookie} +} + +// Request reply for GetCrtcInfo +// size: ((32 + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumPossibleOutputs) * 4))) +type GetCrtcInfoReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp xproto.Timestamp + X int16 + Y int16 + Width uint16 + Height uint16 + Mode Mode + Rotation uint16 + Rotations uint16 + NumOutputs uint16 + NumPossibleOutputs uint16 + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) +} + +// Waits and reads reply data from request GetCrtcInfo +func (cook GetCrtcInfoCookie) Reply() (*GetCrtcInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcInfoReply(buf), nil +} + +// Read reply into structure from buffer for GetCrtcInfo +func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { + v := new(GetCrtcInfoReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Mode = Mode(xgb.Get32(buf[b:])) + b += 4 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + v.Rotations = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumPossibleOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Possible = make([]Output, v.NumPossibleOutputs) + for i := 0; i < int(v.NumPossibleOutputs); i++ { + v.Possible[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCrtcInfo +func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// Request SetCrtcConfig +// size: xgb.Pad((28 + xgb.Pad((len(Outputs) * 4)))) +type SetCrtcConfigCookie struct { + *xgb.Cookie +} + +func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) + return SetCrtcConfigCookie{cookie} +} + +func SetCrtcConfigUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) + return SetCrtcConfigCookie{cookie} +} + +// Request reply for SetCrtcConfig +// size: 32 +type SetCrtcConfigReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp xproto.Timestamp + // padding: 20 bytes +} + +// Waits and reads reply data from request SetCrtcConfig +func (cook SetCrtcConfigCookie) Reply() (*SetCrtcConfigReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setCrtcConfigReply(buf), nil +} + +// Read reply into structure from buffer for SetCrtcConfig +func setCrtcConfigReply(buf []byte) *SetCrtcConfigReply { + v := new(SetCrtcConfigReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for SetCrtcConfig +func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Outputs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + xgb.Put16(buf[b:], Rotation) + b += 2 + + b += 2 // padding + + for i := 0; i < int(len(Outputs)); i++ { + xgb.Put32(buf[b:], uint32(Outputs[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetCrtcGammaSize +// size: 8 +type GetCrtcGammaSizeCookie struct { + *xgb.Cookie +} + +func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) + return GetCrtcGammaSizeCookie{cookie} +} + +func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) + return GetCrtcGammaSizeCookie{cookie} +} + +// Request reply for GetCrtcGammaSize +// size: 32 +type GetCrtcGammaSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request GetCrtcGammaSize +func (cook GetCrtcGammaSizeCookie) Reply() (*GetCrtcGammaSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcGammaSizeReply(buf), nil +} + +// Read reply into structure from buffer for GetCrtcGammaSize +func getCrtcGammaSizeReply(buf []byte) *GetCrtcGammaSizeReply { + v := new(GetCrtcGammaSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +// Write request to wire for GetCrtcGammaSize +func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request GetCrtcGamma +// size: 8 +type GetCrtcGammaCookie struct { + *xgb.Cookie +} + +func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) + return GetCrtcGammaCookie{cookie} +} + +func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) + return GetCrtcGammaCookie{cookie} +} + +// Request reply for GetCrtcGamma +// size: (((32 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) +type GetCrtcGammaReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes + Red []uint16 // size: xgb.Pad((int(Size) * 2)) + Green []uint16 // size: xgb.Pad((int(Size) * 2)) + Blue []uint16 // size: xgb.Pad((int(Size) * 2)) +} + +// Waits and reads reply data from request GetCrtcGamma +func (cook GetCrtcGammaCookie) Reply() (*GetCrtcGammaReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcGammaReply(buf), nil +} + +// Read reply into structure from buffer for GetCrtcGamma +func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { + v := new(GetCrtcGammaReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Red = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Red[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Green = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Green[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Blue = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Blue[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCrtcGamma +func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request SetCrtcGamma +// size: xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) +type SetCrtcGammaCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetCrtcGamma +func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) + return SetCrtcGammaCookie{cookie} +} + +func SetCrtcGammaChecked(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) + return SetCrtcGammaCookie{cookie} +} + +func (cook SetCrtcGammaCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCrtcGamma +func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { + size := xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + xgb.Put16(buf[b:], Size) + b += 2 + + b += 2 // padding + + for i := 0; i < int(Size); i++ { + xgb.Put16(buf[b:], Red[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(Size); i++ { + xgb.Put16(buf[b:], Green[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(Size); i++ { + xgb.Put16(buf[b:], Blue[i]) + b += 2 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetScreenResourcesCurrent +// size: 8 +type GetScreenResourcesCurrentCookie struct { + *xgb.Cookie +} + +func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) + return GetScreenResourcesCurrentCookie{cookie} +} + +func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) + return GetScreenResourcesCurrentCookie{cookie} +} + +// Request reply for GetScreenResourcesCurrent +// size: ((((32 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumModes) * 32))) + xgb.Pad((int(NamesLen) * 1))) +type GetScreenResourcesCurrentReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) +} + +// Waits and reads reply data from request GetScreenResourcesCurrent +func (cook GetScreenResourcesCurrentCookie) Reply() (*GetScreenResourcesCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenResourcesCurrentReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenResourcesCurrent +func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply { + v := new(GetScreenResourcesCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumModes = xgb.Get16(buf[b:]) + b += 2 + + v.NamesLen = xgb.Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Modes = make([]ModeInfo, v.NumModes) + b += ModeInfoReadList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += xgb.Pad(int(v.NamesLen)) + + return v +} + +// Write request to wire for GetScreenResourcesCurrent +func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request SetCrtcTransform +// size: xgb.Pad(((48 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(FilterParams) * 4)))) +type SetCrtcTransformCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetCrtcTransform +func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) + return SetCrtcTransformCookie{cookie} +} + +func SetCrtcTransformChecked(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) + return SetCrtcTransformCookie{cookie} +} + +func (cook SetCrtcTransformCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCrtcTransform +func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) []byte { + size := xgb.Pad(((48 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(FilterParams) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + { + structBytes := Transform.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put16(buf[b:], FilterLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], FilterName[:FilterLen]) + b += xgb.Pad(int(FilterLen)) + + for i := 0; i < int(len(FilterParams)); i++ { + xgb.Put32(buf[b:], uint32(FilterParams[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetCrtcTransform +// size: 8 +type GetCrtcTransformCookie struct { + *xgb.Cookie +} + +func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) + return GetCrtcTransformCookie{cookie} +} + +func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) + return GetCrtcTransformCookie{cookie} +} + +// Request reply for GetCrtcTransform +// size: ((((96 + xgb.Pad((int(PendingLen) * 1))) + xgb.Pad((int(PendingNparams) * 4))) + xgb.Pad((int(CurrentLen) * 1))) + xgb.Pad((int(CurrentNparams) * 4))) +type GetCrtcTransformReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PendingTransform render.Transform + HasTransforms bool + // padding: 3 bytes + CurrentTransform render.Transform + // padding: 4 bytes + PendingLen uint16 + PendingNparams uint16 + CurrentLen uint16 + CurrentNparams uint16 + PendingFilterName string // size: xgb.Pad((int(PendingLen) * 1)) + PendingParams []render.Fixed // size: xgb.Pad((int(PendingNparams) * 4)) + CurrentFilterName string // size: xgb.Pad((int(CurrentLen) * 1)) + CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) +} + +// Waits and reads reply data from request GetCrtcTransform +func (cook GetCrtcTransformCookie) Reply() (*GetCrtcTransformReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcTransformReply(buf), nil +} + +// Read reply into structure from buffer for GetCrtcTransform +func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { + v := new(GetCrtcTransformReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PendingTransform = render.Transform{} + b += render.TransformRead(buf[b:], &v.PendingTransform) + + if buf[b] == 1 { + v.HasTransforms = true + } else { + v.HasTransforms = false + } + b += 1 + + b += 3 // padding + + v.CurrentTransform = render.Transform{} + b += render.TransformRead(buf[b:], &v.CurrentTransform) + + b += 4 // padding + + v.PendingLen = xgb.Get16(buf[b:]) + b += 2 + + v.PendingNparams = xgb.Get16(buf[b:]) + b += 2 + + v.CurrentLen = xgb.Get16(buf[b:]) + b += 2 + + v.CurrentNparams = xgb.Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.PendingLen) + copy(byteString[:v.PendingLen], buf[b:]) + v.PendingFilterName = string(byteString) + b += xgb.Pad(int(v.PendingLen)) + } + + v.PendingParams = make([]render.Fixed, v.PendingNparams) + for i := 0; i < int(v.PendingNparams); i++ { + v.PendingParams[i] = render.Fixed(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + { + byteString := make([]byte, v.CurrentLen) + copy(byteString[:v.CurrentLen], buf[b:]) + v.CurrentFilterName = string(byteString) + b += xgb.Pad(int(v.CurrentLen)) + } + + v.CurrentParams = make([]render.Fixed, v.CurrentNparams) + for i := 0; i < int(v.CurrentNparams); i++ { + v.CurrentParams[i] = render.Fixed(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCrtcTransform +func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request GetPanning +// size: 8 +type GetPanningCookie struct { + *xgb.Cookie +} + +func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPanningRequest(c, Crtc), cookie) + return GetPanningCookie{cookie} +} + +func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPanningRequest(c, Crtc), cookie) + return GetPanningCookie{cookie} +} + +// Request reply for GetPanning +// size: 36 +type GetPanningReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp xproto.Timestamp + Left uint16 + Top uint16 + Width uint16 + Height uint16 + TrackLeft uint16 + TrackTop uint16 + TrackWidth uint16 + TrackHeight uint16 + BorderLeft int16 + BorderTop int16 + BorderRight int16 + BorderBottom int16 +} + +// Waits and reads reply data from request GetPanning +func (cook GetPanningCookie) Reply() (*GetPanningReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPanningReply(buf), nil +} + +// Read reply into structure from buffer for GetPanning +func getPanningReply(buf []byte) *GetPanningReply { + v := new(GetPanningReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Left = xgb.Get16(buf[b:]) + b += 2 + + v.Top = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.TrackLeft = xgb.Get16(buf[b:]) + b += 2 + + v.TrackTop = xgb.Get16(buf[b:]) + b += 2 + + v.TrackWidth = xgb.Get16(buf[b:]) + b += 2 + + v.TrackHeight = xgb.Get16(buf[b:]) + b += 2 + + v.BorderLeft = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderTop = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderRight = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderBottom = int16(xgb.Get16(buf[b:])) + b += 2 + + return v +} + +// Write request to wire for GetPanning +func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// Request SetPanning +// size: 36 +type SetPanningCookie struct { + *xgb.Cookie +} + +func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) + return SetPanningCookie{cookie} +} + +func SetPanningUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) + return SetPanningCookie{cookie} +} + +// Request reply for SetPanning +// size: 12 +type SetPanningReply struct { + Sequence uint16 + Length uint32 + Status byte + Timestamp xproto.Timestamp +} + +// Waits and reads reply data from request SetPanning +func (cook SetPanningCookie) Reply() (*SetPanningReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setPanningReply(buf), nil +} + +// Read reply into structure from buffer for SetPanning +func setPanningReply(buf []byte) *SetPanningReply { + v := new(SetPanningReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for SetPanning +func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(Timestamp)) + b += 4 + + xgb.Put16(buf[b:], Left) + b += 2 + + xgb.Put16(buf[b:], Top) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put16(buf[b:], TrackLeft) + b += 2 + + xgb.Put16(buf[b:], TrackTop) + b += 2 + + xgb.Put16(buf[b:], TrackWidth) + b += 2 + + xgb.Put16(buf[b:], TrackHeight) + b += 2 + + xgb.Put16(buf[b:], uint16(BorderLeft)) + b += 2 + + xgb.Put16(buf[b:], uint16(BorderTop)) + b += 2 + + xgb.Put16(buf[b:], uint16(BorderRight)) + b += 2 + + xgb.Put16(buf[b:], uint16(BorderBottom)) + b += 2 + + return buf +} + +// Request SetOutputPrimary +// size: 12 +type SetOutputPrimaryCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetOutputPrimary +func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) + return SetOutputPrimaryCookie{cookie} +} + +func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) + return SetOutputPrimaryCookie{cookie} +} + +func (cook SetOutputPrimaryCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetOutputPrimary +func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + return buf +} + +// Request GetOutputPrimary +// size: 8 +type GetOutputPrimaryCookie struct { + *xgb.Cookie +} + +func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) + return GetOutputPrimaryCookie{cookie} +} + +func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) + return GetOutputPrimaryCookie{cookie} +} + +// Request reply for GetOutputPrimary +// size: 12 +type GetOutputPrimaryReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Output Output +} + +// Waits and reads reply data from request GetOutputPrimary +func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOutputPrimaryReply(buf), nil +} + +// Read reply into structure from buffer for GetOutputPrimary +func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { + v := new(GetOutputPrimaryReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Output = Output(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetOutputPrimary +func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/record/record.go b/nexgb/record/record.go new file mode 100644 index 0000000..04d514b --- /dev/null +++ b/nexgb/record/record.go @@ -0,0 +1,1089 @@ +package record + +/* + This file was generated by record.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the RECORD extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 6, "RECORD").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named RECORD could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["RECORD"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["RECORD"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["RECORD"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["RECORD"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["RECORD"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +const ( + HTypeFromServerTime = 1 + HTypeFromClientTime = 2 + HTypeFromClientSequence = 4 +) + +const ( + CsCurrentClients = 1 + CsFutureClients = 2 + CsAllClients = 3 +) + +type Context uint32 + +func NewContextId(c *xgb.Conn) (Context, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Context(id), nil +} + +type ElementHeader byte + +type ClientSpec uint32 + +// 'Range8' struct definition +// Size: 2 +type Range8 struct { + First byte + Last byte +} + +// Struct read Range8 +func Range8Read(buf []byte, v *Range8) int { + b := 0 + + v.First = buf[b] + b += 1 + + v.Last = buf[b] + b += 1 + + return b +} + +// Struct list read Range8 +func Range8ReadList(buf []byte, dest []Range8) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Range8{} + b += Range8Read(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Range8 +func (v Range8) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.First + b += 1 + + buf[b] = v.Last + b += 1 + + return buf +} + +// Write struct list Range8 +func Range8ListBytes(buf []byte, list []Range8) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Range16' struct definition +// Size: 4 +type Range16 struct { + First uint16 + Last uint16 +} + +// Struct read Range16 +func Range16Read(buf []byte, v *Range16) int { + b := 0 + + v.First = xgb.Get16(buf[b:]) + b += 2 + + v.Last = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Range16 +func Range16ReadList(buf []byte, dest []Range16) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Range16{} + b += Range16Read(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Range16 +func (v Range16) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], v.First) + b += 2 + + xgb.Put16(buf[b:], v.Last) + b += 2 + + return buf +} + +// Write struct list Range16 +func Range16ListBytes(buf []byte, list []Range16) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'ExtRange' struct definition +// Size: 6 +type ExtRange struct { + Major Range8 + Minor Range16 +} + +// Struct read ExtRange +func ExtRangeRead(buf []byte, v *ExtRange) int { + b := 0 + + v.Major = Range8{} + b += Range8Read(buf[b:], &v.Major) + + v.Minor = Range16{} + b += Range16Read(buf[b:], &v.Minor) + + return b +} + +// Struct list read ExtRange +func ExtRangeReadList(buf []byte, dest []ExtRange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ExtRange{} + b += ExtRangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ExtRange +func (v ExtRange) Bytes() []byte { + buf := make([]byte, 6) + b := 0 + + { + structBytes := v.Major.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Minor.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list ExtRange +func ExtRangeListBytes(buf []byte, list []ExtRange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Range' struct definition +// Size: 24 +type Range struct { + CoreRequests Range8 + CoreReplies Range8 + ExtRequests ExtRange + ExtReplies ExtRange + DeliveredEvents Range8 + DeviceEvents Range8 + Errors Range8 + ClientStarted bool + ClientDied bool +} + +// Struct read Range +func RangeRead(buf []byte, v *Range) int { + b := 0 + + v.CoreRequests = Range8{} + b += Range8Read(buf[b:], &v.CoreRequests) + + v.CoreReplies = Range8{} + b += Range8Read(buf[b:], &v.CoreReplies) + + v.ExtRequests = ExtRange{} + b += ExtRangeRead(buf[b:], &v.ExtRequests) + + v.ExtReplies = ExtRange{} + b += ExtRangeRead(buf[b:], &v.ExtReplies) + + v.DeliveredEvents = Range8{} + b += Range8Read(buf[b:], &v.DeliveredEvents) + + v.DeviceEvents = Range8{} + b += Range8Read(buf[b:], &v.DeviceEvents) + + v.Errors = Range8{} + b += Range8Read(buf[b:], &v.Errors) + + if buf[b] == 1 { + v.ClientStarted = true + } else { + v.ClientStarted = false + } + b += 1 + + if buf[b] == 1 { + v.ClientDied = true + } else { + v.ClientDied = false + } + b += 1 + + return b +} + +// Struct list read Range +func RangeReadList(buf []byte, dest []Range) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Range{} + b += RangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Range +func (v Range) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.CoreRequests.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.CoreReplies.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.ExtRequests.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.ExtReplies.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.DeliveredEvents.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.DeviceEvents.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Errors.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + if v.ClientStarted { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if v.ClientDied { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Write struct list Range +func RangeListBytes(buf []byte, list []Range) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'ClientInfo' struct definition +// Size: (8 + xgb.Pad((int(NumRanges) * 24))) +type ClientInfo struct { + ClientResource ClientSpec + NumRanges uint32 + Ranges []Range // size: xgb.Pad((int(NumRanges) * 24)) +} + +// Struct read ClientInfo +func ClientInfoRead(buf []byte, v *ClientInfo) int { + b := 0 + + v.ClientResource = ClientSpec(xgb.Get32(buf[b:])) + b += 4 + + v.NumRanges = xgb.Get32(buf[b:]) + b += 4 + + v.Ranges = make([]Range, v.NumRanges) + b += RangeReadList(buf[b:], v.Ranges) + + return b +} + +// Struct list read ClientInfo +func ClientInfoReadList(buf []byte, dest []ClientInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ClientInfo{} + b += ClientInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ClientInfo +func (v ClientInfo) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.ClientResource)) + b += 4 + + xgb.Put32(buf[b:], v.NumRanges) + b += 4 + + b += RangeListBytes(buf[b:], v.Ranges) + + return buf +} + +// Write struct list ClientInfo +func ClientInfoListBytes(buf []byte, list []ClientInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ClientInfo +func ClientInfoListSize(list []ClientInfo) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumRanges) * 24))) + } + return size +} + +// Error definition BadContext (0) +// Size: 32 + +const BadBadContext = 0 + +type BadContextError struct { + Sequence uint16 + NiceName string + InvalidRecord uint32 +} + +// Error read BadContext +func BadContextErrorNew(buf []byte) xgb.Error { + v := BadContextError{} + v.NiceName = "BadContext" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.InvalidRecord = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +func (err BadContextError) ImplementsError() {} + +func (err BadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadContextError) BadId() uint32 { + return 0 +} + +func (err BadContextError) Error() string { + fieldVals := make([]string, 0, 1) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("InvalidRecord: %d", err.InvalidRecord)) + return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], MajorVersion) + b += 2 + + xgb.Put16(buf[b:], MinorVersion) + b += 2 + + return buf +} + +// Request CreateContext +// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) +type CreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateContext +func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return CreateContextCookie{cookie} +} + +func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return CreateContextCookie{cookie} +} + +func (cook CreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateContext +func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { + size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = byte(ElementHeader) + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], NumClientSpecs) + b += 4 + + xgb.Put32(buf[b:], NumRanges) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + xgb.Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = xgb.Pad(b) + + b += RangeListBytes(buf[b:], Ranges) + + return buf +} + +// Request RegisterClients +// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) +type RegisterClientsCookie struct { + *xgb.Cookie +} + +// Write request to wire for RegisterClients +func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RegisterClientsCookie{cookie} +} + +func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return RegisterClientsCookie{cookie} +} + +func (cook RegisterClientsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RegisterClients +func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { + size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = byte(ElementHeader) + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], NumClientSpecs) + b += 4 + + xgb.Put32(buf[b:], NumRanges) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + xgb.Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = xgb.Pad(b) + + b += RangeListBytes(buf[b:], Ranges) + + return buf +} + +// Request UnregisterClients +// size: xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4)))) +type UnregisterClientsCookie struct { + *xgb.Cookie +} + +// Write request to wire for UnregisterClients +func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) + return UnregisterClientsCookie{cookie} +} + +func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) + return UnregisterClientsCookie{cookie} +} + +func (cook UnregisterClientsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnregisterClients +func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], NumClientSpecs) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + xgb.Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetContext +// size: 8 +type GetContextCookie struct { + *xgb.Cookie +} + +func GetContext(c *xgb.Conn, Context Context) GetContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getContextRequest(c, Context), cookie) + return GetContextCookie{cookie} +} + +func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getContextRequest(c, Context), cookie) + return GetContextCookie{cookie} +} + +// Request reply for GetContext +// size: (32 + ClientInfoListSize(InterceptedClients)) +type GetContextReply struct { + Sequence uint16 + Length uint32 + Enabled bool + ElementHeader ElementHeader + // padding: 3 bytes + NumInterceptedClients uint32 + // padding: 16 bytes + InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients) +} + +// Waits and reads reply data from request GetContext +func (cook GetContextCookie) Reply() (*GetContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getContextReply(buf), nil +} + +// Read reply into structure from buffer for GetContext +func getContextReply(buf []byte) *GetContextReply { + v := new(GetContextReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ElementHeader = ElementHeader(buf[b]) + b += 1 + + b += 3 // padding + + v.NumInterceptedClients = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.InterceptedClients = make([]ClientInfo, v.NumInterceptedClients) + b += ClientInfoReadList(buf[b:], v.InterceptedClients) + + return v +} + +// Write request to wire for GetContext +func getContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request EnableContext +// size: 8 +type EnableContextCookie struct { + *xgb.Cookie +} + +func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(enableContextRequest(c, Context), cookie) + return EnableContextCookie{cookie} +} + +func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(enableContextRequest(c, Context), cookie) + return EnableContextCookie{cookie} +} + +// Request reply for EnableContext +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +type EnableContextReply struct { + Sequence uint16 + Length uint32 + Category byte + ElementHeader ElementHeader + ClientSwapped bool + // padding: 2 bytes + XidBase uint32 + ServerTime uint32 + RecSequenceNum uint32 + // padding: 8 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Waits and reads reply data from request EnableContext +func (cook EnableContextCookie) Reply() (*EnableContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return enableContextReply(buf), nil +} + +// Read reply into structure from buffer for EnableContext +func enableContextReply(buf []byte) *EnableContextReply { + v := new(EnableContextReply) + b := 1 // skip reply determinant + + v.Category = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ElementHeader = ElementHeader(buf[b]) + b += 1 + + if buf[b] == 1 { + v.ClientSwapped = true + } else { + v.ClientSwapped = false + } + b += 1 + + b += 2 // padding + + v.XidBase = xgb.Get32(buf[b:]) + b += 4 + + v.ServerTime = xgb.Get32(buf[b:]) + b += 4 + + v.RecSequenceNum = xgb.Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for EnableContext +func enableContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request DisableContext +// size: 8 +type DisableContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for DisableContext +func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(disableContextRequest(c, Context), cookie) + return DisableContextCookie{cookie} +} + +func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(disableContextRequest(c, Context), cookie) + return DisableContextCookie{cookie} +} + +func (cook DisableContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DisableContext +func disableContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request FreeContext +// size: 8 +type FreeContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for FreeContext +func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeContextRequest(c, Context), cookie) + return FreeContextCookie{cookie} +} + +func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeContextRequest(c, Context), cookie) + return FreeContextCookie{cookie} +} + +func (cook FreeContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeContext +func freeContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} diff --git a/nexgb/render/render.go b/nexgb/render/render.go new file mode 100644 index 0000000..a939ed9 --- /dev/null +++ b/nexgb/render/render.go @@ -0,0 +1,3542 @@ +package render + +/* + This file was generated by render.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the RENDER extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 6, "RENDER").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named RENDER could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["RENDER"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["RENDER"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["RENDER"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["RENDER"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +const ( + PictTypeIndexed = 0 + PictTypeDirect = 1 +) + +const ( + PictureNone = 0 +) + +const ( + PictOpClear = 0 + PictOpSrc = 1 + PictOpDst = 2 + PictOpOver = 3 + PictOpOverReverse = 4 + PictOpIn = 5 + PictOpInReverse = 6 + PictOpOut = 7 + PictOpOutReverse = 8 + PictOpAtop = 9 + PictOpAtopReverse = 10 + PictOpXor = 11 + PictOpAdd = 12 + PictOpSaturate = 13 + PictOpDisjointClear = 16 + PictOpDisjointSrc = 17 + PictOpDisjointDst = 18 + PictOpDisjointOver = 19 + PictOpDisjointOverReverse = 20 + PictOpDisjointIn = 21 + PictOpDisjointInReverse = 22 + PictOpDisjointOut = 23 + PictOpDisjointOutReverse = 24 + PictOpDisjointAtop = 25 + PictOpDisjointAtopReverse = 26 + PictOpDisjointXor = 27 + PictOpConjointClear = 32 + PictOpConjointSrc = 33 + PictOpConjointDst = 34 + PictOpConjointOver = 35 + PictOpConjointOverReverse = 36 + PictOpConjointIn = 37 + PictOpConjointInReverse = 38 + PictOpConjointOut = 39 + PictOpConjointOutReverse = 40 + PictOpConjointAtop = 41 + PictOpConjointAtopReverse = 42 + PictOpConjointXor = 43 + PictOpMultiply = 48 + PictOpScreen = 49 + PictOpOverlay = 50 + PictOpDarken = 51 + PictOpLighten = 52 + PictOpColorDodge = 53 + PictOpColorBurn = 54 + PictOpHardLight = 55 + PictOpSoftLight = 56 + PictOpDifference = 57 + PictOpExclusion = 58 + PictOpHSLHue = 59 + PictOpHSLSaturation = 60 + PictOpHSLColor = 61 + PictOpHSLLuminosity = 62 +) + +const ( + PolyEdgeSharp = 0 + PolyEdgeSmooth = 1 +) + +const ( + PolyModePrecise = 0 + PolyModeImprecise = 1 +) + +const ( + CpRepeat = 1 + CpAlphaMap = 2 + CpAlphaXOrigin = 4 + CpAlphaYOrigin = 8 + CpClipXOrigin = 16 + CpClipYOrigin = 32 + CpClipMask = 64 + CpGraphicsExposure = 128 + CpSubwindowMode = 256 + CpPolyEdge = 512 + CpPolyMode = 1024 + CpDither = 2048 + CpComponentAlpha = 4096 +) + +const ( + SubPixelUnknown = 0 + SubPixelHorizontalRGB = 1 + SubPixelHorizontalBGR = 2 + SubPixelVerticalRGB = 3 + SubPixelVerticalBGR = 4 + SubPixelNone = 5 +) + +const ( + RepeatNone = 0 + RepeatNormal = 1 + RepeatPad = 2 + RepeatReflect = 3 +) + +type Glyphset uint32 + +func NewGlyphsetId(c *xgb.Conn) (Glyphset, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Glyphset(id), nil +} + +type Picture uint32 + +func NewPictureId(c *xgb.Conn) (Picture, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Picture(id), nil +} + +type Pictformat uint32 + +func NewPictformatId(c *xgb.Conn) (Pictformat, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pictformat(id), nil +} + +type Glyph uint32 + +type Fixed int32 + +// 'Directformat' struct definition +// Size: 16 +type Directformat struct { + RedShift uint16 + RedMask uint16 + GreenShift uint16 + GreenMask uint16 + BlueShift uint16 + BlueMask uint16 + AlphaShift uint16 + AlphaMask uint16 +} + +// Struct read Directformat +func DirectformatRead(buf []byte, v *Directformat) int { + b := 0 + + v.RedShift = xgb.Get16(buf[b:]) + b += 2 + + v.RedMask = xgb.Get16(buf[b:]) + b += 2 + + v.GreenShift = xgb.Get16(buf[b:]) + b += 2 + + v.GreenMask = xgb.Get16(buf[b:]) + b += 2 + + v.BlueShift = xgb.Get16(buf[b:]) + b += 2 + + v.BlueMask = xgb.Get16(buf[b:]) + b += 2 + + v.AlphaShift = xgb.Get16(buf[b:]) + b += 2 + + v.AlphaMask = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Directformat +func DirectformatReadList(buf []byte, dest []Directformat) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Directformat{} + b += DirectformatRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Directformat +func (v Directformat) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + xgb.Put16(buf[b:], v.RedShift) + b += 2 + + xgb.Put16(buf[b:], v.RedMask) + b += 2 + + xgb.Put16(buf[b:], v.GreenShift) + b += 2 + + xgb.Put16(buf[b:], v.GreenMask) + b += 2 + + xgb.Put16(buf[b:], v.BlueShift) + b += 2 + + xgb.Put16(buf[b:], v.BlueMask) + b += 2 + + xgb.Put16(buf[b:], v.AlphaShift) + b += 2 + + xgb.Put16(buf[b:], v.AlphaMask) + b += 2 + + return buf +} + +// Write struct list Directformat +func DirectformatListBytes(buf []byte, list []Directformat) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Pictforminfo' struct definition +// Size: 28 +type Pictforminfo struct { + Id Pictformat + Type byte + Depth byte + // padding: 2 bytes + Direct Directformat + Colormap xproto.Colormap +} + +// Struct read Pictforminfo +func PictforminfoRead(buf []byte, v *Pictforminfo) int { + b := 0 + + v.Id = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + v.Type = buf[b] + b += 1 + + v.Depth = buf[b] + b += 1 + + b += 2 // padding + + v.Direct = Directformat{} + b += DirectformatRead(buf[b:], &v.Direct) + + v.Colormap = xproto.Colormap(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Pictforminfo +func PictforminfoReadList(buf []byte, dest []Pictforminfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictforminfo{} + b += PictforminfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Pictforminfo +func (v Pictforminfo) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Id)) + b += 4 + + buf[b] = v.Type + b += 1 + + buf[b] = v.Depth + b += 1 + + b += 2 // padding + + { + structBytes := v.Direct.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Colormap)) + b += 4 + + return buf +} + +// Write struct list Pictforminfo +func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Pictvisual' struct definition +// Size: 8 +type Pictvisual struct { + Visual xproto.Visualid + Format Pictformat +} + +// Struct read Pictvisual +func PictvisualRead(buf []byte, v *Pictvisual) int { + b := 0 + + v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Format = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Pictvisual +func PictvisualReadList(buf []byte, dest []Pictvisual) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictvisual{} + b += PictvisualRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Pictvisual +func (v Pictvisual) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Visual)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Format)) + b += 4 + + return buf +} + +// Write struct list Pictvisual +func PictvisualListBytes(buf []byte, list []Pictvisual) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Pictdepth' struct definition +// Size: (8 + xgb.Pad((int(NumVisuals) * 8))) +type Pictdepth struct { + Depth byte + // padding: 1 bytes + NumVisuals uint16 + // padding: 4 bytes + Visuals []Pictvisual // size: xgb.Pad((int(NumVisuals) * 8)) +} + +// Struct read Pictdepth +func PictdepthRead(buf []byte, v *Pictdepth) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + b += 1 // padding + + v.NumVisuals = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Visuals = make([]Pictvisual, v.NumVisuals) + b += PictvisualReadList(buf[b:], v.Visuals) + + return b +} + +// Struct list read Pictdepth +func PictdepthReadList(buf []byte, dest []Pictdepth) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictdepth{} + b += PictdepthRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Pictdepth +func (v Pictdepth) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumVisuals) * 8)))) + b := 0 + + buf[b] = v.Depth + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.NumVisuals) + b += 2 + + b += 4 // padding + + b += PictvisualListBytes(buf[b:], v.Visuals) + + return buf +} + +// Write struct list Pictdepth +func PictdepthListBytes(buf []byte, list []Pictdepth) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size Pictdepth +func PictdepthListSize(list []Pictdepth) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumVisuals) * 8))) + } + return size +} + +// 'Pictscreen' struct definition +// Size: (8 + PictdepthListSize(Depths)) +type Pictscreen struct { + NumDepths uint32 + Fallback Pictformat + Depths []Pictdepth // size: PictdepthListSize(Depths) +} + +// Struct read Pictscreen +func PictscreenRead(buf []byte, v *Pictscreen) int { + b := 0 + + v.NumDepths = xgb.Get32(buf[b:]) + b += 4 + + v.Fallback = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + v.Depths = make([]Pictdepth, v.NumDepths) + b += PictdepthReadList(buf[b:], v.Depths) + + return b +} + +// Struct list read Pictscreen +func PictscreenReadList(buf []byte, dest []Pictscreen) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictscreen{} + b += PictscreenRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Pictscreen +func (v Pictscreen) Bytes() []byte { + buf := make([]byte, (8 + PictdepthListSize(v.Depths))) + b := 0 + + xgb.Put32(buf[b:], v.NumDepths) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Fallback)) + b += 4 + + b += PictdepthListBytes(buf[b:], v.Depths) + + return buf +} + +// Write struct list Pictscreen +func PictscreenListBytes(buf []byte, list []Pictscreen) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size Pictscreen +func PictscreenListSize(list []Pictscreen) int { + size := 0 + for _, item := range list { + size += (8 + PictdepthListSize(item.Depths)) + } + return size +} + +// 'Indexvalue' struct definition +// Size: 12 +type Indexvalue struct { + Pixel uint32 + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} + +// Struct read Indexvalue +func IndexvalueRead(buf []byte, v *Indexvalue) int { + b := 0 + + v.Pixel = xgb.Get32(buf[b:]) + b += 4 + + v.Red = xgb.Get16(buf[b:]) + b += 2 + + v.Green = xgb.Get16(buf[b:]) + b += 2 + + v.Blue = xgb.Get16(buf[b:]) + b += 2 + + v.Alpha = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Indexvalue +func IndexvalueReadList(buf []byte, dest []Indexvalue) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Indexvalue{} + b += IndexvalueRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Indexvalue +func (v Indexvalue) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put32(buf[b:], v.Pixel) + b += 4 + + xgb.Put16(buf[b:], v.Red) + b += 2 + + xgb.Put16(buf[b:], v.Green) + b += 2 + + xgb.Put16(buf[b:], v.Blue) + b += 2 + + xgb.Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// Write struct list Indexvalue +func IndexvalueListBytes(buf []byte, list []Indexvalue) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Color' struct definition +// Size: 8 +type Color struct { + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} + +// Struct read Color +func ColorRead(buf []byte, v *Color) int { + b := 0 + + v.Red = xgb.Get16(buf[b:]) + b += 2 + + v.Green = xgb.Get16(buf[b:]) + b += 2 + + v.Blue = xgb.Get16(buf[b:]) + b += 2 + + v.Alpha = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read Color +func ColorReadList(buf []byte, dest []Color) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Color{} + b += ColorRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Color +func (v Color) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.Red) + b += 2 + + xgb.Put16(buf[b:], v.Green) + b += 2 + + xgb.Put16(buf[b:], v.Blue) + b += 2 + + xgb.Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// Write struct list Color +func ColorListBytes(buf []byte, list []Color) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Pointfix' struct definition +// Size: 8 +type Pointfix struct { + X Fixed + Y Fixed +} + +// Struct read Pointfix +func PointfixRead(buf []byte, v *Pointfix) int { + b := 0 + + v.X = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Y = Fixed(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Pointfix +func PointfixReadList(buf []byte, dest []Pointfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pointfix{} + b += PointfixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Pointfix +func (v Pointfix) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.X)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// Write struct list Pointfix +func PointfixListBytes(buf []byte, list []Pointfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Linefix' struct definition +// Size: 16 +type Linefix struct { + P1 Pointfix + P2 Pointfix +} + +// Struct read Linefix +func LinefixRead(buf []byte, v *Linefix) int { + b := 0 + + v.P1 = Pointfix{} + b += PointfixRead(buf[b:], &v.P1) + + v.P2 = Pointfix{} + b += PointfixRead(buf[b:], &v.P2) + + return b +} + +// Struct list read Linefix +func LinefixReadList(buf []byte, dest []Linefix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Linefix{} + b += LinefixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Linefix +func (v Linefix) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list Linefix +func LinefixListBytes(buf []byte, list []Linefix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Triangle' struct definition +// Size: 24 +type Triangle struct { + P1 Pointfix + P2 Pointfix + P3 Pointfix +} + +// Struct read Triangle +func TriangleRead(buf []byte, v *Triangle) int { + b := 0 + + v.P1 = Pointfix{} + b += PointfixRead(buf[b:], &v.P1) + + v.P2 = Pointfix{} + b += PointfixRead(buf[b:], &v.P2) + + v.P3 = Pointfix{} + b += PointfixRead(buf[b:], &v.P3) + + return b +} + +// Struct list read Triangle +func TriangleReadList(buf []byte, dest []Triangle) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Triangle{} + b += TriangleRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Triangle +func (v Triangle) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P3.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list Triangle +func TriangleListBytes(buf []byte, list []Triangle) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Trapezoid' struct definition +// Size: 40 +type Trapezoid struct { + Top Fixed + Bottom Fixed + Left Linefix + Right Linefix +} + +// Struct read Trapezoid +func TrapezoidRead(buf []byte, v *Trapezoid) int { + b := 0 + + v.Top = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Bottom = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Left = Linefix{} + b += LinefixRead(buf[b:], &v.Left) + + v.Right = Linefix{} + b += LinefixRead(buf[b:], &v.Right) + + return b +} + +// Struct list read Trapezoid +func TrapezoidReadList(buf []byte, dest []Trapezoid) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Trapezoid{} + b += TrapezoidRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Trapezoid +func (v Trapezoid) Bytes() []byte { + buf := make([]byte, 40) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Top)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Bottom)) + b += 4 + + { + structBytes := v.Left.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Right.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list Trapezoid +func TrapezoidListBytes(buf []byte, list []Trapezoid) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Glyphinfo' struct definition +// Size: 12 +type Glyphinfo struct { + Width uint16 + Height uint16 + X int16 + Y int16 + XOff int16 + YOff int16 +} + +// Struct read Glyphinfo +func GlyphinfoRead(buf []byte, v *Glyphinfo) int { + b := 0 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.XOff = int16(xgb.Get16(buf[b:])) + b += 2 + + v.YOff = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read Glyphinfo +func GlyphinfoReadList(buf []byte, dest []Glyphinfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Glyphinfo{} + b += GlyphinfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Glyphinfo +func (v Glyphinfo) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.XOff)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.YOff)) + b += 2 + + return buf +} + +// Write struct list Glyphinfo +func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Transform' struct definition +// Size: 36 +type Transform struct { + Matrix11 Fixed + Matrix12 Fixed + Matrix13 Fixed + Matrix21 Fixed + Matrix22 Fixed + Matrix23 Fixed + Matrix31 Fixed + Matrix32 Fixed + Matrix33 Fixed +} + +// Struct read Transform +func TransformRead(buf []byte, v *Transform) int { + b := 0 + + v.Matrix11 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix12 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix13 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix21 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix22 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix23 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix31 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix32 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Matrix33 = Fixed(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Transform +func TransformReadList(buf []byte, dest []Transform) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Transform{} + b += TransformRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Transform +func (v Transform) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Matrix11)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix12)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix13)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix21)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix22)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix23)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix31)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix32)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Matrix33)) + b += 4 + + return buf +} + +// Write struct list Transform +func TransformListBytes(buf []byte, list []Transform) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Animcursorelt' struct definition +// Size: 8 +type Animcursorelt struct { + Cursor xproto.Cursor + Delay uint32 +} + +// Struct read Animcursorelt +func AnimcursoreltRead(buf []byte, v *Animcursorelt) int { + b := 0 + + v.Cursor = xproto.Cursor(xgb.Get32(buf[b:])) + b += 4 + + v.Delay = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Animcursorelt +func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Animcursorelt{} + b += AnimcursoreltRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Animcursorelt +func (v Animcursorelt) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Cursor)) + b += 4 + + xgb.Put32(buf[b:], v.Delay) + b += 4 + + return buf +} + +// Write struct list Animcursorelt +func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Spanfix' struct definition +// Size: 12 +type Spanfix struct { + L Fixed + R Fixed + Y Fixed +} + +// Struct read Spanfix +func SpanfixRead(buf []byte, v *Spanfix) int { + b := 0 + + v.L = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.R = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Y = Fixed(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Spanfix +func SpanfixReadList(buf []byte, dest []Spanfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Spanfix{} + b += SpanfixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Spanfix +func (v Spanfix) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put32(buf[b:], uint32(v.L)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.R)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// Write struct list Spanfix +func SpanfixListBytes(buf []byte, list []Spanfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Trap' struct definition +// Size: 24 +type Trap struct { + Top Spanfix + Bot Spanfix +} + +// Struct read Trap +func TrapRead(buf []byte, v *Trap) int { + b := 0 + + v.Top = Spanfix{} + b += SpanfixRead(buf[b:], &v.Top) + + v.Bot = Spanfix{} + b += SpanfixRead(buf[b:], &v.Bot) + + return b +} + +// Struct list read Trap +func TrapReadList(buf []byte, dest []Trap) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Trap{} + b += TrapRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Trap +func (v Trap) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.Top.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Bot.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list Trap +func TrapListBytes(buf []byte, list []Trap) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Error definition PictFormat (0) +// Size: 32 + +const BadPictFormat = 0 + +type PictFormatError struct { + Sequence uint16 + NiceName string +} + +// Error read PictFormat +func PictFormatErrorNew(buf []byte) xgb.Error { + v := PictFormatError{} + v.NiceName = "PictFormat" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err PictFormatError) ImplementsError() {} + +func (err PictFormatError) SequenceId() uint16 { + return err.Sequence +} + +func (err PictFormatError) BadId() uint32 { + return 0 +} + +func (err PictFormatError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPictFormat {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][0] = PictFormatErrorNew +} + +// Error definition Picture (1) +// Size: 32 + +const BadPicture = 1 + +type PictureError struct { + Sequence uint16 + NiceName string +} + +// Error read Picture +func PictureErrorNew(buf []byte) xgb.Error { + v := PictureError{} + v.NiceName = "Picture" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err PictureError) ImplementsError() {} + +func (err PictureError) SequenceId() uint16 { + return err.Sequence +} + +func (err PictureError) BadId() uint32 { + return 0 +} + +func (err PictureError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPicture {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][1] = PictureErrorNew +} + +// Error definition PictOp (2) +// Size: 32 + +const BadPictOp = 2 + +type PictOpError struct { + Sequence uint16 + NiceName string +} + +// Error read PictOp +func PictOpErrorNew(buf []byte) xgb.Error { + v := PictOpError{} + v.NiceName = "PictOp" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err PictOpError) ImplementsError() {} + +func (err PictOpError) SequenceId() uint16 { + return err.Sequence +} + +func (err PictOpError) BadId() uint32 { + return 0 +} + +func (err PictOpError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPictOp {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][2] = PictOpErrorNew +} + +// Error definition GlyphSet (3) +// Size: 32 + +const BadGlyphSet = 3 + +type GlyphSetError struct { + Sequence uint16 + NiceName string +} + +// Error read GlyphSet +func GlyphSetErrorNew(buf []byte) xgb.Error { + v := GlyphSetError{} + v.NiceName = "GlyphSet" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err GlyphSetError) ImplementsError() {} + +func (err GlyphSetError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlyphSetError) BadId() uint32 { + return 0 +} + +func (err GlyphSetError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadGlyphSet {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][3] = GlyphSetErrorNew +} + +// Error definition Glyph (4) +// Size: 32 + +const BadGlyph = 4 + +type GlyphError struct { + Sequence uint16 + NiceName string +} + +// Error read Glyph +func GlyphErrorNew(buf []byte) xgb.Error { + v := GlyphError{} + v.NiceName = "Glyph" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err GlyphError) ImplementsError() {} + +func (err GlyphError) SequenceId() uint16 { + return err.Sequence +} + +func (err GlyphError) BadId() uint32 { + return 0 +} + +func (err GlyphError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadGlyph {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][4] = GlyphErrorNew +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request QueryPictFormats +// size: 4 +type QueryPictFormatsCookie struct { + *xgb.Cookie +} + +func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryPictFormatsRequest(c), cookie) + return QueryPictFormatsCookie{cookie} +} + +func QueryPictFormatsUnchecked(c *xgb.Conn) QueryPictFormatsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryPictFormatsRequest(c), cookie) + return QueryPictFormatsCookie{cookie} +} + +// Request reply for QueryPictFormats +// size: (((32 + xgb.Pad((int(NumFormats) * 28))) + PictscreenListSize(Screens)) + xgb.Pad((int(NumSubpixel) * 4))) +type QueryPictFormatsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFormats uint32 + NumScreens uint32 + NumDepths uint32 + NumVisuals uint32 + NumSubpixel uint32 + // padding: 4 bytes + Formats []Pictforminfo // size: xgb.Pad((int(NumFormats) * 28)) + Screens []Pictscreen // size: PictscreenListSize(Screens) + Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) +} + +// Waits and reads reply data from request QueryPictFormats +func (cook QueryPictFormatsCookie) Reply() (*QueryPictFormatsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryPictFormatsReply(buf), nil +} + +// Read reply into structure from buffer for QueryPictFormats +func queryPictFormatsReply(buf []byte) *QueryPictFormatsReply { + v := new(QueryPictFormatsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFormats = xgb.Get32(buf[b:]) + b += 4 + + v.NumScreens = xgb.Get32(buf[b:]) + b += 4 + + v.NumDepths = xgb.Get32(buf[b:]) + b += 4 + + v.NumVisuals = xgb.Get32(buf[b:]) + b += 4 + + v.NumSubpixel = xgb.Get32(buf[b:]) + b += 4 + + b += 4 // padding + + v.Formats = make([]Pictforminfo, v.NumFormats) + b += PictforminfoReadList(buf[b:], v.Formats) + + v.Screens = make([]Pictscreen, v.NumScreens) + b += PictscreenReadList(buf[b:], v.Screens) + + v.Subpixels = make([]uint32, v.NumSubpixel) + for i := 0; i < int(v.NumSubpixel); i++ { + v.Subpixels[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryPictFormats +func queryPictFormatsRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request QueryPictIndexValues +// size: 8 +type QueryPictIndexValuesCookie struct { + *xgb.Cookie +} + +func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) + return QueryPictIndexValuesCookie{cookie} +} + +func QueryPictIndexValuesUnchecked(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) + return QueryPictIndexValuesCookie{cookie} +} + +// Request reply for QueryPictIndexValues +// size: (32 + xgb.Pad((int(NumValues) * 12))) +type QueryPictIndexValuesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumValues uint32 + // padding: 20 bytes + Values []Indexvalue // size: xgb.Pad((int(NumValues) * 12)) +} + +// Waits and reads reply data from request QueryPictIndexValues +func (cook QueryPictIndexValuesCookie) Reply() (*QueryPictIndexValuesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryPictIndexValuesReply(buf), nil +} + +// Read reply into structure from buffer for QueryPictIndexValues +func queryPictIndexValuesReply(buf []byte) *QueryPictIndexValuesReply { + v := new(QueryPictIndexValuesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumValues = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Values = make([]Indexvalue, v.NumValues) + b += IndexvalueReadList(buf[b:], v.Values) + + return v +} + +// Write request to wire for QueryPictIndexValues +func queryPictIndexValuesRequest(c *xgb.Conn, Format Pictformat) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Format)) + b += 4 + + return buf +} + +// Request CreatePicture +// size: xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +type CreatePictureCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreatePicture +func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) + return CreatePictureCookie{cookie} +} + +func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) + return CreatePictureCookie{cookie} +} + +func (cook CreatePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePicture +func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Format)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request ChangePicture +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +type ChangePictureCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangePicture +func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) + return ChangePictureCookie{cookie} +} + +func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) + return ChangePictureCookie{cookie} +} + +func (cook ChangePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangePicture +func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request SetPictureClipRectangles +// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +type SetPictureClipRectanglesCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPictureClipRectangles +func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetPictureClipRectanglesCookie{cookie} +} + +func SetPictureClipRectanglesChecked(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetPictureClipRectanglesCookie{cookie} +} + +func (cook SetPictureClipRectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPictureClipRectangles +func setPictureClipRectanglesRequest(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put16(buf[b:], uint16(ClipXOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(ClipYOrigin)) + b += 2 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request FreePicture +// size: 8 +type FreePictureCookie struct { + *xgb.Cookie +} + +// Write request to wire for FreePicture +func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freePictureRequest(c, Picture), cookie) + return FreePictureCookie{cookie} +} + +func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freePictureRequest(c, Picture), cookie) + return FreePictureCookie{cookie} +} + +func (cook FreePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreePicture +func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// Request Composite +// size: 36 +type CompositeCookie struct { + *xgb.Cookie +} + +// Write request to wire for Composite +func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return CompositeCookie{cookie} +} + +func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return CompositeCookie{cookie} +} + +func (cook CompositeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Composite +func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mask)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], uint16(MaskX)) + b += 2 + + xgb.Put16(buf[b:], uint16(MaskY)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request Trapezoids +// size: xgb.Pad((24 + xgb.Pad((len(Traps) * 40)))) +type TrapezoidsCookie struct { + *xgb.Cookie +} + +// Write request to wire for Trapezoids +func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) + return TrapezoidsCookie{cookie} +} + +func TrapezoidsChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) + return TrapezoidsCookie{cookie} +} + +func (cook TrapezoidsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Trapezoids +func trapezoidsRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Traps) * 40)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += TrapezoidListBytes(buf[b:], Traps) + + return buf +} + +// Request Triangles +// size: xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) +type TrianglesCookie struct { + *xgb.Cookie +} + +// Write request to wire for Triangles +func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return TrianglesCookie{cookie} +} + +func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return TrianglesCookie{cookie} +} + +func (cook TrianglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Triangles +func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += TriangleListBytes(buf[b:], Triangles) + + return buf +} + +// Request TriStrip +// size: xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) +type TriStripCookie struct { + *xgb.Cookie +} + +// Write request to wire for TriStrip +func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriStripCookie{cookie} +} + +func TriStripChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriStripCookie{cookie} +} + +func (cook TriStripCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TriStrip +func triStripRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += PointfixListBytes(buf[b:], Points) + + return buf +} + +// Request TriFan +// size: xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) +type TriFanCookie struct { + *xgb.Cookie +} + +// Write request to wire for TriFan +func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriFanCookie{cookie} +} + +func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriFanCookie{cookie} +} + +func (cook TriFanCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TriFan +func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + b += PointfixListBytes(buf[b:], Points) + + return buf +} + +// Request CreateGlyphSet +// size: 12 +type CreateGlyphSetCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateGlyphSet +func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) + return CreateGlyphSetCookie{cookie} +} + +func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) + return CreateGlyphSetCookie{cookie} +} + +func (cook CreateGlyphSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateGlyphSet +func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gsid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Format)) + b += 4 + + return buf +} + +// Request ReferenceGlyphSet +// size: 12 +type ReferenceGlyphSetCookie struct { + *xgb.Cookie +} + +// Write request to wire for ReferenceGlyphSet +func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) + return ReferenceGlyphSetCookie{cookie} +} + +func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) + return ReferenceGlyphSetCookie{cookie} +} + +func (cook ReferenceGlyphSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ReferenceGlyphSet +func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gsid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Existing)) + b += 4 + + return buf +} + +// Request FreeGlyphSet +// size: 8 +type FreeGlyphSetCookie struct { + *xgb.Cookie +} + +// Write request to wire for FreeGlyphSet +func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) + return FreeGlyphSetCookie{cookie} +} + +func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) + return FreeGlyphSetCookie{cookie} +} + +func (cook FreeGlyphSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeGlyphSet +func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + return buf +} + +// Request AddGlyphs +// size: xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) +type AddGlyphsCookie struct { + *xgb.Cookie +} + +// Write request to wire for AddGlyphs +func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return AddGlyphsCookie{cookie} +} + +func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return AddGlyphsCookie{cookie} +} + +func (cook AddGlyphsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddGlyphs +func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { + size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put32(buf[b:], GlyphsLen) + b += 4 + + for i := 0; i < int(GlyphsLen); i++ { + xgb.Put32(buf[b:], Glyphids[i]) + b += 4 + } + b = xgb.Pad(b) + + b += GlyphinfoListBytes(buf[b:], Glyphs) + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// Request FreeGlyphs +// size: xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) +type FreeGlyphsCookie struct { + *xgb.Cookie +} + +// Write request to wire for FreeGlyphs +func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) + return FreeGlyphsCookie{cookie} +} + +func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) + return FreeGlyphsCookie{cookie} +} + +func (cook FreeGlyphsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeGlyphs +func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + for i := 0; i < int(len(Glyphs)); i++ { + xgb.Put32(buf[b:], uint32(Glyphs[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request CompositeGlyphs8 +// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +type CompositeGlyphs8Cookie struct { + *xgb.Cookie +} + +// Write request to wire for CompositeGlyphs8 +func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs8Cookie{cookie} +} + +func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs8Cookie{cookie} +} + +func (cook CompositeGlyphs8Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs8 +func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// Request CompositeGlyphs16 +// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +type CompositeGlyphs16Cookie struct { + *xgb.Cookie +} + +// Write request to wire for CompositeGlyphs16 +func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs16Cookie{cookie} +} + +func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs16Cookie{cookie} +} + +func (cook CompositeGlyphs16Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs16 +func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// Request CompositeGlyphs32 +// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +type CompositeGlyphs32Cookie struct { + *xgb.Cookie +} + +// Write request to wire for CompositeGlyphs32 +func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs32Cookie{cookie} +} + +func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs32Cookie{cookie} +} + +func (cook CompositeGlyphs32Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs32 +func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// Request FillRectangles +// size: xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) +type FillRectanglesCookie struct { + *xgb.Cookie +} + +// Write request to wire for FillRectangles +func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) + return FillRectanglesCookie{cookie} +} + +func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) + return FillRectanglesCookie{cookie} +} + +func (cook FillRectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FillRectangles +func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) []byte { + size := xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + b += xproto.RectangleListBytes(buf[b:], Rects) + + return buf +} + +// Request CreateCursor +// size: 16 +type CreateCursorCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateCursor +func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +func (cook CreateCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateCursor +func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put16(buf[b:], X) + b += 2 + + xgb.Put16(buf[b:], Y) + b += 2 + + return buf +} + +// Request SetPictureTransform +// size: 44 +type SetPictureTransformCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPictureTransform +func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) + return SetPictureTransformCookie{cookie} +} + +func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) + return SetPictureTransformCookie{cookie} +} + +func (cook SetPictureTransformCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPictureTransform +func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transform) []byte { + size := 44 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Transform.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Request QueryFilters +// size: 8 +type QueryFiltersCookie struct { + *xgb.Cookie +} + +func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryFiltersRequest(c, Drawable), cookie) + return QueryFiltersCookie{cookie} +} + +func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryFiltersRequest(c, Drawable), cookie) + return QueryFiltersCookie{cookie} +} + +// Request reply for QueryFilters +// size: ((32 + xgb.Pad((int(NumAliases) * 2))) + xproto.StrListSize(Filters)) +type QueryFiltersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAliases uint32 + NumFilters uint32 + // padding: 16 bytes + Aliases []uint16 // size: xgb.Pad((int(NumAliases) * 2)) + Filters []xproto.Str // size: xproto.StrListSize(Filters) +} + +// Waits and reads reply data from request QueryFilters +func (cook QueryFiltersCookie) Reply() (*QueryFiltersReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryFiltersReply(buf), nil +} + +// Read reply into structure from buffer for QueryFilters +func queryFiltersReply(buf []byte) *QueryFiltersReply { + v := new(QueryFiltersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAliases = xgb.Get32(buf[b:]) + b += 4 + + v.NumFilters = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.Aliases = make([]uint16, v.NumAliases) + for i := 0; i < int(v.NumAliases); i++ { + v.Aliases[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Filters = make([]xproto.Str, v.NumFilters) + b += xproto.StrReadList(buf[b:], v.Filters) + + return v +} + +// Write request to wire for QueryFilters +func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request SetPictureFilter +// size: xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) +type SetPictureFilterCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPictureFilter +func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) + return SetPictureFilterCookie{cookie} +} + +func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) + return SetPictureFilterCookie{cookie} +} + +func (cook SetPictureFilterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPictureFilter +func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) []byte { + size := xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put16(buf[b:], FilterLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Filter[:FilterLen]) + b += xgb.Pad(int(FilterLen)) + + for i := 0; i < int(len(Values)); i++ { + xgb.Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request CreateAnimCursor +// size: xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) +type CreateAnimCursorCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateAnimCursor +func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) + return CreateAnimCursorCookie{cookie} +} + +func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) + return CreateAnimCursorCookie{cookie} +} + +func (cook CreateAnimCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateAnimCursor +func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + b += AnimcursoreltListBytes(buf[b:], Cursors) + + return buf +} + +// Request AddTraps +// size: xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) +type AddTrapsCookie struct { + *xgb.Cookie +} + +// Write request to wire for AddTraps +func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) + return AddTrapsCookie{cookie} +} + +func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) + return AddTrapsCookie{cookie} +} + +func (cook AddTrapsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddTraps +func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOff)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOff)) + b += 2 + + b += TrapListBytes(buf[b:], Traps) + + return buf +} + +// Request CreateSolidFill +// size: 16 +type CreateSolidFillCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateSolidFill +func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) + return CreateSolidFillCookie{cookie} +} + +func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) + return CreateSolidFillCookie{cookie} +} + +func (cook CreateSolidFillCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateSolidFill +func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Request CreateLinearGradient +// size: xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +type CreateLinearGradientCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateLinearGradient +func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) + return CreateLinearGradientCookie{cookie} +} + +func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) + return CreateLinearGradientCookie{cookie} +} + +func (cook CreateLinearGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateLinearGradient +func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} + +// Request CreateRadialGradient +// size: xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +type CreateRadialGradientCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRadialGradient +func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return CreateRadialGradientCookie{cookie} +} + +func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return CreateRadialGradientCookie{cookie} +} + +func (cook CreateRadialGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRadialGradient +func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Inner.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := Outer.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(InnerRadius)) + b += 4 + + xgb.Put32(buf[b:], uint32(OuterRadius)) + b += 4 + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} + +// Request CreateConicalGradient +// size: xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +type CreateConicalGradientCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateConicalGradient +func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return CreateConicalGradientCookie{cookie} +} + +func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return CreateConicalGradientCookie{cookie} +} + +func (cook CreateConicalGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateConicalGradient +func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 36 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Center.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(Angle)) + b += 4 + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} diff --git a/nexgb/res/res.go b/nexgb/res/res.go new file mode 100644 index 0000000..aa958ab --- /dev/null +++ b/nexgb/res/res.go @@ -0,0 +1,514 @@ +package res + +/* + This file was generated by res.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the X-Resource extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 10, "X-Resource").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named X-Resource could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["X-Resource"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["X-Resource"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["X-Resource"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["X-Resource"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["X-Resource"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// 'Client' struct definition +// Size: 8 +type Client struct { + ResourceBase uint32 + ResourceMask uint32 +} + +// Struct read Client +func ClientRead(buf []byte, v *Client) int { + b := 0 + + v.ResourceBase = xgb.Get32(buf[b:]) + b += 4 + + v.ResourceMask = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Client +func ClientReadList(buf []byte, dest []Client) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Client{} + b += ClientRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Client +func (v Client) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], v.ResourceBase) + b += 4 + + xgb.Put32(buf[b:], v.ResourceMask) + b += 4 + + return buf +} + +// Write struct list Client +func ClientListBytes(buf []byte, list []Client) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Type' struct definition +// Size: 8 +type Type struct { + ResourceType xproto.Atom + Count uint32 +} + +// Struct read Type +func TypeRead(buf []byte, v *Type) int { + b := 0 + + v.ResourceType = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Count = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Type +func TypeReadList(buf []byte, dest []Type) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Type{} + b += TypeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Type +func (v Type) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.ResourceType)) + b += 4 + + xgb.Put32(buf[b:], v.Count) + b += 4 + + return buf +} + +// Write struct list Type +func TypeListBytes(buf []byte, list []Type) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 + + return buf +} + +// Request QueryClients +// size: 4 +type QueryClientsCookie struct { + *xgb.Cookie +} + +func QueryClients(c *xgb.Conn) QueryClientsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryClientsRequest(c), cookie) + return QueryClientsCookie{cookie} +} + +func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryClientsRequest(c), cookie) + return QueryClientsCookie{cookie} +} + +// Request reply for QueryClients +// size: (32 + xgb.Pad((int(NumClients) * 8))) +type QueryClientsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClients uint32 + // padding: 20 bytes + Clients []Client // size: xgb.Pad((int(NumClients) * 8)) +} + +// Waits and reads reply data from request QueryClients +func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryClientsReply(buf), nil +} + +// Read reply into structure from buffer for QueryClients +func queryClientsReply(buf []byte) *QueryClientsReply { + v := new(QueryClientsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClients = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Clients = make([]Client, v.NumClients) + b += ClientReadList(buf[b:], v.Clients) + + return v +} + +// Write request to wire for QueryClients +func queryClientsRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request QueryClientResources +// size: 8 +type QueryClientResourcesCookie struct { + *xgb.Cookie +} + +func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) + return QueryClientResourcesCookie{cookie} +} + +func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) + return QueryClientResourcesCookie{cookie} +} + +// Request reply for QueryClientResources +// size: (32 + xgb.Pad((int(NumTypes) * 8))) +type QueryClientResourcesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumTypes uint32 + // padding: 20 bytes + Types []Type // size: xgb.Pad((int(NumTypes) * 8)) +} + +// Waits and reads reply data from request QueryClientResources +func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryClientResourcesReply(buf), nil +} + +// Read reply into structure from buffer for QueryClientResources +func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply { + v := new(QueryClientResourcesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumTypes = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Types = make([]Type, v.NumTypes) + b += TypeReadList(buf[b:], v.Types) + + return v +} + +// Write request to wire for QueryClientResources +func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Xid) + b += 4 + + return buf +} + +// Request QueryClientPixmapBytes +// size: 8 +type QueryClientPixmapBytesCookie struct { + *xgb.Cookie +} + +func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) + return QueryClientPixmapBytesCookie{cookie} +} + +func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) + return QueryClientPixmapBytesCookie{cookie} +} + +// Request reply for QueryClientPixmapBytes +// size: 16 +type QueryClientPixmapBytesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Bytes uint32 + BytesOverflow uint32 +} + +// Waits and reads reply data from request QueryClientPixmapBytes +func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryClientPixmapBytesReply(buf), nil +} + +// Read reply into structure from buffer for QueryClientPixmapBytes +func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { + v := new(QueryClientPixmapBytesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Bytes = xgb.Get32(buf[b:]) + b += 4 + + v.BytesOverflow = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryClientPixmapBytes +func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Xid) + b += 4 + + return buf +} diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go new file mode 100644 index 0000000..d9353f2 --- /dev/null +++ b/nexgb/screensaver/screensaver.go @@ -0,0 +1,621 @@ +package screensaver + +/* + This file was generated by screensaver.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the MIT-SCREEN-SAVER extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 16, "MIT-SCREEN-SAVER").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named MIT-SCREEN-SAVER could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +const ( + KindBlanked = 0 + KindInternal = 1 + KindExternal = 2 +) + +const ( + EventNotifyMask = 1 + EventCycleMask = 2 +) + +const ( + StateOff = 0 + StateOn = 1 + StateCycle = 2 + StateDisabled = 3 +) + +// Event definition Notify (0) +// Size: 32 + +const Notify = 0 + +type NotifyEvent struct { + Sequence uint16 + Code byte + State byte + // padding: 1 bytes + SequenceNumber uint16 + Time xproto.Timestamp + Root xproto.Window + Window xproto.Window + Kind byte + Forced bool + // padding: 14 bytes +} + +// Event read Notify +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number + + v.Code = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.State = buf[b] + b += 1 + + b += 1 // padding + + v.SequenceNumber = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Kind = buf[b] + b += 1 + + if buf[b] == 1 { + v.Forced = true + } else { + v.Forced = false + } + b += 1 + + b += 14 // padding + + return v +} + +// Event write Notify +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Code + b += 1 + + b += 2 // skip sequence number + + buf[b] = v.State + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.SequenceNumber) + b += 2 + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.Kind + b += 1 + + if v.Forced { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 14 // padding + + return buf +} + +func (v NotifyEvent) ImplementsEvent() {} + +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Code: %d", v.Code)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SequenceNumber: %d", v.SequenceNumber)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, xgb.Sprintf("Forced: %t", v.Forced)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajorVersion + b += 1 + + buf[b] = ClientMinorVersion + b += 1 + + b += 2 // padding + + return buf +} + +// Request QueryInfo +// size: 8 +type QueryInfoCookie struct { + *xgb.Cookie +} + +func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryInfoRequest(c, Drawable), cookie) + return QueryInfoCookie{cookie} +} + +func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryInfoRequest(c, Drawable), cookie) + return QueryInfoCookie{cookie} +} + +// Request reply for QueryInfo +// size: 32 +type QueryInfoReply struct { + Sequence uint16 + Length uint32 + State byte + SaverWindow xproto.Window + MsUntilServer uint32 + MsSinceUserInput uint32 + EventMask uint32 + Kind byte + // padding: 7 bytes +} + +// Waits and reads reply data from request QueryInfo +func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryInfoReply(buf), nil +} + +// Read reply into structure from buffer for QueryInfo +func queryInfoReply(buf []byte) *QueryInfoReply { + v := new(QueryInfoReply) + b := 1 // skip reply determinant + + v.State = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.SaverWindow = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.MsUntilServer = xgb.Get32(buf[b:]) + b += 4 + + v.MsSinceUserInput = xgb.Get32(buf[b:]) + b += 4 + + v.EventMask = xgb.Get32(buf[b:]) + b += 4 + + v.Kind = buf[b] + b += 1 + + b += 7 // padding + + return v +} + +// Write request to wire for QueryInfo +func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request SelectInput +// size: 12 +type SelectInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectInput +func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) + return SelectInputCookie{cookie} +} + +func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) + return SelectInputCookie{cookie} +} + +func (cook SelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectInput +func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request SetAttributes +// size: xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +type SetAttributesCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetAttributes +func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) + return SetAttributesCookie{cookie} +} + +func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) + return SetAttributesCookie{cookie} +} + +func (cook SetAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetAttributes +func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put16(buf[b:], BorderWidth) + b += 2 + + buf[b] = Class + b += 1 + + buf[b] = Depth + b += 1 + + xgb.Put32(buf[b:], uint32(Visual)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request UnsetAttributes +// size: 8 +type UnsetAttributesCookie struct { + *xgb.Cookie +} + +// Write request to wire for UnsetAttributes +func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) + return UnsetAttributesCookie{cookie} +} + +func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) + return UnsetAttributesCookie{cookie} +} + +func (cook UnsetAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnsetAttributes +func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request Suspend +// size: 8 +type SuspendCookie struct { + *xgb.Cookie +} + +// Write request to wire for Suspend +func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(suspendRequest(c, Suspend), cookie) + return SuspendCookie{cookie} +} + +func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(suspendRequest(c, Suspend), cookie) + return SuspendCookie{cookie} +} + +func (cook SuspendCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Suspend +func suspendRequest(c *xgb.Conn, Suspend bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Suspend { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go new file mode 100644 index 0000000..5d9dbf3 --- /dev/null +++ b/nexgb/shape/shape.go @@ -0,0 +1,883 @@ +package shape + +/* + This file was generated by shape.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the SHAPE extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 5, "SHAPE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named SHAPE could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["SHAPE"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["SHAPE"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["SHAPE"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["SHAPE"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +const ( + SoSet = 0 + SoUnion = 1 + SoIntersect = 2 + SoSubtract = 3 + SoInvert = 4 +) + +const ( + SkBounding = 0 + SkClip = 1 + SkInput = 2 +) + +type Op byte + +type Kind byte + +// Event definition Notify (0) +// Size: 32 + +const Notify = 0 + +type NotifyEvent struct { + Sequence uint16 + ShapeKind Kind + AffectedWindow xproto.Window + ExtentsX int16 + ExtentsY int16 + ExtentsWidth uint16 + ExtentsHeight uint16 + ServerTime xproto.Timestamp + Shaped bool + // padding: 11 bytes +} + +// Event read Notify +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number + + v.ShapeKind = Kind(buf[b]) + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.AffectedWindow = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.ExtentsX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.ExtentsY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.ExtentsWidth = xgb.Get16(buf[b:]) + b += 2 + + v.ExtentsHeight = xgb.Get16(buf[b:]) + b += 2 + + v.ServerTime = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.Shaped = true + } else { + v.Shaped = false + } + b += 1 + + b += 11 // padding + + return v +} + +// Event write Notify +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = byte(v.ShapeKind) + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.AffectedWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.ExtentsX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.ExtentsY)) + b += 2 + + xgb.Put16(buf[b:], v.ExtentsWidth) + b += 2 + + xgb.Put16(buf[b:], v.ExtentsHeight) + b += 2 + + xgb.Put32(buf[b:], uint32(v.ServerTime)) + b += 4 + + if v.Shaped { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 11 // padding + + return buf +} + +func (v NotifyEvent) ImplementsEvent() {} + +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("ShapeKind: %d", v.ShapeKind)) + fieldVals = append(fieldVals, xgb.Sprintf("AffectedWindow: %d", v.AffectedWindow)) + fieldVals = append(fieldVals, xgb.Sprintf("ExtentsX: %d", v.ExtentsX)) + fieldVals = append(fieldVals, xgb.Sprintf("ExtentsY: %d", v.ExtentsY)) + fieldVals = append(fieldVals, xgb.Sprintf("ExtentsWidth: %d", v.ExtentsWidth)) + fieldVals = append(fieldVals, xgb.Sprintf("ExtentsHeight: %d", v.ExtentsHeight)) + fieldVals = append(fieldVals, xgb.Sprintf("ServerTime: %d", v.ServerTime)) + fieldVals = append(fieldVals, xgb.Sprintf("Shaped: %t", v.Shaped)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew +} + +// Request QueryVersion +// size: 4 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Rectangles +// size: xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) +type RectanglesCookie struct { + *xgb.Cookie +} + +// Write request to wire for Rectangles +func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return RectanglesCookie{cookie} +} + +func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return RectanglesCookie{cookie} +} + +func (cook RectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Rectangles +func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + buf[b] = Ordering + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request Mask +// size: 20 +type MaskCookie struct { + *xgb.Cookie +} + +// Write request to wire for Mask +func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return MaskCookie{cookie} +} + +func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return MaskCookie{cookie} +} + +func (cook MaskCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Mask +func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + xgb.Put32(buf[b:], uint32(SourceBitmap)) + b += 4 + + return buf +} + +// Request Combine +// size: 20 +type CombineCookie struct { + *xgb.Cookie +} + +// Write request to wire for Combine +func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) + return CombineCookie{cookie} +} + +func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) + return CombineCookie{cookie} +} + +func (cook CombineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Combine +func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + buf[b] = byte(SourceKind) + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + xgb.Put32(buf[b:], uint32(SourceWindow)) + b += 4 + + return buf +} + +// Request Offset +// size: 16 +type OffsetCookie struct { + *xgb.Cookie +} + +// Write request to wire for Offset +func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) + return OffsetCookie{cookie} +} + +func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) + return OffsetCookie{cookie} +} + +func (cook OffsetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Offset +func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(DestinationKind) + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + return buf +} + +// Request QueryExtents +// size: 8 +type QueryExtentsCookie struct { + *xgb.Cookie +} + +func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) + return QueryExtentsCookie{cookie} +} + +func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) + return QueryExtentsCookie{cookie} +} + +// Request reply for QueryExtents +// size: 28 +type QueryExtentsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + BoundingShaped bool + ClipShaped bool + // padding: 2 bytes + BoundingShapeExtentsX int16 + BoundingShapeExtentsY int16 + BoundingShapeExtentsWidth uint16 + BoundingShapeExtentsHeight uint16 + ClipShapeExtentsX int16 + ClipShapeExtentsY int16 + ClipShapeExtentsWidth uint16 + ClipShapeExtentsHeight uint16 +} + +// Waits and reads reply data from request QueryExtents +func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryExtentsReply(buf), nil +} + +// Read reply into structure from buffer for QueryExtents +func queryExtentsReply(buf []byte) *QueryExtentsReply { + v := new(QueryExtentsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.BoundingShaped = true + } else { + v.BoundingShaped = false + } + b += 1 + + if buf[b] == 1 { + v.ClipShaped = true + } else { + v.ClipShaped = false + } + b += 1 + + b += 2 // padding + + v.BoundingShapeExtentsX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BoundingShapeExtentsY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BoundingShapeExtentsWidth = xgb.Get16(buf[b:]) + b += 2 + + v.BoundingShapeExtentsHeight = xgb.Get16(buf[b:]) + b += 2 + + v.ClipShapeExtentsX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.ClipShapeExtentsY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.ClipShapeExtentsWidth = xgb.Get16(buf[b:]) + b += 2 + + v.ClipShapeExtentsHeight = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryExtents +func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + return buf +} + +// Request SelectInput +// size: 12 +type SelectInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectInput +func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) + return SelectInputCookie{cookie} +} + +func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) + return SelectInputCookie{cookie} +} + +func (cook SelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectInput +func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + if Enable { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request InputSelected +// size: 8 +type InputSelectedCookie struct { + *xgb.Cookie +} + +func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) + return InputSelectedCookie{cookie} +} + +func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) + return InputSelectedCookie{cookie} +} + +// Request reply for InputSelected +// size: 8 +type InputSelectedReply struct { + Sequence uint16 + Length uint32 + Enabled bool +} + +// Waits and reads reply data from request InputSelected +func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return inputSelectedReply(buf), nil +} + +// Read reply into structure from buffer for InputSelected +func inputSelectedReply(buf []byte) *InputSelectedReply { + v := new(InputSelectedReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for InputSelected +func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + return buf +} + +// Request GetRectangles +// size: 12 +type GetRectanglesCookie struct { + *xgb.Cookie +} + +func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) + return GetRectanglesCookie{cookie} +} + +func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) + return GetRectanglesCookie{cookie} +} + +// Request reply for GetRectangles +// size: (32 + xgb.Pad((int(RectanglesLen) * 8))) +type GetRectanglesReply struct { + Sequence uint16 + Length uint32 + Ordering byte + RectanglesLen uint32 + // padding: 20 bytes + Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8)) +} + +// Waits and reads reply data from request GetRectangles +func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getRectanglesReply(buf), nil +} + +// Read reply into structure from buffer for GetRectangles +func getRectanglesReply(buf []byte) *GetRectanglesReply { + v := new(GetRectanglesReply) + b := 1 // skip reply determinant + + v.Ordering = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RectanglesLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Rectangles = make([]xproto.Rectangle, v.RectanglesLen) + b += xproto.RectangleReadList(buf[b:], v.Rectangles) + + return v +} + +// Write request to wire for GetRectangles +func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = byte(SourceKind) + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go new file mode 100644 index 0000000..ecffafc --- /dev/null +++ b/nexgb/shm/shm.go @@ -0,0 +1,672 @@ +package shm + +/* + This file was generated by shm.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the MIT-SHM extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 7, "MIT-SHM").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named MIT-SHM could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["MIT-SHM"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["MIT-SHM"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["MIT-SHM"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["MIT-SHM"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +type Seg uint32 + +func NewSegId(c *xgb.Conn) (Seg, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Seg(id), nil +} + +// Event definition Completion (0) +// Size: 32 + +const Completion = 0 + +type CompletionEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable xproto.Drawable + MinorEvent uint16 + MajorEvent byte + // padding: 1 bytes + Shmseg Seg + Offset uint32 +} + +// Event read Completion +func CompletionEventNew(buf []byte) xgb.Event { + v := CompletionEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.MinorEvent = xgb.Get16(buf[b:]) + b += 2 + + v.MajorEvent = buf[b] + b += 1 + + b += 1 // padding + + v.Shmseg = Seg(xgb.Get32(buf[b:])) + b += 4 + + v.Offset = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Event write Completion +func (v CompletionEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put16(buf[b:], v.MinorEvent) + b += 2 + + buf[b] = v.MajorEvent + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(v.Shmseg)) + b += 4 + + xgb.Put32(buf[b:], v.Offset) + b += 4 + + return buf +} + +func (v CompletionEvent) ImplementsEvent() {} + +func (v CompletionEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v CompletionEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorEvent: %d", v.MinorEvent)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorEvent: %d", v.MajorEvent)) + fieldVals = append(fieldVals, xgb.Sprintf("Shmseg: %d", v.Shmseg)) + fieldVals = append(fieldVals, xgb.Sprintf("Offset: %d", v.Offset)) + return "Completion {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew +} + +// ErrorCopy definition BadSeg (0) + +const BadBadSeg = 0 + +type BadSegError xproto.ValueError + +func BadSegErrorNew(buf []byte) xgb.Error { + v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError)) + v.NiceName = "BadSeg" + return v +} + +func (err BadSegError) ImplementsError() {} + +func (err BadSegError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadSegError) BadId() uint32 { + return 0 +} + +func (err BadSegError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadSeg {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew +} + +// Request QueryVersion +// size: 4 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + SharedPixmaps bool + MajorVersion uint16 + MinorVersion uint16 + Uid uint16 + Gid uint16 + PixmapFormat byte + // padding: 15 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SharedPixmaps = true + } else { + v.SharedPixmaps = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.Uid = xgb.Get16(buf[b:]) + b += 2 + + v.Gid = xgb.Get16(buf[b:]) + b += 2 + + v.PixmapFormat = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request Attach +// size: 16 +type AttachCookie struct { + *xgb.Cookie +} + +// Write request to wire for Attach +func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) + return AttachCookie{cookie} +} + +func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) + return AttachCookie{cookie} +} + +func (cook AttachCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Attach +func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Shmid) + b += 4 + + if ReadOnly { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request Detach +// size: 8 +type DetachCookie struct { + *xgb.Cookie +} + +// Write request to wire for Detach +func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(detachRequest(c, Shmseg), cookie) + return DetachCookie{cookie} +} + +func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(detachRequest(c, Shmseg), cookie) + return DetachCookie{cookie} +} + +func (cook DetachCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Detach +func detachRequest(c *xgb.Conn, Shmseg Seg) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + return buf +} + +// Request PutImage +// size: 40 +type PutImageCookie struct { + *xgb.Cookie +} + +// Write request to wire for PutImage +func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return PutImageCookie{cookie} +} + +func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return PutImageCookie{cookie} +} + +func (cook PutImageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutImage +func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) []byte { + size := 40 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], TotalWidth) + b += 2 + + xgb.Put16(buf[b:], TotalHeight) + b += 2 + + xgb.Put16(buf[b:], SrcX) + b += 2 + + xgb.Put16(buf[b:], SrcY) + b += 2 + + xgb.Put16(buf[b:], SrcWidth) + b += 2 + + xgb.Put16(buf[b:], SrcHeight) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + buf[b] = Depth + b += 1 + + buf[b] = Format + b += 1 + + buf[b] = SendEvent + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Offset) + b += 4 + + return buf +} + +// Request GetImage +// size: 32 +type GetImageCookie struct { + *xgb.Cookie +} + +func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) + return GetImageCookie{cookie} +} + +func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) + return GetImageCookie{cookie} +} + +// Request reply for GetImage +// size: 16 +type GetImageReply struct { + Sequence uint16 + Length uint32 + Depth byte + Visual xproto.Visualid + Size uint32 +} + +// Waits and reads reply data from request GetImage +func (cook GetImageCookie) Reply() (*GetImageReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getImageReply(buf), nil +} + +// Read reply into structure from buffer for GetImage +func getImageReply(buf []byte) *GetImageReply { + v := new(GetImageReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Size = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetImage +func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], PlaneMask) + b += 4 + + buf[b] = Format + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Offset) + b += 4 + + return buf +} + +// Request CreatePixmap +// size: 28 +type CreatePixmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreatePixmap +func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return CreatePixmapCookie{cookie} +} + +func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return CreatePixmapCookie{cookie} +} + +func (cook CreatePixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePixmap +func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + buf[b] = Depth + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Offset) + b += 4 + + return buf +} diff --git a/nexgb/sync.go b/nexgb/sync.go new file mode 100644 index 0000000..d671e62 --- /dev/null +++ b/nexgb/sync.go @@ -0,0 +1,29 @@ +package xgb + +// Sync sends a round trip request and wait for the response. +// This forces all pending cookies to be dealt with. +// You actually shouldn't need to use this like you might with Xlib. Namely, +// buffers are automatically flushed using Go's channels and round trip requests +// are forced where appropriate automatically. +func (c *Conn) Sync() { + cookie := c.NewCookie(true, true) + c.NewRequest(c.getInputFocusRequest(), cookie) + cookie.Reply() // wait for the buffer to clear +} + +// getInputFocusRequest writes the raw bytes to a buffer. +// It is duplicated from xproto/xproto.go. +func (c *Conn) getInputFocusRequest() []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 43 // request opcode + b += 1 + + b += 1 // padding + Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go new file mode 100644 index 0000000..689a5c3 --- /dev/null +++ b/nexgb/sync/sync.go @@ -0,0 +1,1927 @@ +package sync + +/* + This file was generated by sync.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the SYNC extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 4, "SYNC").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named SYNC could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["SYNC"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["SYNC"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["SYNC"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["SYNC"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +const ( + AlarmstateActive = 0 + AlarmstateInactive = 1 + AlarmstateDestroyed = 2 +) + +const ( + TesttypePositiveTransition = 0 + TesttypeNegativeTransition = 1 + TesttypePositiveComparison = 2 + TesttypeNegativeComparison = 3 +) + +const ( + ValuetypeAbsolute = 0 + ValuetypeRelative = 1 +) + +const ( + CaCounter = 1 + CaValueType = 2 + CaValue = 4 + CaTestType = 8 + CaDelta = 16 + CaEvents = 32 +) + +type Alarm uint32 + +func NewAlarmId(c *xgb.Conn) (Alarm, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Alarm(id), nil +} + +type Counter uint32 + +func NewCounterId(c *xgb.Conn) (Counter, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Counter(id), nil +} + +type Fence uint32 + +func NewFenceId(c *xgb.Conn) (Fence, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Fence(id), nil +} + +// 'Int64' struct definition +// Size: 8 +type Int64 struct { + Hi int32 + Lo uint32 +} + +// Struct read Int64 +func Int64Read(buf []byte, v *Int64) int { + b := 0 + + v.Hi = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Lo = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Int64 +func Int64ReadList(buf []byte, dest []Int64) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Int64{} + b += Int64Read(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Int64 +func (v Int64) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Hi)) + b += 4 + + xgb.Put32(buf[b:], v.Lo) + b += 4 + + return buf +} + +// Write struct list Int64 +func Int64ListBytes(buf []byte, list []Int64) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Systemcounter' struct definition +// Size: (14 + xgb.Pad((int(NameLen) * 1))) +type Systemcounter struct { + Counter Counter + Resolution Int64 + NameLen uint16 + Name string // size: xgb.Pad((int(NameLen) * 1)) +} + +// Struct read Systemcounter +func SystemcounterRead(buf []byte, v *Systemcounter) int { + b := 0 + + v.Counter = Counter(xgb.Get32(buf[b:])) + b += 4 + + v.Resolution = Int64{} + b += Int64Read(buf[b:], &v.Resolution) + + v.NameLen = xgb.Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameLen)) + } + + return b +} + +// Struct list read Systemcounter +func SystemcounterReadList(buf []byte, dest []Systemcounter) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Systemcounter{} + b += SystemcounterRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Systemcounter +func (v Systemcounter) Bytes() []byte { + buf := make([]byte, (14 + xgb.Pad((int(v.NameLen) * 1)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Counter)) + b += 4 + + { + structBytes := v.Resolution.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put16(buf[b:], v.NameLen) + b += 2 + + copy(buf[b:], v.Name[:v.NameLen]) + b += xgb.Pad(int(v.NameLen)) + + return buf +} + +// Write struct list Systemcounter +func SystemcounterListBytes(buf []byte, list []Systemcounter) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size Systemcounter +func SystemcounterListSize(list []Systemcounter) int { + size := 0 + for _, item := range list { + size += (14 + xgb.Pad((int(item.NameLen) * 1))) + } + return size +} + +// 'Trigger' struct definition +// Size: 20 +type Trigger struct { + Counter Counter + WaitType uint32 + WaitValue Int64 + TestType uint32 +} + +// Struct read Trigger +func TriggerRead(buf []byte, v *Trigger) int { + b := 0 + + v.Counter = Counter(xgb.Get32(buf[b:])) + b += 4 + + v.WaitType = xgb.Get32(buf[b:]) + b += 4 + + v.WaitValue = Int64{} + b += Int64Read(buf[b:], &v.WaitValue) + + v.TestType = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read Trigger +func TriggerReadList(buf []byte, dest []Trigger) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Trigger{} + b += TriggerRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Trigger +func (v Trigger) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Counter)) + b += 4 + + xgb.Put32(buf[b:], v.WaitType) + b += 4 + + { + structBytes := v.WaitValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], v.TestType) + b += 4 + + return buf +} + +// Write struct list Trigger +func TriggerListBytes(buf []byte, list []Trigger) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Waitcondition' struct definition +// Size: 28 +type Waitcondition struct { + Trigger Trigger + EventThreshold Int64 +} + +// Struct read Waitcondition +func WaitconditionRead(buf []byte, v *Waitcondition) int { + b := 0 + + v.Trigger = Trigger{} + b += TriggerRead(buf[b:], &v.Trigger) + + v.EventThreshold = Int64{} + b += Int64Read(buf[b:], &v.EventThreshold) + + return b +} + +// Struct list read Waitcondition +func WaitconditionReadList(buf []byte, dest []Waitcondition) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Waitcondition{} + b += WaitconditionRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Waitcondition +func (v Waitcondition) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + { + structBytes := v.Trigger.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.EventThreshold.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Write struct list Waitcondition +func WaitconditionListBytes(buf []byte, list []Waitcondition) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Event definition CounterNotify (0) +// Size: 32 + +const CounterNotify = 0 + +type CounterNotifyEvent struct { + Sequence uint16 + Kind byte + Counter Counter + WaitValue Int64 + CounterValue Int64 + Timestamp xproto.Timestamp + Count uint16 + Destroyed bool + // padding: 1 bytes +} + +// Event read CounterNotify +func CounterNotifyEventNew(buf []byte) xgb.Event { + v := CounterNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Counter = Counter(xgb.Get32(buf[b:])) + b += 4 + + v.WaitValue = Int64{} + b += Int64Read(buf[b:], &v.WaitValue) + + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Count = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Destroyed = true + } else { + v.Destroyed = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Event write CounterNotify +func (v CounterNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Counter)) + b += 4 + + { + structBytes := v.WaitValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put16(buf[b:], v.Count) + b += 2 + + if v.Destroyed { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +func (v CounterNotifyEvent) ImplementsEvent() {} + +func (v CounterNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v CounterNotifyEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, xgb.Sprintf("Counter: %d", v.Counter)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("Destroyed: %t", v.Destroyed)) + return "CounterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["SYNC"][0] = CounterNotifyEventNew +} + +// Event definition AlarmNotify (1) +// Size: 32 + +const AlarmNotify = 1 + +type AlarmNotifyEvent struct { + Sequence uint16 + Kind byte + Alarm Alarm + CounterValue Int64 + AlarmValue Int64 + Timestamp xproto.Timestamp + State byte + // padding: 3 bytes +} + +// Event read AlarmNotify +func AlarmNotifyEventNew(buf []byte) xgb.Event { + v := AlarmNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Alarm = Alarm(xgb.Get32(buf[b:])) + b += 4 + + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) + + v.AlarmValue = Int64{} + b += Int64Read(buf[b:], &v.AlarmValue) + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Event write AlarmNotify +func (v AlarmNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Alarm)) + b += 4 + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.AlarmValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +func (v AlarmNotifyEvent) ImplementsEvent() {} + +func (v AlarmNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v AlarmNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, xgb.Sprintf("Alarm: %d", v.Alarm)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "AlarmNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["SYNC"][1] = AlarmNotifyEventNew +} + +// Error definition Counter (0) +// Size: 32 + +const BadCounter = 0 + +type CounterError struct { + Sequence uint16 + NiceName string + BadCounter uint32 + MinorOpcode uint16 + MajorOpcode byte +} + +// Error read Counter +func CounterErrorNew(buf []byte) xgb.Error { + v := CounterError{} + v.NiceName = "Counter" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadCounter = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + return v +} + +func (err CounterError) ImplementsError() {} + +func (err CounterError) SequenceId() uint16 { + return err.Sequence +} + +func (err CounterError) BadId() uint32 { + return 0 +} + +func (err CounterError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadCounter: %d", err.BadCounter)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadCounter {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["SYNC"][0] = CounterErrorNew +} + +// Error definition Alarm (1) +// Size: 32 + +const BadAlarm = 1 + +type AlarmError struct { + Sequence uint16 + NiceName string + BadAlarm uint32 + MinorOpcode uint16 + MajorOpcode byte +} + +// Error read Alarm +func AlarmErrorNew(buf []byte) xgb.Error { + v := AlarmError{} + v.NiceName = "Alarm" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadAlarm = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + return v +} + +func (err AlarmError) ImplementsError() {} + +func (err AlarmError) SequenceId() uint16 { + return err.Sequence +} + +func (err AlarmError) BadId() uint32 { + return 0 +} + +func (err AlarmError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadAlarm: %d", err.BadAlarm)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAlarm {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["SYNC"][1] = AlarmErrorNew +} + +// Request Initialize +// size: 8 +type InitializeCookie struct { + *xgb.Cookie +} + +func Initialize(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) + return InitializeCookie{cookie} +} + +func InitializeUnchecked(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) + return InitializeCookie{cookie} +} + +// Request reply for Initialize +// size: 32 +type InitializeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion byte + MinorVersion byte + // padding: 22 bytes +} + +// Waits and reads reply data from request Initialize +func (cook InitializeCookie) Reply() (*InitializeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return initializeReply(buf), nil +} + +// Read reply into structure from buffer for Initialize +func initializeReply(buf []byte) *InitializeReply { + v := new(InitializeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = buf[b] + b += 1 + + v.MinorVersion = buf[b] + b += 1 + + b += 22 // padding + + return v +} + +// Write request to wire for Initialize +func initializeRequest(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DesiredMajorVersion + b += 1 + + buf[b] = DesiredMinorVersion + b += 1 + + return buf +} + +// Request ListSystemCounters +// size: 4 +type ListSystemCountersCookie struct { + *xgb.Cookie +} + +func ListSystemCounters(c *xgb.Conn) ListSystemCountersCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listSystemCountersRequest(c), cookie) + return ListSystemCountersCookie{cookie} +} + +func ListSystemCountersUnchecked(c *xgb.Conn) ListSystemCountersCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listSystemCountersRequest(c), cookie) + return ListSystemCountersCookie{cookie} +} + +// Request reply for ListSystemCounters +// size: (32 + SystemcounterListSize(Counters)) +type ListSystemCountersReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + CountersLen uint32 + // padding: 20 bytes + Counters []Systemcounter // size: SystemcounterListSize(Counters) +} + +// Waits and reads reply data from request ListSystemCounters +func (cook ListSystemCountersCookie) Reply() (*ListSystemCountersReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listSystemCountersReply(buf), nil +} + +// Read reply into structure from buffer for ListSystemCounters +func listSystemCountersReply(buf []byte) *ListSystemCountersReply { + v := new(ListSystemCountersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.CountersLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Counters = make([]Systemcounter, v.CountersLen) + b += SystemcounterReadList(buf[b:], v.Counters) + + return v +} + +// Write request to wire for ListSystemCounters +func listSystemCountersRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request CreateCounter +// size: 16 +type CreateCounterCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateCounter +func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) + return CreateCounterCookie{cookie} +} + +func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) + return CreateCounterCookie{cookie} +} + +func (cook CreateCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateCounter +func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + { + structBytes := InitialValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Request DestroyCounter +// size: 8 +type DestroyCounterCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyCounter +func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyCounterRequest(c, Counter), cookie) + return DestroyCounterCookie{cookie} +} + +func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyCounterRequest(c, Counter), cookie) + return DestroyCounterCookie{cookie} +} + +func (cook DestroyCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyCounter +func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + return buf +} + +// Request QueryCounter +// size: 8 +type QueryCounterCookie struct { + *xgb.Cookie +} + +func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryCounterRequest(c, Counter), cookie) + return QueryCounterCookie{cookie} +} + +func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryCounterRequest(c, Counter), cookie) + return QueryCounterCookie{cookie} +} + +// Request reply for QueryCounter +// size: 16 +type QueryCounterReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + CounterValue Int64 +} + +// Waits and reads reply data from request QueryCounter +func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryCounterReply(buf), nil +} + +// Read reply into structure from buffer for QueryCounter +func queryCounterReply(buf []byte) *QueryCounterReply { + v := new(QueryCounterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) + + return v +} + +// Write request to wire for QueryCounter +func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + return buf +} + +// Request Await +// size: xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) +type AwaitCookie struct { + *xgb.Cookie +} + +// Write request to wire for Await +func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(awaitRequest(c, WaitList), cookie) + return AwaitCookie{cookie} +} + +func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(awaitRequest(c, WaitList), cookie) + return AwaitCookie{cookie} +} + +func (cook AwaitCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Await +func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { + size := xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + b += WaitconditionListBytes(buf[b:], WaitList) + + return buf +} + +// Request ChangeCounter +// size: 16 +type ChangeCounterCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeCounter +func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) + return ChangeCounterCookie{cookie} +} + +func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) + return ChangeCounterCookie{cookie} +} + +func (cook ChangeCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeCounter +func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Amount.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Request SetCounter +// size: 16 +type SetCounterCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetCounter +func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCounterRequest(c, Counter, Value), cookie) + return SetCounterCookie{cookie} +} + +func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCounterRequest(c, Counter, Value), cookie) + return SetCounterCookie{cookie} +} + +func (cook SetCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCounter +func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Value.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// Request CreateAlarm +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +type CreateAlarmCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateAlarm +func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return CreateAlarmCookie{cookie} +} + +func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return CreateAlarmCookie{cookie} +} + +func (cook CreateAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateAlarm +func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request ChangeAlarm +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +type ChangeAlarmCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeAlarm +func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return ChangeAlarmCookie{cookie} +} + +func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return ChangeAlarmCookie{cookie} +} + +func (cook ChangeAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeAlarm +func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DestroyAlarm +// size: 8 +type DestroyAlarmCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyAlarm +func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) + return DestroyAlarmCookie{cookie} +} + +func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) + return DestroyAlarmCookie{cookie} +} + +func (cook DestroyAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyAlarm +func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Alarm)) + b += 4 + + return buf +} + +// Request QueryAlarm +// size: 8 +type QueryAlarmCookie struct { + *xgb.Cookie +} + +func QueryAlarm(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryAlarmRequest(c, Alarm), cookie) + return QueryAlarmCookie{cookie} +} + +func QueryAlarmUnchecked(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryAlarmRequest(c, Alarm), cookie) + return QueryAlarmCookie{cookie} +} + +// Request reply for QueryAlarm +// size: 40 +type QueryAlarmReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Trigger Trigger + Delta Int64 + Events bool + State byte + // padding: 2 bytes +} + +// Waits and reads reply data from request QueryAlarm +func (cook QueryAlarmCookie) Reply() (*QueryAlarmReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryAlarmReply(buf), nil +} + +// Read reply into structure from buffer for QueryAlarm +func queryAlarmReply(buf []byte) *QueryAlarmReply { + v := new(QueryAlarmReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Trigger = Trigger{} + b += TriggerRead(buf[b:], &v.Trigger) + + v.Delta = Int64{} + b += Int64Read(buf[b:], &v.Delta) + + if buf[b] == 1 { + v.Events = true + } else { + v.Events = false + } + b += 1 + + v.State = buf[b] + b += 1 + + b += 2 // padding + + return v +} + +// Write request to wire for QueryAlarm +func queryAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Alarm)) + b += 4 + + return buf +} + +// Request SetPriority +// size: 12 +type SetPriorityCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPriority +func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) + return SetPriorityCookie{cookie} +} + +func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) + return SetPriorityCookie{cookie} +} + +func (cook SetPriorityCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPriority +func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], uint32(Priority)) + b += 4 + + return buf +} + +// Request GetPriority +// size: 8 +type GetPriorityCookie struct { + *xgb.Cookie +} + +func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPriorityRequest(c, Id), cookie) + return GetPriorityCookie{cookie} +} + +func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPriorityRequest(c, Id), cookie) + return GetPriorityCookie{cookie} +} + +// Request reply for GetPriority +// size: 12 +type GetPriorityReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Priority int32 +} + +// Waits and reads reply data from request GetPriority +func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPriorityReply(buf), nil +} + +// Read reply into structure from buffer for GetPriority +func getPriorityReply(buf []byte) *GetPriorityReply { + v := new(GetPriorityReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Priority = int32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetPriority +func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Id) + b += 4 + + return buf +} + +// Request CreateFence +// size: 16 +type CreateFenceCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateFence +func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) + return CreateFenceCookie{cookie} +} + +func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) + return CreateFenceCookie{cookie} +} + +func (cook CreateFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateFence +func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + if InitiallyTriggered { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request TriggerFence +// size: 8 +type TriggerFenceCookie struct { + *xgb.Cookie +} + +// Write request to wire for TriggerFence +func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(triggerFenceRequest(c, Fence), cookie) + return TriggerFenceCookie{cookie} +} + +func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(triggerFenceRequest(c, Fence), cookie) + return TriggerFenceCookie{cookie} +} + +func (cook TriggerFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TriggerFence +func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request ResetFence +// size: 8 +type ResetFenceCookie struct { + *xgb.Cookie +} + +// Write request to wire for ResetFence +func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(resetFenceRequest(c, Fence), cookie) + return ResetFenceCookie{cookie} +} + +func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(resetFenceRequest(c, Fence), cookie) + return ResetFenceCookie{cookie} +} + +func (cook ResetFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ResetFence +func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request DestroyFence +// size: 8 +type DestroyFenceCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyFence +func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyFenceRequest(c, Fence), cookie) + return DestroyFenceCookie{cookie} +} + +func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyFenceRequest(c, Fence), cookie) + return DestroyFenceCookie{cookie} +} + +func (cook DestroyFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyFence +func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request QueryFence +// size: 8 +type QueryFenceCookie struct { + *xgb.Cookie +} + +func QueryFence(c *xgb.Conn, Fence Fence) QueryFenceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryFenceRequest(c, Fence), cookie) + return QueryFenceCookie{cookie} +} + +func QueryFenceUnchecked(c *xgb.Conn, Fence Fence) QueryFenceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryFenceRequest(c, Fence), cookie) + return QueryFenceCookie{cookie} +} + +// Request reply for QueryFence +// size: 32 +type QueryFenceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Triggered bool + // padding: 23 bytes +} + +// Waits and reads reply data from request QueryFence +func (cook QueryFenceCookie) Reply() (*QueryFenceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryFenceReply(buf), nil +} + +// Read reply into structure from buffer for QueryFence +func queryFenceReply(buf []byte) *QueryFenceReply { + v := new(QueryFenceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Triggered = true + } else { + v.Triggered = false + } + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for QueryFence +func queryFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// Request AwaitFence +// size: xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) +type AwaitFenceCookie struct { + *xgb.Cookie +} + +// Write request to wire for AwaitFence +func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(awaitFenceRequest(c, FenceList), cookie) + return AwaitFenceCookie{cookie} +} + +func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(awaitFenceRequest(c, FenceList), cookie) + return AwaitFenceCookie{cookie} +} + +func (cook AwaitFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AwaitFence +func awaitFenceRequest(c *xgb.Conn, FenceList []Fence) []byte { + size := xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + for i := 0; i < int(len(FenceList)); i++ { + xgb.Put32(buf[b:], uint32(FenceList[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go new file mode 100644 index 0000000..324d455 --- /dev/null +++ b/nexgb/xcmisc/xcmisc.go @@ -0,0 +1,320 @@ +package xcmisc + +/* + This file was generated by xc_misc.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XC-MISC extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 7, "XC-MISC").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XC-MISC could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XC-MISC"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XC-MISC"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XC-MISC"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XC-MISC"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XC-MISC"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Request GetVersion +// size: 8 +type GetVersionCookie struct { + *xgb.Cookie +} + +func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} +} + +func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// Request reply for GetVersion +// size: 12 +type GetVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 +} + +// Waits and reads reply data from request GetVersion +func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVersionReply(buf), nil +} + +// Read reply into structure from buffer for GetVersion +func getVersionReply(buf []byte) *GetVersionReply { + v := new(GetVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for GetVersion +func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XC-MISC"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ClientMajorVersion) + b += 2 + + xgb.Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request GetXIDRange +// size: 4 +type GetXIDRangeCookie struct { + *xgb.Cookie +} + +func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getXIDRangeRequest(c), cookie) + return GetXIDRangeCookie{cookie} +} + +func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getXIDRangeRequest(c), cookie) + return GetXIDRangeCookie{cookie} +} + +// Request reply for GetXIDRange +// size: 16 +type GetXIDRangeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StartId uint32 + Count uint32 +} + +// Waits and reads reply data from request GetXIDRange +func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getXIDRangeReply(buf), nil +} + +// Read reply into structure from buffer for GetXIDRange +func getXIDRangeReply(buf []byte) *GetXIDRangeReply { + v := new(GetXIDRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StartId = xgb.Get32(buf[b:]) + b += 4 + + v.Count = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetXIDRange +func getXIDRangeRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XC-MISC"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetXIDList +// size: 8 +type GetXIDListCookie struct { + *xgb.Cookie +} + +func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getXIDListRequest(c, Count), cookie) + return GetXIDListCookie{cookie} +} + +func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getXIDListRequest(c, Count), cookie) + return GetXIDListCookie{cookie} +} + +// Request reply for GetXIDList +// size: (32 + xgb.Pad((int(IdsLen) * 4))) +type GetXIDListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IdsLen uint32 + // padding: 20 bytes + Ids []uint32 // size: xgb.Pad((int(IdsLen) * 4)) +} + +// Waits and reads reply data from request GetXIDList +func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getXIDListReply(buf), nil +} + +// Read reply into structure from buffer for GetXIDList +func getXIDListReply(buf []byte) *GetXIDListReply { + v := new(GetXIDListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.IdsLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Ids = make([]uint32, v.IdsLen) + for i := 0; i < int(v.IdsLen); i++ { + v.Ids[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetXIDList +func getXIDListRequest(c *xgb.Conn, Count uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XC-MISC"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Count) + b += 4 + + return buf +} diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go new file mode 100644 index 0000000..c3943f9 --- /dev/null +++ b/nexgb/xevie/xevie.go @@ -0,0 +1,525 @@ +package xevie + +/* + This file was generated by xevie.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XEVIE extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 5, "XEVIE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XEVIE could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XEVIE"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XEVIE"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XEVIE"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XEVIE"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +const ( + DatatypeUnmodified = 0 + DatatypeModified = 1 +) + +// 'Event' struct definition +// Size: 32 +type Event struct { + // padding: 32 bytes +} + +// Struct read Event +func EventRead(buf []byte, v *Event) int { + b := 0 + + b += 32 // padding + + return b +} + +// Struct list read Event +func EventReadList(buf []byte, dest []Event) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Event{} + b += EventRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Event +func (v Event) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + b += 32 // padding + + return buf +} + +// Write struct list Event +func EventListBytes(buf []byte, list []Event) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 + // padding: 20 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ClientMajorVersion) + b += 2 + + xgb.Put16(buf[b:], ClientMinorVersion) + b += 2 + + return buf +} + +// Request Start +// size: 8 +type StartCookie struct { + *xgb.Cookie +} + +func Start(c *xgb.Conn, Screen uint32) StartCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(startRequest(c, Screen), cookie) + return StartCookie{cookie} +} + +func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(startRequest(c, Screen), cookie) + return StartCookie{cookie} +} + +// Request reply for Start +// size: 32 +type StartReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request Start +func (cook StartCookie) Reply() (*StartReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return startReply(buf), nil +} + +// Read reply into structure from buffer for Start +func startReply(buf []byte) *StartReply { + v := new(StartReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for Start +func startRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request End +// size: 8 +type EndCookie struct { + *xgb.Cookie +} + +func End(c *xgb.Conn, Cmap uint32) EndCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(endRequest(c, Cmap), cookie) + return EndCookie{cookie} +} + +func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(endRequest(c, Cmap), cookie) + return EndCookie{cookie} +} + +// Request reply for End +// size: 32 +type EndReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request End +func (cook EndCookie) Reply() (*EndReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return endReply(buf), nil +} + +// Read reply into structure from buffer for End +func endReply(buf []byte) *EndReply { + v := new(EndReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for End +func endRequest(c *xgb.Conn, Cmap uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Cmap) + b += 4 + + return buf +} + +// Request Send +// size: 104 +type SendCookie struct { + *xgb.Cookie +} + +func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(sendRequest(c, Event, DataType), cookie) + return SendCookie{cookie} +} + +func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(sendRequest(c, Event, DataType), cookie) + return SendCookie{cookie} +} + +// Request reply for Send +// size: 32 +type SendReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request Send +func (cook SendCookie) Reply() (*SendReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return sendReply(buf), nil +} + +// Read reply into structure from buffer for Send +func sendReply(buf []byte) *SendReply { + v := new(SendReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for Send +func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { + size := 104 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + { + structBytes := Event.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], DataType) + b += 4 + + b += 64 // padding + + return buf +} + +// Request SelectInput +// size: 8 +type SelectInputCookie struct { + *xgb.Cookie +} + +func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(selectInputRequest(c, EventMask), cookie) + return SelectInputCookie{cookie} +} + +func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(selectInputRequest(c, EventMask), cookie) + return SelectInputCookie{cookie} +} + +// Request reply for SelectInput +// size: 32 +type SelectInputReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes +} + +// Waits and reads reply data from request SelectInput +func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return selectInputReply(buf), nil +} + +// Read reply into structure from buffer for SelectInput +func selectInputReply(buf []byte) *SelectInputReply { + v := new(SelectInputReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for SelectInput +func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go new file mode 100644 index 0000000..0259729 --- /dev/null +++ b/nexgb/xf86dri/xf86dri.go @@ -0,0 +1,1121 @@ +package xf86dri + +/* + This file was generated by xf86dri.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XFree86-DRI extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 11, "XFree86-DRI").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XFree86-DRI could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XFree86-DRI"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XFree86-DRI"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XFree86-DRI"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XFree86-DRI"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// 'DrmClipRect' struct definition +// Size: 8 +type DrmClipRect struct { + X1 int16 + Y1 int16 + X2 int16 + X3 int16 +} + +// Struct read DrmClipRect +func DrmClipRectRead(buf []byte, v *DrmClipRect) int { + b := 0 + + v.X1 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y1 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.X2 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.X3 = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read DrmClipRect +func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DrmClipRect{} + b += DrmClipRectRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DrmClipRect +func (v DrmClipRect) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], uint16(v.X1)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y1)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.X2)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.X3)) + b += 2 + + return buf +} + +// Write struct list DrmClipRect +func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Request QueryVersion +// size: 4 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 16 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DriMajorVersion uint16 + DriMinorVersion uint16 + DriMinorPatch uint32 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.DriMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.DriMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.DriMinorPatch = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request QueryDirectRenderingCapable +// size: 8 +type QueryDirectRenderingCapableCookie struct { + *xgb.Cookie +} + +func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) + return QueryDirectRenderingCapableCookie{cookie} +} + +func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) + return QueryDirectRenderingCapableCookie{cookie} +} + +// Request reply for QueryDirectRenderingCapable +// size: 9 +type QueryDirectRenderingCapableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + IsCapable bool +} + +// Waits and reads reply data from request QueryDirectRenderingCapable +func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryDirectRenderingCapableReply(buf), nil +} + +// Read reply into structure from buffer for QueryDirectRenderingCapable +func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply { + v := new(QueryDirectRenderingCapableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.IsCapable = true + } else { + v.IsCapable = false + } + b += 1 + + return v +} + +// Write request to wire for QueryDirectRenderingCapable +func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request OpenConnection +// size: 8 +type OpenConnectionCookie struct { + *xgb.Cookie +} + +func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(openConnectionRequest(c, Screen), cookie) + return OpenConnectionCookie{cookie} +} + +func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(openConnectionRequest(c, Screen), cookie) + return OpenConnectionCookie{cookie} +} + +// Request reply for OpenConnection +// size: (32 + xgb.Pad((int(BusIdLen) * 1))) +type OpenConnectionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SareaHandleLow uint32 + SareaHandleHigh uint32 + BusIdLen uint32 + // padding: 12 bytes + BusId string // size: xgb.Pad((int(BusIdLen) * 1)) +} + +// Waits and reads reply data from request OpenConnection +func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return openConnectionReply(buf), nil +} + +// Read reply into structure from buffer for OpenConnection +func openConnectionReply(buf []byte) *OpenConnectionReply { + v := new(OpenConnectionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.SareaHandleLow = xgb.Get32(buf[b:]) + b += 4 + + v.SareaHandleHigh = xgb.Get32(buf[b:]) + b += 4 + + v.BusIdLen = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + { + byteString := make([]byte, v.BusIdLen) + copy(byteString[:v.BusIdLen], buf[b:]) + v.BusId = string(byteString) + b += xgb.Pad(int(v.BusIdLen)) + } + + return v +} + +// Write request to wire for OpenConnection +func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request CloseConnection +// size: 8 +type CloseConnectionCookie struct { + *xgb.Cookie +} + +// Write request to wire for CloseConnection +func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(closeConnectionRequest(c, Screen), cookie) + return CloseConnectionCookie{cookie} +} + +func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(closeConnectionRequest(c, Screen), cookie) + return CloseConnectionCookie{cookie} +} + +func (cook CloseConnectionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CloseConnection +func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request GetClientDriverName +// size: 8 +type GetClientDriverNameCookie struct { + *xgb.Cookie +} + +func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) + return GetClientDriverNameCookie{cookie} +} + +func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) + return GetClientDriverNameCookie{cookie} +} + +// Request reply for GetClientDriverName +// size: (32 + xgb.Pad((int(ClientDriverNameLen) * 1))) +type GetClientDriverNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ClientDriverMajorVersion uint32 + ClientDriverMinorVersion uint32 + ClientDriverPatchVersion uint32 + ClientDriverNameLen uint32 + // padding: 8 bytes + ClientDriverName string // size: xgb.Pad((int(ClientDriverNameLen) * 1)) +} + +// Waits and reads reply data from request GetClientDriverName +func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getClientDriverNameReply(buf), nil +} + +// Read reply into structure from buffer for GetClientDriverName +func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply { + v := new(GetClientDriverNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ClientDriverMajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.ClientDriverMinorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.ClientDriverPatchVersion = xgb.Get32(buf[b:]) + b += 4 + + v.ClientDriverNameLen = xgb.Get32(buf[b:]) + b += 4 + + b += 8 // padding + + { + byteString := make([]byte, v.ClientDriverNameLen) + copy(byteString[:v.ClientDriverNameLen], buf[b:]) + v.ClientDriverName = string(byteString) + b += xgb.Pad(int(v.ClientDriverNameLen)) + } + + return v +} + +// Write request to wire for GetClientDriverName +func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request CreateContext +// size: 16 +type CreateContextCookie struct { + *xgb.Cookie +} + +func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) + return CreateContextCookie{cookie} +} + +func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) + return CreateContextCookie{cookie} +} + +// Request reply for CreateContext +// size: 12 +type CreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + HwContext uint32 +} + +// Waits and reads reply data from request CreateContext +func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createContextReply(buf), nil +} + +// Read reply into structure from buffer for CreateContext +func createContextReply(buf []byte) *CreateContextReply { + v := new(CreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwContext = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for CreateContext +func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Visual) + b += 4 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request DestroyContext +// size: 12 +type DestroyContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyContext +func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) + return DestroyContextCookie{cookie} +} + +func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) + return DestroyContextCookie{cookie} +} + +func (cook DestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyContext +func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request CreateDrawable +// size: 12 +type CreateDrawableCookie struct { + *xgb.Cookie +} + +func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +// Request reply for CreateDrawable +// size: 12 +type CreateDrawableReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + HwDrawableHandle uint32 +} + +// Waits and reads reply data from request CreateDrawable +func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createDrawableReply(buf), nil +} + +// Read reply into structure from buffer for CreateDrawable +func createDrawableReply(buf []byte) *CreateDrawableReply { + v := new(CreateDrawableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwDrawableHandle = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for CreateDrawable +func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request DestroyDrawable +// size: 12 +type DestroyDrawableCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyDrawable +func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +func (cook DestroyDrawableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyDrawable +func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request GetDrawableInfo +// size: 12 +type GetDrawableInfoCookie struct { + *xgb.Cookie +} + +func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) + return GetDrawableInfoCookie{cookie} +} + +func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) + return GetDrawableInfoCookie{cookie} +} + +// Request reply for GetDrawableInfo +// size: ((36 + xgb.Pad((int(NumClipRects) * 8))) + xgb.Pad((int(NumBackClipRects) * 8))) +type GetDrawableInfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DrawableTableIndex uint32 + DrawableTableStamp uint32 + DrawableOriginX int16 + DrawableOriginY int16 + DrawableSizeW int16 + DrawableSizeH int16 + NumClipRects uint32 + BackX int16 + BackY int16 + NumBackClipRects uint32 + ClipRects []DrmClipRect // size: xgb.Pad((int(NumClipRects) * 8)) + BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) +} + +// Waits and reads reply data from request GetDrawableInfo +func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDrawableInfoReply(buf), nil +} + +// Read reply into structure from buffer for GetDrawableInfo +func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply { + v := new(GetDrawableInfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.DrawableTableIndex = xgb.Get32(buf[b:]) + b += 4 + + v.DrawableTableStamp = xgb.Get32(buf[b:]) + b += 4 + + v.DrawableOriginX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.DrawableOriginY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.DrawableSizeW = int16(xgb.Get16(buf[b:])) + b += 2 + + v.DrawableSizeH = int16(xgb.Get16(buf[b:])) + b += 2 + + v.NumClipRects = xgb.Get32(buf[b:]) + b += 4 + + v.BackX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BackY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.NumBackClipRects = xgb.Get32(buf[b:]) + b += 4 + + v.ClipRects = make([]DrmClipRect, v.NumClipRects) + b += DrmClipRectReadList(buf[b:], v.ClipRects) + + v.BackClipRects = make([]DrmClipRect, v.NumBackClipRects) + b += DrmClipRectReadList(buf[b:], v.BackClipRects) + + return v +} + +// Write request to wire for GetDrawableInfo +func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// Request GetDeviceInfo +// size: 8 +type GetDeviceInfoCookie struct { + *xgb.Cookie +} + +func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) + return GetDeviceInfoCookie{cookie} +} + +func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) + return GetDeviceInfoCookie{cookie} +} + +// Request reply for GetDeviceInfo +// size: (32 + xgb.Pad((int(DevicePrivateSize) * 4))) +type GetDeviceInfoReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + FramebufferHandleLow uint32 + FramebufferHandleHigh uint32 + FramebufferOriginOffset uint32 + FramebufferSize uint32 + FramebufferStride uint32 + DevicePrivateSize uint32 + DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4)) +} + +// Waits and reads reply data from request GetDeviceInfo +func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceInfoReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceInfo +func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { + v := new(GetDeviceInfoReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.FramebufferHandleLow = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferHandleHigh = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferOriginOffset = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferSize = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferStride = xgb.Get32(buf[b:]) + b += 4 + + v.DevicePrivateSize = xgb.Get32(buf[b:]) + b += 4 + + v.DevicePrivate = make([]uint32, v.DevicePrivateSize) + for i := 0; i < int(v.DevicePrivateSize); i++ { + v.DevicePrivate[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDeviceInfo +func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request AuthConnection +// size: 12 +type AuthConnectionCookie struct { + *xgb.Cookie +} + +func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) + return AuthConnectionCookie{cookie} +} + +func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) + return AuthConnectionCookie{cookie} +} + +// Request reply for AuthConnection +// size: 12 +type AuthConnectionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Authenticated uint32 +} + +// Waits and reads reply data from request AuthConnection +func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return authConnectionReply(buf), nil +} + +// Read reply into structure from buffer for AuthConnection +func authConnectionReply(buf []byte) *AuthConnectionReply { + v := new(AuthConnectionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Authenticated = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for AuthConnection +func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Magic) + b += 4 + + return buf +} diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go new file mode 100644 index 0000000..4137df8 --- /dev/null +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -0,0 +1,2360 @@ +package xf86vidmode + +/* + This file was generated by xf86vidmode.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XFree86-VidModeExtension extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 24, "XFree86-VidModeExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XFree86-VidModeExtension could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XFree86-VidModeExtension"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XFree86-VidModeExtension"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + ModeFlagPositiveHsync = 1 + ModeFlagNegativeHsync = 2 + ModeFlagPositiveVsync = 4 + ModeFlagNegativeVsync = 8 + ModeFlagInterlace = 16 + ModeFlagCompositeSync = 32 + ModeFlagPositiveCsync = 64 + ModeFlagNegativeCsync = 128 + ModeFlagHSkew = 256 + ModeFlagBroadcast = 512 + ModeFlagPixmux = 1024 + ModeFlagDoubleClock = 2048 + ModeFlagHalfClock = 4096 +) + +const ( + ClockFlagProgramable = 1 +) + +const ( + PermissionRead = 1 + PermissionWrite = 2 +) + +type Syncrange uint32 + +type Dotclock uint32 + +// 'ModeInfo' struct definition +// Size: 48 +type ModeInfo struct { + Dotclock Dotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint32 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 4 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 +} + +// Struct read ModeInfo +func ModeInfoRead(buf []byte, v *ModeInfo) int { + b := 0 + + v.Dotclock = Dotclock(xgb.Get32(buf[b:])) + b += 4 + + v.Hdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Htotal = xgb.Get16(buf[b:]) + b += 2 + + v.Hskew = xgb.Get32(buf[b:]) + b += 4 + + v.Vdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Vtotal = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read ModeInfo +func ModeInfoReadList(buf []byte, dest []ModeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ModeInfo{} + b += ModeInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ModeInfo +func (v ModeInfo) Bytes() []byte { + buf := make([]byte, 48) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Dotclock)) + b += 4 + + xgb.Put16(buf[b:], v.Hdisplay) + b += 2 + + xgb.Put16(buf[b:], v.Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], v.Hsyncend) + b += 2 + + xgb.Put16(buf[b:], v.Htotal) + b += 2 + + xgb.Put32(buf[b:], v.Hskew) + b += 4 + + xgb.Put16(buf[b:], v.Vdisplay) + b += 2 + + xgb.Put16(buf[b:], v.Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], v.Vsyncend) + b += 2 + + xgb.Put16(buf[b:], v.Vtotal) + b += 2 + + b += 4 // padding + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], v.Privsize) + b += 4 + + return buf +} + +// Write struct list ModeInfo +func ModeInfoListBytes(buf []byte, list []ModeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Error definition BadClock (0) +// Size: 32 + +const BadBadClock = 0 + +type BadClockError struct { + Sequence uint16 + NiceName string +} + +// Error read BadClock +func BadClockErrorNew(buf []byte) xgb.Error { + v := BadClockError{} + v.NiceName = "BadClock" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadClockError) ImplementsError() {} + +func (err BadClockError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadClockError) BadId() uint32 { + return 0 +} + +func (err BadClockError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadClock {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][0] = BadClockErrorNew +} + +// Error definition BadHTimings (1) +// Size: 32 + +const BadBadHTimings = 1 + +type BadHTimingsError struct { + Sequence uint16 + NiceName string +} + +// Error read BadHTimings +func BadHTimingsErrorNew(buf []byte) xgb.Error { + v := BadHTimingsError{} + v.NiceName = "BadHTimings" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadHTimingsError) ImplementsError() {} + +func (err BadHTimingsError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadHTimingsError) BadId() uint32 { + return 0 +} + +func (err BadHTimingsError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadHTimings {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][1] = BadHTimingsErrorNew +} + +// Error definition BadVTimings (2) +// Size: 32 + +const BadBadVTimings = 2 + +type BadVTimingsError struct { + Sequence uint16 + NiceName string +} + +// Error read BadVTimings +func BadVTimingsErrorNew(buf []byte) xgb.Error { + v := BadVTimingsError{} + v.NiceName = "BadVTimings" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadVTimingsError) ImplementsError() {} + +func (err BadVTimingsError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadVTimingsError) BadId() uint32 { + return 0 +} + +func (err BadVTimingsError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadVTimings {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][2] = BadVTimingsErrorNew +} + +// Error definition ModeUnsuitable (3) +// Size: 32 + +const BadModeUnsuitable = 3 + +type ModeUnsuitableError struct { + Sequence uint16 + NiceName string +} + +// Error read ModeUnsuitable +func ModeUnsuitableErrorNew(buf []byte) xgb.Error { + v := ModeUnsuitableError{} + v.NiceName = "ModeUnsuitable" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ModeUnsuitableError) ImplementsError() {} + +func (err ModeUnsuitableError) SequenceId() uint16 { + return err.Sequence +} + +func (err ModeUnsuitableError) BadId() uint32 { + return 0 +} + +func (err ModeUnsuitableError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadModeUnsuitable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][3] = ModeUnsuitableErrorNew +} + +// Error definition ExtensionDisabled (4) +// Size: 32 + +const BadExtensionDisabled = 4 + +type ExtensionDisabledError struct { + Sequence uint16 + NiceName string +} + +// Error read ExtensionDisabled +func ExtensionDisabledErrorNew(buf []byte) xgb.Error { + v := ExtensionDisabledError{} + v.NiceName = "ExtensionDisabled" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ExtensionDisabledError) ImplementsError() {} + +func (err ExtensionDisabledError) SequenceId() uint16 { + return err.Sequence +} + +func (err ExtensionDisabledError) BadId() uint32 { + return 0 +} + +func (err ExtensionDisabledError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadExtensionDisabled {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][4] = ExtensionDisabledErrorNew +} + +// Error definition ClientNotLocal (5) +// Size: 32 + +const BadClientNotLocal = 5 + +type ClientNotLocalError struct { + Sequence uint16 + NiceName string +} + +// Error read ClientNotLocal +func ClientNotLocalErrorNew(buf []byte) xgb.Error { + v := ClientNotLocalError{} + v.NiceName = "ClientNotLocal" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ClientNotLocalError) ImplementsError() {} + +func (err ClientNotLocalError) SequenceId() uint16 { + return err.Sequence +} + +func (err ClientNotLocalError) BadId() uint32 { + return 0 +} + +func (err ClientNotLocalError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadClientNotLocal {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][5] = ClientNotLocalErrorNew +} + +// Error definition ZoomLocked (6) +// Size: 32 + +const BadZoomLocked = 6 + +type ZoomLockedError struct { + Sequence uint16 + NiceName string +} + +// Error read ZoomLocked +func ZoomLockedErrorNew(buf []byte) xgb.Error { + v := ZoomLockedError{} + v.NiceName = "ZoomLocked" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ZoomLockedError) ImplementsError() {} + +func (err ZoomLockedError) SequenceId() uint16 { + return err.Sequence +} + +func (err ZoomLockedError) BadId() uint32 { + return 0 +} + +func (err ZoomLockedError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadZoomLocked {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][6] = ZoomLockedErrorNew +} + +// Request QueryVersion +// size: 4 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetModeLine +// size: 8 +type GetModeLineCookie struct { + *xgb.Cookie +} + +func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getModeLineRequest(c, Screen), cookie) + return GetModeLineCookie{cookie} +} + +func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getModeLineRequest(c, Screen), cookie) + return GetModeLineCookie{cookie} +} + +// Request reply for GetModeLine +// size: (52 + xgb.Pad((int(Privsize) * 1))) +type GetModeLineReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Dotclock Dotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint16 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 2 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 + Private []byte // size: xgb.Pad((int(Privsize) * 1)) +} + +// Waits and reads reply data from request GetModeLine +func (cook GetModeLineCookie) Reply() (*GetModeLineReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getModeLineReply(buf), nil +} + +// Read reply into structure from buffer for GetModeLine +func getModeLineReply(buf []byte) *GetModeLineReply { + v := new(GetModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Dotclock = Dotclock(xgb.Get32(buf[b:])) + b += 4 + + v.Hdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Htotal = xgb.Get16(buf[b:]) + b += 2 + + v.Hskew = xgb.Get16(buf[b:]) + b += 2 + + v.Vdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Vtotal = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = xgb.Get32(buf[b:]) + b += 4 + + v.Private = make([]byte, v.Privsize) + copy(v.Private[:v.Privsize], buf[b:]) + b += xgb.Pad(int(v.Privsize)) + + return v +} + +// Write request to wire for GetModeLine +func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request ModModeLine +// size: xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) +type ModModeLineCookie struct { + *xgb.Cookie +} + +// Write request to wire for ModModeLine +func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ModModeLineCookie{cookie} +} + +func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ModModeLineCookie{cookie} +} + +func (cook ModModeLineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ModModeLine +func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// Request SwitchMode +// size: 8 +type SwitchModeCookie struct { + *xgb.Cookie +} + +// Write request to wire for SwitchMode +func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) + return SwitchModeCookie{cookie} +} + +func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) + return SwitchModeCookie{cookie} +} + +func (cook SwitchModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwitchMode +func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Zoom) + b += 2 + + return buf +} + +// Request GetMonitor +// size: 8 +type GetMonitorCookie struct { + *xgb.Cookie +} + +func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMonitorRequest(c, Screen), cookie) + return GetMonitorCookie{cookie} +} + +func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMonitorRequest(c, Screen), cookie) + return GetMonitorCookie{cookie} +} + +// Request reply for GetMonitor +// size: (((((32 + xgb.Pad((int(NumHsync) * 4))) + xgb.Pad((int(NumVsync) * 4))) + xgb.Pad((int(VendorLength) * 1))) + xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1))) + xgb.Pad((int(ModelLength) * 1))) +type GetMonitorReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + VendorLength byte + ModelLength byte + NumHsync byte + NumVsync byte + // padding: 20 bytes + Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) + Vsync []Syncrange // size: xgb.Pad((int(NumVsync) * 4)) + Vendor string // size: xgb.Pad((int(VendorLength) * 1)) + AlignmentPad []byte // size: xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) + Model string // size: xgb.Pad((int(ModelLength) * 1)) +} + +// Waits and reads reply data from request GetMonitor +func (cook GetMonitorCookie) Reply() (*GetMonitorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMonitorReply(buf), nil +} + +// Read reply into structure from buffer for GetMonitor +func getMonitorReply(buf []byte) *GetMonitorReply { + v := new(GetMonitorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.VendorLength = buf[b] + b += 1 + + v.ModelLength = buf[b] + b += 1 + + v.NumHsync = buf[b] + b += 1 + + v.NumVsync = buf[b] + b += 1 + + b += 20 // padding + + v.Hsync = make([]Syncrange, v.NumHsync) + for i := 0; i < int(v.NumHsync); i++ { + v.Hsync[i] = Syncrange(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Vsync = make([]Syncrange, v.NumVsync) + for i := 0; i < int(v.NumVsync); i++ { + v.Vsync[i] = Syncrange(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + { + byteString := make([]byte, v.VendorLength) + copy(byteString[:v.VendorLength], buf[b:]) + v.Vendor = string(byteString) + b += xgb.Pad(int(v.VendorLength)) + } + + v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) + copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) + b += xgb.Pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) + + { + byteString := make([]byte, v.ModelLength) + copy(byteString[:v.ModelLength], buf[b:]) + v.Model = string(byteString) + b += xgb.Pad(int(v.ModelLength)) + } + + return v +} + +// Write request to wire for GetMonitor +func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request LockModeSwitch +// size: 8 +type LockModeSwitchCookie struct { + *xgb.Cookie +} + +// Write request to wire for LockModeSwitch +func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) + return LockModeSwitchCookie{cookie} +} + +func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) + return LockModeSwitchCookie{cookie} +} + +func (cook LockModeSwitchCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for LockModeSwitch +func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Lock) + b += 2 + + return buf +} + +// Request GetAllModeLines +// size: 8 +type GetAllModeLinesCookie struct { + *xgb.Cookie +} + +func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) + return GetAllModeLinesCookie{cookie} +} + +func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) + return GetAllModeLinesCookie{cookie} +} + +// Request reply for GetAllModeLines +// size: (32 + xgb.Pad((int(Modecount) * 48))) +type GetAllModeLinesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Modecount uint32 + // padding: 20 bytes + Modeinfo []ModeInfo // size: xgb.Pad((int(Modecount) * 48)) +} + +// Waits and reads reply data from request GetAllModeLines +func (cook GetAllModeLinesCookie) Reply() (*GetAllModeLinesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getAllModeLinesReply(buf), nil +} + +// Read reply into structure from buffer for GetAllModeLines +func getAllModeLinesReply(buf []byte) *GetAllModeLinesReply { + v := new(GetAllModeLinesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Modecount = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Modeinfo = make([]ModeInfo, v.Modecount) + b += ModeInfoReadList(buf[b:], v.Modeinfo) + + return v +} + +// Write request to wire for GetAllModeLines +func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request AddModeLine +// size: xgb.Pad((92 + xgb.Pad((int(Privsize) * 1)))) +type AddModeLineCookie struct { + *xgb.Cookie +} + +// Write request to wire for AddModeLine +func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) + return AddModeLineCookie{cookie} +} + +func AddModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) + return AddModeLineCookie{cookie} +} + +func (cook AddModeLineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddModeLine +func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) []byte { + size := xgb.Pad((92 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + xgb.Put32(buf[b:], uint32(AfterDotclock)) + b += 4 + + xgb.Put16(buf[b:], AfterHdisplay) + b += 2 + + xgb.Put16(buf[b:], AfterHsyncstart) + b += 2 + + xgb.Put16(buf[b:], AfterHsyncend) + b += 2 + + xgb.Put16(buf[b:], AfterHtotal) + b += 2 + + xgb.Put16(buf[b:], AfterHskew) + b += 2 + + xgb.Put16(buf[b:], AfterVdisplay) + b += 2 + + xgb.Put16(buf[b:], AfterVsyncstart) + b += 2 + + xgb.Put16(buf[b:], AfterVsyncend) + b += 2 + + xgb.Put16(buf[b:], AfterVtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], AfterFlags) + b += 4 + + b += 12 // padding + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// Request DeleteModeLine +// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +type DeleteModeLineCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeleteModeLine +func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return DeleteModeLineCookie{cookie} +} + +func DeleteModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return DeleteModeLineCookie{cookie} +} + +func (cook DeleteModeLineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteModeLine +func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// Request ValidateModeLine +// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +type ValidateModeLineCookie struct { + *xgb.Cookie +} + +func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ValidateModeLineCookie{cookie} +} + +func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ValidateModeLineCookie{cookie} +} + +// Request reply for ValidateModeLine +// size: 32 +type ValidateModeLineReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status uint32 + // padding: 20 bytes +} + +// Waits and reads reply data from request ValidateModeLine +func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return validateModeLineReply(buf), nil +} + +// Read reply into structure from buffer for ValidateModeLine +func validateModeLineReply(buf []byte) *ValidateModeLineReply { + v := new(ValidateModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for ValidateModeLine +func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// Request SwitchToMode +// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +type SwitchToModeCookie struct { + *xgb.Cookie +} + +// Write request to wire for SwitchToMode +func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return SwitchToModeCookie{cookie} +} + +func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return SwitchToModeCookie{cookie} +} + +func (cook SwitchToModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwitchToMode +func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// Request GetViewPort +// size: 8 +type GetViewPortCookie struct { + *xgb.Cookie +} + +func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getViewPortRequest(c, Screen), cookie) + return GetViewPortCookie{cookie} +} + +func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getViewPortRequest(c, Screen), cookie) + return GetViewPortCookie{cookie} +} + +// Request reply for GetViewPort +// size: 32 +type GetViewPortReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X uint32 + Y uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request GetViewPort +func (cook GetViewPortCookie) Reply() (*GetViewPortReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getViewPortReply(buf), nil +} + +// Read reply into structure from buffer for GetViewPort +func getViewPortReply(buf []byte) *GetViewPortReply { + v := new(GetViewPortReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = xgb.Get32(buf[b:]) + b += 4 + + v.Y = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for GetViewPort +func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request SetViewPort +// size: 16 +type SetViewPortCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetViewPort +func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) + return SetViewPortCookie{cookie} +} + +func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) + return SetViewPortCookie{cookie} +} + +func (cook SetViewPortCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetViewPort +func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], X) + b += 4 + + xgb.Put32(buf[b:], Y) + b += 4 + + return buf +} + +// Request GetDotClocks +// size: 8 +type GetDotClocksCookie struct { + *xgb.Cookie +} + +func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDotClocksRequest(c, Screen), cookie) + return GetDotClocksCookie{cookie} +} + +func GetDotClocksUnchecked(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDotClocksRequest(c, Screen), cookie) + return GetDotClocksCookie{cookie} +} + +// Request reply for GetDotClocks +// size: (32 + xgb.Pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4))) +type GetDotClocksReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Flags uint32 + Clocks uint32 + Maxclocks uint32 + // padding: 12 bytes + Clock []uint32 // size: xgb.Pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4)) +} + +// Waits and reads reply data from request GetDotClocks +func (cook GetDotClocksCookie) Reply() (*GetDotClocksReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDotClocksReply(buf), nil +} + +// Read reply into structure from buffer for GetDotClocks +func getDotClocksReply(buf []byte) *GetDotClocksReply { + v := new(GetDotClocksReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + v.Clocks = xgb.Get32(buf[b:]) + b += 4 + + v.Maxclocks = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Clock = make([]uint32, ((1 - (int(v.Flags) & 1)) * int(v.Clocks))) + for i := 0; i < int(((1 - (int(v.Flags) & 1)) * int(v.Clocks))); i++ { + v.Clock[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDotClocks +func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request SetClientVersion +// size: 8 +type SetClientVersionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetClientVersion +func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) + return SetClientVersionCookie{cookie} +} + +func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) + return SetClientVersionCookie{cookie} +} + +func (cook SetClientVersionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientVersion +func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Major) + b += 2 + + xgb.Put16(buf[b:], Minor) + b += 2 + + return buf +} + +// Request SetGamma +// size: 32 +type SetGammaCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetGamma +func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) + return SetGammaCookie{cookie} +} + +func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) + return SetGammaCookie{cookie} +} + +func (cook SetGammaCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGamma +func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Red) + b += 4 + + xgb.Put32(buf[b:], Green) + b += 4 + + xgb.Put32(buf[b:], Blue) + b += 4 + + b += 12 // padding + + return buf +} + +// Request GetGamma +// size: 32 +type GetGammaCookie struct { + *xgb.Cookie +} + +func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getGammaRequest(c, Screen), cookie) + return GetGammaCookie{cookie} +} + +func GetGammaUnchecked(c *xgb.Conn, Screen uint16) GetGammaCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getGammaRequest(c, Screen), cookie) + return GetGammaCookie{cookie} +} + +// Request reply for GetGamma +// size: 32 +type GetGammaReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Red uint32 + Green uint32 + Blue uint32 + // padding: 12 bytes +} + +// Waits and reads reply data from request GetGamma +func (cook GetGammaCookie) Reply() (*GetGammaReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getGammaReply(buf), nil +} + +// Read reply into structure from buffer for GetGamma +func getGammaReply(buf []byte) *GetGammaReply { + v := new(GetGammaReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Red = xgb.Get32(buf[b:]) + b += 4 + + v.Green = xgb.Get32(buf[b:]) + b += 4 + + v.Blue = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + return v +} + +// Write request to wire for GetGamma +func getGammaRequest(c *xgb.Conn, Screen uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 26 // padding + + return buf +} + +// Request GetGammaRamp +// size: 8 +type GetGammaRampCookie struct { + *xgb.Cookie +} + +func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) + return GetGammaRampCookie{cookie} +} + +func GetGammaRampUnchecked(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) + return GetGammaRampCookie{cookie} +} + +// Request reply for GetGammaRamp +// size: (((32 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) +type GetGammaRampReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes + Red []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + Green []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) +} + +// Waits and reads reply data from request GetGammaRamp +func (cook GetGammaRampCookie) Reply() (*GetGammaRampReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getGammaRampReply(buf), nil +} + +// Read reply into structure from buffer for GetGammaRamp +func getGammaRampReply(buf []byte) *GetGammaRampReply { + v := new(GetGammaRampReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Red = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Red[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Green = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Green[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Blue = make([]uint16, ((int(v.Size) + 1) & -2)) + for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { + v.Blue[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetGammaRamp +func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Size) + b += 2 + + return buf +} + +// Request SetGammaRamp +// size: xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) +type SetGammaRampCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetGammaRamp +func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) + return SetGammaRampCookie{cookie} +} + +func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) + return SetGammaRampCookie{cookie} +} + +func (cook SetGammaRampCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGammaRamp +func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { + size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Size) + b += 2 + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Red[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Green[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Blue[i]) + b += 2 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetGammaRampSize +// size: 8 +type GetGammaRampSizeCookie struct { + *xgb.Cookie +} + +func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) + return GetGammaRampSizeCookie{cookie} +} + +func GetGammaRampSizeUnchecked(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) + return GetGammaRampSizeCookie{cookie} +} + +// Request reply for GetGammaRampSize +// size: 32 +type GetGammaRampSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Size uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request GetGammaRampSize +func (cook GetGammaRampSizeCookie) Reply() (*GetGammaRampSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getGammaRampSizeReply(buf), nil +} + +// Read reply into structure from buffer for GetGammaRampSize +func getGammaRampSizeReply(buf []byte) *GetGammaRampSizeReply { + v := new(GetGammaRampSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +// Write request to wire for GetGammaRampSize +func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// Request GetPermissions +// size: 8 +type GetPermissionsCookie struct { + *xgb.Cookie +} + +func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPermissionsRequest(c, Screen), cookie) + return GetPermissionsCookie{cookie} +} + +func GetPermissionsUnchecked(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPermissionsRequest(c, Screen), cookie) + return GetPermissionsCookie{cookie} +} + +// Request reply for GetPermissions +// size: 32 +type GetPermissionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Permissions uint32 + // padding: 20 bytes +} + +// Waits and reads reply data from request GetPermissions +func (cook GetPermissionsCookie) Reply() (*GetPermissionsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPermissionsReply(buf), nil +} + +// Read reply into structure from buffer for GetPermissions +func getPermissionsReply(buf []byte) *GetPermissionsReply { + v := new(GetPermissionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Permissions = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for GetPermissions +func getPermissionsRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go new file mode 100644 index 0000000..7115e02 --- /dev/null +++ b/nexgb/xfixes/xfixes.go @@ -0,0 +1,2155 @@ +package xfixes + +/* + This file was generated by xfixes.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/render" + "github.com/BurntSushi/xgb/shape" + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XFIXES extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 6, "XFIXES").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XFIXES could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XFIXES"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XFIXES"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XFIXES"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XFIXES"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +const ( + SaveSetModeInsert = 0 + SaveSetModeDelete = 1 +) + +const ( + SaveSetTargetNearest = 0 + SaveSetTargetRoot = 1 +) + +const ( + SaveSetMappingMap = 0 + SaveSetMappingUnmap = 1 +) + +const ( + SelectionEventSetSelectionOwner = 0 + SelectionEventSelectionWindowDestroy = 1 + SelectionEventSelectionClientClose = 2 +) + +const ( + SelectionEventMaskSetSelectionOwner = 1 + SelectionEventMaskSelectionWindowDestroy = 2 + SelectionEventMaskSelectionClientClose = 4 +) + +const ( + CursorNotifyDisplayCursor = 0 +) + +const ( + CursorNotifyMaskDisplayCursor = 1 +) + +const ( + RegionNone = 0 +) + +type Region uint32 + +func NewRegionId(c *xgb.Conn) (Region, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Region(id), nil +} + +// Event definition SelectionNotify (0) +// Size: 32 + +const SelectionNotify = 0 + +type SelectionNotifyEvent struct { + Sequence uint16 + Subtype byte + Window xproto.Window + Owner xproto.Window + Selection xproto.Atom + Timestamp xproto.Timestamp + SelectionTimestamp xproto.Timestamp + // padding: 8 bytes +} + +// Event read SelectionNotify +func SelectionNotifyEventNew(buf []byte) xgb.Event { + v := SelectionNotifyEvent{} + b := 1 // don't read event number + + v.Subtype = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Owner = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Selection = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.SelectionTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + b += 8 // padding + + return v +} + +// Event write SelectionNotify +func (v SelectionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Subtype + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Owner)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Selection)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.SelectionTimestamp)) + b += 4 + + b += 8 // padding + + return buf +} + +func (v SelectionNotifyEvent) ImplementsEvent() {} + +func (v SelectionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v SelectionNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Subtype: %d", v.Subtype)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("SelectionTimestamp: %d", v.SelectionTimestamp)) + return "SelectionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XFIXES"][0] = SelectionNotifyEventNew +} + +// Event definition CursorNotify (1) +// Size: 32 + +const CursorNotify = 1 + +type CursorNotifyEvent struct { + Sequence uint16 + Subtype byte + Window xproto.Window + CursorSerial uint32 + Timestamp xproto.Timestamp + Name xproto.Atom + // padding: 12 bytes +} + +// Event read CursorNotify +func CursorNotifyEventNew(buf []byte) xgb.Event { + v := CursorNotifyEvent{} + b := 1 // don't read event number + + v.Subtype = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.CursorSerial = xgb.Get32(buf[b:]) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Name = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + return v +} + +// Event write CursorNotify +func (v CursorNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Subtype + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], v.CursorSerial) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Name)) + b += 4 + + b += 12 // padding + + return buf +} + +func (v CursorNotifyEvent) ImplementsEvent() {} + +func (v CursorNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v CursorNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Subtype: %d", v.Subtype)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("CursorSerial: %d", v.CursorSerial)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("Name: %d", v.Name)) + return "CursorNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew +} + +// Error definition BadRegion (0) +// Size: 32 + +const BadBadRegion = 0 + +type BadRegionError struct { + Sequence uint16 + NiceName string +} + +// Error read BadRegion +func BadRegionErrorNew(buf []byte) xgb.Error { + v := BadRegionError{} + v.NiceName = "BadRegion" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadRegionError) ImplementsError() {} + +func (err BadRegionError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadRegionError) BadId() uint32 { + return 0 +} + +func (err BadRegionError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadRegion {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XFIXES"][0] = BadRegionErrorNew +} + +// Request QueryVersion +// size: 12 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 32 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// Request ChangeSaveSet +// size: 12 +type ChangeSaveSetCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeSaveSet +func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) + return ChangeSaveSetCookie{cookie} +} + +func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) + return ChangeSaveSetCookie{cookie} +} + +func (cook ChangeSaveSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeSaveSet +func changeSaveSetRequest(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Mode + b += 1 + + buf[b] = Target + b += 1 + + buf[b] = Map + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request SelectSelectionInput +// size: 16 +type SelectSelectionInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectSelectionInput +func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) + return SelectSelectionInputCookie{cookie} +} + +func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) + return SelectSelectionInputCookie{cookie} +} + +func (cook SelectSelectionInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectSelectionInput +func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request SelectCursorInput +// size: 12 +type SelectCursorInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectCursorInput +func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) + return SelectCursorInputCookie{cookie} +} + +func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) + return SelectCursorInputCookie{cookie} +} + +func (cook SelectCursorInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectCursorInput +func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// Request GetCursorImage +// size: 4 +type GetCursorImageCookie struct { + *xgb.Cookie +} + +func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCursorImageRequest(c), cookie) + return GetCursorImageCookie{cookie} +} + +func GetCursorImageUnchecked(c *xgb.Conn) GetCursorImageCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCursorImageRequest(c), cookie) + return GetCursorImageCookie{cookie} +} + +// Request reply for GetCursorImage +// size: (32 + xgb.Pad(((int(Width) * int(Height)) * 4))) +type GetCursorImageReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X int16 + Y int16 + Width uint16 + Height uint16 + Xhot uint16 + Yhot uint16 + CursorSerial uint32 + // padding: 8 bytes + CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) +} + +// Waits and reads reply data from request GetCursorImage +func (cook GetCursorImageCookie) Reply() (*GetCursorImageReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCursorImageReply(buf), nil +} + +// Read reply into structure from buffer for GetCursorImage +func getCursorImageReply(buf []byte) *GetCursorImageReply { + v := new(GetCursorImageReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Xhot = xgb.Get16(buf[b:]) + b += 2 + + v.Yhot = xgb.Get16(buf[b:]) + b += 2 + + v.CursorSerial = xgb.Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) + for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { + v.CursorImage[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCursorImage +func getCursorImageRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request CreateRegion +// size: xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) +type CreateRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegion +func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) + return CreateRegionCookie{cookie} +} + +func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) + return CreateRegionCookie{cookie} +} + +func (cook CreateRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegion +func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request CreateRegionFromBitmap +// size: 12 +type CreateRegionFromBitmapCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegionFromBitmap +func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) + return CreateRegionFromBitmapCookie{cookie} +} + +func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) + return CreateRegionFromBitmapCookie{cookie} +} + +func (cook CreateRegionFromBitmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromBitmap +func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Bitmap)) + b += 4 + + return buf +} + +// Request CreateRegionFromWindow +// size: 16 +type CreateRegionFromWindowCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegionFromWindow +func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) + return CreateRegionFromWindowCookie{cookie} +} + +func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) + return CreateRegionFromWindowCookie{cookie} +} + +func (cook CreateRegionFromWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromWindow +func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = byte(Kind) + b += 1 + + b += 3 // padding + + return buf +} + +// Request CreateRegionFromGC +// size: 12 +type CreateRegionFromGCCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegionFromGC +func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) + return CreateRegionFromGCCookie{cookie} +} + +func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) + return CreateRegionFromGCCookie{cookie} +} + +func (cook CreateRegionFromGCCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromGC +func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + return buf +} + +// Request CreateRegionFromPicture +// size: 12 +type CreateRegionFromPictureCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateRegionFromPicture +func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) + return CreateRegionFromPictureCookie{cookie} +} + +func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) + return CreateRegionFromPictureCookie{cookie} +} + +func (cook CreateRegionFromPictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromPicture +func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.Picture) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// Request DestroyRegion +// size: 8 +type DestroyRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyRegion +func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyRegionRequest(c, Region), cookie) + return DestroyRegionCookie{cookie} +} + +func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyRegionRequest(c, Region), cookie) + return DestroyRegionCookie{cookie} +} + +func (cook DestroyRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyRegion +func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request SetRegion +// size: xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) +type SetRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetRegion +func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) + return SetRegionCookie{cookie} +} + +func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) + return SetRegionCookie{cookie} +} + +func (cook SetRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetRegion +func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// Request CopyRegion +// size: 12 +type CopyRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for CopyRegion +func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) + return CopyRegionCookie{cookie} +} + +func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) + return CopyRegionCookie{cookie} +} + +func (cook CopyRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyRegion +func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request UnionRegion +// size: 16 +type UnionRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for UnionRegion +func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) + return UnionRegionCookie{cookie} +} + +func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) + return UnionRegionCookie{cookie} +} + +func (cook UnionRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnionRegion +func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request IntersectRegion +// size: 16 +type IntersectRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for IntersectRegion +func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) + return IntersectRegionCookie{cookie} +} + +func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) + return IntersectRegionCookie{cookie} +} + +func (cook IntersectRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for IntersectRegion +func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request SubtractRegion +// size: 16 +type SubtractRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SubtractRegion +func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) + return SubtractRegionCookie{cookie} +} + +func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) + return SubtractRegionCookie{cookie} +} + +func (cook SubtractRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SubtractRegion +func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request InvertRegion +// size: 20 +type InvertRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for InvertRegion +func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) + return InvertRegionCookie{cookie} +} + +func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) + return InvertRegionCookie{cookie} +} + +func (cook InvertRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for InvertRegion +func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + { + structBytes := Bounds.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request TranslateRegion +// size: 12 +type TranslateRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for TranslateRegion +func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) + return TranslateRegionCookie{cookie} +} + +func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) + return TranslateRegionCookie{cookie} +} + +func (cook TranslateRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TranslateRegion +func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(Dx)) + b += 2 + + xgb.Put16(buf[b:], uint16(Dy)) + b += 2 + + return buf +} + +// Request RegionExtents +// size: 12 +type RegionExtentsCookie struct { + *xgb.Cookie +} + +// Write request to wire for RegionExtents +func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) + return RegionExtentsCookie{cookie} +} + +func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) + return RegionExtentsCookie{cookie} +} + +func (cook RegionExtentsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RegionExtents +func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request FetchRegion +// size: 8 +type FetchRegionCookie struct { + *xgb.Cookie +} + +func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(fetchRegionRequest(c, Region), cookie) + return FetchRegionCookie{cookie} +} + +func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(fetchRegionRequest(c, Region), cookie) + return FetchRegionCookie{cookie} +} + +// Request reply for FetchRegion +// size: (32 + xgb.Pad(((int(Length) / 2) * 8))) +type FetchRegionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Extents xproto.Rectangle + // padding: 16 bytes + Rectangles []xproto.Rectangle // size: xgb.Pad(((int(Length) / 2) * 8)) +} + +// Waits and reads reply data from request FetchRegion +func (cook FetchRegionCookie) Reply() (*FetchRegionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return fetchRegionReply(buf), nil +} + +// Read reply into structure from buffer for FetchRegion +func fetchRegionReply(buf []byte) *FetchRegionReply { + v := new(FetchRegionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Extents = xproto.Rectangle{} + b += xproto.RectangleRead(buf[b:], &v.Extents) + + b += 16 // padding + + v.Rectangles = make([]xproto.Rectangle, (int(v.Length) / 2)) + b += xproto.RectangleReadList(buf[b:], v.Rectangles) + + return v +} + +// Write request to wire for FetchRegion +func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request SetGCClipRegion +// size: 16 +type SetGCClipRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetGCClipRegion +func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) + return SetGCClipRegionCookie{cookie} +} + +func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) + return SetGCClipRegionCookie{cookie} +} + +func (cook SetGCClipRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGCClipRegion +func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// Request SetWindowShapeRegion +// size: 20 +type SetWindowShapeRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetWindowShapeRegion +func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) + return SetWindowShapeRegionCookie{cookie} +} + +func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) + return SetWindowShapeRegionCookie{cookie} +} + +func (cook SetWindowShapeRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetWindowShapeRegion +func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Dest)) + b += 4 + + buf[b] = byte(DestKind) + b += 1 + + b += 3 // padding + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// Request SetPictureClipRegion +// size: 16 +type SetPictureClipRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPictureClipRegion +func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) + return SetPictureClipRegionCookie{cookie} +} + +func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) + return SetPictureClipRegionCookie{cookie} +} + +func (cook SetPictureClipRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPictureClipRegion +func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// Request SetCursorName +// size: xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) +type SetCursorNameCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetCursorName +func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) + return SetCursorNameCookie{cookie} +} + +func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) + return SetCursorNameCookie{cookie} +} + +func (cook SetCursorNameCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCursorName +func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + xgb.Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += xgb.Pad(int(Nbytes)) + + return buf +} + +// Request GetCursorName +// size: 8 +type GetCursorNameCookie struct { + *xgb.Cookie +} + +func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCursorNameRequest(c, Cursor), cookie) + return GetCursorNameCookie{cookie} +} + +func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCursorNameRequest(c, Cursor), cookie) + return GetCursorNameCookie{cookie} +} + +// Request reply for GetCursorName +// size: (32 + xgb.Pad((int(Nbytes) * 1))) +type GetCursorNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Atom xproto.Atom + Nbytes uint16 + // padding: 18 bytes + Name string // size: xgb.Pad((int(Nbytes) * 1)) +} + +// Waits and reads reply data from request GetCursorName +func (cook GetCursorNameCookie) Reply() (*GetCursorNameReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCursorNameReply(buf), nil +} + +// Read reply into structure from buffer for GetCursorName +func getCursorNameReply(buf []byte) *GetCursorNameReply { + v := new(GetCursorNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Atom = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Nbytes = xgb.Get16(buf[b:]) + b += 2 + + b += 18 // padding + + { + byteString := make([]byte, v.Nbytes) + copy(byteString[:v.Nbytes], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.Nbytes)) + } + + return v +} + +// Write request to wire for GetCursorName +func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + return buf +} + +// Request GetCursorImageAndName +// size: 4 +type GetCursorImageAndNameCookie struct { + *xgb.Cookie +} + +func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getCursorImageAndNameRequest(c), cookie) + return GetCursorImageAndNameCookie{cookie} +} + +func GetCursorImageAndNameUnchecked(c *xgb.Conn) GetCursorImageAndNameCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getCursorImageAndNameRequest(c), cookie) + return GetCursorImageAndNameCookie{cookie} +} + +// Request reply for GetCursorImageAndName +// size: ((32 + xgb.Pad((int(Nbytes) * 1))) + xgb.Pad(((int(Width) * int(Height)) * 4))) +type GetCursorImageAndNameReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + X int16 + Y int16 + Width uint16 + Height uint16 + Xhot uint16 + Yhot uint16 + CursorSerial uint32 + CursorAtom xproto.Atom + Nbytes uint16 + // padding: 2 bytes + Name string // size: xgb.Pad((int(Nbytes) * 1)) + CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) +} + +// Waits and reads reply data from request GetCursorImageAndName +func (cook GetCursorImageAndNameCookie) Reply() (*GetCursorImageAndNameReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCursorImageAndNameReply(buf), nil +} + +// Read reply into structure from buffer for GetCursorImageAndName +func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { + v := new(GetCursorImageAndNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Xhot = xgb.Get16(buf[b:]) + b += 2 + + v.Yhot = xgb.Get16(buf[b:]) + b += 2 + + v.CursorSerial = xgb.Get32(buf[b:]) + b += 4 + + v.CursorAtom = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Nbytes = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + { + byteString := make([]byte, v.Nbytes) + copy(byteString[:v.Nbytes], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.Nbytes)) + } + + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) + for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { + v.CursorImage[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCursorImageAndName +func getCursorImageAndNameRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ChangeCursor +// size: 12 +type ChangeCursorCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeCursor +func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) + return ChangeCursorCookie{cookie} +} + +func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) + return ChangeCursorCookie{cookie} +} + +func (cook ChangeCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeCursor +func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// Request ChangeCursorByName +// size: xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) +type ChangeCursorByNameCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeCursorByName +func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) + return ChangeCursorByNameCookie{cookie} +} + +func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) + return ChangeCursorByNameCookie{cookie} +} + +func (cook ChangeCursorByNameCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeCursorByName +func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += xgb.Pad(int(Nbytes)) + + return buf +} + +// Request ExpandRegion +// size: 20 +type ExpandRegionCookie struct { + *xgb.Cookie +} + +// Write request to wire for ExpandRegion +func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) + return ExpandRegionCookie{cookie} +} + +func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) + return ExpandRegionCookie{cookie} +} + +func (cook ExpandRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ExpandRegion +func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + xgb.Put16(buf[b:], Left) + b += 2 + + xgb.Put16(buf[b:], Right) + b += 2 + + xgb.Put16(buf[b:], Top) + b += 2 + + xgb.Put16(buf[b:], Bottom) + b += 2 + + return buf +} + +// Request HideCursor +// size: 8 +type HideCursorCookie struct { + *xgb.Cookie +} + +// Write request to wire for HideCursor +func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(hideCursorRequest(c, Window), cookie) + return HideCursorCookie{cookie} +} + +func HideCursorChecked(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(hideCursorRequest(c, Window), cookie) + return HideCursorCookie{cookie} +} + +func (cook HideCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for HideCursor +func hideCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request ShowCursor +// size: 8 +type ShowCursorCookie struct { + *xgb.Cookie +} + +// Write request to wire for ShowCursor +func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(showCursorRequest(c, Window), cookie) + return ShowCursorCookie{cookie} +} + +func ShowCursorChecked(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(showCursorRequest(c, Window), cookie) + return ShowCursorCookie{cookie} +} + +func (cook ShowCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ShowCursor +func showCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 6a71187..75af854 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -9,7 +9,14 @@ import ( "sync" ) -var logger = log.New(os.Stderr, "XGB: ", 0) +var ( + logger = log.New(os.Stderr, "XGB: ", 0) + + // ExtLock is a lock used whenever new extensions are initialized. + // It should not be used. It is exported for use in the extension + // sub-packages. + ExtLock sync.Mutex +) const ( // cookieBuffer represents the queue size of cookies existing at any @@ -44,17 +51,21 @@ type Conn struct { host string conn net.Conn display string - defaultScreen int - Setup SetupInfo + DefaultScreen int + SetupBytes []byte + + setupResourceIdBase uint32 + setupResourceIdMask uint32 eventChan chan eventOrError - cookieChan chan *cookie + cookieChan chan *Cookie xidChan chan xid seqChan chan uint16 reqChan chan *request - extLock sync.Mutex - extensions map[string]byte + // Extensions is a map from extension name to major opcode. It should + // not be used. It is exported for use in the extension sub-packages. + Extensions map[string]byte } // NewConn creates a new connection instance. It initializes locks, data @@ -83,9 +94,9 @@ func NewConnDisplay(display string) (*Conn, error) { return nil, err } - conn.extensions = make(map[string]byte) + conn.Extensions = make(map[string]byte) - conn.cookieChan = make(chan *cookie, cookieBuffer) + conn.cookieChan = make(chan *Cookie, cookieBuffer) conn.xidChan = make(chan xid, xidBuffer) conn.seqChan = make(chan uint16, seqBuffer) conn.reqChan = make(chan *request, reqBuffer) @@ -104,12 +115,6 @@ func (c *Conn) Close() { c.conn.Close() } -// DefaultScreen returns the Screen info for the default screen, which is -// 0 or the one given in the display argument to Dial. -func (c *Conn) DefaultScreen() *ScreenInfo { - return &c.Setup.Roots[c.defaultScreen] -} - // Event is an interface that can contain any of the events returned by the // server. Use a type assertion switch to extract the Event structs. type Event interface { @@ -118,16 +123,20 @@ type Event interface { String() string } -type newEventFun func(buf []byte) Event +// NewEventFun is the type of function use to construct events from raw bytes. +// It should not be used. It is exported for use in the extension sub-packages. +type NewEventFun func(buf []byte) Event -// newEventFuncs is a map from event numbers to functions that create -// the corresponding event. -var newEventFuncs = make(map[int]newEventFun) +// NewEventFuncs is a map from event numbers to functions that create +// the corresponding event. It should not be used. It is exported for use +// in the extension sub-packages. +var NewEventFuncs = make(map[int]NewEventFun) -// newExtEventFuncs is a temporary map that stores event constructor functions +// NewExtEventFuncs is a temporary map that stores event constructor functions // for each extension. When an extension is initialized, each event for that -// extension is added to the 'newEventFuncs' map. -var newExtEventFuncs = make(map[string]map[int]newEventFun) +// extension is added to the 'NewEventFuncs' map. It should not be used. It is +// exported for use in the extension sub-packages. +var NewExtEventFuncs = make(map[string]map[int]NewEventFun) // Error is an interface that can contain any of the errors returned by // the server. Use a type assertion switch to extract the Error structs. @@ -138,16 +147,20 @@ type Error interface { Error() string } -type newErrorFun func(buf []byte) Error +// NewErrorFun is the type of function use to construct errors from raw bytes. +// It should not be used. It is exported for use in the extension sub-packages. +type NewErrorFun func(buf []byte) Error -// newErrorFuncs is a map from error numbers to functions that create -// the corresponding error. -var newErrorFuncs = make(map[int]newErrorFun) +// NewErrorFuncs is a map from error numbers to functions that create +// the corresponding error. It should not be used. It is exported for use in +// the extension sub-packages. +var NewErrorFuncs = make(map[int]NewErrorFun) -// newExtErrorFuncs is a temporary map that stores error constructor functions +// NewExtErrorFuncs is a temporary map that stores error constructor functions // for each extension. When an extension is initialized, each error for that -// extension is added to the 'newErrorFuncs' map. -var newExtErrorFuncs = make(map[string]map[int]newErrorFun) +// extension is added to the 'NewErrorFuncs' map. It should not be used. It is +// exported for use in the extension sub-packages. +var NewExtErrorFuncs = make(map[string]map[int]NewErrorFun) // eventOrError corresponds to values that can be either an event or an // error. @@ -194,8 +207,8 @@ func (conn *Conn) generateXIds() { // 00111000 & 11001000 = 00001000. // And we use that value to increment the last resource id to get a new one. // (And then, of course, we OR it with resource-id-base.) - inc := conn.Setup.ResourceIdMask & -conn.Setup.ResourceIdMask - max := conn.Setup.ResourceIdMask + inc := conn.setupResourceIdMask & -conn.setupResourceIdMask + max := conn.setupResourceIdMask last := uint32(0) for { // TODO: Use the XC Misc extension to look for released ids. @@ -209,7 +222,7 @@ func (conn *Conn) generateXIds() { last += inc conn.xidChan <- xid{ - id: last | conn.Setup.ResourceIdBase, + id: last | conn.setupResourceIdBase, err: nil, } } @@ -244,14 +257,14 @@ func (c *Conn) generateSeqIds() { // The cookie is used to match up the reply/error. type request struct { buf []byte - cookie *cookie + cookie *Cookie } -// newRequest takes the bytes an a cookie, constructs a request type, +// NewRequest takes the bytes an a cookie, constructs a request type, // and sends it over the Conn.reqChan channel. // Note that the sequence number is added to the cookie after it is sent // over the request channel. -func (c *Conn) newRequest(buf []byte, cookie *cookie) { +func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { c.reqChan <- &request{buf: buf, cookie: cookie} } @@ -264,11 +277,11 @@ func (c *Conn) sendRequests() { // Note that we circumvent the request channel, because we're *in* // the request channel. if len(c.cookieChan) == cookieBuffer-1 { - cookie := c.newCookie(true, true) + cookie := c.NewCookie(true, true) cookie.Sequence = c.newSequenceId() c.cookieChan <- cookie c.writeBuffer(c.getInputFocusRequest()) - GetInputFocusCookie{cookie}.Reply() // wait for the buffer to clear + cookie.Reply() // wait for the buffer to clear } req.cookie.Sequence = c.newSequenceId() @@ -315,7 +328,7 @@ func (c *Conn) readResponses() { case 0: // This is an error // Use the constructor function for this error (that is auto // generated) by looking it up by the error number. - newErrFun, ok := newErrorFuncs[int(buf[1])] + newErrFun, ok := NewErrorFuncs[int(buf[1])] if !ok { logger.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) @@ -352,7 +365,7 @@ func (c *Conn) readResponses() { // the most significant bit (which is set when it was sent from // a SendEvent request). evNum := int(buf[0] & 127) - newEventFun, ok := newEventFuncs[evNum] + newEventFun, ok := NewEventFuncs[evNum] if !ok { logger.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) diff --git a/nexgb/xgb_help.go b/nexgb/xgb_help.go index 6c3b40a..36fe98b 100644 --- a/nexgb/xgb_help.go +++ b/nexgb/xgb_help.go @@ -5,30 +5,30 @@ import ( "strings" ) -// stringsJoin is an alias to strings.Join. It allows us to avoid having to +// StringsJoin is an alias to strings.Join. It allows us to avoid having to // import 'strings' in each of the generated Go files. -func stringsJoin(ss []string, sep string) string { +func StringsJoin(ss []string, sep string) string { return strings.Join(ss, sep) } -// sprintf is so we don't need to import 'fmt' in the generated Go files. -func sprintf(format string, v ...interface{}) string { +// Sprintf is so we don't need to import 'fmt' in the generated Go files. +func Sprintf(format string, v ...interface{}) string { return fmt.Sprintf(format, v...) } -// errorf is just a wrapper for fmt.Errorf. Exists for the same reason +// Errorf is just a wrapper for fmt.Errorf. Exists for the same reason // that 'stringsJoin' and 'sprintf' exists. -func errorf(format string, v ...interface{}) error { +func Errorf(format string, v ...interface{}) error { return fmt.Errorf(format, v...) } // Pad a length to align on 4 bytes. -func pad(n int) int { +func Pad(n int) int { return (n + 3) & ^3 } // popCount counts the number of bits set in a value list mask. -func popCount(mask0 int) int { +func PopCount(mask0 int) int { mask := uint32(mask0) n := 0 for i := uint32(0); i < 32; i++ { diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index a7a1d1d..67699cf 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -5,7 +5,6 @@ import ( "encoding/xml" "fmt" "log" - "strings" "time" ) @@ -49,10 +48,10 @@ func (c *Context) Morph(xmlBytes []byte) { parsedXml.Imports.Eval() // Translate XML types to nice types - c.protocol = parsedXml.Translate() + c.protocol = parsedXml.Translate(nil) // Start with Go header. - c.Putln("package xgb") + c.Putln("package %s", c.protocol.PkgName()) c.Putln("") c.Putln("/*") c.Putln("\tThis file was generated by %s.xml on %s.", @@ -61,44 +60,53 @@ func (c *Context) Morph(xmlBytes []byte) { c.Putln("*/") c.Putln("") - // Write imports in comments - if len(c.protocol.Imports) > 0 { - c.Putln("// Imports are not necessary for XGB because everything is ") - c.Putln("// in one package. They are still listed here for reference.") - for _, imp := range c.protocol.Imports { - c.Putln("// import \"%s\"", imp.Name) - } - c.Putln("") + // Write imports. We always need to import at least xgb. + // We also need to import xproto if it's an extension. + c.Putln("import (") + c.Putln("\"github.com/BurntSushi/xgb\"") + c.Putln("") + if c.protocol.isExt() { + c.Putln("\"github.com/BurntSushi/xgb/xproto\"") } + for _, imp := range c.protocol.Imports { + // We always import xproto, so skip it if it's explicitly imported + if imp.Name == "xproto" { + continue + } + c.Putln("\"github.com/BurntSushi/xgb/%s\"", imp.Name) + } + c.Putln(")") + c.Putln("") // If this is an extension, create a function to initialize the extension // before it can be used. if c.protocol.isExt() { - name := strings.Title(c.protocol.Name) + "Init" xname := c.protocol.ExtXName - c.Putln("// %s must be called before using the %s extension.", - name, xname) - c.Putln("func (c *Conn) %s() error {", name) - c.Putln("reply, err := c.QueryExtension(%d, \"%s\").Reply()", + c.Putln("// Init must be called before using the %s extension.", + xname) + c.Putln("func Init(c *xgb.Conn) error {") + c.Putln("reply, err := xproto.QueryExtension(c, %d, \"%s\").Reply()", len(xname), xname) c.Putln("switch {") c.Putln("case err != nil:") c.Putln("return err") c.Putln("case !reply.Present:") - c.Putln("return errorf(\"No extension named %s could be found on "+ + c.Putln("return xgb.Errorf(\"No extension named %s could be found on "+ "on the server.\")", xname) c.Putln("}") c.Putln("") - c.Putln("c.extLock.Lock()") - c.Putln("c.extensions[\"%s\"] = reply.MajorOpcode", xname) - c.Putln("for evNum, fun := range newExtEventFuncs[\"%s\"] {", xname) - c.Putln("newEventFuncs[int(reply.FirstEvent) + evNum] = fun") + c.Putln("xgb.ExtLock.Lock()") + c.Putln("c.Extensions[\"%s\"] = reply.MajorOpcode", xname) + c.Putln("for evNum, fun := range xgb.NewExtEventFuncs[\"%s\"] {", + xname) + c.Putln("xgb.NewEventFuncs[int(reply.FirstEvent) + evNum] = fun") c.Putln("}") - c.Putln("for errNum, fun := range newExtErrorFuncs[\"%s\"] {", xname) - c.Putln("newErrorFuncs[int(reply.FirstError) + errNum] = fun") + c.Putln("for errNum, fun := range xgb.NewExtErrorFuncs[\"%s\"] {", + xname) + c.Putln("xgb.NewErrorFuncs[int(reply.FirstError) + errNum] = fun") c.Putln("}") - c.Putln("c.extLock.Unlock()") + c.Putln("xgb.ExtLock.Unlock()") c.Putln("") c.Putln("return nil") c.Putln("}") @@ -107,8 +115,26 @@ func (c *Context) Morph(xmlBytes []byte) { // Make sure newExtEventFuncs["EXT_NAME"] map is initialized. // Same deal for newExtErrorFuncs["EXT_NAME"] c.Putln("func init() {") - c.Putln("newExtEventFuncs[\"%s\"] = make(map[int]newEventFun)", xname) - c.Putln("newExtErrorFuncs[\"%s\"] = make(map[int]newErrorFun)", xname) + c.Putln("xgb.NewExtEventFuncs[\"%s\"] = make(map[int]xgb.NewEventFun)", + xname) + c.Putln("xgb.NewExtErrorFuncs[\"%s\"] = make(map[int]xgb.NewErrorFun)", + xname) + c.Putln("}") + c.Putln("") + } else { + // In the xproto package, we must provide a Setup function that uses + // SetupBytes in xgb.Conn to return a SetupInfo structure. + c.Putln("// Setup parses the setup bytes retrieved when") + c.Putln("// connecting into a SetupInfo struct.") + c.Putln("func Setup(c *xgb.Conn) *SetupInfo {") + c.Putln("setup := new(SetupInfo)") + c.Putln("SetupInfoRead(c.SetupBytes, setup)") + c.Putln("return setup") + c.Putln("}") + c.Putln("") + c.Putln("// DefaultScreen gets the default screen info from SetupInfo.") + c.Putln("func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo {") + c.Putln("return &s.Roots[c.DefaultScreen]") c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 0966b58..2047b5f 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -204,7 +204,7 @@ func (e *Padding) Reduce(prefix string) string { if e.Concrete() { return fmt.Sprintf("%d", e.Eval()) } - return fmt.Sprintf("pad(%s)", e.Expr.Reduce(prefix)) + return fmt.Sprintf("xgb.Pad(%s)", e.Expr.Reduce(prefix)) } func (e *Padding) String() string { @@ -233,7 +233,7 @@ func (e *PopCount) Reduce(prefix string) string { if e.Concrete() { return fmt.Sprintf("%d", e.Eval()) } - return fmt.Sprintf("popCount(%s)", e.Expr.Reduce(prefix)) + return fmt.Sprintf("xgb.PopCount(%s)", e.Expr.Reduce(prefix)) } func (e *PopCount) String() string { diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 7c83f1a..78475f8 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -245,7 +245,7 @@ func (f *ValueField) SrcType() string { func (f *ValueField) Size() Size { maskSize := f.MaskType.Size() listSize := newExpressionSize(&Function{ - Name: "pad", + Name: "xgb.Pad", Expr: &BinaryOp{ Op: "*", Expr1: &Value{v: 4}, diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index 2b2c191..6c680e8 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -82,7 +82,7 @@ func (enum *Enum) Define(c *Context) { func (res *Resource) Define(c *Context) { c.Putln("type %s uint32", res.SrcName()) c.Putln("") - c.Putln("func (c *Conn) New%sId() (%s, error) {", + c.Putln("func New%sId(c *xgb.Conn) (%s, error) {", res.SrcName(), res.SrcName()) c.Putln("id, err := c.NewId()") c.Putln("if err != nil {") @@ -167,10 +167,10 @@ func (f *ValueField) Read(c *Context, prefix string) { c.Putln("%s%s = make([]uint32, %s)", prefix, f.ListName, f.ListLength().Reduce(prefix)) c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) - c.Putln("%s%s[i] = Get32(buf[b:])", prefix, f.ListName) + c.Putln("%s%s[i] = xgb.Get32(buf[b:])", prefix, f.ListName) c.Putln("b += 4") c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") } func (f *ValueField) Write(c *Context, prefix string) { @@ -180,10 +180,10 @@ func (f *ValueField) Write(c *Context, prefix string) { fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType) } c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) - c.Putln("Put32(buf[b:], %s%s[i])", prefix, f.ListName) + c.Putln("xgb.Put32(buf[b:], %s%s[i])", prefix, f.ListName) c.Putln("b += 4") c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") } // Switch field diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index f4577ef..b7721be 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -30,10 +30,10 @@ func (e *Error) Define(c *Context) { // Let's the XGB event loop read this error. c.Putln("func init() {") if c.protocol.isExt() { - c.Putln("newExtErrorFuncs[\"%s\"][%d] = New%s", + c.Putln("xgb.NewExtErrorFuncs[\"%s\"][%d] = %sNew", c.protocol.ExtXName, e.Number, e.ErrType()) } else { - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + c.Putln("xgb.NewErrorFuncs[%d] = %sNew", e.Number, e.ErrType()) } c.Putln("}") c.Putln("") @@ -41,14 +41,14 @@ func (e *Error) Define(c *Context) { func (e *Error) Read(c *Context) { c.Putln("// Error read %s", e.SrcName()) - c.Putln("func New%s(buf []byte) Error {", e.ErrType()) + c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType()) c.Putln("v := %s{}", e.ErrType()) c.Putln("v.NiceName = \"%s\"", e.SrcName()) c.Putln("") c.Putln("b := 1 // skip error determinant") c.Putln("b += 1 // don't read error number") c.Putln("") - c.Putln("v.Sequence = Get16(buf[b:])") + c.Putln("v.Sequence = xgb.Get16(buf[b:])") c.Putln("b += 2") c.Putln("") for _, field := range e.Fields { @@ -101,18 +101,18 @@ func (e *ErrorCopy) Define(c *Context) { // Let's the XGB know how to read this error. c.Putln("func init() {") if c.protocol.isExt() { - c.Putln("newExtErrorFuncs[\"%s\"][%d] = New%s", + c.Putln("xgb.NewExtErrorFuncs[\"%s\"][%d] = %sNew", c.protocol.ExtXName, e.Number, e.ErrType()) } else { - c.Putln("newErrorFuncs[%d] = New%s", e.Number, e.ErrType()) + c.Putln("xgb.NewErrorFuncs[%d] = %sNew", e.Number, e.ErrType()) } c.Putln("}") c.Putln("") } func (e *ErrorCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) Error {", e.ErrType()) - c.Putln("v := %s(New%s(buf).(%s))", + c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType()) + c.Putln("v := %s(%sNew(buf).(%s))", e.ErrType(), e.Old.(*Error).ErrType(), e.Old.(*Error).ErrType()) c.Putln("v.NiceName = \"%s\"", e.SrcName()) c.Putln("return v") @@ -148,7 +148,7 @@ func ErrorFieldString(c *Context, fields []Field, errName string) { c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) c.Putln("fieldVals = append(fieldVals, \"NiceName: \" + err.NiceName)") c.Putln("fieldVals = append(fieldVals, "+ - "sprintf(\"Sequence: %s\", err.Sequence))", "%d") + "xgb.Sprintf(\"Sequence: %s\", err.Sequence))", "%d") for _, field := range fields { switch field.(type) { case *PadField: @@ -158,11 +158,12 @@ func ErrorFieldString(c *Context, fields []Field, errName string) { c.Putln("fieldVals = append(fieldVals, \"%s: \" + err.%s)", field.SrcName(), field.SrcName()) } else { - format := fmt.Sprintf("sprintf(\"%s: %s\", err.%s)", + format := fmt.Sprintf("xgb.Sprintf(\"%s: %s\", err.%s)", field.SrcName(), "%d", field.SrcName()) c.Putln("fieldVals = append(fieldVals, %s)", format) } } } - c.Putln("return \"%s {\" + stringsJoin(fieldVals, \", \") + \"}\"", errName) + c.Putln("return \"%s {\" + xgb.StringsJoin(fieldVals, \", \") + \"}\"", + errName) } diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index f55e26f..d7ef109 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -48,10 +48,10 @@ func (e *Event) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") if c.protocol.isExt() { - c.Putln("newExtEventFuncs[\"%s\"][%d] = New%s", + c.Putln("xgb.NewExtEventFuncs[\"%s\"][%d] = %sNew", c.protocol.ExtXName, e.Number, e.EvType()) } else { - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + c.Putln("xgb.NewEventFuncs[%d] = %sNew", e.Number, e.EvType()) } c.Putln("}") c.Putln("") @@ -59,13 +59,13 @@ func (e *Event) Define(c *Context) { func (e *Event) Read(c *Context) { c.Putln("// Event read %s", e.SrcName()) - c.Putln("func New%s(buf []byte) Event {", e.EvType()) + c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType()) c.Putln("v := %s{}", e.EvType()) c.Putln("b := 1 // don't read event number") c.Putln("") for i, field := range e.Fields { if i == 1 && !e.NoSequence { - c.Putln("v.Sequence = Get16(buf[b:])") + c.Putln("v.Sequence = xgb.Get16(buf[b:])") c.Putln("b += 2") c.Putln("") } @@ -136,18 +136,18 @@ func (e *EventCopy) Define(c *Context) { // Let's the XGB event loop read this event. c.Putln("func init() {") if c.protocol.isExt() { - c.Putln("newExtEventFuncs[\"%s\"][%d] = New%s", + c.Putln("xgb.NewExtEventFuncs[\"%s\"][%d] = %sNew", c.protocol.ExtXName, e.Number, e.EvType()) } else { - c.Putln("newEventFuncs[%d] = New%s", e.Number, e.EvType()) + c.Putln("xgb.NewEventFuncs[%d] = %sNew", e.Number, e.EvType()) } c.Putln("}") c.Putln("") } func (e *EventCopy) Read(c *Context) { - c.Putln("func New%s(buf []byte) Event {", e.EvType()) - c.Putln("return %s(New%s(buf).(%s))", + c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType()) + c.Putln("return %s(%sNew(buf).(%s))", e.EvType(), e.Old.(*Event).EvType(), e.Old.(*Event).EvType()) c.Putln("}") c.Putln("") @@ -166,7 +166,7 @@ func EventFieldString(c *Context, fields []Field, evName string) { c.Putln("fieldVals := make([]string, 0, %d)", len(fields)) if evName != "KeymapNotify" { c.Putln("fieldVals = append(fieldVals, "+ - "sprintf(\"Sequence: %s\", v.Sequence))", "%d") + "xgb.Sprintf(\"Sequence: %s\", v.Sequence))", "%d") } for _, field := range fields { switch f := field.(type) { @@ -183,19 +183,20 @@ func EventFieldString(c *Context, fields []Field, evName string) { switch field.SrcType() { case "string": - format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + format := fmt.Sprintf("xgb.Sprintf(\"%s: %s\", v.%s)", field.SrcName(), "%s", field.SrcName()) c.Putln("fieldVals = append(fieldVals, %s)", format) case "bool": - format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + format := fmt.Sprintf("xgb.Sprintf(\"%s: %s\", v.%s)", field.SrcName(), "%t", field.SrcName()) c.Putln("fieldVals = append(fieldVals, %s)", format) default: - format := fmt.Sprintf("sprintf(\"%s: %s\", v.%s)", + format := fmt.Sprintf("xgb.Sprintf(\"%s: %s\", v.%s)", field.SrcName(), "%d", field.SrcName()) c.Putln("fieldVals = append(fieldVals, %s)", format) } } } - c.Putln("return \"%s {\" + stringsJoin(fieldVals, \", \") + \"}\"", evName) + c.Putln("return \"%s {\" + xgb.StringsJoin(fieldVals, \", \") + \"}\"", + evName) } diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index b01519b..4cf962a 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -21,7 +21,7 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("for i := 0; i < int(%s); i++ {", length) ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") case *Base: length := f.LengthExpr.Reduce(prefix) if strings.ToLower(t.XmlName()) == "char" { @@ -29,13 +29,13 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("byteString := make([]%s, %s)", t.SrcName(), length) c.Putln("copy(byteString[:%s], buf[b:])", length) c.Putln("%s%s = string(byteString)", prefix, f.SrcName()) - c.Putln("b += pad(int(%s))", length) + c.Putln("b += xgb.Pad(int(%s))", length) c.Putln("}") } else if t.SrcName() == "byte" { c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), length) c.Putln("copy(%s%s[:%s], buf[b:])", prefix, f.SrcName(), length) - c.Putln("b += pad(int(%s))", length) + c.Putln("b += xgb.Pad(int(%s))", length) } else { c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), length) @@ -43,7 +43,7 @@ func (f *ListField) Read(c *Context, prefix string) { ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") } case *TypeDef: length := f.LengthExpr.Reduce(prefix) @@ -52,16 +52,16 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("for i := 0; i < int(%s); i++ {", length) ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") case *Union: c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), f.LengthExpr.Reduce(prefix)) - c.Putln("b += Read%sList(buf[b:], %s%s)", + c.Putln("b += %sReadList(buf[b:], %s%s)", t.SrcName(), prefix, f.SrcName()) case *Struct: c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), f.LengthExpr.Reduce(prefix)) - c.Putln("b += Read%sList(buf[b:], %s%s)", + c.Putln("b += %sReadList(buf[b:], %s%s)", t.SrcName(), prefix, f.SrcName()) default: log.Panicf("Cannot read list field '%s' with %T type.", @@ -77,18 +77,18 @@ func (f *ListField) Write(c *Context, prefix string) { WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") case *Base: length := f.Length().Reduce(prefix) if t.SrcName() == "byte" { c.Putln("copy(buf[b:], %s%s[:%s])", prefix, f.SrcName(), length) - c.Putln("b += pad(int(%s))", length) + c.Putln("b += xgb.Pad(int(%s))", length) } else { c.Putln("for i := 0; i < int(%s); i++ {", length) WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") } case *TypeDef: length := f.Length().Reduce(prefix) @@ -96,7 +96,7 @@ func (f *ListField) Write(c *Context, prefix string) { WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = pad(b)") + c.Putln("b = xgb.Pad(b)") case *Union: c.Putln("b += %sListBytes(buf[b:], %s%s)", t.SrcName(), prefix, f.SrcName()) diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index a9e624d..200260c 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -9,22 +9,22 @@ func (r *Request) Define(c *Context) { c.Putln("// Request %s", r.SrcName()) c.Putln("// size: %s", r.Size(c)) c.Putln("type %s struct {", r.CookieName()) - c.Putln("*cookie") + c.Putln("*xgb.Cookie") c.Putln("}") c.Putln("") if r.Reply != nil { - c.Putln("func (c *Conn) %s(%s) %s {", + c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) - c.Putln("cookie := c.newCookie(true, true)") - c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("cookie := c.NewCookie(true, true)") + c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") - c.Putln("func (c *Conn) %sUnchecked(%s) %s {", + c.Putln("func %sUnchecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) - c.Putln("cookie := c.newCookie(false, true)") - c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("cookie := c.NewCookie(false, true)") + c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") @@ -32,27 +32,27 @@ func (r *Request) Define(c *Context) { r.ReadReply(c) } else { c.Putln("// Write request to wire for %s", r.SrcName()) - c.Putln("func (c *Conn) %s(%s) %s {", + c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) - c.Putln("cookie := c.newCookie(false, false)") - c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("cookie := c.NewCookie(false, false)") + c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") - c.Putln("func (c *Conn) %sChecked(%s) %s {", + c.Putln("func %sChecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) - c.Putln("cookie := c.newCookie(true, false)") - c.Putln("c.newRequest(c.%s(%s), cookie)", r.ReqName(), r.ParamNames()) + c.Putln("cookie := c.NewCookie(true, false)") + c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) c.Putln("}") c.Putln("") + + c.Putln("func (cook %s) Check() error {", r.CookieName()) + c.Putln("return cook.Cookie.Check()") + c.Putln("}") + c.Putln("") } - - c.Putln("func (cook %s) Check() error {", r.CookieName()) - c.Putln("return cook.check()") - c.Putln("}") - c.Putln("") r.WriteRequest(c) } @@ -71,7 +71,7 @@ func (r *Request) ReadReply(c *Context) { c.Putln("// Waits and reads reply data from request %s", r.SrcName()) c.Putln("func (cook %s) Reply() (*%s, error) {", r.CookieName(), r.ReplyTypeName()) - c.Putln("buf, err := cook.reply()") + c.Putln("buf, err := cook.Cookie.Reply()") c.Putln("if err != nil {") c.Putln("return nil, err") c.Putln("}") @@ -92,10 +92,10 @@ func (r *Request) ReadReply(c *Context) { field.Read(c, "v.") c.Putln("") if i == 0 { - c.Putln("v.Sequence = Get16(buf[b:])") + c.Putln("v.Sequence = xgb.Get16(buf[b:])") c.Putln("b += 2") c.Putln("") - c.Putln("v.Length = Get32(buf[b:]) // 4-byte units") + c.Putln("v.Length = xgb.Get32(buf[b:]) // 4-byte units") c.Putln("b += 4") c.Putln("") } @@ -107,19 +107,20 @@ func (r *Request) ReadReply(c *Context) { func (r *Request) WriteRequest(c *Context) { writeSize := func() { - c.Putln("Put16(buf[b:], uint16(size / 4)) " + + c.Putln("xgb.Put16(buf[b:], uint16(size / 4)) " + "// write request size in 4-byte units") c.Putln("b += 2") c.Putln("") } c.Putln("// Write request to wire for %s", r.SrcName()) - c.Putln("func (c *Conn) %s(%s) []byte {", r.ReqName(), r.ParamNameTypes()) + c.Putln("func %s(c *xgb.Conn, %s) []byte {", + r.ReqName(), r.ParamNameTypes()) c.Putln("size := %s", r.Size(c)) c.Putln("b := 0") c.Putln("buf := make([]byte, size)") c.Putln("") if c.protocol.isExt() { - c.Putln("buf[b] = c.extensions[\"%s\"]", + c.Putln("buf[b] = c.Extensions[\"%s\"]", strings.ToUpper(c.protocol.ExtXName)) c.Putln("b += 1") c.Putln("") @@ -165,7 +166,7 @@ func (r *Request) ParamNames() string { names = append(names, fmt.Sprintf("%s", field.SrcName())) } } - return strings.Join(names, ",") + return strings.Join(names, ", ") } func (r *Request) ParamNameTypes() string { @@ -189,5 +190,5 @@ func (r *Request) ParamNameTypes() string { fmt.Sprintf("%s %s", field.SrcName(), field.SrcType())) } } - return strings.Join(nameTypes, ",") + return strings.Join(nameTypes, ", ") } diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go index 433ebe3..3e3fa53 100644 --- a/nexgb/xgbgen/go_single_field.go +++ b/nexgb/xgbgen/go_single_field.go @@ -12,17 +12,17 @@ func (f *SingleField) Define(c *Context) { func ReadSimpleSingleField(c *Context, name string, typ Type) { switch t := typ.(type) { case *Resource: - c.Putln("%s = %s(Get32(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(xgb.Get32(buf[b:]))", name, t.SrcName()) case *TypeDef: switch t.Size().Eval() { case 1: c.Putln("%s = %s(buf[b])", name, t.SrcName()) case 2: - c.Putln("%s = %s(Get16(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(xgb.Get16(buf[b:]))", name, t.SrcName()) case 4: - c.Putln("%s = %s(Get32(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(xgb.Get32(buf[b:]))", name, t.SrcName()) case 8: - c.Putln("%s = %s(Get64(buf[b:]))", name, t.SrcName()) + c.Putln("%s = %s(xgb.Get64(buf[b:]))", name, t.SrcName()) } case *Base: // If this is a bool, stop short and do something special. @@ -40,11 +40,11 @@ func ReadSimpleSingleField(c *Context, name string, typ Type) { case 1: val = fmt.Sprintf("buf[b]") case 2: - val = fmt.Sprintf("Get16(buf[b:])") + val = fmt.Sprintf("xgb.Get16(buf[b:])") case 4: - val = fmt.Sprintf("Get32(buf[b:])") + val = fmt.Sprintf("xgb.Get32(buf[b:])") case 8: - val = fmt.Sprintf("Get64(buf[b:])") + val = fmt.Sprintf("xgb.Get64(buf[b:])") } // We need to convert base types if they aren't uintXX or byte @@ -71,10 +71,10 @@ func (f *SingleField) Read(c *Context, prefix string) { ReadSimpleSingleField(c, fmt.Sprintf("%s%s", prefix, f.SrcName()), t) case *Struct: c.Putln("%s%s = %s{}", prefix, f.SrcName(), t.SrcName()) - c.Putln("b += Read%s(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) + c.Putln("b += %sRead(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) case *Union: c.Putln("%s%s = %s{}", prefix, f.SrcName(), t.SrcName()) - c.Putln("b += Read%s(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) + c.Putln("b += %sRead(buf[b:], &%s%s)", t.SrcName(), prefix, f.SrcName()) default: log.Panicf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) } @@ -83,17 +83,17 @@ func (f *SingleField) Read(c *Context, prefix string) { func WriteSimpleSingleField(c *Context, name string, typ Type) { switch t := typ.(type) { case *Resource: - c.Putln("Put32(buf[b:], uint32(%s))", name) + c.Putln("xgb.Put32(buf[b:], uint32(%s))", name) case *TypeDef: switch t.Size().Eval() { case 1: c.Putln("buf[b] = byte(%s)", name) case 2: - c.Putln("Put16(buf[b:], uint16(%s))", name) + c.Putln("xgb.Put16(buf[b:], uint16(%s))", name) case 4: - c.Putln("Put32(buf[b:], uint32(%s))", name) + c.Putln("xgb.Put32(buf[b:], uint32(%s))", name) case 8: - c.Putln("Put64(buf[b:], uint64(%s))", name) + c.Putln("xgb.Put64(buf[b:], uint64(%s))", name) } case *Base: // If this is a bool, stop short and do something special. @@ -115,21 +115,21 @@ func WriteSimpleSingleField(c *Context, name string, typ Type) { } case 2: if t.SrcName() != "uint16" { - c.Putln("Put16(buf[b:], uint16(%s))", name) + c.Putln("xgb.Put16(buf[b:], uint16(%s))", name) } else { - c.Putln("Put16(buf[b:], %s)", name) + c.Putln("xgb.Put16(buf[b:], %s)", name) } case 4: if t.SrcName() != "uint32" { - c.Putln("Put32(buf[b:], uint32(%s))", name) + c.Putln("xgb.Put32(buf[b:], uint32(%s))", name) } else { - c.Putln("Put32(buf[b:], %s)", name) + c.Putln("xgb.Put32(buf[b:], %s)", name) } case 8: if t.SrcName() != "uint64" { - c.Putln("Put64(buf[b:], uint64(%s))", name) + c.Putln("xgb.Put64(buf[b:], uint64(%s))", name) } else { - c.Putln("Put64(buf[b:], %s)", name) + c.Putln("xgb.Put64(buf[b:], %s)", name) } } default: @@ -152,13 +152,13 @@ func (f *SingleField) Write(c *Context, prefix string) { c.Putln("{") c.Putln("unionBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], unionBytes)") - c.Putln("b += pad(len(unionBytes))") + c.Putln("b += xgb.Pad(len(unionBytes))") c.Putln("}") case *Struct: c.Putln("{") c.Putln("structBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += pad(len(structBytes))") + c.Putln("b += xgb.Pad(len(structBytes))") c.Putln("}") default: log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 9884194..7f33b21 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -35,7 +35,7 @@ func (s *Struct) Define(c *Context) { // 'ReadStructName' should only be used to read raw reply data from the wire. func (s *Struct) Read(c *Context) { c.Putln("// Struct read %s", s.SrcName()) - c.Putln("func Read%s(buf []byte, v *%s) int {", s.SrcName(), s.SrcName()) + c.Putln("func %sRead(buf []byte, v *%s) int {", s.SrcName(), s.SrcName()) c.Putln("b := 0") c.Putln("") @@ -54,16 +54,16 @@ func (s *Struct) Read(c *Context) { // the number of bytes read from the byte slice. func (s *Struct) ReadList(c *Context) { c.Putln("// Struct list read %s", s.SrcName()) - c.Putln("func Read%sList(buf []byte, dest []%s) int {", + c.Putln("func %sReadList(buf []byte, dest []%s) int {", s.SrcName(), s.SrcName()) c.Putln("b := 0") c.Putln("for i := 0; i < len(dest); i++ {") c.Putln("dest[i] = %s{}", s.SrcName()) - c.Putln("b += Read%s(buf[b:], &dest[i])", s.SrcName()) + c.Putln("b += %sRead(buf[b:], &dest[i])", s.SrcName()) c.Putln("}") - c.Putln("return pad(b)") + c.Putln("return xgb.Pad(b)") c.Putln("}") c.Putln("") @@ -93,7 +93,7 @@ func (s *Struct) WriteList(c *Context) { c.Putln("for _, item := range list {") c.Putln("structBytes = item.Bytes()") c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += pad(len(structBytes))") + c.Putln("b += xgb.Pad(len(structBytes))") c.Putln("}") c.Putln("return b") c.Putln("}") diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 73e85f7..91300a2 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -8,7 +8,7 @@ func (u *Union) Define(c *Context) { c.Putln("// Instead use one of the following constructors for '%s':", u.SrcName()) for _, field := range u.Fields { - c.Putln("// New%s%s(%s %s) %s", u.SrcName(), field.SrcName(), + c.Putln("// %s%sNew(%s %s) %s", u.SrcName(), field.SrcName(), field.SrcName(), field.SrcType(), u.SrcName()) } @@ -40,7 +40,7 @@ func (u *Union) New(c *Context) { for _, field := range u.Fields { c.Putln("// Union constructor for %s for field %s.", u.SrcName(), field.SrcName()) - c.Putln("func New%s%s(%s %s) %s {", + c.Putln("func %s%sNew(%s %s) %s {", u.SrcName(), field.SrcName(), field.SrcName(), field.SrcType(), u.SrcName()) c.Putln("var b int") @@ -66,7 +66,7 @@ func (u *Union) New(c *Context) { func (u *Union) Read(c *Context) { c.Putln("// Union read %s", u.SrcName()) - c.Putln("func Read%s(buf []byte, v *%s) int {", u.SrcName(), u.SrcName()) + c.Putln("func %sRead(buf []byte, v *%s) int {", u.SrcName(), u.SrcName()) c.Putln("var b int") c.Putln("") for _, field := range u.Fields { @@ -81,14 +81,14 @@ func (u *Union) Read(c *Context) { func (u *Union) ReadList(c *Context) { c.Putln("// Union list read %s", u.SrcName()) - c.Putln("func Read%sList(buf []byte, dest []%s) int {", + c.Putln("func %sReadList(buf []byte, dest []%s) int {", u.SrcName(), u.SrcName()) c.Putln("b := 0") c.Putln("for i := 0; i < len(dest); i++ {") c.Putln("dest[i] = %s{}", u.SrcName()) - c.Putln("b += Read%s(buf[b:], &dest[i])", u.SrcName()) + c.Putln("b += %sRead(buf[b:], &dest[i])", u.SrcName()) c.Putln("}") - c.Putln("return pad(b)") + c.Putln("return xgb.Pad(b)") c.Putln("}") c.Putln("") } @@ -121,7 +121,7 @@ func (u *Union) WriteList(c *Context) { c.Putln("for _, item := range list {") c.Putln("unionBytes = item.Bytes()") c.Putln("copy(buf[b:], unionBytes)") - c.Putln("b += pad(len(unionBytes))") + c.Putln("b += xgb.Pad(len(unionBytes))") c.Putln("}") c.Putln("return b") c.Putln("}") diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go index 83dde14..d56663d 100644 --- a/nexgb/xgbgen/protocol.go +++ b/nexgb/xgbgen/protocol.go @@ -1,6 +1,7 @@ package main import ( + "log" "strings" ) @@ -9,6 +10,7 @@ import ( // if this protocol imports other other extensions. The import relationship // is recursive. type Protocol struct { + Parent *Protocol Name string ExtXName string ExtName string @@ -33,6 +35,28 @@ func (p *Protocol) Initialize() { } } +// PkgName returns the name of this package. +// i.e., 'xproto' for the core X protocol, 'randr' for the RandR extension, etc. +func (p *Protocol) PkgName() string { + return strings.Replace(p.Name, "_", "", -1) +} + +// ProtocolGet searches the current context for the protocol with the given +// name. (i.e., the current protocol and its imports.) +// It is an error if one is not found. +func (p *Protocol) ProtocolFind(name string) *Protocol { + if p.Name == name { + return p // that was easy + } + for _, imp := range p.Imports { + if imp.Name == name { + return imp + } + } + log.Panicf("Could not find protocol with name '%s'.", name) + panic("unreachable") +} + // isExt returns true if this protocol is an extension. // i.e., it's name isn't "xproto". func (p *Protocol) isExt() bool { diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index 4daa4ac..637266b 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -3,7 +3,6 @@ package main import ( "fmt" "log" - "strings" "unicode" ) @@ -23,7 +22,7 @@ type Request struct { func (r *Request) Initialize(p *Protocol) { r.srcName = SrcName(p, r.xmlName) if p.isExt() { - r.srcName = strings.Title(strings.ToLower(p.Name)) + r.srcName + r.srcName = r.srcName } if r.Reply != nil { diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 44d615d..0123669 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -18,8 +18,9 @@ import ( "strings" ) -func (xml *XML) Translate() *Protocol { +func (xml *XML) Translate(parent *Protocol) *Protocol { protocol := &Protocol{ + Parent: parent, Name: xml.Header, ExtXName: xml.ExtensionXName, ExtName: xml.ExtensionName, @@ -33,7 +34,8 @@ func (xml *XML) Translate() *Protocol { for _, imp := range xml.Imports { if imp.xml != nil { - protocol.Imports = append(protocol.Imports, imp.xml.Translate()) + protocol.Imports = append(protocol.Imports, + imp.xml.Translate(protocol)) } } @@ -209,7 +211,7 @@ func (x *XMLRequest) Translate() *Request { // The XML protocol description references 'string_len' in the // computation of the 'odd_length' field. However, 'string_len' is not // defined. Therefore, let's forcefully add it as a 'local field'. - // (i.e., a parameter in the caller but does not get send over the wire.) + // (i.e., a parameter in the caller but does not get sent over the wire.) if x.Name == "QueryTextExtents" { stringLenLocal := &LocalField{&SingleField{ xmlName: "string_len", @@ -399,27 +401,15 @@ func TypeSrcName(p *Protocol, typ Type) string { if colon := strings.Index(t, ":"); colon > -1 { namespace := t[:colon] rest := t[colon+1:] - return splitAndTitle(namespace) + splitAndTitle(rest) + return p.ProtocolFind(namespace).PkgName() + "." + splitAndTitle(rest) } - // Since there is no namespace, we need to look for a namespace - // in the current context. - niceType := splitAndTitle(t) - if p.isExt() { - for _, typ2 := range p.Types { - if t == typ2.XmlName() { - return strings.Title(p.Name) + niceType - } - } - for _, imp := range p.Imports { - for _, typ2 := range imp.Types { - if t == typ2.XmlName() { - return strings.Title(imp.Name) + niceType - } - } - } + // Since there's no namespace, we're left with the raw type name. + // If the type is part of the source we're generating (i.e., there is + // no parent protocol), then just return that type name. + // Otherwise, we must qualify it with a package name. + if p.Parent == nil { + return splitAndTitle(t) } - - // We couldn't find one, so return it without a prefix. - return niceType + return p.PkgName() + "." + splitAndTitle(t) } diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go new file mode 100644 index 0000000..eb7cd9a --- /dev/null +++ b/nexgb/xinerama/xinerama.go @@ -0,0 +1,633 @@ +package xinerama + +/* + This file was generated by xinerama.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XINERAMA extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 8, "XINERAMA").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XINERAMA could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XINERAMA"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XINERAMA"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XINERAMA"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XINERAMA"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// 'ScreenInfo' struct definition +// Size: 8 +type ScreenInfo struct { + XOrg int16 + YOrg int16 + Width uint16 + Height uint16 +} + +// Struct read ScreenInfo +func ScreenInfoRead(buf []byte, v *ScreenInfo) int { + b := 0 + + v.XOrg = int16(xgb.Get16(buf[b:])) + b += 2 + + v.YOrg = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read ScreenInfo +func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ScreenInfo{} + b += ScreenInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ScreenInfo +func (v ScreenInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], uint16(v.XOrg)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.YOrg)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// Write struct list ScreenInfo +func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint16 + Minor uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = xgb.Get16(buf[b:]) + b += 2 + + v.Minor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Major + b += 1 + + buf[b] = Minor + b += 1 + + return buf +} + +// Request GetState +// size: 8 +type GetStateCookie struct { + *xgb.Cookie +} + +func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getStateRequest(c, Window), cookie) + return GetStateCookie{cookie} +} + +func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getStateRequest(c, Window), cookie) + return GetStateCookie{cookie} +} + +// Request reply for GetState +// size: 12 +type GetStateReply struct { + Sequence uint16 + Length uint32 + State byte + Window xproto.Window +} + +// Waits and reads reply data from request GetState +func (cook GetStateCookie) Reply() (*GetStateReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getStateReply(buf), nil +} + +// Read reply into structure from buffer for GetState +func getStateReply(buf []byte) *GetStateReply { + v := new(GetStateReply) + b := 1 // skip reply determinant + + v.State = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetState +func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request GetScreenCount +// size: 8 +type GetScreenCountCookie struct { + *xgb.Cookie +} + +func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenCountRequest(c, Window), cookie) + return GetScreenCountCookie{cookie} +} + +func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenCountRequest(c, Window), cookie) + return GetScreenCountCookie{cookie} +} + +// Request reply for GetScreenCount +// size: 12 +type GetScreenCountReply struct { + Sequence uint16 + Length uint32 + ScreenCount byte + Window xproto.Window +} + +// Waits and reads reply data from request GetScreenCount +func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenCountReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenCount +func getScreenCountReply(buf []byte) *GetScreenCountReply { + v := new(GetScreenCountReply) + b := 1 // skip reply determinant + + v.ScreenCount = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetScreenCount +func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request GetScreenSize +// size: 12 +type GetScreenSizeCookie struct { + *xgb.Cookie +} + +func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) + return GetScreenSizeCookie{cookie} +} + +func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) + return GetScreenSizeCookie{cookie} +} + +// Request reply for GetScreenSize +// size: 24 +type GetScreenSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint32 + Height uint32 + Window xproto.Window + Screen uint32 +} + +// Waits and reads reply data from request GetScreenSize +func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenSizeReply(buf), nil +} + +// Read reply into structure from buffer for GetScreenSize +func getScreenSizeReply(buf []byte) *GetScreenSizeReply { + v := new(GetScreenSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = xgb.Get32(buf[b:]) + b += 4 + + v.Height = xgb.Get32(buf[b:]) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Screen = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetScreenSize +func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// Request IsActive +// size: 4 +type IsActiveCookie struct { + *xgb.Cookie +} + +func IsActive(c *xgb.Conn) IsActiveCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(isActiveRequest(c), cookie) + return IsActiveCookie{cookie} +} + +func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(isActiveRequest(c), cookie) + return IsActiveCookie{cookie} +} + +// Request reply for IsActive +// size: 12 +type IsActiveReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + State uint32 +} + +// Waits and reads reply data from request IsActive +func (cook IsActiveCookie) Reply() (*IsActiveReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isActiveReply(buf), nil +} + +// Read reply into structure from buffer for IsActive +func isActiveReply(buf []byte) *IsActiveReply { + v := new(IsActiveReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.State = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for IsActive +func isActiveRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request QueryScreens +// size: 4 +type QueryScreensCookie struct { + *xgb.Cookie +} + +func QueryScreens(c *xgb.Conn) QueryScreensCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryScreensRequest(c), cookie) + return QueryScreensCookie{cookie} +} + +func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryScreensRequest(c), cookie) + return QueryScreensCookie{cookie} +} + +// Request reply for QueryScreens +// size: (32 + xgb.Pad((int(Number) * 8))) +type QueryScreensReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Number uint32 + // padding: 20 bytes + ScreenInfo []ScreenInfo // size: xgb.Pad((int(Number) * 8)) +} + +// Waits and reads reply data from request QueryScreens +func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryScreensReply(buf), nil +} + +// Read reply into structure from buffer for QueryScreens +func queryScreensReply(buf []byte) *QueryScreensReply { + v := new(QueryScreensReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Number = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.ScreenInfo = make([]ScreenInfo, v.Number) + b += ScreenInfoReadList(buf[b:], v.ScreenInfo) + + return v +} + +// Write request to wire for QueryScreens +func queryScreensRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go new file mode 100644 index 0000000..40635f3 --- /dev/null +++ b/nexgb/xinput/xinput.go @@ -0,0 +1,7219 @@ +package xinput + +/* + This file was generated by xinput.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XInputExtension extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 15, "XInputExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XInputExtension could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XInputExtension"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XInputExtension"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XInputExtension"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +const ( + ValuatorModeRelative = 0 + ValuatorModeAbsolute = 1 +) + +const ( + PropagateModeAddToList = 0 + PropagateModeDeleteFromList = 1 +) + +const ( + DeviceUseIsXPointer = 0 + DeviceUseIsXKeyboard = 1 + DeviceUseIsXExtensionDevice = 2 + DeviceUseIsXExtensionKeyboard = 3 + DeviceUseIsXExtensionPointer = 4 +) + +const ( + InputClassKey = 0 + InputClassButton = 1 + InputClassValuator = 2 + InputClassFeedback = 3 + InputClassProximity = 4 + InputClassFocus = 5 + InputClassOther = 6 +) + +const ( + DeviceInputModeAsyncThisDevice = 0 + DeviceInputModeSyncThisDevice = 1 + DeviceInputModeReplayThisDevice = 2 + DeviceInputModeAsyncOtherDevices = 3 + DeviceInputModeAsyncAll = 4 + DeviceInputModeSyncAll = 5 +) + +const ( + FeedbackClassKeyboard = 0 + FeedbackClassPointer = 1 + FeedbackClassString = 2 + FeedbackClassInteger = 3 + FeedbackClassLed = 4 + FeedbackClassBell = 5 +) + +type KeyCode byte + +type EventClass uint32 + +// 'DeviceInfo' struct definition +// Size: 8 +type DeviceInfo struct { + DeviceType xproto.Atom + DeviceId byte + NumClassInfo byte + DeviceUse byte + // padding: 1 bytes +} + +// Struct read DeviceInfo +func DeviceInfoRead(buf []byte, v *DeviceInfo) int { + b := 0 + + v.DeviceType = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.DeviceId = buf[b] + b += 1 + + v.NumClassInfo = buf[b] + b += 1 + + v.DeviceUse = buf[b] + b += 1 + + b += 1 // padding + + return b +} + +// Struct list read DeviceInfo +func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceInfo{} + b += DeviceInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceInfo +func (v DeviceInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.DeviceType)) + b += 4 + + buf[b] = v.DeviceId + b += 1 + + buf[b] = v.NumClassInfo + b += 1 + + buf[b] = v.DeviceUse + b += 1 + + b += 1 // padding + + return buf +} + +// Write struct list DeviceInfo +func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'InputInfo' struct definition +// Size: 2 +type InputInfo struct { + ClassId byte + Len byte +} + +// Struct read InputInfo +func InputInfoRead(buf []byte, v *InputInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + return b +} + +// Struct list read InputInfo +func InputInfoReadList(buf []byte, dest []InputInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputInfo{} + b += InputInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write InputInfo +func (v InputInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + return buf +} + +// Write struct list InputInfo +func InputInfoListBytes(buf []byte, list []InputInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'KeyInfo' struct definition +// Size: 8 +type KeyInfo struct { + ClassId byte + Len byte + MinKeycode KeyCode + MaxKeycode KeyCode + NumKeys uint16 + // padding: 2 bytes +} + +// Struct read KeyInfo +func KeyInfoRead(buf []byte, v *KeyInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.MinKeycode = KeyCode(buf[b]) + b += 1 + + v.MaxKeycode = KeyCode(buf[b]) + b += 1 + + v.NumKeys = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return b +} + +// Struct list read KeyInfo +func KeyInfoReadList(buf []byte, dest []KeyInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KeyInfo{} + b += KeyInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write KeyInfo +func (v KeyInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = byte(v.MinKeycode) + b += 1 + + buf[b] = byte(v.MaxKeycode) + b += 1 + + xgb.Put16(buf[b:], v.NumKeys) + b += 2 + + b += 2 // padding + + return buf +} + +// Write struct list KeyInfo +func KeyInfoListBytes(buf []byte, list []KeyInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'ButtonInfo' struct definition +// Size: 4 +type ButtonInfo struct { + ClassId byte + Len byte + NumButtons uint16 +} + +// Struct read ButtonInfo +func ButtonInfoRead(buf []byte, v *ButtonInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumButtons = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read ButtonInfo +func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ButtonInfo{} + b += ButtonInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ButtonInfo +func (v ButtonInfo) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + xgb.Put16(buf[b:], v.NumButtons) + b += 2 + + return buf +} + +// Write struct list ButtonInfo +func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'AxisInfo' struct definition +// Size: 12 +type AxisInfo struct { + Resolution uint32 + Minimum int32 + Maximum int32 +} + +// Struct read AxisInfo +func AxisInfoRead(buf []byte, v *AxisInfo) int { + b := 0 + + v.Resolution = xgb.Get32(buf[b:]) + b += 4 + + v.Minimum = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Maximum = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read AxisInfo +func AxisInfoReadList(buf []byte, dest []AxisInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = AxisInfo{} + b += AxisInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write AxisInfo +func (v AxisInfo) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put32(buf[b:], v.Resolution) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Minimum)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Maximum)) + b += 4 + + return buf +} + +// Write struct list AxisInfo +func AxisInfoListBytes(buf []byte, list []AxisInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'ValuatorInfo' struct definition +// Size: (8 + xgb.Pad((int(AxesLen) * 12))) +type ValuatorInfo struct { + ClassId byte + Len byte + AxesLen byte + Mode byte + MotionSize uint32 + Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) +} + +// Struct read ValuatorInfo +func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.AxesLen = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.MotionSize = xgb.Get32(buf[b:]) + b += 4 + + v.Axes = make([]AxisInfo, v.AxesLen) + b += AxisInfoReadList(buf[b:], v.Axes) + + return b +} + +// Struct list read ValuatorInfo +func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ValuatorInfo{} + b += ValuatorInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ValuatorInfo +func (v ValuatorInfo) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.AxesLen + b += 1 + + buf[b] = v.Mode + b += 1 + + xgb.Put32(buf[b:], v.MotionSize) + b += 4 + + b += AxisInfoListBytes(buf[b:], v.Axes) + + return buf +} + +// Write struct list ValuatorInfo +func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ValuatorInfo +func ValuatorInfoListSize(list []ValuatorInfo) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.AxesLen) * 12))) + } + return size +} + +// 'InputClassInfo' struct definition +// Size: 2 +type InputClassInfo struct { + ClassId byte + EventTypeBase byte +} + +// Struct read InputClassInfo +func InputClassInfoRead(buf []byte, v *InputClassInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.EventTypeBase = buf[b] + b += 1 + + return b +} + +// Struct list read InputClassInfo +func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputClassInfo{} + b += InputClassInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write InputClassInfo +func (v InputClassInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.EventTypeBase + b += 1 + + return buf +} + +// Write struct list InputClassInfo +func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceTimeCoord' struct definition +// Size: 4 +type DeviceTimeCoord struct { + Time xproto.Timestamp +} + +// Struct read DeviceTimeCoord +func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { + b := 0 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read DeviceTimeCoord +func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceTimeCoord{} + b += DeviceTimeCoordRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceTimeCoord +func (v DeviceTimeCoord) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + return buf +} + +// Write struct list DeviceTimeCoord +func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'FeedbackState' struct definition +// Size: 4 +type FeedbackState struct { + ClassId byte + Id byte + Len uint16 +} + +// Struct read FeedbackState +func FeedbackStateRead(buf []byte, v *FeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read FeedbackState +func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = FeedbackState{} + b += FeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write FeedbackState +func (v FeedbackState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list FeedbackState +func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'KbdFeedbackState' struct definition +// Size: 52 +type KbdFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Pitch uint16 + Duration uint16 + LedMask uint32 + LedValues uint32 + GlobalAutoRepeat bool + Click byte + Percent byte + // padding: 1 bytes + AutoRepeats []byte // size: 32 +} + +// Struct read KbdFeedbackState +func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Pitch = xgb.Get16(buf[b:]) + b += 2 + + v.Duration = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.GlobalAutoRepeat = true + } else { + v.GlobalAutoRepeat = false + } + b += 1 + + v.Click = buf[b] + b += 1 + + v.Percent = buf[b] + b += 1 + + b += 1 // padding + + v.AutoRepeats = make([]byte, 32) + copy(v.AutoRepeats[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return b +} + +// Struct list read KbdFeedbackState +func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KbdFeedbackState{} + b += KbdFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write KbdFeedbackState +func (v KbdFeedbackState) Bytes() []byte { + buf := make([]byte, 52) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put16(buf[b:], v.Pitch) + b += 2 + + xgb.Put16(buf[b:], v.Duration) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + if v.GlobalAutoRepeat { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.Click + b += 1 + + buf[b] = v.Percent + b += 1 + + b += 1 // padding + + copy(buf[b:], v.AutoRepeats[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// Write struct list KbdFeedbackState +func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size KbdFeedbackState +func KbdFeedbackStateListSize(list []KbdFeedbackState) int { + size := 0 + for _ = range list { + size += 52 + } + return size +} + +// 'PtrFeedbackState' struct definition +// Size: 12 +type PtrFeedbackState struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + AccelNum uint16 + AccelDenom uint16 + Threshold uint16 +} + +// Struct read PtrFeedbackState +func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.AccelNum = xgb.Get16(buf[b:]) + b += 2 + + v.AccelDenom = xgb.Get16(buf[b:]) + b += 2 + + v.Threshold = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read PtrFeedbackState +func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = PtrFeedbackState{} + b += PtrFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write PtrFeedbackState +func (v PtrFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], v.AccelNum) + b += 2 + + xgb.Put16(buf[b:], v.AccelDenom) + b += 2 + + xgb.Put16(buf[b:], v.Threshold) + b += 2 + + return buf +} + +// Write struct list PtrFeedbackState +func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'IntegerFeedbackState' struct definition +// Size: 16 +type IntegerFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Resolution uint32 + MinValue int32 + MaxValue int32 +} + +// Struct read IntegerFeedbackState +func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Resolution = xgb.Get32(buf[b:]) + b += 4 + + v.MinValue = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxValue = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read IntegerFeedbackState +func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = IntegerFeedbackState{} + b += IntegerFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write IntegerFeedbackState +func (v IntegerFeedbackState) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.Resolution) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MinValue)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxValue)) + b += 4 + + return buf +} + +// Write struct list IntegerFeedbackState +func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'StringFeedbackState' struct definition +// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) +type StringFeedbackState struct { + ClassId byte + Id byte + Len uint16 + MaxSymbols uint16 + NumKeysyms uint16 + Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) +} + +// Struct read StringFeedbackState +func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.MaxSymbols = xgb.Get16(buf[b:]) + b += 2 + + v.NumKeysyms = xgb.Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read StringFeedbackState +func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = StringFeedbackState{} + b += StringFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write StringFeedbackState +func (v StringFeedbackState) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put16(buf[b:], v.MaxSymbols) + b += 2 + + xgb.Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + xgb.Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list StringFeedbackState +func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size StringFeedbackState +func StringFeedbackStateListSize(list []StringFeedbackState) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) + } + return size +} + +// 'BellFeedbackState' struct definition +// Size: 12 +type BellFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Percent byte + // padding: 3 bytes + Pitch uint16 + Duration uint16 +} + +// Struct read BellFeedbackState +func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Percent = buf[b] + b += 1 + + b += 3 // padding + + v.Pitch = xgb.Get16(buf[b:]) + b += 2 + + v.Duration = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read BellFeedbackState +func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = BellFeedbackState{} + b += BellFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write BellFeedbackState +func (v BellFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Percent + b += 1 + + b += 3 // padding + + xgb.Put16(buf[b:], v.Pitch) + b += 2 + + xgb.Put16(buf[b:], v.Duration) + b += 2 + + return buf +} + +// Write struct list BellFeedbackState +func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'LedFeedbackState' struct definition +// Size: 12 +type LedFeedbackState struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// Struct read LedFeedbackState +func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read LedFeedbackState +func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = LedFeedbackState{} + b += LedFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write LedFeedbackState +func (v LedFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list LedFeedbackState +func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'FeedbackCtl' struct definition +// Size: 4 +type FeedbackCtl struct { + ClassId byte + Id byte + Len uint16 +} + +// Struct read FeedbackCtl +func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read FeedbackCtl +func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = FeedbackCtl{} + b += FeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write FeedbackCtl +func (v FeedbackCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list FeedbackCtl +func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'KbdFeedbackCtl' struct definition +// Size: 20 +type KbdFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + Key KeyCode + AutoRepeatMode byte + KeyClickPercent int8 + BellPercent int8 + BellPitch int16 + BellDuration int16 + LedMask uint32 + LedValues uint32 +} + +// Struct read KbdFeedbackCtl +func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Key = KeyCode(buf[b]) + b += 1 + + v.AutoRepeatMode = buf[b] + b += 1 + + v.KeyClickPercent = int8(buf[b]) + b += 1 + + v.BellPercent = int8(buf[b]) + b += 1 + + v.BellPitch = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BellDuration = int16(xgb.Get16(buf[b:])) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read KbdFeedbackCtl +func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KbdFeedbackCtl{} + b += KbdFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write KbdFeedbackCtl +func (v KbdFeedbackCtl) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = byte(v.Key) + b += 1 + + buf[b] = v.AutoRepeatMode + b += 1 + + buf[b] = byte(v.KeyClickPercent) + b += 1 + + buf[b] = byte(v.BellPercent) + b += 1 + + xgb.Put16(buf[b:], uint16(v.BellPitch)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.BellDuration)) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list KbdFeedbackCtl +func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'PtrFeedbackCtl' struct definition +// Size: 12 +type PtrFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + Num int16 + Denom int16 + Threshold int16 +} + +// Struct read PtrFeedbackCtl +func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Num = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Denom = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Threshold = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read PtrFeedbackCtl +func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = PtrFeedbackCtl{} + b += PtrFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write PtrFeedbackCtl +func (v PtrFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], uint16(v.Num)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Denom)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Threshold)) + b += 2 + + return buf +} + +// Write struct list PtrFeedbackCtl +func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'IntegerFeedbackCtl' struct definition +// Size: 8 +type IntegerFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + IntToDisplay int32 +} + +// Struct read IntegerFeedbackCtl +func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.IntToDisplay = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read IntegerFeedbackCtl +func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = IntegerFeedbackCtl{} + b += IntegerFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write IntegerFeedbackCtl +func (v IntegerFeedbackCtl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], uint32(v.IntToDisplay)) + b += 4 + + return buf +} + +// Write struct list IntegerFeedbackCtl +func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'StringFeedbackCtl' struct definition +// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) +type StringFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + NumKeysyms uint16 + Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) +} + +// Struct read StringFeedbackCtl +func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.NumKeysyms = xgb.Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read StringFeedbackCtl +func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = StringFeedbackCtl{} + b += StringFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write StringFeedbackCtl +func (v StringFeedbackCtl) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + xgb.Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list StringFeedbackCtl +func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size StringFeedbackCtl +func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) + } + return size +} + +// 'BellFeedbackCtl' struct definition +// Size: 12 +type BellFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + Percent int8 + // padding: 3 bytes + Pitch int16 + Duration int16 +} + +// Struct read BellFeedbackCtl +func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Percent = int8(buf[b]) + b += 1 + + b += 3 // padding + + v.Pitch = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Duration = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// Struct list read BellFeedbackCtl +func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = BellFeedbackCtl{} + b += BellFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write BellFeedbackCtl +func (v BellFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = byte(v.Percent) + b += 1 + + b += 3 // padding + + xgb.Put16(buf[b:], uint16(v.Pitch)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Duration)) + b += 2 + + return buf +} + +// Write struct list BellFeedbackCtl +func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'LedFeedbackCtl' struct definition +// Size: 12 +type LedFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// Struct read LedFeedbackCtl +func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read LedFeedbackCtl +func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = LedFeedbackCtl{} + b += LedFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write LedFeedbackCtl +func (v LedFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// Write struct list LedFeedbackCtl +func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'InputState' struct definition +// Size: 3 +type InputState struct { + ClassId byte + Len byte + NumItems byte +} + +// Struct read InputState +func InputStateRead(buf []byte, v *InputState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumItems = buf[b] + b += 1 + + return b +} + +// Struct list read InputState +func InputStateReadList(buf []byte, dest []InputState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputState{} + b += InputStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write InputState +func (v InputState) Bytes() []byte { + buf := make([]byte, 3) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumItems + b += 1 + + return buf +} + +// Write struct list InputState +func InputStateListBytes(buf []byte, list []InputState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'KeyState' struct definition +// Size: 36 +type KeyState struct { + ClassId byte + Len byte + NumKeys byte + // padding: 1 bytes + Keys []byte // size: 32 +} + +// Struct read KeyState +func KeyStateRead(buf []byte, v *KeyState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumKeys = buf[b] + b += 1 + + b += 1 // padding + + v.Keys = make([]byte, 32) + copy(v.Keys[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return b +} + +// Struct list read KeyState +func KeyStateReadList(buf []byte, dest []KeyState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KeyState{} + b += KeyStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write KeyState +func (v KeyState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumKeys + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Keys[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// Write struct list KeyState +func KeyStateListBytes(buf []byte, list []KeyState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size KeyState +func KeyStateListSize(list []KeyState) int { + size := 0 + for _ = range list { + size += 36 + } + return size +} + +// 'ButtonState' struct definition +// Size: 36 +type ButtonState struct { + ClassId byte + Len byte + NumButtons byte + // padding: 1 bytes + Buttons []byte // size: 32 +} + +// Struct read ButtonState +func ButtonStateRead(buf []byte, v *ButtonState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumButtons = buf[b] + b += 1 + + b += 1 // padding + + v.Buttons = make([]byte, 32) + copy(v.Buttons[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return b +} + +// Struct list read ButtonState +func ButtonStateReadList(buf []byte, dest []ButtonState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ButtonState{} + b += ButtonStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ButtonState +func (v ButtonState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumButtons + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Buttons[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// Write struct list ButtonState +func ButtonStateListBytes(buf []byte, list []ButtonState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ButtonState +func ButtonStateListSize(list []ButtonState) int { + size := 0 + for _ = range list { + size += 36 + } + return size +} + +// 'ValuatorState' struct definition +// Size: (4 + xgb.Pad((int(NumValuators) * 4))) +type ValuatorState struct { + ClassId byte + Len byte + NumValuators byte + Mode byte + Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// Struct read ValuatorState +func ValuatorStateRead(buf []byte, v *ValuatorState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.Valuators = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.Valuators[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read ValuatorState +func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ValuatorState{} + b += ValuatorStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ValuatorState +func (v ValuatorState) Bytes() []byte { + buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.Mode + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.Valuators[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list ValuatorState +func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ValuatorState +func ValuatorStateListSize(list []ValuatorState) int { + size := 0 + for _, item := range list { + size += (4 + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'DeviceState' struct definition +// Size: 4 +type DeviceState struct { + ControlId uint16 + Len uint16 +} + +// Struct read DeviceState +func DeviceStateRead(buf []byte, v *DeviceState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read DeviceState +func DeviceStateReadList(buf []byte, dest []DeviceState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceState{} + b += DeviceStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceState +func (v DeviceState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list DeviceState +func DeviceStateListBytes(buf []byte, list []DeviceState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceResolutionState' struct definition +// Size: (((8 + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) +type DeviceResolutionState struct { + ControlId uint16 + Len uint16 + NumValuators uint32 + ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) + ResolutionMin []uint32 // size: xgb.Pad((int(NumValuators) * 4)) + ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// Struct read DeviceResolutionState +func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.NumValuators = xgb.Get32(buf[b:]) + b += 4 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.ResolutionMin = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMin[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.ResolutionMax = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMax[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read DeviceResolutionState +func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceResolutionState{} + b += DeviceResolutionStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceResolutionState +func (v DeviceResolutionState) Bytes() []byte { + buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.NumValuators) + b += 4 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = xgb.Pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionMin[i]) + b += 4 + } + b = xgb.Pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionMax[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list DeviceResolutionState +func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size DeviceResolutionState +func DeviceResolutionStateListSize(list []DeviceResolutionState) int { + size := 0 + for _, item := range list { + size += (((8 + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'DeviceAbsCalibState' struct definition +// Size: 36 +type DeviceAbsCalibState struct { + ControlId uint16 + Len uint16 + MinX int32 + MaxX int32 + MinY int32 + MaxY int32 + FlipX uint32 + FlipY uint32 + Rotation uint32 + ButtonThreshold uint32 +} + +// Struct read DeviceAbsCalibState +func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.MinX = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxX = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MinY = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxY = int32(xgb.Get32(buf[b:])) + b += 4 + + v.FlipX = xgb.Get32(buf[b:]) + b += 4 + + v.FlipY = xgb.Get32(buf[b:]) + b += 4 + + v.Rotation = xgb.Get32(buf[b:]) + b += 4 + + v.ButtonThreshold = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read DeviceAbsCalibState +func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceAbsCalibState{} + b += DeviceAbsCalibStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceAbsCalibState +func (v DeviceAbsCalibState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], uint32(v.MinX)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxX)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MinY)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxY)) + b += 4 + + xgb.Put32(buf[b:], v.FlipX) + b += 4 + + xgb.Put32(buf[b:], v.FlipY) + b += 4 + + xgb.Put32(buf[b:], v.Rotation) + b += 4 + + xgb.Put32(buf[b:], v.ButtonThreshold) + b += 4 + + return buf +} + +// Write struct list DeviceAbsCalibState +func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceAbsAreaState' struct definition +// Size: 28 +type DeviceAbsAreaState struct { + ControlId uint16 + Len uint16 + OffsetX uint32 + OffsetY uint32 + Width uint32 + Height uint32 + Screen uint32 + Following uint32 +} + +// Struct read DeviceAbsAreaState +func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.OffsetX = xgb.Get32(buf[b:]) + b += 4 + + v.OffsetY = xgb.Get32(buf[b:]) + b += 4 + + v.Width = xgb.Get32(buf[b:]) + b += 4 + + v.Height = xgb.Get32(buf[b:]) + b += 4 + + v.Screen = xgb.Get32(buf[b:]) + b += 4 + + v.Following = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read DeviceAbsAreaState +func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceAbsAreaState{} + b += DeviceAbsAreaStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceAbsAreaState +func (v DeviceAbsAreaState) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.OffsetX) + b += 4 + + xgb.Put32(buf[b:], v.OffsetY) + b += 4 + + xgb.Put32(buf[b:], v.Width) + b += 4 + + xgb.Put32(buf[b:], v.Height) + b += 4 + + xgb.Put32(buf[b:], v.Screen) + b += 4 + + xgb.Put32(buf[b:], v.Following) + b += 4 + + return buf +} + +// Write struct list DeviceAbsAreaState +func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceCoreState' struct definition +// Size: 8 +type DeviceCoreState struct { + ControlId uint16 + Len uint16 + Status byte + Iscore byte + // padding: 2 bytes +} + +// Struct read DeviceCoreState +func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Status = buf[b] + b += 1 + + v.Iscore = buf[b] + b += 1 + + b += 2 // padding + + return b +} + +// Struct list read DeviceCoreState +func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceCoreState{} + b += DeviceCoreStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceCoreState +func (v DeviceCoreState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Status + b += 1 + + buf[b] = v.Iscore + b += 1 + + b += 2 // padding + + return buf +} + +// Write struct list DeviceCoreState +func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceEnableState' struct definition +// Size: 8 +type DeviceEnableState struct { + ControlId uint16 + Len uint16 + Enable byte + // padding: 3 bytes +} + +// Struct read DeviceEnableState +func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Enable = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read DeviceEnableState +func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceEnableState{} + b += DeviceEnableStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceEnableState +func (v DeviceEnableState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Enable + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list DeviceEnableState +func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceCtl' struct definition +// Size: 4 +type DeviceCtl struct { + ControlId uint16 + Len uint16 +} + +// Struct read DeviceCtl +func DeviceCtlRead(buf []byte, v *DeviceCtl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// Struct list read DeviceCtl +func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceCtl{} + b += DeviceCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceCtl +func (v DeviceCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// Write struct list DeviceCtl +func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceResolutionCtl' struct definition +// Size: (6 + xgb.Pad((int(NumValuators) * 4))) +type DeviceResolutionCtl struct { + ControlId uint16 + Len uint16 + FirstValuator byte + NumValuators byte + ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// Struct read DeviceResolutionCtl +func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.FirstValuator = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read DeviceResolutionCtl +func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceResolutionCtl{} + b += DeviceResolutionCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceResolutionCtl +func (v DeviceResolutionCtl) Bytes() []byte { + buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.FirstValuator + b += 1 + + buf[b] = v.NumValuators + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list DeviceResolutionCtl +func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size DeviceResolutionCtl +func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { + size := 0 + for _, item := range list { + size += (6 + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +// 'DeviceAbsCalibCtl' struct definition +// Size: 36 +type DeviceAbsCalibCtl struct { + ControlId uint16 + Len uint16 + MinX int32 + MaxX int32 + MinY int32 + MaxY int32 + FlipX uint32 + FlipY uint32 + Rotation uint32 + ButtonThreshold uint32 +} + +// Struct read DeviceAbsCalibCtl +func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.MinX = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxX = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MinY = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxY = int32(xgb.Get32(buf[b:])) + b += 4 + + v.FlipX = xgb.Get32(buf[b:]) + b += 4 + + v.FlipY = xgb.Get32(buf[b:]) + b += 4 + + v.Rotation = xgb.Get32(buf[b:]) + b += 4 + + v.ButtonThreshold = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read DeviceAbsCalibCtl +func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceAbsCalibCtl{} + b += DeviceAbsCalibCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceAbsCalibCtl +func (v DeviceAbsCalibCtl) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], uint32(v.MinX)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxX)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MinY)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxY)) + b += 4 + + xgb.Put32(buf[b:], v.FlipX) + b += 4 + + xgb.Put32(buf[b:], v.FlipY) + b += 4 + + xgb.Put32(buf[b:], v.Rotation) + b += 4 + + xgb.Put32(buf[b:], v.ButtonThreshold) + b += 4 + + return buf +} + +// Write struct list DeviceAbsCalibCtl +func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceAbsAreaCtrl' struct definition +// Size: 28 +type DeviceAbsAreaCtrl struct { + ControlId uint16 + Len uint16 + OffsetX uint32 + OffsetY uint32 + Width int32 + Height int32 + Screen int32 + Following uint32 +} + +// Struct read DeviceAbsAreaCtrl +func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.OffsetX = xgb.Get32(buf[b:]) + b += 4 + + v.OffsetY = xgb.Get32(buf[b:]) + b += 4 + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Height = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Screen = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Following = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read DeviceAbsAreaCtrl +func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceAbsAreaCtrl{} + b += DeviceAbsAreaCtrlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceAbsAreaCtrl +func (v DeviceAbsAreaCtrl) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.OffsetX) + b += 4 + + xgb.Put32(buf[b:], v.OffsetY) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Width)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Height)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Screen)) + b += 4 + + xgb.Put32(buf[b:], v.Following) + b += 4 + + return buf +} + +// Write struct list DeviceAbsAreaCtrl +func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceCoreCtrl' struct definition +// Size: 8 +type DeviceCoreCtrl struct { + ControlId uint16 + Len uint16 + Status byte + // padding: 3 bytes +} + +// Struct read DeviceCoreCtrl +func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Status = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read DeviceCoreCtrl +func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceCoreCtrl{} + b += DeviceCoreCtrlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceCoreCtrl +func (v DeviceCoreCtrl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Status + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list DeviceCoreCtrl +func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'DeviceEnableCtrl' struct definition +// Size: 8 +type DeviceEnableCtrl struct { + ControlId uint16 + Len uint16 + Enable byte + // padding: 3 bytes +} + +// Struct read DeviceEnableCtrl +func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Enable = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read DeviceEnableCtrl +func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceEnableCtrl{} + b += DeviceEnableCtrlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write DeviceEnableCtrl +func (v DeviceEnableCtrl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Enable + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list DeviceEnableCtrl +func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Event definition DeviceValuator (0) +// Size: 32 + +const DeviceValuator = 0 + +type DeviceValuatorEvent struct { + Sequence uint16 + DeviceId byte + DeviceState uint16 + NumValuators byte + FirstValuator byte + Valuators []int32 // size: 24 +} + +// Event read DeviceValuator +func DeviceValuatorEventNew(buf []byte) xgb.Event { + v := DeviceValuatorEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.DeviceState = xgb.Get16(buf[b:]) + b += 2 + + v.NumValuators = buf[b] + b += 1 + + v.FirstValuator = buf[b] + b += 1 + + v.Valuators = make([]int32, 6) + for i := 0; i < int(6); i++ { + v.Valuators[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Event write DeviceValuator +func (v DeviceValuatorEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + xgb.Put16(buf[b:], v.DeviceState) + b += 2 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.FirstValuator + b += 1 + + for i := 0; i < int(6); i++ { + xgb.Put32(buf[b:], uint32(v.Valuators[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +func (v DeviceValuatorEvent) ImplementsEvent() {} + +func (v DeviceValuatorEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceValuatorEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceState: %d", v.DeviceState)) + fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstValuator: %d", v.FirstValuator)) + return "DeviceValuator {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew +} + +// Event definition DeviceKeyPress (1) +// Size: 32 + +const DeviceKeyPress = 1 + +type DeviceKeyPressEvent struct { + Sequence uint16 + Detail byte + Time xproto.Timestamp + Root xproto.Window + Event xproto.Window + Child xproto.Window + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + DeviceId byte +} + +// Event read DeviceKeyPress +func DeviceKeyPressEventNew(buf []byte) xgb.Event { + v := DeviceKeyPressEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Event = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Child = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.RootX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.RootY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.State = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + v.DeviceId = buf[b] + b += 1 + + return v +} + +// Event write DeviceKeyPress +func (v DeviceKeyPressEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Child)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.RootX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.RootY)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventY)) + b += 2 + + xgb.Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.DeviceId + b += 1 + + return buf +} + +func (v DeviceKeyPressEvent) ImplementsEvent() {} + +func (v DeviceKeyPressEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceKeyPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceKeyPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][1] = DeviceKeyPressEventNew +} + +// Event definition FocusIn (6) +// Size: 32 + +const FocusIn = 6 + +type FocusInEvent struct { + Sequence uint16 + Detail byte + Time xproto.Timestamp + Window xproto.Window + Mode byte + DeviceId byte + // padding: 18 bytes +} + +// Event read FocusIn +func FocusInEventNew(buf []byte) xgb.Event { + v := FocusInEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = buf[b] + b += 1 + + v.DeviceId = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +// Event write FocusIn +func (v FocusInEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 6 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.Mode + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 18 // padding + + return buf +} + +func (v FocusInEvent) ImplementsEvent() {} + +func (v FocusInEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v FocusInEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew +} + +// Event definition DeviceStateNotify (10) +// Size: 32 + +const DeviceStateNotify = 10 + +type DeviceStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Time xproto.Timestamp + NumKeys byte + NumButtons byte + NumValuators byte + ClassesReported byte + Buttons []byte // size: 4 + Keys []byte // size: 4 + Valuators []uint32 // size: 12 +} + +// Event read DeviceStateNotify +func DeviceStateNotifyEventNew(buf []byte) xgb.Event { + v := DeviceStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumKeys = buf[b] + b += 1 + + v.NumButtons = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.ClassesReported = buf[b] + b += 1 + + v.Buttons = make([]byte, 4) + copy(v.Buttons[:4], buf[b:]) + b += xgb.Pad(int(4)) + + v.Keys = make([]byte, 4) + copy(v.Keys[:4], buf[b:]) + b += xgb.Pad(int(4)) + + v.Valuators = make([]uint32, 3) + for i := 0; i < int(3); i++ { + v.Valuators[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Event write DeviceStateNotify +func (v DeviceStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 10 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.NumKeys + b += 1 + + buf[b] = v.NumButtons + b += 1 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.ClassesReported + b += 1 + + copy(buf[b:], v.Buttons[:4]) + b += xgb.Pad(int(4)) + + copy(buf[b:], v.Keys[:4]) + b += xgb.Pad(int(4)) + + for i := 0; i < int(3); i++ { + xgb.Put32(buf[b:], v.Valuators[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +func (v DeviceStateNotifyEvent) ImplementsEvent() {} + +func (v DeviceStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("NumKeys: %d", v.NumKeys)) + fieldVals = append(fieldVals, xgb.Sprintf("NumButtons: %d", v.NumButtons)) + fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) + fieldVals = append(fieldVals, xgb.Sprintf("ClassesReported: %d", v.ClassesReported)) + return "DeviceStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][10] = DeviceStateNotifyEventNew +} + +// Event definition DeviceMappingNotify (11) +// Size: 32 + +const DeviceMappingNotify = 11 + +type DeviceMappingNotifyEvent struct { + Sequence uint16 + DeviceId byte + Request byte + FirstKeycode KeyCode + Count byte + // padding: 1 bytes + Time xproto.Timestamp + // padding: 20 bytes +} + +// Event read DeviceMappingNotify +func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { + v := DeviceMappingNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Request = buf[b] + b += 1 + + v.FirstKeycode = KeyCode(buf[b]) + b += 1 + + v.Count = buf[b] + b += 1 + + b += 1 // padding + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Event write DeviceMappingNotify +func (v DeviceMappingNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 11 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + buf[b] = v.Request + b += 1 + + buf[b] = byte(v.FirstKeycode) + b += 1 + + buf[b] = v.Count + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + b += 20 // padding + + return buf +} + +func (v DeviceMappingNotifyEvent) ImplementsEvent() {} + +func (v DeviceMappingNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceMappingNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + return "DeviceMappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew +} + +// Event definition ChangeDeviceNotify (12) +// Size: 32 + +const ChangeDeviceNotify = 12 + +type ChangeDeviceNotifyEvent struct { + Sequence uint16 + DeviceId byte + Time xproto.Timestamp + Request byte + // padding: 23 bytes +} + +// Event read ChangeDeviceNotify +func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { + v := ChangeDeviceNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Request = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Event write ChangeDeviceNotify +func (v ChangeDeviceNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 12 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.Request + b += 1 + + b += 23 // padding + + return buf +} + +func (v ChangeDeviceNotifyEvent) ImplementsEvent() {} + +func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ChangeDeviceNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + return "ChangeDeviceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew +} + +// Event definition DeviceKeyStateNotify (13) +// Size: 32 + +const DeviceKeyStateNotify = 13 + +type DeviceKeyStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Keys []byte // size: 28 +} + +// Event read DeviceKeyStateNotify +func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { + v := DeviceKeyStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Keys = make([]byte, 28) + copy(v.Keys[:28], buf[b:]) + b += xgb.Pad(int(28)) + + return v +} + +// Event write DeviceKeyStateNotify +func (v DeviceKeyStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 13 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Keys[:28]) + b += xgb.Pad(int(28)) + + return buf +} + +func (v DeviceKeyStateNotifyEvent) ImplementsEvent() {} + +func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceKeyStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceKeyStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew +} + +// Event definition DeviceButtonStateNotify (14) +// Size: 32 + +const DeviceButtonStateNotify = 14 + +type DeviceButtonStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Buttons []byte // size: 28 +} + +// Event read DeviceButtonStateNotify +func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { + v := DeviceButtonStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Buttons = make([]byte, 28) + copy(v.Buttons[:28], buf[b:]) + b += xgb.Pad(int(28)) + + return v +} + +// Event write DeviceButtonStateNotify +func (v DeviceButtonStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 14 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Buttons[:28]) + b += xgb.Pad(int(28)) + + return buf +} + +func (v DeviceButtonStateNotifyEvent) ImplementsEvent() {} + +func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceButtonStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew +} + +// Event definition DevicePresenceNotify (15) +// Size: 32 + +const DevicePresenceNotify = 15 + +type DevicePresenceNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time xproto.Timestamp + Devchange byte + DeviceId byte + Control uint16 + // padding: 20 bytes +} + +// Event read DevicePresenceNotify +func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { + v := DevicePresenceNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Devchange = buf[b] + b += 1 + + v.DeviceId = buf[b] + b += 1 + + v.Control = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Event write DevicePresenceNotify +func (v DevicePresenceNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 15 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.Devchange + b += 1 + + buf[b] = v.DeviceId + b += 1 + + xgb.Put16(buf[b:], v.Control) + b += 2 + + b += 20 // padding + + return buf +} + +func (v DevicePresenceNotifyEvent) ImplementsEvent() {} + +func (v DevicePresenceNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DevicePresenceNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Devchange: %d", v.Devchange)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Control: %d", v.Control)) + return "DevicePresenceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew +} + +// EventCopy definition DeviceKeyRelease (2) + +const DeviceKeyRelease = 2 + +type DeviceKeyReleaseEvent DeviceKeyPressEvent + +func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { + return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v DeviceKeyReleaseEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v DeviceKeyReleaseEvent) ImplementsEvent() {} + +func (v DeviceKeyReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceKeyReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceKeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew +} + +// EventCopy definition DeviceButtonPress (3) + +const DeviceButtonPress = 3 + +type DeviceButtonPressEvent DeviceKeyPressEvent + +func DeviceButtonPressEventNew(buf []byte) xgb.Event { + return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v DeviceButtonPressEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v DeviceButtonPressEvent) ImplementsEvent() {} + +func (v DeviceButtonPressEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceButtonPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew +} + +// EventCopy definition DeviceButtonRelease (4) + +const DeviceButtonRelease = 4 + +type DeviceButtonReleaseEvent DeviceKeyPressEvent + +func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { + return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v DeviceButtonReleaseEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v DeviceButtonReleaseEvent) ImplementsEvent() {} + +func (v DeviceButtonReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceButtonReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew +} + +// EventCopy definition DeviceMotionNotify (5) + +const DeviceMotionNotify = 5 + +type DeviceMotionNotifyEvent DeviceKeyPressEvent + +func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { + return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v DeviceMotionNotifyEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v DeviceMotionNotifyEvent) ImplementsEvent() {} + +func (v DeviceMotionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceMotionNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceMotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew +} + +// EventCopy definition ProximityIn (8) + +const ProximityIn = 8 + +type ProximityInEvent DeviceKeyPressEvent + +func ProximityInEventNew(buf []byte) xgb.Event { + return ProximityInEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v ProximityInEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v ProximityInEvent) ImplementsEvent() {} + +func (v ProximityInEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ProximityInEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "ProximityIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][8] = ProximityInEventNew +} + +// EventCopy definition ProximityOut (9) + +const ProximityOut = 9 + +type ProximityOutEvent DeviceKeyPressEvent + +func ProximityOutEventNew(buf []byte) xgb.Event { + return ProximityOutEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +func (v ProximityOutEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +func (v ProximityOutEvent) ImplementsEvent() {} + +func (v ProximityOutEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ProximityOutEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "ProximityOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][9] = ProximityOutEventNew +} + +// EventCopy definition FocusOut (7) + +const FocusOut = 7 + +type FocusOutEvent FocusInEvent + +func FocusOutEventNew(buf []byte) xgb.Event { + return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) +} + +func (v FocusOutEvent) Bytes() []byte { + return FocusInEvent(v).Bytes() +} + +func (v FocusOutEvent) ImplementsEvent() {} + +func (v FocusOutEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v FocusOutEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew +} + +// Error definition Device (0) +// Size: 32 + +const BadDevice = 0 + +type DeviceError struct { + Sequence uint16 + NiceName string +} + +// Error read Device +func DeviceErrorNew(buf []byte) xgb.Error { + v := DeviceError{} + v.NiceName = "Device" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err DeviceError) ImplementsError() {} + +func (err DeviceError) SequenceId() uint16 { + return err.Sequence +} + +func (err DeviceError) BadId() uint32 { + return 0 +} + +func (err DeviceError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadDevice {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew +} + +// Error definition Event (1) +// Size: 32 + +const BadEvent = 1 + +type EventError struct { + Sequence uint16 + NiceName string +} + +// Error read Event +func EventErrorNew(buf []byte) xgb.Error { + v := EventError{} + v.NiceName = "Event" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err EventError) ImplementsError() {} + +func (err EventError) SequenceId() uint16 { + return err.Sequence +} + +func (err EventError) BadId() uint32 { + return 0 +} + +func (err EventError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadEvent {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew +} + +// Error definition Mode (2) +// Size: 32 + +const BadMode = 2 + +type ModeError struct { + Sequence uint16 + NiceName string +} + +// Error read Mode +func ModeErrorNew(buf []byte) xgb.Error { + v := ModeError{} + v.NiceName = "Mode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ModeError) ImplementsError() {} + +func (err ModeError) SequenceId() uint16 { + return err.Sequence +} + +func (err ModeError) BadId() uint32 { + return 0 +} + +func (err ModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew +} + +// Error definition DeviceBusy (3) +// Size: 32 + +const BadDeviceBusy = 3 + +type DeviceBusyError struct { + Sequence uint16 + NiceName string +} + +// Error read DeviceBusy +func DeviceBusyErrorNew(buf []byte) xgb.Error { + v := DeviceBusyError{} + v.NiceName = "DeviceBusy" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err DeviceBusyError) ImplementsError() {} + +func (err DeviceBusyError) SequenceId() uint16 { + return err.Sequence +} + +func (err DeviceBusyError) BadId() uint32 { + return 0 +} + +func (err DeviceBusyError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadDeviceBusy {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew +} + +// Error definition Class (4) +// Size: 32 + +const BadClass = 4 + +type ClassError struct { + Sequence uint16 + NiceName string +} + +// Error read Class +func ClassErrorNew(buf []byte) xgb.Error { + v := ClassError{} + v.NiceName = "Class" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err ClassError) ImplementsError() {} + +func (err ClassError) SequenceId() uint16 { + return err.Sequence +} + +func (err ClassError) BadId() uint32 { + return 0 +} + +func (err ClassError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadClass {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew +} + +// Request GetExtensionVersion +// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +type GetExtensionVersionCookie struct { + *xgb.Cookie +} + +func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) + return GetExtensionVersionCookie{cookie} +} + +func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) + return GetExtensionVersionCookie{cookie} +} + +// Request reply for GetExtensionVersion +// size: 32 +type GetExtensionVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 + Present bool + // padding: 19 bytes +} + +// Waits and reads reply data from request GetExtensionVersion +func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getExtensionVersionReply(buf), nil +} + +// Read reply into structure from buffer for GetExtensionVersion +func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { + v := new(GetExtensionVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Present = true + } else { + v.Present = false + } + b += 1 + + b += 19 // padding + + return v +} + +// Write request to wire for GetExtensionVersion +func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += xgb.Pad(int(NameLen)) + + return buf +} + +// Request ListInputDevices +// size: 4 +type ListInputDevicesCookie struct { + *xgb.Cookie +} + +func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listInputDevicesRequest(c), cookie) + return ListInputDevicesCookie{cookie} +} + +func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listInputDevicesRequest(c), cookie) + return ListInputDevicesCookie{cookie} +} + +// Request reply for ListInputDevices +// size: (32 + xgb.Pad((int(DevicesLen) * 8))) +type ListInputDevicesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + DevicesLen byte + // padding: 23 bytes + Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) +} + +// Waits and reads reply data from request ListInputDevices +func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listInputDevicesReply(buf), nil +} + +// Read reply into structure from buffer for ListInputDevices +func listInputDevicesReply(buf []byte) *ListInputDevicesReply { + v := new(ListInputDevicesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.DevicesLen = buf[b] + b += 1 + + b += 23 // padding + + v.Devices = make([]DeviceInfo, v.DevicesLen) + b += DeviceInfoReadList(buf[b:], v.Devices) + + return v +} + +// Write request to wire for ListInputDevices +func listInputDevicesRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request OpenDevice +// size: 8 +type OpenDeviceCookie struct { + *xgb.Cookie +} + +func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(openDeviceRequest(c, DeviceId), cookie) + return OpenDeviceCookie{cookie} +} + +func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(openDeviceRequest(c, DeviceId), cookie) + return OpenDeviceCookie{cookie} +} + +// Request reply for OpenDevice +// size: (32 + xgb.Pad((int(NumClasses) * 2))) +type OpenDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes + ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) +} + +// Waits and reads reply data from request OpenDevice +func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return openDeviceReply(buf), nil +} + +// Read reply into structure from buffer for OpenDevice +func openDeviceReply(buf []byte) *OpenDeviceReply { + v := new(OpenDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = buf[b] + b += 1 + + b += 23 // padding + + v.ClassInfo = make([]InputClassInfo, v.NumClasses) + b += InputClassInfoReadList(buf[b:], v.ClassInfo) + + return v +} + +// Write request to wire for OpenDevice +func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request CloseDevice +// size: 8 +type CloseDeviceCookie struct { + *xgb.Cookie +} + +// Write request to wire for CloseDevice +func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) + return CloseDeviceCookie{cookie} +} + +func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) + return CloseDeviceCookie{cookie} +} + +func (cook CloseDeviceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CloseDevice +func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request SetDeviceMode +// size: 8 +type SetDeviceModeCookie struct { + *xgb.Cookie +} + +func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) + return SetDeviceModeCookie{cookie} +} + +func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) + return SetDeviceModeCookie{cookie} +} + +// Request reply for SetDeviceMode +// size: 32 +type SetDeviceModeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request SetDeviceMode +func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setDeviceModeReply(buf), nil +} + +// Read reply into structure from buffer for SetDeviceMode +func setDeviceModeReply(buf []byte) *SetDeviceModeReply { + v := new(SetDeviceModeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for SetDeviceMode +func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + return buf +} + +// Request SelectExtensionEvent +// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +type SelectExtensionEventCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectExtensionEvent +func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) + return SelectExtensionEventCookie{cookie} +} + +func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) + return SelectExtensionEventCookie{cookie} +} + +func (cook SelectExtensionEventCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectExtensionEvent +func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetSelectedExtensionEvents +// size: 8 +type GetSelectedExtensionEventsCookie struct { + *xgb.Cookie +} + +func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) + return GetSelectedExtensionEventsCookie{cookie} +} + +func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) + return GetSelectedExtensionEventsCookie{cookie} +} + +// Request reply for GetSelectedExtensionEvents +// size: ((32 + xgb.Pad((int(NumThisClasses) * 4))) + xgb.Pad((int(NumAllClasses) * 4))) +type GetSelectedExtensionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumThisClasses uint16 + NumAllClasses uint16 + // padding: 20 bytes + ThisClasses []EventClass // size: xgb.Pad((int(NumThisClasses) * 4)) + AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) +} + +// Waits and reads reply data from request GetSelectedExtensionEvents +func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectedExtensionEventsReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectedExtensionEvents +func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { + v := new(GetSelectedExtensionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumThisClasses = xgb.Get16(buf[b:]) + b += 2 + + v.NumAllClasses = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + v.ThisClasses = make([]EventClass, v.NumThisClasses) + for i := 0; i < int(v.NumThisClasses); i++ { + v.ThisClasses[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.AllClasses = make([]EventClass, v.NumAllClasses) + for i := 0; i < int(v.NumAllClasses); i++ { + v.AllClasses[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetSelectedExtensionEvents +func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request ChangeDeviceDontPropagateList +// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +type ChangeDeviceDontPropagateListCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeDeviceDontPropagateList +func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) + return ChangeDeviceDontPropagateListCookie{cookie} +} + +func ChangeDeviceDontPropagateListChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) + return ChangeDeviceDontPropagateListCookie{cookie} +} + +func (cook ChangeDeviceDontPropagateListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeDeviceDontPropagateList +func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = Mode + b += 1 + + b += 1 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetDeviceDontPropagateList +// size: 8 +type GetDeviceDontPropagateListCookie struct { + *xgb.Cookie +} + +func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) + return GetDeviceDontPropagateListCookie{cookie} +} + +func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) + return GetDeviceDontPropagateListCookie{cookie} +} + +// Request reply for GetDeviceDontPropagateList +// size: (32 + xgb.Pad((int(NumClasses) * 4))) +type GetDeviceDontPropagateListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses uint16 + // padding: 22 bytes + Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) +} + +// Waits and reads reply data from request GetDeviceDontPropagateList +func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceDontPropagateListReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceDontPropagateList +func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { + v := new(GetDeviceDontPropagateListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Classes = make([]EventClass, v.NumClasses) + for i := 0; i < int(v.NumClasses); i++ { + v.Classes[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDeviceDontPropagateList +func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request GetDeviceMotionEvents +// size: 16 +type GetDeviceMotionEventsCookie struct { + *xgb.Cookie +} + +func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) + return GetDeviceMotionEventsCookie{cookie} +} + +func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) + return GetDeviceMotionEventsCookie{cookie} +} + +// Request reply for GetDeviceMotionEvents +// size: 32 +type GetDeviceMotionEventsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumCoords uint32 + NumAxes byte + DeviceMode byte + // padding: 18 bytes +} + +// Waits and reads reply data from request GetDeviceMotionEvents +func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceMotionEventsReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceMotionEvents +func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { + v := new(GetDeviceMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumCoords = xgb.Get32(buf[b:]) + b += 4 + + v.NumAxes = buf[b] + b += 1 + + v.DeviceMode = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +// Write request to wire for GetDeviceMotionEvents +func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Start)) + b += 4 + + xgb.Put32(buf[b:], uint32(Stop)) + b += 4 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request ChangeKeyboardDevice +// size: 8 +type ChangeKeyboardDeviceCookie struct { + *xgb.Cookie +} + +func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) + return ChangeKeyboardDeviceCookie{cookie} +} + +func ChangeKeyboardDeviceUnchecked(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) + return ChangeKeyboardDeviceCookie{cookie} +} + +// Request reply for ChangeKeyboardDevice +// size: 32 +type ChangeKeyboardDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request ChangeKeyboardDevice +func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return changeKeyboardDeviceReply(buf), nil +} + +// Read reply into structure from buffer for ChangeKeyboardDevice +func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { + v := new(ChangeKeyboardDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for ChangeKeyboardDevice +func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request ChangePointerDevice +// size: 8 +type ChangePointerDeviceCookie struct { + *xgb.Cookie +} + +func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) + return ChangePointerDeviceCookie{cookie} +} + +func ChangePointerDeviceUnchecked(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) + return ChangePointerDeviceCookie{cookie} +} + +// Request reply for ChangePointerDevice +// size: 32 +type ChangePointerDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request ChangePointerDevice +func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return changePointerDeviceReply(buf), nil +} + +// Read reply into structure from buffer for ChangePointerDevice +func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { + v := new(ChangePointerDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for ChangePointerDevice +func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = XAxis + b += 1 + + buf[b] = YAxis + b += 1 + + buf[b] = DeviceId + b += 1 + + b += 1 // padding + + return buf +} + +// Request GrabDevice +// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +type GrabDeviceCookie struct { + *xgb.Cookie +} + +func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) + return GrabDeviceCookie{cookie} +} + +func GrabDeviceUnchecked(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) + return GrabDeviceCookie{cookie} +} + +// Request reply for GrabDevice +// size: 32 +type GrabDeviceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request GrabDevice +func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return grabDeviceReply(buf), nil +} + +// Read reply into structure from buffer for GrabDevice +func grabDeviceReply(buf []byte) *GrabDeviceReply { + v := new(GrabDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for GrabDevice +func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) []byte { + size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = DeviceId + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request UngrabDevice +// size: 12 +type UngrabDeviceCookie struct { + *xgb.Cookie +} + +// Write request to wire for UngrabDevice +func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) + return UngrabDeviceCookie{cookie} +} + +func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) + return UngrabDeviceCookie{cookie} +} + +func (cook UngrabDeviceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabDevice +func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request GrabDeviceKey +// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +type GrabDeviceKeyCookie struct { + *xgb.Cookie +} + +// Write request to wire for GrabDeviceKey +func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) + return GrabDeviceKeyCookie{cookie} +} + +func GrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) + return GrabDeviceKeyCookie{cookie} +} + +func (cook GrabDeviceKeyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for GrabDeviceKey +func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) []byte { + size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + buf[b] = Key + b += 1 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request UngrabDeviceKey +// size: 16 +type UngrabDeviceKeyCookie struct { + *xgb.Cookie +} + +// Write request to wire for UngrabDeviceKey +func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return UngrabDeviceKeyCookie{cookie} +} + +func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return UngrabDeviceKeyCookie{cookie} +} + +func (cook UngrabDeviceKeyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabDeviceKey +func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Key + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + return buf +} + +// Request GrabDeviceButton +// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +type GrabDeviceButtonCookie struct { + *xgb.Cookie +} + +// Write request to wire for GrabDeviceButton +func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return GrabDeviceButtonCookie{cookie} +} + +func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return GrabDeviceButtonCookie{cookie} +} + +func (cook GrabDeviceButtonCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for GrabDeviceButton +func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { + size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + buf[b] = GrabbedDevice + b += 1 + + buf[b] = ModifierDevice + b += 1 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = OwnerEvents + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request UngrabDeviceButton +// size: 16 +type UngrabDeviceButtonCookie struct { + *xgb.Cookie +} + +// Write request to wire for UngrabDeviceButton +func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return UngrabDeviceButtonCookie{cookie} +} + +func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return UngrabDeviceButtonCookie{cookie} +} + +func (cook UngrabDeviceButtonCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabDeviceButton +func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + return buf +} + +// Request AllowDeviceEvents +// size: 12 +type AllowDeviceEventsCookie struct { + *xgb.Cookie +} + +// Write request to wire for AllowDeviceEvents +func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) + return AllowDeviceEventsCookie{cookie} +} + +func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) + return AllowDeviceEventsCookie{cookie} +} + +func (cook AllowDeviceEventsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AllowDeviceEvents +func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = Mode + b += 1 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request GetDeviceFocus +// size: 8 +type GetDeviceFocusCookie struct { + *xgb.Cookie +} + +func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) + return GetDeviceFocusCookie{cookie} +} + +func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) + return GetDeviceFocusCookie{cookie} +} + +// Request reply for GetDeviceFocus +// size: 32 +type GetDeviceFocusReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Focus xproto.Window + Time xproto.Timestamp + RevertTo byte + // padding: 15 bytes +} + +// Waits and reads reply data from request GetDeviceFocus +func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceFocusReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceFocus +func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { + v := new(GetDeviceFocusReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Focus = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.RevertTo = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +// Write request to wire for GetDeviceFocus +func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request SetDeviceFocus +// size: 16 +type SetDeviceFocusCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetDeviceFocus +func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) + return SetDeviceFocusCookie{cookie} +} + +func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) + return SetDeviceFocusCookie{cookie} +} + +func (cook SetDeviceFocusCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceFocus +func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Focus)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = RevertTo + b += 1 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// Request GetFeedbackControl +// size: 8 +type GetFeedbackControlCookie struct { + *xgb.Cookie +} + +func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) + return GetFeedbackControlCookie{cookie} +} + +func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) + return GetFeedbackControlCookie{cookie} +} + +// Request reply for GetFeedbackControl +// size: 32 +type GetFeedbackControlReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFeedback uint16 + // padding: 22 bytes +} + +// Waits and reads reply data from request GetFeedbackControl +func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFeedbackControlReply(buf), nil +} + +// Read reply into structure from buffer for GetFeedbackControl +func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { + v := new(GetFeedbackControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFeedback = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +// Write request to wire for GetFeedbackControl +func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request GetDeviceKeyMapping +// size: 8 +type GetDeviceKeyMappingCookie struct { + *xgb.Cookie +} + +func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) + return GetDeviceKeyMappingCookie{cookie} +} + +func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) + return GetDeviceKeyMappingCookie{cookie} +} + +// Request reply for GetDeviceKeyMapping +// size: (32 + xgb.Pad((int(Length) * 4))) +type GetDeviceKeyMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + KeysymsPerKeycode byte + // padding: 23 bytes + Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request GetDeviceKeyMapping +func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceKeyMappingReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceKeyMapping +func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { + v := new(GetDeviceKeyMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeysymsPerKeycode = buf[b] + b += 1 + + b += 23 // padding + + v.Keysyms = make([]xproto.Keysym, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDeviceKeyMapping +func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return buf +} + +// Request ChangeDeviceKeyMapping +// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +type ChangeDeviceKeyMappingCookie struct { + *xgb.Cookie +} + +// Write request to wire for ChangeDeviceKeyMapping +func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return ChangeDeviceKeyMappingCookie{cookie} +} + +func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return ChangeDeviceKeyMappingCookie{cookie} +} + +func (cook ChangeDeviceKeyMappingCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeDeviceKeyMapping +func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { + size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = KeysymsPerKeycode + b += 1 + + buf[b] = KeycodeCount + b += 1 + + for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { + xgb.Put32(buf[b:], uint32(Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetDeviceModifierMapping +// size: 8 +type GetDeviceModifierMappingCookie struct { + *xgb.Cookie +} + +func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) + return GetDeviceModifierMappingCookie{cookie} +} + +func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) + return GetDeviceModifierMappingCookie{cookie} +} + +// Request reply for GetDeviceModifierMapping +// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) +type GetDeviceModifierMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + KeycodesPerModifier byte + // padding: 23 bytes + Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) +} + +// Waits and reads reply data from request GetDeviceModifierMapping +func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceModifierMappingReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceModifierMapping +func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { + v := new(GetDeviceModifierMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeycodesPerModifier = buf[b] + b += 1 + + b += 23 // padding + + v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) + copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) + b += xgb.Pad(int((int(v.KeycodesPerModifier) * 8))) + + return v +} + +// Write request to wire for GetDeviceModifierMapping +func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request SetDeviceModifierMapping +// size: xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) +type SetDeviceModifierMappingCookie struct { + *xgb.Cookie +} + +func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) + return SetDeviceModifierMappingCookie{cookie} +} + +func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) + return SetDeviceModifierMappingCookie{cookie} +} + +// Request reply for SetDeviceModifierMapping +// size: 32 +type SetDeviceModifierMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request SetDeviceModifierMapping +func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setDeviceModifierMappingReply(buf), nil +} + +// Read reply into structure from buffer for SetDeviceModifierMapping +func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { + v := new(SetDeviceModifierMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for SetDeviceModifierMapping +func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { + size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = KeycodesPerModifier + b += 1 + + b += 1 // padding + + copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) + b += xgb.Pad(int((int(KeycodesPerModifier) * 8))) + + return buf +} + +// Request GetDeviceButtonMapping +// size: 8 +type GetDeviceButtonMappingCookie struct { + *xgb.Cookie +} + +func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) + return GetDeviceButtonMappingCookie{cookie} +} + +func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) + return GetDeviceButtonMappingCookie{cookie} +} + +// Request reply for GetDeviceButtonMapping +// size: (32 + xgb.Pad((int(MapSize) * 1))) +type GetDeviceButtonMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MapSize byte + // padding: 23 bytes + Map []byte // size: xgb.Pad((int(MapSize) * 1)) +} + +// Waits and reads reply data from request GetDeviceButtonMapping +func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceButtonMappingReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceButtonMapping +func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { + v := new(GetDeviceButtonMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MapSize = buf[b] + b += 1 + + b += 23 // padding + + v.Map = make([]byte, v.MapSize) + copy(v.Map[:v.MapSize], buf[b:]) + b += xgb.Pad(int(v.MapSize)) + + return v +} + +// Write request to wire for GetDeviceButtonMapping +func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request SetDeviceButtonMapping +// size: xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) +type SetDeviceButtonMappingCookie struct { + *xgb.Cookie +} + +func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) + return SetDeviceButtonMappingCookie{cookie} +} + +func SetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) + return SetDeviceButtonMappingCookie{cookie} +} + +// Request reply for SetDeviceButtonMapping +// size: 32 +type SetDeviceButtonMappingReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request SetDeviceButtonMapping +func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setDeviceButtonMappingReply(buf), nil +} + +// Read reply into structure from buffer for SetDeviceButtonMapping +func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { + v := new(SetDeviceButtonMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for SetDeviceButtonMapping +func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) []byte { + size := xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = MapSize + b += 1 + + b += 2 // padding + + copy(buf[b:], Map[:MapSize]) + b += xgb.Pad(int(MapSize)) + + return buf +} + +// Request QueryDeviceState +// size: 8 +type QueryDeviceStateCookie struct { + *xgb.Cookie +} + +func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) + return QueryDeviceStateCookie{cookie} +} + +func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) + return QueryDeviceStateCookie{cookie} +} + +// Request reply for QueryDeviceState +// size: 32 +type QueryDeviceStateReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes +} + +// Waits and reads reply data from request QueryDeviceState +func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryDeviceStateReply(buf), nil +} + +// Read reply into structure from buffer for QueryDeviceState +func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { + v := new(QueryDeviceStateReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for QueryDeviceState +func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// Request SendExtensionEvent +// size: xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) +type SendExtensionEventCookie struct { + *xgb.Cookie +} + +// Write request to wire for SendExtensionEvent +func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return SendExtensionEventCookie{cookie} +} + +func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return SendExtensionEventCookie{cookie} +} + +func (cook SendExtensionEventCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SendExtensionEvent +func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { + size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + buf[b] = DeviceId + b += 1 + + if Propagate { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + buf[b] = NumEvents + b += 1 + + b += 3 // padding + + copy(buf[b:], Events[:(int(NumEvents)*32)]) + b += xgb.Pad(int((int(NumEvents) * 32))) + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request DeviceBell +// size: 8 +type DeviceBellCookie struct { + *xgb.Cookie +} + +// Write request to wire for DeviceBell +func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return DeviceBellCookie{cookie} +} + +func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return DeviceBellCookie{cookie} +} + +func (cook DeviceBellCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeviceBell +func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = FeedbackId + b += 1 + + buf[b] = FeedbackClass + b += 1 + + buf[b] = byte(Percent) + b += 1 + + return buf +} + +// Request SetDeviceValuators +// size: xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) +type SetDeviceValuatorsCookie struct { + *xgb.Cookie +} + +func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) + return SetDeviceValuatorsCookie{cookie} +} + +func SetDeviceValuatorsUnchecked(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) + return SetDeviceValuatorsCookie{cookie} +} + +// Request reply for SetDeviceValuators +// size: 32 +type SetDeviceValuatorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request SetDeviceValuators +func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setDeviceValuatorsReply(buf), nil +} + +// Read reply into structure from buffer for SetDeviceValuators +func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { + v := new(SetDeviceValuatorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for SetDeviceValuators +func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = FirstValuator + b += 1 + + buf[b] = NumValuators + b += 1 + + b += 1 // padding + + for i := 0; i < int(NumValuators); i++ { + xgb.Put32(buf[b:], uint32(Valuators[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request GetDeviceControl +// size: 8 +type GetDeviceControlCookie struct { + *xgb.Cookie +} + +func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) + return GetDeviceControlCookie{cookie} +} + +func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) + return GetDeviceControlCookie{cookie} +} + +// Request reply for GetDeviceControl +// size: 32 +type GetDeviceControlReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Waits and reads reply data from request GetDeviceControl +func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceControlReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceControl +func getDeviceControlReply(buf []byte) *GetDeviceControlReply { + v := new(GetDeviceControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for GetDeviceControl +func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ControlId) + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 1 // padding + + return buf +} diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go new file mode 100644 index 0000000..2fcf49f --- /dev/null +++ b/nexgb/xprint/xprint.go @@ -0,0 +1,2164 @@ +package xprint + +/* + This file was generated by xprint.xml on May 10 2012 4:20:28pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XpExtension extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 11, "XpExtension").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XpExtension could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XpExtension"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XpExtension"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XpExtension"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XpExtension"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + GetDocFinished = 0 + GetDocSecondConsumer = 1 +) + +const ( + EvMaskNoEventMask = 0 + EvMaskPrintMask = 1 + EvMaskAttributeMask = 2 +) + +const ( + DetailStartJobNotify = 1 + DetailEndJobNotify = 2 + DetailStartDocNotify = 3 + DetailEndDocNotify = 4 + DetailStartPageNotify = 5 + DetailEndPageNotify = 6 +) + +const ( + AttrJobAttr = 1 + AttrDocAttr = 2 + AttrPageAttr = 3 + AttrPrinterAttr = 4 + AttrServerAttr = 5 + AttrMediumAttr = 6 + AttrSpoolerAttr = 7 +) + +type Pcontext uint32 + +func NewPcontextId(c *xgb.Conn) (Pcontext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pcontext(id), nil +} + +type String8 byte + +// 'Printer' struct definition +// Size: (((4 + xgb.Pad((int(NameLen) * 1))) + 4) + xgb.Pad((int(DescLen) * 1))) +type Printer struct { + NameLen uint32 + Name []String8 // size: xgb.Pad((int(NameLen) * 1)) + DescLen uint32 + Description []String8 // size: xgb.Pad((int(DescLen) * 1)) +} + +// Struct read Printer +func PrinterRead(buf []byte, v *Printer) int { + b := 0 + + v.NameLen = xgb.Get32(buf[b:]) + b += 4 + + v.Name = make([]String8, v.NameLen) + for i := 0; i < int(v.NameLen); i++ { + v.Name[i] = String8(buf[b]) + b += 1 + } + b = xgb.Pad(b) + + v.DescLen = xgb.Get32(buf[b:]) + b += 4 + + v.Description = make([]String8, v.DescLen) + for i := 0; i < int(v.DescLen); i++ { + v.Description[i] = String8(buf[b]) + b += 1 + } + b = xgb.Pad(b) + + return b +} + +// Struct list read Printer +func PrinterReadList(buf []byte, dest []Printer) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Printer{} + b += PrinterRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Printer +func (v Printer) Bytes() []byte { + buf := make([]byte, (((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + xgb.Pad((int(v.DescLen) * 1)))) + b := 0 + + xgb.Put32(buf[b:], v.NameLen) + b += 4 + + for i := 0; i < int(v.NameLen); i++ { + buf[b] = byte(v.Name[i]) + b += 1 + } + b = xgb.Pad(b) + + xgb.Put32(buf[b:], v.DescLen) + b += 4 + + for i := 0; i < int(v.DescLen); i++ { + buf[b] = byte(v.Description[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Write struct list Printer +func PrinterListBytes(buf []byte, list []Printer) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size Printer +func PrinterListSize(list []Printer) int { + size := 0 + for _, item := range list { + size += (((4 + xgb.Pad((int(item.NameLen) * 1))) + 4) + xgb.Pad((int(item.DescLen) * 1))) + } + return size +} + +// Event definition Notify (0) +// Size: 32 + +const Notify = 0 + +type NotifyEvent struct { + Sequence uint16 + Detail byte + Context Pcontext + Cancel bool +} + +// Event read Notify +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Context = Pcontext(xgb.Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.Cancel = true + } else { + v.Cancel = false + } + b += 1 + + return v +} + +// Event write Notify +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Context)) + b += 4 + + if v.Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +func (v NotifyEvent) ImplementsEvent() {} + +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Context: %d", v.Context)) + fieldVals = append(fieldVals, xgb.Sprintf("Cancel: %t", v.Cancel)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XpExtension"][0] = NotifyEventNew +} + +// Event definition AttributNotify (1) +// Size: 32 + +const AttributNotify = 1 + +type AttributNotifyEvent struct { + Sequence uint16 + Detail byte + Context Pcontext +} + +// Event read AttributNotify +func AttributNotifyEventNew(buf []byte) xgb.Event { + v := AttributNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Context = Pcontext(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Event write AttributNotify +func (v AttributNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Context)) + b += 4 + + return buf +} + +func (v AttributNotifyEvent) ImplementsEvent() {} + +func (v AttributNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v AttributNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Context: %d", v.Context)) + return "AttributNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XpExtension"][1] = AttributNotifyEventNew +} + +// Error definition BadContext (0) +// Size: 32 + +const BadBadContext = 0 + +type BadContextError struct { + Sequence uint16 + NiceName string +} + +// Error read BadContext +func BadContextErrorNew(buf []byte) xgb.Error { + v := BadContextError{} + v.NiceName = "BadContext" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadContextError) ImplementsError() {} + +func (err BadContextError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadContextError) BadId() uint32 { + return 0 +} + +func (err BadContextError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XpExtension"][0] = BadContextErrorNew +} + +// Error definition BadSequence (1) +// Size: 32 + +const BadBadSequence = 1 + +type BadSequenceError struct { + Sequence uint16 + NiceName string +} + +// Error read BadSequence +func BadSequenceErrorNew(buf []byte) xgb.Error { + v := BadSequenceError{} + v.NiceName = "BadSequence" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadSequenceError) ImplementsError() {} + +func (err BadSequenceError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadSequenceError) BadId() uint32 { + return 0 +} + +func (err BadSequenceError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadSequence {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XpExtension"][1] = BadSequenceErrorNew +} + +// Request PrintQueryVersion +// size: 4 +type PrintQueryVersionCookie struct { + *xgb.Cookie +} + +func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printQueryVersionRequest(c), cookie) + return PrintQueryVersionCookie{cookie} +} + +func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printQueryVersionRequest(c), cookie) + return PrintQueryVersionCookie{cookie} +} + +// Request reply for PrintQueryVersion +// size: 12 +type PrintQueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Waits and reads reply data from request PrintQueryVersion +func (cook PrintQueryVersionCookie) Reply() (*PrintQueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printQueryVersionReply(buf), nil +} + +// Read reply into structure from buffer for PrintQueryVersion +func printQueryVersionReply(buf []byte) *PrintQueryVersionReply { + v := new(PrintQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for PrintQueryVersion +func printQueryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request PrintGetPrinterList +// size: xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) +type PrintGetPrinterListCookie struct { + *xgb.Cookie +} + +func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return PrintGetPrinterListCookie{cookie} +} + +func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return PrintGetPrinterListCookie{cookie} +} + +// Request reply for PrintGetPrinterList +// size: (32 + PrinterListSize(Printers)) +type PrintGetPrinterListReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ListCount uint32 + // padding: 20 bytes + Printers []Printer // size: PrinterListSize(Printers) +} + +// Waits and reads reply data from request PrintGetPrinterList +func (cook PrintGetPrinterListCookie) Reply() (*PrintGetPrinterListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetPrinterListReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetPrinterList +func printGetPrinterListReply(buf []byte) *PrintGetPrinterListReply { + v := new(PrintGetPrinterListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ListCount = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Printers = make([]Printer, v.ListCount) + b += PrinterReadList(buf[b:], v.Printers) + + return v +} + +// Write request to wire for PrintGetPrinterList +func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { + size := xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], PrinterNameLen) + b += 4 + + xgb.Put32(buf[b:], LocaleLen) + b += 4 + + for i := 0; i < int(PrinterNameLen); i++ { + buf[b] = byte(PrinterName[i]) + b += 1 + } + b = xgb.Pad(b) + + for i := 0; i < int(LocaleLen); i++ { + buf[b] = byte(Locale[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintRehashPrinterList +// size: 4 +type PrintRehashPrinterListCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintRehashPrinterList +func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printRehashPrinterListRequest(c), cookie) + return PrintRehashPrinterListCookie{cookie} +} + +func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printRehashPrinterListRequest(c), cookie) + return PrintRehashPrinterListCookie{cookie} +} + +func (cook PrintRehashPrinterListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintRehashPrinterList +func printRehashPrinterListRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request CreateContext +// size: xgb.Pad(((16 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) +type CreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for CreateContext +func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return CreateContextCookie{cookie} +} + +func CreateContextChecked(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return CreateContextCookie{cookie} +} + +func (cook CreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateContext +func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { + size := xgb.Pad(((16 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextId) + b += 4 + + xgb.Put32(buf[b:], PrinterNameLen) + b += 4 + + xgb.Put32(buf[b:], LocaleLen) + b += 4 + + for i := 0; i < int(PrinterNameLen); i++ { + buf[b] = byte(PrinterName[i]) + b += 1 + } + b = xgb.Pad(b) + + for i := 0; i < int(LocaleLen); i++ { + buf[b] = byte(Locale[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintSetContext +// size: 8 +type PrintSetContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintSetContext +func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printSetContextRequest(c, Context), cookie) + return PrintSetContextCookie{cookie} +} + +func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printSetContextRequest(c, Context), cookie) + return PrintSetContextCookie{cookie} +} + +func (cook PrintSetContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSetContext +func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request PrintGetContext +// size: 4 +type PrintGetContextCookie struct { + *xgb.Cookie +} + +func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetContextRequest(c), cookie) + return PrintGetContextCookie{cookie} +} + +func PrintGetContextUnchecked(c *xgb.Conn) PrintGetContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetContextRequest(c), cookie) + return PrintGetContextCookie{cookie} +} + +// Request reply for PrintGetContext +// size: 12 +type PrintGetContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Context uint32 +} + +// Waits and reads reply data from request PrintGetContext +func (cook PrintGetContextCookie) Reply() (*PrintGetContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetContextReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetContext +func printGetContextReply(buf []byte) *PrintGetContextReply { + v := new(PrintGetContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Context = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for PrintGetContext +func printGetContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request PrintDestroyContext +// size: 8 +type PrintDestroyContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintDestroyContext +func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printDestroyContextRequest(c, Context), cookie) + return PrintDestroyContextCookie{cookie} +} + +func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printDestroyContextRequest(c, Context), cookie) + return PrintDestroyContextCookie{cookie} +} + +func (cook PrintDestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintDestroyContext +func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// Request PrintGetScreenOfContext +// size: 4 +type PrintGetScreenOfContextCookie struct { + *xgb.Cookie +} + +func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetScreenOfContextRequest(c), cookie) + return PrintGetScreenOfContextCookie{cookie} +} + +func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetScreenOfContextRequest(c), cookie) + return PrintGetScreenOfContextCookie{cookie} +} + +// Request reply for PrintGetScreenOfContext +// size: 12 +type PrintGetScreenOfContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Root xproto.Window +} + +// Waits and reads reply data from request PrintGetScreenOfContext +func (cook PrintGetScreenOfContextCookie) Reply() (*PrintGetScreenOfContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetScreenOfContextReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetScreenOfContext +func printGetScreenOfContextReply(buf []byte) *PrintGetScreenOfContextReply { + v := new(PrintGetScreenOfContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for PrintGetScreenOfContext +func printGetScreenOfContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request PrintStartJob +// size: 8 +type PrintStartJobCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintStartJob +func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printStartJobRequest(c, OutputMode), cookie) + return PrintStartJobCookie{cookie} +} + +func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printStartJobRequest(c, OutputMode), cookie) + return PrintStartJobCookie{cookie} +} + +func (cook PrintStartJobCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintStartJob +func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = OutputMode + b += 1 + + return buf +} + +// Request PrintEndJob +// size: 8 +type PrintEndJobCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintEndJob +func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printEndJobRequest(c, Cancel), cookie) + return PrintEndJobCookie{cookie} +} + +func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printEndJobRequest(c, Cancel), cookie) + return PrintEndJobCookie{cookie} +} + +func (cook PrintEndJobCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndJob +func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request PrintStartDoc +// size: 8 +type PrintStartDocCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintStartDoc +func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printStartDocRequest(c, DriverMode), cookie) + return PrintStartDocCookie{cookie} +} + +func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printStartDocRequest(c, DriverMode), cookie) + return PrintStartDocCookie{cookie} +} + +func (cook PrintStartDocCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintStartDoc +func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DriverMode + b += 1 + + return buf +} + +// Request PrintEndDoc +// size: 8 +type PrintEndDocCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintEndDoc +func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printEndDocRequest(c, Cancel), cookie) + return PrintEndDocCookie{cookie} +} + +func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printEndDocRequest(c, Cancel), cookie) + return PrintEndDocCookie{cookie} +} + +func (cook PrintEndDocCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndDoc +func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// Request PrintPutDocumentData +// size: xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) +type PrintPutDocumentDataCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintPutDocumentData +func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return PrintPutDocumentDataCookie{cookie} +} + +func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return PrintPutDocumentDataCookie{cookie} +} + +func (cook PrintPutDocumentDataCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintPutDocumentData +func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) []byte { + size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], LenData) + b += 4 + + xgb.Put16(buf[b:], LenFmt) + b += 2 + + xgb.Put16(buf[b:], LenOptions) + b += 2 + + copy(buf[b:], Data[:LenData]) + b += xgb.Pad(int(LenData)) + + for i := 0; i < int(len(DocFormat)); i++ { + buf[b] = byte(DocFormat[i]) + b += 1 + } + b = xgb.Pad(b) + + for i := 0; i < int(len(Options)); i++ { + buf[b] = byte(Options[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintGetDocumentData +// size: 12 +type PrintGetDocumentDataCookie struct { + *xgb.Cookie +} + +func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) + return PrintGetDocumentDataCookie{cookie} +} + +func PrintGetDocumentDataUnchecked(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) + return PrintGetDocumentDataCookie{cookie} +} + +// Request reply for PrintGetDocumentData +// size: (32 + xgb.Pad((int(DataLen) * 1))) +type PrintGetDocumentDataReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StatusCode uint32 + FinishedFlag uint32 + DataLen uint32 + // padding: 12 bytes + Data []byte // size: xgb.Pad((int(DataLen) * 1)) +} + +// Waits and reads reply data from request PrintGetDocumentData +func (cook PrintGetDocumentDataCookie) Reply() (*PrintGetDocumentDataReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetDocumentDataReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetDocumentData +func printGetDocumentDataReply(buf []byte) *PrintGetDocumentDataReply { + v := new(PrintGetDocumentDataReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StatusCode = xgb.Get32(buf[b:]) + b += 4 + + v.FinishedFlag = xgb.Get32(buf[b:]) + b += 4 + + v.DataLen = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, v.DataLen) + copy(v.Data[:v.DataLen], buf[b:]) + b += xgb.Pad(int(v.DataLen)) + + return v +} + +// Write request to wire for PrintGetDocumentData +func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], MaxBytes) + b += 4 + + return buf +} + +// Request PrintStartPage +// size: 8 +type PrintStartPageCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintStartPage +func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printStartPageRequest(c, Window), cookie) + return PrintStartPageCookie{cookie} +} + +func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printStartPageRequest(c, Window), cookie) + return PrintStartPageCookie{cookie} +} + +func (cook PrintStartPageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintStartPage +func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request PrintEndPage +// size: 8 +type PrintEndPageCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintEndPage +func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printEndPageRequest(c, Cancel), cookie) + return PrintEndPageCookie{cookie} +} + +func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printEndPageRequest(c, Cancel), cookie) + return PrintEndPageCookie{cookie} +} + +func (cook PrintEndPageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndPage +func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request PrintSelectInput +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) +type PrintSelectInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintSelectInput +func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + return PrintSelectInputCookie{cookie} +} + +func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + return PrintSelectInputCookie{cookie} +} + +func (cook PrintSelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSelectInput +func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + for i := 0; i < xgb.PopCount(int(EventMask)); i++ { + xgb.Put32(buf[b:], EventList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintInputSelected +// size: 8 +type PrintInputSelectedCookie struct { + *xgb.Cookie +} + +func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printInputSelectedRequest(c, Context), cookie) + return PrintInputSelectedCookie{cookie} +} + +func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printInputSelectedRequest(c, Context), cookie) + return PrintInputSelectedCookie{cookie} +} + +// Request reply for PrintInputSelected +// size: ((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask)))))) + (4 + xgb.Pad((4 * xgb.PopCount(int(AllEventsMask)))))) +type PrintInputSelectedReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + EventMask uint32 + EventList []uint32 + AllEventsMask uint32 + AllEventsList []uint32 +} + +// Waits and reads reply data from request PrintInputSelected +func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printInputSelectedReply(buf), nil +} + +// Read reply into structure from buffer for PrintInputSelected +func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { + v := new(PrintInputSelectedReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventMask = xgb.Get32(buf[b:]) + b += 4 + + v.EventList = make([]uint32, xgb.PopCount(int(v.EventMask))) + for i := 0; i < xgb.PopCount(int(v.EventMask)); i++ { + v.EventList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.AllEventsMask = xgb.Get32(buf[b:]) + b += 4 + + v.AllEventsList = make([]uint32, xgb.PopCount(int(v.AllEventsMask))) + for i := 0; i < xgb.PopCount(int(v.AllEventsMask)); i++ { + v.AllEventsList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for PrintInputSelected +func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request PrintGetAttributes +// size: 12 +type PrintGetAttributesCookie struct { + *xgb.Cookie +} + +func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) + return PrintGetAttributesCookie{cookie} +} + +func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) + return PrintGetAttributesCookie{cookie} +} + +// Request reply for PrintGetAttributes +// size: 33 +type PrintGetAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + StringLen uint32 + // padding: 20 bytes + Attributes String8 +} + +// Waits and reads reply data from request PrintGetAttributes +func (cook PrintGetAttributesCookie) Reply() (*PrintGetAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetAttributesReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetAttributes +func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { + v := new(PrintGetAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StringLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attributes = String8(buf[b]) + b += 1 + + return v +} + +// Write request to wire for PrintGetAttributes +func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = Pool + b += 1 + + b += 3 // padding + + return buf +} + +// Request PrintGetOneAttributes +// size: xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) +type PrintGetOneAttributesCookie struct { + *xgb.Cookie +} + +func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) + return PrintGetOneAttributesCookie{cookie} +} + +func PrintGetOneAttributesUnchecked(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) + return PrintGetOneAttributesCookie{cookie} +} + +// Request reply for PrintGetOneAttributes +// size: (32 + xgb.Pad((int(ValueLen) * 1))) +type PrintGetOneAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ValueLen uint32 + // padding: 20 bytes + Value []String8 // size: xgb.Pad((int(ValueLen) * 1)) +} + +// Waits and reads reply data from request PrintGetOneAttributes +func (cook PrintGetOneAttributesCookie) Reply() (*PrintGetOneAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetOneAttributesReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetOneAttributes +func printGetOneAttributesReply(buf []byte) *PrintGetOneAttributesReply { + v := new(PrintGetOneAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ValueLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Value = make([]String8, v.ValueLen) + for i := 0; i < int(v.ValueLen); i++ { + v.Value[i] = String8(buf[b]) + b += 1 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for PrintGetOneAttributes +func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) []byte { + size := xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], NameLen) + b += 4 + + buf[b] = Pool + b += 1 + + b += 3 // padding + + for i := 0; i < int(NameLen); i++ { + buf[b] = byte(Name[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintSetAttributes +// size: xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) +type PrintSetAttributesCookie struct { + *xgb.Cookie +} + +// Write request to wire for PrintSetAttributes +func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) + return PrintSetAttributesCookie{cookie} +} + +func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) + return PrintSetAttributesCookie{cookie} +} + +func (cook PrintSetAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSetAttributes +func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], StringLen) + b += 4 + + buf[b] = Pool + b += 1 + + buf[b] = Rule + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Attributes)); i++ { + buf[b] = byte(Attributes[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// Request PrintGetPageDimensions +// size: 8 +type PrintGetPageDimensionsCookie struct { + *xgb.Cookie +} + +func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) + return PrintGetPageDimensionsCookie{cookie} +} + +func PrintGetPageDimensionsUnchecked(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) + return PrintGetPageDimensionsCookie{cookie} +} + +// Request reply for PrintGetPageDimensions +// size: 20 +type PrintGetPageDimensionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Width uint16 + Height uint16 + OffsetX uint16 + OffsetY uint16 + ReproducibleWidth uint16 + ReproducibleHeight uint16 +} + +// Waits and reads reply data from request PrintGetPageDimensions +func (cook PrintGetPageDimensionsCookie) Reply() (*PrintGetPageDimensionsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetPageDimensionsReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetPageDimensions +func printGetPageDimensionsReply(buf []byte) *PrintGetPageDimensionsReply { + v := new(PrintGetPageDimensionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.OffsetX = xgb.Get16(buf[b:]) + b += 2 + + v.OffsetY = xgb.Get16(buf[b:]) + b += 2 + + v.ReproducibleWidth = xgb.Get16(buf[b:]) + b += 2 + + v.ReproducibleHeight = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for PrintGetPageDimensions +func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// Request PrintQueryScreens +// size: 4 +type PrintQueryScreensCookie struct { + *xgb.Cookie +} + +func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printQueryScreensRequest(c), cookie) + return PrintQueryScreensCookie{cookie} +} + +func PrintQueryScreensUnchecked(c *xgb.Conn) PrintQueryScreensCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printQueryScreensRequest(c), cookie) + return PrintQueryScreensCookie{cookie} +} + +// Request reply for PrintQueryScreens +// size: (32 + xgb.Pad((int(ListCount) * 4))) +type PrintQueryScreensReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ListCount uint32 + // padding: 20 bytes + Roots []xproto.Window // size: xgb.Pad((int(ListCount) * 4)) +} + +// Waits and reads reply data from request PrintQueryScreens +func (cook PrintQueryScreensCookie) Reply() (*PrintQueryScreensReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printQueryScreensReply(buf), nil +} + +// Read reply into structure from buffer for PrintQueryScreens +func printQueryScreensReply(buf []byte) *PrintQueryScreensReply { + v := new(PrintQueryScreensReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ListCount = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Roots = make([]xproto.Window, v.ListCount) + for i := 0; i < int(v.ListCount); i++ { + v.Roots[i] = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for PrintQueryScreens +func printQueryScreensRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request PrintSetImageResolution +// size: 12 +type PrintSetImageResolutionCookie struct { + *xgb.Cookie +} + +func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) + return PrintSetImageResolutionCookie{cookie} +} + +func PrintSetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) + return PrintSetImageResolutionCookie{cookie} +} + +// Request reply for PrintSetImageResolution +// size: 10 +type PrintSetImageResolutionReply struct { + Sequence uint16 + Length uint32 + Status bool + PreviousResolutions uint16 +} + +// Waits and reads reply data from request PrintSetImageResolution +func (cook PrintSetImageResolutionCookie) Reply() (*PrintSetImageResolutionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printSetImageResolutionReply(buf), nil +} + +// Read reply into structure from buffer for PrintSetImageResolution +func printSetImageResolutionReply(buf []byte) *PrintSetImageResolutionReply { + v := new(PrintSetImageResolutionReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Status = true + } else { + v.Status = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PreviousResolutions = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for PrintSetImageResolution +func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResolution uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put16(buf[b:], ImageResolution) + b += 2 + + return buf +} + +// Request PrintGetImageResolution +// size: 8 +type PrintGetImageResolutionCookie struct { + *xgb.Cookie +} + +func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) + return PrintGetImageResolutionCookie{cookie} +} + +func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) + return PrintGetImageResolutionCookie{cookie} +} + +// Request reply for PrintGetImageResolution +// size: 10 +type PrintGetImageResolutionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ImageResolution uint16 +} + +// Waits and reads reply data from request PrintGetImageResolution +func (cook PrintGetImageResolutionCookie) Reply() (*PrintGetImageResolutionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetImageResolutionReply(buf), nil +} + +// Read reply into structure from buffer for PrintGetImageResolution +func printGetImageResolutionReply(buf []byte) *PrintGetImageResolutionReply { + v := new(PrintGetImageResolutionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ImageResolution = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for PrintGetImageResolution +func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} diff --git a/nexgb/auto_xproto.go b/nexgb/xproto/xproto.go similarity index 51% rename from nexgb/auto_xproto.go rename to nexgb/xproto/xproto.go index 8bd39b3..2516225 100644 --- a/nexgb/auto_xproto.go +++ b/nexgb/xproto/xproto.go @@ -1,10 +1,27 @@ -package xgb +package xproto /* - This file was generated by xproto.xml on May 10 2012 12:39:34pm EDT. + This file was generated by xproto.xml on May 10 2012 4:20:28pm EDT. This file is automatically generated. Edit at your peril! */ +import ( + "github.com/BurntSushi/xgb" +) + +// Setup parses the setup bytes retrieved when +// connecting into a SetupInfo struct. +func Setup(c *xgb.Conn) *SetupInfo { + setup := new(SetupInfo) + SetupInfoRead(c.SetupBytes, setup) + return setup +} + +// DefaultScreen gets the default screen info from SetupInfo. +func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { + return &s.Roots[c.DefaultScreen] +} + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -617,7 +634,7 @@ const ( type Window uint32 -func (c *Conn) NewWindowId() (Window, error) { +func NewWindowId(c *xgb.Conn) (Window, error) { id, err := c.NewId() if err != nil { return 0, err @@ -627,7 +644,7 @@ func (c *Conn) NewWindowId() (Window, error) { type Pixmap uint32 -func (c *Conn) NewPixmapId() (Pixmap, error) { +func NewPixmapId(c *xgb.Conn) (Pixmap, error) { id, err := c.NewId() if err != nil { return 0, err @@ -637,7 +654,7 @@ func (c *Conn) NewPixmapId() (Pixmap, error) { type Cursor uint32 -func (c *Conn) NewCursorId() (Cursor, error) { +func NewCursorId(c *xgb.Conn) (Cursor, error) { id, err := c.NewId() if err != nil { return 0, err @@ -647,7 +664,7 @@ func (c *Conn) NewCursorId() (Cursor, error) { type Font uint32 -func (c *Conn) NewFontId() (Font, error) { +func NewFontId(c *xgb.Conn) (Font, error) { id, err := c.NewId() if err != nil { return 0, err @@ -657,7 +674,7 @@ func (c *Conn) NewFontId() (Font, error) { type Gcontext uint32 -func (c *Conn) NewGcontextId() (Gcontext, error) { +func NewGcontextId(c *xgb.Conn) (Gcontext, error) { id, err := c.NewId() if err != nil { return 0, err @@ -667,7 +684,7 @@ func (c *Conn) NewGcontextId() (Gcontext, error) { type Colormap uint32 -func (c *Conn) NewColormapId() (Colormap, error) { +func NewColormapId(c *xgb.Conn) (Colormap, error) { id, err := c.NewId() if err != nil { return 0, err @@ -677,7 +694,7 @@ func (c *Conn) NewColormapId() (Colormap, error) { type Atom uint32 -func (c *Conn) NewAtomId() (Atom, error) { +func NewAtomId(c *xgb.Conn) (Atom, error) { id, err := c.NewId() if err != nil { return 0, err @@ -687,7 +704,7 @@ func (c *Conn) NewAtomId() (Atom, error) { type Drawable uint32 -func (c *Conn) NewDrawableId() (Drawable, error) { +func NewDrawableId(c *xgb.Conn) (Drawable, error) { id, err := c.NewId() if err != nil { return 0, err @@ -697,7 +714,7 @@ func (c *Conn) NewDrawableId() (Drawable, error) { type Fontable uint32 -func (c *Conn) NewFontableId() (Fontable, error) { +func NewFontableId(c *xgb.Conn) (Fontable, error) { id, err := c.NewId() if err != nil { return 0, err @@ -723,7 +740,7 @@ type Char2b struct { } // Struct read Char2b -func ReadChar2b(buf []byte, v *Char2b) int { +func Char2bRead(buf []byte, v *Char2b) int { b := 0 v.Byte1 = buf[b] @@ -736,13 +753,13 @@ func ReadChar2b(buf []byte, v *Char2b) int { } // Struct list read Char2b -func ReadChar2bList(buf []byte, dest []Char2b) int { +func Char2bReadList(buf []byte, dest []Char2b) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Char2b{} - b += ReadChar2b(buf[b:], &dest[i]) + b += Char2bRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Char2b @@ -766,7 +783,7 @@ func Char2bListBytes(buf []byte, list []Char2b) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -779,26 +796,26 @@ type Point struct { } // Struct read Point -func ReadPoint(buf []byte, v *Point) int { +func PointRead(buf []byte, v *Point) int { b := 0 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 return b } // Struct list read Point -func ReadPointList(buf []byte, dest []Point) int { +func PointReadList(buf []byte, dest []Point) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Point{} - b += ReadPoint(buf[b:], &dest[i]) + b += PointRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Point @@ -806,10 +823,10 @@ func (v Point) Bytes() []byte { buf := make([]byte, 4) b := 0 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 return buf @@ -822,7 +839,7 @@ func PointListBytes(buf []byte, list []Point) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -837,32 +854,32 @@ type Rectangle struct { } // Struct read Rectangle -func ReadRectangle(buf []byte, v *Rectangle) int { +func RectangleRead(buf []byte, v *Rectangle) int { b := 0 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 return b } // Struct list read Rectangle -func ReadRectangleList(buf []byte, dest []Rectangle) int { +func RectangleReadList(buf []byte, dest []Rectangle) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Rectangle{} - b += ReadRectangle(buf[b:], &dest[i]) + b += RectangleRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Rectangle @@ -870,16 +887,16 @@ func (v Rectangle) Bytes() []byte { buf := make([]byte, 8) b := 0 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 return buf @@ -892,7 +909,7 @@ func RectangleListBytes(buf []byte, list []Rectangle) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -909,38 +926,38 @@ type Arc struct { } // Struct read Arc -func ReadArc(buf []byte, v *Arc) int { +func ArcRead(buf []byte, v *Arc) int { b := 0 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.Angle1 = int16(Get16(buf[b:])) + v.Angle1 = int16(xgb.Get16(buf[b:])) b += 2 - v.Angle2 = int16(Get16(buf[b:])) + v.Angle2 = int16(xgb.Get16(buf[b:])) b += 2 return b } // Struct list read Arc -func ReadArcList(buf []byte, dest []Arc) int { +func ArcReadList(buf []byte, dest []Arc) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Arc{} - b += ReadArc(buf[b:], &dest[i]) + b += ArcRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Arc @@ -948,22 +965,22 @@ func (v Arc) Bytes() []byte { buf := make([]byte, 12) b := 0 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], uint16(v.Angle1)) + xgb.Put16(buf[b:], uint16(v.Angle1)) b += 2 - Put16(buf[b:], uint16(v.Angle2)) + xgb.Put16(buf[b:], uint16(v.Angle2)) b += 2 return buf @@ -976,7 +993,7 @@ func ArcListBytes(buf []byte, list []Arc) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -991,7 +1008,7 @@ type Format struct { } // Struct read Format -func ReadFormat(buf []byte, v *Format) int { +func FormatRead(buf []byte, v *Format) int { b := 0 v.Depth = buf[b] @@ -1009,13 +1026,13 @@ func ReadFormat(buf []byte, v *Format) int { } // Struct list read Format -func ReadFormatList(buf []byte, dest []Format) int { +func FormatReadList(buf []byte, dest []Format) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Format{} - b += ReadFormat(buf[b:], &dest[i]) + b += FormatRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Format @@ -1044,7 +1061,7 @@ func FormatListBytes(buf []byte, list []Format) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1063,10 +1080,10 @@ type VisualInfo struct { } // Struct read VisualInfo -func ReadVisualInfo(buf []byte, v *VisualInfo) int { +func VisualInfoRead(buf []byte, v *VisualInfo) int { b := 0 - v.VisualId = Visualid(Get32(buf[b:])) + v.VisualId = Visualid(xgb.Get32(buf[b:])) b += 4 v.Class = buf[b] @@ -1075,16 +1092,16 @@ func ReadVisualInfo(buf []byte, v *VisualInfo) int { v.BitsPerRgbValue = buf[b] b += 1 - v.ColormapEntries = Get16(buf[b:]) + v.ColormapEntries = xgb.Get16(buf[b:]) b += 2 - v.RedMask = Get32(buf[b:]) + v.RedMask = xgb.Get32(buf[b:]) b += 4 - v.GreenMask = Get32(buf[b:]) + v.GreenMask = xgb.Get32(buf[b:]) b += 4 - v.BlueMask = Get32(buf[b:]) + v.BlueMask = xgb.Get32(buf[b:]) b += 4 b += 4 // padding @@ -1093,13 +1110,13 @@ func ReadVisualInfo(buf []byte, v *VisualInfo) int { } // Struct list read VisualInfo -func ReadVisualInfoList(buf []byte, dest []VisualInfo) int { +func VisualInfoReadList(buf []byte, dest []VisualInfo) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = VisualInfo{} - b += ReadVisualInfo(buf[b:], &dest[i]) + b += VisualInfoRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write VisualInfo @@ -1107,7 +1124,7 @@ func (v VisualInfo) Bytes() []byte { buf := make([]byte, 24) b := 0 - Put32(buf[b:], uint32(v.VisualId)) + xgb.Put32(buf[b:], uint32(v.VisualId)) b += 4 buf[b] = v.Class @@ -1116,16 +1133,16 @@ func (v VisualInfo) Bytes() []byte { buf[b] = v.BitsPerRgbValue b += 1 - Put16(buf[b:], v.ColormapEntries) + xgb.Put16(buf[b:], v.ColormapEntries) b += 2 - Put32(buf[b:], v.RedMask) + xgb.Put32(buf[b:], v.RedMask) b += 4 - Put32(buf[b:], v.GreenMask) + xgb.Put32(buf[b:], v.GreenMask) b += 4 - Put32(buf[b:], v.BlueMask) + xgb.Put32(buf[b:], v.BlueMask) b += 4 b += 4 // padding @@ -1140,23 +1157,23 @@ func VisualInfoListBytes(buf []byte, list []VisualInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } // 'DepthInfo' struct definition -// Size: (8 + pad((int(VisualsLen) * 24))) +// Size: (8 + xgb.Pad((int(VisualsLen) * 24))) type DepthInfo struct { Depth byte // padding: 1 bytes VisualsLen uint16 // padding: 4 bytes - Visuals []VisualInfo // size: pad((int(VisualsLen) * 24)) + Visuals []VisualInfo // size: xgb.Pad((int(VisualsLen) * 24)) } // Struct read DepthInfo -func ReadDepthInfo(buf []byte, v *DepthInfo) int { +func DepthInfoRead(buf []byte, v *DepthInfo) int { b := 0 v.Depth = buf[b] @@ -1164,30 +1181,30 @@ func ReadDepthInfo(buf []byte, v *DepthInfo) int { b += 1 // padding - v.VisualsLen = Get16(buf[b:]) + v.VisualsLen = xgb.Get16(buf[b:]) b += 2 b += 4 // padding v.Visuals = make([]VisualInfo, v.VisualsLen) - b += ReadVisualInfoList(buf[b:], v.Visuals) + b += VisualInfoReadList(buf[b:], v.Visuals) return b } // Struct list read DepthInfo -func ReadDepthInfoList(buf []byte, dest []DepthInfo) int { +func DepthInfoReadList(buf []byte, dest []DepthInfo) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = DepthInfo{} - b += ReadDepthInfo(buf[b:], &dest[i]) + b += DepthInfoRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write DepthInfo func (v DepthInfo) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.VisualsLen) * 24)))) + buf := make([]byte, (8 + xgb.Pad((int(v.VisualsLen) * 24)))) b := 0 buf[b] = v.Depth @@ -1195,7 +1212,7 @@ func (v DepthInfo) Bytes() []byte { b += 1 // padding - Put16(buf[b:], v.VisualsLen) + xgb.Put16(buf[b:], v.VisualsLen) b += 2 b += 4 // padding @@ -1212,7 +1229,7 @@ func DepthInfoListBytes(buf []byte, list []DepthInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1221,7 +1238,7 @@ func DepthInfoListBytes(buf []byte, list []DepthInfo) int { func DepthInfoListSize(list []DepthInfo) int { size := 0 for _, item := range list { - size += (8 + pad((int(item.VisualsLen) * 24))) + size += (8 + xgb.Pad((int(item.VisualsLen) * 24))) } return size } @@ -1249,43 +1266,43 @@ type ScreenInfo struct { } // Struct read ScreenInfo -func ReadScreenInfo(buf []byte, v *ScreenInfo) int { +func ScreenInfoRead(buf []byte, v *ScreenInfo) int { b := 0 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.DefaultColormap = Colormap(Get32(buf[b:])) + v.DefaultColormap = Colormap(xgb.Get32(buf[b:])) b += 4 - v.WhitePixel = Get32(buf[b:]) + v.WhitePixel = xgb.Get32(buf[b:]) b += 4 - v.BlackPixel = Get32(buf[b:]) + v.BlackPixel = xgb.Get32(buf[b:]) b += 4 - v.CurrentInputMasks = Get32(buf[b:]) + v.CurrentInputMasks = xgb.Get32(buf[b:]) b += 4 - v.WidthInPixels = Get16(buf[b:]) + v.WidthInPixels = xgb.Get16(buf[b:]) b += 2 - v.HeightInPixels = Get16(buf[b:]) + v.HeightInPixels = xgb.Get16(buf[b:]) b += 2 - v.WidthInMillimeters = Get16(buf[b:]) + v.WidthInMillimeters = xgb.Get16(buf[b:]) b += 2 - v.HeightInMillimeters = Get16(buf[b:]) + v.HeightInMillimeters = xgb.Get16(buf[b:]) b += 2 - v.MinInstalledMaps = Get16(buf[b:]) + v.MinInstalledMaps = xgb.Get16(buf[b:]) b += 2 - v.MaxInstalledMaps = Get16(buf[b:]) + v.MaxInstalledMaps = xgb.Get16(buf[b:]) b += 2 - v.RootVisual = Visualid(Get32(buf[b:])) + v.RootVisual = Visualid(xgb.Get32(buf[b:])) b += 4 v.BackingStores = buf[b] @@ -1305,19 +1322,19 @@ func ReadScreenInfo(buf []byte, v *ScreenInfo) int { b += 1 v.AllowedDepths = make([]DepthInfo, v.AllowedDepthsLen) - b += ReadDepthInfoList(buf[b:], v.AllowedDepths) + b += DepthInfoReadList(buf[b:], v.AllowedDepths) return b } // Struct list read ScreenInfo -func ReadScreenInfoList(buf []byte, dest []ScreenInfo) int { +func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = ScreenInfo{} - b += ReadScreenInfo(buf[b:], &dest[i]) + b += ScreenInfoRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write ScreenInfo @@ -1325,40 +1342,40 @@ func (v ScreenInfo) Bytes() []byte { buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) b := 0 - Put32(buf[b:], uint32(v.Root)) + xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - Put32(buf[b:], uint32(v.DefaultColormap)) + xgb.Put32(buf[b:], uint32(v.DefaultColormap)) b += 4 - Put32(buf[b:], v.WhitePixel) + xgb.Put32(buf[b:], v.WhitePixel) b += 4 - Put32(buf[b:], v.BlackPixel) + xgb.Put32(buf[b:], v.BlackPixel) b += 4 - Put32(buf[b:], v.CurrentInputMasks) + xgb.Put32(buf[b:], v.CurrentInputMasks) b += 4 - Put16(buf[b:], v.WidthInPixels) + xgb.Put16(buf[b:], v.WidthInPixels) b += 2 - Put16(buf[b:], v.HeightInPixels) + xgb.Put16(buf[b:], v.HeightInPixels) b += 2 - Put16(buf[b:], v.WidthInMillimeters) + xgb.Put16(buf[b:], v.WidthInMillimeters) b += 2 - Put16(buf[b:], v.HeightInMillimeters) + xgb.Put16(buf[b:], v.HeightInMillimeters) b += 2 - Put16(buf[b:], v.MinInstalledMaps) + xgb.Put16(buf[b:], v.MinInstalledMaps) b += 2 - Put16(buf[b:], v.MaxInstalledMaps) + xgb.Put16(buf[b:], v.MaxInstalledMaps) b += 2 - Put32(buf[b:], uint32(v.RootVisual)) + xgb.Put32(buf[b:], uint32(v.RootVisual)) b += 4 buf[b] = v.BackingStores @@ -1389,7 +1406,7 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1404,7 +1421,7 @@ func ScreenInfoListSize(list []ScreenInfo) int { } // 'SetupRequest' struct definition -// Size: ((12 + pad((int(AuthorizationProtocolNameLen) * 1))) + pad((int(AuthorizationProtocolDataLen) * 1))) +// Size: ((12 + xgb.Pad((int(AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(AuthorizationProtocolDataLen) * 1))) type SetupRequest struct { ByteOrder byte // padding: 1 bytes @@ -1413,12 +1430,12 @@ type SetupRequest struct { AuthorizationProtocolNameLen uint16 AuthorizationProtocolDataLen uint16 // padding: 2 bytes - AuthorizationProtocolName string // size: pad((int(AuthorizationProtocolNameLen) * 1)) - AuthorizationProtocolData string // size: pad((int(AuthorizationProtocolDataLen) * 1)) + AuthorizationProtocolName string // size: xgb.Pad((int(AuthorizationProtocolNameLen) * 1)) + AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) } // Struct read SetupRequest -func ReadSetupRequest(buf []byte, v *SetupRequest) int { +func SetupRequestRead(buf []byte, v *SetupRequest) int { b := 0 v.ByteOrder = buf[b] @@ -1426,16 +1443,16 @@ func ReadSetupRequest(buf []byte, v *SetupRequest) int { b += 1 // padding - v.ProtocolMajorVersion = Get16(buf[b:]) + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) b += 2 - v.ProtocolMinorVersion = Get16(buf[b:]) + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) b += 2 - v.AuthorizationProtocolNameLen = Get16(buf[b:]) + v.AuthorizationProtocolNameLen = xgb.Get16(buf[b:]) b += 2 - v.AuthorizationProtocolDataLen = Get16(buf[b:]) + v.AuthorizationProtocolDataLen = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -1444,32 +1461,32 @@ func ReadSetupRequest(buf []byte, v *SetupRequest) int { byteString := make([]byte, v.AuthorizationProtocolNameLen) copy(byteString[:v.AuthorizationProtocolNameLen], buf[b:]) v.AuthorizationProtocolName = string(byteString) - b += pad(int(v.AuthorizationProtocolNameLen)) + b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) } { byteString := make([]byte, v.AuthorizationProtocolDataLen) copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) v.AuthorizationProtocolData = string(byteString) - b += pad(int(v.AuthorizationProtocolDataLen)) + b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) } return b } // Struct list read SetupRequest -func ReadSetupRequestList(buf []byte, dest []SetupRequest) int { +func SetupRequestReadList(buf []byte, dest []SetupRequest) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = SetupRequest{} - b += ReadSetupRequest(buf[b:], &dest[i]) + b += SetupRequestRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write SetupRequest func (v SetupRequest) Bytes() []byte { - buf := make([]byte, ((12 + pad((int(v.AuthorizationProtocolNameLen) * 1))) + pad((int(v.AuthorizationProtocolDataLen) * 1)))) + buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) b := 0 buf[b] = v.ByteOrder @@ -1477,25 +1494,25 @@ func (v SetupRequest) Bytes() []byte { b += 1 // padding - Put16(buf[b:], v.ProtocolMajorVersion) + xgb.Put16(buf[b:], v.ProtocolMajorVersion) b += 2 - Put16(buf[b:], v.ProtocolMinorVersion) + xgb.Put16(buf[b:], v.ProtocolMinorVersion) b += 2 - Put16(buf[b:], v.AuthorizationProtocolNameLen) + xgb.Put16(buf[b:], v.AuthorizationProtocolNameLen) b += 2 - Put16(buf[b:], v.AuthorizationProtocolDataLen) + xgb.Put16(buf[b:], v.AuthorizationProtocolDataLen) b += 2 b += 2 // padding copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) - b += pad(int(v.AuthorizationProtocolNameLen)) + b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) - b += pad(int(v.AuthorizationProtocolDataLen)) + b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) return buf } @@ -1507,7 +1524,7 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1516,24 +1533,24 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { func SetupRequestListSize(list []SetupRequest) int { size := 0 for _, item := range list { - size += ((12 + pad((int(item.AuthorizationProtocolNameLen) * 1))) + pad((int(item.AuthorizationProtocolDataLen) * 1))) + size += ((12 + xgb.Pad((int(item.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(item.AuthorizationProtocolDataLen) * 1))) } return size } // 'SetupFailed' struct definition -// Size: (8 + pad((int(ReasonLen) * 1))) +// Size: (8 + xgb.Pad((int(ReasonLen) * 1))) type SetupFailed struct { Status byte ReasonLen byte ProtocolMajorVersion uint16 ProtocolMinorVersion uint16 Length uint16 - Reason string // size: pad((int(ReasonLen) * 1)) + Reason string // size: xgb.Pad((int(ReasonLen) * 1)) } // Struct read SetupFailed -func ReadSetupFailed(buf []byte, v *SetupFailed) int { +func SetupFailedRead(buf []byte, v *SetupFailed) int { b := 0 v.Status = buf[b] @@ -1542,38 +1559,38 @@ func ReadSetupFailed(buf []byte, v *SetupFailed) int { v.ReasonLen = buf[b] b += 1 - v.ProtocolMajorVersion = Get16(buf[b:]) + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) b += 2 - v.ProtocolMinorVersion = Get16(buf[b:]) + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) b += 2 - v.Length = Get16(buf[b:]) + v.Length = xgb.Get16(buf[b:]) b += 2 { byteString := make([]byte, v.ReasonLen) copy(byteString[:v.ReasonLen], buf[b:]) v.Reason = string(byteString) - b += pad(int(v.ReasonLen)) + b += xgb.Pad(int(v.ReasonLen)) } return b } // Struct list read SetupFailed -func ReadSetupFailedList(buf []byte, dest []SetupFailed) int { +func SetupFailedReadList(buf []byte, dest []SetupFailed) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = SetupFailed{} - b += ReadSetupFailed(buf[b:], &dest[i]) + b += SetupFailedRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write SetupFailed func (v SetupFailed) Bytes() []byte { - buf := make([]byte, (8 + pad((int(v.ReasonLen) * 1)))) + buf := make([]byte, (8 + xgb.Pad((int(v.ReasonLen) * 1)))) b := 0 buf[b] = v.Status @@ -1582,17 +1599,17 @@ func (v SetupFailed) Bytes() []byte { buf[b] = v.ReasonLen b += 1 - Put16(buf[b:], v.ProtocolMajorVersion) + xgb.Put16(buf[b:], v.ProtocolMajorVersion) b += 2 - Put16(buf[b:], v.ProtocolMinorVersion) + xgb.Put16(buf[b:], v.ProtocolMinorVersion) b += 2 - Put16(buf[b:], v.Length) + xgb.Put16(buf[b:], v.Length) b += 2 copy(buf[b:], v.Reason[:v.ReasonLen]) - b += pad(int(v.ReasonLen)) + b += xgb.Pad(int(v.ReasonLen)) return buf } @@ -1604,7 +1621,7 @@ func SetupFailedListBytes(buf []byte, list []SetupFailed) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1613,22 +1630,22 @@ func SetupFailedListBytes(buf []byte, list []SetupFailed) int { func SetupFailedListSize(list []SetupFailed) int { size := 0 for _, item := range list { - size += (8 + pad((int(item.ReasonLen) * 1))) + size += (8 + xgb.Pad((int(item.ReasonLen) * 1))) } return size } // 'SetupAuthenticate' struct definition -// Size: (8 + pad(((int(Length) * 4) * 1))) +// Size: (8 + xgb.Pad(((int(Length) * 4) * 1))) type SetupAuthenticate struct { Status byte // padding: 5 bytes Length uint16 - Reason string // size: pad(((int(Length) * 4) * 1)) + Reason string // size: xgb.Pad(((int(Length) * 4) * 1)) } // Struct read SetupAuthenticate -func ReadSetupAuthenticate(buf []byte, v *SetupAuthenticate) int { +func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { b := 0 v.Status = buf[b] @@ -1636,32 +1653,32 @@ func ReadSetupAuthenticate(buf []byte, v *SetupAuthenticate) int { b += 5 // padding - v.Length = Get16(buf[b:]) + v.Length = xgb.Get16(buf[b:]) b += 2 { byteString := make([]byte, (int(v.Length) * 4)) copy(byteString[:(int(v.Length)*4)], buf[b:]) v.Reason = string(byteString) - b += pad(int((int(v.Length) * 4))) + b += xgb.Pad(int((int(v.Length) * 4))) } return b } // Struct list read SetupAuthenticate -func ReadSetupAuthenticateList(buf []byte, dest []SetupAuthenticate) int { +func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = SetupAuthenticate{} - b += ReadSetupAuthenticate(buf[b:], &dest[i]) + b += SetupAuthenticateRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write SetupAuthenticate func (v SetupAuthenticate) Bytes() []byte { - buf := make([]byte, (8 + pad(((int(v.Length) * 4) * 1)))) + buf := make([]byte, (8 + xgb.Pad(((int(v.Length) * 4) * 1)))) b := 0 buf[b] = v.Status @@ -1669,11 +1686,11 @@ func (v SetupAuthenticate) Bytes() []byte { b += 5 // padding - Put16(buf[b:], v.Length) + xgb.Put16(buf[b:], v.Length) b += 2 copy(buf[b:], v.Reason[:(int(v.Length)*4)]) - b += pad(int((int(v.Length) * 4))) + b += xgb.Pad(int((int(v.Length) * 4))) return buf } @@ -1685,7 +1702,7 @@ func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1694,13 +1711,13 @@ func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { func SetupAuthenticateListSize(list []SetupAuthenticate) int { size := 0 for _, item := range list { - size += (8 + pad(((int(item.Length) * 4) * 1))) + size += (8 + xgb.Pad(((int(item.Length) * 4) * 1))) } return size } // 'SetupInfo' struct definition -// Size: (((40 + pad((int(VendorLen) * 1))) + pad((int(PixmapFormatsLen) * 8))) + ScreenInfoListSize(Roots)) +// Size: (((40 + xgb.Pad((int(VendorLen) * 1))) + xgb.Pad((int(PixmapFormatsLen) * 8))) + ScreenInfoListSize(Roots)) type SetupInfo struct { Status byte // padding: 1 bytes @@ -1722,13 +1739,13 @@ type SetupInfo struct { MinKeycode Keycode MaxKeycode Keycode // padding: 4 bytes - Vendor string // size: pad((int(VendorLen) * 1)) - PixmapFormats []Format // size: pad((int(PixmapFormatsLen) * 8)) + Vendor string // size: xgb.Pad((int(VendorLen) * 1)) + PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) Roots []ScreenInfo // size: ScreenInfoListSize(Roots) } // Struct read SetupInfo -func ReadSetupInfo(buf []byte, v *SetupInfo) int { +func SetupInfoRead(buf []byte, v *SetupInfo) int { b := 0 v.Status = buf[b] @@ -1736,31 +1753,31 @@ func ReadSetupInfo(buf []byte, v *SetupInfo) int { b += 1 // padding - v.ProtocolMajorVersion = Get16(buf[b:]) + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) b += 2 - v.ProtocolMinorVersion = Get16(buf[b:]) + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) b += 2 - v.Length = Get16(buf[b:]) + v.Length = xgb.Get16(buf[b:]) b += 2 - v.ReleaseNumber = Get32(buf[b:]) + v.ReleaseNumber = xgb.Get32(buf[b:]) b += 4 - v.ResourceIdBase = Get32(buf[b:]) + v.ResourceIdBase = xgb.Get32(buf[b:]) b += 4 - v.ResourceIdMask = Get32(buf[b:]) + v.ResourceIdMask = xgb.Get32(buf[b:]) b += 4 - v.MotionBufferSize = Get32(buf[b:]) + v.MotionBufferSize = xgb.Get32(buf[b:]) b += 4 - v.VendorLen = Get16(buf[b:]) + v.VendorLen = xgb.Get16(buf[b:]) b += 2 - v.MaximumRequestLength = Get16(buf[b:]) + v.MaximumRequestLength = xgb.Get16(buf[b:]) b += 2 v.RootsLen = buf[b] @@ -1793,31 +1810,31 @@ func ReadSetupInfo(buf []byte, v *SetupInfo) int { byteString := make([]byte, v.VendorLen) copy(byteString[:v.VendorLen], buf[b:]) v.Vendor = string(byteString) - b += pad(int(v.VendorLen)) + b += xgb.Pad(int(v.VendorLen)) } v.PixmapFormats = make([]Format, v.PixmapFormatsLen) - b += ReadFormatList(buf[b:], v.PixmapFormats) + b += FormatReadList(buf[b:], v.PixmapFormats) v.Roots = make([]ScreenInfo, v.RootsLen) - b += ReadScreenInfoList(buf[b:], v.Roots) + b += ScreenInfoReadList(buf[b:], v.Roots) return b } // Struct list read SetupInfo -func ReadSetupInfoList(buf []byte, dest []SetupInfo) int { +func SetupInfoReadList(buf []byte, dest []SetupInfo) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = SetupInfo{} - b += ReadSetupInfo(buf[b:], &dest[i]) + b += SetupInfoRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write SetupInfo func (v SetupInfo) Bytes() []byte { - buf := make([]byte, (((40 + pad((int(v.VendorLen) * 1))) + pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) + buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) b := 0 buf[b] = v.Status @@ -1825,31 +1842,31 @@ func (v SetupInfo) Bytes() []byte { b += 1 // padding - Put16(buf[b:], v.ProtocolMajorVersion) + xgb.Put16(buf[b:], v.ProtocolMajorVersion) b += 2 - Put16(buf[b:], v.ProtocolMinorVersion) + xgb.Put16(buf[b:], v.ProtocolMinorVersion) b += 2 - Put16(buf[b:], v.Length) + xgb.Put16(buf[b:], v.Length) b += 2 - Put32(buf[b:], v.ReleaseNumber) + xgb.Put32(buf[b:], v.ReleaseNumber) b += 4 - Put32(buf[b:], v.ResourceIdBase) + xgb.Put32(buf[b:], v.ResourceIdBase) b += 4 - Put32(buf[b:], v.ResourceIdMask) + xgb.Put32(buf[b:], v.ResourceIdMask) b += 4 - Put32(buf[b:], v.MotionBufferSize) + xgb.Put32(buf[b:], v.MotionBufferSize) b += 4 - Put16(buf[b:], v.VendorLen) + xgb.Put16(buf[b:], v.VendorLen) b += 2 - Put16(buf[b:], v.MaximumRequestLength) + xgb.Put16(buf[b:], v.MaximumRequestLength) b += 2 buf[b] = v.RootsLen @@ -1879,7 +1896,7 @@ func (v SetupInfo) Bytes() []byte { b += 4 // padding copy(buf[b:], v.Vendor[:v.VendorLen]) - b += pad(int(v.VendorLen)) + b += xgb.Pad(int(v.VendorLen)) b += FormatListBytes(buf[b:], v.PixmapFormats) @@ -1895,7 +1912,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1904,7 +1921,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { func SetupInfoListSize(list []SetupInfo) int { size := 0 for _, item := range list { - size += (((40 + pad((int(item.VendorLen) * 1))) + pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) + size += (((40 + xgb.Pad((int(item.VendorLen) * 1))) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) } return size } @@ -1918,29 +1935,29 @@ type Timecoord struct { } // Struct read Timecoord -func ReadTimecoord(buf []byte, v *Timecoord) int { +func TimecoordRead(buf []byte, v *Timecoord) int { b := 0 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 return b } // Struct list read Timecoord -func ReadTimecoordList(buf []byte, dest []Timecoord) int { +func TimecoordReadList(buf []byte, dest []Timecoord) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Timecoord{} - b += ReadTimecoord(buf[b:], &dest[i]) + b += TimecoordRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Timecoord @@ -1948,13 +1965,13 @@ func (v Timecoord) Bytes() []byte { buf := make([]byte, 8) b := 0 - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 return buf @@ -1967,7 +1984,7 @@ func TimecoordListBytes(buf []byte, list []Timecoord) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -1980,26 +1997,26 @@ type Fontprop struct { } // Struct read Fontprop -func ReadFontprop(buf []byte, v *Fontprop) int { +func FontpropRead(buf []byte, v *Fontprop) int { b := 0 - v.Name = Atom(Get32(buf[b:])) + v.Name = Atom(xgb.Get32(buf[b:])) b += 4 - v.Value = Get32(buf[b:]) + v.Value = xgb.Get32(buf[b:]) b += 4 return b } // Struct list read Fontprop -func ReadFontpropList(buf []byte, dest []Fontprop) int { +func FontpropReadList(buf []byte, dest []Fontprop) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Fontprop{} - b += ReadFontprop(buf[b:], &dest[i]) + b += FontpropRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Fontprop @@ -2007,10 +2024,10 @@ func (v Fontprop) Bytes() []byte { buf := make([]byte, 8) b := 0 - Put32(buf[b:], uint32(v.Name)) + xgb.Put32(buf[b:], uint32(v.Name)) b += 4 - Put32(buf[b:], v.Value) + xgb.Put32(buf[b:], v.Value) b += 4 return buf @@ -2023,7 +2040,7 @@ func FontpropListBytes(buf []byte, list []Fontprop) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -2040,38 +2057,38 @@ type Charinfo struct { } // Struct read Charinfo -func ReadCharinfo(buf []byte, v *Charinfo) int { +func CharinfoRead(buf []byte, v *Charinfo) int { b := 0 - v.LeftSideBearing = int16(Get16(buf[b:])) + v.LeftSideBearing = int16(xgb.Get16(buf[b:])) b += 2 - v.RightSideBearing = int16(Get16(buf[b:])) + v.RightSideBearing = int16(xgb.Get16(buf[b:])) b += 2 - v.CharacterWidth = int16(Get16(buf[b:])) + v.CharacterWidth = int16(xgb.Get16(buf[b:])) b += 2 - v.Ascent = int16(Get16(buf[b:])) + v.Ascent = int16(xgb.Get16(buf[b:])) b += 2 - v.Descent = int16(Get16(buf[b:])) + v.Descent = int16(xgb.Get16(buf[b:])) b += 2 - v.Attributes = Get16(buf[b:]) + v.Attributes = xgb.Get16(buf[b:]) b += 2 return b } // Struct list read Charinfo -func ReadCharinfoList(buf []byte, dest []Charinfo) int { +func CharinfoReadList(buf []byte, dest []Charinfo) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Charinfo{} - b += ReadCharinfo(buf[b:], &dest[i]) + b += CharinfoRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Charinfo @@ -2079,22 +2096,22 @@ func (v Charinfo) Bytes() []byte { buf := make([]byte, 12) b := 0 - Put16(buf[b:], uint16(v.LeftSideBearing)) + xgb.Put16(buf[b:], uint16(v.LeftSideBearing)) b += 2 - Put16(buf[b:], uint16(v.RightSideBearing)) + xgb.Put16(buf[b:], uint16(v.RightSideBearing)) b += 2 - Put16(buf[b:], uint16(v.CharacterWidth)) + xgb.Put16(buf[b:], uint16(v.CharacterWidth)) b += 2 - Put16(buf[b:], uint16(v.Ascent)) + xgb.Put16(buf[b:], uint16(v.Ascent)) b += 2 - Put16(buf[b:], uint16(v.Descent)) + xgb.Put16(buf[b:], uint16(v.Descent)) b += 2 - Put16(buf[b:], v.Attributes) + xgb.Put16(buf[b:], v.Attributes) b += 2 return buf @@ -2107,20 +2124,20 @@ func CharinfoListBytes(buf []byte, list []Charinfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } // 'Str' struct definition -// Size: (1 + pad((int(NameLen) * 1))) +// Size: (1 + xgb.Pad((int(NameLen) * 1))) type Str struct { NameLen byte - Name string // size: pad((int(NameLen) * 1)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Struct read Str -func ReadStr(buf []byte, v *Str) int { +func StrRead(buf []byte, v *Str) int { b := 0 v.NameLen = buf[b] @@ -2130,32 +2147,32 @@ func ReadStr(buf []byte, v *Str) int { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += pad(int(v.NameLen)) + b += xgb.Pad(int(v.NameLen)) } return b } // Struct list read Str -func ReadStrList(buf []byte, dest []Str) int { +func StrReadList(buf []byte, dest []Str) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Str{} - b += ReadStr(buf[b:], &dest[i]) + b += StrRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Str func (v Str) Bytes() []byte { - buf := make([]byte, (1 + pad((int(v.NameLen) * 1)))) + buf := make([]byte, (1 + xgb.Pad((int(v.NameLen) * 1)))) b := 0 buf[b] = v.NameLen b += 1 copy(buf[b:], v.Name[:v.NameLen]) - b += pad(int(v.NameLen)) + b += xgb.Pad(int(v.NameLen)) return buf } @@ -2167,7 +2184,7 @@ func StrListBytes(buf []byte, list []Str) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -2176,7 +2193,7 @@ func StrListBytes(buf []byte, list []Str) int { func StrListSize(list []Str) int { size := 0 for _, item := range list { - size += (1 + pad((int(item.NameLen) * 1))) + size += (1 + xgb.Pad((int(item.NameLen) * 1))) } return size } @@ -2191,32 +2208,32 @@ type Segment struct { } // Struct read Segment -func ReadSegment(buf []byte, v *Segment) int { +func SegmentRead(buf []byte, v *Segment) int { b := 0 - v.X1 = int16(Get16(buf[b:])) + v.X1 = int16(xgb.Get16(buf[b:])) b += 2 - v.Y1 = int16(Get16(buf[b:])) + v.Y1 = int16(xgb.Get16(buf[b:])) b += 2 - v.X2 = int16(Get16(buf[b:])) + v.X2 = int16(xgb.Get16(buf[b:])) b += 2 - v.Y2 = int16(Get16(buf[b:])) + v.Y2 = int16(xgb.Get16(buf[b:])) b += 2 return b } // Struct list read Segment -func ReadSegmentList(buf []byte, dest []Segment) int { +func SegmentReadList(buf []byte, dest []Segment) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Segment{} - b += ReadSegment(buf[b:], &dest[i]) + b += SegmentRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Segment @@ -2224,16 +2241,16 @@ func (v Segment) Bytes() []byte { buf := make([]byte, 8) b := 0 - Put16(buf[b:], uint16(v.X1)) + xgb.Put16(buf[b:], uint16(v.X1)) b += 2 - Put16(buf[b:], uint16(v.Y1)) + xgb.Put16(buf[b:], uint16(v.Y1)) b += 2 - Put16(buf[b:], uint16(v.X2)) + xgb.Put16(buf[b:], uint16(v.X2)) b += 2 - Put16(buf[b:], uint16(v.Y2)) + xgb.Put16(buf[b:], uint16(v.Y2)) b += 2 return buf @@ -2246,7 +2263,7 @@ func SegmentListBytes(buf []byte, list []Segment) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -2263,19 +2280,19 @@ type Coloritem struct { } // Struct read Coloritem -func ReadColoritem(buf []byte, v *Coloritem) int { +func ColoritemRead(buf []byte, v *Coloritem) int { b := 0 - v.Pixel = Get32(buf[b:]) + v.Pixel = xgb.Get32(buf[b:]) b += 4 - v.Red = Get16(buf[b:]) + v.Red = xgb.Get16(buf[b:]) b += 2 - v.Green = Get16(buf[b:]) + v.Green = xgb.Get16(buf[b:]) b += 2 - v.Blue = Get16(buf[b:]) + v.Blue = xgb.Get16(buf[b:]) b += 2 v.Flags = buf[b] @@ -2287,13 +2304,13 @@ func ReadColoritem(buf []byte, v *Coloritem) int { } // Struct list read Coloritem -func ReadColoritemList(buf []byte, dest []Coloritem) int { +func ColoritemReadList(buf []byte, dest []Coloritem) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Coloritem{} - b += ReadColoritem(buf[b:], &dest[i]) + b += ColoritemRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Coloritem @@ -2301,16 +2318,16 @@ func (v Coloritem) Bytes() []byte { buf := make([]byte, 12) b := 0 - Put32(buf[b:], v.Pixel) + xgb.Put32(buf[b:], v.Pixel) b += 4 - Put16(buf[b:], v.Red) + xgb.Put16(buf[b:], v.Red) b += 2 - Put16(buf[b:], v.Green) + xgb.Put16(buf[b:], v.Green) b += 2 - Put16(buf[b:], v.Blue) + xgb.Put16(buf[b:], v.Blue) b += 2 buf[b] = v.Flags @@ -2328,7 +2345,7 @@ func ColoritemListBytes(buf []byte, list []Coloritem) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -2343,16 +2360,16 @@ type Rgb struct { } // Struct read Rgb -func ReadRgb(buf []byte, v *Rgb) int { +func RgbRead(buf []byte, v *Rgb) int { b := 0 - v.Red = Get16(buf[b:]) + v.Red = xgb.Get16(buf[b:]) b += 2 - v.Green = Get16(buf[b:]) + v.Green = xgb.Get16(buf[b:]) b += 2 - v.Blue = Get16(buf[b:]) + v.Blue = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -2361,13 +2378,13 @@ func ReadRgb(buf []byte, v *Rgb) int { } // Struct list read Rgb -func ReadRgbList(buf []byte, dest []Rgb) int { +func RgbReadList(buf []byte, dest []Rgb) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Rgb{} - b += ReadRgb(buf[b:], &dest[i]) + b += RgbRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Rgb @@ -2375,13 +2392,13 @@ func (v Rgb) Bytes() []byte { buf := make([]byte, 8) b := 0 - Put16(buf[b:], v.Red) + xgb.Put16(buf[b:], v.Red) b += 2 - Put16(buf[b:], v.Green) + xgb.Put16(buf[b:], v.Green) b += 2 - Put16(buf[b:], v.Blue) + xgb.Put16(buf[b:], v.Blue) b += 2 b += 2 // padding @@ -2396,22 +2413,22 @@ func RgbListBytes(buf []byte, list []Rgb) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } // 'Host' struct definition -// Size: (4 + pad((int(AddressLen) * 1))) +// Size: (4 + xgb.Pad((int(AddressLen) * 1))) type Host struct { Family byte // padding: 1 bytes AddressLen uint16 - Address []byte // size: pad((int(AddressLen) * 1)) + Address []byte // size: xgb.Pad((int(AddressLen) * 1)) } // Struct read Host -func ReadHost(buf []byte, v *Host) int { +func HostRead(buf []byte, v *Host) int { b := 0 v.Family = buf[b] @@ -2419,29 +2436,29 @@ func ReadHost(buf []byte, v *Host) int { b += 1 // padding - v.AddressLen = Get16(buf[b:]) + v.AddressLen = xgb.Get16(buf[b:]) b += 2 v.Address = make([]byte, v.AddressLen) copy(v.Address[:v.AddressLen], buf[b:]) - b += pad(int(v.AddressLen)) + b += xgb.Pad(int(v.AddressLen)) return b } // Struct list read Host -func ReadHostList(buf []byte, dest []Host) int { +func HostReadList(buf []byte, dest []Host) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = Host{} - b += ReadHost(buf[b:], &dest[i]) + b += HostRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Struct write Host func (v Host) Bytes() []byte { - buf := make([]byte, (4 + pad((int(v.AddressLen) * 1)))) + buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) b := 0 buf[b] = v.Family @@ -2449,11 +2466,11 @@ func (v Host) Bytes() []byte { b += 1 // padding - Put16(buf[b:], v.AddressLen) + xgb.Put16(buf[b:], v.AddressLen) b += 2 copy(buf[b:], v.Address[:v.AddressLen]) - b += pad(int(v.AddressLen)) + b += xgb.Pad(int(v.AddressLen)) return buf } @@ -2465,7 +2482,7 @@ func HostListBytes(buf []byte, list []Host) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += pad(len(structBytes)) + b += xgb.Pad(len(structBytes)) } return b } @@ -2474,7 +2491,7 @@ func HostListBytes(buf []byte, list []Host) int { func HostListSize(list []Host) int { size := 0 for _, item := range list { - size += (4 + pad((int(item.AddressLen) * 1))) + size += (4 + xgb.Pad((int(item.AddressLen) * 1))) } return size } @@ -2483,9 +2500,9 @@ func HostListSize(list []Host) int { // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). // Instead use one of the following constructors for 'ClientMessageDataUnion': -// NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion -// NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion -// NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion +// ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion +// ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion +// ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion type ClientMessageDataUnion struct { Data8 []byte // size: 20 Data16 []uint16 // size: 20 @@ -2493,12 +2510,12 @@ type ClientMessageDataUnion struct { } // Union constructor for ClientMessageDataUnion for field Data8. -func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion { +func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { var b int buf := make([]byte, 20) copy(buf[b:], Data8[:20]) - b += pad(int(20)) + b += xgb.Pad(int(20)) // Create the Union type v := ClientMessageDataUnion{} @@ -2508,37 +2525,37 @@ func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += pad(int(20)) + b += xgb.Pad(int(20)) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) for i := 0; i < int(10); i++ { - v.Data16[i] = Get16(buf[b:]) + v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = pad(b) + b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) for i := 0; i < int(5); i++ { - v.Data32[i] = Get32(buf[b:]) + v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } // Union constructor for ClientMessageDataUnion for field Data16. -func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion { +func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { var b int buf := make([]byte, 20) for i := 0; i < int(10); i++ { - Put16(buf[b:], Data16[i]) + xgb.Put16(buf[b:], Data16[i]) b += 2 } - b = pad(b) + b = xgb.Pad(b) // Create the Union type v := ClientMessageDataUnion{} @@ -2548,37 +2565,37 @@ func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += pad(int(20)) + b += xgb.Pad(int(20)) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) for i := 0; i < int(10); i++ { - v.Data16[i] = Get16(buf[b:]) + v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = pad(b) + b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) for i := 0; i < int(5); i++ { - v.Data32[i] = Get32(buf[b:]) + v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } // Union constructor for ClientMessageDataUnion for field Data32. -func NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion { +func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { var b int buf := make([]byte, 20) for i := 0; i < int(5); i++ { - Put32(buf[b:], Data32[i]) + xgb.Put32(buf[b:], Data32[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) // Create the Union type v := ClientMessageDataUnion{} @@ -2588,63 +2605,63 @@ func NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += pad(int(20)) + b += xgb.Pad(int(20)) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) for i := 0; i < int(10); i++ { - v.Data16[i] = Get16(buf[b:]) + v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = pad(b) + b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) for i := 0; i < int(5); i++ { - v.Data32[i] = Get32(buf[b:]) + v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } // Union read ClientMessageDataUnion -func ReadClientMessageDataUnion(buf []byte, v *ClientMessageDataUnion) int { +func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { var b int b = 0 // re-read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += pad(int(20)) + b += xgb.Pad(int(20)) b = 0 // re-read the same bytes v.Data16 = make([]uint16, 10) for i := 0; i < int(10); i++ { - v.Data16[i] = Get16(buf[b:]) + v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = pad(b) + b = xgb.Pad(b) b = 0 // re-read the same bytes v.Data32 = make([]uint32, 5) for i := 0; i < int(5); i++ { - v.Data32[i] = Get32(buf[b:]) + v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return 20 } // Union list read ClientMessageDataUnion -func ReadClientMessageDataUnionList(buf []byte, dest []ClientMessageDataUnion) int { +func ClientMessageDataUnionReadList(buf []byte, dest []ClientMessageDataUnion) int { b := 0 for i := 0; i < len(dest); i++ { dest[i] = ClientMessageDataUnion{} - b += ReadClientMessageDataUnion(buf[b:], &dest[i]) + b += ClientMessageDataUnionRead(buf[b:], &dest[i]) } - return pad(b) + return xgb.Pad(b) } // Union write ClientMessageDataUnion @@ -2655,7 +2672,7 @@ func (v ClientMessageDataUnion) Bytes() []byte { b := 0 copy(buf[b:], v.Data8[:20]) - b += pad(int(20)) + b += xgb.Pad(int(20)) return buf } @@ -2666,7 +2683,7 @@ func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) for _, item := range list { unionBytes = item.Bytes() copy(buf[b:], unionBytes) - b += pad(len(unionBytes)) + b += xgb.Pad(len(unionBytes)) } return b } @@ -2693,41 +2710,41 @@ type KeyPressEvent struct { } // Event read KeyPress -func NewKeyPressEvent(buf []byte) Event { +func KeyPressEventNew(buf []byte) xgb.Event { v := KeyPressEvent{} b := 1 // don't read event number v.Detail = Keycode(buf[b]) b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.RootX = int16(Get16(buf[b:])) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.RootY = int16(Get16(buf[b:])) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.EventX = int16(Get16(buf[b:])) + v.EventX = int16(xgb.Get16(buf[b:])) b += 2 - v.EventY = int16(Get16(buf[b:])) + v.EventY = int16(xgb.Get16(buf[b:])) b += 2 - v.State = Get16(buf[b:]) + v.State = xgb.Get16(buf[b:]) b += 2 if buf[b] == 1 { @@ -2756,31 +2773,31 @@ func (v KeyPressEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Root)) + xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Child)) + xgb.Put32(buf[b:], uint32(v.Child)) b += 4 - Put16(buf[b:], uint16(v.RootX)) + xgb.Put16(buf[b:], uint16(v.RootX)) b += 2 - Put16(buf[b:], uint16(v.RootY)) + xgb.Put16(buf[b:], uint16(v.RootY)) b += 2 - Put16(buf[b:], uint16(v.EventX)) + xgb.Put16(buf[b:], uint16(v.EventX)) b += 2 - Put16(buf[b:], uint16(v.EventY)) + xgb.Put16(buf[b:], uint16(v.EventY)) b += 2 - Put16(buf[b:], v.State) + xgb.Put16(buf[b:], v.State) b += 2 if v.SameScreen { @@ -2803,23 +2820,23 @@ func (v KeyPressEvent) SequenceId() uint16 { func (v KeyPressEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - return "KeyPress {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "KeyPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[2] = NewKeyPressEvent + xgb.NewEventFuncs[2] = KeyPressEventNew } // Event definition ButtonPress (4) @@ -2844,41 +2861,41 @@ type ButtonPressEvent struct { } // Event read ButtonPress -func NewButtonPressEvent(buf []byte) Event { +func ButtonPressEventNew(buf []byte) xgb.Event { v := ButtonPressEvent{} b := 1 // don't read event number v.Detail = Button(buf[b]) b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.RootX = int16(Get16(buf[b:])) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.RootY = int16(Get16(buf[b:])) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.EventX = int16(Get16(buf[b:])) + v.EventX = int16(xgb.Get16(buf[b:])) b += 2 - v.EventY = int16(Get16(buf[b:])) + v.EventY = int16(xgb.Get16(buf[b:])) b += 2 - v.State = Get16(buf[b:]) + v.State = xgb.Get16(buf[b:]) b += 2 if buf[b] == 1 { @@ -2907,31 +2924,31 @@ func (v ButtonPressEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Root)) + xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Child)) + xgb.Put32(buf[b:], uint32(v.Child)) b += 4 - Put16(buf[b:], uint16(v.RootX)) + xgb.Put16(buf[b:], uint16(v.RootX)) b += 2 - Put16(buf[b:], uint16(v.RootY)) + xgb.Put16(buf[b:], uint16(v.RootY)) b += 2 - Put16(buf[b:], uint16(v.EventX)) + xgb.Put16(buf[b:], uint16(v.EventX)) b += 2 - Put16(buf[b:], uint16(v.EventY)) + xgb.Put16(buf[b:], uint16(v.EventY)) b += 2 - Put16(buf[b:], v.State) + xgb.Put16(buf[b:], v.State) b += 2 if v.SameScreen { @@ -2954,23 +2971,23 @@ func (v ButtonPressEvent) SequenceId() uint16 { func (v ButtonPressEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - return "ButtonPress {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[4] = NewButtonPressEvent + xgb.NewEventFuncs[4] = ButtonPressEventNew } // Event definition MotionNotify (6) @@ -2995,41 +3012,41 @@ type MotionNotifyEvent struct { } // Event read MotionNotify -func NewMotionNotifyEvent(buf []byte) Event { +func MotionNotifyEventNew(buf []byte) xgb.Event { v := MotionNotifyEvent{} b := 1 // don't read event number v.Detail = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.RootX = int16(Get16(buf[b:])) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.RootY = int16(Get16(buf[b:])) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.EventX = int16(Get16(buf[b:])) + v.EventX = int16(xgb.Get16(buf[b:])) b += 2 - v.EventY = int16(Get16(buf[b:])) + v.EventY = int16(xgb.Get16(buf[b:])) b += 2 - v.State = Get16(buf[b:]) + v.State = xgb.Get16(buf[b:]) b += 2 if buf[b] == 1 { @@ -3058,31 +3075,31 @@ func (v MotionNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Root)) + xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Child)) + xgb.Put32(buf[b:], uint32(v.Child)) b += 4 - Put16(buf[b:], uint16(v.RootX)) + xgb.Put16(buf[b:], uint16(v.RootX)) b += 2 - Put16(buf[b:], uint16(v.RootY)) + xgb.Put16(buf[b:], uint16(v.RootY)) b += 2 - Put16(buf[b:], uint16(v.EventX)) + xgb.Put16(buf[b:], uint16(v.EventX)) b += 2 - Put16(buf[b:], uint16(v.EventY)) + xgb.Put16(buf[b:], uint16(v.EventY)) b += 2 - Put16(buf[b:], v.State) + xgb.Put16(buf[b:], v.State) b += 2 if v.SameScreen { @@ -3105,23 +3122,23 @@ func (v MotionNotifyEvent) SequenceId() uint16 { func (v MotionNotifyEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - return "MotionNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "MotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[6] = NewMotionNotifyEvent + xgb.NewEventFuncs[6] = MotionNotifyEventNew } // Event definition EnterNotify (7) @@ -3146,41 +3163,41 @@ type EnterNotifyEvent struct { } // Event read EnterNotify -func NewEnterNotifyEvent(buf []byte) Event { +func EnterNotifyEventNew(buf []byte) xgb.Event { v := EnterNotifyEvent{} b := 1 // don't read event number v.Detail = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.RootX = int16(Get16(buf[b:])) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.RootY = int16(Get16(buf[b:])) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.EventX = int16(Get16(buf[b:])) + v.EventX = int16(xgb.Get16(buf[b:])) b += 2 - v.EventY = int16(Get16(buf[b:])) + v.EventY = int16(xgb.Get16(buf[b:])) b += 2 - v.State = Get16(buf[b:]) + v.State = xgb.Get16(buf[b:]) b += 2 v.Mode = buf[b] @@ -3206,31 +3223,31 @@ func (v EnterNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Root)) + xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Child)) + xgb.Put32(buf[b:], uint32(v.Child)) b += 4 - Put16(buf[b:], uint16(v.RootX)) + xgb.Put16(buf[b:], uint16(v.RootX)) b += 2 - Put16(buf[b:], uint16(v.RootY)) + xgb.Put16(buf[b:], uint16(v.RootY)) b += 2 - Put16(buf[b:], uint16(v.EventX)) + xgb.Put16(buf[b:], uint16(v.EventX)) b += 2 - Put16(buf[b:], uint16(v.EventY)) + xgb.Put16(buf[b:], uint16(v.EventY)) b += 2 - Put16(buf[b:], v.State) + xgb.Put16(buf[b:], v.State) b += 2 buf[b] = v.Mode @@ -3250,24 +3267,24 @@ func (v EnterNotifyEvent) SequenceId() uint16 { func (v EnterNotifyEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, sprintf("SameScreenFocus: %d", v.SameScreenFocus)) - return "EnterNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "EnterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[7] = NewEnterNotifyEvent + xgb.NewEventFuncs[7] = EnterNotifyEventNew } // Event definition FocusIn (9) @@ -3284,17 +3301,17 @@ type FocusInEvent struct { } // Event read FocusIn -func NewFocusInEvent(buf []byte) Event { +func FocusInEventNew(buf []byte) xgb.Event { v := FocusInEvent{} b := 1 // don't read event number v.Detail = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 v.Mode = buf[b] @@ -3319,7 +3336,7 @@ func (v FocusInEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 buf[b] = v.Mode @@ -3338,15 +3355,15 @@ func (v FocusInEvent) SequenceId() uint16 { func (v FocusInEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - return "FocusIn {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[9] = NewFocusInEvent + xgb.NewEventFuncs[9] = FocusInEventNew } // Event definition KeymapNotify (11) @@ -3359,13 +3376,13 @@ type KeymapNotifyEvent struct { } // Event read KeymapNotify -func NewKeymapNotifyEvent(buf []byte) Event { +func KeymapNotifyEventNew(buf []byte) xgb.Event { v := KeymapNotifyEvent{} b := 1 // don't read event number v.Keys = make([]byte, 31) copy(v.Keys[:31], buf[b:]) - b += pad(int(31)) + b += xgb.Pad(int(31)) return v } @@ -3380,7 +3397,7 @@ func (v KeymapNotifyEvent) Bytes() []byte { b += 1 copy(buf[b:], v.Keys[:31]) - b += pad(int(31)) + b += xgb.Pad(int(31)) return buf } @@ -3393,11 +3410,11 @@ func (v KeymapNotifyEvent) SequenceId() uint16 { func (v KeymapNotifyEvent) String() string { fieldVals := make([]string, 0, 1) - return "KeymapNotify {" + stringsJoin(fieldVals, ", ") + "}" + return "KeymapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[11] = NewKeymapNotifyEvent + xgb.NewEventFuncs[11] = KeymapNotifyEventNew } // Event definition Expose (12) @@ -3418,31 +3435,31 @@ type ExposeEvent struct { } // Event read Expose -func NewExposeEvent(buf []byte) Event { +func ExposeEventNew(buf []byte) xgb.Event { v := ExposeEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.X = Get16(buf[b:]) + v.X = xgb.Get16(buf[b:]) b += 2 - v.Y = Get16(buf[b:]) + v.Y = xgb.Get16(buf[b:]) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.Count = Get16(buf[b:]) + v.Count = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -3463,22 +3480,22 @@ func (v ExposeEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put16(buf[b:], v.X) + xgb.Put16(buf[b:], v.X) b += 2 - Put16(buf[b:], v.Y) + xgb.Put16(buf[b:], v.Y) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], v.Count) + xgb.Put16(buf[b:], v.Count) b += 2 b += 2 // padding @@ -3494,18 +3511,18 @@ func (v ExposeEvent) SequenceId() uint16 { func (v ExposeEvent) String() string { fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - return "Expose {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + return "Expose {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[12] = NewExposeEvent + xgb.NewEventFuncs[12] = ExposeEventNew } // Event definition GraphicsExposure (13) @@ -3528,34 +3545,34 @@ type GraphicsExposureEvent struct { } // Event read GraphicsExposure -func NewGraphicsExposureEvent(buf []byte) Event { +func GraphicsExposureEventNew(buf []byte) xgb.Event { v := GraphicsExposureEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Drawable = Drawable(Get32(buf[b:])) + v.Drawable = Drawable(xgb.Get32(buf[b:])) b += 4 - v.X = Get16(buf[b:]) + v.X = xgb.Get16(buf[b:]) b += 2 - v.Y = Get16(buf[b:]) + v.Y = xgb.Get16(buf[b:]) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.MinorOpcode = Get16(buf[b:]) + v.MinorOpcode = xgb.Get16(buf[b:]) b += 2 - v.Count = Get16(buf[b:]) + v.Count = xgb.Get16(buf[b:]) b += 2 v.MajorOpcode = buf[b] @@ -3579,25 +3596,25 @@ func (v GraphicsExposureEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Drawable)) + xgb.Put32(buf[b:], uint32(v.Drawable)) b += 4 - Put16(buf[b:], v.X) + xgb.Put16(buf[b:], v.X) b += 2 - Put16(buf[b:], v.Y) + xgb.Put16(buf[b:], v.Y) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], v.MinorOpcode) + xgb.Put16(buf[b:], v.MinorOpcode) b += 2 - Put16(buf[b:], v.Count) + xgb.Put16(buf[b:], v.Count) b += 2 buf[b] = v.MajorOpcode @@ -3616,20 +3633,20 @@ func (v GraphicsExposureEvent) SequenceId() uint16 { func (v GraphicsExposureEvent) String() string { fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", v.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", v.MajorOpcode)) - return "GraphicsExposure {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "GraphicsExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[13] = NewGraphicsExposureEvent + xgb.NewEventFuncs[13] = GraphicsExposureEventNew } // Event definition NoExposure (14) @@ -3647,19 +3664,19 @@ type NoExposureEvent struct { } // Event read NoExposure -func NewNoExposureEvent(buf []byte) Event { +func NoExposureEventNew(buf []byte) xgb.Event { v := NoExposureEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Drawable = Drawable(Get32(buf[b:])) + v.Drawable = Drawable(xgb.Get32(buf[b:])) b += 4 - v.MinorOpcode = Get16(buf[b:]) + v.MinorOpcode = xgb.Get16(buf[b:]) b += 2 v.MajorOpcode = buf[b] @@ -3683,10 +3700,10 @@ func (v NoExposureEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Drawable)) + xgb.Put32(buf[b:], uint32(v.Drawable)) b += 4 - Put16(buf[b:], v.MinorOpcode) + xgb.Put16(buf[b:], v.MinorOpcode) b += 2 buf[b] = v.MajorOpcode @@ -3705,15 +3722,15 @@ func (v NoExposureEvent) SequenceId() uint16 { func (v NoExposureEvent) String() string { fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", v.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", v.MajorOpcode)) - return "NoExposure {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "NoExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[14] = NewNoExposureEvent + xgb.NewEventFuncs[14] = NoExposureEventNew } // Event definition VisibilityNotify (15) @@ -3730,16 +3747,16 @@ type VisibilityNotifyEvent struct { } // Event read VisibilityNotify -func NewVisibilityNotifyEvent(buf []byte) Event { +func VisibilityNotifyEventNew(buf []byte) xgb.Event { v := VisibilityNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 v.State = buf[b] @@ -3763,7 +3780,7 @@ func (v VisibilityNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 buf[b] = v.State @@ -3782,14 +3799,14 @@ func (v VisibilityNotifyEvent) SequenceId() uint16 { func (v VisibilityNotifyEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - return "VisibilityNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "VisibilityNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[15] = NewVisibilityNotifyEvent + xgb.NewEventFuncs[15] = VisibilityNotifyEventNew } // Event definition CreateNotify (16) @@ -3812,34 +3829,34 @@ type CreateNotifyEvent struct { } // Event read CreateNotify -func NewCreateNotifyEvent(buf []byte) Event { +func CreateNotifyEventNew(buf []byte) xgb.Event { v := CreateNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Parent = Window(Get32(buf[b:])) + v.Parent = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.BorderWidth = Get16(buf[b:]) + v.BorderWidth = xgb.Get16(buf[b:]) b += 2 if buf[b] == 1 { @@ -3867,25 +3884,25 @@ func (v CreateNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Parent)) + xgb.Put32(buf[b:], uint32(v.Parent)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], v.BorderWidth) + xgb.Put16(buf[b:], v.BorderWidth) b += 2 if v.OverrideRedirect { @@ -3908,20 +3925,20 @@ func (v CreateNotifyEvent) SequenceId() uint16 { func (v CreateNotifyEvent) String() string { fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) - fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "CreateNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "CreateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[16] = NewCreateNotifyEvent + xgb.NewEventFuncs[16] = CreateNotifyEventNew } // Event definition DestroyNotify (17) @@ -3937,19 +3954,19 @@ type DestroyNotifyEvent struct { } // Event read DestroyNotify -func NewDestroyNotifyEvent(buf []byte) Event { +func DestroyNotifyEventNew(buf []byte) xgb.Event { v := DestroyNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 return v @@ -3968,10 +3985,10 @@ func (v DestroyNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 return buf @@ -3985,14 +4002,14 @@ func (v DestroyNotifyEvent) SequenceId() uint16 { func (v DestroyNotifyEvent) String() string { fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - return "DestroyNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + return "DestroyNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[17] = NewDestroyNotifyEvent + xgb.NewEventFuncs[17] = DestroyNotifyEventNew } // Event definition UnmapNotify (18) @@ -4010,19 +4027,19 @@ type UnmapNotifyEvent struct { } // Event read UnmapNotify -func NewUnmapNotifyEvent(buf []byte) Event { +func UnmapNotifyEventNew(buf []byte) xgb.Event { v := UnmapNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -4050,10 +4067,10 @@ func (v UnmapNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 if v.FromConfigure { @@ -4076,15 +4093,15 @@ func (v UnmapNotifyEvent) SequenceId() uint16 { func (v UnmapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("FromConfigure: %t", v.FromConfigure)) - return "UnmapNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("FromConfigure: %t", v.FromConfigure)) + return "UnmapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[18] = NewUnmapNotifyEvent + xgb.NewEventFuncs[18] = UnmapNotifyEventNew } // Event definition MapNotify (19) @@ -4102,19 +4119,19 @@ type MapNotifyEvent struct { } // Event read MapNotify -func NewMapNotifyEvent(buf []byte) Event { +func MapNotifyEventNew(buf []byte) xgb.Event { v := MapNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -4142,10 +4159,10 @@ func (v MapNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 if v.OverrideRedirect { @@ -4168,15 +4185,15 @@ func (v MapNotifyEvent) SequenceId() uint16 { func (v MapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "MapNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "MapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[19] = NewMapNotifyEvent + xgb.NewEventFuncs[19] = MapNotifyEventNew } // Event definition MapRequest (20) @@ -4192,19 +4209,19 @@ type MapRequestEvent struct { } // Event read MapRequest -func NewMapRequestEvent(buf []byte) Event { +func MapRequestEventNew(buf []byte) xgb.Event { v := MapRequestEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Parent = Window(Get32(buf[b:])) + v.Parent = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 return v @@ -4223,10 +4240,10 @@ func (v MapRequestEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Parent)) + xgb.Put32(buf[b:], uint32(v.Parent)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 return buf @@ -4240,14 +4257,14 @@ func (v MapRequestEvent) SequenceId() uint16 { func (v MapRequestEvent) String() string { fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - return "MapRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + return "MapRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[20] = NewMapRequestEvent + xgb.NewEventFuncs[20] = MapRequestEventNew } // Event definition ReparentNotify (21) @@ -4268,28 +4285,28 @@ type ReparentNotifyEvent struct { } // Event read ReparentNotify -func NewReparentNotifyEvent(buf []byte) Event { +func ReparentNotifyEventNew(buf []byte) xgb.Event { v := ReparentNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Parent = Window(Get32(buf[b:])) + v.Parent = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 if buf[b] == 1 { @@ -4317,19 +4334,19 @@ func (v ReparentNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.Parent)) + xgb.Put32(buf[b:], uint32(v.Parent)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 if v.OverrideRedirect { @@ -4352,18 +4369,18 @@ func (v ReparentNotifyEvent) SequenceId() uint16 { func (v ReparentNotifyEvent) String() string { fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "ReparentNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "ReparentNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[21] = NewReparentNotifyEvent + xgb.NewEventFuncs[21] = ReparentNotifyEventNew } // Event definition ConfigureNotify (22) @@ -4387,37 +4404,37 @@ type ConfigureNotifyEvent struct { } // Event read ConfigureNotify -func NewConfigureNotifyEvent(buf []byte) Event { +func ConfigureNotifyEventNew(buf []byte) xgb.Event { v := ConfigureNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.AboveSibling = Window(Get32(buf[b:])) + v.AboveSibling = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.BorderWidth = Get16(buf[b:]) + v.BorderWidth = xgb.Get16(buf[b:]) b += 2 if buf[b] == 1 { @@ -4445,28 +4462,28 @@ func (v ConfigureNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.AboveSibling)) + xgb.Put32(buf[b:], uint32(v.AboveSibling)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], v.BorderWidth) + xgb.Put16(buf[b:], v.BorderWidth) b += 2 if v.OverrideRedirect { @@ -4489,21 +4506,21 @@ func (v ConfigureNotifyEvent) SequenceId() uint16 { func (v ConfigureNotifyEvent) String() string { fieldVals := make([]string, 0, 11) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("AboveSibling: %d", v.AboveSibling)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) - fieldVals = append(fieldVals, sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "ConfigureNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("AboveSibling: %d", v.AboveSibling)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "ConfigureNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[22] = NewConfigureNotifyEvent + xgb.NewEventFuncs[22] = ConfigureNotifyEventNew } // Event definition ConfigureRequest (23) @@ -4526,41 +4543,41 @@ type ConfigureRequestEvent struct { } // Event read ConfigureRequest -func NewConfigureRequestEvent(buf []byte) Event { +func ConfigureRequestEventNew(buf []byte) xgb.Event { v := ConfigureRequestEvent{} b := 1 // don't read event number v.StackMode = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Parent = Window(Get32(buf[b:])) + v.Parent = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Sibling = Window(Get32(buf[b:])) + v.Sibling = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.BorderWidth = Get16(buf[b:]) + v.BorderWidth = xgb.Get16(buf[b:]) b += 2 - v.ValueMask = Get16(buf[b:]) + v.ValueMask = xgb.Get16(buf[b:]) b += 2 return v @@ -4580,31 +4597,31 @@ func (v ConfigureRequestEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Parent)) + xgb.Put32(buf[b:], uint32(v.Parent)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.Sibling)) + xgb.Put32(buf[b:], uint32(v.Sibling)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 - Put16(buf[b:], v.BorderWidth) + xgb.Put16(buf[b:], v.BorderWidth) b += 2 - Put16(buf[b:], v.ValueMask) + xgb.Put16(buf[b:], v.ValueMask) b += 2 return buf @@ -4618,22 +4635,22 @@ func (v ConfigureRequestEvent) SequenceId() uint16 { func (v ConfigureRequestEvent) String() string { fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("StackMode: %d", v.StackMode)) - fieldVals = append(fieldVals, sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Sibling: %d", v.Sibling)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, sprintf("BorderWidth: %d", v.BorderWidth)) - fieldVals = append(fieldVals, sprintf("ValueMask: %d", v.ValueMask)) - return "ConfigureRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("StackMode: %d", v.StackMode)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Sibling: %d", v.Sibling)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, xgb.Sprintf("ValueMask: %d", v.ValueMask)) + return "ConfigureRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[23] = NewConfigureRequestEvent + xgb.NewEventFuncs[23] = ConfigureRequestEventNew } // Event definition GravityNotify (24) @@ -4651,25 +4668,25 @@ type GravityNotifyEvent struct { } // Event read GravityNotify -func NewGravityNotifyEvent(buf []byte) Event { +func GravityNotifyEventNew(buf []byte) xgb.Event { v := GravityNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 return v @@ -4688,16 +4705,16 @@ func (v GravityNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put16(buf[b:], uint16(v.X)) + xgb.Put16(buf[b:], uint16(v.X)) b += 2 - Put16(buf[b:], uint16(v.Y)) + xgb.Put16(buf[b:], uint16(v.Y)) b += 2 return buf @@ -4711,16 +4728,16 @@ func (v GravityNotifyEvent) SequenceId() uint16 { func (v GravityNotifyEvent) String() string { fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, sprintf("Y: %d", v.Y)) - return "GravityNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + return "GravityNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[24] = NewGravityNotifyEvent + xgb.NewEventFuncs[24] = GravityNotifyEventNew } // Event definition ResizeRequest (25) @@ -4737,22 +4754,22 @@ type ResizeRequestEvent struct { } // Event read ResizeRequest -func NewResizeRequestEvent(buf []byte) Event { +func ResizeRequestEventNew(buf []byte) xgb.Event { v := ResizeRequestEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 return v @@ -4771,13 +4788,13 @@ func (v ResizeRequestEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put16(buf[b:], v.Width) + xgb.Put16(buf[b:], v.Width) b += 2 - Put16(buf[b:], v.Height) + xgb.Put16(buf[b:], v.Height) b += 2 return buf @@ -4791,15 +4808,15 @@ func (v ResizeRequestEvent) SequenceId() uint16 { func (v ResizeRequestEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, sprintf("Height: %d", v.Height)) - return "ResizeRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + return "ResizeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[25] = NewResizeRequestEvent + xgb.NewEventFuncs[25] = ResizeRequestEventNew } // Event definition CirculateNotify (26) @@ -4818,19 +4835,19 @@ type CirculateNotifyEvent struct { } // Event read CirculateNotify -func NewCirculateNotifyEvent(buf []byte) Event { +func CirculateNotifyEventNew(buf []byte) xgb.Event { v := CirculateNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Event = Window(Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 b += 4 // padding @@ -4856,10 +4873,10 @@ func (v CirculateNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Event)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 b += 4 // padding @@ -4880,15 +4897,15 @@ func (v CirculateNotifyEvent) SequenceId() uint16 { func (v CirculateNotifyEvent) String() string { fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Place: %d", v.Place)) - return "CirculateNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) + return "CirculateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[26] = NewCirculateNotifyEvent + xgb.NewEventFuncs[26] = CirculateNotifyEventNew } // Event definition PropertyNotify (28) @@ -4907,22 +4924,22 @@ type PropertyNotifyEvent struct { } // Event read PropertyNotify -func NewPropertyNotifyEvent(buf []byte) Event { +func PropertyNotifyEventNew(buf []byte) xgb.Event { v := PropertyNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Atom = Atom(Get32(buf[b:])) + v.Atom = Atom(xgb.Get32(buf[b:])) b += 4 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 v.State = buf[b] @@ -4946,13 +4963,13 @@ func (v PropertyNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.Atom)) + xgb.Put32(buf[b:], uint32(v.Atom)) b += 4 - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 buf[b] = v.State @@ -4971,16 +4988,16 @@ func (v PropertyNotifyEvent) SequenceId() uint16 { func (v PropertyNotifyEvent) String() string { fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Atom: %d", v.Atom)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - return "PropertyNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Atom: %d", v.Atom)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "PropertyNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[28] = NewPropertyNotifyEvent + xgb.NewEventFuncs[28] = PropertyNotifyEventNew } // Event definition SelectionClear (29) @@ -4997,22 +5014,22 @@ type SelectionClearEvent struct { } // Event read SelectionClear -func NewSelectionClearEvent(buf []byte) Event { +func SelectionClearEventNew(buf []byte) xgb.Event { v := SelectionClearEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Owner = Window(Get32(buf[b:])) + v.Owner = Window(xgb.Get32(buf[b:])) b += 4 - v.Selection = Atom(Get32(buf[b:])) + v.Selection = Atom(xgb.Get32(buf[b:])) b += 4 return v @@ -5031,13 +5048,13 @@ func (v SelectionClearEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Owner)) + xgb.Put32(buf[b:], uint32(v.Owner)) b += 4 - Put32(buf[b:], uint32(v.Selection)) + xgb.Put32(buf[b:], uint32(v.Selection)) b += 4 return buf @@ -5051,15 +5068,15 @@ func (v SelectionClearEvent) SequenceId() uint16 { func (v SelectionClearEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) - fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) - return "SelectionClear {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) + return "SelectionClear {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[29] = NewSelectionClearEvent + xgb.NewEventFuncs[29] = SelectionClearEventNew } // Event definition SelectionRequest (30) @@ -5079,31 +5096,31 @@ type SelectionRequestEvent struct { } // Event read SelectionRequest -func NewSelectionRequestEvent(buf []byte) Event { +func SelectionRequestEventNew(buf []byte) xgb.Event { v := SelectionRequestEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Owner = Window(Get32(buf[b:])) + v.Owner = Window(xgb.Get32(buf[b:])) b += 4 - v.Requestor = Window(Get32(buf[b:])) + v.Requestor = Window(xgb.Get32(buf[b:])) b += 4 - v.Selection = Atom(Get32(buf[b:])) + v.Selection = Atom(xgb.Get32(buf[b:])) b += 4 - v.Target = Atom(Get32(buf[b:])) + v.Target = Atom(xgb.Get32(buf[b:])) b += 4 - v.Property = Atom(Get32(buf[b:])) + v.Property = Atom(xgb.Get32(buf[b:])) b += 4 return v @@ -5122,22 +5139,22 @@ func (v SelectionRequestEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Owner)) + xgb.Put32(buf[b:], uint32(v.Owner)) b += 4 - Put32(buf[b:], uint32(v.Requestor)) + xgb.Put32(buf[b:], uint32(v.Requestor)) b += 4 - Put32(buf[b:], uint32(v.Selection)) + xgb.Put32(buf[b:], uint32(v.Selection)) b += 4 - Put32(buf[b:], uint32(v.Target)) + xgb.Put32(buf[b:], uint32(v.Target)) b += 4 - Put32(buf[b:], uint32(v.Property)) + xgb.Put32(buf[b:], uint32(v.Property)) b += 4 return buf @@ -5151,18 +5168,18 @@ func (v SelectionRequestEvent) SequenceId() uint16 { func (v SelectionRequestEvent) String() string { fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Owner: %d", v.Owner)) - fieldVals = append(fieldVals, sprintf("Requestor: %d", v.Requestor)) - fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) - fieldVals = append(fieldVals, sprintf("Target: %d", v.Target)) - fieldVals = append(fieldVals, sprintf("Property: %d", v.Property)) - return "SelectionRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Owner: %d", v.Owner)) + fieldVals = append(fieldVals, xgb.Sprintf("Requestor: %d", v.Requestor)) + fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, xgb.Sprintf("Target: %d", v.Target)) + fieldVals = append(fieldVals, xgb.Sprintf("Property: %d", v.Property)) + return "SelectionRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[30] = NewSelectionRequestEvent + xgb.NewEventFuncs[30] = SelectionRequestEventNew } // Event definition SelectionNotify (31) @@ -5181,28 +5198,28 @@ type SelectionNotifyEvent struct { } // Event read SelectionNotify -func NewSelectionNotifyEvent(buf []byte) Event { +func SelectionNotifyEventNew(buf []byte) xgb.Event { v := SelectionNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Time = Timestamp(Get32(buf[b:])) + v.Time = Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Requestor = Window(Get32(buf[b:])) + v.Requestor = Window(xgb.Get32(buf[b:])) b += 4 - v.Selection = Atom(Get32(buf[b:])) + v.Selection = Atom(xgb.Get32(buf[b:])) b += 4 - v.Target = Atom(Get32(buf[b:])) + v.Target = Atom(xgb.Get32(buf[b:])) b += 4 - v.Property = Atom(Get32(buf[b:])) + v.Property = Atom(xgb.Get32(buf[b:])) b += 4 return v @@ -5221,19 +5238,19 @@ func (v SelectionNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - Put32(buf[b:], uint32(v.Requestor)) + xgb.Put32(buf[b:], uint32(v.Requestor)) b += 4 - Put32(buf[b:], uint32(v.Selection)) + xgb.Put32(buf[b:], uint32(v.Selection)) b += 4 - Put32(buf[b:], uint32(v.Target)) + xgb.Put32(buf[b:], uint32(v.Target)) b += 4 - Put32(buf[b:], uint32(v.Property)) + xgb.Put32(buf[b:], uint32(v.Property)) b += 4 return buf @@ -5247,17 +5264,17 @@ func (v SelectionNotifyEvent) SequenceId() uint16 { func (v SelectionNotifyEvent) String() string { fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Requestor: %d", v.Requestor)) - fieldVals = append(fieldVals, sprintf("Selection: %d", v.Selection)) - fieldVals = append(fieldVals, sprintf("Target: %d", v.Target)) - fieldVals = append(fieldVals, sprintf("Property: %d", v.Property)) - return "SelectionNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Requestor: %d", v.Requestor)) + fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, xgb.Sprintf("Target: %d", v.Target)) + fieldVals = append(fieldVals, xgb.Sprintf("Property: %d", v.Property)) + return "SelectionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[31] = NewSelectionNotifyEvent + xgb.NewEventFuncs[31] = SelectionNotifyEventNew } // Event definition ColormapNotify (32) @@ -5276,19 +5293,19 @@ type ColormapNotifyEvent struct { } // Event read ColormapNotify -func NewColormapNotifyEvent(buf []byte) Event { +func ColormapNotifyEventNew(buf []byte) xgb.Event { v := ColormapNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Colormap = Colormap(Get32(buf[b:])) + v.Colormap = Colormap(xgb.Get32(buf[b:])) b += 4 if buf[b] == 1 { @@ -5319,10 +5336,10 @@ func (v ColormapNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.Colormap)) + xgb.Put32(buf[b:], uint32(v.Colormap)) b += 4 if v.New { @@ -5348,16 +5365,16 @@ func (v ColormapNotifyEvent) SequenceId() uint16 { func (v ColormapNotifyEvent) String() string { fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Colormap: %d", v.Colormap)) - fieldVals = append(fieldVals, sprintf("New: %t", v.New)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - return "ColormapNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Colormap: %d", v.Colormap)) + fieldVals = append(fieldVals, xgb.Sprintf("New: %t", v.New)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "ColormapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[32] = NewColormapNotifyEvent + xgb.NewEventFuncs[32] = ColormapNotifyEventNew } // Event definition ClientMessage (33) @@ -5374,24 +5391,24 @@ type ClientMessageEvent struct { } // Event read ClientMessage -func NewClientMessageEvent(buf []byte) Event { +func ClientMessageEventNew(buf []byte) xgb.Event { v := ClientMessageEvent{} b := 1 // don't read event number v.Format = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Window = Window(Get32(buf[b:])) + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Type = Atom(Get32(buf[b:])) + v.Type = Atom(xgb.Get32(buf[b:])) b += 4 v.Data = ClientMessageDataUnion{} - b += ReadClientMessageDataUnion(buf[b:], &v.Data) + b += ClientMessageDataUnionRead(buf[b:], &v.Data) return v } @@ -5410,16 +5427,16 @@ func (v ClientMessageEvent) Bytes() []byte { b += 2 // skip sequence number - Put32(buf[b:], uint32(v.Window)) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - Put32(buf[b:], uint32(v.Type)) + xgb.Put32(buf[b:], uint32(v.Type)) b += 4 { unionBytes := v.Data.Bytes() copy(buf[b:], unionBytes) - b += pad(len(unionBytes)) + b += xgb.Pad(len(unionBytes)) } return buf @@ -5433,15 +5450,15 @@ func (v ClientMessageEvent) SequenceId() uint16 { func (v ClientMessageEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Format: %d", v.Format)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Type: %d", v.Type)) - return "ClientMessage {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Format: %d", v.Format)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Type: %d", v.Type)) + return "ClientMessage {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[33] = NewClientMessageEvent + xgb.NewEventFuncs[33] = ClientMessageEventNew } // Event definition MappingNotify (34) @@ -5459,13 +5476,13 @@ type MappingNotifyEvent struct { } // Event read MappingNotify -func NewMappingNotifyEvent(buf []byte) Event { +func MappingNotifyEventNew(buf []byte) xgb.Event { v := MappingNotifyEvent{} b := 1 // don't read event number b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Request = buf[b] @@ -5517,15 +5534,15 @@ func (v MappingNotifyEvent) SequenceId() uint16 { func (v MappingNotifyEvent) String() string { fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Request: %d", v.Request)) - fieldVals = append(fieldVals, sprintf("FirstKeycode: %d", v.FirstKeycode)) - fieldVals = append(fieldVals, sprintf("Count: %d", v.Count)) - return "MappingNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + return "MappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[34] = NewMappingNotifyEvent + xgb.NewEventFuncs[34] = MappingNotifyEventNew } // EventCopy definition KeyRelease (3) @@ -5534,8 +5551,8 @@ const KeyRelease = 3 type KeyReleaseEvent KeyPressEvent -func NewKeyReleaseEvent(buf []byte) Event { - return KeyReleaseEvent(NewKeyPressEvent(buf).(KeyPressEvent)) +func KeyReleaseEventNew(buf []byte) xgb.Event { + return KeyReleaseEvent(KeyPressEventNew(buf).(KeyPressEvent)) } func (v KeyReleaseEvent) Bytes() []byte { @@ -5550,23 +5567,23 @@ func (v KeyReleaseEvent) SequenceId() uint16 { func (v KeyReleaseEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - return "KeyRelease {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "KeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[3] = NewKeyReleaseEvent + xgb.NewEventFuncs[3] = KeyReleaseEventNew } // EventCopy definition ButtonRelease (5) @@ -5575,8 +5592,8 @@ const ButtonRelease = 5 type ButtonReleaseEvent ButtonPressEvent -func NewButtonReleaseEvent(buf []byte) Event { - return ButtonReleaseEvent(NewButtonPressEvent(buf).(ButtonPressEvent)) +func ButtonReleaseEventNew(buf []byte) xgb.Event { + return ButtonReleaseEvent(ButtonPressEventNew(buf).(ButtonPressEvent)) } func (v ButtonReleaseEvent) Bytes() []byte { @@ -5591,23 +5608,23 @@ func (v ButtonReleaseEvent) SequenceId() uint16 { func (v ButtonReleaseEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("SameScreen: %t", v.SameScreen)) - return "ButtonRelease {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[5] = NewButtonReleaseEvent + xgb.NewEventFuncs[5] = ButtonReleaseEventNew } // EventCopy definition LeaveNotify (8) @@ -5616,8 +5633,8 @@ const LeaveNotify = 8 type LeaveNotifyEvent EnterNotifyEvent -func NewLeaveNotifyEvent(buf []byte) Event { - return LeaveNotifyEvent(NewEnterNotifyEvent(buf).(EnterNotifyEvent)) +func LeaveNotifyEventNew(buf []byte) xgb.Event { + return LeaveNotifyEvent(EnterNotifyEventNew(buf).(EnterNotifyEvent)) } func (v LeaveNotifyEvent) Bytes() []byte { @@ -5632,24 +5649,24 @@ func (v LeaveNotifyEvent) SequenceId() uint16 { func (v LeaveNotifyEvent) String() string { fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, sprintf("SameScreenFocus: %d", v.SameScreenFocus)) - return "LeaveNotify {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "LeaveNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[8] = NewLeaveNotifyEvent + xgb.NewEventFuncs[8] = LeaveNotifyEventNew } // EventCopy definition FocusOut (10) @@ -5658,8 +5675,8 @@ const FocusOut = 10 type FocusOutEvent FocusInEvent -func NewFocusOutEvent(buf []byte) Event { - return FocusOutEvent(NewFocusInEvent(buf).(FocusInEvent)) +func FocusOutEventNew(buf []byte) xgb.Event { + return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) } func (v FocusOutEvent) Bytes() []byte { @@ -5674,15 +5691,15 @@ func (v FocusOutEvent) SequenceId() uint16 { func (v FocusOutEvent) String() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Mode: %d", v.Mode)) - return "FocusOut {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[10] = NewFocusOutEvent + xgb.NewEventFuncs[10] = FocusOutEventNew } // EventCopy definition CirculateRequest (27) @@ -5691,8 +5708,8 @@ const CirculateRequest = 27 type CirculateRequestEvent CirculateNotifyEvent -func NewCirculateRequestEvent(buf []byte) Event { - return CirculateRequestEvent(NewCirculateNotifyEvent(buf).(CirculateNotifyEvent)) +func CirculateRequestEventNew(buf []byte) xgb.Event { + return CirculateRequestEvent(CirculateNotifyEventNew(buf).(CirculateNotifyEvent)) } func (v CirculateRequestEvent) Bytes() []byte { @@ -5707,15 +5724,15 @@ func (v CirculateRequestEvent) SequenceId() uint16 { func (v CirculateRequestEvent) String() string { fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, sprintf("Place: %d", v.Place)) - return "CirculateRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) + return "CirculateRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newEventFuncs[27] = NewCirculateRequestEvent + xgb.NewEventFuncs[27] = CirculateRequestEventNew } // Error definition Request (1) @@ -5733,20 +5750,20 @@ type RequestError struct { } // Error read Request -func NewRequestError(buf []byte) Error { +func RequestErrorNew(buf []byte) xgb.Error { v := RequestError{} v.NiceName = "Request" b := 1 // skip error determinant b += 1 // don't read error number - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.BadValue = Get32(buf[b:]) + v.BadValue = xgb.Get32(buf[b:]) b += 4 - v.MinorOpcode = Get16(buf[b:]) + v.MinorOpcode = xgb.Get16(buf[b:]) b += 2 v.MajorOpcode = buf[b] @@ -5770,15 +5787,15 @@ func (err RequestError) BadId() uint32 { func (err RequestError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadRequest {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[1] = NewRequestError + xgb.NewErrorFuncs[1] = RequestErrorNew } // Error definition Value (2) @@ -5796,20 +5813,20 @@ type ValueError struct { } // Error read Value -func NewValueError(buf []byte) Error { +func ValueErrorNew(buf []byte) xgb.Error { v := ValueError{} v.NiceName = "Value" b := 1 // skip error determinant b += 1 // don't read error number - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.BadValue = Get32(buf[b:]) + v.BadValue = xgb.Get32(buf[b:]) b += 4 - v.MinorOpcode = Get16(buf[b:]) + v.MinorOpcode = xgb.Get16(buf[b:]) b += 2 v.MajorOpcode = buf[b] @@ -5833,15 +5850,15 @@ func (err ValueError) BadId() uint32 { func (err ValueError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadValue {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadValue {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[2] = NewValueError + xgb.NewErrorFuncs[2] = ValueErrorNew } // ErrorCopy definition Window (3) @@ -5850,8 +5867,8 @@ const BadWindow = 3 type WindowError ValueError -func NewWindowError(buf []byte) Error { - v := WindowError(NewValueError(buf).(ValueError)) +func WindowErrorNew(buf []byte) xgb.Error { + v := WindowError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Window" return v } @@ -5869,15 +5886,15 @@ func (err WindowError) BadId() uint32 { func (err WindowError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadWindow {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[3] = NewWindowError + xgb.NewErrorFuncs[3] = WindowErrorNew } // ErrorCopy definition Pixmap (4) @@ -5886,8 +5903,8 @@ const BadPixmap = 4 type PixmapError ValueError -func NewPixmapError(buf []byte) Error { - v := PixmapError(NewValueError(buf).(ValueError)) +func PixmapErrorNew(buf []byte) xgb.Error { + v := PixmapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Pixmap" return v } @@ -5905,15 +5922,15 @@ func (err PixmapError) BadId() uint32 { func (err PixmapError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadPixmap {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[4] = NewPixmapError + xgb.NewErrorFuncs[4] = PixmapErrorNew } // ErrorCopy definition Atom (5) @@ -5922,8 +5939,8 @@ const BadAtom = 5 type AtomError ValueError -func NewAtomError(buf []byte) Error { - v := AtomError(NewValueError(buf).(ValueError)) +func AtomErrorNew(buf []byte) xgb.Error { + v := AtomError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Atom" return v } @@ -5941,15 +5958,15 @@ func (err AtomError) BadId() uint32 { func (err AtomError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAtom {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAtom {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[5] = NewAtomError + xgb.NewErrorFuncs[5] = AtomErrorNew } // ErrorCopy definition Cursor (6) @@ -5958,8 +5975,8 @@ const BadCursor = 6 type CursorError ValueError -func NewCursorError(buf []byte) Error { - v := CursorError(NewValueError(buf).(ValueError)) +func CursorErrorNew(buf []byte) xgb.Error { + v := CursorError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Cursor" return v } @@ -5977,15 +5994,15 @@ func (err CursorError) BadId() uint32 { func (err CursorError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadCursor {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadCursor {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[6] = NewCursorError + xgb.NewErrorFuncs[6] = CursorErrorNew } // ErrorCopy definition Font (7) @@ -5994,8 +6011,8 @@ const BadFont = 7 type FontError ValueError -func NewFontError(buf []byte) Error { - v := FontError(NewValueError(buf).(ValueError)) +func FontErrorNew(buf []byte) xgb.Error { + v := FontError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Font" return v } @@ -6013,15 +6030,15 @@ func (err FontError) BadId() uint32 { func (err FontError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadFont {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadFont {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[7] = NewFontError + xgb.NewErrorFuncs[7] = FontErrorNew } // ErrorCopy definition Match (8) @@ -6030,8 +6047,8 @@ const BadMatch = 8 type MatchError RequestError -func NewMatchError(buf []byte) Error { - v := MatchError(NewRequestError(buf).(RequestError)) +func MatchErrorNew(buf []byte) xgb.Error { + v := MatchError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Match" return v } @@ -6049,15 +6066,15 @@ func (err MatchError) BadId() uint32 { func (err MatchError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadMatch {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadMatch {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[8] = NewMatchError + xgb.NewErrorFuncs[8] = MatchErrorNew } // ErrorCopy definition Drawable (9) @@ -6066,8 +6083,8 @@ const BadDrawable = 9 type DrawableError ValueError -func NewDrawableError(buf []byte) Error { - v := DrawableError(NewValueError(buf).(ValueError)) +func DrawableErrorNew(buf []byte) xgb.Error { + v := DrawableError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Drawable" return v } @@ -6085,15 +6102,15 @@ func (err DrawableError) BadId() uint32 { func (err DrawableError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadDrawable {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[9] = NewDrawableError + xgb.NewErrorFuncs[9] = DrawableErrorNew } // ErrorCopy definition Access (10) @@ -6102,8 +6119,8 @@ const BadAccess = 10 type AccessError RequestError -func NewAccessError(buf []byte) Error { - v := AccessError(NewRequestError(buf).(RequestError)) +func AccessErrorNew(buf []byte) xgb.Error { + v := AccessError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Access" return v } @@ -6121,15 +6138,15 @@ func (err AccessError) BadId() uint32 { func (err AccessError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAccess {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAccess {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[10] = NewAccessError + xgb.NewErrorFuncs[10] = AccessErrorNew } // ErrorCopy definition Alloc (11) @@ -6138,8 +6155,8 @@ const BadAlloc = 11 type AllocError RequestError -func NewAllocError(buf []byte) Error { - v := AllocError(NewRequestError(buf).(RequestError)) +func AllocErrorNew(buf []byte) xgb.Error { + v := AllocError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Alloc" return v } @@ -6157,15 +6174,15 @@ func (err AllocError) BadId() uint32 { func (err AllocError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAlloc {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAlloc {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[11] = NewAllocError + xgb.NewErrorFuncs[11] = AllocErrorNew } // ErrorCopy definition Colormap (12) @@ -6174,8 +6191,8 @@ const BadColormap = 12 type ColormapError ValueError -func NewColormapError(buf []byte) Error { - v := ColormapError(NewValueError(buf).(ValueError)) +func ColormapErrorNew(buf []byte) xgb.Error { + v := ColormapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Colormap" return v } @@ -6193,15 +6210,15 @@ func (err ColormapError) BadId() uint32 { func (err ColormapError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadColormap {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadColormap {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[12] = NewColormapError + xgb.NewErrorFuncs[12] = ColormapErrorNew } // ErrorCopy definition GContext (13) @@ -6210,8 +6227,8 @@ const BadGContext = 13 type GContextError ValueError -func NewGContextError(buf []byte) Error { - v := GContextError(NewValueError(buf).(ValueError)) +func GContextErrorNew(buf []byte) xgb.Error { + v := GContextError(ValueErrorNew(buf).(ValueError)) v.NiceName = "GContext" return v } @@ -6229,15 +6246,15 @@ func (err GContextError) BadId() uint32 { func (err GContextError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGContext {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[13] = NewGContextError + xgb.NewErrorFuncs[13] = GContextErrorNew } // ErrorCopy definition IDChoice (14) @@ -6246,8 +6263,8 @@ const BadIDChoice = 14 type IDChoiceError ValueError -func NewIDChoiceError(buf []byte) Error { - v := IDChoiceError(NewValueError(buf).(ValueError)) +func IDChoiceErrorNew(buf []byte) xgb.Error { + v := IDChoiceError(ValueErrorNew(buf).(ValueError)) v.NiceName = "IDChoice" return v } @@ -6265,15 +6282,15 @@ func (err IDChoiceError) BadId() uint32 { func (err IDChoiceError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadIDChoice {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadIDChoice {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[14] = NewIDChoiceError + xgb.NewErrorFuncs[14] = IDChoiceErrorNew } // ErrorCopy definition Name (15) @@ -6282,8 +6299,8 @@ const BadName = 15 type NameError RequestError -func NewNameError(buf []byte) Error { - v := NameError(NewRequestError(buf).(RequestError)) +func NameErrorNew(buf []byte) xgb.Error { + v := NameError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Name" return v } @@ -6301,15 +6318,15 @@ func (err NameError) BadId() uint32 { func (err NameError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadName {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadName {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[15] = NewNameError + xgb.NewErrorFuncs[15] = NameErrorNew } // ErrorCopy definition Length (16) @@ -6318,8 +6335,8 @@ const BadLength = 16 type LengthError RequestError -func NewLengthError(buf []byte) Error { - v := LengthError(NewRequestError(buf).(RequestError)) +func LengthErrorNew(buf []byte) xgb.Error { + v := LengthError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Length" return v } @@ -6337,15 +6354,15 @@ func (err LengthError) BadId() uint32 { func (err LengthError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadLength {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadLength {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[16] = NewLengthError + xgb.NewErrorFuncs[16] = LengthErrorNew } // ErrorCopy definition Implementation (17) @@ -6354,8 +6371,8 @@ const BadImplementation = 17 type ImplementationError RequestError -func NewImplementationError(buf []byte) Error { - v := ImplementationError(NewRequestError(buf).(RequestError)) +func ImplementationErrorNew(buf []byte) xgb.Error { + v := ImplementationError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Implementation" return v } @@ -6373,43 +6390,43 @@ func (err ImplementationError) BadId() uint32 { func (err ImplementationError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadImplementation {" + stringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadImplementation {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - newErrorFuncs[17] = NewImplementationError + xgb.NewErrorFuncs[17] = ImplementationErrorNew } // Request CreateWindow -// size: pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type CreateWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreateWindow -func (c *Conn) CreateWindow(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) +func CreateWindow(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } -func (c *Conn) CreateWindowChecked(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createWindowRequest(Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) +func CreateWindowChecked(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } func (cook CreateWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreateWindow -func (c *Conn) createWindowRequest(Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { - size := pad((28 + (4 + pad((4 * popCount(int(ValueMask))))))) +func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6419,73 +6436,73 @@ func (c *Conn) createWindowRequest(Depth byte, Wid Window, Parent Window, X int1 buf[b] = Depth b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Wid)) + xgb.Put32(buf[b:], uint32(Wid)) b += 4 - Put32(buf[b:], uint32(Parent)) + xgb.Put32(buf[b:], uint32(Parent)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 - Put16(buf[b:], BorderWidth) + xgb.Put16(buf[b:], BorderWidth) b += 2 - Put16(buf[b:], Class) + xgb.Put16(buf[b:], Class) b += 2 - Put32(buf[b:], uint32(Visual)) + xgb.Put32(buf[b:], uint32(Visual)) b += 4 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } // Request ChangeWindowAttributes -// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type ChangeWindowAttributesCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeWindowAttributes -func (c *Conn) ChangeWindowAttributes(Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) +func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } -func (c *Conn) ChangeWindowAttributesChecked(Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeWindowAttributesRequest(Window, ValueMask, ValueList), cookie) +func ChangeWindowAttributesChecked(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } func (cook ChangeWindowAttributesCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeWindowAttributes -func (c *Conn) changeWindowAttributesRequest(Window Window, ValueMask uint32, ValueList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -6494,19 +6511,19 @@ func (c *Conn) changeWindowAttributesRequest(Window Window, ValueMask uint32, Va b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -6514,18 +6531,18 @@ func (c *Conn) changeWindowAttributesRequest(Window Window, ValueMask uint32, Va // Request GetWindowAttributes // size: 8 type GetWindowAttributesCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetWindowAttributes(Window Window) GetWindowAttributesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getWindowAttributesRequest(Window), cookie) +func GetWindowAttributes(c *xgb.Conn, Window Window) GetWindowAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } -func (c *Conn) GetWindowAttributesUnchecked(Window Window) GetWindowAttributesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getWindowAttributesRequest(Window), cookie) +func GetWindowAttributesUnchecked(c *xgb.Conn, Window Window) GetWindowAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } @@ -6554,7 +6571,7 @@ type GetWindowAttributesReply struct { // Waits and reads reply data from request GetWindowAttributes func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -6572,16 +6589,16 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { v.BackingStore = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Visual = Visualid(Get32(buf[b:])) + v.Visual = Visualid(xgb.Get32(buf[b:])) b += 4 - v.Class = Get16(buf[b:]) + v.Class = xgb.Get16(buf[b:]) b += 2 v.BitGravity = buf[b] @@ -6590,10 +6607,10 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { v.WinGravity = buf[b] b += 1 - v.BackingPlanes = Get32(buf[b:]) + v.BackingPlanes = xgb.Get32(buf[b:]) b += 4 - v.BackingPixel = Get32(buf[b:]) + v.BackingPixel = xgb.Get32(buf[b:]) b += 4 if buf[b] == 1 { @@ -6620,16 +6637,16 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { } b += 1 - v.Colormap = Colormap(Get32(buf[b:])) + v.Colormap = Colormap(xgb.Get32(buf[b:])) b += 4 - v.AllEventMasks = Get32(buf[b:]) + v.AllEventMasks = xgb.Get32(buf[b:]) b += 4 - v.YourEventMask = Get32(buf[b:]) + v.YourEventMask = xgb.Get32(buf[b:]) b += 4 - v.DoNotPropagateMask = Get16(buf[b:]) + v.DoNotPropagateMask = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -6637,12 +6654,8 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { return v } -func (cook GetWindowAttributesCookie) Check() error { - return cook.check() -} - // Write request to wire for GetWindowAttributes -func (c *Conn) getWindowAttributesRequest(Window Window) []byte { +func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6652,10 +6665,10 @@ func (c *Conn) getWindowAttributesRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6664,28 +6677,28 @@ func (c *Conn) getWindowAttributesRequest(Window Window) []byte { // Request DestroyWindow // size: 8 type DestroyWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for DestroyWindow -func (c *Conn) DestroyWindow(Window Window) DestroyWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.destroyWindowRequest(Window), cookie) +func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{cookie} } -func (c *Conn) DestroyWindowChecked(Window Window) DestroyWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.destroyWindowRequest(Window), cookie) +func DestroyWindowChecked(c *xgb.Conn, Window Window) DestroyWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{cookie} } func (cook DestroyWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for DestroyWindow -func (c *Conn) destroyWindowRequest(Window Window) []byte { +func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6695,10 +6708,10 @@ func (c *Conn) destroyWindowRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6707,28 +6720,28 @@ func (c *Conn) destroyWindowRequest(Window Window) []byte { // Request DestroySubwindows // size: 8 type DestroySubwindowsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for DestroySubwindows -func (c *Conn) DestroySubwindows(Window Window) DestroySubwindowsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.destroySubwindowsRequest(Window), cookie) +func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{cookie} } -func (c *Conn) DestroySubwindowsChecked(Window Window) DestroySubwindowsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.destroySubwindowsRequest(Window), cookie) +func DestroySubwindowsChecked(c *xgb.Conn, Window Window) DestroySubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{cookie} } func (cook DestroySubwindowsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for DestroySubwindows -func (c *Conn) destroySubwindowsRequest(Window Window) []byte { +func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6738,10 +6751,10 @@ func (c *Conn) destroySubwindowsRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6750,28 +6763,28 @@ func (c *Conn) destroySubwindowsRequest(Window Window) []byte { // Request ChangeSaveSet // size: 8 type ChangeSaveSetCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeSaveSet -func (c *Conn) ChangeSaveSet(Mode byte, Window Window) ChangeSaveSetCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) +func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } -func (c *Conn) ChangeSaveSetChecked(Mode byte, Window Window) ChangeSaveSetCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeSaveSetRequest(Mode, Window), cookie) +func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } func (cook ChangeSaveSetCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeSaveSet -func (c *Conn) changeSaveSetRequest(Mode byte, Window Window) []byte { +func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6782,10 +6795,10 @@ func (c *Conn) changeSaveSetRequest(Mode byte, Window Window) []byte { buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6794,28 +6807,28 @@ func (c *Conn) changeSaveSetRequest(Mode byte, Window Window) []byte { // Request ReparentWindow // size: 16 type ReparentWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ReparentWindow -func (c *Conn) ReparentWindow(Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) +func ReparentWindow(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } -func (c *Conn) ReparentWindowChecked(Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.reparentWindowRequest(Window, Parent, X, Y), cookie) +func ReparentWindowChecked(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } func (cook ReparentWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ReparentWindow -func (c *Conn) reparentWindowRequest(Window Window, Parent Window, X int16, Y int16) []byte { +func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -6825,19 +6838,19 @@ func (c *Conn) reparentWindowRequest(Window Window, Parent Window, X int16, Y in b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Parent)) + xgb.Put32(buf[b:], uint32(Parent)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 return buf @@ -6846,28 +6859,28 @@ func (c *Conn) reparentWindowRequest(Window Window, Parent Window, X int16, Y in // Request MapWindow // size: 8 type MapWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for MapWindow -func (c *Conn) MapWindow(Window Window) MapWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.mapWindowRequest(Window), cookie) +func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{cookie} } -func (c *Conn) MapWindowChecked(Window Window) MapWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.mapWindowRequest(Window), cookie) +func MapWindowChecked(c *xgb.Conn, Window Window) MapWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{cookie} } func (cook MapWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for MapWindow -func (c *Conn) mapWindowRequest(Window Window) []byte { +func mapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6877,10 +6890,10 @@ func (c *Conn) mapWindowRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6889,28 +6902,28 @@ func (c *Conn) mapWindowRequest(Window Window) []byte { // Request MapSubwindows // size: 8 type MapSubwindowsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for MapSubwindows -func (c *Conn) MapSubwindows(Window Window) MapSubwindowsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.mapSubwindowsRequest(Window), cookie) +func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{cookie} } -func (c *Conn) MapSubwindowsChecked(Window Window) MapSubwindowsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.mapSubwindowsRequest(Window), cookie) +func MapSubwindowsChecked(c *xgb.Conn, Window Window) MapSubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{cookie} } func (cook MapSubwindowsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for MapSubwindows -func (c *Conn) mapSubwindowsRequest(Window Window) []byte { +func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6920,10 +6933,10 @@ func (c *Conn) mapSubwindowsRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6932,28 +6945,28 @@ func (c *Conn) mapSubwindowsRequest(Window Window) []byte { // Request UnmapWindow // size: 8 type UnmapWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UnmapWindow -func (c *Conn) UnmapWindow(Window Window) UnmapWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.unmapWindowRequest(Window), cookie) +func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{cookie} } -func (c *Conn) UnmapWindowChecked(Window Window) UnmapWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.unmapWindowRequest(Window), cookie) +func UnmapWindowChecked(c *xgb.Conn, Window Window) UnmapWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{cookie} } func (cook UnmapWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UnmapWindow -func (c *Conn) unmapWindowRequest(Window Window) []byte { +func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -6963,10 +6976,10 @@ func (c *Conn) unmapWindowRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -6975,28 +6988,28 @@ func (c *Conn) unmapWindowRequest(Window Window) []byte { // Request UnmapSubwindows // size: 8 type UnmapSubwindowsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UnmapSubwindows -func (c *Conn) UnmapSubwindows(Window Window) UnmapSubwindowsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.unmapSubwindowsRequest(Window), cookie) +func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{cookie} } -func (c *Conn) UnmapSubwindowsChecked(Window Window) UnmapSubwindowsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.unmapSubwindowsRequest(Window), cookie) +func UnmapSubwindowsChecked(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{cookie} } func (cook UnmapSubwindowsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UnmapSubwindows -func (c *Conn) unmapSubwindowsRequest(Window Window) []byte { +func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7006,41 +7019,41 @@ func (c *Conn) unmapSubwindowsRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf } // Request ConfigureWindow -// size: pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type ConfigureWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ConfigureWindow -func (c *Conn) ConfigureWindow(Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) +func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } -func (c *Conn) ConfigureWindowChecked(Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.configureWindowRequest(Window, ValueMask, ValueList), cookie) +func ConfigureWindowChecked(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } func (cook ConfigureWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ConfigureWindow -func (c *Conn) configureWindowRequest(Window Window, ValueMask uint16, ValueList []uint32) []byte { - size := pad((10 + (2 + pad((4 * popCount(int(ValueMask))))))) +func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { + size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -7049,22 +7062,22 @@ func (c *Conn) configureWindowRequest(Window Window, ValueMask uint16, ValueList b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put16(buf[b:], ValueMask) + xgb.Put16(buf[b:], ValueMask) b += 2 b += 2 // padding - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -7072,28 +7085,28 @@ func (c *Conn) configureWindowRequest(Window Window, ValueMask uint16, ValueList // Request CirculateWindow // size: 8 type CirculateWindowCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CirculateWindow -func (c *Conn) CirculateWindow(Direction byte, Window Window) CirculateWindowCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) +func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{cookie} } -func (c *Conn) CirculateWindowChecked(Direction byte, Window Window) CirculateWindowCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.circulateWindowRequest(Direction, Window), cookie) +func CirculateWindowChecked(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{cookie} } func (cook CirculateWindowCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CirculateWindow -func (c *Conn) circulateWindowRequest(Direction byte, Window Window) []byte { +func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7104,10 +7117,10 @@ func (c *Conn) circulateWindowRequest(Direction byte, Window Window) []byte { buf[b] = Direction b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -7116,18 +7129,18 @@ func (c *Conn) circulateWindowRequest(Direction byte, Window Window) []byte { // Request GetGeometry // size: 8 type GetGeometryCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetGeometry(Drawable Drawable) GetGeometryCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getGeometryRequest(Drawable), cookie) +func GetGeometry(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } -func (c *Conn) GetGeometryUnchecked(Drawable Drawable) GetGeometryCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getGeometryRequest(Drawable), cookie) +func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } @@ -7148,7 +7161,7 @@ type GetGeometryReply struct { // Waits and reads reply data from request GetGeometry func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7166,28 +7179,28 @@ func getGeometryReply(buf []byte) *GetGeometryReply { v.Depth = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.X = int16(Get16(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) b += 2 - v.Y = int16(Get16(buf[b:])) + v.Y = int16(xgb.Get16(buf[b:])) b += 2 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 - v.BorderWidth = Get16(buf[b:]) + v.BorderWidth = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -7195,12 +7208,8 @@ func getGeometryReply(buf []byte) *GetGeometryReply { return v } -func (cook GetGeometryCookie) Check() error { - return cook.check() -} - // Write request to wire for GetGeometry -func (c *Conn) getGeometryRequest(Drawable Drawable) []byte { +func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7210,10 +7219,10 @@ func (c *Conn) getGeometryRequest(Drawable Drawable) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 return buf @@ -7222,23 +7231,23 @@ func (c *Conn) getGeometryRequest(Drawable Drawable) []byte { // Request QueryTree // size: 8 type QueryTreeCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryTree(Window Window) QueryTreeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryTreeRequest(Window), cookie) +func QueryTree(c *xgb.Conn, Window Window) QueryTreeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } -func (c *Conn) QueryTreeUnchecked(Window Window) QueryTreeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryTreeRequest(Window), cookie) +func QueryTreeUnchecked(c *xgb.Conn, Window Window) QueryTreeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } // Request reply for QueryTree -// size: (32 + pad((int(ChildrenLen) * 4))) +// size: (32 + xgb.Pad((int(ChildrenLen) * 4))) type QueryTreeReply struct { Sequence uint16 Length uint32 @@ -7247,12 +7256,12 @@ type QueryTreeReply struct { Parent Window ChildrenLen uint16 // padding: 14 bytes - Children []Window // size: pad((int(ChildrenLen) * 4)) + Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) } // Waits and reads reply data from request QueryTree func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7269,39 +7278,35 @@ func queryTreeReply(buf []byte) *QueryTreeReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Parent = Window(Get32(buf[b:])) + v.Parent = Window(xgb.Get32(buf[b:])) b += 4 - v.ChildrenLen = Get16(buf[b:]) + v.ChildrenLen = xgb.Get16(buf[b:]) b += 2 b += 14 // padding v.Children = make([]Window, v.ChildrenLen) for i := 0; i < int(v.ChildrenLen); i++ { - v.Children[i] = Window(Get32(buf[b:])) + v.Children[i] = Window(xgb.Get32(buf[b:])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook QueryTreeCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryTree -func (c *Conn) queryTreeRequest(Window Window) []byte { +func queryTreeRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7311,30 +7316,30 @@ func (c *Conn) queryTreeRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf } // Request InternAtom -// size: pad((8 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) type InternAtomCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) InternAtom(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.internAtomRequest(OnlyIfExists, NameLen, Name), cookie) +func InternAtom(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } -func (c *Conn) InternAtomUnchecked(OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.internAtomRequest(OnlyIfExists, NameLen, Name), cookie) +func InternAtomUnchecked(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } @@ -7349,7 +7354,7 @@ type InternAtomReply struct { // Waits and reads reply data from request InternAtom func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7366,25 +7371,21 @@ func internAtomReply(buf []byte) *InternAtomReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Atom = Atom(Get32(buf[b:])) + v.Atom = Atom(xgb.Get32(buf[b:])) b += 4 return v } -func (cook InternAtomCookie) Check() error { - return cook.check() -} - // Write request to wire for InternAtom -func (c *Conn) internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) []byte { - size := pad((8 + pad((int(NameLen) * 1)))) +func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -7398,16 +7399,16 @@ func (c *Conn) internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } @@ -7415,35 +7416,35 @@ func (c *Conn) internAtomRequest(OnlyIfExists bool, NameLen uint16, Name string) // Request GetAtomName // size: 8 type GetAtomNameCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetAtomName(Atom Atom) GetAtomNameCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getAtomNameRequest(Atom), cookie) +func GetAtomName(c *xgb.Conn, Atom Atom) GetAtomNameCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } -func (c *Conn) GetAtomNameUnchecked(Atom Atom) GetAtomNameCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getAtomNameRequest(Atom), cookie) +func GetAtomNameUnchecked(c *xgb.Conn, Atom Atom) GetAtomNameCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } // Request reply for GetAtomName -// size: (32 + pad((int(NameLen) * 1))) +// size: (32 + xgb.Pad((int(NameLen) * 1))) type GetAtomNameReply struct { Sequence uint16 Length uint32 // padding: 1 bytes NameLen uint16 // padding: 22 bytes - Name string // size: pad((int(NameLen) * 1)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Waits and reads reply data from request GetAtomName func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7460,13 +7461,13 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.NameLen = Get16(buf[b:]) + v.NameLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding @@ -7475,18 +7476,14 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += pad(int(v.NameLen)) + b += xgb.Pad(int(v.NameLen)) } return v } -func (cook GetAtomNameCookie) Check() error { - return cook.check() -} - // Write request to wire for GetAtomName -func (c *Conn) getAtomNameRequest(Atom Atom) []byte { +func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7496,41 +7493,41 @@ func (c *Conn) getAtomNameRequest(Atom Atom) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Atom)) + xgb.Put32(buf[b:], uint32(Atom)) b += 4 return buf } // Request ChangeProperty -// size: pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) +// size: xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) type ChangePropertyCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeProperty -func (c *Conn) ChangeProperty(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) +func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } -func (c *Conn) ChangePropertyChecked(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changePropertyRequest(Mode, Window, Property, Type, Format, DataLen, Data), cookie) +func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } func (cook ChangePropertyCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeProperty -func (c *Conn) changePropertyRequest(Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { - size := pad((24 + pad((((int(DataLen) * int(Format)) / 8) * 1)))) +func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 buf := make([]byte, size) @@ -7540,16 +7537,16 @@ func (c *Conn) changePropertyRequest(Mode byte, Window Window, Property Atom, Ty buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Property)) + xgb.Put32(buf[b:], uint32(Property)) b += 4 - Put32(buf[b:], uint32(Type)) + xgb.Put32(buf[b:], uint32(Type)) b += 4 buf[b] = Format @@ -7557,11 +7554,11 @@ func (c *Conn) changePropertyRequest(Mode byte, Window Window, Property Atom, Ty b += 3 // padding - Put32(buf[b:], DataLen) + xgb.Put32(buf[b:], DataLen) b += 4 copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) - b += pad(int(((int(DataLen) * int(Format)) / 8))) + b += xgb.Pad(int(((int(DataLen) * int(Format)) / 8))) return buf } @@ -7569,28 +7566,28 @@ func (c *Conn) changePropertyRequest(Mode byte, Window Window, Property Atom, Ty // Request DeleteProperty // size: 12 type DeletePropertyCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for DeleteProperty -func (c *Conn) DeleteProperty(Window Window, Property Atom) DeletePropertyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.deletePropertyRequest(Window, Property), cookie) +func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{cookie} } -func (c *Conn) DeletePropertyChecked(Window Window, Property Atom) DeletePropertyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.deletePropertyRequest(Window, Property), cookie) +func DeletePropertyChecked(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{cookie} } func (cook DeletePropertyCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for DeleteProperty -func (c *Conn) deletePropertyRequest(Window Window, Property Atom) []byte { +func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -7600,13 +7597,13 @@ func (c *Conn) deletePropertyRequest(Window Window, Property Atom) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Property)) + xgb.Put32(buf[b:], uint32(Property)) b += 4 return buf @@ -7615,23 +7612,23 @@ func (c *Conn) deletePropertyRequest(Window Window, Property Atom) []byte { // Request GetProperty // size: 24 type GetPropertyCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetProperty(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) +func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } -func (c *Conn) GetPropertyUnchecked(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getPropertyRequest(Delete, Window, Property, Type, LongOffset, LongLength), cookie) +func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } // Request reply for GetProperty -// size: (32 + pad(((int(ValueLen) * (int(Format) / 8)) * 1))) +// size: (32 + xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1))) type GetPropertyReply struct { Sequence uint16 Length uint32 @@ -7640,12 +7637,12 @@ type GetPropertyReply struct { BytesAfter uint32 ValueLen uint32 // padding: 12 bytes - Value []byte // size: pad(((int(ValueLen) * (int(Format) / 8)) * 1)) + Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) } // Waits and reads reply data from request GetProperty func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7663,36 +7660,32 @@ func getPropertyReply(buf []byte) *GetPropertyReply { v.Format = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Type = Atom(Get32(buf[b:])) + v.Type = Atom(xgb.Get32(buf[b:])) b += 4 - v.BytesAfter = Get32(buf[b:]) + v.BytesAfter = xgb.Get32(buf[b:]) b += 4 - v.ValueLen = Get32(buf[b:]) + v.ValueLen = xgb.Get32(buf[b:]) b += 4 b += 12 // padding v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) - b += pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) + b += xgb.Pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) return v } -func (cook GetPropertyCookie) Check() error { - return cook.check() -} - // Write request to wire for GetProperty -func (c *Conn) getPropertyRequest(Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { +func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7707,22 +7700,22 @@ func (c *Conn) getPropertyRequest(Delete bool, Window Window, Property Atom, Typ } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Property)) + xgb.Put32(buf[b:], uint32(Property)) b += 4 - Put32(buf[b:], uint32(Type)) + xgb.Put32(buf[b:], uint32(Type)) b += 4 - Put32(buf[b:], LongOffset) + xgb.Put32(buf[b:], LongOffset) b += 4 - Put32(buf[b:], LongLength) + xgb.Put32(buf[b:], LongLength) b += 4 return buf @@ -7731,35 +7724,35 @@ func (c *Conn) getPropertyRequest(Delete bool, Window Window, Property Atom, Typ // Request ListProperties // size: 8 type ListPropertiesCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListProperties(Window Window) ListPropertiesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listPropertiesRequest(Window), cookie) +func ListProperties(c *xgb.Conn, Window Window) ListPropertiesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } -func (c *Conn) ListPropertiesUnchecked(Window Window) ListPropertiesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listPropertiesRequest(Window), cookie) +func ListPropertiesUnchecked(c *xgb.Conn, Window Window) ListPropertiesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } // Request reply for ListProperties -// size: (32 + pad((int(AtomsLen) * 4))) +// size: (32 + xgb.Pad((int(AtomsLen) * 4))) type ListPropertiesReply struct { Sequence uint16 Length uint32 // padding: 1 bytes AtomsLen uint16 // padding: 22 bytes - Atoms []Atom // size: pad((int(AtomsLen) * 4)) + Atoms []Atom // size: xgb.Pad((int(AtomsLen) * 4)) } // Waits and reads reply data from request ListProperties func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7776,33 +7769,29 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.AtomsLen = Get16(buf[b:]) + v.AtomsLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Atoms = make([]Atom, v.AtomsLen) for i := 0; i < int(v.AtomsLen); i++ { - v.Atoms[i] = Atom(Get32(buf[b:])) + v.Atoms[i] = Atom(xgb.Get32(buf[b:])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook ListPropertiesCookie) Check() error { - return cook.check() -} - // Write request to wire for ListProperties -func (c *Conn) listPropertiesRequest(Window Window) []byte { +func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7812,10 +7801,10 @@ func (c *Conn) listPropertiesRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -7824,28 +7813,28 @@ func (c *Conn) listPropertiesRequest(Window Window) []byte { // Request SetSelectionOwner // size: 16 type SetSelectionOwnerCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetSelectionOwner -func (c *Conn) SetSelectionOwner(Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) +func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } -func (c *Conn) SetSelectionOwnerChecked(Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setSelectionOwnerRequest(Owner, Selection, Time), cookie) +func SetSelectionOwnerChecked(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } func (cook SetSelectionOwnerCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetSelectionOwner -func (c *Conn) setSelectionOwnerRequest(Owner Window, Selection Atom, Time Timestamp) []byte { +func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -7855,16 +7844,16 @@ func (c *Conn) setSelectionOwnerRequest(Owner Window, Selection Atom, Time Times b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Owner)) + xgb.Put32(buf[b:], uint32(Owner)) b += 4 - Put32(buf[b:], uint32(Selection)) + xgb.Put32(buf[b:], uint32(Selection)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -7873,18 +7862,18 @@ func (c *Conn) setSelectionOwnerRequest(Owner Window, Selection Atom, Time Times // Request GetSelectionOwner // size: 8 type GetSelectionOwnerCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetSelectionOwner(Selection Atom) GetSelectionOwnerCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) +func GetSelectionOwner(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } -func (c *Conn) GetSelectionOwnerUnchecked(Selection Atom) GetSelectionOwnerCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getSelectionOwnerRequest(Selection), cookie) +func GetSelectionOwnerUnchecked(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } @@ -7899,7 +7888,7 @@ type GetSelectionOwnerReply struct { // Waits and reads reply data from request GetSelectionOwner func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -7916,24 +7905,20 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Owner = Window(Get32(buf[b:])) + v.Owner = Window(xgb.Get32(buf[b:])) b += 4 return v } -func (cook GetSelectionOwnerCookie) Check() error { - return cook.check() -} - // Write request to wire for GetSelectionOwner -func (c *Conn) getSelectionOwnerRequest(Selection Atom) []byte { +func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7943,10 +7928,10 @@ func (c *Conn) getSelectionOwnerRequest(Selection Atom) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Selection)) + xgb.Put32(buf[b:], uint32(Selection)) b += 4 return buf @@ -7955,28 +7940,28 @@ func (c *Conn) getSelectionOwnerRequest(Selection Atom) []byte { // Request ConvertSelection // size: 24 type ConvertSelectionCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ConvertSelection -func (c *Conn) ConvertSelection(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) +func ConvertSelection(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } -func (c *Conn) ConvertSelectionChecked(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.convertSelectionRequest(Requestor, Selection, Target, Property, Time), cookie) +func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } func (cook ConvertSelectionCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ConvertSelection -func (c *Conn) convertSelectionRequest(Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { +func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -7986,22 +7971,22 @@ func (c *Conn) convertSelectionRequest(Requestor Window, Selection Atom, Target b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Requestor)) + xgb.Put32(buf[b:], uint32(Requestor)) b += 4 - Put32(buf[b:], uint32(Selection)) + xgb.Put32(buf[b:], uint32(Selection)) b += 4 - Put32(buf[b:], uint32(Target)) + xgb.Put32(buf[b:], uint32(Target)) b += 4 - Put32(buf[b:], uint32(Property)) + xgb.Put32(buf[b:], uint32(Property)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -8010,28 +7995,28 @@ func (c *Conn) convertSelectionRequest(Requestor Window, Selection Atom, Target // Request SendEvent // size: 44 type SendEventCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SendEvent -func (c *Conn) SendEvent(Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) +func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } -func (c *Conn) SendEventChecked(Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.sendEventRequest(Propagate, Destination, EventMask, Event), cookie) +func SendEventChecked(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } func (cook SendEventCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SendEvent -func (c *Conn) sendEventRequest(Propagate bool, Destination Window, EventMask uint32, Event string) []byte { +func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { size := 44 b := 0 buf := make([]byte, size) @@ -8046,17 +8031,17 @@ func (c *Conn) sendEventRequest(Propagate bool, Destination Window, EventMask ui } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Destination)) + xgb.Put32(buf[b:], uint32(Destination)) b += 4 - Put32(buf[b:], EventMask) + xgb.Put32(buf[b:], EventMask) b += 4 copy(buf[b:], Event[:32]) - b += pad(int(32)) + b += xgb.Pad(int(32)) return buf } @@ -8064,18 +8049,18 @@ func (c *Conn) sendEventRequest(Propagate bool, Destination Window, EventMask ui // Request GrabPointer // size: 24 type GrabPointerCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GrabPointer(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) +func GrabPointer(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } -func (c *Conn) GrabPointerUnchecked(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.grabPointerRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) +func GrabPointerUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } @@ -8089,7 +8074,7 @@ type GrabPointerReply struct { // Waits and reads reply data from request GrabPointer func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -8107,21 +8092,17 @@ func grabPointerReply(buf []byte) *GrabPointerReply { v.Status = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 return v } -func (cook GrabPointerCookie) Check() error { - return cook.check() -} - // Write request to wire for GrabPointer -func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { +func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -8136,13 +8117,13 @@ func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Window, EventMask } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put16(buf[b:], EventMask) + xgb.Put16(buf[b:], EventMask) b += 2 buf[b] = PointerMode @@ -8151,13 +8132,13 @@ func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Window, EventMask buf[b] = KeyboardMode b += 1 - Put32(buf[b:], uint32(ConfineTo)) + xgb.Put32(buf[b:], uint32(ConfineTo)) b += 4 - Put32(buf[b:], uint32(Cursor)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -8166,28 +8147,28 @@ func (c *Conn) grabPointerRequest(OwnerEvents bool, GrabWindow Window, EventMask // Request UngrabPointer // size: 8 type UngrabPointerCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UngrabPointer -func (c *Conn) UngrabPointer(Time Timestamp) UngrabPointerCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.ungrabPointerRequest(Time), cookie) +func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{cookie} } -func (c *Conn) UngrabPointerChecked(Time Timestamp) UngrabPointerCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.ungrabPointerRequest(Time), cookie) +func UngrabPointerChecked(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{cookie} } func (cook UngrabPointerCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UngrabPointer -func (c *Conn) ungrabPointerRequest(Time Timestamp) []byte { +func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8197,10 +8178,10 @@ func (c *Conn) ungrabPointerRequest(Time Timestamp) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -8209,28 +8190,28 @@ func (c *Conn) ungrabPointerRequest(Time Timestamp) []byte { // Request GrabButton // size: 24 type GrabButtonCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for GrabButton -func (c *Conn) GrabButton(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) +func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } -func (c *Conn) GrabButtonChecked(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.grabButtonRequest(OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) +func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } func (cook GrabButtonCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for GrabButton -func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { +func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -8245,13 +8226,13 @@ func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put16(buf[b:], EventMask) + xgb.Put16(buf[b:], EventMask) b += 2 buf[b] = PointerMode @@ -8260,10 +8241,10 @@ func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask buf[b] = KeyboardMode b += 1 - Put32(buf[b:], uint32(ConfineTo)) + xgb.Put32(buf[b:], uint32(ConfineTo)) b += 4 - Put32(buf[b:], uint32(Cursor)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 buf[b] = Button @@ -8271,7 +8252,7 @@ func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask b += 1 // padding - Put16(buf[b:], Modifiers) + xgb.Put16(buf[b:], Modifiers) b += 2 return buf @@ -8280,28 +8261,28 @@ func (c *Conn) grabButtonRequest(OwnerEvents bool, GrabWindow Window, EventMask // Request UngrabButton // size: 12 type UngrabButtonCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UngrabButton -func (c *Conn) UngrabButton(Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) +func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } -func (c *Conn) UngrabButtonChecked(Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.ungrabButtonRequest(Button, GrabWindow, Modifiers), cookie) +func UngrabButtonChecked(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } func (cook UngrabButtonCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UngrabButton -func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Window, Modifiers uint16) []byte { +func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -8312,13 +8293,13 @@ func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Window, Modifiers uin buf[b] = Button b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put16(buf[b:], Modifiers) + xgb.Put16(buf[b:], Modifiers) b += 2 b += 2 // padding @@ -8329,28 +8310,28 @@ func (c *Conn) ungrabButtonRequest(Button byte, GrabWindow Window, Modifiers uin // Request ChangeActivePointerGrab // size: 16 type ChangeActivePointerGrabCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeActivePointerGrab -func (c *Conn) ChangeActivePointerGrab(Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) +func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } -func (c *Conn) ChangeActivePointerGrabChecked(Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeActivePointerGrabRequest(Cursor, Time, EventMask), cookie) +func ChangeActivePointerGrabChecked(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } func (cook ChangeActivePointerGrabCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeActivePointerGrab -func (c *Conn) changeActivePointerGrabRequest(Cursor Cursor, Time Timestamp, EventMask uint16) []byte { +func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8360,16 +8341,16 @@ func (c *Conn) changeActivePointerGrabRequest(Cursor Cursor, Time Timestamp, Eve b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cursor)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 - Put16(buf[b:], EventMask) + xgb.Put16(buf[b:], EventMask) b += 2 b += 2 // padding @@ -8380,18 +8361,18 @@ func (c *Conn) changeActivePointerGrabRequest(Cursor Cursor, Time Timestamp, Eve // Request GrabKeyboard // size: 16 type GrabKeyboardCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GrabKeyboard(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) +func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } -func (c *Conn) GrabKeyboardUnchecked(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.grabKeyboardRequest(OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) +func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } @@ -8405,7 +8386,7 @@ type GrabKeyboardReply struct { // Waits and reads reply data from request GrabKeyboard func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -8423,21 +8404,17 @@ func grabKeyboardReply(buf []byte) *GrabKeyboardReply { v.Status = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 return v } -func (cook GrabKeyboardCookie) Check() error { - return cook.check() -} - // Write request to wire for GrabKeyboard -func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { +func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8452,13 +8429,13 @@ func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Window, Time Tim } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 buf[b] = PointerMode @@ -8475,28 +8452,28 @@ func (c *Conn) grabKeyboardRequest(OwnerEvents bool, GrabWindow Window, Time Tim // Request UngrabKeyboard // size: 8 type UngrabKeyboardCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UngrabKeyboard -func (c *Conn) UngrabKeyboard(Time Timestamp) UngrabKeyboardCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.ungrabKeyboardRequest(Time), cookie) +func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{cookie} } -func (c *Conn) UngrabKeyboardChecked(Time Timestamp) UngrabKeyboardCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.ungrabKeyboardRequest(Time), cookie) +func UngrabKeyboardChecked(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{cookie} } func (cook UngrabKeyboardCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UngrabKeyboard -func (c *Conn) ungrabKeyboardRequest(Time Timestamp) []byte { +func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8506,10 +8483,10 @@ func (c *Conn) ungrabKeyboardRequest(Time Timestamp) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -8518,28 +8495,28 @@ func (c *Conn) ungrabKeyboardRequest(Time Timestamp) []byte { // Request GrabKey // size: 16 type GrabKeyCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for GrabKey -func (c *Conn) GrabKey(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) +func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } -func (c *Conn) GrabKeyChecked(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.grabKeyRequest(OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) +func GrabKeyChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } func (cook GrabKeyCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for GrabKey -func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { +func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8554,13 +8531,13 @@ func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Window, Modifiers uin } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put16(buf[b:], Modifiers) + xgb.Put16(buf[b:], Modifiers) b += 2 buf[b] = byte(Key) @@ -8580,28 +8557,28 @@ func (c *Conn) grabKeyRequest(OwnerEvents bool, GrabWindow Window, Modifiers uin // Request UngrabKey // size: 12 type UngrabKeyCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UngrabKey -func (c *Conn) UngrabKey(Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) +func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } -func (c *Conn) UngrabKeyChecked(Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.ungrabKeyRequest(Key, GrabWindow, Modifiers), cookie) +func UngrabKeyChecked(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } func (cook UngrabKeyCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UngrabKey -func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Window, Modifiers uint16) []byte { +func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -8612,13 +8589,13 @@ func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Window, Modifiers uint16 buf[b] = byte(Key) b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - Put16(buf[b:], Modifiers) + xgb.Put16(buf[b:], Modifiers) b += 2 b += 2 // padding @@ -8629,28 +8606,28 @@ func (c *Conn) ungrabKeyRequest(Key Keycode, GrabWindow Window, Modifiers uint16 // Request AllowEvents // size: 8 type AllowEventsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for AllowEvents -func (c *Conn) AllowEvents(Mode byte, Time Timestamp) AllowEventsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.allowEventsRequest(Mode, Time), cookie) +func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{cookie} } -func (c *Conn) AllowEventsChecked(Mode byte, Time Timestamp) AllowEventsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.allowEventsRequest(Mode, Time), cookie) +func AllowEventsChecked(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{cookie} } func (cook AllowEventsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for AllowEvents -func (c *Conn) allowEventsRequest(Mode byte, Time Timestamp) []byte { +func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8661,10 +8638,10 @@ func (c *Conn) allowEventsRequest(Mode byte, Time Timestamp) []byte { buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -8673,28 +8650,28 @@ func (c *Conn) allowEventsRequest(Mode byte, Time Timestamp) []byte { // Request GrabServer // size: 4 type GrabServerCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for GrabServer -func (c *Conn) GrabServer() GrabServerCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.grabServerRequest(), cookie) +func GrabServer(c *xgb.Conn) GrabServerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{cookie} } -func (c *Conn) GrabServerChecked() GrabServerCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.grabServerRequest(), cookie) +func GrabServerChecked(c *xgb.Conn) GrabServerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{cookie} } func (cook GrabServerCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for GrabServer -func (c *Conn) grabServerRequest() []byte { +func grabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -8702,8 +8679,8 @@ func (c *Conn) grabServerRequest() []byte { buf[b] = 36 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -8712,28 +8689,28 @@ func (c *Conn) grabServerRequest() []byte { // Request UngrabServer // size: 4 type UngrabServerCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UngrabServer -func (c *Conn) UngrabServer() UngrabServerCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.ungrabServerRequest(), cookie) +func UngrabServer(c *xgb.Conn) UngrabServerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{cookie} } -func (c *Conn) UngrabServerChecked() UngrabServerCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.ungrabServerRequest(), cookie) +func UngrabServerChecked(c *xgb.Conn) UngrabServerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{cookie} } func (cook UngrabServerCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UngrabServer -func (c *Conn) ungrabServerRequest() []byte { +func ungrabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -8741,8 +8718,8 @@ func (c *Conn) ungrabServerRequest() []byte { buf[b] = 37 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -8751,18 +8728,18 @@ func (c *Conn) ungrabServerRequest() []byte { // Request QueryPointer // size: 8 type QueryPointerCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryPointer(Window Window) QueryPointerCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryPointerRequest(Window), cookie) +func QueryPointer(c *xgb.Conn, Window Window) QueryPointerCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } -func (c *Conn) QueryPointerUnchecked(Window Window) QueryPointerCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryPointerRequest(Window), cookie) +func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } @@ -8784,7 +8761,7 @@ type QueryPointerReply struct { // Waits and reads reply data from request QueryPointer func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -8806,31 +8783,31 @@ func queryPointerReply(buf []byte) *QueryPointerReply { } b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Root = Window(Get32(buf[b:])) + v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.RootX = int16(Get16(buf[b:])) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.RootY = int16(Get16(buf[b:])) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.WinX = int16(Get16(buf[b:])) + v.WinX = int16(xgb.Get16(buf[b:])) b += 2 - v.WinY = int16(Get16(buf[b:])) + v.WinY = int16(xgb.Get16(buf[b:])) b += 2 - v.Mask = Get16(buf[b:]) + v.Mask = xgb.Get16(buf[b:]) b += 2 b += 2 // padding @@ -8838,12 +8815,8 @@ func queryPointerReply(buf []byte) *QueryPointerReply { return v } -func (cook QueryPointerCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryPointer -func (c *Conn) queryPointerRequest(Window Window) []byte { +func queryPointerRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -8853,10 +8826,10 @@ func (c *Conn) queryPointerRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -8865,35 +8838,35 @@ func (c *Conn) queryPointerRequest(Window Window) []byte { // Request GetMotionEvents // size: 16 type GetMotionEventsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetMotionEvents(Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) +func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } -func (c *Conn) GetMotionEventsUnchecked(Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getMotionEventsRequest(Window, Start, Stop), cookie) +func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } // Request reply for GetMotionEvents -// size: (32 + pad((int(EventsLen) * 8))) +// size: (32 + xgb.Pad((int(EventsLen) * 8))) type GetMotionEventsReply struct { Sequence uint16 Length uint32 // padding: 1 bytes EventsLen uint32 // padding: 20 bytes - Events []Timecoord // size: pad((int(EventsLen) * 8)) + Events []Timecoord // size: xgb.Pad((int(EventsLen) * 8)) } // Waits and reads reply data from request GetMotionEvents func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -8910,29 +8883,25 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.EventsLen = Get32(buf[b:]) + v.EventsLen = xgb.Get32(buf[b:]) b += 4 b += 20 // padding v.Events = make([]Timecoord, v.EventsLen) - b += ReadTimecoordList(buf[b:], v.Events) + b += TimecoordReadList(buf[b:], v.Events) return v } -func (cook GetMotionEventsCookie) Check() error { - return cook.check() -} - // Write request to wire for GetMotionEvents -func (c *Conn) getMotionEventsRequest(Window Window, Start Timestamp, Stop Timestamp) []byte { +func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -8942,16 +8911,16 @@ func (c *Conn) getMotionEventsRequest(Window Window, Start Timestamp, Stop Times b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Start)) + xgb.Put32(buf[b:], uint32(Start)) b += 4 - Put32(buf[b:], uint32(Stop)) + xgb.Put32(buf[b:], uint32(Stop)) b += 4 return buf @@ -8960,18 +8929,18 @@ func (c *Conn) getMotionEventsRequest(Window Window, Start Timestamp, Stop Times // Request TranslateCoordinates // size: 16 type TranslateCoordinatesCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) TranslateCoordinates(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) +func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } -func (c *Conn) TranslateCoordinatesUnchecked(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.translateCoordinatesRequest(SrcWindow, DstWindow, SrcX, SrcY), cookie) +func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } @@ -8988,7 +8957,7 @@ type TranslateCoordinatesReply struct { // Waits and reads reply data from request TranslateCoordinates func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9010,30 +8979,26 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { } b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Child = Window(Get32(buf[b:])) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.DstX = int16(Get16(buf[b:])) + v.DstX = int16(xgb.Get16(buf[b:])) b += 2 - v.DstY = int16(Get16(buf[b:])) + v.DstY = int16(xgb.Get16(buf[b:])) b += 2 return v } -func (cook TranslateCoordinatesCookie) Check() error { - return cook.check() -} - // Write request to wire for TranslateCoordinates -func (c *Conn) translateCoordinatesRequest(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { +func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -9043,19 +9008,19 @@ func (c *Conn) translateCoordinatesRequest(SrcWindow Window, DstWindow Window, S b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(SrcWindow)) + xgb.Put32(buf[b:], uint32(SrcWindow)) b += 4 - Put32(buf[b:], uint32(DstWindow)) + xgb.Put32(buf[b:], uint32(DstWindow)) b += 4 - Put16(buf[b:], uint16(SrcX)) + xgb.Put16(buf[b:], uint16(SrcX)) b += 2 - Put16(buf[b:], uint16(SrcY)) + xgb.Put16(buf[b:], uint16(SrcY)) b += 2 return buf @@ -9064,28 +9029,28 @@ func (c *Conn) translateCoordinatesRequest(SrcWindow Window, DstWindow Window, S // Request WarpPointer // size: 24 type WarpPointerCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for WarpPointer -func (c *Conn) WarpPointer(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) +func WarpPointer(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } -func (c *Conn) WarpPointerChecked(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.warpPointerRequest(SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) +func WarpPointerChecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } func (cook WarpPointerCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for WarpPointer -func (c *Conn) warpPointerRequest(SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { +func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 buf := make([]byte, size) @@ -9095,31 +9060,31 @@ func (c *Conn) warpPointerRequest(SrcWindow Window, DstWindow Window, SrcX int16 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(SrcWindow)) + xgb.Put32(buf[b:], uint32(SrcWindow)) b += 4 - Put32(buf[b:], uint32(DstWindow)) + xgb.Put32(buf[b:], uint32(DstWindow)) b += 4 - Put16(buf[b:], uint16(SrcX)) + xgb.Put16(buf[b:], uint16(SrcX)) b += 2 - Put16(buf[b:], uint16(SrcY)) + xgb.Put16(buf[b:], uint16(SrcY)) b += 2 - Put16(buf[b:], SrcWidth) + xgb.Put16(buf[b:], SrcWidth) b += 2 - Put16(buf[b:], SrcHeight) + xgb.Put16(buf[b:], SrcHeight) b += 2 - Put16(buf[b:], uint16(DstX)) + xgb.Put16(buf[b:], uint16(DstX)) b += 2 - Put16(buf[b:], uint16(DstY)) + xgb.Put16(buf[b:], uint16(DstY)) b += 2 return buf @@ -9128,28 +9093,28 @@ func (c *Conn) warpPointerRequest(SrcWindow Window, DstWindow Window, SrcX int16 // Request SetInputFocus // size: 12 type SetInputFocusCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetInputFocus -func (c *Conn) SetInputFocus(RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) +func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } -func (c *Conn) SetInputFocusChecked(RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setInputFocusRequest(RevertTo, Focus, Time), cookie) +func SetInputFocusChecked(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } func (cook SetInputFocusCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetInputFocus -func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Window, Time Timestamp) []byte { +func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -9160,13 +9125,13 @@ func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Window, Time Timestamp) buf[b] = RevertTo b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Focus)) + xgb.Put32(buf[b:], uint32(Focus)) b += 4 - Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf @@ -9175,18 +9140,18 @@ func (c *Conn) setInputFocusRequest(RevertTo byte, Focus Window, Time Timestamp) // Request GetInputFocus // size: 4 type GetInputFocusCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetInputFocus() GetInputFocusCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getInputFocusRequest(), cookie) +func GetInputFocus(c *xgb.Conn) GetInputFocusCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } -func (c *Conn) GetInputFocusUnchecked() GetInputFocusCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getInputFocusRequest(), cookie) +func GetInputFocusUnchecked(c *xgb.Conn) GetInputFocusCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } @@ -9201,7 +9166,7 @@ type GetInputFocusReply struct { // Waits and reads reply data from request GetInputFocus func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9219,24 +9184,20 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { v.RevertTo = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Focus = Window(Get32(buf[b:])) + v.Focus = Window(xgb.Get32(buf[b:])) b += 4 return v } -func (cook GetInputFocusCookie) Check() error { - return cook.check() -} - // Write request to wire for GetInputFocus -func (c *Conn) getInputFocusRequest() []byte { +func getInputFocusRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -9244,8 +9205,8 @@ func (c *Conn) getInputFocusRequest() []byte { buf[b] = 43 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -9254,18 +9215,18 @@ func (c *Conn) getInputFocusRequest() []byte { // Request QueryKeymap // size: 4 type QueryKeymapCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryKeymap() QueryKeymapCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryKeymapRequest(), cookie) +func QueryKeymap(c *xgb.Conn) QueryKeymapCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } -func (c *Conn) QueryKeymapUnchecked() QueryKeymapCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryKeymapRequest(), cookie) +func QueryKeymapUnchecked(c *xgb.Conn) QueryKeymapCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } @@ -9280,7 +9241,7 @@ type QueryKeymapReply struct { // Waits and reads reply data from request QueryKeymap func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9297,25 +9258,21 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 v.Keys = make([]byte, 32) copy(v.Keys[:32], buf[b:]) - b += pad(int(32)) + b += xgb.Pad(int(32)) return v } -func (cook QueryKeymapCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryKeymap -func (c *Conn) queryKeymapRequest() []byte { +func queryKeymapRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -9323,39 +9280,39 @@ func (c *Conn) queryKeymapRequest() []byte { buf[b] = 44 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf } // Request OpenFont -// size: pad((12 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) type OpenFontCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for OpenFont -func (c *Conn) OpenFont(Fid Font, NameLen uint16, Name string) OpenFontCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) +func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } -func (c *Conn) OpenFontChecked(Fid Font, NameLen uint16, Name string) OpenFontCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.openFontRequest(Fid, NameLen, Name), cookie) +func OpenFontChecked(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } func (cook OpenFontCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for OpenFont -func (c *Conn) openFontRequest(Fid Font, NameLen uint16, Name string) []byte { - size := pad((12 + pad((int(NameLen) * 1)))) +func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9364,19 +9321,19 @@ func (c *Conn) openFontRequest(Fid Font, NameLen uint16, Name string) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Fid)) + xgb.Put32(buf[b:], uint32(Fid)) b += 4 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } @@ -9384,28 +9341,28 @@ func (c *Conn) openFontRequest(Fid Font, NameLen uint16, Name string) []byte { // Request CloseFont // size: 8 type CloseFontCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CloseFont -func (c *Conn) CloseFont(Font Font) CloseFontCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.closeFontRequest(Font), cookie) +func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{cookie} } -func (c *Conn) CloseFontChecked(Font Font) CloseFontCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.closeFontRequest(Font), cookie) +func CloseFontChecked(c *xgb.Conn, Font Font) CloseFontCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{cookie} } func (cook CloseFontCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CloseFont -func (c *Conn) closeFontRequest(Font Font) []byte { +func closeFontRequest(c *xgb.Conn, Font Font) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9415,10 +9372,10 @@ func (c *Conn) closeFontRequest(Font Font) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Font)) + xgb.Put32(buf[b:], uint32(Font)) b += 4 return buf @@ -9427,23 +9384,23 @@ func (c *Conn) closeFontRequest(Font Font) []byte { // Request QueryFont // size: 8 type QueryFontCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryFont(Font Fontable) QueryFontCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryFontRequest(Font), cookie) +func QueryFont(c *xgb.Conn, Font Fontable) QueryFontCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } -func (c *Conn) QueryFontUnchecked(Font Fontable) QueryFontCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryFontRequest(Font), cookie) +func QueryFontUnchecked(c *xgb.Conn, Font Fontable) QueryFontCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } // Request reply for QueryFont -// size: ((60 + pad((int(PropertiesLen) * 8))) + pad((int(CharInfosLen) * 12))) +// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(CharInfosLen) * 12))) type QueryFontReply struct { Sequence uint16 Length uint32 @@ -9463,13 +9420,13 @@ type QueryFontReply struct { FontAscent int16 FontDescent int16 CharInfosLen uint32 - Properties []Fontprop // size: pad((int(PropertiesLen) * 8)) - CharInfos []Charinfo // size: pad((int(CharInfosLen) * 12)) + Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) + CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) } // Waits and reads reply data from request QueryFont func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9486,32 +9443,32 @@ func queryFontReply(buf []byte) *QueryFontReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 v.MinBounds = Charinfo{} - b += ReadCharinfo(buf[b:], &v.MinBounds) + b += CharinfoRead(buf[b:], &v.MinBounds) b += 4 // padding v.MaxBounds = Charinfo{} - b += ReadCharinfo(buf[b:], &v.MaxBounds) + b += CharinfoRead(buf[b:], &v.MaxBounds) b += 4 // padding - v.MinCharOrByte2 = Get16(buf[b:]) + v.MinCharOrByte2 = xgb.Get16(buf[b:]) b += 2 - v.MaxCharOrByte2 = Get16(buf[b:]) + v.MaxCharOrByte2 = xgb.Get16(buf[b:]) b += 2 - v.DefaultChar = Get16(buf[b:]) + v.DefaultChar = xgb.Get16(buf[b:]) b += 2 - v.PropertiesLen = Get16(buf[b:]) + v.PropertiesLen = xgb.Get16(buf[b:]) b += 2 v.DrawDirection = buf[b] @@ -9530,30 +9487,26 @@ func queryFontReply(buf []byte) *QueryFontReply { } b += 1 - v.FontAscent = int16(Get16(buf[b:])) + v.FontAscent = int16(xgb.Get16(buf[b:])) b += 2 - v.FontDescent = int16(Get16(buf[b:])) + v.FontDescent = int16(xgb.Get16(buf[b:])) b += 2 - v.CharInfosLen = Get32(buf[b:]) + v.CharInfosLen = xgb.Get32(buf[b:]) b += 4 v.Properties = make([]Fontprop, v.PropertiesLen) - b += ReadFontpropList(buf[b:], v.Properties) + b += FontpropReadList(buf[b:], v.Properties) v.CharInfos = make([]Charinfo, v.CharInfosLen) - b += ReadCharinfoList(buf[b:], v.CharInfos) + b += CharinfoReadList(buf[b:], v.CharInfos) return v } -func (cook QueryFontCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryFont -func (c *Conn) queryFontRequest(Font Fontable) []byte { +func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -9563,30 +9516,30 @@ func (c *Conn) queryFontRequest(Font Fontable) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Font)) + xgb.Put32(buf[b:], uint32(Font)) b += 4 return buf } // Request QueryTextExtents -// size: pad((8 + pad((len(String) * 2)))) +// size: xgb.Pad((8 + xgb.Pad((len(String) * 2)))) type QueryTextExtentsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryTextExtents(Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) +func QueryTextExtents(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } -func (c *Conn) QueryTextExtentsUnchecked(Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryTextExtentsRequest(Font, String, StringLen), cookie) +func QueryTextExtentsUnchecked(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } @@ -9607,7 +9560,7 @@ type QueryTextExtentsReply struct { // Waits and reads reply data from request QueryTextExtents func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9625,43 +9578,39 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { v.DrawDirection = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.FontAscent = int16(Get16(buf[b:])) + v.FontAscent = int16(xgb.Get16(buf[b:])) b += 2 - v.FontDescent = int16(Get16(buf[b:])) + v.FontDescent = int16(xgb.Get16(buf[b:])) b += 2 - v.OverallAscent = int16(Get16(buf[b:])) + v.OverallAscent = int16(xgb.Get16(buf[b:])) b += 2 - v.OverallDescent = int16(Get16(buf[b:])) + v.OverallDescent = int16(xgb.Get16(buf[b:])) b += 2 - v.OverallWidth = int32(Get32(buf[b:])) + v.OverallWidth = int32(xgb.Get32(buf[b:])) b += 4 - v.OverallLeft = int32(Get32(buf[b:])) + v.OverallLeft = int32(xgb.Get32(buf[b:])) b += 4 - v.OverallRight = int32(Get32(buf[b:])) + v.OverallRight = int32(xgb.Get32(buf[b:])) b += 4 return v } -func (cook QueryTextExtentsCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryTextExtents -func (c *Conn) queryTextExtentsRequest(Font Fontable, String []Char2b, StringLen uint16) []byte { - size := pad((8 + pad((len(String) * 2)))) +func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { + size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) b := 0 buf := make([]byte, size) @@ -9671,10 +9620,10 @@ func (c *Conn) queryTextExtentsRequest(Font Fontable, String []Char2b, StringLen buf[b] = byte((int(StringLen) & 1)) b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Font)) + xgb.Put32(buf[b:], uint32(Font)) b += 4 b += Char2bListBytes(buf[b:], String) @@ -9685,20 +9634,20 @@ func (c *Conn) queryTextExtentsRequest(Font Fontable, String []Char2b, StringLen } // Request ListFonts -// size: pad((8 + pad((int(PatternLen) * 1)))) +// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) type ListFontsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListFonts(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listFontsRequest(MaxNames, PatternLen, Pattern), cookie) +func ListFonts(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } -func (c *Conn) ListFontsUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listFontsRequest(MaxNames, PatternLen, Pattern), cookie) +func ListFontsUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } @@ -9715,7 +9664,7 @@ type ListFontsReply struct { // Waits and reads reply data from request ListFonts func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9732,30 +9681,26 @@ func listFontsReply(buf []byte) *ListFontsReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.NamesLen = Get16(buf[b:]) + v.NamesLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Names = make([]Str, v.NamesLen) - b += ReadStrList(buf[b:], v.Names) + b += StrReadList(buf[b:], v.Names) return v } -func (cook ListFontsCookie) Check() error { - return cook.check() -} - // Write request to wire for ListFonts -func (c *Conn) listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { - size := pad((8 + pad((int(PatternLen) * 1)))) +func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9764,41 +9709,41 @@ func (c *Conn) listFontsRequest(MaxNames uint16, PatternLen uint16, Pattern stri b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], MaxNames) + xgb.Put16(buf[b:], MaxNames) b += 2 - Put16(buf[b:], PatternLen) + xgb.Put16(buf[b:], PatternLen) b += 2 copy(buf[b:], Pattern[:PatternLen]) - b += pad(int(PatternLen)) + b += xgb.Pad(int(PatternLen)) return buf } // Request ListFontsWithInfo -// size: pad((8 + pad((int(PatternLen) * 1)))) +// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) type ListFontsWithInfoCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListFontsWithInfo(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) +func ListFontsWithInfo(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } -func (c *Conn) ListFontsWithInfoUnchecked(MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listFontsWithInfoRequest(MaxNames, PatternLen, Pattern), cookie) +func ListFontsWithInfoUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } // Request reply for ListFontsWithInfo -// size: ((60 + pad((int(PropertiesLen) * 8))) + pad((int(NameLen) * 1))) +// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(NameLen) * 1))) type ListFontsWithInfoReply struct { Sequence uint16 Length uint32 @@ -9818,13 +9763,13 @@ type ListFontsWithInfoReply struct { FontAscent int16 FontDescent int16 RepliesHint uint32 - Properties []Fontprop // size: pad((int(PropertiesLen) * 8)) - Name string // size: pad((int(NameLen) * 1)) + Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Waits and reads reply data from request ListFontsWithInfo func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -9842,32 +9787,32 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { v.NameLen = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 v.MinBounds = Charinfo{} - b += ReadCharinfo(buf[b:], &v.MinBounds) + b += CharinfoRead(buf[b:], &v.MinBounds) b += 4 // padding v.MaxBounds = Charinfo{} - b += ReadCharinfo(buf[b:], &v.MaxBounds) + b += CharinfoRead(buf[b:], &v.MaxBounds) b += 4 // padding - v.MinCharOrByte2 = Get16(buf[b:]) + v.MinCharOrByte2 = xgb.Get16(buf[b:]) b += 2 - v.MaxCharOrByte2 = Get16(buf[b:]) + v.MaxCharOrByte2 = xgb.Get16(buf[b:]) b += 2 - v.DefaultChar = Get16(buf[b:]) + v.DefaultChar = xgb.Get16(buf[b:]) b += 2 - v.PropertiesLen = Get16(buf[b:]) + v.PropertiesLen = xgb.Get16(buf[b:]) b += 2 v.DrawDirection = buf[b] @@ -9886,35 +9831,31 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { } b += 1 - v.FontAscent = int16(Get16(buf[b:])) + v.FontAscent = int16(xgb.Get16(buf[b:])) b += 2 - v.FontDescent = int16(Get16(buf[b:])) + v.FontDescent = int16(xgb.Get16(buf[b:])) b += 2 - v.RepliesHint = Get32(buf[b:]) + v.RepliesHint = xgb.Get32(buf[b:]) b += 4 v.Properties = make([]Fontprop, v.PropertiesLen) - b += ReadFontpropList(buf[b:], v.Properties) + b += FontpropReadList(buf[b:], v.Properties) { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += pad(int(v.NameLen)) + b += xgb.Pad(int(v.NameLen)) } return v } -func (cook ListFontsWithInfoCookie) Check() error { - return cook.check() -} - // Write request to wire for ListFontsWithInfo -func (c *Conn) listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Pattern string) []byte { - size := pad((8 + pad((int(PatternLen) * 1)))) +func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 buf := make([]byte, size) @@ -9923,47 +9864,47 @@ func (c *Conn) listFontsWithInfoRequest(MaxNames uint16, PatternLen uint16, Patt b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], MaxNames) + xgb.Put16(buf[b:], MaxNames) b += 2 - Put16(buf[b:], PatternLen) + xgb.Put16(buf[b:], PatternLen) b += 2 copy(buf[b:], Pattern[:PatternLen]) - b += pad(int(PatternLen)) + b += xgb.Pad(int(PatternLen)) return buf } // Request SetFontPath -// size: pad((8 + StrListSize(Font))) +// size: xgb.Pad((8 + StrListSize(Font))) type SetFontPathCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetFontPath -func (c *Conn) SetFontPath(FontQty uint16, Font []Str) SetFontPathCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setFontPathRequest(FontQty, Font), cookie) +func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{cookie} } -func (c *Conn) SetFontPathChecked(FontQty uint16, Font []Str) SetFontPathCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setFontPathRequest(FontQty, Font), cookie) +func SetFontPathChecked(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{cookie} } func (cook SetFontPathCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetFontPath -func (c *Conn) setFontPathRequest(FontQty uint16, Font []Str) []byte { - size := pad((8 + StrListSize(Font))) +func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { + size := xgb.Pad((8 + StrListSize(Font))) b := 0 buf := make([]byte, size) @@ -9972,10 +9913,10 @@ func (c *Conn) setFontPathRequest(FontQty uint16, Font []Str) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], FontQty) + xgb.Put16(buf[b:], FontQty) b += 2 b += 2 // padding @@ -9988,18 +9929,18 @@ func (c *Conn) setFontPathRequest(FontQty uint16, Font []Str) []byte { // Request GetFontPath // size: 4 type GetFontPathCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetFontPath() GetFontPathCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getFontPathRequest(), cookie) +func GetFontPath(c *xgb.Conn) GetFontPathCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } -func (c *Conn) GetFontPathUnchecked() GetFontPathCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getFontPathRequest(), cookie) +func GetFontPathUnchecked(c *xgb.Conn) GetFontPathCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } @@ -10016,7 +9957,7 @@ type GetFontPathReply struct { // Waits and reads reply data from request GetFontPath func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -10033,29 +9974,25 @@ func getFontPathReply(buf []byte) *GetFontPathReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.PathLen = Get16(buf[b:]) + v.PathLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Path = make([]Str, v.PathLen) - b += ReadStrList(buf[b:], v.Path) + b += StrReadList(buf[b:], v.Path) return v } -func (cook GetFontPathCookie) Check() error { - return cook.check() -} - // Write request to wire for GetFontPath -func (c *Conn) getFontPathRequest() []byte { +func getFontPathRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -10063,8 +10000,8 @@ func (c *Conn) getFontPathRequest() []byte { buf[b] = 52 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -10073,28 +10010,28 @@ func (c *Conn) getFontPathRequest() []byte { // Request CreatePixmap // size: 16 type CreatePixmapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreatePixmap -func (c *Conn) CreatePixmap(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) +func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } -func (c *Conn) CreatePixmapChecked(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createPixmapRequest(Depth, Pid, Drawable, Width, Height), cookie) +func CreatePixmapChecked(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } func (cook CreatePixmapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreatePixmap -func (c *Conn) createPixmapRequest(Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { +func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10105,19 +10042,19 @@ func (c *Conn) createPixmapRequest(Depth byte, Pid Pixmap, Drawable Drawable, Wi buf[b] = Depth b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Pid)) + xgb.Put32(buf[b:], uint32(Pid)) b += 4 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 return buf @@ -10126,28 +10063,28 @@ func (c *Conn) createPixmapRequest(Depth byte, Pid Pixmap, Drawable Drawable, Wi // Request FreePixmap // size: 8 type FreePixmapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FreePixmap -func (c *Conn) FreePixmap(Pixmap Pixmap) FreePixmapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.freePixmapRequest(Pixmap), cookie) +func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{cookie} } -func (c *Conn) FreePixmapChecked(Pixmap Pixmap) FreePixmapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.freePixmapRequest(Pixmap), cookie) +func FreePixmapChecked(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{cookie} } func (cook FreePixmapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FreePixmap -func (c *Conn) freePixmapRequest(Pixmap Pixmap) []byte { +func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10157,41 +10094,41 @@ func (c *Conn) freePixmapRequest(Pixmap Pixmap) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Pixmap)) + xgb.Put32(buf[b:], uint32(Pixmap)) b += 4 return buf } // Request CreateGC -// size: pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type CreateGCCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreateGC -func (c *Conn) CreateGC(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) +func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } -func (c *Conn) CreateGCChecked(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createGCRequest(Cid, Drawable, ValueMask, ValueList), cookie) +func CreateGCChecked(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } func (cook CreateGCCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreateGC -func (c *Conn) createGCRequest(Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { - size := pad((12 + (4 + pad((4 * popCount(int(ValueMask))))))) +func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -10200,52 +10137,52 @@ func (c *Conn) createGCRequest(Cid Gcontext, Drawable Drawable, ValueMask uint32 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cid)) + xgb.Put32(buf[b:], uint32(Cid)) b += 4 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } // Request ChangeGC -// size: pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type ChangeGCCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeGC -func (c *Conn) ChangeGC(Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) +func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } -func (c *Conn) ChangeGCChecked(Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeGCRequest(Gc, ValueMask, ValueList), cookie) +func ChangeGCChecked(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } func (cook ChangeGCCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeGC -func (c *Conn) changeGCRequest(Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { - size := pad((8 + (4 + pad((4 * popCount(int(ValueMask))))))) +func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -10254,19 +10191,19 @@ func (c *Conn) changeGCRequest(Gc Gcontext, ValueMask uint32, ValueList []uint32 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -10274,28 +10211,28 @@ func (c *Conn) changeGCRequest(Gc Gcontext, ValueMask uint32, ValueList []uint32 // Request CopyGC // size: 16 type CopyGCCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CopyGC -func (c *Conn) CopyGC(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) +func CopyGC(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } -func (c *Conn) CopyGCChecked(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.copyGCRequest(SrcGc, DstGc, ValueMask), cookie) +func CopyGCChecked(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } func (cook CopyGCCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CopyGC -func (c *Conn) copyGCRequest(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { +func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10305,47 +10242,47 @@ func (c *Conn) copyGCRequest(SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) [ b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(SrcGc)) + xgb.Put32(buf[b:], uint32(SrcGc)) b += 4 - Put32(buf[b:], uint32(DstGc)) + xgb.Put32(buf[b:], uint32(DstGc)) b += 4 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 return buf } // Request SetDashes -// size: pad((12 + pad((int(DashesLen) * 1)))) +// size: xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) type SetDashesCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetDashes -func (c *Conn) SetDashes(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) +func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } -func (c *Conn) SetDashesChecked(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setDashesRequest(Gc, DashOffset, DashesLen, Dashes), cookie) +func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } func (cook SetDashesCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetDashes -func (c *Conn) setDashesRequest(Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { - size := pad((12 + pad((int(DashesLen) * 1)))) +func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) b := 0 buf := make([]byte, size) @@ -10354,50 +10291,50 @@ func (c *Conn) setDashesRequest(Gc Gcontext, DashOffset uint16, DashesLen uint16 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], DashOffset) + xgb.Put16(buf[b:], DashOffset) b += 2 - Put16(buf[b:], DashesLen) + xgb.Put16(buf[b:], DashesLen) b += 2 copy(buf[b:], Dashes[:DashesLen]) - b += pad(int(DashesLen)) + b += xgb.Pad(int(DashesLen)) return buf } // Request SetClipRectangles -// size: pad((12 + pad((len(Rectangles) * 8)))) +// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) type SetClipRectanglesCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetClipRectangles -func (c *Conn) SetClipRectangles(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) +func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } -func (c *Conn) SetClipRectanglesChecked(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setClipRectanglesRequest(Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) +func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } func (cook SetClipRectanglesCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetClipRectangles -func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { - size := pad((12 + pad((len(Rectangles) * 8)))) +func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10407,16 +10344,16 @@ func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Gcontext, ClipXOrigin buf[b] = Ordering b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(ClipXOrigin)) + xgb.Put16(buf[b:], uint16(ClipXOrigin)) b += 2 - Put16(buf[b:], uint16(ClipYOrigin)) + xgb.Put16(buf[b:], uint16(ClipYOrigin)) b += 2 b += RectangleListBytes(buf[b:], Rectangles) @@ -10427,28 +10364,28 @@ func (c *Conn) setClipRectanglesRequest(Ordering byte, Gc Gcontext, ClipXOrigin // Request FreeGC // size: 8 type FreeGCCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FreeGC -func (c *Conn) FreeGC(Gc Gcontext) FreeGCCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.freeGCRequest(Gc), cookie) +func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{cookie} } -func (c *Conn) FreeGCChecked(Gc Gcontext) FreeGCCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.freeGCRequest(Gc), cookie) +func FreeGCChecked(c *xgb.Conn, Gc Gcontext) FreeGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{cookie} } func (cook FreeGCCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FreeGC -func (c *Conn) freeGCRequest(Gc Gcontext) []byte { +func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -10458,10 +10395,10 @@ func (c *Conn) freeGCRequest(Gc Gcontext) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 return buf @@ -10470,28 +10407,28 @@ func (c *Conn) freeGCRequest(Gc Gcontext) []byte { // Request ClearArea // size: 16 type ClearAreaCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ClearArea -func (c *Conn) ClearArea(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) +func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } -func (c *Conn) ClearAreaChecked(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.clearAreaRequest(Exposures, Window, X, Y, Width, Height), cookie) +func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } func (cook ClearAreaCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ClearArea -func (c *Conn) clearAreaRequest(Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { +func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -10506,22 +10443,22 @@ func (c *Conn) clearAreaRequest(Exposures bool, Window Window, X int16, Y int16, } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 return buf @@ -10530,28 +10467,28 @@ func (c *Conn) clearAreaRequest(Exposures bool, Window Window, X int16, Y int16, // Request CopyArea // size: 28 type CopyAreaCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CopyArea -func (c *Conn) CopyArea(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) +func CopyArea(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } -func (c *Conn) CopyAreaChecked(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.copyAreaRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) +func CopyAreaChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } func (cook CopyAreaCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CopyArea -func (c *Conn) copyAreaRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { +func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 buf := make([]byte, size) @@ -10561,34 +10498,34 @@ func (c *Conn) copyAreaRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gc b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(SrcDrawable)) + xgb.Put32(buf[b:], uint32(SrcDrawable)) b += 4 - Put32(buf[b:], uint32(DstDrawable)) + xgb.Put32(buf[b:], uint32(DstDrawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(SrcX)) + xgb.Put16(buf[b:], uint16(SrcX)) b += 2 - Put16(buf[b:], uint16(SrcY)) + xgb.Put16(buf[b:], uint16(SrcY)) b += 2 - Put16(buf[b:], uint16(DstX)) + xgb.Put16(buf[b:], uint16(DstX)) b += 2 - Put16(buf[b:], uint16(DstY)) + xgb.Put16(buf[b:], uint16(DstY)) b += 2 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 return buf @@ -10597,28 +10534,28 @@ func (c *Conn) copyAreaRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gc // Request CopyPlane // size: 32 type CopyPlaneCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CopyPlane -func (c *Conn) CopyPlane(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) +func CopyPlane(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } -func (c *Conn) CopyPlaneChecked(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.copyPlaneRequest(SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) +func CopyPlaneChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } func (cook CopyPlaneCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CopyPlane -func (c *Conn) copyPlaneRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { +func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -10628,68 +10565,68 @@ func (c *Conn) copyPlaneRequest(SrcDrawable Drawable, DstDrawable Drawable, Gc G b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(SrcDrawable)) + xgb.Put32(buf[b:], uint32(SrcDrawable)) b += 4 - Put32(buf[b:], uint32(DstDrawable)) + xgb.Put32(buf[b:], uint32(DstDrawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(SrcX)) + xgb.Put16(buf[b:], uint16(SrcX)) b += 2 - Put16(buf[b:], uint16(SrcY)) + xgb.Put16(buf[b:], uint16(SrcY)) b += 2 - Put16(buf[b:], uint16(DstX)) + xgb.Put16(buf[b:], uint16(DstX)) b += 2 - Put16(buf[b:], uint16(DstY)) + xgb.Put16(buf[b:], uint16(DstY)) b += 2 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 - Put32(buf[b:], BitPlane) + xgb.Put32(buf[b:], BitPlane) b += 4 return buf } // Request PolyPoint -// size: pad((12 + pad((len(Points) * 4)))) +// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) type PolyPointCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyPoint -func (c *Conn) PolyPoint(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) +func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } -func (c *Conn) PolyPointChecked(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyPointRequest(CoordinateMode, Drawable, Gc, Points), cookie) +func PolyPointChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } func (cook PolyPointCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyPoint -func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { - size := pad((12 + pad((len(Points) * 4)))) +func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10699,13 +10636,13 @@ func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Drawable, Gc Gcont buf[b] = CoordinateMode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += PointListBytes(buf[b:], Points) @@ -10714,31 +10651,31 @@ func (c *Conn) polyPointRequest(CoordinateMode byte, Drawable Drawable, Gc Gcont } // Request PolyLine -// size: pad((12 + pad((len(Points) * 4)))) +// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) type PolyLineCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyLine -func (c *Conn) PolyLine(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) +func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } -func (c *Conn) PolyLineChecked(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyLineRequest(CoordinateMode, Drawable, Gc, Points), cookie) +func PolyLineChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } func (cook PolyLineCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyLine -func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { - size := pad((12 + pad((len(Points) * 4)))) +func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10748,13 +10685,13 @@ func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Drawable, Gc Gconte buf[b] = CoordinateMode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += PointListBytes(buf[b:], Points) @@ -10763,31 +10700,31 @@ func (c *Conn) polyLineRequest(CoordinateMode byte, Drawable Drawable, Gc Gconte } // Request PolySegment -// size: pad((12 + pad((len(Segments) * 8)))) +// size: xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) type PolySegmentCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolySegment -func (c *Conn) PolySegment(Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) +func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } -func (c *Conn) PolySegmentChecked(Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polySegmentRequest(Drawable, Gc, Segments), cookie) +func PolySegmentChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } func (cook PolySegmentCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolySegment -func (c *Conn) polySegmentRequest(Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { - size := pad((12 + pad((len(Segments) * 8)))) +func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) b := 0 buf := make([]byte, size) @@ -10796,13 +10733,13 @@ func (c *Conn) polySegmentRequest(Drawable Drawable, Gc Gcontext, Segments []Seg b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += SegmentListBytes(buf[b:], Segments) @@ -10811,31 +10748,31 @@ func (c *Conn) polySegmentRequest(Drawable Drawable, Gc Gcontext, Segments []Seg } // Request PolyRectangle -// size: pad((12 + pad((len(Rectangles) * 8)))) +// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) type PolyRectangleCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyRectangle -func (c *Conn) PolyRectangle(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) +func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } -func (c *Conn) PolyRectangleChecked(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyRectangleRequest(Drawable, Gc, Rectangles), cookie) +func PolyRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } func (cook PolyRectangleCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyRectangle -func (c *Conn) polyRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { - size := pad((12 + pad((len(Rectangles) * 8)))) +func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10844,13 +10781,13 @@ func (c *Conn) polyRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles [ b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += RectangleListBytes(buf[b:], Rectangles) @@ -10859,31 +10796,31 @@ func (c *Conn) polyRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles [ } // Request PolyArc -// size: pad((12 + pad((len(Arcs) * 12)))) +// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) type PolyArcCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyArc -func (c *Conn) PolyArc(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) +func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } -func (c *Conn) PolyArcChecked(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyArcRequest(Drawable, Gc, Arcs), cookie) +func PolyArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } func (cook PolyArcCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyArc -func (c *Conn) polyArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { - size := pad((12 + pad((len(Arcs) * 12)))) +func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -10892,13 +10829,13 @@ func (c *Conn) polyArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += ArcListBytes(buf[b:], Arcs) @@ -10907,31 +10844,31 @@ func (c *Conn) polyArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte } // Request FillPoly -// size: pad((16 + pad((len(Points) * 4)))) +// size: xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) type FillPolyCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FillPoly -func (c *Conn) FillPoly(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) +func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } -func (c *Conn) FillPolyChecked(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.fillPolyRequest(Drawable, Gc, Shape, CoordinateMode, Points), cookie) +func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } func (cook FillPolyCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FillPoly -func (c *Conn) fillPolyRequest(Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { - size := pad((16 + pad((len(Points) * 4)))) +func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) b := 0 buf := make([]byte, size) @@ -10940,13 +10877,13 @@ func (c *Conn) fillPolyRequest(Drawable Drawable, Gc Gcontext, Shape byte, Coord b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 buf[b] = Shape @@ -10963,31 +10900,31 @@ func (c *Conn) fillPolyRequest(Drawable Drawable, Gc Gcontext, Shape byte, Coord } // Request PolyFillRectangle -// size: pad((12 + pad((len(Rectangles) * 8)))) +// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) type PolyFillRectangleCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyFillRectangle -func (c *Conn) PolyFillRectangle(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) +func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } -func (c *Conn) PolyFillRectangleChecked(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyFillRectangleRequest(Drawable, Gc, Rectangles), cookie) +func PolyFillRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } func (cook PolyFillRectangleCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyFillRectangle -func (c *Conn) polyFillRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { - size := pad((12 + pad((len(Rectangles) * 8)))) +func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 buf := make([]byte, size) @@ -10996,13 +10933,13 @@ func (c *Conn) polyFillRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangl b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += RectangleListBytes(buf[b:], Rectangles) @@ -11011,31 +10948,31 @@ func (c *Conn) polyFillRectangleRequest(Drawable Drawable, Gc Gcontext, Rectangl } // Request PolyFillArc -// size: pad((12 + pad((len(Arcs) * 12)))) +// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) type PolyFillArcCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyFillArc -func (c *Conn) PolyFillArc(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) +func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } -func (c *Conn) PolyFillArcChecked(Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyFillArcRequest(Drawable, Gc, Arcs), cookie) +func PolyFillArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } func (cook PolyFillArcCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyFillArc -func (c *Conn) polyFillArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { - size := pad((12 + pad((len(Arcs) * 12)))) +func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 buf := make([]byte, size) @@ -11044,13 +10981,13 @@ func (c *Conn) polyFillArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) [] b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 b += ArcListBytes(buf[b:], Arcs) @@ -11059,31 +10996,31 @@ func (c *Conn) polyFillArcRequest(Drawable Drawable, Gc Gcontext, Arcs []Arc) [] } // Request PutImage -// size: pad((24 + pad((len(Data) * 1)))) +// size: xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) type PutImageCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PutImage -func (c *Conn) PutImage(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) +func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } -func (c *Conn) PutImageChecked(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.putImageRequest(Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) +func PutImageChecked(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } func (cook PutImageCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PutImage -func (c *Conn) putImageRequest(Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { - size := pad((24 + pad((len(Data) * 1)))) +func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -11093,25 +11030,25 @@ func (c *Conn) putImageRequest(Format byte, Drawable Drawable, Gc Gcontext, Widt buf[b] = Format b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 - Put16(buf[b:], uint16(DstX)) + xgb.Put16(buf[b:], uint16(DstX)) b += 2 - Put16(buf[b:], uint16(DstY)) + xgb.Put16(buf[b:], uint16(DstY)) b += 2 buf[b] = LeftPad @@ -11123,7 +11060,7 @@ func (c *Conn) putImageRequest(Format byte, Drawable Drawable, Gc Gcontext, Widt b += 2 // padding copy(buf[b:], Data[:len(Data)]) - b += pad(int(len(Data))) + b += xgb.Pad(int(len(Data))) return buf } @@ -11131,35 +11068,35 @@ func (c *Conn) putImageRequest(Format byte, Drawable Drawable, Gc Gcontext, Widt // Request GetImage // size: 20 type GetImageCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetImage(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) +func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } -func (c *Conn) GetImageUnchecked(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getImageRequest(Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) +func GetImageUnchecked(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } // Request reply for GetImage -// size: (32 + pad(((int(Length) * 4) * 1))) +// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) type GetImageReply struct { Sequence uint16 Length uint32 Depth byte Visual Visualid // padding: 20 bytes - Data []byte // size: pad(((int(Length) * 4) * 1)) + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } // Waits and reads reply data from request GetImage func (cook GetImageCookie) Reply() (*GetImageReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -11177,30 +11114,26 @@ func getImageReply(buf []byte) *GetImageReply { v.Depth = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Visual = Visualid(Get32(buf[b:])) + v.Visual = Visualid(xgb.Get32(buf[b:])) b += 4 b += 20 // padding v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += pad(int((int(v.Length) * 4))) + b += xgb.Pad(int((int(v.Length) * 4))) return v } -func (cook GetImageCookie) Check() error { - return cook.check() -} - // Write request to wire for GetImage -func (c *Conn) getImageRequest(Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { +func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -11211,56 +11144,56 @@ func (c *Conn) getImageRequest(Format byte, Drawable Drawable, X int16, Y int16, buf[b] = Format b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 - Put32(buf[b:], PlaneMask) + xgb.Put32(buf[b:], PlaneMask) b += 4 return buf } // Request PolyText8 -// size: pad((16 + pad((len(Items) * 1)))) +// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) type PolyText8Cookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyText8 -func (c *Conn) PolyText8(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) +func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } -func (c *Conn) PolyText8Checked(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyText8Request(Drawable, Gc, X, Y, Items), cookie) +func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } func (cook PolyText8Cookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyText8 -func (c *Conn) polyText8Request(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { - size := pad((16 + pad((len(Items) * 1)))) +func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -11269,53 +11202,53 @@ func (c *Conn) polyText8Request(Drawable Drawable, Gc Gcontext, X int16, Y int16 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 copy(buf[b:], Items[:len(Items)]) - b += pad(int(len(Items))) + b += xgb.Pad(int(len(Items))) return buf } // Request PolyText16 -// size: pad((16 + pad((len(Items) * 1)))) +// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) type PolyText16Cookie struct { - *cookie + *xgb.Cookie } // Write request to wire for PolyText16 -func (c *Conn) PolyText16(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) +func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } -func (c *Conn) PolyText16Checked(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.polyText16Request(Drawable, Gc, X, Y, Items), cookie) +func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } func (cook PolyText16Cookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for PolyText16 -func (c *Conn) polyText16Request(Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { - size := pad((16 + pad((len(Items) * 1)))) +func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 buf := make([]byte, size) @@ -11324,53 +11257,53 @@ func (c *Conn) polyText16Request(Drawable Drawable, Gc Gcontext, X int16, Y int1 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 copy(buf[b:], Items[:len(Items)]) - b += pad(int(len(Items))) + b += xgb.Pad(int(len(Items))) return buf } // Request ImageText8 -// size: pad((16 + pad((int(StringLen) * 1)))) +// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) type ImageText8Cookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ImageText8 -func (c *Conn) ImageText8(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) +func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } -func (c *Conn) ImageText8Checked(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.imageText8Request(StringLen, Drawable, Gc, X, Y, String), cookie) +func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } func (cook ImageText8Cookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ImageText8 -func (c *Conn) imageText8Request(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { - size := pad((16 + pad((int(StringLen) * 1)))) +func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11380,53 +11313,53 @@ func (c *Conn) imageText8Request(StringLen byte, Drawable Drawable, Gc Gcontext, buf[b] = StringLen b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 copy(buf[b:], String[:StringLen]) - b += pad(int(StringLen)) + b += xgb.Pad(int(StringLen)) return buf } // Request ImageText16 -// size: pad((16 + pad((int(StringLen) * 2)))) +// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) type ImageText16Cookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ImageText16 -func (c *Conn) ImageText16(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { - cookie := c.newCookie(false, false) - c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) +func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } -func (c *Conn) ImageText16Checked(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { - cookie := c.newCookie(true, false) - c.newRequest(c.imageText16Request(StringLen, Drawable, Gc, X, Y, String), cookie) +func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } func (cook ImageText16Cookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ImageText16 -func (c *Conn) imageText16Request(StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { - size := pad((16 + pad((int(StringLen) * 2)))) +func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) @@ -11436,19 +11369,19 @@ func (c *Conn) imageText16Request(StringLen byte, Drawable Drawable, Gc Gcontext buf[b] = StringLen b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put32(buf[b:], uint32(Gc)) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - Put16(buf[b:], uint16(X)) + xgb.Put16(buf[b:], uint16(X)) b += 2 - Put16(buf[b:], uint16(Y)) + xgb.Put16(buf[b:], uint16(Y)) b += 2 b += Char2bListBytes(buf[b:], String) @@ -11459,28 +11392,28 @@ func (c *Conn) imageText16Request(StringLen byte, Drawable Drawable, Gc Gcontext // Request CreateColormap // size: 16 type CreateColormapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreateColormap -func (c *Conn) CreateColormap(Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) +func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } -func (c *Conn) CreateColormapChecked(Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createColormapRequest(Alloc, Mid, Window, Visual), cookie) +func CreateColormapChecked(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } func (cook CreateColormapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreateColormap -func (c *Conn) createColormapRequest(Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { +func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -11491,16 +11424,16 @@ func (c *Conn) createColormapRequest(Alloc byte, Mid Colormap, Window Window, Vi buf[b] = Alloc b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Mid)) + xgb.Put32(buf[b:], uint32(Mid)) b += 4 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put32(buf[b:], uint32(Visual)) + xgb.Put32(buf[b:], uint32(Visual)) b += 4 return buf @@ -11509,28 +11442,28 @@ func (c *Conn) createColormapRequest(Alloc byte, Mid Colormap, Window Window, Vi // Request FreeColormap // size: 8 type FreeColormapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FreeColormap -func (c *Conn) FreeColormap(Cmap Colormap) FreeColormapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.freeColormapRequest(Cmap), cookie) +func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{cookie} } -func (c *Conn) FreeColormapChecked(Cmap Colormap) FreeColormapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.freeColormapRequest(Cmap), cookie) +func FreeColormapChecked(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{cookie} } func (cook FreeColormapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FreeColormap -func (c *Conn) freeColormapRequest(Cmap Colormap) []byte { +func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11540,10 +11473,10 @@ func (c *Conn) freeColormapRequest(Cmap Colormap) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 return buf @@ -11552,28 +11485,28 @@ func (c *Conn) freeColormapRequest(Cmap Colormap) []byte { // Request CopyColormapAndFree // size: 12 type CopyColormapAndFreeCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CopyColormapAndFree -func (c *Conn) CopyColormapAndFree(Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) +func CopyColormapAndFree(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } -func (c *Conn) CopyColormapAndFreeChecked(Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.copyColormapAndFreeRequest(Mid, SrcCmap), cookie) +func CopyColormapAndFreeChecked(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } func (cook CopyColormapAndFreeCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CopyColormapAndFree -func (c *Conn) copyColormapAndFreeRequest(Mid Colormap, SrcCmap Colormap) []byte { +func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -11583,13 +11516,13 @@ func (c *Conn) copyColormapAndFreeRequest(Mid Colormap, SrcCmap Colormap) []byte b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Mid)) + xgb.Put32(buf[b:], uint32(Mid)) b += 4 - Put32(buf[b:], uint32(SrcCmap)) + xgb.Put32(buf[b:], uint32(SrcCmap)) b += 4 return buf @@ -11598,28 +11531,28 @@ func (c *Conn) copyColormapAndFreeRequest(Mid Colormap, SrcCmap Colormap) []byte // Request InstallColormap // size: 8 type InstallColormapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for InstallColormap -func (c *Conn) InstallColormap(Cmap Colormap) InstallColormapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.installColormapRequest(Cmap), cookie) +func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{cookie} } -func (c *Conn) InstallColormapChecked(Cmap Colormap) InstallColormapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.installColormapRequest(Cmap), cookie) +func InstallColormapChecked(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{cookie} } func (cook InstallColormapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for InstallColormap -func (c *Conn) installColormapRequest(Cmap Colormap) []byte { +func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11629,10 +11562,10 @@ func (c *Conn) installColormapRequest(Cmap Colormap) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 return buf @@ -11641,28 +11574,28 @@ func (c *Conn) installColormapRequest(Cmap Colormap) []byte { // Request UninstallColormap // size: 8 type UninstallColormapCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for UninstallColormap -func (c *Conn) UninstallColormap(Cmap Colormap) UninstallColormapCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.uninstallColormapRequest(Cmap), cookie) +func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{cookie} } -func (c *Conn) UninstallColormapChecked(Cmap Colormap) UninstallColormapCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.uninstallColormapRequest(Cmap), cookie) +func UninstallColormapChecked(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{cookie} } func (cook UninstallColormapCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for UninstallColormap -func (c *Conn) uninstallColormapRequest(Cmap Colormap) []byte { +func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11672,10 +11605,10 @@ func (c *Conn) uninstallColormapRequest(Cmap Colormap) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 return buf @@ -11684,35 +11617,35 @@ func (c *Conn) uninstallColormapRequest(Cmap Colormap) []byte { // Request ListInstalledColormaps // size: 8 type ListInstalledColormapsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListInstalledColormaps(Window Window) ListInstalledColormapsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listInstalledColormapsRequest(Window), cookie) +func ListInstalledColormaps(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } -func (c *Conn) ListInstalledColormapsUnchecked(Window Window) ListInstalledColormapsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listInstalledColormapsRequest(Window), cookie) +func ListInstalledColormapsUnchecked(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } // Request reply for ListInstalledColormaps -// size: (32 + pad((int(CmapsLen) * 4))) +// size: (32 + xgb.Pad((int(CmapsLen) * 4))) type ListInstalledColormapsReply struct { Sequence uint16 Length uint32 // padding: 1 bytes CmapsLen uint16 // padding: 22 bytes - Cmaps []Colormap // size: pad((int(CmapsLen) * 4)) + Cmaps []Colormap // size: xgb.Pad((int(CmapsLen) * 4)) } // Waits and reads reply data from request ListInstalledColormaps func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -11729,33 +11662,29 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.CmapsLen = Get16(buf[b:]) + v.CmapsLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Cmaps = make([]Colormap, v.CmapsLen) for i := 0; i < int(v.CmapsLen); i++ { - v.Cmaps[i] = Colormap(Get32(buf[b:])) + v.Cmaps[i] = Colormap(xgb.Get32(buf[b:])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook ListInstalledColormapsCookie) Check() error { - return cook.check() -} - // Write request to wire for ListInstalledColormaps -func (c *Conn) listInstalledColormapsRequest(Window Window) []byte { +func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -11765,10 +11694,10 @@ func (c *Conn) listInstalledColormapsRequest(Window Window) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf @@ -11777,18 +11706,18 @@ func (c *Conn) listInstalledColormapsRequest(Window Window) []byte { // Request AllocColor // size: 16 type AllocColorCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) AllocColor(Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) +func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } -func (c *Conn) AllocColorUnchecked(Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.allocColorRequest(Cmap, Red, Green, Blue), cookie) +func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } @@ -11807,7 +11736,7 @@ type AllocColorReply struct { // Waits and reads reply data from request AllocColor func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -11824,35 +11753,31 @@ func allocColorReply(buf []byte) *AllocColorReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Red = Get16(buf[b:]) + v.Red = xgb.Get16(buf[b:]) b += 2 - v.Green = Get16(buf[b:]) + v.Green = xgb.Get16(buf[b:]) b += 2 - v.Blue = Get16(buf[b:]) + v.Blue = xgb.Get16(buf[b:]) b += 2 b += 2 // padding - v.Pixel = Get32(buf[b:]) + v.Pixel = xgb.Get32(buf[b:]) b += 4 return v } -func (cook AllocColorCookie) Check() error { - return cook.check() -} - // Write request to wire for AllocColor -func (c *Conn) allocColorRequest(Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { +func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -11862,19 +11787,19 @@ func (c *Conn) allocColorRequest(Cmap Colormap, Red uint16, Green uint16, Blue u b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], Red) + xgb.Put16(buf[b:], Red) b += 2 - Put16(buf[b:], Green) + xgb.Put16(buf[b:], Green) b += 2 - Put16(buf[b:], Blue) + xgb.Put16(buf[b:], Blue) b += 2 b += 2 // padding @@ -11883,20 +11808,20 @@ func (c *Conn) allocColorRequest(Cmap Colormap, Red uint16, Green uint16, Blue u } // Request AllocNamedColor -// size: pad((12 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) type AllocNamedColorCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) AllocNamedColor(Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) +func AllocNamedColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } -func (c *Conn) AllocNamedColorUnchecked(Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.allocNamedColorRequest(Cmap, NameLen, Name), cookie) +func AllocNamedColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } @@ -11917,7 +11842,7 @@ type AllocNamedColorReply struct { // Waits and reads reply data from request AllocNamedColor func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -11934,43 +11859,39 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Pixel = Get32(buf[b:]) + v.Pixel = xgb.Get32(buf[b:]) b += 4 - v.ExactRed = Get16(buf[b:]) + v.ExactRed = xgb.Get16(buf[b:]) b += 2 - v.ExactGreen = Get16(buf[b:]) + v.ExactGreen = xgb.Get16(buf[b:]) b += 2 - v.ExactBlue = Get16(buf[b:]) + v.ExactBlue = xgb.Get16(buf[b:]) b += 2 - v.VisualRed = Get16(buf[b:]) + v.VisualRed = xgb.Get16(buf[b:]) b += 2 - v.VisualGreen = Get16(buf[b:]) + v.VisualGreen = xgb.Get16(buf[b:]) b += 2 - v.VisualBlue = Get16(buf[b:]) + v.VisualBlue = xgb.Get16(buf[b:]) b += 2 return v } -func (cook AllocNamedColorCookie) Check() error { - return cook.check() -} - // Write request to wire for AllocNamedColor -func (c *Conn) allocNamedColorRequest(Cmap Colormap, NameLen uint16, Name string) []byte { - size := pad((12 + pad((int(NameLen) * 1)))) +func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -11979,19 +11900,19 @@ func (c *Conn) allocNamedColorRequest(Cmap Colormap, NameLen uint16, Name string b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } @@ -11999,23 +11920,23 @@ func (c *Conn) allocNamedColorRequest(Cmap Colormap, NameLen uint16, Name string // Request AllocColorCells // size: 12 type AllocColorCellsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) AllocColorCells(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) +func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } -func (c *Conn) AllocColorCellsUnchecked(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.allocColorCellsRequest(Contiguous, Cmap, Colors, Planes), cookie) +func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } // Request reply for AllocColorCells -// size: ((32 + pad((int(PixelsLen) * 4))) + pad((int(MasksLen) * 4))) +// size: ((32 + xgb.Pad((int(PixelsLen) * 4))) + xgb.Pad((int(MasksLen) * 4))) type AllocColorCellsReply struct { Sequence uint16 Length uint32 @@ -12023,13 +11944,13 @@ type AllocColorCellsReply struct { PixelsLen uint16 MasksLen uint16 // padding: 20 bytes - Pixels []uint32 // size: pad((int(PixelsLen) * 4)) - Masks []uint32 // size: pad((int(MasksLen) * 4)) + Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) + Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) } // Waits and reads reply data from request AllocColorCells func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12046,43 +11967,39 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.PixelsLen = Get16(buf[b:]) + v.PixelsLen = xgb.Get16(buf[b:]) b += 2 - v.MasksLen = Get16(buf[b:]) + v.MasksLen = xgb.Get16(buf[b:]) b += 2 b += 20 // padding v.Pixels = make([]uint32, v.PixelsLen) for i := 0; i < int(v.PixelsLen); i++ { - v.Pixels[i] = Get32(buf[b:]) + v.Pixels[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) v.Masks = make([]uint32, v.MasksLen) for i := 0; i < int(v.MasksLen); i++ { - v.Masks[i] = Get32(buf[b:]) + v.Masks[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook AllocColorCellsCookie) Check() error { - return cook.check() -} - // Write request to wire for AllocColorCells -func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { +func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12097,16 +12014,16 @@ func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Colormap, Colors uin } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], Colors) + xgb.Put16(buf[b:], Colors) b += 2 - Put16(buf[b:], Planes) + xgb.Put16(buf[b:], Planes) b += 2 return buf @@ -12115,23 +12032,23 @@ func (c *Conn) allocColorCellsRequest(Contiguous bool, Cmap Colormap, Colors uin // Request AllocColorPlanes // size: 16 type AllocColorPlanesCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) AllocColorPlanes(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) +func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } -func (c *Conn) AllocColorPlanesUnchecked(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.allocColorPlanesRequest(Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) +func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } // Request reply for AllocColorPlanes -// size: (32 + pad((int(PixelsLen) * 4))) +// size: (32 + xgb.Pad((int(PixelsLen) * 4))) type AllocColorPlanesReply struct { Sequence uint16 Length uint32 @@ -12142,12 +12059,12 @@ type AllocColorPlanesReply struct { GreenMask uint32 BlueMask uint32 // padding: 8 bytes - Pixels []uint32 // size: pad((int(PixelsLen) * 4)) + Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) } // Waits and reads reply data from request AllocColorPlanes func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12164,44 +12081,40 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.PixelsLen = Get16(buf[b:]) + v.PixelsLen = xgb.Get16(buf[b:]) b += 2 b += 2 // padding - v.RedMask = Get32(buf[b:]) + v.RedMask = xgb.Get32(buf[b:]) b += 4 - v.GreenMask = Get32(buf[b:]) + v.GreenMask = xgb.Get32(buf[b:]) b += 4 - v.BlueMask = Get32(buf[b:]) + v.BlueMask = xgb.Get32(buf[b:]) b += 4 b += 8 // padding v.Pixels = make([]uint32, v.PixelsLen) for i := 0; i < int(v.PixelsLen); i++ { - v.Pixels[i] = Get32(buf[b:]) + v.Pixels[i] = xgb.Get32(buf[b:]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook AllocColorPlanesCookie) Check() error { - return cook.check() -} - // Write request to wire for AllocColorPlanes -func (c *Conn) allocColorPlanesRequest(Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { +func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -12216,53 +12129,53 @@ func (c *Conn) allocColorPlanesRequest(Contiguous bool, Cmap Colormap, Colors ui } b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], Colors) + xgb.Put16(buf[b:], Colors) b += 2 - Put16(buf[b:], Reds) + xgb.Put16(buf[b:], Reds) b += 2 - Put16(buf[b:], Greens) + xgb.Put16(buf[b:], Greens) b += 2 - Put16(buf[b:], Blues) + xgb.Put16(buf[b:], Blues) b += 2 return buf } // Request FreeColors -// size: pad((12 + pad((len(Pixels) * 4)))) +// size: xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) type FreeColorsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FreeColors -func (c *Conn) FreeColors(Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) +func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } -func (c *Conn) FreeColorsChecked(Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.freeColorsRequest(Cmap, PlaneMask, Pixels), cookie) +func FreeColorsChecked(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } func (cook FreeColorsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FreeColors -func (c *Conn) freeColorsRequest(Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { - size := pad((12 + pad((len(Pixels) * 4)))) +func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -12271,50 +12184,50 @@ func (c *Conn) freeColorsRequest(Cmap Colormap, PlaneMask uint32, Pixels []uint3 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put32(buf[b:], PlaneMask) + xgb.Put32(buf[b:], PlaneMask) b += 4 for i := 0; i < int(len(Pixels)); i++ { - Put32(buf[b:], Pixels[i]) + xgb.Put32(buf[b:], Pixels[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } // Request StoreColors -// size: pad((8 + pad((len(Items) * 12)))) +// size: xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) type StoreColorsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for StoreColors -func (c *Conn) StoreColors(Cmap Colormap, Items []Coloritem) StoreColorsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) +func StoreColors(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{cookie} } -func (c *Conn) StoreColorsChecked(Cmap Colormap, Items []Coloritem) StoreColorsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.storeColorsRequest(Cmap, Items), cookie) +func StoreColorsChecked(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{cookie} } func (cook StoreColorsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for StoreColors -func (c *Conn) storeColorsRequest(Cmap Colormap, Items []Coloritem) []byte { - size := pad((8 + pad((len(Items) * 12)))) +func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) b := 0 buf := make([]byte, size) @@ -12323,10 +12236,10 @@ func (c *Conn) storeColorsRequest(Cmap Colormap, Items []Coloritem) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 b += ColoritemListBytes(buf[b:], Items) @@ -12335,31 +12248,31 @@ func (c *Conn) storeColorsRequest(Cmap Colormap, Items []Coloritem) []byte { } // Request StoreNamedColor -// size: pad((16 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) type StoreNamedColorCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for StoreNamedColor -func (c *Conn) StoreNamedColor(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) +func StoreNamedColor(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } -func (c *Conn) StoreNamedColorChecked(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.storeNamedColorRequest(Flags, Cmap, Pixel, NameLen, Name), cookie) +func StoreNamedColorChecked(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } func (cook StoreNamedColorCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for StoreNamedColor -func (c *Conn) storeNamedColorRequest(Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) []byte { - size := pad((16 + pad((int(NameLen) * 1)))) +func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) []byte { + size := xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12369,58 +12282,58 @@ func (c *Conn) storeNamedColorRequest(Flags byte, Cmap Colormap, Pixel uint32, N buf[b] = Flags b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put32(buf[b:], Pixel) + xgb.Put32(buf[b:], Pixel) b += 4 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } // Request QueryColors -// size: pad((8 + pad((len(Pixels) * 4)))) +// size: xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) type QueryColorsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryColors(Cmap Colormap, Pixels []uint32) QueryColorsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) +func QueryColors(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } -func (c *Conn) QueryColorsUnchecked(Cmap Colormap, Pixels []uint32) QueryColorsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryColorsRequest(Cmap, Pixels), cookie) +func QueryColorsUnchecked(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } // Request reply for QueryColors -// size: (32 + pad((int(ColorsLen) * 8))) +// size: (32 + xgb.Pad((int(ColorsLen) * 8))) type QueryColorsReply struct { Sequence uint16 Length uint32 // padding: 1 bytes ColorsLen uint16 // padding: 22 bytes - Colors []Rgb // size: pad((int(ColorsLen) * 8)) + Colors []Rgb // size: xgb.Pad((int(ColorsLen) * 8)) } // Waits and reads reply data from request QueryColors func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12437,30 +12350,26 @@ func queryColorsReply(buf []byte) *QueryColorsReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.ColorsLen = Get16(buf[b:]) + v.ColorsLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Colors = make([]Rgb, v.ColorsLen) - b += ReadRgbList(buf[b:], v.Colors) + b += RgbReadList(buf[b:], v.Colors) return v } -func (cook QueryColorsCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryColors -func (c *Conn) queryColorsRequest(Cmap Colormap, Pixels []uint32) []byte { - size := pad((8 + pad((len(Pixels) * 4)))) +func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) b := 0 buf := make([]byte, size) @@ -12469,36 +12378,36 @@ func (c *Conn) queryColorsRequest(Cmap Colormap, Pixels []uint32) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 for i := 0; i < int(len(Pixels)); i++ { - Put32(buf[b:], Pixels[i]) + xgb.Put32(buf[b:], Pixels[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } // Request LookupColor -// size: pad((12 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) type LookupColorCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) LookupColor(Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) +func LookupColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } -func (c *Conn) LookupColorUnchecked(Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.lookupColorRequest(Cmap, NameLen, Name), cookie) +func LookupColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } @@ -12518,7 +12427,7 @@ type LookupColorReply struct { // Waits and reads reply data from request LookupColor func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12535,40 +12444,36 @@ func lookupColorReply(buf []byte) *LookupColorReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.ExactRed = Get16(buf[b:]) + v.ExactRed = xgb.Get16(buf[b:]) b += 2 - v.ExactGreen = Get16(buf[b:]) + v.ExactGreen = xgb.Get16(buf[b:]) b += 2 - v.ExactBlue = Get16(buf[b:]) + v.ExactBlue = xgb.Get16(buf[b:]) b += 2 - v.VisualRed = Get16(buf[b:]) + v.VisualRed = xgb.Get16(buf[b:]) b += 2 - v.VisualGreen = Get16(buf[b:]) + v.VisualGreen = xgb.Get16(buf[b:]) b += 2 - v.VisualBlue = Get16(buf[b:]) + v.VisualBlue = xgb.Get16(buf[b:]) b += 2 return v } -func (cook LookupColorCookie) Check() error { - return cook.check() -} - // Write request to wire for LookupColor -func (c *Conn) lookupColorRequest(Cmap Colormap, NameLen uint16, Name string) []byte { - size := pad((12 + pad((int(NameLen) * 1)))) +func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -12577,19 +12482,19 @@ func (c *Conn) lookupColorRequest(Cmap Colormap, NameLen uint16, Name string) [] b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } @@ -12597,28 +12502,28 @@ func (c *Conn) lookupColorRequest(Cmap Colormap, NameLen uint16, Name string) [] // Request CreateCursor // size: 32 type CreateCursorCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreateCursor -func (c *Conn) CreateCursor(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) +func CreateCursor(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } -func (c *Conn) CreateCursorChecked(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createCursorRequest(Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) +func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } func (cook CreateCursorCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreateCursor -func (c *Conn) createCursorRequest(Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { +func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -12628,40 +12533,40 @@ func (c *Conn) createCursorRequest(Cid Cursor, Source Pixmap, Mask Pixmap, ForeR b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cid)) + xgb.Put32(buf[b:], uint32(Cid)) b += 4 - Put32(buf[b:], uint32(Source)) + xgb.Put32(buf[b:], uint32(Source)) b += 4 - Put32(buf[b:], uint32(Mask)) + xgb.Put32(buf[b:], uint32(Mask)) b += 4 - Put16(buf[b:], ForeRed) + xgb.Put16(buf[b:], ForeRed) b += 2 - Put16(buf[b:], ForeGreen) + xgb.Put16(buf[b:], ForeGreen) b += 2 - Put16(buf[b:], ForeBlue) + xgb.Put16(buf[b:], ForeBlue) b += 2 - Put16(buf[b:], BackRed) + xgb.Put16(buf[b:], BackRed) b += 2 - Put16(buf[b:], BackGreen) + xgb.Put16(buf[b:], BackGreen) b += 2 - Put16(buf[b:], BackBlue) + xgb.Put16(buf[b:], BackBlue) b += 2 - Put16(buf[b:], X) + xgb.Put16(buf[b:], X) b += 2 - Put16(buf[b:], Y) + xgb.Put16(buf[b:], Y) b += 2 return buf @@ -12670,28 +12575,28 @@ func (c *Conn) createCursorRequest(Cid Cursor, Source Pixmap, Mask Pixmap, ForeR // Request CreateGlyphCursor // size: 32 type CreateGlyphCursorCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for CreateGlyphCursor -func (c *Conn) CreateGlyphCursor(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) +func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } -func (c *Conn) CreateGlyphCursorChecked(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.createGlyphCursorRequest(Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) +func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } func (cook CreateGlyphCursorCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for CreateGlyphCursor -func (c *Conn) createGlyphCursorRequest(Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -12701,40 +12606,40 @@ func (c *Conn) createGlyphCursorRequest(Cid Cursor, SourceFont Font, MaskFont Fo b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cid)) + xgb.Put32(buf[b:], uint32(Cid)) b += 4 - Put32(buf[b:], uint32(SourceFont)) + xgb.Put32(buf[b:], uint32(SourceFont)) b += 4 - Put32(buf[b:], uint32(MaskFont)) + xgb.Put32(buf[b:], uint32(MaskFont)) b += 4 - Put16(buf[b:], SourceChar) + xgb.Put16(buf[b:], SourceChar) b += 2 - Put16(buf[b:], MaskChar) + xgb.Put16(buf[b:], MaskChar) b += 2 - Put16(buf[b:], ForeRed) + xgb.Put16(buf[b:], ForeRed) b += 2 - Put16(buf[b:], ForeGreen) + xgb.Put16(buf[b:], ForeGreen) b += 2 - Put16(buf[b:], ForeBlue) + xgb.Put16(buf[b:], ForeBlue) b += 2 - Put16(buf[b:], BackRed) + xgb.Put16(buf[b:], BackRed) b += 2 - Put16(buf[b:], BackGreen) + xgb.Put16(buf[b:], BackGreen) b += 2 - Put16(buf[b:], BackBlue) + xgb.Put16(buf[b:], BackBlue) b += 2 return buf @@ -12743,28 +12648,28 @@ func (c *Conn) createGlyphCursorRequest(Cid Cursor, SourceFont Font, MaskFont Fo // Request FreeCursor // size: 8 type FreeCursorCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for FreeCursor -func (c *Conn) FreeCursor(Cursor Cursor) FreeCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.freeCursorRequest(Cursor), cookie) +func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{cookie} } -func (c *Conn) FreeCursorChecked(Cursor Cursor) FreeCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.freeCursorRequest(Cursor), cookie) +func FreeCursorChecked(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{cookie} } func (cook FreeCursorCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for FreeCursor -func (c *Conn) freeCursorRequest(Cursor Cursor) []byte { +func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -12774,10 +12679,10 @@ func (c *Conn) freeCursorRequest(Cursor Cursor) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cursor)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 return buf @@ -12786,28 +12691,28 @@ func (c *Conn) freeCursorRequest(Cursor Cursor) []byte { // Request RecolorCursor // size: 20 type RecolorCursorCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for RecolorCursor -func (c *Conn) RecolorCursor(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) +func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } -func (c *Conn) RecolorCursorChecked(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.recolorCursorRequest(Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) +func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } func (cook RecolorCursorCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for RecolorCursor -func (c *Conn) recolorCursorRequest(Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { +func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 buf := make([]byte, size) @@ -12817,28 +12722,28 @@ func (c *Conn) recolorCursorRequest(Cursor Cursor, ForeRed uint16, ForeGreen uin b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Cursor)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 - Put16(buf[b:], ForeRed) + xgb.Put16(buf[b:], ForeRed) b += 2 - Put16(buf[b:], ForeGreen) + xgb.Put16(buf[b:], ForeGreen) b += 2 - Put16(buf[b:], ForeBlue) + xgb.Put16(buf[b:], ForeBlue) b += 2 - Put16(buf[b:], BackRed) + xgb.Put16(buf[b:], BackRed) b += 2 - Put16(buf[b:], BackGreen) + xgb.Put16(buf[b:], BackGreen) b += 2 - Put16(buf[b:], BackBlue) + xgb.Put16(buf[b:], BackBlue) b += 2 return buf @@ -12847,18 +12752,18 @@ func (c *Conn) recolorCursorRequest(Cursor Cursor, ForeRed uint16, ForeGreen uin // Request QueryBestSize // size: 12 type QueryBestSizeCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryBestSize(Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) +func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } -func (c *Conn) QueryBestSizeUnchecked(Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryBestSizeRequest(Class, Drawable, Width, Height), cookie) +func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } @@ -12874,7 +12779,7 @@ type QueryBestSizeReply struct { // Waits and reads reply data from request QueryBestSize func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12891,27 +12796,23 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Width = Get16(buf[b:]) + v.Width = xgb.Get16(buf[b:]) b += 2 - v.Height = Get16(buf[b:]) + v.Height = xgb.Get16(buf[b:]) b += 2 return v } -func (cook QueryBestSizeCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryBestSize -func (c *Conn) queryBestSizeRequest(Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { +func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -12922,36 +12823,36 @@ func (c *Conn) queryBestSizeRequest(Class byte, Drawable Drawable, Width uint16, buf[b] = Class b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - Put16(buf[b:], Width) + xgb.Put16(buf[b:], Width) b += 2 - Put16(buf[b:], Height) + xgb.Put16(buf[b:], Height) b += 2 return buf } // Request QueryExtension -// size: pad((8 + pad((int(NameLen) * 1)))) +// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) type QueryExtensionCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) QueryExtension(NameLen uint16, Name string) QueryExtensionCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.queryExtensionRequest(NameLen, Name), cookie) +func QueryExtension(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } -func (c *Conn) QueryExtensionUnchecked(NameLen uint16, Name string) QueryExtensionCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.queryExtensionRequest(NameLen, Name), cookie) +func QueryExtensionUnchecked(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } @@ -12969,7 +12870,7 @@ type QueryExtensionReply struct { // Waits and reads reply data from request QueryExtension func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -12986,10 +12887,10 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 if buf[b] == 1 { @@ -13011,13 +12912,9 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { return v } -func (cook QueryExtensionCookie) Check() error { - return cook.check() -} - // Write request to wire for QueryExtension -func (c *Conn) queryExtensionRequest(NameLen uint16, Name string) []byte { - size := pad((8 + pad((int(NameLen) * 1)))) +func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) @@ -13026,16 +12923,16 @@ func (c *Conn) queryExtensionRequest(NameLen uint16, Name string) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], NameLen) + xgb.Put16(buf[b:], NameLen) b += 2 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += pad(int(NameLen)) + b += xgb.Pad(int(NameLen)) return buf } @@ -13043,18 +12940,18 @@ func (c *Conn) queryExtensionRequest(NameLen uint16, Name string) []byte { // Request ListExtensions // size: 4 type ListExtensionsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListExtensions() ListExtensionsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listExtensionsRequest(), cookie) +func ListExtensions(c *xgb.Conn) ListExtensionsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } -func (c *Conn) ListExtensionsUnchecked() ListExtensionsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listExtensionsRequest(), cookie) +func ListExtensionsUnchecked(c *xgb.Conn) ListExtensionsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } @@ -13070,7 +12967,7 @@ type ListExtensionsReply struct { // Waits and reads reply data from request ListExtensions func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13088,26 +12985,22 @@ func listExtensionsReply(buf []byte) *ListExtensionsReply { v.NamesLen = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 b += 24 // padding v.Names = make([]Str, v.NamesLen) - b += ReadStrList(buf[b:], v.Names) + b += StrReadList(buf[b:], v.Names) return v } -func (cook ListExtensionsCookie) Check() error { - return cook.check() -} - // Write request to wire for ListExtensions -func (c *Conn) listExtensionsRequest() []byte { +func listExtensionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13115,39 +13008,39 @@ func (c *Conn) listExtensionsRequest() []byte { buf[b] = 99 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf } // Request ChangeKeyboardMapping -// size: pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) type ChangeKeyboardMappingCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeKeyboardMapping -func (c *Conn) ChangeKeyboardMapping(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) +func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{cookie} } -func (c *Conn) ChangeKeyboardMappingChecked(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeKeyboardMappingRequest(KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) +func ChangeKeyboardMappingChecked(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{cookie} } func (cook ChangeKeyboardMappingCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardMapping -func (c *Conn) changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { - size := pad((8 + pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { + size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 buf := make([]byte, size) @@ -13157,7 +13050,7 @@ func (c *Conn) changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keyc buf[b] = KeycodeCount b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 buf[b] = byte(FirstKeycode) @@ -13169,10 +13062,10 @@ func (c *Conn) changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keyc b += 2 // padding for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { - Put32(buf[b:], uint32(Keysyms[i])) + xgb.Put32(buf[b:], uint32(Keysyms[i])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -13180,34 +13073,34 @@ func (c *Conn) changeKeyboardMappingRequest(KeycodeCount byte, FirstKeycode Keyc // Request GetKeyboardMapping // size: 8 type GetKeyboardMappingCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetKeyboardMapping(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getKeyboardMappingRequest(FirstKeycode, Count), cookie) +func GetKeyboardMapping(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } -func (c *Conn) GetKeyboardMappingUnchecked(FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getKeyboardMappingRequest(FirstKeycode, Count), cookie) +func GetKeyboardMappingUnchecked(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } // Request reply for GetKeyboardMapping -// size: (32 + pad((int(Length) * 4))) +// size: (32 + xgb.Pad((int(Length) * 4))) type GetKeyboardMappingReply struct { Sequence uint16 Length uint32 KeysymsPerKeycode byte // padding: 24 bytes - Keysyms []Keysym // size: pad((int(Length) * 4)) + Keysyms []Keysym // size: xgb.Pad((int(Length) * 4)) } // Waits and reads reply data from request GetKeyboardMapping func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13225,30 +13118,26 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { v.KeysymsPerKeycode = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 b += 24 // padding v.Keysyms = make([]Keysym, v.Length) for i := 0; i < int(v.Length); i++ { - v.Keysyms[i] = Keysym(Get32(buf[b:])) + v.Keysyms[i] = Keysym(xgb.Get32(buf[b:])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook GetKeyboardMappingCookie) Check() error { - return cook.check() -} - // Write request to wire for GetKeyboardMapping -func (c *Conn) getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byte { +func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -13258,7 +13147,7 @@ func (c *Conn) getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byt b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 buf[b] = byte(FirstKeycode) @@ -13271,31 +13160,31 @@ func (c *Conn) getKeyboardMappingRequest(FirstKeycode Keycode, Count byte) []byt } // Request ChangeKeyboardControl -// size: pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) +// size: xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) type ChangeKeyboardControlCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeKeyboardControl -func (c *Conn) ChangeKeyboardControl(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeKeyboardControlRequest(ValueMask, ValueList), cookie) +func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{cookie} } -func (c *Conn) ChangeKeyboardControlChecked(ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeKeyboardControlRequest(ValueMask, ValueList), cookie) +func ChangeKeyboardControlChecked(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{cookie} } func (cook ChangeKeyboardControlCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardControl -func (c *Conn) changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32) []byte { - size := pad((4 + (4 + pad((4 * popCount(int(ValueMask))))))) +func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 buf := make([]byte, size) @@ -13304,16 +13193,16 @@ func (c *Conn) changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32 b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], ValueMask) b += 4 - for i := 0; i < popCount(int(ValueMask)); i++ { - Put32(buf[b:], ValueList[i]) + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -13321,18 +13210,18 @@ func (c *Conn) changeKeyboardControlRequest(ValueMask uint32, ValueList []uint32 // Request GetKeyboardControl // size: 4 type GetKeyboardControlCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetKeyboardControl() GetKeyboardControlCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getKeyboardControlRequest(), cookie) +func GetKeyboardControl(c *xgb.Conn) GetKeyboardControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } -func (c *Conn) GetKeyboardControlUnchecked() GetKeyboardControlCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getKeyboardControlRequest(), cookie) +func GetKeyboardControlUnchecked(c *xgb.Conn) GetKeyboardControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } @@ -13353,7 +13242,7 @@ type GetKeyboardControlReply struct { // Waits and reads reply data from request GetKeyboardControl func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13371,13 +13260,13 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v.GlobalAutoRepeat = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.LedMask = Get32(buf[b:]) + v.LedMask = xgb.Get32(buf[b:]) b += 4 v.KeyClickPercent = buf[b] @@ -13386,27 +13275,23 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v.BellPercent = buf[b] b += 1 - v.BellPitch = Get16(buf[b:]) + v.BellPitch = xgb.Get16(buf[b:]) b += 2 - v.BellDuration = Get16(buf[b:]) + v.BellDuration = xgb.Get16(buf[b:]) b += 2 b += 2 // padding v.AutoRepeats = make([]byte, 32) copy(v.AutoRepeats[:32], buf[b:]) - b += pad(int(32)) + b += xgb.Pad(int(32)) return v } -func (cook GetKeyboardControlCookie) Check() error { - return cook.check() -} - // Write request to wire for GetKeyboardControl -func (c *Conn) getKeyboardControlRequest() []byte { +func getKeyboardControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13414,8 +13299,8 @@ func (c *Conn) getKeyboardControlRequest() []byte { buf[b] = 103 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13424,28 +13309,28 @@ func (c *Conn) getKeyboardControlRequest() []byte { // Request Bell // size: 4 type BellCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for Bell -func (c *Conn) Bell(Percent int8) BellCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.bellRequest(Percent), cookie) +func Bell(c *xgb.Conn, Percent int8) BellCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{cookie} } -func (c *Conn) BellChecked(Percent int8) BellCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.bellRequest(Percent), cookie) +func BellChecked(c *xgb.Conn, Percent int8) BellCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{cookie} } func (cook BellCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for Bell -func (c *Conn) bellRequest(Percent int8) []byte { +func bellRequest(c *xgb.Conn, Percent int8) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13456,7 +13341,7 @@ func (c *Conn) bellRequest(Percent int8) []byte { buf[b] = byte(Percent) b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13465,28 +13350,28 @@ func (c *Conn) bellRequest(Percent int8) []byte { // Request ChangePointerControl // size: 12 type ChangePointerControlCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangePointerControl -func (c *Conn) ChangePointerControl(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) +func ChangePointerControl(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} } -func (c *Conn) ChangePointerControlChecked(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changePointerControlRequest(AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) +func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} } func (cook ChangePointerControlCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangePointerControl -func (c *Conn) changePointerControlRequest(AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { +func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -13496,16 +13381,16 @@ func (c *Conn) changePointerControlRequest(AccelerationNumerator int16, Accelera b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], uint16(AccelerationNumerator)) + xgb.Put16(buf[b:], uint16(AccelerationNumerator)) b += 2 - Put16(buf[b:], uint16(AccelerationDenominator)) + xgb.Put16(buf[b:], uint16(AccelerationDenominator)) b += 2 - Put16(buf[b:], uint16(Threshold)) + xgb.Put16(buf[b:], uint16(Threshold)) b += 2 if DoAcceleration { @@ -13528,18 +13413,18 @@ func (c *Conn) changePointerControlRequest(AccelerationNumerator int16, Accelera // Request GetPointerControl // size: 4 type GetPointerControlCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetPointerControl() GetPointerControlCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getPointerControlRequest(), cookie) +func GetPointerControl(c *xgb.Conn) GetPointerControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } -func (c *Conn) GetPointerControlUnchecked() GetPointerControlCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getPointerControlRequest(), cookie) +func GetPointerControlUnchecked(c *xgb.Conn) GetPointerControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } @@ -13557,7 +13442,7 @@ type GetPointerControlReply struct { // Waits and reads reply data from request GetPointerControl func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13574,19 +13459,19 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.AccelerationNumerator = Get16(buf[b:]) + v.AccelerationNumerator = xgb.Get16(buf[b:]) b += 2 - v.AccelerationDenominator = Get16(buf[b:]) + v.AccelerationDenominator = xgb.Get16(buf[b:]) b += 2 - v.Threshold = Get16(buf[b:]) + v.Threshold = xgb.Get16(buf[b:]) b += 2 b += 18 // padding @@ -13594,12 +13479,8 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { return v } -func (cook GetPointerControlCookie) Check() error { - return cook.check() -} - // Write request to wire for GetPointerControl -func (c *Conn) getPointerControlRequest() []byte { +func getPointerControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13607,8 +13488,8 @@ func (c *Conn) getPointerControlRequest() []byte { buf[b] = 106 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13617,28 +13498,28 @@ func (c *Conn) getPointerControlRequest() []byte { // Request SetScreenSaver // size: 12 type SetScreenSaverCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetScreenSaver -func (c *Conn) SetScreenSaver(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) +func SetScreenSaver(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} } -func (c *Conn) SetScreenSaverChecked(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setScreenSaverRequest(Timeout, Interval, PreferBlanking, AllowExposures), cookie) +func SetScreenSaverChecked(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} } func (cook SetScreenSaverCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetScreenSaver -func (c *Conn) setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { +func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -13648,13 +13529,13 @@ func (c *Conn) setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanki b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put16(buf[b:], uint16(Timeout)) + xgb.Put16(buf[b:], uint16(Timeout)) b += 2 - Put16(buf[b:], uint16(Interval)) + xgb.Put16(buf[b:], uint16(Interval)) b += 2 buf[b] = PreferBlanking @@ -13669,18 +13550,18 @@ func (c *Conn) setScreenSaverRequest(Timeout int16, Interval int16, PreferBlanki // Request GetScreenSaver // size: 4 type GetScreenSaverCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetScreenSaver() GetScreenSaverCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getScreenSaverRequest(), cookie) +func GetScreenSaver(c *xgb.Conn) GetScreenSaverCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } -func (c *Conn) GetScreenSaverUnchecked() GetScreenSaverCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getScreenSaverRequest(), cookie) +func GetScreenSaverUnchecked(c *xgb.Conn) GetScreenSaverCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } @@ -13699,7 +13580,7 @@ type GetScreenSaverReply struct { // Waits and reads reply data from request GetScreenSaver func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13716,16 +13597,16 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { b += 1 // padding - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Timeout = Get16(buf[b:]) + v.Timeout = xgb.Get16(buf[b:]) b += 2 - v.Interval = Get16(buf[b:]) + v.Interval = xgb.Get16(buf[b:]) b += 2 v.PreferBlanking = buf[b] @@ -13739,12 +13620,8 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { return v } -func (cook GetScreenSaverCookie) Check() error { - return cook.check() -} - // Write request to wire for GetScreenSaver -func (c *Conn) getScreenSaverRequest() []byte { +func getScreenSaverRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13752,39 +13629,39 @@ func (c *Conn) getScreenSaverRequest() []byte { buf[b] = 108 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf } // Request ChangeHosts -// size: pad((8 + pad((int(AddressLen) * 1)))) +// size: xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) type ChangeHostsCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ChangeHosts -func (c *Conn) ChangeHosts(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.changeHostsRequest(Mode, Family, AddressLen, Address), cookie) +func ChangeHosts(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} } -func (c *Conn) ChangeHostsChecked(Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.changeHostsRequest(Mode, Family, AddressLen, Address), cookie) +func ChangeHostsChecked(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} } func (cook ChangeHostsCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ChangeHosts -func (c *Conn) changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { - size := pad((8 + pad((int(AddressLen) * 1)))) +func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { + size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) b := 0 buf := make([]byte, size) @@ -13794,7 +13671,7 @@ func (c *Conn) changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Add buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 buf[b] = Family @@ -13802,11 +13679,11 @@ func (c *Conn) changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Add b += 1 // padding - Put16(buf[b:], AddressLen) + xgb.Put16(buf[b:], AddressLen) b += 2 copy(buf[b:], Address[:AddressLen]) - b += pad(int(AddressLen)) + b += xgb.Pad(int(AddressLen)) return buf } @@ -13814,18 +13691,18 @@ func (c *Conn) changeHostsRequest(Mode byte, Family byte, AddressLen uint16, Add // Request ListHosts // size: 4 type ListHostsCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) ListHosts() ListHostsCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.listHostsRequest(), cookie) +func ListHosts(c *xgb.Conn) ListHostsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } -func (c *Conn) ListHostsUnchecked() ListHostsCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.listHostsRequest(), cookie) +func ListHostsUnchecked(c *xgb.Conn) ListHostsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } @@ -13842,7 +13719,7 @@ type ListHostsReply struct { // Waits and reads reply data from request ListHosts func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -13860,29 +13737,25 @@ func listHostsReply(buf []byte) *ListHostsReply { v.Mode = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.HostsLen = Get16(buf[b:]) + v.HostsLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding v.Hosts = make([]Host, v.HostsLen) - b += ReadHostList(buf[b:], v.Hosts) + b += HostReadList(buf[b:], v.Hosts) return v } -func (cook ListHostsCookie) Check() error { - return cook.check() -} - // Write request to wire for ListHosts -func (c *Conn) listHostsRequest() []byte { +func listHostsRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13890,8 +13763,8 @@ func (c *Conn) listHostsRequest() []byte { buf[b] = 110 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13900,28 +13773,28 @@ func (c *Conn) listHostsRequest() []byte { // Request SetAccessControl // size: 4 type SetAccessControlCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetAccessControl -func (c *Conn) SetAccessControl(Mode byte) SetAccessControlCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setAccessControlRequest(Mode), cookie) +func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{cookie} } -func (c *Conn) SetAccessControlChecked(Mode byte) SetAccessControlCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setAccessControlRequest(Mode), cookie) +func SetAccessControlChecked(c *xgb.Conn, Mode byte) SetAccessControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{cookie} } func (cook SetAccessControlCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetAccessControl -func (c *Conn) setAccessControlRequest(Mode byte) []byte { +func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13932,7 +13805,7 @@ func (c *Conn) setAccessControlRequest(Mode byte) []byte { buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13941,28 +13814,28 @@ func (c *Conn) setAccessControlRequest(Mode byte) []byte { // Request SetCloseDownMode // size: 4 type SetCloseDownModeCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for SetCloseDownMode -func (c *Conn) SetCloseDownMode(Mode byte) SetCloseDownModeCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.setCloseDownModeRequest(Mode), cookie) +func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{cookie} } -func (c *Conn) SetCloseDownModeChecked(Mode byte) SetCloseDownModeCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.setCloseDownModeRequest(Mode), cookie) +func SetCloseDownModeChecked(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{cookie} } func (cook SetCloseDownModeCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for SetCloseDownMode -func (c *Conn) setCloseDownModeRequest(Mode byte) []byte { +func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -13973,7 +13846,7 @@ func (c *Conn) setCloseDownModeRequest(Mode byte) []byte { buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -13982,28 +13855,28 @@ func (c *Conn) setCloseDownModeRequest(Mode byte) []byte { // Request KillClient // size: 8 type KillClientCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for KillClient -func (c *Conn) KillClient(Resource uint32) KillClientCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.killClientRequest(Resource), cookie) +func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{cookie} } -func (c *Conn) KillClientChecked(Resource uint32) KillClientCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.killClientRequest(Resource), cookie) +func KillClientChecked(c *xgb.Conn, Resource uint32) KillClientCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{cookie} } func (cook KillClientCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for KillClient -func (c *Conn) killClientRequest(Resource uint32) []byte { +func killClientRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -14013,41 +13886,41 @@ func (c *Conn) killClientRequest(Resource uint32) []byte { b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], Resource) + xgb.Put32(buf[b:], Resource) b += 4 return buf } // Request RotateProperties -// size: pad((12 + pad((int(AtomsLen) * 4)))) +// size: xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) type RotatePropertiesCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for RotateProperties -func (c *Conn) RotateProperties(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) +func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } -func (c *Conn) RotatePropertiesChecked(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.rotatePropertiesRequest(Window, AtomsLen, Delta, Atoms), cookie) +func RotatePropertiesChecked(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } func (cook RotatePropertiesCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for RotateProperties -func (c *Conn) rotatePropertiesRequest(Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { - size := pad((12 + pad((int(AtomsLen) * 4)))) +func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { + size := xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) b := 0 buf := make([]byte, size) @@ -14056,23 +13929,23 @@ func (c *Conn) rotatePropertiesRequest(Window Window, AtomsLen uint16, Delta int b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - Put16(buf[b:], AtomsLen) + xgb.Put16(buf[b:], AtomsLen) b += 2 - Put16(buf[b:], uint16(Delta)) + xgb.Put16(buf[b:], uint16(Delta)) b += 2 for i := 0; i < int(AtomsLen); i++ { - Put32(buf[b:], uint32(Atoms[i])) + xgb.Put32(buf[b:], uint32(Atoms[i])) b += 4 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -14080,28 +13953,28 @@ func (c *Conn) rotatePropertiesRequest(Window Window, AtomsLen uint16, Delta int // Request ForceScreenSaver // size: 4 type ForceScreenSaverCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for ForceScreenSaver -func (c *Conn) ForceScreenSaver(Mode byte) ForceScreenSaverCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.forceScreenSaverRequest(Mode), cookie) +func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{cookie} } -func (c *Conn) ForceScreenSaverChecked(Mode byte) ForceScreenSaverCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.forceScreenSaverRequest(Mode), cookie) +func ForceScreenSaverChecked(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{cookie} } func (cook ForceScreenSaverCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for ForceScreenSaver -func (c *Conn) forceScreenSaverRequest(Mode byte) []byte { +func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -14112,27 +13985,27 @@ func (c *Conn) forceScreenSaverRequest(Mode byte) []byte { buf[b] = Mode b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf } // Request SetPointerMapping -// size: pad((4 + pad((int(MapLen) * 1)))) +// size: xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) type SetPointerMappingCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) SetPointerMapping(MapLen byte, Map []byte) SetPointerMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.setPointerMappingRequest(MapLen, Map), cookie) +func SetPointerMapping(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } -func (c *Conn) SetPointerMappingUnchecked(MapLen byte, Map []byte) SetPointerMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.setPointerMappingRequest(MapLen, Map), cookie) +func SetPointerMappingUnchecked(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } @@ -14146,7 +14019,7 @@ type SetPointerMappingReply struct { // Waits and reads reply data from request SetPointerMapping func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -14164,22 +14037,18 @@ func setPointerMappingReply(buf []byte) *SetPointerMappingReply { v.Status = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 return v } -func (cook SetPointerMappingCookie) Check() error { - return cook.check() -} - // Write request to wire for SetPointerMapping -func (c *Conn) setPointerMappingRequest(MapLen byte, Map []byte) []byte { - size := pad((4 + pad((int(MapLen) * 1)))) +func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { + size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) b := 0 buf := make([]byte, size) @@ -14189,11 +14058,11 @@ func (c *Conn) setPointerMappingRequest(MapLen byte, Map []byte) []byte { buf[b] = MapLen b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 copy(buf[b:], Map[:MapLen]) - b += pad(int(MapLen)) + b += xgb.Pad(int(MapLen)) return buf } @@ -14201,34 +14070,34 @@ func (c *Conn) setPointerMappingRequest(MapLen byte, Map []byte) []byte { // Request GetPointerMapping // size: 4 type GetPointerMappingCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetPointerMapping() GetPointerMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getPointerMappingRequest(), cookie) +func GetPointerMapping(c *xgb.Conn) GetPointerMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } -func (c *Conn) GetPointerMappingUnchecked() GetPointerMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getPointerMappingRequest(), cookie) +func GetPointerMappingUnchecked(c *xgb.Conn) GetPointerMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } // Request reply for GetPointerMapping -// size: (32 + pad((int(MapLen) * 1))) +// size: (32 + xgb.Pad((int(MapLen) * 1))) type GetPointerMappingReply struct { Sequence uint16 Length uint32 MapLen byte // padding: 24 bytes - Map []byte // size: pad((int(MapLen) * 1)) + Map []byte // size: xgb.Pad((int(MapLen) * 1)) } // Waits and reads reply data from request GetPointerMapping func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -14246,27 +14115,23 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { v.MapLen = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 b += 24 // padding v.Map = make([]byte, v.MapLen) copy(v.Map[:v.MapLen], buf[b:]) - b += pad(int(v.MapLen)) + b += xgb.Pad(int(v.MapLen)) return v } -func (cook GetPointerMappingCookie) Check() error { - return cook.check() -} - // Write request to wire for GetPointerMapping -func (c *Conn) getPointerMappingRequest() []byte { +func getPointerMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -14274,28 +14139,28 @@ func (c *Conn) getPointerMappingRequest() []byte { buf[b] = 117 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf } // Request SetModifierMapping -// size: pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) +// size: xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) type SetModifierMappingCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) SetModifierMapping(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) +func SetModifierMapping(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } -func (c *Conn) SetModifierMappingUnchecked(KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.setModifierMappingRequest(KeycodesPerModifier, Keycodes), cookie) +func SetModifierMappingUnchecked(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } @@ -14309,7 +14174,7 @@ type SetModifierMappingReply struct { // Waits and reads reply data from request SetModifierMapping func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -14327,22 +14192,18 @@ func setModifierMappingReply(buf []byte) *SetModifierMappingReply { v.Status = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 return v } -func (cook SetModifierMappingCookie) Check() error { - return cook.check() -} - // Write request to wire for SetModifierMapping -func (c *Conn) setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Keycode) []byte { - size := pad((4 + pad(((int(KeycodesPerModifier) * 8) * 1)))) +func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { + size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 buf := make([]byte, size) @@ -14352,14 +14213,14 @@ func (c *Conn) setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Ke buf[b] = KeycodesPerModifier b += 1 - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 for i := 0; i < int((int(KeycodesPerModifier) * 8)); i++ { buf[b] = byte(Keycodes[i]) b += 1 } - b = pad(b) + b = xgb.Pad(b) return buf } @@ -14367,34 +14228,34 @@ func (c *Conn) setModifierMappingRequest(KeycodesPerModifier byte, Keycodes []Ke // Request GetModifierMapping // size: 4 type GetModifierMappingCookie struct { - *cookie + *xgb.Cookie } -func (c *Conn) GetModifierMapping() GetModifierMappingCookie { - cookie := c.newCookie(true, true) - c.newRequest(c.getModifierMappingRequest(), cookie) +func GetModifierMapping(c *xgb.Conn) GetModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } -func (c *Conn) GetModifierMappingUnchecked() GetModifierMappingCookie { - cookie := c.newCookie(false, true) - c.newRequest(c.getModifierMappingRequest(), cookie) +func GetModifierMappingUnchecked(c *xgb.Conn) GetModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } // Request reply for GetModifierMapping -// size: (32 + pad(((int(KeycodesPerModifier) * 8) * 1))) +// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) type GetModifierMappingReply struct { Sequence uint16 Length uint32 KeycodesPerModifier byte // padding: 24 bytes - Keycodes []Keycode // size: pad(((int(KeycodesPerModifier) * 8) * 1)) + Keycodes []Keycode // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) } // Waits and reads reply data from request GetModifierMapping func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { - buf, err := cook.reply() + buf, err := cook.Cookie.Reply() if err != nil { return nil, err } @@ -14412,10 +14273,10 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v.KeycodesPerModifier = buf[b] b += 1 - v.Sequence = Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = Get32(buf[b:]) // 4-byte units + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 b += 24 // padding @@ -14425,17 +14286,13 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v.Keycodes[i] = Keycode(buf[b]) b += 1 } - b = pad(b) + b = xgb.Pad(b) return v } -func (cook GetModifierMappingCookie) Check() error { - return cook.check() -} - // Write request to wire for GetModifierMapping -func (c *Conn) getModifierMappingRequest() []byte { +func getModifierMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -14443,8 +14300,8 @@ func (c *Conn) getModifierMappingRequest() []byte { buf[b] = 119 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf @@ -14453,28 +14310,28 @@ func (c *Conn) getModifierMappingRequest() []byte { // Request NoOperation // size: 4 type NoOperationCookie struct { - *cookie + *xgb.Cookie } // Write request to wire for NoOperation -func (c *Conn) NoOperation() NoOperationCookie { - cookie := c.newCookie(false, false) - c.newRequest(c.noOperationRequest(), cookie) +func NoOperation(c *xgb.Conn) NoOperationCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{cookie} } -func (c *Conn) NoOperationChecked() NoOperationCookie { - cookie := c.newCookie(true, false) - c.newRequest(c.noOperationRequest(), cookie) +func NoOperationChecked(c *xgb.Conn) NoOperationCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{cookie} } func (cook NoOperationCookie) Check() error { - return cook.check() + return cook.Cookie.Check() } // Write request to wire for NoOperation -func (c *Conn) noOperationRequest() []byte { +func noOperationRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -14482,8 +14339,8 @@ func (c *Conn) noOperationRequest() []byte { buf[b] = 127 // request opcode b += 1 - b += 1 // padding - Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 return buf diff --git a/nexgb/xgb_test.go b/nexgb/xproto/xproto_test.go similarity index 86% rename from nexgb/xgb_test.go rename to nexgb/xproto/xproto_test.go index d0e840a..f061198 100644 --- a/nexgb/xgb_test.go +++ b/nexgb/xproto/xproto_test.go @@ -1,4 +1,4 @@ -package xgb +package xproto /* Tests for XGB. @@ -21,17 +21,19 @@ import ( "math/rand" "testing" "time" + + "github.com/BurntSushi/xgb" ) // The X connection used throughout testing. -var X *Conn +var X *xgb.Conn // init initializes the X connection, seeds the RNG and starts waiting // for events. func init() { var err error - X, err = NewConn() + X, err = xgb.NewConn() if err != nil { log.Fatal(err) } @@ -48,7 +50,7 @@ func init() { // TestSynchronousError purposefully causes a BadWindow error in a // MapWindow request, and checks it synchronously. func TestSynchronousError(t *testing.T) { - err := X.MapWindowChecked(0).Check() // resource id 0 is always invalid + err := MapWindowChecked(X, 0).Check() // resource 0 is always invalid if err == nil { t.Fatalf("MapWindow: A MapWindow request that should return an " + "error has returned a nil error.") @@ -59,7 +61,7 @@ func TestSynchronousError(t *testing.T) { // TestAsynchronousError does the same thing as TestSynchronousError, but // grabs the error asynchronously instead. func TestAsynchronousError(t *testing.T) { - X.MapWindow(0) // resource id 0 is always invalid + MapWindow(X, 0) // resource id 0 is always invalid evOrErr := waitForEvent(t, 5) if evOrErr.ev != nil { @@ -77,7 +79,7 @@ func TestAsynchronousError(t *testing.T) { func TestCookieBuffer(t *testing.T) { n := (1 << 16) + 10 for i := 0; i < n; i++ { - X.NoOperation() + NoOperation(X) } TestProperty(t) } @@ -88,7 +90,7 @@ func TestCookieBuffer(t *testing.T) { func TestSequenceWrap(t *testing.T) { n := (1 << 16) + 10 for i := 0; i < n; i++ { - _, err := X.InternAtom(false, 5, "RANDO").Reply() + _, err := InternAtom(X, false, 5, "RANDO").Reply() if err != nil { t.Fatalf("InternAtom: %s", err) } @@ -127,13 +129,13 @@ func TestWindowEvents(t *testing.T) { // The geometry to set the window. gx, gy, gw, gh := 200, 400, 1000, 300 - wid, err := X.NewWindowId() + wid, err := NewWindowId(X) if err != nil { t.Fatalf("NewId: %s", err) } - screen := X.DefaultScreen() // alias - err = X.CreateWindowChecked(screen.RootDepth, wid, screen.Root, + screen := Setup(X).DefaultScreen(X) // alias + err = CreateWindowChecked(X, screen.RootDepth, wid, screen.Root, 0, 0, 500, 500, 0, WindowClassInputOutput, screen.RootVisual, CwBackPixel|CwOverrideRedirect, []uint32{0xffffffff, 1}).Check() @@ -141,20 +143,20 @@ func TestWindowEvents(t *testing.T) { t.Fatalf("CreateWindow: %s", err) } - err = X.MapWindowChecked(wid).Check() + err = MapWindowChecked(X, wid).Check() if err != nil { t.Fatalf("MapWindow: %s", err) } // We don't listen in the CreateWindow request so that we don't get // a MapNotify event. - err = X.ChangeWindowAttributesChecked(wid, + err = ChangeWindowAttributesChecked(X, wid, CwEventMask, []uint32{EventMaskStructureNotify}).Check() if err != nil { t.Fatalf("ChangeWindowAttributes: %s", err) } - err = X.ConfigureWindowChecked(wid, + err = ConfigureWindowChecked(X, wid, ConfigWindowX|ConfigWindowY| ConfigWindowWidth|ConfigWindowHeight, []uint32{uint32(gx), uint32(gy), uint32(gw), uint32(gh)}).Check() @@ -162,22 +164,6 @@ func TestWindowEvents(t *testing.T) { t.Fatalf("ConfigureWindow: %s", err) } - err = X.ConfigureWindowChecked(wid, - ConfigWindowX|ConfigWindowY| - ConfigWindowWidth|ConfigWindowHeight, - []uint32{uint32(gx + 2), uint32(gy), uint32(gw), uint32(gh)}).Check() - if err != nil { - t.Fatalf("ConfigureWindow: %s", err) - } - - err = X.ConfigureWindowChecked(wid, - ConfigWindowX|ConfigWindowY| - ConfigWindowWidth|ConfigWindowHeight, - []uint32{uint32(gx + 1), uint32(gy), uint32(gw), uint32(gh)}).Check() - if err != nil { - t.Fatalf("ConfigureWindow: %s", err) - } - TestProperty(t) evOrErr := waitForEvent(t, 5) @@ -204,13 +190,13 @@ func TestWindowEvents(t *testing.T) { } // Okay, clean up! - err = X.ChangeWindowAttributesChecked(wid, + err = ChangeWindowAttributesChecked(X, wid, CwEventMask, []uint32{0}).Check() if err != nil { t.Fatalf("ChangeWindowAttributes: %s", err) } - err = X.DestroyWindowChecked(wid).Check() + err = DestroyWindowChecked(X, wid).Check() if err != nil { t.Fatalf("DestroyWindow: %s", err) } @@ -234,7 +220,7 @@ func BenchmarkInternAtomsGood(b *testing.B) { b.StartTimer() cookies := make([]InternAtomCookie, b.N) for i := 0; i < b.N; i++ { - cookies[i] = X.InternAtom(false, uint16(len(names[i])), names[i]) + cookies[i] = InternAtom(X, false, uint16(len(names[i])), names[i]) } for _, cookie := range cookies { cookie.Reply() @@ -251,7 +237,7 @@ func BenchmarkInternAtomsPoor(b *testing.B) { b.StartTimer() for i := 0; i < b.N; i++ { - X.InternAtom(false, uint16(len(names[i])), names[i]).Reply() + InternAtom(X, false, uint16(len(names[i])), names[i]).Reply() } } @@ -265,24 +251,27 @@ func BenchmarkInternAtomsPoor(b *testing.B) { // It tests both requests with and without replies (GetProperty and // ChangeProperty respectively.) func changeAndGetProp(prop, val string) (string, error) { - propAtom, err := X.InternAtom(false, uint16(len(prop)), prop).Reply() + setup := Setup(X) + root := setup.DefaultScreen(X).Root + + propAtom, err := InternAtom(X, false, uint16(len(prop)), prop).Reply() if err != nil { return "", fmt.Errorf("InternAtom: %s", err) } typName := "UTF8_STRING" - typAtom, err := X.InternAtom(false, uint16(len(typName)), typName).Reply() + typAtom, err := InternAtom(X, false, uint16(len(typName)), typName).Reply() if err != nil { return "", fmt.Errorf("InternAtom: %s", err) } - err = X.ChangePropertyChecked(PropModeReplace, X.DefaultScreen().Root, - propAtom.Atom, typAtom.Atom, 8, uint32(len(val)), []byte(val)).Check() + err = ChangePropertyChecked(X, PropModeReplace, root, propAtom.Atom, + typAtom.Atom, 8, uint32(len(val)), []byte(val)).Check() if err != nil { return "", fmt.Errorf("ChangeProperty: %s", err) } - reply, err := X.GetProperty(false, X.DefaultScreen().Root, propAtom.Atom, + reply, err := GetProperty(X, false, root, propAtom.Atom, GetPropertyTypeAny, 0, (1<<32)-1).Reply() if err != nil { return "", fmt.Errorf("GetProperty: %s", err) @@ -343,8 +332,8 @@ func seqNames(n int) []string { // evErr represents a value that is either an event or an error. type evErr struct { - ev Event - err Error + ev xgb.Event + err xgb.Error } // channel used to pass evErrs. diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go new file mode 100644 index 0000000..4675e90 --- /dev/null +++ b/nexgb/xselinux/xselinux.go @@ -0,0 +1,1903 @@ +package xselinux + +/* + This file was generated by xselinux.xml on May 10 2012 4:20:29pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the SELinux extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 7, "SELinux").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named SELinux could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["SELinux"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["SELinux"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["SELinux"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["SELinux"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// 'ListItem' struct definition +// Size: ((12 + xgb.Pad((int(ObjectContextLen) * 1))) + xgb.Pad((int(DataContextLen) * 1))) +type ListItem struct { + Name xproto.Atom + ObjectContextLen uint32 + DataContextLen uint32 + ObjectContext string // size: xgb.Pad((int(ObjectContextLen) * 1)) + DataContext string // size: xgb.Pad((int(DataContextLen) * 1)) +} + +// Struct read ListItem +func ListItemRead(buf []byte, v *ListItem) int { + b := 0 + + v.Name = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.ObjectContextLen = xgb.Get32(buf[b:]) + b += 4 + + v.DataContextLen = xgb.Get32(buf[b:]) + b += 4 + + { + byteString := make([]byte, v.ObjectContextLen) + copy(byteString[:v.ObjectContextLen], buf[b:]) + v.ObjectContext = string(byteString) + b += xgb.Pad(int(v.ObjectContextLen)) + } + + { + byteString := make([]byte, v.DataContextLen) + copy(byteString[:v.DataContextLen], buf[b:]) + v.DataContext = string(byteString) + b += xgb.Pad(int(v.DataContextLen)) + } + + return b +} + +// Struct list read ListItem +func ListItemReadList(buf []byte, dest []ListItem) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ListItem{} + b += ListItemRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ListItem +func (v ListItem) Bytes() []byte { + buf := make([]byte, ((12 + xgb.Pad((int(v.ObjectContextLen) * 1))) + xgb.Pad((int(v.DataContextLen) * 1)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Name)) + b += 4 + + xgb.Put32(buf[b:], v.ObjectContextLen) + b += 4 + + xgb.Put32(buf[b:], v.DataContextLen) + b += 4 + + copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) + b += xgb.Pad(int(v.ObjectContextLen)) + + copy(buf[b:], v.DataContext[:v.DataContextLen]) + b += xgb.Pad(int(v.DataContextLen)) + + return buf +} + +// Write struct list ListItem +func ListItemListBytes(buf []byte, list []ListItem) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ListItem +func ListItemListSize(list []ListItem) int { + size := 0 + for _, item := range list { + size += ((12 + xgb.Pad((int(item.ObjectContextLen) * 1))) + xgb.Pad((int(item.DataContextLen) * 1))) + } + return size +} + +// Request QueryVersion +// size: 8 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 12 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 + + return buf +} + +// Request SetDeviceCreateContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetDeviceCreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetDeviceCreateContext +func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) + return SetDeviceCreateContextCookie{cookie} +} + +func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) + return SetDeviceCreateContextCookie{cookie} +} + +func (cook SetDeviceCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceCreateContext +func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetDeviceCreateContext +// size: 4 +type GetDeviceCreateContextCookie struct { + *xgb.Cookie +} + +func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceCreateContextRequest(c), cookie) + return GetDeviceCreateContextCookie{cookie} +} + +func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceCreateContextRequest(c), cookie) + return GetDeviceCreateContextCookie{cookie} +} + +// Request reply for GetDeviceCreateContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetDeviceCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetDeviceCreateContext +func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceCreateContext +func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { + v := new(GetDeviceCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetDeviceCreateContext +func getDeviceCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request SetDeviceContext +// size: xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) +type SetDeviceContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetDeviceContext +func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) + return SetDeviceContextCookie{cookie} +} + +func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) + return SetDeviceContextCookie{cookie} +} + +func (cook SetDeviceContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceContext +func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Device) + b += 4 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetDeviceContext +// size: 8 +type GetDeviceContextCookie struct { + *xgb.Cookie +} + +func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceContextRequest(c, Device), cookie) + return GetDeviceContextCookie{cookie} +} + +func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceContextRequest(c, Device), cookie) + return GetDeviceContextCookie{cookie} +} + +// Request reply for GetDeviceContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetDeviceContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetDeviceContext +func (cook GetDeviceContextCookie) Reply() (*GetDeviceContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceContextReply(buf), nil +} + +// Read reply into structure from buffer for GetDeviceContext +func getDeviceContextReply(buf []byte) *GetDeviceContextReply { + v := new(GetDeviceContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetDeviceContext +func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Device) + b += 4 + + return buf +} + +// Request SetWindowCreateContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetWindowCreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetWindowCreateContext +func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) + return SetWindowCreateContextCookie{cookie} +} + +func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) + return SetWindowCreateContextCookie{cookie} +} + +func (cook SetWindowCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetWindowCreateContext +func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetWindowCreateContext +// size: 4 +type GetWindowCreateContextCookie struct { + *xgb.Cookie +} + +func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getWindowCreateContextRequest(c), cookie) + return GetWindowCreateContextCookie{cookie} +} + +func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getWindowCreateContextRequest(c), cookie) + return GetWindowCreateContextCookie{cookie} +} + +// Request reply for GetWindowCreateContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetWindowCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetWindowCreateContext +func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getWindowCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for GetWindowCreateContext +func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { + v := new(GetWindowCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetWindowCreateContext +func getWindowCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetWindowContext +// size: 8 +type GetWindowContextCookie struct { + *xgb.Cookie +} + +func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getWindowContextRequest(c, Window), cookie) + return GetWindowContextCookie{cookie} +} + +func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getWindowContextRequest(c, Window), cookie) + return GetWindowContextCookie{cookie} +} + +// Request reply for GetWindowContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetWindowContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetWindowContext +func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getWindowContextReply(buf), nil +} + +// Read reply into structure from buffer for GetWindowContext +func getWindowContextReply(buf []byte) *GetWindowContextReply { + v := new(GetWindowContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetWindowContext +func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request SetPropertyCreateContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetPropertyCreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPropertyCreateContext +func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) + return SetPropertyCreateContextCookie{cookie} +} + +func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) + return SetPropertyCreateContextCookie{cookie} +} + +func (cook SetPropertyCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPropertyCreateContext +func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetPropertyCreateContext +// size: 4 +type GetPropertyCreateContextCookie struct { + *xgb.Cookie +} + +func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyCreateContextRequest(c), cookie) + return GetPropertyCreateContextCookie{cookie} +} + +func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyCreateContextRequest(c), cookie) + return GetPropertyCreateContextCookie{cookie} +} + +// Request reply for GetPropertyCreateContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetPropertyCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetPropertyCreateContext +func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for GetPropertyCreateContext +func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { + v := new(GetPropertyCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetPropertyCreateContext +func getPropertyCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request SetPropertyUseContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetPropertyUseContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPropertyUseContext +func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) + return SetPropertyUseContextCookie{cookie} +} + +func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) + return SetPropertyUseContextCookie{cookie} +} + +func (cook SetPropertyUseContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPropertyUseContext +func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetPropertyUseContext +// size: 4 +type GetPropertyUseContextCookie struct { + *xgb.Cookie +} + +func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyUseContextRequest(c), cookie) + return GetPropertyUseContextCookie{cookie} +} + +func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyUseContextRequest(c), cookie) + return GetPropertyUseContextCookie{cookie} +} + +// Request reply for GetPropertyUseContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetPropertyUseContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetPropertyUseContext +func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyUseContextReply(buf), nil +} + +// Read reply into structure from buffer for GetPropertyUseContext +func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { + v := new(GetPropertyUseContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetPropertyUseContext +func getPropertyUseContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetPropertyContext +// size: 12 +type GetPropertyContextCookie struct { + *xgb.Cookie +} + +func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) + return GetPropertyContextCookie{cookie} +} + +func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) + return GetPropertyContextCookie{cookie} +} + +// Request reply for GetPropertyContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetPropertyContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetPropertyContext +func (cook GetPropertyContextCookie) Reply() (*GetPropertyContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyContextReply(buf), nil +} + +// Read reply into structure from buffer for GetPropertyContext +func getPropertyContextReply(buf []byte) *GetPropertyContextReply { + v := new(GetPropertyContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetPropertyContext +func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request GetPropertyDataContext +// size: 12 +type GetPropertyDataContextCookie struct { + *xgb.Cookie +} + +func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) + return GetPropertyDataContextCookie{cookie} +} + +func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) + return GetPropertyDataContextCookie{cookie} +} + +// Request reply for GetPropertyDataContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetPropertyDataContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetPropertyDataContext +func (cook GetPropertyDataContextCookie) Reply() (*GetPropertyDataContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyDataContextReply(buf), nil +} + +// Read reply into structure from buffer for GetPropertyDataContext +func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { + v := new(GetPropertyDataContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetPropertyDataContext +func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// Request ListProperties +// size: 8 +type ListPropertiesCookie struct { + *xgb.Cookie +} + +func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} +} + +func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} +} + +// Request reply for ListProperties +// size: (32 + ListItemListSize(Properties)) +type ListPropertiesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + PropertiesLen uint32 + // padding: 20 bytes + Properties []ListItem // size: ListItemListSize(Properties) +} + +// Waits and reads reply data from request ListProperties +func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listPropertiesReply(buf), nil +} + +// Read reply into structure from buffer for ListProperties +func listPropertiesReply(buf []byte) *ListPropertiesReply { + v := new(ListPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PropertiesLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Properties = make([]ListItem, v.PropertiesLen) + b += ListItemReadList(buf[b:], v.Properties) + + return v +} + +// Write request to wire for ListProperties +func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request SetSelectionCreateContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetSelectionCreateContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetSelectionCreateContext +func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) + return SetSelectionCreateContextCookie{cookie} +} + +func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) + return SetSelectionCreateContextCookie{cookie} +} + +func (cook SetSelectionCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetSelectionCreateContext +func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetSelectionCreateContext +// size: 4 +type GetSelectionCreateContextCookie struct { + *xgb.Cookie +} + +func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionCreateContextRequest(c), cookie) + return GetSelectionCreateContextCookie{cookie} +} + +func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionCreateContextRequest(c), cookie) + return GetSelectionCreateContextCookie{cookie} +} + +// Request reply for GetSelectionCreateContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetSelectionCreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetSelectionCreateContext +func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionCreateContextReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectionCreateContext +func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply { + v := new(GetSelectionCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionCreateContext +func getSelectionCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request SetSelectionUseContext +// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +type SetSelectionUseContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetSelectionUseContext +func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) + return SetSelectionUseContextCookie{cookie} +} + +func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) + return SetSelectionUseContextCookie{cookie} +} + +func (cook SetSelectionUseContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetSelectionUseContext +func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// Request GetSelectionUseContext +// size: 4 +type GetSelectionUseContextCookie struct { + *xgb.Cookie +} + +func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionUseContextRequest(c), cookie) + return GetSelectionUseContextCookie{cookie} +} + +func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionUseContextRequest(c), cookie) + return GetSelectionUseContextCookie{cookie} +} + +// Request reply for GetSelectionUseContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetSelectionUseContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetSelectionUseContext +func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionUseContextReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectionUseContext +func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { + v := new(GetSelectionUseContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionUseContext +func getSelectionUseContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetSelectionContext +// size: 8 +type GetSelectionContextCookie struct { + *xgb.Cookie +} + +func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionContextRequest(c, Selection), cookie) + return GetSelectionContextCookie{cookie} +} + +func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionContextRequest(c, Selection), cookie) + return GetSelectionContextCookie{cookie} +} + +// Request reply for GetSelectionContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetSelectionContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetSelectionContext +func (cook GetSelectionContextCookie) Reply() (*GetSelectionContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionContextReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectionContext +func getSelectionContextReply(buf []byte) *GetSelectionContextReply { + v := new(GetSelectionContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionContext +func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + return buf +} + +// Request GetSelectionDataContext +// size: 8 +type GetSelectionDataContextCookie struct { + *xgb.Cookie +} + +func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) + return GetSelectionDataContextCookie{cookie} +} + +func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) + return GetSelectionDataContextCookie{cookie} +} + +// Request reply for GetSelectionDataContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetSelectionDataContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetSelectionDataContext +func (cook GetSelectionDataContextCookie) Reply() (*GetSelectionDataContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionDataContextReply(buf), nil +} + +// Read reply into structure from buffer for GetSelectionDataContext +func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { + v := new(GetSelectionDataContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionDataContext +func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + return buf +} + +// Request ListSelections +// size: 4 +type ListSelectionsCookie struct { + *xgb.Cookie +} + +func ListSelections(c *xgb.Conn) ListSelectionsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listSelectionsRequest(c), cookie) + return ListSelectionsCookie{cookie} +} + +func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listSelectionsRequest(c), cookie) + return ListSelectionsCookie{cookie} +} + +// Request reply for ListSelections +// size: (32 + ListItemListSize(Selections)) +type ListSelectionsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + SelectionsLen uint32 + // padding: 20 bytes + Selections []ListItem // size: ListItemListSize(Selections) +} + +// Waits and reads reply data from request ListSelections +func (cook ListSelectionsCookie) Reply() (*ListSelectionsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listSelectionsReply(buf), nil +} + +// Read reply into structure from buffer for ListSelections +func listSelectionsReply(buf []byte) *ListSelectionsReply { + v := new(ListSelectionsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.SelectionsLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Selections = make([]ListItem, v.SelectionsLen) + b += ListItemReadList(buf[b:], v.Selections) + + return v +} + +// Write request to wire for ListSelections +func listSelectionsRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request GetClientContext +// size: 8 +type GetClientContextCookie struct { + *xgb.Cookie +} + +func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getClientContextRequest(c, Resource), cookie) + return GetClientContextCookie{cookie} +} + +func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getClientContextRequest(c, Resource), cookie) + return GetClientContextCookie{cookie} +} + +// Request reply for GetClientContext +// size: (32 + xgb.Pad((int(ContextLen) * 1))) +type GetClientContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Waits and reads reply data from request GetClientContext +func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getClientContextReply(buf), nil +} + +// Read reply into structure from buffer for GetClientContext +func getClientContextReply(buf []byte) *GetClientContextReply { + v := new(GetClientContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetClientContext +func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Resource) + b += 4 + + return buf +} diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go new file mode 100644 index 0000000..e035fe5 --- /dev/null +++ b/nexgb/xtest/xtest.go @@ -0,0 +1,355 @@ +package xtest + +/* + This file was generated by xtest.xml on May 10 2012 4:20:29pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XTEST extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 5, "XTEST").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XTEST could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XTEST"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XTEST"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XTEST"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XTEST"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +const ( + CursorNone = 0 + CursorCurrent = 1 +) + +// Request GetVersion +// size: 8 +type GetVersionCookie struct { + *xgb.Cookie +} + +func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) + return GetVersionCookie{cookie} +} + +func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// Request reply for GetVersion +// size: 10 +type GetVersionReply struct { + Sequence uint16 + Length uint32 + MajorVersion byte + MinorVersion uint16 +} + +// Waits and reads reply data from request GetVersion +func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVersionReply(buf), nil +} + +// Read reply into structure from buffer for GetVersion +func getVersionReply(buf []byte) *GetVersionReply { + v := new(GetVersionReply) + b := 1 // skip reply determinant + + v.MajorVersion = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for GetVersion +func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XTEST"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = MajorVersion + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], MinorVersion) + b += 2 + + return buf +} + +// Request CompareCursor +// size: 12 +type CompareCursorCookie struct { + *xgb.Cookie +} + +func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) + return CompareCursorCookie{cookie} +} + +func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) + return CompareCursorCookie{cookie} +} + +// Request reply for CompareCursor +// size: 8 +type CompareCursorReply struct { + Sequence uint16 + Length uint32 + Same bool +} + +// Waits and reads reply data from request CompareCursor +func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return compareCursorReply(buf), nil +} + +// Read reply into structure from buffer for CompareCursor +func compareCursorReply(buf []byte) *CompareCursorReply { + v := new(CompareCursorReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Same = true + } else { + v.Same = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for CompareCursor +func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XTEST"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + return buf +} + +// Request FakeInput +// size: 36 +type FakeInputCookie struct { + *xgb.Cookie +} + +// Write request to wire for FakeInput +func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) + return FakeInputCookie{cookie} +} + +func FakeInputChecked(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) + return FakeInputCookie{cookie} +} + +func (cook FakeInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FakeInput +func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XTEST"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Type + b += 1 + + buf[b] = Detail + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], Time) + b += 4 + + xgb.Put32(buf[b:], uint32(Root)) + b += 4 + + b += 8 // padding + + xgb.Put16(buf[b:], uint16(RootX)) + b += 2 + + xgb.Put16(buf[b:], uint16(RootY)) + b += 2 + + b += 7 // padding + + buf[b] = Deviceid + b += 1 + + return buf +} + +// Request GrabControl +// size: 8 +type GrabControlCookie struct { + *xgb.Cookie +} + +// Write request to wire for GrabControl +func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(grabControlRequest(c, Impervious), cookie) + return GrabControlCookie{cookie} +} + +func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(grabControlRequest(c, Impervious), cookie) + return GrabControlCookie{cookie} +} + +func (cook GrabControlCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for GrabControl +func grabControlRequest(c *xgb.Conn, Impervious bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XTEST"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Impervious { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go new file mode 100644 index 0000000..8faaf83 --- /dev/null +++ b/nexgb/xv/xv.go @@ -0,0 +1,2746 @@ +package xv + +/* + This file was generated by xv.xml on May 10 2012 4:20:29pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/shm" + "github.com/BurntSushi/xgb/xproto" +) + +// Init must be called before using the XVideo extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 6, "XVideo").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XVideo could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XVideo"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XVideo"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XVideo"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XVideo"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +const ( + TypeInputMask = 1 + TypeOutputMask = 2 + TypeVideoMask = 4 + TypeStillMask = 8 + TypeImageMask = 16 +) + +const ( + ImageFormatInfoTypeRgb = 0 + ImageFormatInfoTypeYuv = 1 +) + +const ( + ImageFormatInfoFormatPacked = 0 + ImageFormatInfoFormatPlanar = 1 +) + +const ( + AttributeFlagGettable = 1 + AttributeFlagSettable = 2 +) + +const ( + VideoNotifyReasonStarted = 0 + VideoNotifyReasonStopped = 1 + VideoNotifyReasonBusy = 2 + VideoNotifyReasonPreempted = 3 + VideoNotifyReasonHardError = 4 +) + +const ( + ScanlineOrderTopToBottom = 0 + ScanlineOrderBottomToTop = 1 +) + +const ( + GrabPortStatusSuccess = 0 + GrabPortStatusBadExtension = 1 + GrabPortStatusAlreadyGrabbed = 2 + GrabPortStatusInvalidTime = 3 + GrabPortStatusBadReply = 4 + GrabPortStatusBadAlloc = 5 +) + +type Port uint32 + +func NewPortId(c *xgb.Conn) (Port, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Port(id), nil +} + +type Encoding uint32 + +func NewEncodingId(c *xgb.Conn) (Encoding, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Encoding(id), nil +} + +// 'Rational' struct definition +// Size: 8 +type Rational struct { + Numerator int32 + Denominator int32 +} + +// Struct read Rational +func RationalRead(buf []byte, v *Rational) int { + b := 0 + + v.Numerator = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Denominator = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// Struct list read Rational +func RationalReadList(buf []byte, dest []Rational) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rational{} + b += RationalRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Rational +func (v Rational) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Numerator)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Denominator)) + b += 4 + + return buf +} + +// Write struct list Rational +func RationalListBytes(buf []byte, list []Rational) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'Format' struct definition +// Size: 8 +type Format struct { + Visual xproto.Visualid + Depth byte + // padding: 3 bytes +} + +// Struct read Format +func FormatRead(buf []byte, v *Format) int { + b := 0 + + v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Depth = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// Struct list read Format +func FormatReadList(buf []byte, dest []Format) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Format{} + b += FormatRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Format +func (v Format) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Visual)) + b += 4 + + buf[b] = v.Depth + b += 1 + + b += 3 // padding + + return buf +} + +// Write struct list Format +func FormatListBytes(buf []byte, list []Format) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// 'AdaptorInfo' struct definition +// Size: ((12 + xgb.Pad((int(NameSize) * 1))) + xgb.Pad((int(NumFormats) * 8))) +type AdaptorInfo struct { + BaseId Port + NameSize uint16 + NumPorts uint16 + NumFormats uint16 + Type byte + // padding: 1 bytes + Name string // size: xgb.Pad((int(NameSize) * 1)) + Formats []Format // size: xgb.Pad((int(NumFormats) * 8)) +} + +// Struct read AdaptorInfo +func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { + b := 0 + + v.BaseId = Port(xgb.Get32(buf[b:])) + b += 4 + + v.NameSize = xgb.Get16(buf[b:]) + b += 2 + + v.NumPorts = xgb.Get16(buf[b:]) + b += 2 + + v.NumFormats = xgb.Get16(buf[b:]) + b += 2 + + v.Type = buf[b] + b += 1 + + b += 1 // padding + + { + byteString := make([]byte, v.NameSize) + copy(byteString[:v.NameSize], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameSize)) + } + + v.Formats = make([]Format, v.NumFormats) + b += FormatReadList(buf[b:], v.Formats) + + return b +} + +// Struct list read AdaptorInfo +func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = AdaptorInfo{} + b += AdaptorInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write AdaptorInfo +func (v AdaptorInfo) Bytes() []byte { + buf := make([]byte, ((12 + xgb.Pad((int(v.NameSize) * 1))) + xgb.Pad((int(v.NumFormats) * 8)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.BaseId)) + b += 4 + + xgb.Put16(buf[b:], v.NameSize) + b += 2 + + xgb.Put16(buf[b:], v.NumPorts) + b += 2 + + xgb.Put16(buf[b:], v.NumFormats) + b += 2 + + buf[b] = v.Type + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Name[:v.NameSize]) + b += xgb.Pad(int(v.NameSize)) + + b += FormatListBytes(buf[b:], v.Formats) + + return buf +} + +// Write struct list AdaptorInfo +func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size AdaptorInfo +func AdaptorInfoListSize(list []AdaptorInfo) int { + size := 0 + for _, item := range list { + size += ((12 + xgb.Pad((int(item.NameSize) * 1))) + xgb.Pad((int(item.NumFormats) * 8))) + } + return size +} + +// 'EncodingInfo' struct definition +// Size: (20 + xgb.Pad((int(NameSize) * 1))) +type EncodingInfo struct { + Encoding Encoding + NameSize uint16 + Width uint16 + Height uint16 + // padding: 2 bytes + Rate Rational + Name string // size: xgb.Pad((int(NameSize) * 1)) +} + +// Struct read EncodingInfo +func EncodingInfoRead(buf []byte, v *EncodingInfo) int { + b := 0 + + v.Encoding = Encoding(xgb.Get32(buf[b:])) + b += 4 + + v.NameSize = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Rate = Rational{} + b += RationalRead(buf[b:], &v.Rate) + + { + byteString := make([]byte, v.NameSize) + copy(byteString[:v.NameSize], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameSize)) + } + + return b +} + +// Struct list read EncodingInfo +func EncodingInfoReadList(buf []byte, dest []EncodingInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = EncodingInfo{} + b += EncodingInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write EncodingInfo +func (v EncodingInfo) Bytes() []byte { + buf := make([]byte, (20 + xgb.Pad((int(v.NameSize) * 1)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Encoding)) + b += 4 + + xgb.Put16(buf[b:], v.NameSize) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + b += 2 // padding + + { + structBytes := v.Rate.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + copy(buf[b:], v.Name[:v.NameSize]) + b += xgb.Pad(int(v.NameSize)) + + return buf +} + +// Write struct list EncodingInfo +func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size EncodingInfo +func EncodingInfoListSize(list []EncodingInfo) int { + size := 0 + for _, item := range list { + size += (20 + xgb.Pad((int(item.NameSize) * 1))) + } + return size +} + +// 'Image' struct definition +// Size: (((16 + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(DataSize) * 1))) +type Image struct { + Id uint32 + Width uint16 + Height uint16 + DataSize uint32 + NumPlanes uint32 + Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + Data []byte // size: xgb.Pad((int(DataSize) * 1)) +} + +// Struct read Image +func ImageRead(buf []byte, v *Image) int { + b := 0 + + v.Id = xgb.Get32(buf[b:]) + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.DataSize = xgb.Get32(buf[b:]) + b += 4 + + v.NumPlanes = xgb.Get32(buf[b:]) + b += 4 + + v.Pitches = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Pitches[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.Offsets = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Offsets[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.Data = make([]byte, v.DataSize) + copy(v.Data[:v.DataSize], buf[b:]) + b += xgb.Pad(int(v.DataSize)) + + return b +} + +// Struct list read Image +func ImageReadList(buf []byte, dest []Image) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Image{} + b += ImageRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write Image +func (v Image) Bytes() []byte { + buf := make([]byte, (((16 + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) + b := 0 + + xgb.Put32(buf[b:], v.Id) + b += 4 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put32(buf[b:], v.DataSize) + b += 4 + + xgb.Put32(buf[b:], v.NumPlanes) + b += 4 + + for i := 0; i < int(v.NumPlanes); i++ { + xgb.Put32(buf[b:], v.Pitches[i]) + b += 4 + } + b = xgb.Pad(b) + + for i := 0; i < int(v.NumPlanes); i++ { + xgb.Put32(buf[b:], v.Offsets[i]) + b += 4 + } + b = xgb.Pad(b) + + copy(buf[b:], v.Data[:v.DataSize]) + b += xgb.Pad(int(v.DataSize)) + + return buf +} + +// Write struct list Image +func ImageListBytes(buf []byte, list []Image) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size Image +func ImageListSize(list []Image) int { + size := 0 + for _, item := range list { + size += (((16 + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.DataSize) * 1))) + } + return size +} + +// 'AttributeInfo' struct definition +// Size: (16 + xgb.Pad((int(Size) * 1))) +type AttributeInfo struct { + Flags uint32 + Min int32 + Max int32 + Size uint32 + Name string // size: xgb.Pad((int(Size) * 1)) +} + +// Struct read AttributeInfo +func AttributeInfoRead(buf []byte, v *AttributeInfo) int { + b := 0 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + v.Min = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Max = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Size = xgb.Get32(buf[b:]) + b += 4 + + { + byteString := make([]byte, v.Size) + copy(byteString[:v.Size], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.Size)) + } + + return b +} + +// Struct list read AttributeInfo +func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = AttributeInfo{} + b += AttributeInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write AttributeInfo +func (v AttributeInfo) Bytes() []byte { + buf := make([]byte, (16 + xgb.Pad((int(v.Size) * 1)))) + b := 0 + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Min)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Max)) + b += 4 + + xgb.Put32(buf[b:], v.Size) + b += 4 + + copy(buf[b:], v.Name[:v.Size]) + b += xgb.Pad(int(v.Size)) + + return buf +} + +// Write struct list AttributeInfo +func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size AttributeInfo +func AttributeInfoListSize(list []AttributeInfo) int { + size := 0 + for _, item := range list { + size += (16 + xgb.Pad((int(item.Size) * 1))) + } + return size +} + +// 'ImageFormatInfo' struct definition +// Size: 128 +type ImageFormatInfo struct { + Id uint32 + Type byte + ByteOrder byte + // padding: 2 bytes + Guid []byte // size: 16 + Bpp byte + NumPlanes byte + // padding: 2 bytes + Depth byte + // padding: 3 bytes + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + Format byte + // padding: 3 bytes + YSampleBits uint32 + USampleBits uint32 + VSampleBits uint32 + VhorzYPeriod uint32 + VhorzUPeriod uint32 + VhorzVPeriod uint32 + VvertYPeriod uint32 + VvertUPeriod uint32 + VvertVPeriod uint32 + VcompOrder []byte // size: 32 + VscanlineOrder byte + // padding: 11 bytes +} + +// Struct read ImageFormatInfo +func ImageFormatInfoRead(buf []byte, v *ImageFormatInfo) int { + b := 0 + + v.Id = xgb.Get32(buf[b:]) + b += 4 + + v.Type = buf[b] + b += 1 + + v.ByteOrder = buf[b] + b += 1 + + b += 2 // padding + + v.Guid = make([]byte, 16) + copy(v.Guid[:16], buf[b:]) + b += xgb.Pad(int(16)) + + v.Bpp = buf[b] + b += 1 + + v.NumPlanes = buf[b] + b += 1 + + b += 2 // padding + + v.Depth = buf[b] + b += 1 + + b += 3 // padding + + v.RedMask = xgb.Get32(buf[b:]) + b += 4 + + v.GreenMask = xgb.Get32(buf[b:]) + b += 4 + + v.BlueMask = xgb.Get32(buf[b:]) + b += 4 + + v.Format = buf[b] + b += 1 + + b += 3 // padding + + v.YSampleBits = xgb.Get32(buf[b:]) + b += 4 + + v.USampleBits = xgb.Get32(buf[b:]) + b += 4 + + v.VSampleBits = xgb.Get32(buf[b:]) + b += 4 + + v.VhorzYPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VhorzUPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VhorzVPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VvertYPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VvertUPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VvertVPeriod = xgb.Get32(buf[b:]) + b += 4 + + v.VcompOrder = make([]byte, 32) + copy(v.VcompOrder[:32], buf[b:]) + b += xgb.Pad(int(32)) + + v.VscanlineOrder = buf[b] + b += 1 + + b += 11 // padding + + return b +} + +// Struct list read ImageFormatInfo +func ImageFormatInfoReadList(buf []byte, dest []ImageFormatInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ImageFormatInfo{} + b += ImageFormatInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write ImageFormatInfo +func (v ImageFormatInfo) Bytes() []byte { + buf := make([]byte, 128) + b := 0 + + xgb.Put32(buf[b:], v.Id) + b += 4 + + buf[b] = v.Type + b += 1 + + buf[b] = v.ByteOrder + b += 1 + + b += 2 // padding + + copy(buf[b:], v.Guid[:16]) + b += xgb.Pad(int(16)) + + buf[b] = v.Bpp + b += 1 + + buf[b] = v.NumPlanes + b += 1 + + b += 2 // padding + + buf[b] = v.Depth + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], v.RedMask) + b += 4 + + xgb.Put32(buf[b:], v.GreenMask) + b += 4 + + xgb.Put32(buf[b:], v.BlueMask) + b += 4 + + buf[b] = v.Format + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], v.YSampleBits) + b += 4 + + xgb.Put32(buf[b:], v.USampleBits) + b += 4 + + xgb.Put32(buf[b:], v.VSampleBits) + b += 4 + + xgb.Put32(buf[b:], v.VhorzYPeriod) + b += 4 + + xgb.Put32(buf[b:], v.VhorzUPeriod) + b += 4 + + xgb.Put32(buf[b:], v.VhorzVPeriod) + b += 4 + + xgb.Put32(buf[b:], v.VvertYPeriod) + b += 4 + + xgb.Put32(buf[b:], v.VvertUPeriod) + b += 4 + + xgb.Put32(buf[b:], v.VvertVPeriod) + b += 4 + + copy(buf[b:], v.VcompOrder[:32]) + b += xgb.Pad(int(32)) + + buf[b] = v.VscanlineOrder + b += 1 + + b += 11 // padding + + return buf +} + +// Write struct list ImageFormatInfo +func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Struct list size ImageFormatInfo +func ImageFormatInfoListSize(list []ImageFormatInfo) int { + size := 0 + for _ = range list { + size += 128 + } + return size +} + +// Event definition VideoNotify (0) +// Size: 32 + +const VideoNotify = 0 + +type VideoNotifyEvent struct { + Sequence uint16 + Reason byte + Time xproto.Timestamp + Drawable xproto.Drawable + Port Port +} + +// Event read VideoNotify +func VideoNotifyEventNew(buf []byte) xgb.Event { + v := VideoNotifyEvent{} + b := 1 // don't read event number + + v.Reason = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.Port = Port(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Event write VideoNotify +func (v VideoNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Reason + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Port)) + b += 4 + + return buf +} + +func (v VideoNotifyEvent) ImplementsEvent() {} + +func (v VideoNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v VideoNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Reason: %d", v.Reason)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("Port: %d", v.Port)) + return "VideoNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XVideo"][0] = VideoNotifyEventNew +} + +// Event definition PortNotify (1) +// Size: 32 + +const PortNotify = 1 + +type PortNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time xproto.Timestamp + Port Port + Attribute xproto.Atom + Value int32 +} + +// Event read PortNotify +func PortNotifyEventNew(buf []byte) xgb.Event { + v := PortNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Port = Port(xgb.Get32(buf[b:])) + b += 4 + + v.Attribute = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Value = int32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Event write PortNotify +func (v PortNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Attribute)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Value)) + b += 4 + + return buf +} + +func (v PortNotifyEvent) ImplementsEvent() {} + +func (v PortNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v PortNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Port: %d", v.Port)) + fieldVals = append(fieldVals, xgb.Sprintf("Attribute: %d", v.Attribute)) + fieldVals = append(fieldVals, xgb.Sprintf("Value: %d", v.Value)) + return "PortNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XVideo"][1] = PortNotifyEventNew +} + +// Error definition BadPort (0) +// Size: 32 + +const BadBadPort = 0 + +type BadPortError struct { + Sequence uint16 + NiceName string +} + +// Error read BadPort +func BadPortErrorNew(buf []byte) xgb.Error { + v := BadPortError{} + v.NiceName = "BadPort" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadPortError) ImplementsError() {} + +func (err BadPortError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadPortError) BadId() uint32 { + return 0 +} + +func (err BadPortError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadPort {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][0] = BadPortErrorNew +} + +// Error definition BadEncoding (1) +// Size: 32 + +const BadBadEncoding = 1 + +type BadEncodingError struct { + Sequence uint16 + NiceName string +} + +// Error read BadEncoding +func BadEncodingErrorNew(buf []byte) xgb.Error { + v := BadEncodingError{} + v.NiceName = "BadEncoding" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadEncodingError) ImplementsError() {} + +func (err BadEncodingError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadEncodingError) BadId() uint32 { + return 0 +} + +func (err BadEncodingError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadEncoding {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][1] = BadEncodingErrorNew +} + +// Error definition BadControl (2) +// Size: 32 + +const BadBadControl = 2 + +type BadControlError struct { + Sequence uint16 + NiceName string +} + +// Error read BadControl +func BadControlErrorNew(buf []byte) xgb.Error { + v := BadControlError{} + v.NiceName = "BadControl" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +func (err BadControlError) ImplementsError() {} + +func (err BadControlError) SequenceId() uint16 { + return err.Sequence +} + +func (err BadControlError) BadId() uint32 { + return 0 +} + +func (err BadControlError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadControl {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][2] = BadControlErrorNew +} + +// Request QueryExtension +// size: 4 +type QueryExtensionCookie struct { + *xgb.Cookie +} + +func QueryExtension(c *xgb.Conn) QueryExtensionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtensionRequest(c), cookie) + return QueryExtensionCookie{cookie} +} + +func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtensionRequest(c), cookie) + return QueryExtensionCookie{cookie} +} + +// Request reply for QueryExtension +// size: 12 +type QueryExtensionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint16 + Minor uint16 +} + +// Waits and reads reply data from request QueryExtension +func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryExtensionReply(buf), nil +} + +// Read reply into structure from buffer for QueryExtension +func queryExtensionReply(buf []byte) *QueryExtensionReply { + v := new(QueryExtensionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = xgb.Get16(buf[b:]) + b += 2 + + v.Minor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryExtension +func queryExtensionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request QueryAdaptors +// size: 8 +type QueryAdaptorsCookie struct { + *xgb.Cookie +} + +func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryAdaptorsRequest(c, Window), cookie) + return QueryAdaptorsCookie{cookie} +} + +func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryAdaptorsRequest(c, Window), cookie) + return QueryAdaptorsCookie{cookie} +} + +// Request reply for QueryAdaptors +// size: (32 + AdaptorInfoListSize(Info)) +type QueryAdaptorsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAdaptors uint16 + // padding: 22 bytes + Info []AdaptorInfo // size: AdaptorInfoListSize(Info) +} + +// Waits and reads reply data from request QueryAdaptors +func (cook QueryAdaptorsCookie) Reply() (*QueryAdaptorsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryAdaptorsReply(buf), nil +} + +// Read reply into structure from buffer for QueryAdaptors +func queryAdaptorsReply(buf []byte) *QueryAdaptorsReply { + v := new(QueryAdaptorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAdaptors = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]AdaptorInfo, v.NumAdaptors) + b += AdaptorInfoReadList(buf[b:], v.Info) + + return v +} + +// Write request to wire for QueryAdaptors +func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// Request QueryEncodings +// size: 8 +type QueryEncodingsCookie struct { + *xgb.Cookie +} + +func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryEncodingsRequest(c, Port), cookie) + return QueryEncodingsCookie{cookie} +} + +func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryEncodingsRequest(c, Port), cookie) + return QueryEncodingsCookie{cookie} +} + +// Request reply for QueryEncodings +// size: (32 + EncodingInfoListSize(Info)) +type QueryEncodingsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumEncodings uint16 + // padding: 22 bytes + Info []EncodingInfo // size: EncodingInfoListSize(Info) +} + +// Waits and reads reply data from request QueryEncodings +func (cook QueryEncodingsCookie) Reply() (*QueryEncodingsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryEncodingsReply(buf), nil +} + +// Read reply into structure from buffer for QueryEncodings +func queryEncodingsReply(buf []byte) *QueryEncodingsReply { + v := new(QueryEncodingsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumEncodings = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]EncodingInfo, v.NumEncodings) + b += EncodingInfoReadList(buf[b:], v.Info) + + return v +} + +// Write request to wire for QueryEncodings +func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request GrabPort +// size: 12 +type GrabPortCookie struct { + *xgb.Cookie +} + +func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(grabPortRequest(c, Port, Time), cookie) + return GrabPortCookie{cookie} +} + +func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(grabPortRequest(c, Port, Time), cookie) + return GrabPortCookie{cookie} +} + +// Request reply for GrabPort +// size: 8 +type GrabPortReply struct { + Sequence uint16 + Length uint32 + Result byte +} + +// Waits and reads reply data from request GrabPort +func (cook GrabPortCookie) Reply() (*GrabPortReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return grabPortReply(buf), nil +} + +// Read reply into structure from buffer for GrabPort +func grabPortReply(buf []byte) *GrabPortReply { + v := new(GrabPortReply) + b := 1 // skip reply determinant + + v.Result = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for GrabPort +func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// Request UngrabPort +// size: 12 +type UngrabPortCookie struct { + *xgb.Cookie +} + +// Write request to wire for UngrabPort +func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) + return UngrabPortCookie{cookie} +} + +func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) + return UngrabPortCookie{cookie} +} + +func (cook UngrabPortCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabPort +func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// Request PutVideo +// size: 32 +type PutVideoCookie struct { + *xgb.Cookie +} + +// Write request to wire for PutVideo +func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutVideoCookie{cookie} +} + +func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutVideoCookie{cookie} +} + +func (cook PutVideoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutVideo +func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(VidX)) + b += 2 + + xgb.Put16(buf[b:], uint16(VidY)) + b += 2 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request PutStill +// size: 32 +type PutStillCookie struct { + *xgb.Cookie +} + +// Write request to wire for PutStill +func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutStillCookie{cookie} +} + +func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutStillCookie{cookie} +} + +func (cook PutStillCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutStill +func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(VidX)) + b += 2 + + xgb.Put16(buf[b:], uint16(VidY)) + b += 2 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request GetVideo +// size: 32 +type GetVideoCookie struct { + *xgb.Cookie +} + +// Write request to wire for GetVideo +func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetVideoCookie{cookie} +} + +func GetVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetVideoCookie{cookie} +} + +func (cook GetVideoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for GetVideo +func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(VidX)) + b += 2 + + xgb.Put16(buf[b:], uint16(VidY)) + b += 2 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request GetStill +// size: 32 +type GetStillCookie struct { + *xgb.Cookie +} + +// Write request to wire for GetStill +func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetStillCookie{cookie} +} + +func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetStillCookie{cookie} +} + +func (cook GetStillCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for GetStill +func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(VidX)) + b += 2 + + xgb.Put16(buf[b:], uint16(VidY)) + b += 2 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + return buf +} + +// Request StopVideo +// size: 12 +type StopVideoCookie struct { + *xgb.Cookie +} + +// Write request to wire for StopVideo +func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) + return StopVideoCookie{cookie} +} + +func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) + return StopVideoCookie{cookie} +} + +func (cook StopVideoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for StopVideo +func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// Request SelectVideoNotify +// size: 12 +type SelectVideoNotifyCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectVideoNotify +func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) + return SelectVideoNotifyCookie{cookie} +} + +func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) + return SelectVideoNotifyCookie{cookie} +} + +func (cook SelectVideoNotifyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectVideoNotify +func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request SelectPortNotify +// size: 12 +type SelectPortNotifyCookie struct { + *xgb.Cookie +} + +// Write request to wire for SelectPortNotify +func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) + return SelectPortNotifyCookie{cookie} +} + +func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) + return SelectPortNotifyCookie{cookie} +} + +func (cook SelectPortNotifyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectPortNotify +func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request QueryBestSize +// size: 20 +type QueryBestSizeCookie struct { + *xgb.Cookie +} + +func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) + return QueryBestSizeCookie{cookie} +} + +func QueryBestSizeUnchecked(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) + return QueryBestSizeCookie{cookie} +} + +// Request reply for QueryBestSize +// size: 12 +type QueryBestSizeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + ActualWidth uint16 + ActualHeight uint16 +} + +// Waits and reads reply data from request QueryBestSize +func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryBestSizeReply(buf), nil +} + +// Read reply into structure from buffer for QueryBestSize +func queryBestSizeReply(buf []byte) *QueryBestSizeReply { + v := new(QueryBestSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ActualWidth = xgb.Get16(buf[b:]) + b += 2 + + v.ActualHeight = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryBestSize +func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + if Motion { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// Request SetPortAttribute +// size: 16 +type SetPortAttributeCookie struct { + *xgb.Cookie +} + +// Write request to wire for SetPortAttribute +func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) + return SetPortAttributeCookie{cookie} +} + +func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) + return SetPortAttributeCookie{cookie} +} + +func (cook SetPortAttributeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPortAttribute +func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Attribute)) + b += 4 + + xgb.Put32(buf[b:], uint32(Value)) + b += 4 + + return buf +} + +// Request GetPortAttribute +// size: 12 +type GetPortAttributeCookie struct { + *xgb.Cookie +} + +func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) + return GetPortAttributeCookie{cookie} +} + +func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) + return GetPortAttributeCookie{cookie} +} + +// Request reply for GetPortAttribute +// size: 12 +type GetPortAttributeReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Value int32 +} + +// Waits and reads reply data from request GetPortAttribute +func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPortAttributeReply(buf), nil +} + +// Read reply into structure from buffer for GetPortAttribute +func getPortAttributeReply(buf []byte) *GetPortAttributeReply { + v := new(GetPortAttributeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Value = int32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetPortAttribute +func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Attribute)) + b += 4 + + return buf +} + +// Request QueryPortAttributes +// size: 8 +type QueryPortAttributesCookie struct { + *xgb.Cookie +} + +func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryPortAttributesRequest(c, Port), cookie) + return QueryPortAttributesCookie{cookie} +} + +func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryPortAttributesRequest(c, Port), cookie) + return QueryPortAttributesCookie{cookie} +} + +// Request reply for QueryPortAttributes +// size: (32 + AttributeInfoListSize(Attributes)) +type QueryPortAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumAttributes uint32 + TextSize uint32 + // padding: 16 bytes + Attributes []AttributeInfo // size: AttributeInfoListSize(Attributes) +} + +// Waits and reads reply data from request QueryPortAttributes +func (cook QueryPortAttributesCookie) Reply() (*QueryPortAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryPortAttributesReply(buf), nil +} + +// Read reply into structure from buffer for QueryPortAttributes +func queryPortAttributesReply(buf []byte) *QueryPortAttributesReply { + v := new(QueryPortAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttributes = xgb.Get32(buf[b:]) + b += 4 + + v.TextSize = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.Attributes = make([]AttributeInfo, v.NumAttributes) + b += AttributeInfoReadList(buf[b:], v.Attributes) + + return v +} + +// Write request to wire for QueryPortAttributes +func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request ListImageFormats +// size: 8 +type ListImageFormatsCookie struct { + *xgb.Cookie +} + +func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listImageFormatsRequest(c, Port), cookie) + return ListImageFormatsCookie{cookie} +} + +func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listImageFormatsRequest(c, Port), cookie) + return ListImageFormatsCookie{cookie} +} + +// Request reply for ListImageFormats +// size: (32 + ImageFormatInfoListSize(Format)) +type ListImageFormatsReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumFormats uint32 + // padding: 20 bytes + Format []ImageFormatInfo // size: ImageFormatInfoListSize(Format) +} + +// Waits and reads reply data from request ListImageFormats +func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listImageFormatsReply(buf), nil +} + +// Read reply into structure from buffer for ListImageFormats +func listImageFormatsReply(buf []byte) *ListImageFormatsReply { + v := new(ListImageFormatsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFormats = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Format = make([]ImageFormatInfo, v.NumFormats) + b += ImageFormatInfoReadList(buf[b:], v.Format) + + return v +} + +// Write request to wire for ListImageFormats +func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// Request QueryImageAttributes +// size: 16 +type QueryImageAttributesCookie struct { + *xgb.Cookie +} + +func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) + return QueryImageAttributesCookie{cookie} +} + +func QueryImageAttributesUnchecked(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) + return QueryImageAttributesCookie{cookie} +} + +// Request reply for QueryImageAttributes +// size: ((32 + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(NumPlanes) * 4))) +type QueryImageAttributesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + NumPlanes uint32 + DataSize uint32 + Width uint16 + Height uint16 + // padding: 12 bytes + Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) +} + +// Waits and reads reply data from request QueryImageAttributes +func (cook QueryImageAttributesCookie) Reply() (*QueryImageAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryImageAttributesReply(buf), nil +} + +// Read reply into structure from buffer for QueryImageAttributes +func queryImageAttributesReply(buf []byte) *QueryImageAttributesReply { + v := new(QueryImageAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumPlanes = xgb.Get32(buf[b:]) + b += 4 + + v.DataSize = xgb.Get32(buf[b:]) + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + b += 12 // padding + + v.Pitches = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Pitches[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.Offsets = make([]uint32, v.NumPlanes) + for i := 0; i < int(v.NumPlanes); i++ { + v.Offsets[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryImageAttributes +func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request PutImage +// size: xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) +type PutImageCookie struct { + *xgb.Cookie +} + +// Write request to wire for PutImage +func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return PutImageCookie{cookie} +} + +func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return PutImageCookie{cookie} +} + +func (cook PutImageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutImage +func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { + size := xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], SrcW) + b += 2 + + xgb.Put16(buf[b:], SrcH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// Request ShmPutImage +// size: 52 +type ShmPutImageCookie struct { + *xgb.Cookie +} + +// Write request to wire for ShmPutImage +func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) + return ShmPutImageCookie{cookie} +} + +func ShmPutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) + return ShmPutImageCookie{cookie} +} + +func (cook ShmPutImageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ShmPutImage +func shmPutImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { + size := 52 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], Offset) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], SrcW) + b += 2 + + xgb.Put16(buf[b:], SrcH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + buf[b] = SendEvent + b += 1 + + b += 3 // padding + + return buf +} diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go new file mode 100644 index 0000000..8878acf --- /dev/null +++ b/nexgb/xvmc/xvmc.go @@ -0,0 +1,908 @@ +package xvmc + +/* + This file was generated by xvmc.xml on May 10 2012 4:20:29pm EDT. + This file is automatically generated. Edit at your peril! +*/ + +import ( + "github.com/BurntSushi/xgb" + + "github.com/BurntSushi/xgb/xproto" + "github.com/BurntSushi/xgb/xv" +) + +// Init must be called before using the XVideo-MotionCompensation extension. +func Init(c *xgb.Conn) error { + reply, err := xproto.QueryExtension(c, 25, "XVideo-MotionCompensation").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return xgb.Errorf("No extension named XVideo-MotionCompensation could be found on on the server.") + } + + xgb.ExtLock.Lock() + c.Extensions["XVideo-MotionCompensation"] = reply.MajorOpcode + for evNum, fun := range xgb.NewExtEventFuncs["XVideo-MotionCompensation"] { + xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + for errNum, fun := range xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] { + xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun + } + xgb.ExtLock.Unlock() + + return nil +} + +func init() { + xgb.NewExtEventFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewEventFun) + xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) +} + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +type Context uint32 + +func NewContextId(c *xgb.Conn) (Context, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Context(id), nil +} + +type Surface uint32 + +func NewSurfaceId(c *xgb.Conn) (Surface, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Surface(id), nil +} + +type Subpicture uint32 + +func NewSubpictureId(c *xgb.Conn) (Subpicture, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Subpicture(id), nil +} + +// 'SurfaceInfo' struct definition +// Size: 24 +type SurfaceInfo struct { + Id Surface + ChromaFormat uint16 + Pad0 uint16 + MaxWidth uint16 + MaxHeight uint16 + SubpictureMaxWidth uint16 + SubpictureMaxHeight uint16 + McType uint32 + Flags uint32 +} + +// Struct read SurfaceInfo +func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int { + b := 0 + + v.Id = Surface(xgb.Get32(buf[b:])) + b += 4 + + v.ChromaFormat = xgb.Get16(buf[b:]) + b += 2 + + v.Pad0 = xgb.Get16(buf[b:]) + b += 2 + + v.MaxWidth = xgb.Get16(buf[b:]) + b += 2 + + v.MaxHeight = xgb.Get16(buf[b:]) + b += 2 + + v.SubpictureMaxWidth = xgb.Get16(buf[b:]) + b += 2 + + v.SubpictureMaxHeight = xgb.Get16(buf[b:]) + b += 2 + + v.McType = xgb.Get32(buf[b:]) + b += 4 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// Struct list read SurfaceInfo +func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SurfaceInfo{} + b += SurfaceInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Struct write SurfaceInfo +func (v SurfaceInfo) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Id)) + b += 4 + + xgb.Put16(buf[b:], v.ChromaFormat) + b += 2 + + xgb.Put16(buf[b:], v.Pad0) + b += 2 + + xgb.Put16(buf[b:], v.MaxWidth) + b += 2 + + xgb.Put16(buf[b:], v.MaxHeight) + b += 2 + + xgb.Put16(buf[b:], v.SubpictureMaxWidth) + b += 2 + + xgb.Put16(buf[b:], v.SubpictureMaxHeight) + b += 2 + + xgb.Put32(buf[b:], v.McType) + b += 4 + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + return buf +} + +// Write struct list SurfaceInfo +func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// Request QueryVersion +// size: 4 +type QueryVersionCookie struct { + *xgb.Cookie +} + +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// Request reply for QueryVersion +// size: 16 +type QueryVersionReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Major uint32 + Minor uint32 +} + +// Waits and reads reply data from request QueryVersion +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// Read reply into structure from buffer for QueryVersion +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = xgb.Get32(buf[b:]) + b += 4 + + v.Minor = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// Request ListSurfaceTypes +// size: 8 +type ListSurfaceTypesCookie struct { + *xgb.Cookie +} + +func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) + return ListSurfaceTypesCookie{cookie} +} + +func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) + return ListSurfaceTypesCookie{cookie} +} + +// Request reply for ListSurfaceTypes +// size: (32 + xgb.Pad((int(Num) * 24))) +type ListSurfaceTypesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Num uint32 + // padding: 20 bytes + Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24)) +} + +// Waits and reads reply data from request ListSurfaceTypes +func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listSurfaceTypesReply(buf), nil +} + +// Read reply into structure from buffer for ListSurfaceTypes +func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply { + v := new(ListSurfaceTypesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Num = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Surfaces = make([]SurfaceInfo, v.Num) + b += SurfaceInfoReadList(buf[b:], v.Surfaces) + + return v +} + +// Write request to wire for ListSurfaceTypes +func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(PortId)) + b += 4 + + return buf +} + +// Request CreateContext +// size: 24 +type CreateContextCookie struct { + *xgb.Cookie +} + +func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) + return CreateContextCookie{cookie} +} + +func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) + return CreateContextCookie{cookie} +} + +// Request reply for CreateContext +// size: (36 + xgb.Pad((int(Length) * 4))) +type CreateContextReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + WidthActual uint16 + HeightActual uint16 + FlagsReturn uint32 + // padding: 20 bytes + PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request CreateContext +func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createContextReply(buf), nil +} + +// Read reply into structure from buffer for CreateContext +func createContextReply(buf []byte) *CreateContextReply { + v := new(CreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.WidthActual = xgb.Get16(buf[b:]) + b += 2 + + v.HeightActual = xgb.Get16(buf[b:]) + b += 2 + + v.FlagsReturn = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for CreateContext +func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextId)) + b += 4 + + xgb.Put32(buf[b:], uint32(PortId)) + b += 4 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], Flags) + b += 4 + + return buf +} + +// Request DestroyContext +// size: 8 +type DestroyContextCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroyContext +func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyContextRequest(c, ContextId), cookie) + return DestroyContextCookie{cookie} +} + +func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyContextRequest(c, ContextId), cookie) + return DestroyContextCookie{cookie} +} + +func (cook DestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyContext +func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + +// Request CreateSurface +// size: 12 +type CreateSurfaceCookie struct { + *xgb.Cookie +} + +func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) + return CreateSurfaceCookie{cookie} +} + +func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) + return CreateSurfaceCookie{cookie} +} + +// Request reply for CreateSurface +// size: (32 + xgb.Pad((int(Length) * 4))) +type CreateSurfaceReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + // padding: 24 bytes + PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request CreateSurface +func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createSurfaceReply(buf), nil +} + +// Read reply into structure from buffer for CreateSurface +func createSurfaceReply(buf []byte) *CreateSurfaceReply { + v := new(CreateSurfaceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for CreateSurface +func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + +// Request DestroySurface +// size: 8 +type DestroySurfaceCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroySurface +func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) + return DestroySurfaceCookie{cookie} +} + +func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) + return DestroySurfaceCookie{cookie} +} + +func (cook DestroySurfaceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroySurface +func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + return buf +} + +// Request CreateSubpicture +// size: 20 +type CreateSubpictureCookie struct { + *xgb.Cookie +} + +func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) + return CreateSubpictureCookie{cookie} +} + +func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) + return CreateSubpictureCookie{cookie} +} + +// Request reply for CreateSubpicture +// size: (32 + xgb.Pad((int(Length) * 4))) +type CreateSubpictureReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + WidthActual uint16 + HeightActual uint16 + NumPaletteEntries uint16 + EntryBytes uint16 + ComponentOrder []byte // size: 4 + // padding: 12 bytes + PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Waits and reads reply data from request CreateSubpicture +func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createSubpictureReply(buf), nil +} + +// Read reply into structure from buffer for CreateSubpicture +func createSubpictureReply(buf []byte) *CreateSubpictureReply { + v := new(CreateSubpictureReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.WidthActual = xgb.Get16(buf[b:]) + b += 2 + + v.HeightActual = xgb.Get16(buf[b:]) + b += 2 + + v.NumPaletteEntries = xgb.Get16(buf[b:]) + b += 2 + + v.EntryBytes = xgb.Get16(buf[b:]) + b += 2 + + v.ComponentOrder = make([]byte, 4) + copy(v.ComponentOrder[:4], buf[b:]) + b += xgb.Pad(int(4)) + + b += 12 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for CreateSubpicture +func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SubpictureId)) + b += 4 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], XvimageId) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// Request DestroySubpicture +// size: 8 +type DestroySubpictureCookie struct { + *xgb.Cookie +} + +// Write request to wire for DestroySubpicture +func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) + return DestroySubpictureCookie{cookie} +} + +func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) + return DestroySubpictureCookie{cookie} +} + +func (cook DestroySubpictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroySubpicture +func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SubpictureId)) + b += 4 + + return buf +} + +// Request ListSubpictureTypes +// size: 12 +type ListSubpictureTypesCookie struct { + *xgb.Cookie +} + +func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) + return ListSubpictureTypesCookie{cookie} +} + +func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) + return ListSubpictureTypesCookie{cookie} +} + +// Request reply for ListSubpictureTypes +// size: (32 + xv.ImageFormatInfoListSize(Types)) +type ListSubpictureTypesReply struct { + Sequence uint16 + Length uint32 + // padding: 1 bytes + Num uint32 + // padding: 20 bytes + Types []xv.ImageFormatInfo // size: xv.ImageFormatInfoListSize(Types) +} + +// Waits and reads reply data from request ListSubpictureTypes +func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listSubpictureTypesReply(buf), nil +} + +// Read reply into structure from buffer for ListSubpictureTypes +func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply { + v := new(ListSubpictureTypesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Num = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Types = make([]xv.ImageFormatInfo, v.Num) + b += xv.ImageFormatInfoReadList(buf[b:], v.Types) + + return v +} + +// Write request to wire for ListSubpictureTypes +func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(PortId)) + b += 4 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + return buf +} From a3363755cdfdafdf02d5a772bd47a462e99af057 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 20:06:22 -0400 Subject: [PATCH 35/90] adding package header comments --- nexgb/bigreq/bigreq.go | 23 ++++++++++++----------- nexgb/composite/composite.go | 3 ++- nexgb/damage/damage.go | 15 ++++++++------- nexgb/dpms/dpms.go | 11 ++++++----- nexgb/dri2/dri2.go | 19 ++++++++++--------- nexgb/ge/ge.go | 27 ++++++++++++++------------- nexgb/glx/glx.go | 7 ++++--- nexgb/randr/randr.go | 7 ++++--- nexgb/record/record.go | 11 ++++++----- nexgb/render/render.go | 11 ++++++----- nexgb/res/res.go | 19 ++++++++++--------- nexgb/screensaver/screensaver.go | 23 ++++++++++++----------- nexgb/shape/shape.go | 19 ++++++++++--------- nexgb/shm/shm.go | 3 ++- nexgb/sync/sync.go | 19 ++++++++++--------- nexgb/xcmisc/xcmisc.go | 7 ++++--- nexgb/xevie/xevie.go | 23 ++++++++++++----------- nexgb/xf86dri/xf86dri.go | 23 ++++++++++++----------- nexgb/xf86vidmode/xf86vidmode.go | 3 ++- nexgb/xfixes/xfixes.go | 23 ++++++++++++----------- nexgb/xgbgen/context.go | 2 ++ nexgb/xinerama/xinerama.go | 19 ++++++++++--------- nexgb/xinput/xinput.go | 15 ++++++++------- nexgb/xprint/xprint.go | 23 ++++++++++++----------- nexgb/xproto/xproto.go | 11 ++++++----- nexgb/xselinux/xselinux.go | 19 ++++++++++--------- nexgb/xtest/xtest.go | 11 ++++++----- nexgb/xv/xv.go | 23 ++++++++++++----------- nexgb/xvmc/xvmc.go | 7 ++++--- 29 files changed, 228 insertions(+), 198 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index 8bb05c1..c2263a0 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -1,7 +1,8 @@ +// Package bigreq is the X client API for the BIG-REQUESTS extension. package bigreq /* - This file was generated by bigreq.xml on May 10 2012 4:20:27pm EDT. + This file was generated by bigreq.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -53,16 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Request Enable // size: 4 type EnableCookie struct { diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index 266c087..5a3d7c4 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -1,7 +1,8 @@ +// Package composite is the X client API for the Composite extension. package composite /* - This file was generated by composite.xml on May 10 2012 4:20:27pm EDT. + This file was generated by composite.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 8fe1e38..8c59f55 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -1,7 +1,8 @@ +// Package damage is the X client API for the DAMAGE extension. package damage /* - This file was generated by damage.xml on May 10 2012 4:20:27pm EDT. + This file was generated by damage.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +41,6 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -64,6 +59,12 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 01314ac..de748e4 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -1,7 +1,8 @@ +// Package dpms is the X client API for the DPMS extension. package dpms /* - This file was generated by dpms.xml on May 10 2012 4:20:27pm EDT. + This file was generated by dpms.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -63,6 +60,10 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + const ( DPMSModeOn = 0 DPMSModeStandby = 1 diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index cffe20e..c875111 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -1,7 +1,8 @@ +// Package dri2 is the X client API for the DRI2 extension. package dri2 /* - This file was generated by dri2.xml on May 10 2012 4:20:27pm EDT. + This file was generated by dri2.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -63,6 +56,14 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 7753e28..5bb11fa 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -1,7 +1,8 @@ +// Package ge is the X client API for the Generic Event Extension extension. package ge /* - This file was generated by ge.xml on May 10 2012 4:20:27pm EDT. + This file was generated by ge.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -63,6 +52,18 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Request QueryVersion // size: 8 type QueryVersionCookie struct { diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 0aa2e55..887d96b 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -1,7 +1,8 @@ +// Package glx is the X client API for the GLX extension. package glx /* - This file was generated by glx.xml on May 10 2012 4:20:27pm EDT. + This file was generated by glx.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -61,8 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - const ( PbcetDamaged = 32791 PbcetSaved = 32792 diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 4d78691..ba8c0f2 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -1,7 +1,8 @@ +// Package randr is the X client API for the RANDR extension. package randr /* - This file was generated by randr.xml on May 10 2012 4:20:27pm EDT. + This file was generated by randr.xml on May 10 2012 8:04:31pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +41,6 @@ func init() { xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -64,6 +63,8 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + const ( RotationRotate0 = 1 RotationRotate90 = 2 diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 04d514b..740353d 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -1,7 +1,8 @@ +// Package record is the X client API for the RECORD extension. package record /* - This file was generated by record.xml on May 10 2012 4:20:28pm EDT. + This file was generated by record.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["RECORD"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -59,10 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - const ( HTypeFromServerTime = 1 HTypeFromClientTime = 2 diff --git a/nexgb/render/render.go b/nexgb/render/render.go index a939ed9..ca3f9bd 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -1,7 +1,8 @@ +// Package render is the X client API for the RENDER extension. package render /* - This file was generated by render.xml on May 10 2012 4:20:28pm EDT. + This file was generated by render.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -59,10 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( PictTypeIndexed = 0 PictTypeDirect = 1 diff --git a/nexgb/res/res.go b/nexgb/res/res.go index aa958ab..e81fa96 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -1,7 +1,8 @@ +// Package res is the X client API for the X-Resource extension. package res /* - This file was generated by res.xml on May 10 2012 4:20:28pm EDT. + This file was generated by res.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["X-Resource"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -55,14 +64,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // 'Client' struct definition // Size: 8 type Client struct { diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index d9353f2..f11113e 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -1,7 +1,8 @@ +// Package screensaver is the X client API for the MIT-SCREEN-SAVER extension. package screensaver /* - This file was generated by screensaver.xml on May 10 2012 4:20:28pm EDT. + This file was generated by screensaver.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -53,16 +64,6 @@ func init() { // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( KindBlanked = 0 KindInternal = 1 diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 5d9dbf3..97be0f7 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -1,7 +1,8 @@ +// Package shape is the X client API for the SHAPE extension. package shape /* - This file was generated by shape.xml on May 10 2012 4:20:28pm EDT. + This file was generated by shape.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -63,6 +56,14 @@ func init() { // Skipping definition for base type 'Char' +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( SoSet = 0 SoUnion = 1 diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index ecffafc..d262667 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -1,7 +1,8 @@ +// Package shm is the X client API for the MIT-SHM extension. package shm /* - This file was generated by shm.xml on May 10 2012 4:20:28pm EDT. + This file was generated by shm.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 689a5c3..cde5cab 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -1,7 +1,8 @@ +// Package sync is the X client API for the SYNC extension. package sync /* - This file was generated by sync.xml on May 10 2012 4:20:28pm EDT. + This file was generated by sync.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -63,6 +56,14 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( AlarmstateActive = 0 AlarmstateInactive = 1 diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 324d455..d4f7b0d 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -1,7 +1,8 @@ +// Package xcmisc is the X client API for the XC-MISC extension. package xcmisc /* - This file was generated by xc_misc.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xc_misc.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["XC-MISC"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -61,8 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - // Request GetVersion // size: 8 type GetVersionCookie struct { diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index c3943f9..47d9146 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -1,7 +1,8 @@ +// Package xevie is the X client API for the XEVIE extension. package xevie /* - This file was generated by xevie.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xevie.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -53,16 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( DatatypeUnmodified = 0 DatatypeModified = 1 diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 0259729..ac87c0a 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -1,7 +1,8 @@ +// Package xf86dri is the X client API for the XFree86-DRI extension. package xf86dri /* - This file was generated by xf86dri.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xf86dri.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +54,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // 'DrmClipRect' struct definition // Size: 8 type DrmClipRect struct { diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 4137df8..d32f601 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -1,7 +1,8 @@ +// Package xf86vidmode is the X client API for the XFree86-VidModeExtension extension. package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xf86vidmode.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 7115e02..3b6bbea 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -1,7 +1,8 @@ +// Package xfixes is the X client API for the XFIXES extension. package xfixes /* - This file was generated by xfixes.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xfixes.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +42,16 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,16 +66,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 67699cf..c40313f 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -51,6 +51,8 @@ func (c *Context) Morph(xmlBytes []byte) { c.protocol = parsedXml.Translate(nil) // Start with Go header. + c.Putln("// Package %s is the X client API for the %s extension.", + c.protocol.PkgName(), c.protocol.ExtXName) c.Putln("package %s", c.protocol.PkgName()) c.Putln("") c.Putln("/*") diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index eb7cd9a..587b628 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -1,7 +1,8 @@ +// Package xinerama is the X client API for the XINERAMA extension. package xinerama /* - This file was generated by xinerama.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xinerama.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,14 +64,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // 'ScreenInfo' struct definition // Size: 8 type ScreenInfo struct { diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 40635f3..cdb0fec 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -1,7 +1,8 @@ +// Package xinput is the X client API for the XInputExtension extension. package xinput /* - This file was generated by xinput.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xinput.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,6 +40,12 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -57,12 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 2fcf49f..0037a22 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -1,7 +1,8 @@ +// Package xprint is the X client API for the XpExtension extension. package xprint /* - This file was generated by xprint.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xprint.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +54,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( GetDocFinished = 0 GetDocSecondConsumer = 1 diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 2516225..39956f1 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -1,7 +1,8 @@ +// Package xproto is the X client API for the extension. package xproto /* - This file was generated by xproto.xml on May 10 2012 4:20:28pm EDT. + This file was generated by xproto.xml on May 10 2012 8:04:32pm EDT. This file is automatically generated. Edit at your peril! */ @@ -22,10 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -46,6 +43,10 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 4675e90..cb0532f 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -1,7 +1,8 @@ +// Package xselinux is the X client API for the SELinux extension. package xselinux /* - This file was generated by xselinux.xml on May 10 2012 4:20:29pm EDT. + This file was generated by xselinux.xml on May 10 2012 8:04:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +56,14 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // 'ListItem' struct definition // Size: ((12 + xgb.Pad((int(ObjectContextLen) * 1))) + xgb.Pad((int(DataContextLen) * 1))) type ListItem struct { diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index e035fe5..357b325 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -1,7 +1,8 @@ +// Package xtest is the X client API for the XTEST extension. package xtest /* - This file was generated by xtest.xml on May 10 2012 4:20:29pm EDT. + This file was generated by xtest.xml on May 10 2012 8:04:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -39,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -63,6 +60,10 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( CursorNone = 0 CursorCurrent = 1 diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 8faaf83..4e495cf 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -1,7 +1,8 @@ +// Package xv is the X client API for the XVideo extension. package xv /* - This file was generated by xv.xml on May 10 2012 4:20:29pm EDT. + This file was generated by xv.xml on May 10 2012 8:04:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +55,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( TypeInputMask = 1 TypeOutputMask = 2 diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 8878acf..60fcb2e 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -1,7 +1,8 @@ +// Package xvmc is the X client API for the XVideo-MotionCompensation extension. package xvmc /* - This file was generated by xvmc.xml on May 10 2012 4:20:29pm EDT. + This file was generated by xvmc.xml on May 10 2012 8:04:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +63,8 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { From c00652934e4ec68016a152b9bea10273b0be8726 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 23:57:34 -0400 Subject: [PATCH 36/90] better docs --- nexgb/bigreq/bigreq.go | 25 +- nexgb/composite/composite.go | 137 +- nexgb/damage/damage.go | 89 +- nexgb/dpms/dpms.go | 138 +- nexgb/dri2/dri2.go | 289 ++-- nexgb/ge/ge.go | 29 +- nexgb/glx/glx.go | 1778 ++++++++++++--------- nexgb/randr/randr.go | 632 ++++---- nexgb/record/record.go | 176 ++- nexgb/render/render.go | 597 ++++--- nexgb/res/res.go | 98 +- nexgb/screensaver/screensaver.go | 106 +- nexgb/shape/shape.go | 147 +- nexgb/shm/shm.go | 110 +- nexgb/sync/sync.go | 368 +++-- nexgb/xcmisc/xcmisc.go | 59 +- nexgb/xevie/xevie.go | 127 +- nexgb/xf86dri/xf86dri.go | 240 +-- nexgb/xf86vidmode/xf86vidmode.go | 425 ++--- nexgb/xfixes/xfixes.go | 441 ++++-- nexgb/xgb.go | 2 - nexgb/xgbgen/go_error.go | 22 +- nexgb/xgbgen/go_event.go | 29 +- nexgb/xgbgen/go_request_reply.go | 37 +- nexgb/xgbgen/go_struct.go | 17 +- nexgb/xgbgen/go_union.go | 20 +- nexgb/xinerama/xinerama.go | 126 +- nexgb/xinput/xinput.go | 1169 +++++++------- nexgb/xprint/xprint.go | 437 +++--- nexgb/xproto/xproto.go | 2476 ++++++++++++++++++------------ nexgb/xselinux/xselinux.go | 395 +++-- nexgb/xtest/xtest.go | 62 +- nexgb/xv/xv.go | 440 +++--- nexgb/xvmc/xvmc.go | 179 ++- 34 files changed, 6734 insertions(+), 4688 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index c2263a0..3913c5f 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on May 10 2012 8:04:31pm EDT. + This file was generated by bigreq.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -62,36 +64,36 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Request Enable -// size: 4 +// EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie } +// Enable sends a checked request. +// If an error occurs, it will be returned with the reply by calling EnableCookie.Reply() func Enable(c *xgb.Conn) EnableCookie { cookie := c.NewCookie(true, true) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} } +// EnableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableUnchecked(c *xgb.Conn) EnableCookie { cookie := c.NewCookie(false, true) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} } -// Request reply for Enable -// size: 12 +// EnableReply represents the data returned from a Enable request. type EnableReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MaximumRequestLength uint32 } -// Waits and reads reply data from request Enable +// Reply blocks and returns the reply data for a Enable request. func (cook EnableCookie) Reply() (*EnableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -103,7 +105,7 @@ func (cook EnableCookie) Reply() (*EnableReply, error) { return enableReply(buf), nil } -// Read reply into structure from buffer for Enable +// enableReply reads a byte slice into a EnableReply value. func enableReply(buf []byte) *EnableReply { v := new(EnableReply) b := 1 // skip reply determinant @@ -123,6 +125,7 @@ func enableReply(buf []byte) *EnableReply { } // Write request to wire for Enable +// enableRequest writes a Enable request to a byte slice. func enableRequest(c *xgb.Conn) []byte { size := 4 b := 0 diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index 5a3d7c4..be56807 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on May 10 2012 8:04:31pm EDT. + This file was generated by composite.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,16 +41,6 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -65,41 +55,53 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( RedirectAutomatic = 0 RedirectManual = 1 ) -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -111,7 +113,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -136,6 +138,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { size := 12 b := 0 @@ -159,30 +162,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers return buf } -// Request RedirectWindow -// size: 12 +// RedirectWindowCookie is a cookie used only for RedirectWindow requests. type RedirectWindowCookie struct { *xgb.Cookie } -// Write request to wire for RedirectWindow +// RedirectWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) return RedirectWindowCookie{cookie} } +// RedirectWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using RedirectWindowCookie.Check() func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) return RedirectWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RedirectWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RedirectWindow +// redirectWindowRequest writes a RedirectWindow request to a byte slice. func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { size := 12 b := 0 @@ -208,30 +216,35 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt return buf } -// Request RedirectSubwindows -// size: 12 +// RedirectSubwindowsCookie is a cookie used only for RedirectSubwindows requests. type RedirectSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for RedirectSubwindows +// RedirectSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) return RedirectSubwindowsCookie{cookie} } +// RedirectSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) return RedirectSubwindowsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RedirectSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RedirectSubwindows +// redirectSubwindowsRequest writes a RedirectSubwindows request to a byte slice. func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { size := 12 b := 0 @@ -257,30 +270,35 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [ return buf } -// Request UnredirectWindow -// size: 12 +// UnredirectWindowCookie is a cookie used only for UnredirectWindow requests. type UnredirectWindowCookie struct { *xgb.Cookie } -// Write request to wire for UnredirectWindow +// UnredirectWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) return UnredirectWindowCookie{cookie} } +// UnredirectWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using UnredirectWindowCookie.Check() func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) return UnredirectWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnredirectWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnredirectWindow +// unredirectWindowRequest writes a UnredirectWindow request to a byte slice. func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { size := 12 b := 0 @@ -306,30 +324,35 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b return buf } -// Request UnredirectSubwindows -// size: 12 +// UnredirectSubwindowsCookie is a cookie used only for UnredirectSubwindows requests. type UnredirectSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for UnredirectSubwindows +// UnredirectSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) return UnredirectSubwindowsCookie{cookie} } +// UnredirectSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) return UnredirectSubwindowsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnredirectSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnredirectSubwindows +// unredirectSubwindowsRequest writes a UnredirectSubwindows request to a byte slice. func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { size := 12 b := 0 @@ -355,30 +378,35 @@ func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) return buf } -// Request CreateRegionFromBorderClip -// size: 12 +// CreateRegionFromBorderClipCookie is a cookie used only for CreateRegionFromBorderClip requests. type CreateRegionFromBorderClipCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegionFromBorderClip +// CreateRegionFromBorderClip sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) return CreateRegionFromBorderClipCookie{cookie} } +// CreateRegionFromBorderClipChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) return CreateRegionFromBorderClipCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionFromBorderClipCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegionFromBorderClip +// createRegionFromBorderClipRequest writes a CreateRegionFromBorderClip request to a byte slice. func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte { size := 12 b := 0 @@ -402,30 +430,35 @@ func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window return buf } -// Request NameWindowPixmap -// size: 12 +// NameWindowPixmapCookie is a cookie used only for NameWindowPixmap requests. type NameWindowPixmapCookie struct { *xgb.Cookie } -// Write request to wire for NameWindowPixmap +// NameWindowPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) return NameWindowPixmapCookie{cookie} } +// NameWindowPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) return NameWindowPixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook NameWindowPixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for NameWindowPixmap +// nameWindowPixmapRequest writes a NameWindowPixmap request to a byte slice. func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte { size := 12 b := 0 @@ -449,35 +482,37 @@ func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pi return buf } -// Request GetOverlayWindow -// size: 8 +// GetOverlayWindowCookie is a cookie used only for GetOverlayWindow requests. type GetOverlayWindowCookie struct { *xgb.Cookie } +// GetOverlayWindow sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { cookie := c.NewCookie(true, true) c.NewRequest(getOverlayWindowRequest(c, Window), cookie) return GetOverlayWindowCookie{cookie} } +// GetOverlayWindowUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { cookie := c.NewCookie(false, true) c.NewRequest(getOverlayWindowRequest(c, Window), cookie) return GetOverlayWindowCookie{cookie} } -// Request reply for GetOverlayWindow -// size: 32 +// GetOverlayWindowReply represents the data returned from a GetOverlayWindow request. type GetOverlayWindowReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes OverlayWin xproto.Window // padding: 20 bytes } -// Waits and reads reply data from request GetOverlayWindow +// Reply blocks and returns the reply data for a GetOverlayWindow request. func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -489,7 +524,7 @@ func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) { return getOverlayWindowReply(buf), nil } -// Read reply into structure from buffer for GetOverlayWindow +// getOverlayWindowReply reads a byte slice into a GetOverlayWindowReply value. func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply { v := new(GetOverlayWindowReply) b := 1 // skip reply determinant @@ -511,6 +546,7 @@ func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply { } // Write request to wire for GetOverlayWindow +// getOverlayWindowRequest writes a GetOverlayWindow request to a byte slice. func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -531,30 +567,35 @@ func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request ReleaseOverlayWindow -// size: 8 +// ReleaseOverlayWindowCookie is a cookie used only for ReleaseOverlayWindow requests. type ReleaseOverlayWindowCookie struct { *xgb.Cookie } -// Write request to wire for ReleaseOverlayWindow +// ReleaseOverlayWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) return ReleaseOverlayWindowCookie{cookie} } +// ReleaseOverlayWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) return ReleaseOverlayWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ReleaseOverlayWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ReleaseOverlayWindow +// releaseOverlayWindowRequest writes a ReleaseOverlayWindow request to a byte slice. func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 8c59f55..1c17501 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on May 10 2012 8:04:31pm EDT. + This file was generated by damage.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -82,9 +82,7 @@ func NewDamageId(c *xgb.Conn) (Damage, error) { return Damage(id), nil } -// Event definition Notify (0) -// Size: 32 - +// Notify is the event number for a NotifyEvent. const Notify = 0 type NotifyEvent struct { @@ -97,7 +95,7 @@ type NotifyEvent struct { Geometry xproto.Rectangle } -// Event read Notify +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number @@ -126,7 +124,7 @@ func NotifyEventNew(buf []byte) xgb.Event { return v } -// Event write Notify +// Bytes writes a NotifyEvent value to a byte slice. func (v NotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -164,12 +162,14 @@ func (v NotifyEvent) Bytes() []byte { return buf } -func (v NotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -184,9 +184,7 @@ func init() { xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew } -// Error definition BadDamage (0) -// Size: 32 - +// BadBadDamage is the error number for a BadBadDamage. const BadBadDamage = 0 type BadDamageError struct { @@ -194,7 +192,7 @@ type BadDamageError struct { NiceName string } -// Error read BadDamage +// BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice. func BadDamageErrorNew(buf []byte) xgb.Error { v := BadDamageError{} v.NiceName = "BadDamage" @@ -208,8 +206,8 @@ func BadDamageErrorNew(buf []byte) xgb.Error { return v } -func (err BadDamageError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadDamage error. +// This is mostly used internally. func (err BadDamageError) SequenceId() uint16 { return err.Sequence } @@ -229,36 +227,38 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -270,7 +270,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -295,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { size := 12 b := 0 @@ -318,30 +319,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers return buf } -// Request Create -// size: 16 +// CreateCookie is a cookie used only for Create requests. type CreateCookie struct { *xgb.Cookie } -// Write request to wire for Create +// Create sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) return CreateCookie{cookie} } +// CreateChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCookie.Check() func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) return CreateCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Create +// createRequest writes a Create request to a byte slice. func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) []byte { size := 16 b := 0 @@ -370,30 +376,35 @@ func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level b return buf } -// Request Destroy -// size: 8 +// DestroyCookie is a cookie used only for Destroy requests. type DestroyCookie struct { *xgb.Cookie } -// Write request to wire for Destroy +// Destroy sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyRequest(c, Damage), cookie) return DestroyCookie{cookie} } +// DestroyChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyCookie.Check() func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyRequest(c, Damage), cookie) return DestroyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Destroy +// destroyRequest writes a Destroy request to a byte slice. func destroyRequest(c *xgb.Conn, Damage Damage) []byte { size := 8 b := 0 @@ -414,30 +425,35 @@ func destroyRequest(c *xgb.Conn, Damage Damage) []byte { return buf } -// Request Subtract -// size: 16 +// SubtractCookie is a cookie used only for Subtract requests. type SubtractCookie struct { *xgb.Cookie } -// Write request to wire for Subtract +// Subtract sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { cookie := c.NewCookie(false, false) c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) return SubtractCookie{cookie} } +// SubtractChecked sends a checked request. +// If an error occurs, it can be retrieved using SubtractCookie.Check() func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { cookie := c.NewCookie(true, false) c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) return SubtractCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SubtractCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Subtract +// subtractRequest writes a Subtract request to a byte slice. func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) []byte { size := 16 b := 0 @@ -464,30 +480,35 @@ func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfi return buf } -// Request Add -// size: 12 +// AddCookie is a cookie used only for Add requests. type AddCookie struct { *xgb.Cookie } -// Write request to wire for Add +// Add sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { cookie := c.NewCookie(false, false) c.NewRequest(addRequest(c, Drawable, Region), cookie) return AddCookie{cookie} } +// AddChecked sends a checked request. +// If an error occurs, it can be retrieved using AddCookie.Check() func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { cookie := c.NewCookie(true, false) c.NewRequest(addRequest(c, Drawable, Region), cookie) return AddCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AddCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Add +// addRequest writes a Add request to a byte slice. func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte { size := 12 b := 0 diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index de748e4..e3e095a 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on May 10 2012 8:04:31pm EDT. + This file was generated by dpms.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - const ( DPMSModeOn = 0 DPMSModeStandby = 1 @@ -71,35 +71,37 @@ const ( DPMSModeOff = 3 ) -// Request GetVersion -// size: 8 +// GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { *xgb.Cookie } +// GetVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} } +// GetVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} } -// Request reply for GetVersion -// size: 12 +// GetVersionReply represents the data returned from a GetVersion request. type GetVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajorVersion uint16 ServerMinorVersion uint16 } -// Waits and reads reply data from request GetVersion +// Reply blocks and returns the reply data for a GetVersion request. func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -111,7 +113,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { return getVersionReply(buf), nil } -// Read reply into structure from buffer for GetVersion +// getVersionReply reads a byte slice into a GetVersionReply value. func getVersionReply(buf []byte) *GetVersionReply { v := new(GetVersionReply) b := 1 // skip reply determinant @@ -134,6 +136,7 @@ func getVersionReply(buf []byte) *GetVersionReply { } // Write request to wire for GetVersion +// getVersionRequest writes a GetVersion request to a byte slice. func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { size := 8 b := 0 @@ -157,35 +160,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio return buf } -// Request Capable -// size: 4 +// CapableCookie is a cookie used only for Capable requests. type CapableCookie struct { *xgb.Cookie } +// Capable sends a checked request. +// If an error occurs, it will be returned with the reply by calling CapableCookie.Reply() func Capable(c *xgb.Conn) CapableCookie { cookie := c.NewCookie(true, true) c.NewRequest(capableRequest(c), cookie) return CapableCookie{cookie} } +// CapableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CapableUnchecked(c *xgb.Conn) CapableCookie { cookie := c.NewCookie(false, true) c.NewRequest(capableRequest(c), cookie) return CapableCookie{cookie} } -// Request reply for Capable -// size: 32 +// CapableReply represents the data returned from a Capable request. type CapableReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Capable bool // padding: 23 bytes } -// Waits and reads reply data from request Capable +// Reply blocks and returns the reply data for a Capable request. func (cook CapableCookie) Reply() (*CapableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -197,7 +202,7 @@ func (cook CapableCookie) Reply() (*CapableReply, error) { return capableReply(buf), nil } -// Read reply into structure from buffer for Capable +// capableReply reads a byte slice into a CapableReply value. func capableReply(buf []byte) *CapableReply { v := new(CapableReply) b := 1 // skip reply determinant @@ -223,6 +228,7 @@ func capableReply(buf []byte) *CapableReply { } // Write request to wire for Capable +// capableRequest writes a Capable request to a byte slice. func capableRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -240,29 +246,31 @@ func capableRequest(c *xgb.Conn) []byte { return buf } -// Request GetTimeouts -// size: 4 +// GetTimeoutsCookie is a cookie used only for GetTimeouts requests. type GetTimeoutsCookie struct { *xgb.Cookie } +// GetTimeouts sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTimeoutsCookie.Reply() func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTimeoutsRequest(c), cookie) return GetTimeoutsCookie{cookie} } +// GetTimeoutsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTimeoutsRequest(c), cookie) return GetTimeoutsCookie{cookie} } -// Request reply for GetTimeouts -// size: 32 +// GetTimeoutsReply represents the data returned from a GetTimeouts request. type GetTimeoutsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes StandbyTimeout uint16 SuspendTimeout uint16 @@ -270,7 +278,7 @@ type GetTimeoutsReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetTimeouts +// Reply blocks and returns the reply data for a GetTimeouts request. func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -282,7 +290,7 @@ func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) { return getTimeoutsReply(buf), nil } -// Read reply into structure from buffer for GetTimeouts +// getTimeoutsReply reads a byte slice into a GetTimeoutsReply value. func getTimeoutsReply(buf []byte) *GetTimeoutsReply { v := new(GetTimeoutsReply) b := 1 // skip reply determinant @@ -310,6 +318,7 @@ func getTimeoutsReply(buf []byte) *GetTimeoutsReply { } // Write request to wire for GetTimeouts +// getTimeoutsRequest writes a GetTimeouts request to a byte slice. func getTimeoutsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -327,30 +336,35 @@ func getTimeoutsRequest(c *xgb.Conn) []byte { return buf } -// Request SetTimeouts -// size: 12 +// SetTimeoutsCookie is a cookie used only for SetTimeouts requests. type SetTimeoutsCookie struct { *xgb.Cookie } -// Write request to wire for SetTimeouts +// SetTimeouts sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { cookie := c.NewCookie(false, false) c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) return SetTimeoutsCookie{cookie} } +// SetTimeoutsChecked sends a checked request. +// If an error occurs, it can be retrieved using SetTimeoutsCookie.Check() func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { cookie := c.NewCookie(true, false) c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) return SetTimeoutsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetTimeoutsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetTimeouts +// setTimeoutsRequest writes a SetTimeouts request to a byte slice. func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { size := 12 b := 0 @@ -377,30 +391,35 @@ func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint1 return buf } -// Request Enable -// size: 4 +// EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie } -// Write request to wire for Enable +// Enable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Enable(c *xgb.Conn) EnableCookie { cookie := c.NewCookie(false, false) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} } +// EnableChecked sends a checked request. +// If an error occurs, it can be retrieved using EnableCookie.Check() func EnableChecked(c *xgb.Conn) EnableCookie { cookie := c.NewCookie(true, false) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook EnableCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Enable +// enableRequest writes a Enable request to a byte slice. func enableRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -418,30 +437,35 @@ func enableRequest(c *xgb.Conn) []byte { return buf } -// Request Disable -// size: 4 +// DisableCookie is a cookie used only for Disable requests. type DisableCookie struct { *xgb.Cookie } -// Write request to wire for Disable +// Disable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Disable(c *xgb.Conn) DisableCookie { cookie := c.NewCookie(false, false) c.NewRequest(disableRequest(c), cookie) return DisableCookie{cookie} } +// DisableChecked sends a checked request. +// If an error occurs, it can be retrieved using DisableCookie.Check() func DisableChecked(c *xgb.Conn) DisableCookie { cookie := c.NewCookie(true, false) c.NewRequest(disableRequest(c), cookie) return DisableCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DisableCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Disable +// disableRequest writes a Disable request to a byte slice. func disableRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -459,30 +483,35 @@ func disableRequest(c *xgb.Conn) []byte { return buf } -// Request ForceLevel -// size: 8 +// ForceLevelCookie is a cookie used only for ForceLevel requests. type ForceLevelCookie struct { *xgb.Cookie } -// Write request to wire for ForceLevel +// ForceLevel sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { cookie := c.NewCookie(false, false) c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) return ForceLevelCookie{cookie} } +// ForceLevelChecked sends a checked request. +// If an error occurs, it can be retrieved using ForceLevelCookie.Check() func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { cookie := c.NewCookie(true, false) c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) return ForceLevelCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ForceLevelCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ForceLevel +// forceLevelRequest writes a ForceLevel request to a byte slice. func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { size := 8 b := 0 @@ -503,36 +532,38 @@ func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { return buf } -// Request Info -// size: 4 +// InfoCookie is a cookie used only for Info requests. type InfoCookie struct { *xgb.Cookie } +// Info sends a checked request. +// If an error occurs, it will be returned with the reply by calling InfoCookie.Reply() func Info(c *xgb.Conn) InfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(infoRequest(c), cookie) return InfoCookie{cookie} } +// InfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InfoUnchecked(c *xgb.Conn) InfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(infoRequest(c), cookie) return InfoCookie{cookie} } -// Request reply for Info -// size: 32 +// InfoReply represents the data returned from a Info request. type InfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PowerLevel uint16 State bool // padding: 21 bytes } -// Waits and reads reply data from request Info +// Reply blocks and returns the reply data for a Info request. func (cook InfoCookie) Reply() (*InfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -544,7 +575,7 @@ func (cook InfoCookie) Reply() (*InfoReply, error) { return infoReply(buf), nil } -// Read reply into structure from buffer for Info +// infoReply reads a byte slice into a InfoReply value. func infoReply(buf []byte) *InfoReply { v := new(InfoReply) b := 1 // skip reply determinant @@ -573,6 +604,7 @@ func infoReply(buf []byte) *InfoReply { } // Write request to wire for Info +// infoRequest writes a Info request to a byte slice. func infoRequest(c *xgb.Conn) []byte { size := 4 b := 0 diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index c875111..b6398e1 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on May 10 2012 8:04:31pm EDT. + This file was generated by dri2.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 @@ -89,8 +89,6 @@ const ( EventTypeFlipComplete = 3 ) -// 'DRI2Buffer' struct definition -// Size: 20 type DRI2Buffer struct { Attachment uint32 Name uint32 @@ -99,7 +97,7 @@ type DRI2Buffer struct { Flags uint32 } -// Struct read DRI2Buffer +// DRI2BufferRead reads a byte slice into a DRI2Buffer value. func DRI2BufferRead(buf []byte, v *DRI2Buffer) int { b := 0 @@ -121,7 +119,7 @@ func DRI2BufferRead(buf []byte, v *DRI2Buffer) int { return b } -// Struct list read DRI2Buffer +// DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values. func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int { b := 0 for i := 0; i < len(dest); i++ { @@ -131,7 +129,7 @@ func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int { return xgb.Pad(b) } -// Struct write DRI2Buffer +// Bytes writes a DRI2Buffer value to a byte slice. func (v DRI2Buffer) Bytes() []byte { buf := make([]byte, 20) b := 0 @@ -154,7 +152,7 @@ func (v DRI2Buffer) Bytes() []byte { return buf } -// Write struct list DRI2Buffer +// DRI2BufferListBytes writes a list of %s(MISSING) values to a byte slice. func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { b := 0 var structBytes []byte @@ -166,14 +164,12 @@ func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { return b } -// 'AttachFormat' struct definition -// Size: 8 type AttachFormat struct { Attachment uint32 Format uint32 } -// Struct read AttachFormat +// AttachFormatRead reads a byte slice into a AttachFormat value. func AttachFormatRead(buf []byte, v *AttachFormat) int { b := 0 @@ -186,7 +182,7 @@ func AttachFormatRead(buf []byte, v *AttachFormat) int { return b } -// Struct list read AttachFormat +// AttachFormatReadList reads a byte slice into a list of AttachFormat values. func AttachFormatReadList(buf []byte, dest []AttachFormat) int { b := 0 for i := 0; i < len(dest); i++ { @@ -196,7 +192,7 @@ func AttachFormatReadList(buf []byte, dest []AttachFormat) int { return xgb.Pad(b) } -// Struct write AttachFormat +// Bytes writes a AttachFormat value to a byte slice. func (v AttachFormat) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -210,7 +206,7 @@ func (v AttachFormat) Bytes() []byte { return buf } -// Write struct list AttachFormat +// AttachFormatListBytes writes a list of %s(MISSING) values to a byte slice. func AttachFormatListBytes(buf []byte, list []AttachFormat) int { b := 0 var structBytes []byte @@ -222,9 +218,7 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int { return b } -// Event definition BufferSwapComplete (0) -// Size: 32 - +// BufferSwapComplete is the event number for a BufferSwapCompleteEvent. const BufferSwapComplete = 0 type BufferSwapCompleteEvent struct { @@ -240,7 +234,7 @@ type BufferSwapCompleteEvent struct { Sbc uint32 } -// Event read BufferSwapComplete +// BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice. func BufferSwapCompleteEventNew(buf []byte) xgb.Event { v := BufferSwapCompleteEvent{} b := 1 // don't read event number @@ -276,7 +270,7 @@ func BufferSwapCompleteEventNew(buf []byte) xgb.Event { return v } -// Event write BufferSwapComplete +// Bytes writes a BufferSwapCompleteEvent value to a byte slice. func (v BufferSwapCompleteEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -315,12 +309,14 @@ func (v BufferSwapCompleteEvent) Bytes() []byte { return buf } -func (v BufferSwapCompleteEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the BufferSwapComplete event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v BufferSwapCompleteEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of BufferSwapCompleteEvent. func (v BufferSwapCompleteEvent) String() string { fieldVals := make([]string, 0, 9) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -338,9 +334,7 @@ func init() { xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew } -// Event definition InvalidateBuffers (1) -// Size: 32 - +// InvalidateBuffers is the event number for a InvalidateBuffersEvent. const InvalidateBuffers = 1 type InvalidateBuffersEvent struct { @@ -349,7 +343,7 @@ type InvalidateBuffersEvent struct { Drawable xproto.Drawable } -// Event read InvalidateBuffers +// InvalidateBuffersEventNew constructs a InvalidateBuffersEvent value that implements xgb.Event from a byte slice. func InvalidateBuffersEventNew(buf []byte) xgb.Event { v := InvalidateBuffersEvent{} b := 1 // don't read event number @@ -365,7 +359,7 @@ func InvalidateBuffersEventNew(buf []byte) xgb.Event { return v } -// Event write InvalidateBuffers +// Bytes writes a InvalidateBuffersEvent value to a byte slice. func (v InvalidateBuffersEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -384,12 +378,14 @@ func (v InvalidateBuffersEvent) Bytes() []byte { return buf } -func (v InvalidateBuffersEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the InvalidateBuffers event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v InvalidateBuffersEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of InvalidateBuffersEvent. func (v InvalidateBuffersEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -401,35 +397,37 @@ func init() { xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 16 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -441,7 +439,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -464,6 +462,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { size := 12 b := 0 @@ -487,29 +486,31 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) return buf } -// Request Connect -// size: 12 +// ConnectCookie is a cookie used only for Connect requests. type ConnectCookie struct { *xgb.Cookie } +// Connect sends a checked request. +// If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply() func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { cookie := c.NewCookie(true, true) c.NewRequest(connectRequest(c, Window, DriverType), cookie) return ConnectCookie{cookie} } +// ConnectUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { cookie := c.NewCookie(false, true) c.NewRequest(connectRequest(c, Window, DriverType), cookie) return ConnectCookie{cookie} } -// Request reply for Connect -// size: (((32 + xgb.Pad((int(DriverNameLength) * 1))) + xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + xgb.Pad((int(DeviceNameLength) * 1))) +// ConnectReply represents the data returned from a Connect request. type ConnectReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes DriverNameLength uint32 DeviceNameLength uint32 @@ -519,7 +520,7 @@ type ConnectReply struct { DeviceName string // size: xgb.Pad((int(DeviceNameLength) * 1)) } -// Waits and reads reply data from request Connect +// Reply blocks and returns the reply data for a Connect request. func (cook ConnectCookie) Reply() (*ConnectReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -531,7 +532,7 @@ func (cook ConnectCookie) Reply() (*ConnectReply, error) { return connectReply(buf), nil } -// Read reply into structure from buffer for Connect +// connectReply reads a byte slice into a ConnectReply value. func connectReply(buf []byte) *ConnectReply { v := new(ConnectReply) b := 1 // skip reply determinant @@ -574,6 +575,7 @@ func connectReply(buf []byte) *ConnectReply { } // Write request to wire for Connect +// connectRequest writes a Connect request to a byte slice. func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte { size := 12 b := 0 @@ -597,34 +599,36 @@ func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte return buf } -// Request Authenticate -// size: 12 +// AuthenticateCookie is a cookie used only for Authenticate requests. type AuthenticateCookie struct { *xgb.Cookie } +// Authenticate sends a checked request. +// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply() func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { cookie := c.NewCookie(true, true) c.NewRequest(authenticateRequest(c, Window, Magic), cookie) return AuthenticateCookie{cookie} } +// AuthenticateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { cookie := c.NewCookie(false, true) c.NewRequest(authenticateRequest(c, Window, Magic), cookie) return AuthenticateCookie{cookie} } -// Request reply for Authenticate -// size: 12 +// AuthenticateReply represents the data returned from a Authenticate request. type AuthenticateReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Authenticated uint32 } -// Waits and reads reply data from request Authenticate +// Reply blocks and returns the reply data for a Authenticate request. func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -636,7 +640,7 @@ func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { return authenticateReply(buf), nil } -// Read reply into structure from buffer for Authenticate +// authenticateReply reads a byte slice into a AuthenticateReply value. func authenticateReply(buf []byte) *AuthenticateReply { v := new(AuthenticateReply) b := 1 // skip reply determinant @@ -656,6 +660,7 @@ func authenticateReply(buf []byte) *AuthenticateReply { } // Write request to wire for Authenticate +// authenticateRequest writes a Authenticate request to a byte slice. func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte { size := 12 b := 0 @@ -679,30 +684,35 @@ func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte return buf } -// Request CreateDrawable -// size: 8 +// CreateDrawableCookie is a cookie used only for CreateDrawable requests. type CreateDrawableCookie struct { *xgb.Cookie } -// Write request to wire for CreateDrawable +// CreateDrawable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { cookie := c.NewCookie(false, false) c.NewRequest(createDrawableRequest(c, Drawable), cookie) return CreateDrawableCookie{cookie} } +// CreateDrawableChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateDrawableCookie.Check() func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { cookie := c.NewCookie(true, false) c.NewRequest(createDrawableRequest(c, Drawable), cookie) return CreateDrawableCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateDrawableCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateDrawable +// createDrawableRequest writes a CreateDrawable request to a byte slice. func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -723,30 +733,35 @@ func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request DestroyDrawable -// size: 8 +// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests. type DestroyDrawableCookie struct { *xgb.Cookie } -// Write request to wire for DestroyDrawable +// DestroyDrawable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) return DestroyDrawableCookie{cookie} } +// DestroyDrawableChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) return DestroyDrawableCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyDrawableCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyDrawable +// destroyDrawableRequest writes a DestroyDrawable request to a byte slice. func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -767,29 +782,31 @@ func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request GetBuffers -// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 4)))) +// GetBuffersCookie is a cookie used only for GetBuffers requests. type GetBuffersCookie struct { *xgb.Cookie } +// GetBuffers sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply() func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { cookie := c.NewCookie(true, true) c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersCookie{cookie} } +// GetBuffersUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { cookie := c.NewCookie(false, true) c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersCookie{cookie} } -// Request reply for GetBuffers -// size: (32 + xgb.Pad((int(Count) * 20))) +// GetBuffersReply represents the data returned from a GetBuffers request. type GetBuffersReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint32 Height uint32 @@ -798,7 +815,7 @@ type GetBuffersReply struct { Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20)) } -// Waits and reads reply data from request GetBuffers +// Reply blocks and returns the reply data for a GetBuffers request. func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -810,7 +827,7 @@ func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) { return getBuffersReply(buf), nil } -// Read reply into structure from buffer for GetBuffers +// getBuffersReply reads a byte slice into a GetBuffersReply value. func getBuffersReply(buf []byte) *GetBuffersReply { v := new(GetBuffersReply) b := 1 // skip reply determinant @@ -841,6 +858,7 @@ func getBuffersReply(buf []byte) *GetBuffersReply { } // Write request to wire for GetBuffers +// getBuffersRequest writes a GetBuffers request to a byte slice. func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4)))) b := 0 @@ -870,33 +888,35 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta return buf } -// Request CopyRegion -// size: 20 +// CopyRegionCookie is a cookie used only for CopyRegion requests. type CopyRegionCookie struct { *xgb.Cookie } +// CopyRegion sends a checked request. +// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply() func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { cookie := c.NewCookie(true, true) c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) return CopyRegionCookie{cookie} } +// CopyRegionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { cookie := c.NewCookie(false, true) c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) return CopyRegionCookie{cookie} } -// Request reply for CopyRegion -// size: 8 +// CopyRegionReply represents the data returned from a CopyRegion request. type CopyRegionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes } -// Waits and reads reply data from request CopyRegion +// Reply blocks and returns the reply data for a CopyRegion request. func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -908,7 +928,7 @@ func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) { return copyRegionReply(buf), nil } -// Read reply into structure from buffer for CopyRegion +// copyRegionReply reads a byte slice into a CopyRegionReply value. func copyRegionReply(buf []byte) *CopyRegionReply { v := new(CopyRegionReply) b := 1 // skip reply determinant @@ -925,6 +945,7 @@ func copyRegionReply(buf []byte) *CopyRegionReply { } // Write request to wire for CopyRegion +// copyRegionRequest writes a CopyRegion request to a byte slice. func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte { size := 20 b := 0 @@ -954,29 +975,31 @@ func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Des return buf } -// Request GetBuffersWithFormat -// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 8)))) +// GetBuffersWithFormatCookie is a cookie used only for GetBuffersWithFormat requests. type GetBuffersWithFormatCookie struct { *xgb.Cookie } +// GetBuffersWithFormat sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply() func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { cookie := c.NewCookie(true, true) c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersWithFormatCookie{cookie} } +// GetBuffersWithFormatUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { cookie := c.NewCookie(false, true) c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersWithFormatCookie{cookie} } -// Request reply for GetBuffersWithFormat -// size: (32 + xgb.Pad((int(Count) * 20))) +// GetBuffersWithFormatReply represents the data returned from a GetBuffersWithFormat request. type GetBuffersWithFormatReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint32 Height uint32 @@ -985,7 +1008,7 @@ type GetBuffersWithFormatReply struct { Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20)) } -// Waits and reads reply data from request GetBuffersWithFormat +// Reply blocks and returns the reply data for a GetBuffersWithFormat request. func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -997,7 +1020,7 @@ func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, erro return getBuffersWithFormatReply(buf), nil } -// Read reply into structure from buffer for GetBuffersWithFormat +// getBuffersWithFormatReply reads a byte slice into a GetBuffersWithFormatReply value. func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply { v := new(GetBuffersWithFormatReply) b := 1 // skip reply determinant @@ -1028,6 +1051,7 @@ func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply { } // Write request to wire for GetBuffersWithFormat +// getBuffersWithFormatRequest writes a GetBuffersWithFormat request to a byte slice. func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) []byte { size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8)))) b := 0 @@ -1053,35 +1077,37 @@ func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count ui return buf } -// Request SwapBuffers -// size: 32 +// SwapBuffersCookie is a cookie used only for SwapBuffers requests. type SwapBuffersCookie struct { *xgb.Cookie } +// SwapBuffers sends a checked request. +// If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply() func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { cookie := c.NewCookie(true, true) c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return SwapBuffersCookie{cookie} } +// SwapBuffersUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { cookie := c.NewCookie(false, true) c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return SwapBuffersCookie{cookie} } -// Request reply for SwapBuffers -// size: 16 +// SwapBuffersReply represents the data returned from a SwapBuffers request. type SwapBuffersReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes SwapHi uint32 SwapLo uint32 } -// Waits and reads reply data from request SwapBuffers +// Reply blocks and returns the reply data for a SwapBuffers request. func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1093,7 +1119,7 @@ func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) { return swapBuffersReply(buf), nil } -// Read reply into structure from buffer for SwapBuffers +// swapBuffersReply reads a byte slice into a SwapBuffersReply value. func swapBuffersReply(buf []byte) *SwapBuffersReply { v := new(SwapBuffersReply) b := 1 // skip reply determinant @@ -1116,6 +1142,7 @@ func swapBuffersReply(buf []byte) *SwapBuffersReply { } // Write request to wire for SwapBuffers +// swapBuffersRequest writes a SwapBuffers request to a byte slice. func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { size := 32 b := 0 @@ -1154,29 +1181,31 @@ func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint3 return buf } -// Request GetMSC -// size: 8 +// GetMSCCookie is a cookie used only for GetMSC requests. type GetMSCCookie struct { *xgb.Cookie } +// GetMSC sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply() func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMSCRequest(c, Drawable), cookie) return GetMSCCookie{cookie} } +// GetMSCUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMSCRequest(c, Drawable), cookie) return GetMSCCookie{cookie} } -// Request reply for GetMSC -// size: 32 +// GetMSCReply represents the data returned from a GetMSC request. type GetMSCReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes UstHi uint32 UstLo uint32 @@ -1186,7 +1215,7 @@ type GetMSCReply struct { SbcLo uint32 } -// Waits and reads reply data from request GetMSC +// Reply blocks and returns the reply data for a GetMSC request. func (cook GetMSCCookie) Reply() (*GetMSCReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1198,7 +1227,7 @@ func (cook GetMSCCookie) Reply() (*GetMSCReply, error) { return getMSCReply(buf), nil } -// Read reply into structure from buffer for GetMSC +// getMSCReply reads a byte slice into a GetMSCReply value. func getMSCReply(buf []byte) *GetMSCReply { v := new(GetMSCReply) b := 1 // skip reply determinant @@ -1233,6 +1262,7 @@ func getMSCReply(buf []byte) *GetMSCReply { } // Write request to wire for GetMSC +// getMSCRequest writes a GetMSC request to a byte slice. func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -1253,29 +1283,31 @@ func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request WaitMSC -// size: 32 +// WaitMSCCookie is a cookie used only for WaitMSC requests. type WaitMSCCookie struct { *xgb.Cookie } +// WaitMSC sends a checked request. +// If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply() func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { cookie := c.NewCookie(true, true) c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return WaitMSCCookie{cookie} } +// WaitMSCUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { cookie := c.NewCookie(false, true) c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return WaitMSCCookie{cookie} } -// Request reply for WaitMSC -// size: 32 +// WaitMSCReply represents the data returned from a WaitMSC request. type WaitMSCReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes UstHi uint32 UstLo uint32 @@ -1285,7 +1317,7 @@ type WaitMSCReply struct { SbcLo uint32 } -// Waits and reads reply data from request WaitMSC +// Reply blocks and returns the reply data for a WaitMSC request. func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1297,7 +1329,7 @@ func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) { return waitMSCReply(buf), nil } -// Read reply into structure from buffer for WaitMSC +// waitMSCReply reads a byte slice into a WaitMSCReply value. func waitMSCReply(buf []byte) *WaitMSCReply { v := new(WaitMSCReply) b := 1 // skip reply determinant @@ -1332,6 +1364,7 @@ func waitMSCReply(buf []byte) *WaitMSCReply { } // Write request to wire for WaitMSC +// waitMSCRequest writes a WaitMSC request to a byte slice. func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte { size := 32 b := 0 @@ -1370,29 +1403,31 @@ func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, T return buf } -// Request WaitSBC -// size: 16 +// WaitSBCCookie is a cookie used only for WaitSBC requests. type WaitSBCCookie struct { *xgb.Cookie } +// WaitSBC sends a checked request. +// If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply() func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { cookie := c.NewCookie(true, true) c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) return WaitSBCCookie{cookie} } +// WaitSBCUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { cookie := c.NewCookie(false, true) c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) return WaitSBCCookie{cookie} } -// Request reply for WaitSBC -// size: 32 +// WaitSBCReply represents the data returned from a WaitSBC request. type WaitSBCReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes UstHi uint32 UstLo uint32 @@ -1402,7 +1437,7 @@ type WaitSBCReply struct { SbcLo uint32 } -// Waits and reads reply data from request WaitSBC +// Reply blocks and returns the reply data for a WaitSBC request. func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1414,7 +1449,7 @@ func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) { return waitSBCReply(buf), nil } -// Read reply into structure from buffer for WaitSBC +// waitSBCReply reads a byte slice into a WaitSBCReply value. func waitSBCReply(buf []byte) *WaitSBCReply { v := new(WaitSBCReply) b := 1 // skip reply determinant @@ -1449,6 +1484,7 @@ func waitSBCReply(buf []byte) *WaitSBCReply { } // Write request to wire for WaitSBC +// waitSBCRequest writes a WaitSBC request to a byte slice. func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte { size := 16 b := 0 @@ -1475,30 +1511,35 @@ func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, T return buf } -// Request SwapInterval -// size: 12 +// SwapIntervalCookie is a cookie used only for SwapInterval requests. type SwapIntervalCookie struct { *xgb.Cookie } -// Write request to wire for SwapInterval +// SwapInterval sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { cookie := c.NewCookie(false, false) c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) return SwapIntervalCookie{cookie} } +// SwapIntervalChecked sends a checked request. +// If an error occurs, it can be retrieved using SwapIntervalCookie.Check() func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { cookie := c.NewCookie(true, false) c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) return SwapIntervalCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SwapIntervalCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SwapInterval +// swapIntervalRequest writes a SwapInterval request to a byte slice. func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte { size := 12 b := 0 diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 5bb11fa..21fdb4b 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on May 10 2012 8:04:31pm EDT. + This file was generated by ge.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -64,36 +60,42 @@ func init() { // Skipping definition for base type 'Float' -// Request QueryVersion -// size: 8 +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint16 MinorVersion uint16 // padding: 20 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -105,7 +107,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -130,6 +132,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { size := 8 b := 0 diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 887d96b..d351137 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on May 10 2012 8:04:31pm EDT. + This file was generated by glx.xml on May 10 2012 11:56:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,12 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( PbcetDamaged = 32791 PbcetSaved = 32792 @@ -172,9 +172,7 @@ type Bool32 uint32 type ContextTag uint32 -// Event definition PbufferClobber (0) -// Size: 32 - +// PbufferClobber is the event number for a PbufferClobberEvent. const PbufferClobber = 0 type PbufferClobberEvent struct { @@ -193,7 +191,7 @@ type PbufferClobberEvent struct { // padding: 4 bytes } -// Event read PbufferClobber +// PbufferClobberEventNew constructs a PbufferClobberEvent value that implements xgb.Event from a byte slice. func PbufferClobberEventNew(buf []byte) xgb.Event { v := PbufferClobberEvent{} b := 1 // don't read event number @@ -238,7 +236,7 @@ func PbufferClobberEventNew(buf []byte) xgb.Event { return v } -// Event write PbufferClobber +// Bytes writes a PbufferClobberEvent value to a byte slice. func (v PbufferClobberEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -286,12 +284,14 @@ func (v PbufferClobberEvent) Bytes() []byte { return buf } -func (v PbufferClobberEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the PbufferClobber event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v PbufferClobberEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of PbufferClobberEvent. func (v PbufferClobberEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -312,9 +312,7 @@ func init() { xgb.NewExtEventFuncs["GLX"][0] = PbufferClobberEventNew } -// Error definition Generic (-1) -// Size: 32 - +// BadGeneric is the error number for a BadGeneric. const BadGeneric = -1 type GenericError struct { @@ -326,7 +324,7 @@ type GenericError struct { // padding: 21 bytes } -// Error read Generic +// GenericErrorNew constructs a GenericError value that implements xgb.Error from a byte slice. func GenericErrorNew(buf []byte) xgb.Error { v := GenericError{} v.NiceName = "Generic" @@ -351,8 +349,8 @@ func GenericErrorNew(buf []byte) xgb.Error { return v } -func (err GenericError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGeneric error. +// This is mostly used internally. func (err GenericError) SequenceId() uint16 { return err.Sequence } @@ -375,20 +373,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][-1] = GenericErrorNew } -// ErrorCopy definition BadContext (0) - +// BadBadContext is the error number for a BadBadContext. const BadBadContext = 0 type BadContextError GenericError +// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. func BadContextErrorNew(buf []byte) xgb.Error { v := BadContextError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadContext" return v } -func (err BadContextError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadContext error. +// This is mostly used internally. func (err BadContextError) SequenceId() uint16 { return err.Sequence } @@ -411,20 +409,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][0] = BadContextErrorNew } -// ErrorCopy definition BadContextState (1) - +// BadBadContextState is the error number for a BadBadContextState. const BadBadContextState = 1 type BadContextStateError GenericError +// BadContextStateErrorNew constructs a BadContextStateError value that implements xgb.Error from a byte slice. func BadContextStateErrorNew(buf []byte) xgb.Error { v := BadContextStateError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadContextState" return v } -func (err BadContextStateError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadContextState error. +// This is mostly used internally. func (err BadContextStateError) SequenceId() uint16 { return err.Sequence } @@ -447,20 +445,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][1] = BadContextStateErrorNew } -// ErrorCopy definition BadDrawable (2) - +// BadBadDrawable is the error number for a BadBadDrawable. const BadBadDrawable = 2 type BadDrawableError GenericError +// BadDrawableErrorNew constructs a BadDrawableError value that implements xgb.Error from a byte slice. func BadDrawableErrorNew(buf []byte) xgb.Error { v := BadDrawableError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadDrawable" return v } -func (err BadDrawableError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadDrawable error. +// This is mostly used internally. func (err BadDrawableError) SequenceId() uint16 { return err.Sequence } @@ -483,20 +481,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][2] = BadDrawableErrorNew } -// ErrorCopy definition BadPixmap (3) - +// BadBadPixmap is the error number for a BadBadPixmap. const BadBadPixmap = 3 type BadPixmapError GenericError +// BadPixmapErrorNew constructs a BadPixmapError value that implements xgb.Error from a byte slice. func BadPixmapErrorNew(buf []byte) xgb.Error { v := BadPixmapError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadPixmap" return v } -func (err BadPixmapError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadPixmap error. +// This is mostly used internally. func (err BadPixmapError) SequenceId() uint16 { return err.Sequence } @@ -519,20 +517,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][3] = BadPixmapErrorNew } -// ErrorCopy definition BadContextTag (4) - +// BadBadContextTag is the error number for a BadBadContextTag. const BadBadContextTag = 4 type BadContextTagError GenericError +// BadContextTagErrorNew constructs a BadContextTagError value that implements xgb.Error from a byte slice. func BadContextTagErrorNew(buf []byte) xgb.Error { v := BadContextTagError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadContextTag" return v } -func (err BadContextTagError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadContextTag error. +// This is mostly used internally. func (err BadContextTagError) SequenceId() uint16 { return err.Sequence } @@ -555,20 +553,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][4] = BadContextTagErrorNew } -// ErrorCopy definition BadCurrentWindow (5) - +// BadBadCurrentWindow is the error number for a BadBadCurrentWindow. const BadBadCurrentWindow = 5 type BadCurrentWindowError GenericError +// BadCurrentWindowErrorNew constructs a BadCurrentWindowError value that implements xgb.Error from a byte slice. func BadCurrentWindowErrorNew(buf []byte) xgb.Error { v := BadCurrentWindowError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadCurrentWindow" return v } -func (err BadCurrentWindowError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadCurrentWindow error. +// This is mostly used internally. func (err BadCurrentWindowError) SequenceId() uint16 { return err.Sequence } @@ -591,20 +589,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][5] = BadCurrentWindowErrorNew } -// ErrorCopy definition BadRenderRequest (6) - +// BadBadRenderRequest is the error number for a BadBadRenderRequest. const BadBadRenderRequest = 6 type BadRenderRequestError GenericError +// BadRenderRequestErrorNew constructs a BadRenderRequestError value that implements xgb.Error from a byte slice. func BadRenderRequestErrorNew(buf []byte) xgb.Error { v := BadRenderRequestError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadRenderRequest" return v } -func (err BadRenderRequestError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadRenderRequest error. +// This is mostly used internally. func (err BadRenderRequestError) SequenceId() uint16 { return err.Sequence } @@ -627,20 +625,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][6] = BadRenderRequestErrorNew } -// ErrorCopy definition BadLargeRequest (7) - +// BadBadLargeRequest is the error number for a BadBadLargeRequest. const BadBadLargeRequest = 7 type BadLargeRequestError GenericError +// BadLargeRequestErrorNew constructs a BadLargeRequestError value that implements xgb.Error from a byte slice. func BadLargeRequestErrorNew(buf []byte) xgb.Error { v := BadLargeRequestError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadLargeRequest" return v } -func (err BadLargeRequestError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadLargeRequest error. +// This is mostly used internally. func (err BadLargeRequestError) SequenceId() uint16 { return err.Sequence } @@ -663,20 +661,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][7] = BadLargeRequestErrorNew } -// ErrorCopy definition UnsupportedPrivateRequest (8) - +// BadUnsupportedPrivateRequest is the error number for a BadUnsupportedPrivateRequest. const BadUnsupportedPrivateRequest = 8 type UnsupportedPrivateRequestError GenericError +// UnsupportedPrivateRequestErrorNew constructs a UnsupportedPrivateRequestError value that implements xgb.Error from a byte slice. func UnsupportedPrivateRequestErrorNew(buf []byte) xgb.Error { v := UnsupportedPrivateRequestError(GenericErrorNew(buf).(GenericError)) v.NiceName = "UnsupportedPrivateRequest" return v } -func (err UnsupportedPrivateRequestError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadUnsupportedPrivateRequest error. +// This is mostly used internally. func (err UnsupportedPrivateRequestError) SequenceId() uint16 { return err.Sequence } @@ -699,20 +697,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][8] = UnsupportedPrivateRequestErrorNew } -// ErrorCopy definition BadFBConfig (9) - +// BadBadFBConfig is the error number for a BadBadFBConfig. const BadBadFBConfig = 9 type BadFBConfigError GenericError +// BadFBConfigErrorNew constructs a BadFBConfigError value that implements xgb.Error from a byte slice. func BadFBConfigErrorNew(buf []byte) xgb.Error { v := BadFBConfigError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadFBConfig" return v } -func (err BadFBConfigError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadFBConfig error. +// This is mostly used internally. func (err BadFBConfigError) SequenceId() uint16 { return err.Sequence } @@ -735,20 +733,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][9] = BadFBConfigErrorNew } -// ErrorCopy definition BadPbuffer (10) - +// BadBadPbuffer is the error number for a BadBadPbuffer. const BadBadPbuffer = 10 type BadPbufferError GenericError +// BadPbufferErrorNew constructs a BadPbufferError value that implements xgb.Error from a byte slice. func BadPbufferErrorNew(buf []byte) xgb.Error { v := BadPbufferError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadPbuffer" return v } -func (err BadPbufferError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadPbuffer error. +// This is mostly used internally. func (err BadPbufferError) SequenceId() uint16 { return err.Sequence } @@ -771,20 +769,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][10] = BadPbufferErrorNew } -// ErrorCopy definition BadCurrentDrawable (11) - +// BadBadCurrentDrawable is the error number for a BadBadCurrentDrawable. const BadBadCurrentDrawable = 11 type BadCurrentDrawableError GenericError +// BadCurrentDrawableErrorNew constructs a BadCurrentDrawableError value that implements xgb.Error from a byte slice. func BadCurrentDrawableErrorNew(buf []byte) xgb.Error { v := BadCurrentDrawableError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadCurrentDrawable" return v } -func (err BadCurrentDrawableError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadCurrentDrawable error. +// This is mostly used internally. func (err BadCurrentDrawableError) SequenceId() uint16 { return err.Sequence } @@ -807,20 +805,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][11] = BadCurrentDrawableErrorNew } -// ErrorCopy definition BadWindow (12) - +// BadBadWindow is the error number for a BadBadWindow. const BadBadWindow = 12 type BadWindowError GenericError +// BadWindowErrorNew constructs a BadWindowError value that implements xgb.Error from a byte slice. func BadWindowErrorNew(buf []byte) xgb.Error { v := BadWindowError(GenericErrorNew(buf).(GenericError)) v.NiceName = "BadWindow" return v } -func (err BadWindowError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadWindow error. +// This is mostly used internally. func (err BadWindowError) SequenceId() uint16 { return err.Sequence } @@ -843,20 +841,20 @@ func init() { xgb.NewExtErrorFuncs["GLX"][12] = BadWindowErrorNew } -// ErrorCopy definition GLXBadProfileARB (13) - +// BadGLXBadProfileARB is the error number for a BadGLXBadProfileARB. const BadGLXBadProfileARB = 13 type GLXBadProfileARBError GenericError +// GLXBadProfileARBErrorNew constructs a GLXBadProfileARBError value that implements xgb.Error from a byte slice. func GLXBadProfileARBErrorNew(buf []byte) xgb.Error { v := GLXBadProfileARBError(GenericErrorNew(buf).(GenericError)) v.NiceName = "GLXBadProfileARB" return v } -func (err GLXBadProfileARBError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGLXBadProfileARB error. +// This is mostly used internally. func (err GLXBadProfileARBError) SequenceId() uint16 { return err.Sequence } @@ -879,30 +877,35 @@ func init() { xgb.NewExtErrorFuncs["GLX"][13] = GLXBadProfileARBErrorNew } -// Request Render -// size: xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) +// RenderCookie is a cookie used only for Render requests. type RenderCookie struct { *xgb.Cookie } -// Write request to wire for Render +// Render sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { cookie := c.NewCookie(false, false) c.NewRequest(renderRequest(c, ContextTag, Data), cookie) return RenderCookie{cookie} } +// RenderChecked sends a checked request. +// If an error occurs, it can be retrieved using RenderCookie.Check() func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { cookie := c.NewCookie(true, false) c.NewRequest(renderRequest(c, ContextTag, Data), cookie) return RenderCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RenderCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Render +// renderRequest writes a Render request to a byte slice. func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { size := xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -926,30 +929,35 @@ func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { return buf } -// Request RenderLarge -// size: xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) +// RenderLargeCookie is a cookie used only for RenderLarge requests. type RenderLargeCookie struct { *xgb.Cookie } -// Write request to wire for RenderLarge +// RenderLarge sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { cookie := c.NewCookie(false, false) c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) return RenderLargeCookie{cookie} } +// RenderLargeChecked sends a checked request. +// If an error occurs, it can be retrieved using RenderLargeCookie.Check() func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { cookie := c.NewCookie(true, false) c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) return RenderLargeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RenderLargeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RenderLarge +// renderLargeRequest writes a RenderLarge request to a byte slice. func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { size := xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) b := 0 @@ -982,30 +990,35 @@ func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, R return buf } -// Request CreateContext -// size: 24 +// CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie } -// Write request to wire for CreateContext +// CreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) return CreateContextCookie{cookie} } +// CreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) return CreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) []byte { size := 24 b := 0 @@ -1044,30 +1057,35 @@ func createContextRequest(c *xgb.Conn, Context Context, Visual xproto.Visualid, return buf } -// Request DestroyContext -// size: 8 +// DestroyContextCookie is a cookie used only for DestroyContext requests. type DestroyContextCookie struct { *xgb.Cookie } -// Write request to wire for DestroyContext +// DestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, Context), cookie) return DestroyContextCookie{cookie} } +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, Context), cookie) return DestroyContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. func destroyContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -1088,35 +1106,37 @@ func destroyContextRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request MakeCurrent -// size: 16 +// MakeCurrentCookie is a cookie used only for MakeCurrent requests. type MakeCurrentCookie struct { *xgb.Cookie } +// MakeCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling MakeCurrentCookie.Reply() func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { cookie := c.NewCookie(true, true) c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) return MakeCurrentCookie{cookie} } +// MakeCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { cookie := c.NewCookie(false, true) c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) return MakeCurrentCookie{cookie} } -// Request reply for MakeCurrent -// size: 32 +// MakeCurrentReply represents the data returned from a MakeCurrent request. type MakeCurrentReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextTag ContextTag // padding: 20 bytes } -// Waits and reads reply data from request MakeCurrent +// Reply blocks and returns the reply data for a MakeCurrent request. func (cook MakeCurrentCookie) Reply() (*MakeCurrentReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1128,7 +1148,7 @@ func (cook MakeCurrentCookie) Reply() (*MakeCurrentReply, error) { return makeCurrentReply(buf), nil } -// Read reply into structure from buffer for MakeCurrent +// makeCurrentReply reads a byte slice into a MakeCurrentReply value. func makeCurrentReply(buf []byte) *MakeCurrentReply { v := new(MakeCurrentReply) b := 1 // skip reply determinant @@ -1150,6 +1170,7 @@ func makeCurrentReply(buf []byte) *MakeCurrentReply { } // Write request to wire for MakeCurrent +// makeCurrentRequest writes a MakeCurrent request to a byte slice. func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) []byte { size := 16 b := 0 @@ -1176,35 +1197,37 @@ func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldCont return buf } -// Request IsDirect -// size: 8 +// IsDirectCookie is a cookie used only for IsDirect requests. type IsDirectCookie struct { *xgb.Cookie } +// IsDirect sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsDirectCookie.Reply() func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { cookie := c.NewCookie(true, true) c.NewRequest(isDirectRequest(c, Context), cookie) return IsDirectCookie{cookie} } +// IsDirectUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { cookie := c.NewCookie(false, true) c.NewRequest(isDirectRequest(c, Context), cookie) return IsDirectCookie{cookie} } -// Request reply for IsDirect -// size: 32 +// IsDirectReply represents the data returned from a IsDirect request. type IsDirectReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes IsDirect bool // padding: 23 bytes } -// Waits and reads reply data from request IsDirect +// Reply blocks and returns the reply data for a IsDirect request. func (cook IsDirectCookie) Reply() (*IsDirectReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1216,7 +1239,7 @@ func (cook IsDirectCookie) Reply() (*IsDirectReply, error) { return isDirectReply(buf), nil } -// Read reply into structure from buffer for IsDirect +// isDirectReply reads a byte slice into a IsDirectReply value. func isDirectReply(buf []byte) *IsDirectReply { v := new(IsDirectReply) b := 1 // skip reply determinant @@ -1242,6 +1265,7 @@ func isDirectReply(buf []byte) *IsDirectReply { } // Write request to wire for IsDirect +// isDirectRequest writes a IsDirect request to a byte slice. func isDirectRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -1262,36 +1286,38 @@ func isDirectRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1303,7 +1329,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -1328,6 +1354,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { size := 12 b := 0 @@ -1351,30 +1378,35 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) return buf } -// Request WaitGL -// size: 8 +// WaitGLCookie is a cookie used only for WaitGL requests. type WaitGLCookie struct { *xgb.Cookie } -// Write request to wire for WaitGL +// WaitGL sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { cookie := c.NewCookie(false, false) c.NewRequest(waitGLRequest(c, ContextTag), cookie) return WaitGLCookie{cookie} } +// WaitGLChecked sends a checked request. +// If an error occurs, it can be retrieved using WaitGLCookie.Check() func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { cookie := c.NewCookie(true, false) c.NewRequest(waitGLRequest(c, ContextTag), cookie) return WaitGLCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook WaitGLCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for WaitGL +// waitGLRequest writes a WaitGL request to a byte slice. func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -1395,30 +1427,35 @@ func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request WaitX -// size: 8 +// WaitXCookie is a cookie used only for WaitX requests. type WaitXCookie struct { *xgb.Cookie } -// Write request to wire for WaitX +// WaitX sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { cookie := c.NewCookie(false, false) c.NewRequest(waitXRequest(c, ContextTag), cookie) return WaitXCookie{cookie} } +// WaitXChecked sends a checked request. +// If an error occurs, it can be retrieved using WaitXCookie.Check() func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { cookie := c.NewCookie(true, false) c.NewRequest(waitXRequest(c, ContextTag), cookie) return WaitXCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook WaitXCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for WaitX +// waitXRequest writes a WaitX request to a byte slice. func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -1439,30 +1476,35 @@ func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request CopyContext -// size: 20 +// CopyContextCookie is a cookie used only for CopyContext requests. type CopyContextCookie struct { *xgb.Cookie } -// Write request to wire for CopyContext +// CopyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) return CopyContextCookie{cookie} } +// CopyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyContextCookie.Check() func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) return CopyContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyContext +// copyContextRequest writes a CopyContext request to a byte slice. func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) []byte { size := 20 b := 0 @@ -1492,30 +1534,35 @@ func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, Src return buf } -// Request SwapBuffers -// size: 12 +// SwapBuffersCookie is a cookie used only for SwapBuffers requests. type SwapBuffersCookie struct { *xgb.Cookie } -// Write request to wire for SwapBuffers +// SwapBuffers sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { cookie := c.NewCookie(false, false) c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) return SwapBuffersCookie{cookie} } +// SwapBuffersChecked sends a checked request. +// If an error occurs, it can be retrieved using SwapBuffersCookie.Check() func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { cookie := c.NewCookie(true, false) c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) return SwapBuffersCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SwapBuffersCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SwapBuffers +// swapBuffersRequest writes a SwapBuffers request to a byte slice. func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) []byte { size := 12 b := 0 @@ -1539,30 +1586,35 @@ func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) [ return buf } -// Request UseXFont -// size: 24 +// UseXFontCookie is a cookie used only for UseXFont requests. type UseXFontCookie struct { *xgb.Cookie } -// Write request to wire for UseXFont +// UseXFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { cookie := c.NewCookie(false, false) c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) return UseXFontCookie{cookie} } +// UseXFontChecked sends a checked request. +// If an error occurs, it can be retrieved using UseXFontCookie.Check() func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { cookie := c.NewCookie(true, false) c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) return UseXFontCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UseXFontCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UseXFont +// useXFontRequest writes a UseXFont request to a byte slice. func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) []byte { size := 24 b := 0 @@ -1595,30 +1647,35 @@ func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First return buf } -// Request CreateGLXPixmap -// size: 20 +// CreateGLXPixmapCookie is a cookie used only for CreateGLXPixmap requests. type CreateGLXPixmapCookie struct { *xgb.Cookie } -// Write request to wire for CreateGLXPixmap +// CreateGLXPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) return CreateGLXPixmapCookie{cookie} } +// CreateGLXPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGLXPixmapCookie.Check() func CreateGLXPixmapChecked(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) return CreateGLXPixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateGLXPixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGLXPixmap +// createGLXPixmapRequest writes a CreateGLXPixmap request to a byte slice. func createGLXPixmapRequest(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) []byte { size := 20 b := 0 @@ -1648,29 +1705,31 @@ func createGLXPixmapRequest(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, return buf } -// Request GetVisualConfigs -// size: 8 +// GetVisualConfigsCookie is a cookie used only for GetVisualConfigs requests. type GetVisualConfigsCookie struct { *xgb.Cookie } +// GetVisualConfigs sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVisualConfigsCookie.Reply() func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) return GetVisualConfigsCookie{cookie} } +// GetVisualConfigsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) return GetVisualConfigsCookie{cookie} } -// Request reply for GetVisualConfigs -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetVisualConfigsReply represents the data returned from a GetVisualConfigs request. type GetVisualConfigsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumVisuals uint32 NumProperties uint32 @@ -1678,7 +1737,7 @@ type GetVisualConfigsReply struct { PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetVisualConfigs +// Reply blocks and returns the reply data for a GetVisualConfigs request. func (cook GetVisualConfigsCookie) Reply() (*GetVisualConfigsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1690,7 +1749,7 @@ func (cook GetVisualConfigsCookie) Reply() (*GetVisualConfigsReply, error) { return getVisualConfigsReply(buf), nil } -// Read reply into structure from buffer for GetVisualConfigs +// getVisualConfigsReply reads a byte slice into a GetVisualConfigsReply value. func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { v := new(GetVisualConfigsReply) b := 1 // skip reply determinant @@ -1722,6 +1781,7 @@ func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { } // Write request to wire for GetVisualConfigs +// getVisualConfigsRequest writes a GetVisualConfigs request to a byte slice. func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -1742,30 +1802,35 @@ func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request DestroyGLXPixmap -// size: 8 +// DestroyGLXPixmapCookie is a cookie used only for DestroyGLXPixmap requests. type DestroyGLXPixmapCookie struct { *xgb.Cookie } -// Write request to wire for DestroyGLXPixmap +// DestroyGLXPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) return DestroyGLXPixmapCookie{cookie} } +// DestroyGLXPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyGLXPixmapCookie.Check() func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) return DestroyGLXPixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyGLXPixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyGLXPixmap +// destroyGLXPixmapRequest writes a DestroyGLXPixmap request to a byte slice. func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { size := 8 b := 0 @@ -1786,30 +1851,35 @@ func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { return buf } -// Request VendorPrivate -// size: xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) +// VendorPrivateCookie is a cookie used only for VendorPrivate requests. type VendorPrivateCookie struct { *xgb.Cookie } -// Write request to wire for VendorPrivate +// VendorPrivate sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { cookie := c.NewCookie(false, false) c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateCookie{cookie} } +// VendorPrivateChecked sends a checked request. +// If an error occurs, it can be retrieved using VendorPrivateCookie.Check() func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { cookie := c.NewCookie(true, false) c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook VendorPrivateCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for VendorPrivate +// vendorPrivateRequest writes a VendorPrivate request to a byte slice. func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -1836,36 +1906,38 @@ func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, return buf } -// Request VendorPrivateWithReply -// size: xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) +// VendorPrivateWithReplyCookie is a cookie used only for VendorPrivateWithReply requests. type VendorPrivateWithReplyCookie struct { *xgb.Cookie } +// VendorPrivateWithReply sends a checked request. +// If an error occurs, it will be returned with the reply by calling VendorPrivateWithReplyCookie.Reply() func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { cookie := c.NewCookie(true, true) c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateWithReplyCookie{cookie} } +// VendorPrivateWithReplyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { cookie := c.NewCookie(false, true) c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateWithReplyCookie{cookie} } -// Request reply for VendorPrivateWithReply -// size: (36 + xgb.Pad(((int(Length) * 4) * 1))) +// VendorPrivateWithReplyReply represents the data returned from a VendorPrivateWithReply request. type VendorPrivateWithReplyReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Retval uint32 Data1 []byte // size: 24 Data2 []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request VendorPrivateWithReply +// Reply blocks and returns the reply data for a VendorPrivateWithReply request. func (cook VendorPrivateWithReplyCookie) Reply() (*VendorPrivateWithReplyReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1877,7 +1949,7 @@ func (cook VendorPrivateWithReplyCookie) Reply() (*VendorPrivateWithReplyReply, return vendorPrivateWithReplyReply(buf), nil } -// Read reply into structure from buffer for VendorPrivateWithReply +// vendorPrivateWithReplyReply reads a byte slice into a VendorPrivateWithReplyReply value. func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { v := new(VendorPrivateWithReplyReply) b := 1 // skip reply determinant @@ -1905,6 +1977,7 @@ func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { } // Write request to wire for VendorPrivateWithReply +// vendorPrivateWithReplyRequest writes a VendorPrivateWithReply request to a byte slice. func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -1931,36 +2004,38 @@ func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag Co return buf } -// Request QueryExtensionsString -// size: 8 +// QueryExtensionsStringCookie is a cookie used only for QueryExtensionsString requests. type QueryExtensionsStringCookie struct { *xgb.Cookie } +// QueryExtensionsString sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionsStringCookie.Reply() func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) return QueryExtensionsStringCookie{cookie} } +// QueryExtensionsStringUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) return QueryExtensionsStringCookie{cookie} } -// Request reply for QueryExtensionsString -// size: 32 +// QueryExtensionsStringReply represents the data returned from a QueryExtensionsString request. type QueryExtensionsStringReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryExtensionsString +// Reply blocks and returns the reply data for a QueryExtensionsString request. func (cook QueryExtensionsStringCookie) Reply() (*QueryExtensionsStringReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1972,7 +2047,7 @@ func (cook QueryExtensionsStringCookie) Reply() (*QueryExtensionsStringReply, er return queryExtensionsStringReply(buf), nil } -// Read reply into structure from buffer for QueryExtensionsString +// queryExtensionsStringReply reads a byte slice into a QueryExtensionsStringReply value. func queryExtensionsStringReply(buf []byte) *QueryExtensionsStringReply { v := new(QueryExtensionsStringReply) b := 1 // skip reply determinant @@ -1996,6 +2071,7 @@ func queryExtensionsStringReply(buf []byte) *QueryExtensionsStringReply { } // Write request to wire for QueryExtensionsString +// queryExtensionsStringRequest writes a QueryExtensionsString request to a byte slice. func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -2016,29 +2092,31 @@ func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request QueryServerString -// size: 12 +// QueryServerStringCookie is a cookie used only for QueryServerString requests. type QueryServerStringCookie struct { *xgb.Cookie } +// QueryServerString sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryServerStringCookie.Reply() func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) return QueryServerStringCookie{cookie} } +// QueryServerStringUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) return QueryServerStringCookie{cookie} } -// Request reply for QueryServerString -// size: (32 + xgb.Pad((int(StrLen) * 1))) +// QueryServerStringReply represents the data returned from a QueryServerString request. type QueryServerStringReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes StrLen uint32 @@ -2046,7 +2124,7 @@ type QueryServerStringReply struct { String string // size: xgb.Pad((int(StrLen) * 1)) } -// Waits and reads reply data from request QueryServerString +// Reply blocks and returns the reply data for a QueryServerString request. func (cook QueryServerStringCookie) Reply() (*QueryServerStringReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2058,7 +2136,7 @@ func (cook QueryServerStringCookie) Reply() (*QueryServerStringReply, error) { return queryServerStringReply(buf), nil } -// Read reply into structure from buffer for QueryServerString +// queryServerStringReply reads a byte slice into a QueryServerStringReply value. func queryServerStringReply(buf []byte) *QueryServerStringReply { v := new(QueryServerStringReply) b := 1 // skip reply determinant @@ -2089,6 +2167,7 @@ func queryServerStringReply(buf []byte) *QueryServerStringReply { } // Write request to wire for QueryServerString +// queryServerStringRequest writes a QueryServerString request to a byte slice. func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { size := 12 b := 0 @@ -2112,30 +2191,35 @@ func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { return buf } -// Request ClientInfo -// size: xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) +// ClientInfoCookie is a cookie used only for ClientInfo requests. type ClientInfoCookie struct { *xgb.Cookie } -// Write request to wire for ClientInfo +// ClientInfo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { cookie := c.NewCookie(false, false) c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) return ClientInfoCookie{cookie} } +// ClientInfoChecked sends a checked request. +// If an error occurs, it can be retrieved using ClientInfoCookie.Check() func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { cookie := c.NewCookie(true, false) c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) return ClientInfoCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ClientInfoCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ClientInfo +// clientInfoRequest writes a ClientInfo request to a byte slice. func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { size := xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) b := 0 @@ -2165,29 +2249,31 @@ func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, St return buf } -// Request GetFBConfigs -// size: 8 +// GetFBConfigsCookie is a cookie used only for GetFBConfigs requests. type GetFBConfigsCookie struct { *xgb.Cookie } +// GetFBConfigs sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFBConfigsCookie.Reply() func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFBConfigsRequest(c, Screen), cookie) return GetFBConfigsCookie{cookie} } +// GetFBConfigsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFBConfigsRequest(c, Screen), cookie) return GetFBConfigsCookie{cookie} } -// Request reply for GetFBConfigs -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetFBConfigsReply represents the data returned from a GetFBConfigs request. type GetFBConfigsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumFbConfigs uint32 NumProperties uint32 @@ -2195,7 +2281,7 @@ type GetFBConfigsReply struct { PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetFBConfigs +// Reply blocks and returns the reply data for a GetFBConfigs request. func (cook GetFBConfigsCookie) Reply() (*GetFBConfigsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2207,7 +2293,7 @@ func (cook GetFBConfigsCookie) Reply() (*GetFBConfigsReply, error) { return getFBConfigsReply(buf), nil } -// Read reply into structure from buffer for GetFBConfigs +// getFBConfigsReply reads a byte slice into a GetFBConfigsReply value. func getFBConfigsReply(buf []byte) *GetFBConfigsReply { v := new(GetFBConfigsReply) b := 1 // skip reply determinant @@ -2239,6 +2325,7 @@ func getFBConfigsReply(buf []byte) *GetFBConfigsReply { } // Write request to wire for GetFBConfigs +// getFBConfigsRequest writes a GetFBConfigs request to a byte slice. func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -2259,30 +2346,35 @@ func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request CreatePixmap -// size: xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. type CreatePixmapCookie struct { *xgb.Cookie } -// Write request to wire for CreatePixmap +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return CreatePixmapCookie{cookie} } +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return CreatePixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) []byte { size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 @@ -2321,30 +2413,35 @@ func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap x return buf } -// Request DestroyPixmap -// size: 8 +// DestroyPixmapCookie is a cookie used only for DestroyPixmap requests. type DestroyPixmapCookie struct { *xgb.Cookie } -// Write request to wire for DestroyPixmap +// DestroyPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) return DestroyPixmapCookie{cookie} } +// DestroyPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyPixmapCookie.Check() func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) return DestroyPixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyPixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyPixmap +// destroyPixmapRequest writes a DestroyPixmap request to a byte slice. func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { size := 8 b := 0 @@ -2365,30 +2462,35 @@ func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { return buf } -// Request CreateNewContext -// size: 28 +// CreateNewContextCookie is a cookie used only for CreateNewContext requests. type CreateNewContextCookie struct { *xgb.Cookie } -// Write request to wire for CreateNewContext +// CreateNewContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return CreateNewContextCookie{cookie} } +// CreateNewContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateNewContextCookie.Check() func CreateNewContextChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return CreateNewContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateNewContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateNewContext +// createNewContextRequest writes a CreateNewContext request to a byte slice. func createNewContextRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) []byte { size := 28 b := 0 @@ -2430,36 +2532,38 @@ func createNewContextRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Sc return buf } -// Request QueryContext -// size: 8 +// QueryContextCookie is a cookie used only for QueryContext requests. type QueryContextCookie struct { *xgb.Cookie } +// QueryContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryContextCookie.Reply() func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryContextRequest(c, Context), cookie) return QueryContextCookie{cookie} } +// QueryContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryContextRequest(c, Context), cookie) return QueryContextCookie{cookie} } -// Request reply for QueryContext -// size: (32 + xgb.Pad(((int(NumAttribs) * 2) * 4))) +// QueryContextReply represents the data returned from a QueryContext request. type QueryContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAttribs uint32 // padding: 20 bytes Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) } -// Waits and reads reply data from request QueryContext +// Reply blocks and returns the reply data for a QueryContext request. func (cook QueryContextCookie) Reply() (*QueryContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2471,7 +2575,7 @@ func (cook QueryContextCookie) Reply() (*QueryContextReply, error) { return queryContextReply(buf), nil } -// Read reply into structure from buffer for QueryContext +// queryContextReply reads a byte slice into a QueryContextReply value. func queryContextReply(buf []byte) *QueryContextReply { v := new(QueryContextReply) b := 1 // skip reply determinant @@ -2500,6 +2604,7 @@ func queryContextReply(buf []byte) *QueryContextReply { } // Write request to wire for QueryContext +// queryContextRequest writes a QueryContext request to a byte slice. func queryContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -2520,35 +2625,37 @@ func queryContextRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request MakeContextCurrent -// size: 20 +// MakeContextCurrentCookie is a cookie used only for MakeContextCurrent requests. type MakeContextCurrentCookie struct { *xgb.Cookie } +// MakeContextCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling MakeContextCurrentCookie.Reply() func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { cookie := c.NewCookie(true, true) c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) return MakeContextCurrentCookie{cookie} } +// MakeContextCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { cookie := c.NewCookie(false, true) c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) return MakeContextCurrentCookie{cookie} } -// Request reply for MakeContextCurrent -// size: 32 +// MakeContextCurrentReply represents the data returned from a MakeContextCurrent request. type MakeContextCurrentReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextTag ContextTag // padding: 20 bytes } -// Waits and reads reply data from request MakeContextCurrent +// Reply blocks and returns the reply data for a MakeContextCurrent request. func (cook MakeContextCurrentCookie) Reply() (*MakeContextCurrentReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2560,7 +2667,7 @@ func (cook MakeContextCurrentCookie) Reply() (*MakeContextCurrentReply, error) { return makeContextCurrentReply(buf), nil } -// Read reply into structure from buffer for MakeContextCurrent +// makeContextCurrentReply reads a byte slice into a MakeContextCurrentReply value. func makeContextCurrentReply(buf []byte) *MakeContextCurrentReply { v := new(MakeContextCurrentReply) b := 1 // skip reply determinant @@ -2582,6 +2689,7 @@ func makeContextCurrentReply(buf []byte) *MakeContextCurrentReply { } // Write request to wire for MakeContextCurrent +// makeContextCurrentRequest writes a MakeContextCurrent request to a byte slice. func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) []byte { size := 20 b := 0 @@ -2611,30 +2719,35 @@ func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable D return buf } -// Request CreatePbuffer -// size: xgb.Pad((20 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +// CreatePbufferCookie is a cookie used only for CreatePbuffer requests. type CreatePbufferCookie struct { *xgb.Cookie } -// Write request to wire for CreatePbuffer +// CreatePbuffer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return CreatePbufferCookie{cookie} } +// CreatePbufferChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePbufferCookie.Check() func CreatePbufferChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return CreatePbufferCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePbufferCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePbuffer +// createPbufferRequest writes a CreatePbuffer request to a byte slice. func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) []byte { size := xgb.Pad((20 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 @@ -2670,30 +2783,35 @@ func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer return buf } -// Request DestroyPbuffer -// size: 8 +// DestroyPbufferCookie is a cookie used only for DestroyPbuffer requests. type DestroyPbufferCookie struct { *xgb.Cookie } -// Write request to wire for DestroyPbuffer +// DestroyPbuffer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) return DestroyPbufferCookie{cookie} } +// DestroyPbufferChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyPbufferCookie.Check() func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) return DestroyPbufferCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyPbufferCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyPbuffer +// destroyPbufferRequest writes a DestroyPbuffer request to a byte slice. func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { size := 8 b := 0 @@ -2714,36 +2832,38 @@ func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { return buf } -// Request GetDrawableAttributes -// size: 8 +// GetDrawableAttributesCookie is a cookie used only for GetDrawableAttributes requests. type GetDrawableAttributesCookie struct { *xgb.Cookie } +// GetDrawableAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDrawableAttributesCookie.Reply() func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) return GetDrawableAttributesCookie{cookie} } +// GetDrawableAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) return GetDrawableAttributesCookie{cookie} } -// Request reply for GetDrawableAttributes -// size: (32 + xgb.Pad(((int(NumAttribs) * 2) * 4))) +// GetDrawableAttributesReply represents the data returned from a GetDrawableAttributes request. type GetDrawableAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAttribs uint32 // padding: 20 bytes Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) } -// Waits and reads reply data from request GetDrawableAttributes +// Reply blocks and returns the reply data for a GetDrawableAttributes request. func (cook GetDrawableAttributesCookie) Reply() (*GetDrawableAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2755,7 +2875,7 @@ func (cook GetDrawableAttributesCookie) Reply() (*GetDrawableAttributesReply, er return getDrawableAttributesReply(buf), nil } -// Read reply into structure from buffer for GetDrawableAttributes +// getDrawableAttributesReply reads a byte slice into a GetDrawableAttributesReply value. func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { v := new(GetDrawableAttributesReply) b := 1 // skip reply determinant @@ -2784,6 +2904,7 @@ func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { } // Write request to wire for GetDrawableAttributes +// getDrawableAttributesRequest writes a GetDrawableAttributes request to a byte slice. func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { size := 8 b := 0 @@ -2804,30 +2925,35 @@ func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { return buf } -// Request ChangeDrawableAttributes -// size: xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +// ChangeDrawableAttributesCookie is a cookie used only for ChangeDrawableAttributes requests. type ChangeDrawableAttributesCookie struct { *xgb.Cookie } -// Write request to wire for ChangeDrawableAttributes +// ChangeDrawableAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) return ChangeDrawableAttributesCookie{cookie} } +// ChangeDrawableAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDrawableAttributesCookie.Check() func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) return ChangeDrawableAttributesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeDrawableAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeDrawableAttributes +// changeDrawableAttributesRequest writes a ChangeDrawableAttributes request to a byte slice. func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) []byte { size := xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 @@ -2857,30 +2983,35 @@ func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs return buf } -// Request CreateWindow -// size: xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +// CreateWindowCookie is a cookie used only for CreateWindow requests. type CreateWindowCookie struct { *xgb.Cookie } -// Write request to wire for CreateWindow +// CreateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return CreateWindowCookie{cookie} } +// CreateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateWindowCookie.Check() func CreateWindowChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return CreateWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateWindow +// createWindowRequest writes a CreateWindow request to a byte slice. func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) []byte { size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 @@ -2919,30 +3050,35 @@ func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window x return buf } -// Request DeleteWindow -// size: 8 +// DeleteWindowCookie is a cookie used only for DeleteWindow requests. type DeleteWindowCookie struct { *xgb.Cookie } -// Write request to wire for DeleteWindow +// DeleteWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) return DeleteWindowCookie{cookie} } +// DeleteWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteWindowCookie.Check() func DeleteWindowChecked(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) return DeleteWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteWindow +// deleteWindowRequest writes a DeleteWindow request to a byte slice. func deleteWindowRequest(c *xgb.Conn, Glxwindow Window) []byte { size := 8 b := 0 @@ -2963,30 +3099,35 @@ func deleteWindowRequest(c *xgb.Conn, Glxwindow Window) []byte { return buf } -// Request SetClientInfoARB -// size: xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +// SetClientInfoARBCookie is a cookie used only for SetClientInfoARB requests. type SetClientInfoARBCookie struct { *xgb.Cookie } -// Write request to wire for SetClientInfoARB +// SetClientInfoARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { cookie := c.NewCookie(false, false) c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfoARBCookie{cookie} } +// SetClientInfoARBChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientInfoARBCookie.Check() func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfoARBCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetClientInfoARBCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetClientInfoARB +// setClientInfoARBRequest writes a SetClientInfoARB request to a byte slice. func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) b := 0 @@ -3031,30 +3172,35 @@ func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint return buf } -// Request CreateContextAttribsARB -// size: xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) +// CreateContextAttribsARBCookie is a cookie used only for CreateContextAttribsARB requests. type CreateContextAttribsARBCookie struct { *xgb.Cookie } -// Write request to wire for CreateContextAttribsARB +// CreateContextAttribsARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { cookie := c.NewCookie(false, false) c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return CreateContextAttribsARBCookie{cookie} } +// CreateContextAttribsARBChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextAttribsARBCookie.Check() func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { cookie := c.NewCookie(true, false) c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return CreateContextAttribsARBCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateContextAttribsARBCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateContextAttribsARB +// createContextAttribsARBRequest writes a CreateContextAttribsARB request to a byte slice. func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { size := xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 @@ -3102,30 +3248,35 @@ func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbcon return buf } -// Request SetClientInfo2ARB -// size: xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +// SetClientInfo2ARBCookie is a cookie used only for SetClientInfo2ARB requests. type SetClientInfo2ARBCookie struct { *xgb.Cookie } -// Write request to wire for SetClientInfo2ARB +// SetClientInfo2ARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { cookie := c.NewCookie(false, false) c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfo2ARBCookie{cookie} } +// SetClientInfo2ARBChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientInfo2ARBCookie.Check() func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfo2ARBCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetClientInfo2ARBCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetClientInfo2ARB +// setClientInfo2ARBRequest writes a SetClientInfo2ARB request to a byte slice. func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) b := 0 @@ -3170,30 +3321,35 @@ func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uin return buf } -// Request NewList -// size: 16 +// NewListCookie is a cookie used only for NewList requests. type NewListCookie struct { *xgb.Cookie } -// Write request to wire for NewList +// NewList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { cookie := c.NewCookie(false, false) c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) return NewListCookie{cookie} } +// NewListChecked sends a checked request. +// If an error occurs, it can be retrieved using NewListCookie.Check() func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { cookie := c.NewCookie(true, false) c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) return NewListCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook NewListCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for NewList +// newListRequest writes a NewList request to a byte slice. func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) []byte { size := 16 b := 0 @@ -3220,30 +3376,35 @@ func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32 return buf } -// Request EndList -// size: 8 +// EndListCookie is a cookie used only for EndList requests. type EndListCookie struct { *xgb.Cookie } -// Write request to wire for EndList +// EndList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { cookie := c.NewCookie(false, false) c.NewRequest(endListRequest(c, ContextTag), cookie) return EndListCookie{cookie} } +// EndListChecked sends a checked request. +// If an error occurs, it can be retrieved using EndListCookie.Check() func EndListChecked(c *xgb.Conn, ContextTag ContextTag) EndListCookie { cookie := c.NewCookie(true, false) c.NewRequest(endListRequest(c, ContextTag), cookie) return EndListCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook EndListCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for EndList +// endListRequest writes a EndList request to a byte slice. func endListRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -3264,30 +3425,35 @@ func endListRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request DeleteLists -// size: 16 +// DeleteListsCookie is a cookie used only for DeleteLists requests. type DeleteListsCookie struct { *xgb.Cookie } -// Write request to wire for DeleteLists +// DeleteLists sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) return DeleteListsCookie{cookie} } +// DeleteListsChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteListsCookie.Check() func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) return DeleteListsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteListsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteLists +// deleteListsRequest writes a DeleteLists request to a byte slice. func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) []byte { size := 16 b := 0 @@ -3314,34 +3480,36 @@ func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range i return buf } -// Request GenLists -// size: 12 +// GenListsCookie is a cookie used only for GenLists requests. type GenListsCookie struct { *xgb.Cookie } +// GenLists sends a checked request. +// If an error occurs, it will be returned with the reply by calling GenListsCookie.Reply() func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { cookie := c.NewCookie(true, true) c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) return GenListsCookie{cookie} } +// GenListsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenListsUnchecked(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { cookie := c.NewCookie(false, true) c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) return GenListsCookie{cookie} } -// Request reply for GenLists -// size: 12 +// GenListsReply represents the data returned from a GenLists request. type GenListsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal uint32 } -// Waits and reads reply data from request GenLists +// Reply blocks and returns the reply data for a GenLists request. func (cook GenListsCookie) Reply() (*GenListsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3353,7 +3521,7 @@ func (cook GenListsCookie) Reply() (*GenListsReply, error) { return genListsReply(buf), nil } -// Read reply into structure from buffer for GenLists +// genListsReply reads a byte slice into a GenListsReply value. func genListsReply(buf []byte) *GenListsReply { v := new(GenListsReply) b := 1 // skip reply determinant @@ -3373,6 +3541,7 @@ func genListsReply(buf []byte) *GenListsReply { } // Write request to wire for GenLists +// genListsRequest writes a GenLists request to a byte slice. func genListsRequest(c *xgb.Conn, ContextTag ContextTag, Range int32) []byte { size := 12 b := 0 @@ -3396,30 +3565,35 @@ func genListsRequest(c *xgb.Conn, ContextTag ContextTag, Range int32) []byte { return buf } -// Request FeedbackBuffer -// size: 16 +// FeedbackBufferCookie is a cookie used only for FeedbackBuffer requests. type FeedbackBufferCookie struct { *xgb.Cookie } -// Write request to wire for FeedbackBuffer +// FeedbackBuffer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { cookie := c.NewCookie(false, false) c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) return FeedbackBufferCookie{cookie} } +// FeedbackBufferChecked sends a checked request. +// If an error occurs, it can be retrieved using FeedbackBufferCookie.Check() func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { cookie := c.NewCookie(true, false) c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) return FeedbackBufferCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FeedbackBufferCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FeedbackBuffer +// feedbackBufferRequest writes a FeedbackBuffer request to a byte slice. func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) []byte { size := 16 b := 0 @@ -3446,30 +3620,35 @@ func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type return buf } -// Request SelectBuffer -// size: 12 +// SelectBufferCookie is a cookie used only for SelectBuffer requests. type SelectBufferCookie struct { *xgb.Cookie } -// Write request to wire for SelectBuffer +// SelectBuffer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) return SelectBufferCookie{cookie} } +// SelectBufferChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectBufferCookie.Check() func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) return SelectBufferCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectBufferCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectBuffer +// selectBufferRequest writes a SelectBuffer request to a byte slice. func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte { size := 12 b := 0 @@ -3493,29 +3672,31 @@ func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte return buf } -// Request RenderMode -// size: 12 +// RenderModeCookie is a cookie used only for RenderMode requests. type RenderModeCookie struct { *xgb.Cookie } +// RenderMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling RenderModeCookie.Reply() func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { cookie := c.NewCookie(true, true) c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) return RenderModeCookie{cookie} } +// RenderModeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { cookie := c.NewCookie(false, true) c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) return RenderModeCookie{cookie} } -// Request reply for RenderMode -// size: (32 + xgb.Pad((int(N) * 4))) +// RenderModeReply represents the data returned from a RenderMode request. type RenderModeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal uint32 N uint32 @@ -3524,7 +3705,7 @@ type RenderModeReply struct { Data []uint32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request RenderMode +// Reply blocks and returns the reply data for a RenderMode request. func (cook RenderModeCookie) Reply() (*RenderModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3536,7 +3717,7 @@ func (cook RenderModeCookie) Reply() (*RenderModeReply, error) { return renderModeReply(buf), nil } -// Read reply into structure from buffer for RenderMode +// renderModeReply reads a byte slice into a RenderModeReply value. func renderModeReply(buf []byte) *RenderModeReply { v := new(RenderModeReply) b := 1 // skip reply determinant @@ -3571,6 +3752,7 @@ func renderModeReply(buf []byte) *RenderModeReply { } // Write request to wire for RenderMode +// renderModeRequest writes a RenderMode request to a byte slice. func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { size := 12 b := 0 @@ -3594,33 +3776,35 @@ func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { return buf } -// Request Finish -// size: 8 +// FinishCookie is a cookie used only for Finish requests. type FinishCookie struct { *xgb.Cookie } +// Finish sends a checked request. +// If an error occurs, it will be returned with the reply by calling FinishCookie.Reply() func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { cookie := c.NewCookie(true, true) c.NewRequest(finishRequest(c, ContextTag), cookie) return FinishCookie{cookie} } +// FinishUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { cookie := c.NewCookie(false, true) c.NewRequest(finishRequest(c, ContextTag), cookie) return FinishCookie{cookie} } -// Request reply for Finish -// size: 8 +// FinishReply represents the data returned from a Finish request. type FinishReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes } -// Waits and reads reply data from request Finish +// Reply blocks and returns the reply data for a Finish request. func (cook FinishCookie) Reply() (*FinishReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3632,7 +3816,7 @@ func (cook FinishCookie) Reply() (*FinishReply, error) { return finishReply(buf), nil } -// Read reply into structure from buffer for Finish +// finishReply reads a byte slice into a FinishReply value. func finishReply(buf []byte) *FinishReply { v := new(FinishReply) b := 1 // skip reply determinant @@ -3649,6 +3833,7 @@ func finishReply(buf []byte) *FinishReply { } // Write request to wire for Finish +// finishRequest writes a Finish request to a byte slice. func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -3669,30 +3854,35 @@ func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request PixelStoref -// size: 16 +// PixelStorefCookie is a cookie used only for PixelStoref requests. type PixelStorefCookie struct { *xgb.Cookie } -// Write request to wire for PixelStoref +// PixelStoref sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { cookie := c.NewCookie(false, false) c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) return PixelStorefCookie{cookie} } +// PixelStorefChecked sends a checked request. +// If an error occurs, it can be retrieved using PixelStorefCookie.Check() func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { cookie := c.NewCookie(true, false) c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) return PixelStorefCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PixelStorefCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PixelStoref +// pixelStorefRequest writes a PixelStoref request to a byte slice. func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) []byte { size := 16 b := 0 @@ -3719,30 +3909,35 @@ func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum return buf } -// Request PixelStorei -// size: 16 +// PixelStoreiCookie is a cookie used only for PixelStorei requests. type PixelStoreiCookie struct { *xgb.Cookie } -// Write request to wire for PixelStorei +// PixelStorei sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { cookie := c.NewCookie(false, false) c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) return PixelStoreiCookie{cookie} } +// PixelStoreiChecked sends a checked request. +// If an error occurs, it can be retrieved using PixelStoreiCookie.Check() func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { cookie := c.NewCookie(true, false) c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) return PixelStoreiCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PixelStoreiCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PixelStorei +// pixelStoreiRequest writes a PixelStorei request to a byte slice. func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) []byte { size := 16 b := 0 @@ -3769,35 +3964,37 @@ func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum return buf } -// Request ReadPixels -// size: 36 +// ReadPixelsCookie is a cookie used only for ReadPixels requests. type ReadPixelsCookie struct { *xgb.Cookie } +// ReadPixels sends a checked request. +// If an error occurs, it will be returned with the reply by calling ReadPixelsCookie.Reply() func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { cookie := c.NewCookie(true, true) c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) return ReadPixelsCookie{cookie} } +// ReadPixelsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { cookie := c.NewCookie(false, true) c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) return ReadPixelsCookie{cookie} } -// Request reply for ReadPixels -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// ReadPixelsReply represents the data returned from a ReadPixels request. type ReadPixelsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request ReadPixels +// Reply blocks and returns the reply data for a ReadPixels request. func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3809,7 +4006,7 @@ func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { return readPixelsReply(buf), nil } -// Read reply into structure from buffer for ReadPixels +// readPixelsReply reads a byte slice into a ReadPixelsReply value. func readPixelsReply(buf []byte) *ReadPixelsReply { v := new(ReadPixelsReply) b := 1 // skip reply determinant @@ -3832,6 +4029,7 @@ func readPixelsReply(buf []byte) *ReadPixelsReply { } // Write request to wire for ReadPixels +// readPixelsRequest writes a ReadPixels request to a byte slice. func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { size := 36 b := 0 @@ -3884,29 +4082,31 @@ func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Wid return buf } -// Request GetBooleanv -// size: 12 +// GetBooleanvCookie is a cookie used only for GetBooleanv requests. type GetBooleanvCookie struct { *xgb.Cookie } +// GetBooleanv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetBooleanvCookie.Reply() func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) return GetBooleanvCookie{cookie} } +// GetBooleanvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBooleanvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) return GetBooleanvCookie{cookie} } -// Request reply for GetBooleanv -// size: (32 + xgb.Pad((int(N) * 1))) +// GetBooleanvReply represents the data returned from a GetBooleanv request. type GetBooleanvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -3915,7 +4115,7 @@ type GetBooleanvReply struct { Data []bool // size: xgb.Pad((int(N) * 1)) } -// Waits and reads reply data from request GetBooleanv +// Reply blocks and returns the reply data for a GetBooleanv request. func (cook GetBooleanvCookie) Reply() (*GetBooleanvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3927,7 +4127,7 @@ func (cook GetBooleanvCookie) Reply() (*GetBooleanvReply, error) { return getBooleanvReply(buf), nil } -// Read reply into structure from buffer for GetBooleanv +// getBooleanvReply reads a byte slice into a GetBooleanvReply value. func getBooleanvReply(buf []byte) *GetBooleanvReply { v := new(GetBooleanvReply) b := 1 // skip reply determinant @@ -3969,6 +4169,7 @@ func getBooleanvReply(buf []byte) *GetBooleanvReply { } // Write request to wire for GetBooleanv +// getBooleanvRequest writes a GetBooleanv request to a byte slice. func getBooleanvRequest(c *xgb.Conn, ContextTag ContextTag, Pname int32) []byte { size := 12 b := 0 @@ -3992,35 +4193,37 @@ func getBooleanvRequest(c *xgb.Conn, ContextTag ContextTag, Pname int32) []byte return buf } -// Request GetClipPlane -// size: 12 +// GetClipPlaneCookie is a cookie used only for GetClipPlane requests. type GetClipPlaneCookie struct { *xgb.Cookie } +// GetClipPlane sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetClipPlaneCookie.Reply() func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { cookie := c.NewCookie(true, true) c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) return GetClipPlaneCookie{cookie} } +// GetClipPlaneUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClipPlaneUnchecked(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { cookie := c.NewCookie(false, true) c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) return GetClipPlaneCookie{cookie} } -// Request reply for GetClipPlane -// size: (32 + xgb.Pad(((int(Length) / 2) * 8))) +// GetClipPlaneReply represents the data returned from a GetClipPlane request. type GetClipPlaneReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []Float64 // size: xgb.Pad(((int(Length) / 2) * 8)) } -// Waits and reads reply data from request GetClipPlane +// Reply blocks and returns the reply data for a GetClipPlane request. func (cook GetClipPlaneCookie) Reply() (*GetClipPlaneReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4032,7 +4235,7 @@ func (cook GetClipPlaneCookie) Reply() (*GetClipPlaneReply, error) { return getClipPlaneReply(buf), nil } -// Read reply into structure from buffer for GetClipPlane +// getClipPlaneReply reads a byte slice into a GetClipPlaneReply value. func getClipPlaneReply(buf []byte) *GetClipPlaneReply { v := new(GetClipPlaneReply) b := 1 // skip reply determinant @@ -4058,6 +4261,7 @@ func getClipPlaneReply(buf []byte) *GetClipPlaneReply { } // Write request to wire for GetClipPlane +// getClipPlaneRequest writes a GetClipPlane request to a byte slice. func getClipPlaneRequest(c *xgb.Conn, ContextTag ContextTag, Plane int32) []byte { size := 12 b := 0 @@ -4081,29 +4285,31 @@ func getClipPlaneRequest(c *xgb.Conn, ContextTag ContextTag, Plane int32) []byte return buf } -// Request GetDoublev -// size: 12 +// GetDoublevCookie is a cookie used only for GetDoublev requests. type GetDoublevCookie struct { *xgb.Cookie } +// GetDoublev sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDoublevCookie.Reply() func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) return GetDoublevCookie{cookie} } +// GetDoublevUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDoublevUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) return GetDoublevCookie{cookie} } -// Request reply for GetDoublev -// size: (32 + xgb.Pad((int(N) * 8))) +// GetDoublevReply represents the data returned from a GetDoublev request. type GetDoublevReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4112,7 +4318,7 @@ type GetDoublevReply struct { Data []Float64 // size: xgb.Pad((int(N) * 8)) } -// Waits and reads reply data from request GetDoublev +// Reply blocks and returns the reply data for a GetDoublev request. func (cook GetDoublevCookie) Reply() (*GetDoublevReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4124,7 +4330,7 @@ func (cook GetDoublevCookie) Reply() (*GetDoublevReply, error) { return getDoublevReply(buf), nil } -// Read reply into structure from buffer for GetDoublev +// getDoublevReply reads a byte slice into a GetDoublevReply value. func getDoublevReply(buf []byte) *GetDoublevReply { v := new(GetDoublevReply) b := 1 // skip reply determinant @@ -4158,6 +4364,7 @@ func getDoublevReply(buf []byte) *GetDoublevReply { } // Write request to wire for GetDoublev +// getDoublevRequest writes a GetDoublev request to a byte slice. func getDoublevRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { size := 12 b := 0 @@ -4181,34 +4388,36 @@ func getDoublevRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte return buf } -// Request GetError -// size: 8 +// GetErrorCookie is a cookie used only for GetError requests. type GetErrorCookie struct { *xgb.Cookie } +// GetError sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetErrorCookie.Reply() func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { cookie := c.NewCookie(true, true) c.NewRequest(getErrorRequest(c, ContextTag), cookie) return GetErrorCookie{cookie} } +// GetErrorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetErrorUnchecked(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { cookie := c.NewCookie(false, true) c.NewRequest(getErrorRequest(c, ContextTag), cookie) return GetErrorCookie{cookie} } -// Request reply for GetError -// size: 12 +// GetErrorReply represents the data returned from a GetError request. type GetErrorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Error int32 } -// Waits and reads reply data from request GetError +// Reply blocks and returns the reply data for a GetError request. func (cook GetErrorCookie) Reply() (*GetErrorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4220,7 +4429,7 @@ func (cook GetErrorCookie) Reply() (*GetErrorReply, error) { return getErrorReply(buf), nil } -// Read reply into structure from buffer for GetError +// getErrorReply reads a byte slice into a GetErrorReply value. func getErrorReply(buf []byte) *GetErrorReply { v := new(GetErrorReply) b := 1 // skip reply determinant @@ -4240,6 +4449,7 @@ func getErrorReply(buf []byte) *GetErrorReply { } // Write request to wire for GetError +// getErrorRequest writes a GetError request to a byte slice. func getErrorRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -4260,29 +4470,31 @@ func getErrorRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request GetFloatv -// size: 12 +// GetFloatvCookie is a cookie used only for GetFloatv requests. type GetFloatvCookie struct { *xgb.Cookie } +// GetFloatv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFloatvCookie.Reply() func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) return GetFloatvCookie{cookie} } +// GetFloatvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFloatvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) return GetFloatvCookie{cookie} } -// Request reply for GetFloatv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetFloatvReply represents the data returned from a GetFloatv request. type GetFloatvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4291,7 +4503,7 @@ type GetFloatvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetFloatv +// Reply blocks and returns the reply data for a GetFloatv request. func (cook GetFloatvCookie) Reply() (*GetFloatvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4303,7 +4515,7 @@ func (cook GetFloatvCookie) Reply() (*GetFloatvReply, error) { return getFloatvReply(buf), nil } -// Read reply into structure from buffer for GetFloatv +// getFloatvReply reads a byte slice into a GetFloatvReply value. func getFloatvReply(buf []byte) *GetFloatvReply { v := new(GetFloatvReply) b := 1 // skip reply determinant @@ -4337,6 +4549,7 @@ func getFloatvReply(buf []byte) *GetFloatvReply { } // Write request to wire for GetFloatv +// getFloatvRequest writes a GetFloatv request to a byte slice. func getFloatvRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { size := 12 b := 0 @@ -4360,29 +4573,31 @@ func getFloatvRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { return buf } -// Request GetIntegerv -// size: 12 +// GetIntegervCookie is a cookie used only for GetIntegerv requests. type GetIntegervCookie struct { *xgb.Cookie } +// GetIntegerv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetIntegervCookie.Reply() func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { cookie := c.NewCookie(true, true) c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) return GetIntegervCookie{cookie} } +// GetIntegervUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetIntegervUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { cookie := c.NewCookie(false, true) c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) return GetIntegervCookie{cookie} } -// Request reply for GetIntegerv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetIntegervReply represents the data returned from a GetIntegerv request. type GetIntegervReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4391,7 +4606,7 @@ type GetIntegervReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetIntegerv +// Reply blocks and returns the reply data for a GetIntegerv request. func (cook GetIntegervCookie) Reply() (*GetIntegervReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4403,7 +4618,7 @@ func (cook GetIntegervCookie) Reply() (*GetIntegervReply, error) { return getIntegervReply(buf), nil } -// Read reply into structure from buffer for GetIntegerv +// getIntegervReply reads a byte slice into a GetIntegervReply value. func getIntegervReply(buf []byte) *GetIntegervReply { v := new(GetIntegervReply) b := 1 // skip reply determinant @@ -4437,6 +4652,7 @@ func getIntegervReply(buf []byte) *GetIntegervReply { } // Write request to wire for GetIntegerv +// getIntegervRequest writes a GetIntegerv request to a byte slice. func getIntegervRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { size := 12 b := 0 @@ -4460,29 +4676,31 @@ func getIntegervRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte return buf } -// Request GetLightfv -// size: 16 +// GetLightfvCookie is a cookie used only for GetLightfv requests. type GetLightfvCookie struct { *xgb.Cookie } +// GetLightfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetLightfvCookie.Reply() func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) return GetLightfvCookie{cookie} } +// GetLightfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) return GetLightfvCookie{cookie} } -// Request reply for GetLightfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetLightfvReply represents the data returned from a GetLightfv request. type GetLightfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4491,7 +4709,7 @@ type GetLightfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetLightfv +// Reply blocks and returns the reply data for a GetLightfv request. func (cook GetLightfvCookie) Reply() (*GetLightfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4503,7 +4721,7 @@ func (cook GetLightfvCookie) Reply() (*GetLightfvReply, error) { return getLightfvReply(buf), nil } -// Read reply into structure from buffer for GetLightfv +// getLightfvReply reads a byte slice into a GetLightfvReply value. func getLightfvReply(buf []byte) *GetLightfvReply { v := new(GetLightfvReply) b := 1 // skip reply determinant @@ -4537,6 +4755,7 @@ func getLightfvReply(buf []byte) *GetLightfvReply { } // Write request to wire for GetLightfv +// getLightfvRequest writes a GetLightfv request to a byte slice. func getLightfvRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) []byte { size := 16 b := 0 @@ -4563,29 +4782,31 @@ func getLightfvRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname u return buf } -// Request GetLightiv -// size: 16 +// GetLightivCookie is a cookie used only for GetLightiv requests. type GetLightivCookie struct { *xgb.Cookie } +// GetLightiv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetLightivCookie.Reply() func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) return GetLightivCookie{cookie} } +// GetLightivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightivUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) return GetLightivCookie{cookie} } -// Request reply for GetLightiv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetLightivReply represents the data returned from a GetLightiv request. type GetLightivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4594,7 +4815,7 @@ type GetLightivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetLightiv +// Reply blocks and returns the reply data for a GetLightiv request. func (cook GetLightivCookie) Reply() (*GetLightivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4606,7 +4827,7 @@ func (cook GetLightivCookie) Reply() (*GetLightivReply, error) { return getLightivReply(buf), nil } -// Read reply into structure from buffer for GetLightiv +// getLightivReply reads a byte slice into a GetLightivReply value. func getLightivReply(buf []byte) *GetLightivReply { v := new(GetLightivReply) b := 1 // skip reply determinant @@ -4640,6 +4861,7 @@ func getLightivReply(buf []byte) *GetLightivReply { } // Write request to wire for GetLightiv +// getLightivRequest writes a GetLightiv request to a byte slice. func getLightivRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) []byte { size := 16 b := 0 @@ -4666,29 +4888,31 @@ func getLightivRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname u return buf } -// Request GetMapdv -// size: 16 +// GetMapdvCookie is a cookie used only for GetMapdv requests. type GetMapdvCookie struct { *xgb.Cookie } +// GetMapdv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMapdvCookie.Reply() func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) return GetMapdvCookie{cookie} } +// GetMapdvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapdvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) return GetMapdvCookie{cookie} } -// Request reply for GetMapdv -// size: (32 + xgb.Pad((int(N) * 8))) +// GetMapdvReply represents the data returned from a GetMapdv request. type GetMapdvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4697,7 +4921,7 @@ type GetMapdvReply struct { Data []Float64 // size: xgb.Pad((int(N) * 8)) } -// Waits and reads reply data from request GetMapdv +// Reply blocks and returns the reply data for a GetMapdv request. func (cook GetMapdvCookie) Reply() (*GetMapdvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4709,7 +4933,7 @@ func (cook GetMapdvCookie) Reply() (*GetMapdvReply, error) { return getMapdvReply(buf), nil } -// Read reply into structure from buffer for GetMapdv +// getMapdvReply reads a byte slice into a GetMapdvReply value. func getMapdvReply(buf []byte) *GetMapdvReply { v := new(GetMapdvReply) b := 1 // skip reply determinant @@ -4743,6 +4967,7 @@ func getMapdvReply(buf []byte) *GetMapdvReply { } // Write request to wire for GetMapdv +// getMapdvRequest writes a GetMapdv request to a byte slice. func getMapdvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { size := 16 b := 0 @@ -4769,29 +4994,31 @@ func getMapdvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui return buf } -// Request GetMapfv -// size: 16 +// GetMapfvCookie is a cookie used only for GetMapfv requests. type GetMapfvCookie struct { *xgb.Cookie } +// GetMapfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMapfvCookie.Reply() func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) return GetMapfvCookie{cookie} } +// GetMapfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) return GetMapfvCookie{cookie} } -// Request reply for GetMapfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMapfvReply represents the data returned from a GetMapfv request. type GetMapfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4800,7 +5027,7 @@ type GetMapfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMapfv +// Reply blocks and returns the reply data for a GetMapfv request. func (cook GetMapfvCookie) Reply() (*GetMapfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4812,7 +5039,7 @@ func (cook GetMapfvCookie) Reply() (*GetMapfvReply, error) { return getMapfvReply(buf), nil } -// Read reply into structure from buffer for GetMapfv +// getMapfvReply reads a byte slice into a GetMapfvReply value. func getMapfvReply(buf []byte) *GetMapfvReply { v := new(GetMapfvReply) b := 1 // skip reply determinant @@ -4846,6 +5073,7 @@ func getMapfvReply(buf []byte) *GetMapfvReply { } // Write request to wire for GetMapfv +// getMapfvRequest writes a GetMapfv request to a byte slice. func getMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { size := 16 b := 0 @@ -4872,29 +5100,31 @@ func getMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui return buf } -// Request GetMapiv -// size: 16 +// GetMapivCookie is a cookie used only for GetMapiv requests. type GetMapivCookie struct { *xgb.Cookie } +// GetMapiv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMapivCookie.Reply() func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) return GetMapivCookie{cookie} } +// GetMapivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) return GetMapivCookie{cookie} } -// Request reply for GetMapiv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMapivReply represents the data returned from a GetMapiv request. type GetMapivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -4903,7 +5133,7 @@ type GetMapivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMapiv +// Reply blocks and returns the reply data for a GetMapiv request. func (cook GetMapivCookie) Reply() (*GetMapivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4915,7 +5145,7 @@ func (cook GetMapivCookie) Reply() (*GetMapivReply, error) { return getMapivReply(buf), nil } -// Read reply into structure from buffer for GetMapiv +// getMapivReply reads a byte slice into a GetMapivReply value. func getMapivReply(buf []byte) *GetMapivReply { v := new(GetMapivReply) b := 1 // skip reply determinant @@ -4949,6 +5179,7 @@ func getMapivReply(buf []byte) *GetMapivReply { } // Write request to wire for GetMapiv +// getMapivRequest writes a GetMapiv request to a byte slice. func getMapivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) []byte { size := 16 b := 0 @@ -4975,29 +5206,31 @@ func getMapivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui return buf } -// Request GetMaterialfv -// size: 16 +// GetMaterialfvCookie is a cookie used only for GetMaterialfv requests. type GetMaterialfvCookie struct { *xgb.Cookie } +// GetMaterialfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMaterialfvCookie.Reply() func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialfvCookie{cookie} } +// GetMaterialfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialfvCookie{cookie} } -// Request reply for GetMaterialfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMaterialfvReply represents the data returned from a GetMaterialfv request. type GetMaterialfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5006,7 +5239,7 @@ type GetMaterialfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMaterialfv +// Reply blocks and returns the reply data for a GetMaterialfv request. func (cook GetMaterialfvCookie) Reply() (*GetMaterialfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5018,7 +5251,7 @@ func (cook GetMaterialfvCookie) Reply() (*GetMaterialfvReply, error) { return getMaterialfvReply(buf), nil } -// Read reply into structure from buffer for GetMaterialfv +// getMaterialfvReply reads a byte slice into a GetMaterialfvReply value. func getMaterialfvReply(buf []byte) *GetMaterialfvReply { v := new(GetMaterialfvReply) b := 1 // skip reply determinant @@ -5052,6 +5285,7 @@ func getMaterialfvReply(buf []byte) *GetMaterialfvReply { } // Write request to wire for GetMaterialfv +// getMaterialfvRequest writes a GetMaterialfv request to a byte slice. func getMaterialfvRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) []byte { size := 16 b := 0 @@ -5078,29 +5312,31 @@ func getMaterialfvRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname return buf } -// Request GetMaterialiv -// size: 16 +// GetMaterialivCookie is a cookie used only for GetMaterialiv requests. type GetMaterialivCookie struct { *xgb.Cookie } +// GetMaterialiv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMaterialivCookie.Reply() func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialivCookie{cookie} } +// GetMaterialivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialivUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialivCookie{cookie} } -// Request reply for GetMaterialiv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMaterialivReply represents the data returned from a GetMaterialiv request. type GetMaterialivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5109,7 +5345,7 @@ type GetMaterialivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMaterialiv +// Reply blocks and returns the reply data for a GetMaterialiv request. func (cook GetMaterialivCookie) Reply() (*GetMaterialivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5121,7 +5357,7 @@ func (cook GetMaterialivCookie) Reply() (*GetMaterialivReply, error) { return getMaterialivReply(buf), nil } -// Read reply into structure from buffer for GetMaterialiv +// getMaterialivReply reads a byte slice into a GetMaterialivReply value. func getMaterialivReply(buf []byte) *GetMaterialivReply { v := new(GetMaterialivReply) b := 1 // skip reply determinant @@ -5155,6 +5391,7 @@ func getMaterialivReply(buf []byte) *GetMaterialivReply { } // Write request to wire for GetMaterialiv +// getMaterialivRequest writes a GetMaterialiv request to a byte slice. func getMaterialivRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) []byte { size := 16 b := 0 @@ -5181,29 +5418,31 @@ func getMaterialivRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname return buf } -// Request GetPixelMapfv -// size: 12 +// GetPixelMapfvCookie is a cookie used only for GetPixelMapfv requests. type GetPixelMapfvCookie struct { *xgb.Cookie } +// GetPixelMapfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPixelMapfvCookie.Reply() func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) return GetPixelMapfvCookie{cookie} } +// GetPixelMapfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) return GetPixelMapfvCookie{cookie} } -// Request reply for GetPixelMapfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetPixelMapfvReply represents the data returned from a GetPixelMapfv request. type GetPixelMapfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5212,7 +5451,7 @@ type GetPixelMapfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetPixelMapfv +// Reply blocks and returns the reply data for a GetPixelMapfv request. func (cook GetPixelMapfvCookie) Reply() (*GetPixelMapfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5224,7 +5463,7 @@ func (cook GetPixelMapfvCookie) Reply() (*GetPixelMapfvReply, error) { return getPixelMapfvReply(buf), nil } -// Read reply into structure from buffer for GetPixelMapfv +// getPixelMapfvReply reads a byte slice into a GetPixelMapfvReply value. func getPixelMapfvReply(buf []byte) *GetPixelMapfvReply { v := new(GetPixelMapfvReply) b := 1 // skip reply determinant @@ -5258,6 +5497,7 @@ func getPixelMapfvReply(buf []byte) *GetPixelMapfvReply { } // Write request to wire for GetPixelMapfv +// getPixelMapfvRequest writes a GetPixelMapfv request to a byte slice. func getPixelMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { size := 12 b := 0 @@ -5281,29 +5521,31 @@ func getPixelMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte return buf } -// Request GetPixelMapuiv -// size: 12 +// GetPixelMapuivCookie is a cookie used only for GetPixelMapuiv requests. type GetPixelMapuivCookie struct { *xgb.Cookie } +// GetPixelMapuiv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPixelMapuivCookie.Reply() func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) return GetPixelMapuivCookie{cookie} } +// GetPixelMapuivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapuivUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) return GetPixelMapuivCookie{cookie} } -// Request reply for GetPixelMapuiv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetPixelMapuivReply represents the data returned from a GetPixelMapuiv request. type GetPixelMapuivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5312,7 +5554,7 @@ type GetPixelMapuivReply struct { Data []uint32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetPixelMapuiv +// Reply blocks and returns the reply data for a GetPixelMapuiv request. func (cook GetPixelMapuivCookie) Reply() (*GetPixelMapuivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5324,7 +5566,7 @@ func (cook GetPixelMapuivCookie) Reply() (*GetPixelMapuivReply, error) { return getPixelMapuivReply(buf), nil } -// Read reply into structure from buffer for GetPixelMapuiv +// getPixelMapuivReply reads a byte slice into a GetPixelMapuivReply value. func getPixelMapuivReply(buf []byte) *GetPixelMapuivReply { v := new(GetPixelMapuivReply) b := 1 // skip reply determinant @@ -5358,6 +5600,7 @@ func getPixelMapuivReply(buf []byte) *GetPixelMapuivReply { } // Write request to wire for GetPixelMapuiv +// getPixelMapuivRequest writes a GetPixelMapuiv request to a byte slice. func getPixelMapuivRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { size := 12 b := 0 @@ -5381,29 +5624,31 @@ func getPixelMapuivRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byt return buf } -// Request GetPixelMapusv -// size: 12 +// GetPixelMapusvCookie is a cookie used only for GetPixelMapusv requests. type GetPixelMapusvCookie struct { *xgb.Cookie } +// GetPixelMapusv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPixelMapusvCookie.Reply() func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) return GetPixelMapusvCookie{cookie} } +// GetPixelMapusvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapusvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) return GetPixelMapusvCookie{cookie} } -// Request reply for GetPixelMapusv -// size: (34 + xgb.Pad((int(N) * 2))) +// GetPixelMapusvReply represents the data returned from a GetPixelMapusv request. type GetPixelMapusvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5412,7 +5657,7 @@ type GetPixelMapusvReply struct { Data []uint16 // size: xgb.Pad((int(N) * 2)) } -// Waits and reads reply data from request GetPixelMapusv +// Reply blocks and returns the reply data for a GetPixelMapusv request. func (cook GetPixelMapusvCookie) Reply() (*GetPixelMapusvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5424,7 +5669,7 @@ func (cook GetPixelMapusvCookie) Reply() (*GetPixelMapusvReply, error) { return getPixelMapusvReply(buf), nil } -// Read reply into structure from buffer for GetPixelMapusv +// getPixelMapusvReply reads a byte slice into a GetPixelMapusvReply value. func getPixelMapusvReply(buf []byte) *GetPixelMapusvReply { v := new(GetPixelMapusvReply) b := 1 // skip reply determinant @@ -5458,6 +5703,7 @@ func getPixelMapusvReply(buf []byte) *GetPixelMapusvReply { } // Write request to wire for GetPixelMapusv +// getPixelMapusvRequest writes a GetPixelMapusv request to a byte slice. func getPixelMapusvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte { size := 12 b := 0 @@ -5481,35 +5727,37 @@ func getPixelMapusvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byt return buf } -// Request GetPolygonStipple -// size: 12 +// GetPolygonStippleCookie is a cookie used only for GetPolygonStipple requests. type GetPolygonStippleCookie struct { *xgb.Cookie } +// GetPolygonStipple sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPolygonStippleCookie.Reply() func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) return GetPolygonStippleCookie{cookie} } +// GetPolygonStippleUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPolygonStippleUnchecked(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) return GetPolygonStippleCookie{cookie} } -// Request reply for GetPolygonStipple -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetPolygonStippleReply represents the data returned from a GetPolygonStipple request. type GetPolygonStippleReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetPolygonStipple +// Reply blocks and returns the reply data for a GetPolygonStipple request. func (cook GetPolygonStippleCookie) Reply() (*GetPolygonStippleReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5521,7 +5769,7 @@ func (cook GetPolygonStippleCookie) Reply() (*GetPolygonStippleReply, error) { return getPolygonStippleReply(buf), nil } -// Read reply into structure from buffer for GetPolygonStipple +// getPolygonStippleReply reads a byte slice into a GetPolygonStippleReply value. func getPolygonStippleReply(buf []byte) *GetPolygonStippleReply { v := new(GetPolygonStippleReply) b := 1 // skip reply determinant @@ -5544,6 +5792,7 @@ func getPolygonStippleReply(buf []byte) *GetPolygonStippleReply { } // Write request to wire for GetPolygonStipple +// getPolygonStippleRequest writes a GetPolygonStipple request to a byte slice. func getPolygonStippleRequest(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) []byte { size := 12 b := 0 @@ -5571,29 +5820,31 @@ func getPolygonStippleRequest(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) return buf } -// Request GetString -// size: 12 +// GetStringCookie is a cookie used only for GetString requests. type GetStringCookie struct { *xgb.Cookie } +// GetString sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetStringCookie.Reply() func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { cookie := c.NewCookie(true, true) c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) return GetStringCookie{cookie} } +// GetStringUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStringUnchecked(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { cookie := c.NewCookie(false, true) c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) return GetStringCookie{cookie} } -// Request reply for GetString -// size: (32 + xgb.Pad((int(N) * 1))) +// GetStringReply represents the data returned from a GetString request. type GetStringReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5601,7 +5852,7 @@ type GetStringReply struct { String string // size: xgb.Pad((int(N) * 1)) } -// Waits and reads reply data from request GetString +// Reply blocks and returns the reply data for a GetString request. func (cook GetStringCookie) Reply() (*GetStringReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5613,7 +5864,7 @@ func (cook GetStringCookie) Reply() (*GetStringReply, error) { return getStringReply(buf), nil } -// Read reply into structure from buffer for GetString +// getStringReply reads a byte slice into a GetStringReply value. func getStringReply(buf []byte) *GetStringReply { v := new(GetStringReply) b := 1 // skip reply determinant @@ -5644,6 +5895,7 @@ func getStringReply(buf []byte) *GetStringReply { } // Write request to wire for GetString +// getStringRequest writes a GetString request to a byte slice. func getStringRequest(c *xgb.Conn, ContextTag ContextTag, Name uint32) []byte { size := 12 b := 0 @@ -5667,29 +5919,31 @@ func getStringRequest(c *xgb.Conn, ContextTag ContextTag, Name uint32) []byte { return buf } -// Request GetTexEnvfv -// size: 16 +// GetTexEnvfvCookie is a cookie used only for GetTexEnvfv requests. type GetTexEnvfvCookie struct { *xgb.Cookie } +// GetTexEnvfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexEnvfvCookie.Reply() func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvfvCookie{cookie} } +// GetTexEnvfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvfvCookie{cookie} } -// Request reply for GetTexEnvfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexEnvfvReply represents the data returned from a GetTexEnvfv request. type GetTexEnvfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5698,7 +5952,7 @@ type GetTexEnvfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexEnvfv +// Reply blocks and returns the reply data for a GetTexEnvfv request. func (cook GetTexEnvfvCookie) Reply() (*GetTexEnvfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5710,7 +5964,7 @@ func (cook GetTexEnvfvCookie) Reply() (*GetTexEnvfvReply, error) { return getTexEnvfvReply(buf), nil } -// Read reply into structure from buffer for GetTexEnvfv +// getTexEnvfvReply reads a byte slice into a GetTexEnvfvReply value. func getTexEnvfvReply(buf []byte) *GetTexEnvfvReply { v := new(GetTexEnvfvReply) b := 1 // skip reply determinant @@ -5744,6 +5998,7 @@ func getTexEnvfvReply(buf []byte) *GetTexEnvfvReply { } // Write request to wire for GetTexEnvfv +// getTexEnvfvRequest writes a GetTexEnvfv request to a byte slice. func getTexEnvfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -5770,29 +6025,31 @@ func getTexEnvfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname return buf } -// Request GetTexEnviv -// size: 16 +// GetTexEnvivCookie is a cookie used only for GetTexEnviv requests. type GetTexEnvivCookie struct { *xgb.Cookie } +// GetTexEnviv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexEnvivCookie.Reply() func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvivCookie{cookie} } +// GetTexEnvivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvivCookie{cookie} } -// Request reply for GetTexEnviv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexEnvivReply represents the data returned from a GetTexEnviv request. type GetTexEnvivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5801,7 +6058,7 @@ type GetTexEnvivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexEnviv +// Reply blocks and returns the reply data for a GetTexEnviv request. func (cook GetTexEnvivCookie) Reply() (*GetTexEnvivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5813,7 +6070,7 @@ func (cook GetTexEnvivCookie) Reply() (*GetTexEnvivReply, error) { return getTexEnvivReply(buf), nil } -// Read reply into structure from buffer for GetTexEnviv +// getTexEnvivReply reads a byte slice into a GetTexEnvivReply value. func getTexEnvivReply(buf []byte) *GetTexEnvivReply { v := new(GetTexEnvivReply) b := 1 // skip reply determinant @@ -5847,6 +6104,7 @@ func getTexEnvivReply(buf []byte) *GetTexEnvivReply { } // Write request to wire for GetTexEnviv +// getTexEnvivRequest writes a GetTexEnviv request to a byte slice. func getTexEnvivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -5873,29 +6131,31 @@ func getTexEnvivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname return buf } -// Request GetTexGendv -// size: 16 +// GetTexGendvCookie is a cookie used only for GetTexGendv requests. type GetTexGendvCookie struct { *xgb.Cookie } +// GetTexGendv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexGendvCookie.Reply() func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGendvCookie{cookie} } +// GetTexGendvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGendvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGendvCookie{cookie} } -// Request reply for GetTexGendv -// size: (32 + xgb.Pad((int(N) * 8))) +// GetTexGendvReply represents the data returned from a GetTexGendv request. type GetTexGendvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -5904,7 +6164,7 @@ type GetTexGendvReply struct { Data []Float64 // size: xgb.Pad((int(N) * 8)) } -// Waits and reads reply data from request GetTexGendv +// Reply blocks and returns the reply data for a GetTexGendv request. func (cook GetTexGendvCookie) Reply() (*GetTexGendvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5916,7 +6176,7 @@ func (cook GetTexGendvCookie) Reply() (*GetTexGendvReply, error) { return getTexGendvReply(buf), nil } -// Read reply into structure from buffer for GetTexGendv +// getTexGendvReply reads a byte slice into a GetTexGendvReply value. func getTexGendvReply(buf []byte) *GetTexGendvReply { v := new(GetTexGendvReply) b := 1 // skip reply determinant @@ -5950,6 +6210,7 @@ func getTexGendvReply(buf []byte) *GetTexGendvReply { } // Write request to wire for GetTexGendv +// getTexGendvRequest writes a GetTexGendv request to a byte slice. func getTexGendvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { size := 16 b := 0 @@ -5976,29 +6237,31 @@ func getTexGendvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname return buf } -// Request GetTexGenfv -// size: 16 +// GetTexGenfvCookie is a cookie used only for GetTexGenfv requests. type GetTexGenfvCookie struct { *xgb.Cookie } +// GetTexGenfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexGenfvCookie.Reply() func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenfvCookie{cookie} } +// GetTexGenfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenfvCookie{cookie} } -// Request reply for GetTexGenfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexGenfvReply represents the data returned from a GetTexGenfv request. type GetTexGenfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6007,7 +6270,7 @@ type GetTexGenfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexGenfv +// Reply blocks and returns the reply data for a GetTexGenfv request. func (cook GetTexGenfvCookie) Reply() (*GetTexGenfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6019,7 +6282,7 @@ func (cook GetTexGenfvCookie) Reply() (*GetTexGenfvReply, error) { return getTexGenfvReply(buf), nil } -// Read reply into structure from buffer for GetTexGenfv +// getTexGenfvReply reads a byte slice into a GetTexGenfvReply value. func getTexGenfvReply(buf []byte) *GetTexGenfvReply { v := new(GetTexGenfvReply) b := 1 // skip reply determinant @@ -6053,6 +6316,7 @@ func getTexGenfvReply(buf []byte) *GetTexGenfvReply { } // Write request to wire for GetTexGenfv +// getTexGenfvRequest writes a GetTexGenfv request to a byte slice. func getTexGenfvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { size := 16 b := 0 @@ -6079,29 +6343,31 @@ func getTexGenfvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname return buf } -// Request GetTexGeniv -// size: 16 +// GetTexGenivCookie is a cookie used only for GetTexGeniv requests. type GetTexGenivCookie struct { *xgb.Cookie } +// GetTexGeniv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexGenivCookie.Reply() func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenivCookie{cookie} } +// GetTexGenivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenivUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenivCookie{cookie} } -// Request reply for GetTexGeniv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexGenivReply represents the data returned from a GetTexGeniv request. type GetTexGenivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6110,7 +6376,7 @@ type GetTexGenivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexGeniv +// Reply blocks and returns the reply data for a GetTexGeniv request. func (cook GetTexGenivCookie) Reply() (*GetTexGenivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6122,7 +6388,7 @@ func (cook GetTexGenivCookie) Reply() (*GetTexGenivReply, error) { return getTexGenivReply(buf), nil } -// Read reply into structure from buffer for GetTexGeniv +// getTexGenivReply reads a byte slice into a GetTexGenivReply value. func getTexGenivReply(buf []byte) *GetTexGenivReply { v := new(GetTexGenivReply) b := 1 // skip reply determinant @@ -6156,6 +6422,7 @@ func getTexGenivReply(buf []byte) *GetTexGenivReply { } // Write request to wire for GetTexGeniv +// getTexGenivRequest writes a GetTexGeniv request to a byte slice. func getTexGenivRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) []byte { size := 16 b := 0 @@ -6182,29 +6449,31 @@ func getTexGenivRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname return buf } -// Request GetTexImage -// size: 28 +// GetTexImageCookie is a cookie used only for GetTexImage requests. type GetTexImageCookie struct { *xgb.Cookie } +// GetTexImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexImageCookie.Reply() func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) return GetTexImageCookie{cookie} } +// GetTexImageUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexImageUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) return GetTexImageCookie{cookie} } -// Request reply for GetTexImage -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetTexImageReply represents the data returned from a GetTexImage request. type GetTexImageReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes Width int32 @@ -6214,7 +6483,7 @@ type GetTexImageReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetTexImage +// Reply blocks and returns the reply data for a GetTexImage request. func (cook GetTexImageCookie) Reply() (*GetTexImageReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6226,7 +6495,7 @@ func (cook GetTexImageCookie) Reply() (*GetTexImageReply, error) { return getTexImageReply(buf), nil } -// Read reply into structure from buffer for GetTexImage +// getTexImageReply reads a byte slice into a GetTexImageReply value. func getTexImageReply(buf []byte) *GetTexImageReply { v := new(GetTexImageReply) b := 1 // skip reply determinant @@ -6260,6 +6529,7 @@ func getTexImageReply(buf []byte) *GetTexImageReply { } // Write request to wire for GetTexImage +// getTexImageRequest writes a GetTexImage request to a byte slice. func getTexImageRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) []byte { size := 28 b := 0 @@ -6299,29 +6569,31 @@ func getTexImageRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level return buf } -// Request GetTexParameterfv -// size: 16 +// GetTexParameterfvCookie is a cookie used only for GetTexParameterfv requests. type GetTexParameterfvCookie struct { *xgb.Cookie } +// GetTexParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexParameterfvCookie.Reply() func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterfvCookie{cookie} } +// GetTexParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterfvCookie{cookie} } -// Request reply for GetTexParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexParameterfvReply represents the data returned from a GetTexParameterfv request. type GetTexParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6330,7 +6602,7 @@ type GetTexParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexParameterfv +// Reply blocks and returns the reply data for a GetTexParameterfv request. func (cook GetTexParameterfvCookie) Reply() (*GetTexParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6342,7 +6614,7 @@ func (cook GetTexParameterfvCookie) Reply() (*GetTexParameterfvReply, error) { return getTexParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetTexParameterfv +// getTexParameterfvReply reads a byte slice into a GetTexParameterfvReply value. func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { v := new(GetTexParameterfvReply) b := 1 // skip reply determinant @@ -6376,6 +6648,7 @@ func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { } // Write request to wire for GetTexParameterfv +// getTexParameterfvRequest writes a GetTexParameterfv request to a byte slice. func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -6402,29 +6675,31 @@ func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, return buf } -// Request GetTexParameteriv -// size: 16 +// GetTexParameterivCookie is a cookie used only for GetTexParameteriv requests. type GetTexParameterivCookie struct { *xgb.Cookie } +// GetTexParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexParameterivCookie.Reply() func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterivCookie{cookie} } +// GetTexParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterivCookie{cookie} } -// Request reply for GetTexParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexParameterivReply represents the data returned from a GetTexParameteriv request. type GetTexParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6433,7 +6708,7 @@ type GetTexParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexParameteriv +// Reply blocks and returns the reply data for a GetTexParameteriv request. func (cook GetTexParameterivCookie) Reply() (*GetTexParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6445,7 +6720,7 @@ func (cook GetTexParameterivCookie) Reply() (*GetTexParameterivReply, error) { return getTexParameterivReply(buf), nil } -// Read reply into structure from buffer for GetTexParameteriv +// getTexParameterivReply reads a byte slice into a GetTexParameterivReply value. func getTexParameterivReply(buf []byte) *GetTexParameterivReply { v := new(GetTexParameterivReply) b := 1 // skip reply determinant @@ -6479,6 +6754,7 @@ func getTexParameterivReply(buf []byte) *GetTexParameterivReply { } // Write request to wire for GetTexParameteriv +// getTexParameterivRequest writes a GetTexParameteriv request to a byte slice. func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -6505,29 +6781,31 @@ func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, return buf } -// Request GetTexLevelParameterfv -// size: 20 +// GetTexLevelParameterfvCookie is a cookie used only for GetTexLevelParameterfv requests. type GetTexLevelParameterfvCookie struct { *xgb.Cookie } +// GetTexLevelParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexLevelParameterfvCookie.Reply() func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterfvCookie{cookie} } +// GetTexLevelParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterfvCookie{cookie} } -// Request reply for GetTexLevelParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexLevelParameterfvReply represents the data returned from a GetTexLevelParameterfv request. type GetTexLevelParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6536,7 +6814,7 @@ type GetTexLevelParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexLevelParameterfv +// Reply blocks and returns the reply data for a GetTexLevelParameterfv request. func (cook GetTexLevelParameterfvCookie) Reply() (*GetTexLevelParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6548,7 +6826,7 @@ func (cook GetTexLevelParameterfvCookie) Reply() (*GetTexLevelParameterfvReply, return getTexLevelParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetTexLevelParameterfv +// getTexLevelParameterfvReply reads a byte slice into a GetTexLevelParameterfvReply value. func getTexLevelParameterfvReply(buf []byte) *GetTexLevelParameterfvReply { v := new(GetTexLevelParameterfvReply) b := 1 // skip reply determinant @@ -6582,6 +6860,7 @@ func getTexLevelParameterfvReply(buf []byte) *GetTexLevelParameterfvReply { } // Write request to wire for GetTexLevelParameterfv +// getTexLevelParameterfvRequest writes a GetTexLevelParameterfv request to a byte slice. func getTexLevelParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) []byte { size := 20 b := 0 @@ -6611,29 +6890,31 @@ func getTexLevelParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target ui return buf } -// Request GetTexLevelParameteriv -// size: 20 +// GetTexLevelParameterivCookie is a cookie used only for GetTexLevelParameteriv requests. type GetTexLevelParameterivCookie struct { *xgb.Cookie } +// GetTexLevelParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexLevelParameterivCookie.Reply() func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterivCookie{cookie} } +// GetTexLevelParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterivCookie{cookie} } -// Request reply for GetTexLevelParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetTexLevelParameterivReply represents the data returned from a GetTexLevelParameteriv request. type GetTexLevelParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -6642,7 +6923,7 @@ type GetTexLevelParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetTexLevelParameteriv +// Reply blocks and returns the reply data for a GetTexLevelParameteriv request. func (cook GetTexLevelParameterivCookie) Reply() (*GetTexLevelParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6654,7 +6935,7 @@ func (cook GetTexLevelParameterivCookie) Reply() (*GetTexLevelParameterivReply, return getTexLevelParameterivReply(buf), nil } -// Read reply into structure from buffer for GetTexLevelParameteriv +// getTexLevelParameterivReply reads a byte slice into a GetTexLevelParameterivReply value. func getTexLevelParameterivReply(buf []byte) *GetTexLevelParameterivReply { v := new(GetTexLevelParameterivReply) b := 1 // skip reply determinant @@ -6688,6 +6969,7 @@ func getTexLevelParameterivReply(buf []byte) *GetTexLevelParameterivReply { } // Write request to wire for GetTexLevelParameteriv +// getTexLevelParameterivRequest writes a GetTexLevelParameteriv request to a byte slice. func getTexLevelParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) []byte { size := 20 b := 0 @@ -6717,34 +6999,36 @@ func getTexLevelParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target ui return buf } -// Request IsList -// size: 12 +// IsListCookie is a cookie used only for IsList requests. type IsListCookie struct { *xgb.Cookie } +// IsList sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsListCookie.Reply() func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { cookie := c.NewCookie(true, true) c.NewRequest(isListRequest(c, ContextTag, List), cookie) return IsListCookie{cookie} } +// IsListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsListUnchecked(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { cookie := c.NewCookie(false, true) c.NewRequest(isListRequest(c, ContextTag, List), cookie) return IsListCookie{cookie} } -// Request reply for IsList -// size: 12 +// IsListReply represents the data returned from a IsList request. type IsListReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal Bool32 } -// Waits and reads reply data from request IsList +// Reply blocks and returns the reply data for a IsList request. func (cook IsListCookie) Reply() (*IsListReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6756,7 +7040,7 @@ func (cook IsListCookie) Reply() (*IsListReply, error) { return isListReply(buf), nil } -// Read reply into structure from buffer for IsList +// isListReply reads a byte slice into a IsListReply value. func isListReply(buf []byte) *IsListReply { v := new(IsListReply) b := 1 // skip reply determinant @@ -6776,6 +7060,7 @@ func isListReply(buf []byte) *IsListReply { } // Write request to wire for IsList +// isListRequest writes a IsList request to a byte slice. func isListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32) []byte { size := 12 b := 0 @@ -6799,30 +7084,35 @@ func isListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32) []byte { return buf } -// Request Flush -// size: 8 +// FlushCookie is a cookie used only for Flush requests. type FlushCookie struct { *xgb.Cookie } -// Write request to wire for Flush +// Flush sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { cookie := c.NewCookie(false, false) c.NewRequest(flushRequest(c, ContextTag), cookie) return FlushCookie{cookie} } +// FlushChecked sends a checked request. +// If an error occurs, it can be retrieved using FlushCookie.Check() func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { cookie := c.NewCookie(true, false) c.NewRequest(flushRequest(c, ContextTag), cookie) return FlushCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FlushCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Flush +// flushRequest writes a Flush request to a byte slice. func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { size := 8 b := 0 @@ -6843,36 +7133,38 @@ func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// Request AreTexturesResident -// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +// AreTexturesResidentCookie is a cookie used only for AreTexturesResident requests. type AreTexturesResidentCookie struct { *xgb.Cookie } +// AreTexturesResident sends a checked request. +// If an error occurs, it will be returned with the reply by calling AreTexturesResidentCookie.Reply() func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { cookie := c.NewCookie(true, true) c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) return AreTexturesResidentCookie{cookie} } +// AreTexturesResidentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { cookie := c.NewCookie(false, true) c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) return AreTexturesResidentCookie{cookie} } -// Request reply for AreTexturesResident -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// AreTexturesResidentReply represents the data returned from a AreTexturesResident request. type AreTexturesResidentReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal Bool32 // padding: 20 bytes Data []bool // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request AreTexturesResident +// Reply blocks and returns the reply data for a AreTexturesResident request. func (cook AreTexturesResidentCookie) Reply() (*AreTexturesResidentReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6884,7 +7176,7 @@ func (cook AreTexturesResidentCookie) Reply() (*AreTexturesResidentReply, error) return areTexturesResidentReply(buf), nil } -// Read reply into structure from buffer for AreTexturesResident +// areTexturesResidentReply reads a byte slice into a AreTexturesResidentReply value. func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { v := new(AreTexturesResidentReply) b := 1 // skip reply determinant @@ -6917,6 +7209,7 @@ func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { } // Write request to wire for AreTexturesResident +// areTexturesResidentRequest writes a AreTexturesResident request to a byte slice. func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) b := 0 @@ -6946,30 +7239,35 @@ func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Tex return buf } -// Request DeleteTextures -// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +// DeleteTexturesCookie is a cookie used only for DeleteTextures requests. type DeleteTexturesCookie struct { *xgb.Cookie } -// Write request to wire for DeleteTextures +// DeleteTextures sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) return DeleteTexturesCookie{cookie} } +// DeleteTexturesChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteTexturesCookie.Check() func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) return DeleteTexturesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteTexturesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteTextures +// deleteTexturesRequest writes a DeleteTextures request to a byte slice. func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) b := 0 @@ -6999,35 +7297,37 @@ func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures return buf } -// Request GenTextures -// size: 12 +// GenTexturesCookie is a cookie used only for GenTextures requests. type GenTexturesCookie struct { *xgb.Cookie } +// GenTextures sends a checked request. +// If an error occurs, it will be returned with the reply by calling GenTexturesCookie.Reply() func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { cookie := c.NewCookie(true, true) c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) return GenTexturesCookie{cookie} } +// GenTexturesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { cookie := c.NewCookie(false, true) c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) return GenTexturesCookie{cookie} } -// Request reply for GenTextures -// size: (32 + xgb.Pad((int(Length) * 4))) +// GenTexturesReply represents the data returned from a GenTextures request. type GenTexturesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GenTextures +// Reply blocks and returns the reply data for a GenTextures request. func (cook GenTexturesCookie) Reply() (*GenTexturesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7039,7 +7339,7 @@ func (cook GenTexturesCookie) Reply() (*GenTexturesReply, error) { return genTexturesReply(buf), nil } -// Read reply into structure from buffer for GenTextures +// genTexturesReply reads a byte slice into a GenTexturesReply value. func genTexturesReply(buf []byte) *GenTexturesReply { v := new(GenTexturesReply) b := 1 // skip reply determinant @@ -7065,6 +7365,7 @@ func genTexturesReply(buf []byte) *GenTexturesReply { } // Write request to wire for GenTextures +// genTexturesRequest writes a GenTextures request to a byte slice. func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { size := 12 b := 0 @@ -7088,34 +7389,36 @@ func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { return buf } -// Request IsTexture -// size: 12 +// IsTextureCookie is a cookie used only for IsTexture requests. type IsTextureCookie struct { *xgb.Cookie } +// IsTexture sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsTextureCookie.Reply() func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { cookie := c.NewCookie(true, true) c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) return IsTextureCookie{cookie} } +// IsTextureUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { cookie := c.NewCookie(false, true) c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) return IsTextureCookie{cookie} } -// Request reply for IsTexture -// size: 12 +// IsTextureReply represents the data returned from a IsTexture request. type IsTextureReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal Bool32 } -// Waits and reads reply data from request IsTexture +// Reply blocks and returns the reply data for a IsTexture request. func (cook IsTextureCookie) Reply() (*IsTextureReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7127,7 +7430,7 @@ func (cook IsTextureCookie) Reply() (*IsTextureReply, error) { return isTextureReply(buf), nil } -// Read reply into structure from buffer for IsTexture +// isTextureReply reads a byte slice into a IsTextureReply value. func isTextureReply(buf []byte) *IsTextureReply { v := new(IsTextureReply) b := 1 // skip reply determinant @@ -7147,6 +7450,7 @@ func isTextureReply(buf []byte) *IsTextureReply { } // Write request to wire for IsTexture +// isTextureRequest writes a IsTexture request to a byte slice. func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte { size := 12 b := 0 @@ -7170,29 +7474,31 @@ func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte return buf } -// Request GetColorTable -// size: 24 +// GetColorTableCookie is a cookie used only for GetColorTable requests. type GetColorTableCookie struct { *xgb.Cookie } +// GetColorTable sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableCookie.Reply() func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { cookie := c.NewCookie(true, true) c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetColorTableCookie{cookie} } +// GetColorTableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { cookie := c.NewCookie(false, true) c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetColorTableCookie{cookie} } -// Request reply for GetColorTable -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetColorTableReply represents the data returned from a GetColorTable request. type GetColorTableReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes Width int32 @@ -7200,7 +7506,7 @@ type GetColorTableReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetColorTable +// Reply blocks and returns the reply data for a GetColorTable request. func (cook GetColorTableCookie) Reply() (*GetColorTableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7212,7 +7518,7 @@ func (cook GetColorTableCookie) Reply() (*GetColorTableReply, error) { return getColorTableReply(buf), nil } -// Read reply into structure from buffer for GetColorTable +// getColorTableReply reads a byte slice into a GetColorTableReply value. func getColorTableReply(buf []byte) *GetColorTableReply { v := new(GetColorTableReply) b := 1 // skip reply determinant @@ -7240,6 +7546,7 @@ func getColorTableReply(buf []byte) *GetColorTableReply { } // Write request to wire for GetColorTable +// getColorTableRequest writes a GetColorTable request to a byte slice. func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { size := 24 b := 0 @@ -7276,29 +7583,31 @@ func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, For return buf } -// Request GetColorTableParameterfv -// size: 16 +// GetColorTableParameterfvCookie is a cookie used only for GetColorTableParameterfv requests. type GetColorTableParameterfvCookie struct { *xgb.Cookie } +// GetColorTableParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableParameterfvCookie.Reply() func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterfvCookie{cookie} } +// GetColorTableParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterfvCookie{cookie} } -// Request reply for GetColorTableParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetColorTableParameterfvReply represents the data returned from a GetColorTableParameterfv request. type GetColorTableParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -7307,7 +7616,7 @@ type GetColorTableParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetColorTableParameterfv +// Reply blocks and returns the reply data for a GetColorTableParameterfv request. func (cook GetColorTableParameterfvCookie) Reply() (*GetColorTableParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7319,7 +7628,7 @@ func (cook GetColorTableParameterfvCookie) Reply() (*GetColorTableParameterfvRep return getColorTableParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetColorTableParameterfv +// getColorTableParameterfvReply reads a byte slice into a GetColorTableParameterfvReply value. func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { v := new(GetColorTableParameterfvReply) b := 1 // skip reply determinant @@ -7353,6 +7662,7 @@ func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { } // Write request to wire for GetColorTableParameterfv +// getColorTableParameterfvRequest writes a GetColorTableParameterfv request to a byte slice. func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -7379,29 +7689,31 @@ func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target return buf } -// Request GetColorTableParameteriv -// size: 16 +// GetColorTableParameterivCookie is a cookie used only for GetColorTableParameteriv requests. type GetColorTableParameterivCookie struct { *xgb.Cookie } +// GetColorTableParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableParameterivCookie.Reply() func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterivCookie{cookie} } +// GetColorTableParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterivCookie{cookie} } -// Request reply for GetColorTableParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetColorTableParameterivReply represents the data returned from a GetColorTableParameteriv request. type GetColorTableParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -7410,7 +7722,7 @@ type GetColorTableParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetColorTableParameteriv +// Reply blocks and returns the reply data for a GetColorTableParameteriv request. func (cook GetColorTableParameterivCookie) Reply() (*GetColorTableParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7422,7 +7734,7 @@ func (cook GetColorTableParameterivCookie) Reply() (*GetColorTableParameterivRep return getColorTableParameterivReply(buf), nil } -// Read reply into structure from buffer for GetColorTableParameteriv +// getColorTableParameterivReply reads a byte slice into a GetColorTableParameterivReply value. func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { v := new(GetColorTableParameterivReply) b := 1 // skip reply determinant @@ -7456,6 +7768,7 @@ func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { } // Write request to wire for GetColorTableParameteriv +// getColorTableParameterivRequest writes a GetColorTableParameteriv request to a byte slice. func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -7482,29 +7795,31 @@ func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target return buf } -// Request GetConvolutionFilter -// size: 24 +// GetConvolutionFilterCookie is a cookie used only for GetConvolutionFilter requests. type GetConvolutionFilterCookie struct { *xgb.Cookie } +// GetConvolutionFilter sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionFilterCookie.Reply() func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetConvolutionFilterCookie{cookie} } +// GetConvolutionFilterUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetConvolutionFilterCookie{cookie} } -// Request reply for GetConvolutionFilter -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetConvolutionFilterReply represents the data returned from a GetConvolutionFilter request. type GetConvolutionFilterReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes Width int32 @@ -7513,7 +7828,7 @@ type GetConvolutionFilterReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetConvolutionFilter +// Reply blocks and returns the reply data for a GetConvolutionFilter request. func (cook GetConvolutionFilterCookie) Reply() (*GetConvolutionFilterReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7525,7 +7840,7 @@ func (cook GetConvolutionFilterCookie) Reply() (*GetConvolutionFilterReply, erro return getConvolutionFilterReply(buf), nil } -// Read reply into structure from buffer for GetConvolutionFilter +// getConvolutionFilterReply reads a byte slice into a GetConvolutionFilterReply value. func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { v := new(GetConvolutionFilterReply) b := 1 // skip reply determinant @@ -7556,6 +7871,7 @@ func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { } // Write request to wire for GetConvolutionFilter +// getConvolutionFilterRequest writes a GetConvolutionFilter request to a byte slice. func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { size := 24 b := 0 @@ -7592,29 +7908,31 @@ func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint return buf } -// Request GetConvolutionParameterfv -// size: 16 +// GetConvolutionParameterfvCookie is a cookie used only for GetConvolutionParameterfv requests. type GetConvolutionParameterfvCookie struct { *xgb.Cookie } +// GetConvolutionParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterfvCookie.Reply() func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterfvCookie{cookie} } +// GetConvolutionParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterfvCookie{cookie} } -// Request reply for GetConvolutionParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetConvolutionParameterfvReply represents the data returned from a GetConvolutionParameterfv request. type GetConvolutionParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -7623,7 +7941,7 @@ type GetConvolutionParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetConvolutionParameterfv +// Reply blocks and returns the reply data for a GetConvolutionParameterfv request. func (cook GetConvolutionParameterfvCookie) Reply() (*GetConvolutionParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7635,7 +7953,7 @@ func (cook GetConvolutionParameterfvCookie) Reply() (*GetConvolutionParameterfvR return getConvolutionParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetConvolutionParameterfv +// getConvolutionParameterfvReply reads a byte slice into a GetConvolutionParameterfvReply value. func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply { v := new(GetConvolutionParameterfvReply) b := 1 // skip reply determinant @@ -7669,6 +7987,7 @@ func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply } // Write request to wire for GetConvolutionParameterfv +// getConvolutionParameterfvRequest writes a GetConvolutionParameterfv request to a byte slice. func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -7695,29 +8014,31 @@ func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target return buf } -// Request GetConvolutionParameteriv -// size: 16 +// GetConvolutionParameterivCookie is a cookie used only for GetConvolutionParameteriv requests. type GetConvolutionParameterivCookie struct { *xgb.Cookie } +// GetConvolutionParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterivCookie.Reply() func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterivCookie{cookie} } +// GetConvolutionParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterivCookie{cookie} } -// Request reply for GetConvolutionParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetConvolutionParameterivReply represents the data returned from a GetConvolutionParameteriv request. type GetConvolutionParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -7726,7 +8047,7 @@ type GetConvolutionParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetConvolutionParameteriv +// Reply blocks and returns the reply data for a GetConvolutionParameteriv request. func (cook GetConvolutionParameterivCookie) Reply() (*GetConvolutionParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7738,7 +8059,7 @@ func (cook GetConvolutionParameterivCookie) Reply() (*GetConvolutionParameterivR return getConvolutionParameterivReply(buf), nil } -// Read reply into structure from buffer for GetConvolutionParameteriv +// getConvolutionParameterivReply reads a byte slice into a GetConvolutionParameterivReply value. func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply { v := new(GetConvolutionParameterivReply) b := 1 // skip reply determinant @@ -7772,6 +8093,7 @@ func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply } // Write request to wire for GetConvolutionParameteriv +// getConvolutionParameterivRequest writes a GetConvolutionParameteriv request to a byte slice. func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -7798,29 +8120,31 @@ func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target return buf } -// Request GetSeparableFilter -// size: 24 +// GetSeparableFilterCookie is a cookie used only for GetSeparableFilter requests. type GetSeparableFilterCookie struct { *xgb.Cookie } +// GetSeparableFilter sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSeparableFilterCookie.Reply() func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetSeparableFilterCookie{cookie} } +// GetSeparableFilterUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetSeparableFilterCookie{cookie} } -// Request reply for GetSeparableFilter -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetSeparableFilterReply represents the data returned from a GetSeparableFilter request. type GetSeparableFilterReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes RowW int32 @@ -7829,7 +8153,7 @@ type GetSeparableFilterReply struct { RowsAndCols []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetSeparableFilter +// Reply blocks and returns the reply data for a GetSeparableFilter request. func (cook GetSeparableFilterCookie) Reply() (*GetSeparableFilterReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7841,7 +8165,7 @@ func (cook GetSeparableFilterCookie) Reply() (*GetSeparableFilterReply, error) { return getSeparableFilterReply(buf), nil } -// Read reply into structure from buffer for GetSeparableFilter +// getSeparableFilterReply reads a byte slice into a GetSeparableFilterReply value. func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { v := new(GetSeparableFilterReply) b := 1 // skip reply determinant @@ -7872,6 +8196,7 @@ func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { } // Write request to wire for GetSeparableFilter +// getSeparableFilterRequest writes a GetSeparableFilter request to a byte slice. func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { size := 24 b := 0 @@ -7908,29 +8233,31 @@ func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32 return buf } -// Request GetHistogram -// size: 24 +// GetHistogramCookie is a cookie used only for GetHistogram requests. type GetHistogramCookie struct { *xgb.Cookie } +// GetHistogram sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramCookie.Reply() func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { cookie := c.NewCookie(true, true) c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetHistogramCookie{cookie} } +// GetHistogramUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { cookie := c.NewCookie(false, true) c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetHistogramCookie{cookie} } -// Request reply for GetHistogram -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetHistogramReply represents the data returned from a GetHistogram request. type GetHistogramReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes Width int32 @@ -7938,7 +8265,7 @@ type GetHistogramReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetHistogram +// Reply blocks and returns the reply data for a GetHistogram request. func (cook GetHistogramCookie) Reply() (*GetHistogramReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7950,7 +8277,7 @@ func (cook GetHistogramCookie) Reply() (*GetHistogramReply, error) { return getHistogramReply(buf), nil } -// Read reply into structure from buffer for GetHistogram +// getHistogramReply reads a byte slice into a GetHistogramReply value. func getHistogramReply(buf []byte) *GetHistogramReply { v := new(GetHistogramReply) b := 1 // skip reply determinant @@ -7978,6 +8305,7 @@ func getHistogramReply(buf []byte) *GetHistogramReply { } // Write request to wire for GetHistogram +// getHistogramRequest writes a GetHistogram request to a byte slice. func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { size := 24 b := 0 @@ -8021,29 +8349,31 @@ func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Form return buf } -// Request GetHistogramParameterfv -// size: 16 +// GetHistogramParameterfvCookie is a cookie used only for GetHistogramParameterfv requests. type GetHistogramParameterfvCookie struct { *xgb.Cookie } +// GetHistogramParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramParameterfvCookie.Reply() func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterfvCookie{cookie} } +// GetHistogramParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterfvCookie{cookie} } -// Request reply for GetHistogramParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetHistogramParameterfvReply represents the data returned from a GetHistogramParameterfv request. type GetHistogramParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8052,7 +8382,7 @@ type GetHistogramParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetHistogramParameterfv +// Reply blocks and returns the reply data for a GetHistogramParameterfv request. func (cook GetHistogramParameterfvCookie) Reply() (*GetHistogramParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8064,7 +8394,7 @@ func (cook GetHistogramParameterfvCookie) Reply() (*GetHistogramParameterfvReply return getHistogramParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetHistogramParameterfv +// getHistogramParameterfvReply reads a byte slice into a GetHistogramParameterfvReply value. func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { v := new(GetHistogramParameterfvReply) b := 1 // skip reply determinant @@ -8098,6 +8428,7 @@ func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { } // Write request to wire for GetHistogramParameterfv +// getHistogramParameterfvRequest writes a GetHistogramParameterfv request to a byte slice. func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -8124,29 +8455,31 @@ func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target u return buf } -// Request GetHistogramParameteriv -// size: 16 +// GetHistogramParameterivCookie is a cookie used only for GetHistogramParameteriv requests. type GetHistogramParameterivCookie struct { *xgb.Cookie } +// GetHistogramParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramParameterivCookie.Reply() func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterivCookie{cookie} } +// GetHistogramParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterivCookie{cookie} } -// Request reply for GetHistogramParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetHistogramParameterivReply represents the data returned from a GetHistogramParameteriv request. type GetHistogramParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8155,7 +8488,7 @@ type GetHistogramParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetHistogramParameteriv +// Reply blocks and returns the reply data for a GetHistogramParameteriv request. func (cook GetHistogramParameterivCookie) Reply() (*GetHistogramParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8167,7 +8500,7 @@ func (cook GetHistogramParameterivCookie) Reply() (*GetHistogramParameterivReply return getHistogramParameterivReply(buf), nil } -// Read reply into structure from buffer for GetHistogramParameteriv +// getHistogramParameterivReply reads a byte slice into a GetHistogramParameterivReply value. func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { v := new(GetHistogramParameterivReply) b := 1 // skip reply determinant @@ -8201,6 +8534,7 @@ func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { } // Write request to wire for GetHistogramParameteriv +// getHistogramParameterivRequest writes a GetHistogramParameteriv request to a byte slice. func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -8227,35 +8561,37 @@ func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target u return buf } -// Request GetMinmax -// size: 24 +// GetMinmaxCookie is a cookie used only for GetMinmax requests. type GetMinmaxCookie struct { *xgb.Cookie } +// GetMinmax sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxCookie.Reply() func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetMinmaxCookie{cookie} } +// GetMinmaxUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetMinmaxCookie{cookie} } -// Request reply for GetMinmax -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetMinmaxReply represents the data returned from a GetMinmax request. type GetMinmaxReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetMinmax +// Reply blocks and returns the reply data for a GetMinmax request. func (cook GetMinmaxCookie) Reply() (*GetMinmaxReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8267,7 +8603,7 @@ func (cook GetMinmaxCookie) Reply() (*GetMinmaxReply, error) { return getMinmaxReply(buf), nil } -// Read reply into structure from buffer for GetMinmax +// getMinmaxReply reads a byte slice into a GetMinmaxReply value. func getMinmaxReply(buf []byte) *GetMinmaxReply { v := new(GetMinmaxReply) b := 1 // skip reply determinant @@ -8290,6 +8626,7 @@ func getMinmaxReply(buf []byte) *GetMinmaxReply { } // Write request to wire for GetMinmax +// getMinmaxRequest writes a GetMinmax request to a byte slice. func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { size := 24 b := 0 @@ -8333,29 +8670,31 @@ func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format return buf } -// Request GetMinmaxParameterfv -// size: 16 +// GetMinmaxParameterfvCookie is a cookie used only for GetMinmaxParameterfv requests. type GetMinmaxParameterfvCookie struct { *xgb.Cookie } +// GetMinmaxParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterfvCookie.Reply() func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterfvCookie{cookie} } +// GetMinmaxParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterfvCookie{cookie} } -// Request reply for GetMinmaxParameterfv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMinmaxParameterfvReply represents the data returned from a GetMinmaxParameterfv request. type GetMinmaxParameterfvReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8364,7 +8703,7 @@ type GetMinmaxParameterfvReply struct { Data []Float32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMinmaxParameterfv +// Reply blocks and returns the reply data for a GetMinmaxParameterfv request. func (cook GetMinmaxParameterfvCookie) Reply() (*GetMinmaxParameterfvReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8376,7 +8715,7 @@ func (cook GetMinmaxParameterfvCookie) Reply() (*GetMinmaxParameterfvReply, erro return getMinmaxParameterfvReply(buf), nil } -// Read reply into structure from buffer for GetMinmaxParameterfv +// getMinmaxParameterfvReply reads a byte slice into a GetMinmaxParameterfvReply value. func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { v := new(GetMinmaxParameterfvReply) b := 1 // skip reply determinant @@ -8410,6 +8749,7 @@ func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { } // Write request to wire for GetMinmaxParameterfv +// getMinmaxParameterfvRequest writes a GetMinmaxParameterfv request to a byte slice. func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -8436,29 +8776,31 @@ func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint return buf } -// Request GetMinmaxParameteriv -// size: 16 +// GetMinmaxParameterivCookie is a cookie used only for GetMinmaxParameteriv requests. type GetMinmaxParameterivCookie struct { *xgb.Cookie } +// GetMinmaxParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterivCookie.Reply() func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterivCookie{cookie} } +// GetMinmaxParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterivCookie{cookie} } -// Request reply for GetMinmaxParameteriv -// size: (32 + xgb.Pad((int(N) * 4))) +// GetMinmaxParameterivReply represents the data returned from a GetMinmaxParameteriv request. type GetMinmaxParameterivReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8467,7 +8809,7 @@ type GetMinmaxParameterivReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetMinmaxParameteriv +// Reply blocks and returns the reply data for a GetMinmaxParameteriv request. func (cook GetMinmaxParameterivCookie) Reply() (*GetMinmaxParameterivReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8479,7 +8821,7 @@ func (cook GetMinmaxParameterivCookie) Reply() (*GetMinmaxParameterivReply, erro return getMinmaxParameterivReply(buf), nil } -// Read reply into structure from buffer for GetMinmaxParameteriv +// getMinmaxParameterivReply reads a byte slice into a GetMinmaxParameterivReply value. func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { v := new(GetMinmaxParameterivReply) b := 1 // skip reply determinant @@ -8513,6 +8855,7 @@ func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { } // Write request to wire for GetMinmaxParameteriv +// getMinmaxParameterivRequest writes a GetMinmaxParameteriv request to a byte slice. func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -8539,29 +8882,31 @@ func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint return buf } -// Request GetCompressedTexImageARB -// size: 16 +// GetCompressedTexImageARBCookie is a cookie used only for GetCompressedTexImageARB requests. type GetCompressedTexImageARBCookie struct { *xgb.Cookie } +// GetCompressedTexImageARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCompressedTexImageARBCookie.Reply() func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) return GetCompressedTexImageARBCookie{cookie} } +// GetCompressedTexImageARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) return GetCompressedTexImageARBCookie{cookie} } -// Request reply for GetCompressedTexImageARB -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetCompressedTexImageARBReply represents the data returned from a GetCompressedTexImageARB request. type GetCompressedTexImageARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 8 bytes Size int32 @@ -8569,7 +8914,7 @@ type GetCompressedTexImageARBReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetCompressedTexImageARB +// Reply blocks and returns the reply data for a GetCompressedTexImageARB request. func (cook GetCompressedTexImageARBCookie) Reply() (*GetCompressedTexImageARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8581,7 +8926,7 @@ func (cook GetCompressedTexImageARBCookie) Reply() (*GetCompressedTexImageARBRep return getCompressedTexImageARBReply(buf), nil } -// Read reply into structure from buffer for GetCompressedTexImageARB +// getCompressedTexImageARBReply reads a byte slice into a GetCompressedTexImageARBReply value. func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { v := new(GetCompressedTexImageARBReply) b := 1 // skip reply determinant @@ -8609,6 +8954,7 @@ func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { } // Write request to wire for GetCompressedTexImageARB +// getCompressedTexImageARBRequest writes a GetCompressedTexImageARB request to a byte slice. func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) []byte { size := 16 b := 0 @@ -8635,30 +8981,35 @@ func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target return buf } -// Request DeleteQueriesARB -// size: xgb.Pad((12 + xgb.Pad((int(N) * 4)))) +// DeleteQueriesARBCookie is a cookie used only for DeleteQueriesARB requests. type DeleteQueriesARBCookie struct { *xgb.Cookie } -// Write request to wire for DeleteQueriesARB +// DeleteQueriesARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) return DeleteQueriesARBCookie{cookie} } +// DeleteQueriesARBChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteQueriesARBCookie.Check() func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) return DeleteQueriesARBCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteQueriesARBCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteQueriesARB +// deleteQueriesARBRequest writes a DeleteQueriesARB request to a byte slice. func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) b := 0 @@ -8688,35 +9039,37 @@ func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids [] return buf } -// Request GenQueriesARB -// size: 12 +// GenQueriesARBCookie is a cookie used only for GenQueriesARB requests. type GenQueriesARBCookie struct { *xgb.Cookie } +// GenQueriesARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GenQueriesARBCookie.Reply() func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) return GenQueriesARBCookie{cookie} } +// GenQueriesARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) return GenQueriesARBCookie{cookie} } -// Request reply for GenQueriesARB -// size: (32 + xgb.Pad((int(Length) * 4))) +// GenQueriesARBReply represents the data returned from a GenQueriesARB request. type GenQueriesARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes Data []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GenQueriesARB +// Reply blocks and returns the reply data for a GenQueriesARB request. func (cook GenQueriesARBCookie) Reply() (*GenQueriesARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8728,7 +9081,7 @@ func (cook GenQueriesARBCookie) Reply() (*GenQueriesARBReply, error) { return genQueriesARBReply(buf), nil } -// Read reply into structure from buffer for GenQueriesARB +// genQueriesARBReply reads a byte slice into a GenQueriesARBReply value. func genQueriesARBReply(buf []byte) *GenQueriesARBReply { v := new(GenQueriesARBReply) b := 1 // skip reply determinant @@ -8754,6 +9107,7 @@ func genQueriesARBReply(buf []byte) *GenQueriesARBReply { } // Write request to wire for GenQueriesARB +// genQueriesARBRequest writes a GenQueriesARB request to a byte slice. func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { size := 12 b := 0 @@ -8777,34 +9131,36 @@ func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { return buf } -// Request IsQueryARB -// size: 12 +// IsQueryARBCookie is a cookie used only for IsQueryARB requests. type IsQueryARBCookie struct { *xgb.Cookie } +// IsQueryARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsQueryARBCookie.Reply() func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) return IsQueryARBCookie{cookie} } +// IsQueryARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsQueryARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) return IsQueryARBCookie{cookie} } -// Request reply for IsQueryARB -// size: 12 +// IsQueryARBReply represents the data returned from a IsQueryARB request. type IsQueryARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes RetVal Bool32 } -// Waits and reads reply data from request IsQueryARB +// Reply blocks and returns the reply data for a IsQueryARB request. func (cook IsQueryARBCookie) Reply() (*IsQueryARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8816,7 +9172,7 @@ func (cook IsQueryARBCookie) Reply() (*IsQueryARBReply, error) { return isQueryARBReply(buf), nil } -// Read reply into structure from buffer for IsQueryARB +// isQueryARBReply reads a byte slice into a IsQueryARBReply value. func isQueryARBReply(buf []byte) *IsQueryARBReply { v := new(IsQueryARBReply) b := 1 // skip reply determinant @@ -8836,6 +9192,7 @@ func isQueryARBReply(buf []byte) *IsQueryARBReply { } // Write request to wire for IsQueryARB +// isQueryARBRequest writes a IsQueryARB request to a byte slice. func isQueryARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32) []byte { size := 12 b := 0 @@ -8859,29 +9216,31 @@ func isQueryARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32) []byte { return buf } -// Request GetQueryivARB -// size: 16 +// GetQueryivARBCookie is a cookie used only for GetQueryivARB requests. type GetQueryivARBCookie struct { *xgb.Cookie } +// GetQueryivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryivARBCookie.Reply() func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) return GetQueryivARBCookie{cookie} } +// GetQueryivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) return GetQueryivARBCookie{cookie} } -// Request reply for GetQueryivARB -// size: (32 + xgb.Pad((int(N) * 4))) +// GetQueryivARBReply represents the data returned from a GetQueryivARB request. type GetQueryivARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8890,7 +9249,7 @@ type GetQueryivARBReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetQueryivARB +// Reply blocks and returns the reply data for a GetQueryivARB request. func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8902,7 +9261,7 @@ func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { return getQueryivARBReply(buf), nil } -// Read reply into structure from buffer for GetQueryivARB +// getQueryivARBReply reads a byte slice into a GetQueryivARBReply value. func getQueryivARBReply(buf []byte) *GetQueryivARBReply { v := new(GetQueryivARBReply) b := 1 // skip reply determinant @@ -8936,6 +9295,7 @@ func getQueryivARBReply(buf []byte) *GetQueryivARBReply { } // Write request to wire for GetQueryivARB +// getQueryivARBRequest writes a GetQueryivARB request to a byte slice. func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { size := 16 b := 0 @@ -8962,29 +9322,31 @@ func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna return buf } -// Request GetQueryObjectivARB -// size: 16 +// GetQueryObjectivARBCookie is a cookie used only for GetQueryObjectivARB requests. type GetQueryObjectivARBCookie struct { *xgb.Cookie } +// GetQueryObjectivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryObjectivARBCookie.Reply() func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectivARBCookie{cookie} } +// GetQueryObjectivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectivARBCookie{cookie} } -// Request reply for GetQueryObjectivARB -// size: (32 + xgb.Pad((int(N) * 4))) +// GetQueryObjectivARBReply represents the data returned from a GetQueryObjectivARB request. type GetQueryObjectivARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -8993,7 +9355,7 @@ type GetQueryObjectivARBReply struct { Data []int32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetQueryObjectivARB +// Reply blocks and returns the reply data for a GetQueryObjectivARB request. func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9005,7 +9367,7 @@ func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) return getQueryObjectivARBReply(buf), nil } -// Read reply into structure from buffer for GetQueryObjectivARB +// getQueryObjectivARBReply reads a byte slice into a GetQueryObjectivARBReply value. func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { v := new(GetQueryObjectivARBReply) b := 1 // skip reply determinant @@ -9039,6 +9401,7 @@ func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { } // Write request to wire for GetQueryObjectivARB +// getQueryObjectivARBRequest writes a GetQueryObjectivARB request to a byte slice. func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { size := 16 b := 0 @@ -9065,29 +9428,31 @@ func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, P return buf } -// Request GetQueryObjectuivARB -// size: 16 +// GetQueryObjectuivARBCookie is a cookie used only for GetQueryObjectuivARB requests. type GetQueryObjectuivARBCookie struct { *xgb.Cookie } +// GetQueryObjectuivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryObjectuivARBCookie.Reply() func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { cookie := c.NewCookie(true, true) c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectuivARBCookie{cookie} } +// GetQueryObjectuivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { cookie := c.NewCookie(false, true) c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectuivARBCookie{cookie} } -// Request reply for GetQueryObjectuivARB -// size: (32 + xgb.Pad((int(N) * 4))) +// GetQueryObjectuivARBReply represents the data returned from a GetQueryObjectuivARB request. type GetQueryObjectuivARBReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes N uint32 @@ -9096,7 +9461,7 @@ type GetQueryObjectuivARBReply struct { Data []uint32 // size: xgb.Pad((int(N) * 4)) } -// Waits and reads reply data from request GetQueryObjectuivARB +// Reply blocks and returns the reply data for a GetQueryObjectuivARB request. func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9108,7 +9473,7 @@ func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, erro return getQueryObjectuivARBReply(buf), nil } -// Read reply into structure from buffer for GetQueryObjectuivARB +// getQueryObjectuivARBReply reads a byte slice into a GetQueryObjectuivARBReply value. func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { v := new(GetQueryObjectuivARBReply) b := 1 // skip reply determinant @@ -9142,6 +9507,7 @@ func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { } // Write request to wire for GetQueryObjectuivARB +// getQueryObjectuivARBRequest writes a GetQueryObjectuivARB request to a byte slice. func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { size := 16 b := 0 diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index ba8c0f2..35de3bf 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on May 10 2012 8:04:31pm EDT. + This file was generated by randr.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,12 @@ func init() { xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -59,12 +65,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( RotationRotate0 = 1 RotationRotate90 = 2 @@ -147,8 +147,6 @@ func NewOutputId(c *xgb.Conn) (Output, error) { return Output(id), nil } -// 'ScreenSize' struct definition -// Size: 8 type ScreenSize struct { Width uint16 Height uint16 @@ -156,7 +154,7 @@ type ScreenSize struct { Mheight uint16 } -// Struct read ScreenSize +// ScreenSizeRead reads a byte slice into a ScreenSize value. func ScreenSizeRead(buf []byte, v *ScreenSize) int { b := 0 @@ -175,7 +173,7 @@ func ScreenSizeRead(buf []byte, v *ScreenSize) int { return b } -// Struct list read ScreenSize +// ScreenSizeReadList reads a byte slice into a list of ScreenSize values. func ScreenSizeReadList(buf []byte, dest []ScreenSize) int { b := 0 for i := 0; i < len(dest); i++ { @@ -185,7 +183,7 @@ func ScreenSizeReadList(buf []byte, dest []ScreenSize) int { return xgb.Pad(b) } -// Struct write ScreenSize +// Bytes writes a ScreenSize value to a byte slice. func (v ScreenSize) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -205,7 +203,7 @@ func (v ScreenSize) Bytes() []byte { return buf } -// Write struct list ScreenSize +// ScreenSizeListBytes writes a list of %s(MISSING) values to a byte slice. func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { b := 0 var structBytes []byte @@ -217,14 +215,12 @@ func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { return b } -// 'RefreshRates' struct definition -// Size: (2 + xgb.Pad((int(NRates) * 2))) type RefreshRates struct { NRates uint16 Rates []uint16 // size: xgb.Pad((int(NRates) * 2)) } -// Struct read RefreshRates +// RefreshRatesRead reads a byte slice into a RefreshRates value. func RefreshRatesRead(buf []byte, v *RefreshRates) int { b := 0 @@ -241,7 +237,7 @@ func RefreshRatesRead(buf []byte, v *RefreshRates) int { return b } -// Struct list read RefreshRates +// RefreshRatesReadList reads a byte slice into a list of RefreshRates values. func RefreshRatesReadList(buf []byte, dest []RefreshRates) int { b := 0 for i := 0; i < len(dest); i++ { @@ -251,7 +247,7 @@ func RefreshRatesReadList(buf []byte, dest []RefreshRates) int { return xgb.Pad(b) } -// Struct write RefreshRates +// Bytes writes a RefreshRates value to a byte slice. func (v RefreshRates) Bytes() []byte { buf := make([]byte, (2 + xgb.Pad((int(v.NRates) * 2)))) b := 0 @@ -268,7 +264,7 @@ func (v RefreshRates) Bytes() []byte { return buf } -// Write struct list RefreshRates +// RefreshRatesListBytes writes a list of %s(MISSING) values to a byte slice. func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { b := 0 var structBytes []byte @@ -280,7 +276,7 @@ func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { return b } -// Struct list size RefreshRates +// RefreshRatesListSize computes the size (bytes) of a list of RefreshRates values. func RefreshRatesListSize(list []RefreshRates) int { size := 0 for _, item := range list { @@ -289,8 +285,6 @@ func RefreshRatesListSize(list []RefreshRates) int { return size } -// 'ModeInfo' struct definition -// Size: 32 type ModeInfo struct { Id uint32 Width uint16 @@ -307,7 +301,7 @@ type ModeInfo struct { ModeFlags uint32 } -// Struct read ModeInfo +// ModeInfoRead reads a byte slice into a ModeInfo value. func ModeInfoRead(buf []byte, v *ModeInfo) int { b := 0 @@ -353,7 +347,7 @@ func ModeInfoRead(buf []byte, v *ModeInfo) int { return b } -// Struct list read ModeInfo +// ModeInfoReadList reads a byte slice into a list of ModeInfo values. func ModeInfoReadList(buf []byte, dest []ModeInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -363,7 +357,7 @@ func ModeInfoReadList(buf []byte, dest []ModeInfo) int { return xgb.Pad(b) } -// Struct write ModeInfo +// Bytes writes a ModeInfo value to a byte slice. func (v ModeInfo) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -410,7 +404,7 @@ func (v ModeInfo) Bytes() []byte { return buf } -// Write struct list ModeInfo +// ModeInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ModeInfoListBytes(buf []byte, list []ModeInfo) int { b := 0 var structBytes []byte @@ -422,8 +416,6 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return b } -// 'CrtcChange' struct definition -// Size: 28 type CrtcChange struct { Timestamp xproto.Timestamp Window xproto.Window @@ -437,7 +429,7 @@ type CrtcChange struct { Height uint16 } -// Struct read CrtcChange +// CrtcChangeRead reads a byte slice into a CrtcChange value. func CrtcChangeRead(buf []byte, v *CrtcChange) int { b := 0 @@ -473,7 +465,7 @@ func CrtcChangeRead(buf []byte, v *CrtcChange) int { return b } -// Struct list read CrtcChange +// CrtcChangeReadList reads a byte slice into a list of CrtcChange values. func CrtcChangeReadList(buf []byte, dest []CrtcChange) int { b := 0 for i := 0; i < len(dest); i++ { @@ -483,7 +475,7 @@ func CrtcChangeReadList(buf []byte, dest []CrtcChange) int { return xgb.Pad(b) } -// Struct write CrtcChange +// Bytes writes a CrtcChange value to a byte slice. func (v CrtcChange) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -520,7 +512,7 @@ func (v CrtcChange) Bytes() []byte { return buf } -// Write struct list CrtcChange +// CrtcChangeListBytes writes a list of %s(MISSING) values to a byte slice. func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { b := 0 var structBytes []byte @@ -532,8 +524,6 @@ func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { return b } -// 'OutputChange' struct definition -// Size: 28 type OutputChange struct { Timestamp xproto.Timestamp ConfigTimestamp xproto.Timestamp @@ -546,7 +536,7 @@ type OutputChange struct { SubpixelOrder byte } -// Struct read OutputChange +// OutputChangeRead reads a byte slice into a OutputChange value. func OutputChangeRead(buf []byte, v *OutputChange) int { b := 0 @@ -580,7 +570,7 @@ func OutputChangeRead(buf []byte, v *OutputChange) int { return b } -// Struct list read OutputChange +// OutputChangeReadList reads a byte slice into a list of OutputChange values. func OutputChangeReadList(buf []byte, dest []OutputChange) int { b := 0 for i := 0; i < len(dest); i++ { @@ -590,7 +580,7 @@ func OutputChangeReadList(buf []byte, dest []OutputChange) int { return xgb.Pad(b) } -// Struct write OutputChange +// Bytes writes a OutputChange value to a byte slice. func (v OutputChange) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -625,7 +615,7 @@ func (v OutputChange) Bytes() []byte { return buf } -// Write struct list OutputChange +// OutputChangeListBytes writes a list of %s(MISSING) values to a byte slice. func OutputChangeListBytes(buf []byte, list []OutputChange) int { b := 0 var structBytes []byte @@ -637,8 +627,6 @@ func OutputChangeListBytes(buf []byte, list []OutputChange) int { return b } -// 'OutputProperty' struct definition -// Size: 28 type OutputProperty struct { Window xproto.Window Output Output @@ -648,7 +636,7 @@ type OutputProperty struct { // padding: 11 bytes } -// Struct read OutputProperty +// OutputPropertyRead reads a byte slice into a OutputProperty value. func OutputPropertyRead(buf []byte, v *OutputProperty) int { b := 0 @@ -672,7 +660,7 @@ func OutputPropertyRead(buf []byte, v *OutputProperty) int { return b } -// Struct list read OutputProperty +// OutputPropertyReadList reads a byte slice into a list of OutputProperty values. func OutputPropertyReadList(buf []byte, dest []OutputProperty) int { b := 0 for i := 0; i < len(dest); i++ { @@ -682,7 +670,7 @@ func OutputPropertyReadList(buf []byte, dest []OutputProperty) int { return xgb.Pad(b) } -// Struct write OutputProperty +// Bytes writes a OutputProperty value to a byte slice. func (v OutputProperty) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -707,7 +695,7 @@ func (v OutputProperty) Bytes() []byte { return buf } -// Write struct list OutputProperty +// OutputPropertyListBytes writes a list of %s(MISSING) values to a byte slice. func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { b := 0 var structBytes []byte @@ -719,7 +707,7 @@ func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { return b } -// Union definition NotifyDataUnion +// NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). // Instead use one of the following constructors for 'NotifyDataUnion': @@ -732,7 +720,7 @@ type NotifyDataUnion struct { Op OutputProperty } -// Union constructor for NotifyDataUnion for field Cc. +// NotifyDataUnionCcNew constructs a new NotifyDataUnion union type with the Cc field. func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { var b int buf := make([]byte, 28) @@ -763,7 +751,7 @@ func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { return v } -// Union constructor for NotifyDataUnion for field Oc. +// NotifyDataUnionOcNew constructs a new NotifyDataUnion union type with the Oc field. func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { var b int buf := make([]byte, 28) @@ -794,7 +782,7 @@ func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { return v } -// Union constructor for NotifyDataUnion for field Op. +// NotifyDataUnionOpNew constructs a new NotifyDataUnion union type with the Op field. func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { var b int buf := make([]byte, 28) @@ -825,7 +813,7 @@ func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { return v } -// Union read NotifyDataUnion +// NotifyDataUnionRead reads a byte slice into a NotifyDataUnion value. func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { var b int @@ -844,7 +832,7 @@ func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { return 28 } -// Union list read NotifyDataUnion +// NotifyDataUnionReadList reads a byte slice into a list of NotifyDataUnion values. func NotifyDataUnionReadList(buf []byte, dest []NotifyDataUnion) int { b := 0 for i := 0; i < len(dest); i++ { @@ -854,7 +842,7 @@ func NotifyDataUnionReadList(buf []byte, dest []NotifyDataUnion) int { return xgb.Pad(b) } -// Union write NotifyDataUnion +// Bytes writes a NotifyDataUnion value to a byte slice. // Each field in a union must contain the same data. // So simply pick the first field and write that to the wire. func (v NotifyDataUnion) Bytes() []byte { @@ -869,7 +857,7 @@ func (v NotifyDataUnion) Bytes() []byte { return buf } -// Union list write NotifyDataUnion +// NotifyDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { b := 0 var unionBytes []byte @@ -881,9 +869,7 @@ func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { return b } -// Event definition ScreenChangeNotify (0) -// Size: 32 - +// ScreenChangeNotify is the event number for a ScreenChangeNotifyEvent. const ScreenChangeNotify = 0 type ScreenChangeNotifyEvent struct { @@ -901,7 +887,7 @@ type ScreenChangeNotifyEvent struct { Mheight uint16 } -// Event read ScreenChangeNotify +// ScreenChangeNotifyEventNew constructs a ScreenChangeNotifyEvent value that implements xgb.Event from a byte slice. func ScreenChangeNotifyEventNew(buf []byte) xgb.Event { v := ScreenChangeNotifyEvent{} b := 1 // don't read event number @@ -945,7 +931,7 @@ func ScreenChangeNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ScreenChangeNotify +// Bytes writes a ScreenChangeNotifyEvent value to a byte slice. func (v ScreenChangeNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -992,12 +978,14 @@ func (v ScreenChangeNotifyEvent) Bytes() []byte { return buf } -func (v ScreenChangeNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ScreenChangeNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ScreenChangeNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ScreenChangeNotifyEvent. func (v ScreenChangeNotifyEvent) String() string { fieldVals := make([]string, 0, 11) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -1019,9 +1007,7 @@ func init() { xgb.NewExtEventFuncs["RANDR"][0] = ScreenChangeNotifyEventNew } -// Event definition Notify (1) -// Size: 32 - +// Notify is the event number for a NotifyEvent. const Notify = 1 type NotifyEvent struct { @@ -1030,7 +1016,7 @@ type NotifyEvent struct { U NotifyDataUnion } -// Event read Notify +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number @@ -1047,7 +1033,7 @@ func NotifyEventNew(buf []byte) xgb.Event { return v } -// Event write Notify +// Bytes writes a NotifyEvent value to a byte slice. func (v NotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -1070,12 +1056,14 @@ func (v NotifyEvent) Bytes() []byte { return buf } -func (v NotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -1087,9 +1075,7 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } -// Error definition BadOutput (0) -// Size: 32 - +// BadBadOutput is the error number for a BadBadOutput. const BadBadOutput = 0 type BadOutputError struct { @@ -1097,7 +1083,7 @@ type BadOutputError struct { NiceName string } -// Error read BadOutput +// BadOutputErrorNew constructs a BadOutputError value that implements xgb.Error from a byte slice. func BadOutputErrorNew(buf []byte) xgb.Error { v := BadOutputError{} v.NiceName = "BadOutput" @@ -1111,8 +1097,8 @@ func BadOutputErrorNew(buf []byte) xgb.Error { return v } -func (err BadOutputError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadOutput error. +// This is mostly used internally. func (err BadOutputError) SequenceId() uint16 { return err.Sequence } @@ -1132,9 +1118,7 @@ func init() { xgb.NewExtErrorFuncs["RANDR"][0] = BadOutputErrorNew } -// Error definition BadCrtc (1) -// Size: 32 - +// BadBadCrtc is the error number for a BadBadCrtc. const BadBadCrtc = 1 type BadCrtcError struct { @@ -1142,7 +1126,7 @@ type BadCrtcError struct { NiceName string } -// Error read BadCrtc +// BadCrtcErrorNew constructs a BadCrtcError value that implements xgb.Error from a byte slice. func BadCrtcErrorNew(buf []byte) xgb.Error { v := BadCrtcError{} v.NiceName = "BadCrtc" @@ -1156,8 +1140,8 @@ func BadCrtcErrorNew(buf []byte) xgb.Error { return v } -func (err BadCrtcError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadCrtc error. +// This is mostly used internally. func (err BadCrtcError) SequenceId() uint16 { return err.Sequence } @@ -1177,9 +1161,7 @@ func init() { xgb.NewExtErrorFuncs["RANDR"][1] = BadCrtcErrorNew } -// Error definition BadMode (2) -// Size: 32 - +// BadBadMode is the error number for a BadBadMode. const BadBadMode = 2 type BadModeError struct { @@ -1187,7 +1169,7 @@ type BadModeError struct { NiceName string } -// Error read BadMode +// BadModeErrorNew constructs a BadModeError value that implements xgb.Error from a byte slice. func BadModeErrorNew(buf []byte) xgb.Error { v := BadModeError{} v.NiceName = "BadMode" @@ -1201,8 +1183,8 @@ func BadModeErrorNew(buf []byte) xgb.Error { return v } -func (err BadModeError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadMode error. +// This is mostly used internally. func (err BadModeError) SequenceId() uint16 { return err.Sequence } @@ -1222,36 +1204,38 @@ func init() { xgb.NewExtErrorFuncs["RANDR"][2] = BadModeErrorNew } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1263,7 +1247,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -1288,6 +1272,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { size := 12 b := 0 @@ -1311,29 +1296,31 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) return buf } -// Request SetScreenConfig -// size: 24 +// SetScreenConfigCookie is a cookie used only for SetScreenConfig requests. type SetScreenConfigCookie struct { *xgb.Cookie } +// SetScreenConfig sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetScreenConfigCookie.Reply() func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { cookie := c.NewCookie(true, true) c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return SetScreenConfigCookie{cookie} } +// SetScreenConfigUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { cookie := c.NewCookie(false, true) c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return SetScreenConfigCookie{cookie} } -// Request reply for SetScreenConfig -// size: 32 +// SetScreenConfigReply represents the data returned from a SetScreenConfig request. type SetScreenConfigReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte NewTimestamp xproto.Timestamp ConfigTimestamp xproto.Timestamp @@ -1342,7 +1329,7 @@ type SetScreenConfigReply struct { // padding: 10 bytes } -// Waits and reads reply data from request SetScreenConfig +// Reply blocks and returns the reply data for a SetScreenConfig request. func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1354,7 +1341,7 @@ func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { return setScreenConfigReply(buf), nil } -// Read reply into structure from buffer for SetScreenConfig +// setScreenConfigReply reads a byte slice into a SetScreenConfigReply value. func setScreenConfigReply(buf []byte) *SetScreenConfigReply { v := new(SetScreenConfigReply) b := 1 // skip reply determinant @@ -1386,6 +1373,7 @@ func setScreenConfigReply(buf []byte) *SetScreenConfigReply { } // Write request to wire for SetScreenConfig +// setScreenConfigRequest writes a SetScreenConfig request to a byte slice. func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { size := 24 b := 0 @@ -1423,30 +1411,35 @@ func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto. return buf } -// Request SelectInput -// size: 12 +// SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie } -// Write request to wire for SelectInput +// SelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, Window, Enable), cookie) return SelectInputCookie{cookie} } +// SelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, Window, Enable), cookie) return SelectInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte { size := 12 b := 0 @@ -1472,29 +1465,31 @@ func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte return buf } -// Request GetScreenInfo -// size: 8 +// GetScreenInfoCookie is a cookie used only for GetScreenInfo requests. type GetScreenInfoCookie struct { *xgb.Cookie } +// GetScreenInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenInfoCookie.Reply() func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenInfoRequest(c, Window), cookie) return GetScreenInfoCookie{cookie} } +// GetScreenInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenInfoRequest(c, Window), cookie) return GetScreenInfoCookie{cookie} } -// Request reply for GetScreenInfo -// size: ((32 + xgb.Pad((int(NSizes) * 8))) + RefreshRatesListSize(Rates)) +// GetScreenInfoReply represents the data returned from a GetScreenInfo request. type GetScreenInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Rotations byte Root xproto.Window Timestamp xproto.Timestamp @@ -1509,7 +1504,7 @@ type GetScreenInfoReply struct { Rates []RefreshRates // size: RefreshRatesListSize(Rates) } -// Waits and reads reply data from request GetScreenInfo +// Reply blocks and returns the reply data for a GetScreenInfo request. func (cook GetScreenInfoCookie) Reply() (*GetScreenInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1521,7 +1516,7 @@ func (cook GetScreenInfoCookie) Reply() (*GetScreenInfoReply, error) { return getScreenInfoReply(buf), nil } -// Read reply into structure from buffer for GetScreenInfo +// getScreenInfoReply reads a byte slice into a GetScreenInfoReply value. func getScreenInfoReply(buf []byte) *GetScreenInfoReply { v := new(GetScreenInfoReply) b := 1 // skip reply determinant @@ -1571,6 +1566,7 @@ func getScreenInfoReply(buf []byte) *GetScreenInfoReply { } // Write request to wire for GetScreenInfo +// getScreenInfoRequest writes a GetScreenInfo request to a byte slice. func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1591,29 +1587,31 @@ func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request GetScreenSizeRange -// size: 8 +// GetScreenSizeRangeCookie is a cookie used only for GetScreenSizeRange requests. type GetScreenSizeRangeCookie struct { *xgb.Cookie } +// GetScreenSizeRange sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSizeRangeCookie.Reply() func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) return GetScreenSizeRangeCookie{cookie} } +// GetScreenSizeRangeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) return GetScreenSizeRangeCookie{cookie} } -// Request reply for GetScreenSizeRange -// size: 32 +// GetScreenSizeRangeReply represents the data returned from a GetScreenSizeRange request. type GetScreenSizeRangeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MinWidth uint16 MinHeight uint16 @@ -1622,7 +1620,7 @@ type GetScreenSizeRangeReply struct { // padding: 16 bytes } -// Waits and reads reply data from request GetScreenSizeRange +// Reply blocks and returns the reply data for a GetScreenSizeRange request. func (cook GetScreenSizeRangeCookie) Reply() (*GetScreenSizeRangeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1634,7 +1632,7 @@ func (cook GetScreenSizeRangeCookie) Reply() (*GetScreenSizeRangeReply, error) { return getScreenSizeRangeReply(buf), nil } -// Read reply into structure from buffer for GetScreenSizeRange +// getScreenSizeRangeReply reads a byte slice into a GetScreenSizeRangeReply value. func getScreenSizeRangeReply(buf []byte) *GetScreenSizeRangeReply { v := new(GetScreenSizeRangeReply) b := 1 // skip reply determinant @@ -1665,6 +1663,7 @@ func getScreenSizeRangeReply(buf []byte) *GetScreenSizeRangeReply { } // Write request to wire for GetScreenSizeRange +// getScreenSizeRangeRequest writes a GetScreenSizeRange request to a byte slice. func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1685,30 +1684,35 @@ func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request SetScreenSize -// size: 20 +// SetScreenSizeCookie is a cookie used only for SetScreenSize requests. type SetScreenSizeCookie struct { *xgb.Cookie } -// Write request to wire for SetScreenSize +// SetScreenSize sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { cookie := c.NewCookie(false, false) c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) return SetScreenSizeCookie{cookie} } +// SetScreenSizeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetScreenSizeCookie.Check() func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { cookie := c.NewCookie(true, false) c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) return SetScreenSizeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetScreenSizeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetScreenSize +// setScreenSizeRequest writes a SetScreenSize request to a byte slice. func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { size := 20 b := 0 @@ -1741,29 +1745,31 @@ func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Heigh return buf } -// Request GetScreenResources -// size: 8 +// GetScreenResourcesCookie is a cookie used only for GetScreenResources requests. type GetScreenResourcesCookie struct { *xgb.Cookie } +// GetScreenResources sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCookie.Reply() func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenResourcesRequest(c, Window), cookie) return GetScreenResourcesCookie{cookie} } +// GetScreenResourcesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenResourcesRequest(c, Window), cookie) return GetScreenResourcesCookie{cookie} } -// Request reply for GetScreenResources -// size: ((((32 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumModes) * 32))) + xgb.Pad((int(NamesLen) * 1))) +// GetScreenResourcesReply represents the data returned from a GetScreenResources request. type GetScreenResourcesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Timestamp xproto.Timestamp ConfigTimestamp xproto.Timestamp @@ -1778,7 +1784,7 @@ type GetScreenResourcesReply struct { Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } -// Waits and reads reply data from request GetScreenResources +// Reply blocks and returns the reply data for a GetScreenResources request. func (cook GetScreenResourcesCookie) Reply() (*GetScreenResourcesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1790,7 +1796,7 @@ func (cook GetScreenResourcesCookie) Reply() (*GetScreenResourcesReply, error) { return getScreenResourcesReply(buf), nil } -// Read reply into structure from buffer for GetScreenResources +// getScreenResourcesReply reads a byte slice into a GetScreenResourcesReply value. func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { v := new(GetScreenResourcesReply) b := 1 // skip reply determinant @@ -1848,6 +1854,7 @@ func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { } // Write request to wire for GetScreenResources +// getScreenResourcesRequest writes a GetScreenResources request to a byte slice. func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1868,29 +1875,31 @@ func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request GetOutputInfo -// size: 12 +// GetOutputInfoCookie is a cookie used only for GetOutputInfo requests. type GetOutputInfoCookie struct { *xgb.Cookie } +// GetOutputInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOutputInfoCookie.Reply() func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) return GetOutputInfoCookie{cookie} } +// GetOutputInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputInfoUnchecked(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) return GetOutputInfoCookie{cookie} } -// Request reply for GetOutputInfo -// size: ((((36 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumModes) * 4))) + xgb.Pad((int(NumClones) * 4))) + xgb.Pad((int(NameLen) * 1))) +// GetOutputInfoReply represents the data returned from a GetOutputInfo request. type GetOutputInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte Timestamp xproto.Timestamp Crtc Crtc @@ -1909,7 +1918,7 @@ type GetOutputInfoReply struct { Name []byte // size: xgb.Pad((int(NameLen) * 1)) } -// Waits and reads reply data from request GetOutputInfo +// Reply blocks and returns the reply data for a GetOutputInfo request. func (cook GetOutputInfoCookie) Reply() (*GetOutputInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1921,7 +1930,7 @@ func (cook GetOutputInfoCookie) Reply() (*GetOutputInfoReply, error) { return getOutputInfoReply(buf), nil } -// Read reply into structure from buffer for GetOutputInfo +// getOutputInfoReply reads a byte slice into a GetOutputInfoReply value. func getOutputInfoReply(buf []byte) *GetOutputInfoReply { v := new(GetOutputInfoReply) b := 1 // skip reply determinant @@ -1997,6 +2006,7 @@ func getOutputInfoReply(buf []byte) *GetOutputInfoReply { } // Write request to wire for GetOutputInfo +// getOutputInfoRequest writes a GetOutputInfo request to a byte slice. func getOutputInfoRequest(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) []byte { size := 12 b := 0 @@ -2020,36 +2030,38 @@ func getOutputInfoRequest(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Tim return buf } -// Request ListOutputProperties -// size: 8 +// ListOutputPropertiesCookie is a cookie used only for ListOutputProperties requests. type ListOutputPropertiesCookie struct { *xgb.Cookie } +// ListOutputProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListOutputPropertiesCookie.Reply() func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) return ListOutputPropertiesCookie{cookie} } +// ListOutputPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListOutputPropertiesUnchecked(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) return ListOutputPropertiesCookie{cookie} } -// Request reply for ListOutputProperties -// size: (32 + xgb.Pad((int(NumAtoms) * 4))) +// ListOutputPropertiesReply represents the data returned from a ListOutputProperties request. type ListOutputPropertiesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAtoms uint16 // padding: 22 bytes Atoms []xproto.Atom // size: xgb.Pad((int(NumAtoms) * 4)) } -// Waits and reads reply data from request ListOutputProperties +// Reply blocks and returns the reply data for a ListOutputProperties request. func (cook ListOutputPropertiesCookie) Reply() (*ListOutputPropertiesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2061,7 +2073,7 @@ func (cook ListOutputPropertiesCookie) Reply() (*ListOutputPropertiesReply, erro return listOutputPropertiesReply(buf), nil } -// Read reply into structure from buffer for ListOutputProperties +// listOutputPropertiesReply reads a byte slice into a ListOutputPropertiesReply value. func listOutputPropertiesReply(buf []byte) *ListOutputPropertiesReply { v := new(ListOutputPropertiesReply) b := 1 // skip reply determinant @@ -2090,6 +2102,7 @@ func listOutputPropertiesReply(buf []byte) *ListOutputPropertiesReply { } // Write request to wire for ListOutputProperties +// listOutputPropertiesRequest writes a ListOutputProperties request to a byte slice. func listOutputPropertiesRequest(c *xgb.Conn, Output Output) []byte { size := 8 b := 0 @@ -2110,29 +2123,31 @@ func listOutputPropertiesRequest(c *xgb.Conn, Output Output) []byte { return buf } -// Request QueryOutputProperty -// size: 12 +// QueryOutputPropertyCookie is a cookie used only for QueryOutputProperty requests. type QueryOutputPropertyCookie struct { *xgb.Cookie } +// QueryOutputProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryOutputPropertyCookie.Reply() func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) return QueryOutputPropertyCookie{cookie} } +// QueryOutputPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) return QueryOutputPropertyCookie{cookie} } -// Request reply for QueryOutputProperty -// size: (32 + xgb.Pad((int(Length) * 4))) +// QueryOutputPropertyReply represents the data returned from a QueryOutputProperty request. type QueryOutputPropertyReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Pending bool Range bool @@ -2141,7 +2156,7 @@ type QueryOutputPropertyReply struct { ValidValues []int32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request QueryOutputProperty +// Reply blocks and returns the reply data for a QueryOutputProperty request. func (cook QueryOutputPropertyCookie) Reply() (*QueryOutputPropertyReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2153,7 +2168,7 @@ func (cook QueryOutputPropertyCookie) Reply() (*QueryOutputPropertyReply, error) return queryOutputPropertyReply(buf), nil } -// Read reply into structure from buffer for QueryOutputProperty +// queryOutputPropertyReply reads a byte slice into a QueryOutputPropertyReply value. func queryOutputPropertyReply(buf []byte) *QueryOutputPropertyReply { v := new(QueryOutputPropertyReply) b := 1 // skip reply determinant @@ -2200,6 +2215,7 @@ func queryOutputPropertyReply(buf []byte) *QueryOutputPropertyReply { } // Write request to wire for QueryOutputProperty +// queryOutputPropertyRequest writes a QueryOutputProperty request to a byte slice. func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { size := 12 b := 0 @@ -2223,30 +2239,35 @@ func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom return buf } -// Request ConfigureOutputProperty -// size: xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) +// ConfigureOutputPropertyCookie is a cookie used only for ConfigureOutputProperty requests. type ConfigureOutputPropertyCookie struct { *xgb.Cookie } -// Write request to wire for ConfigureOutputProperty +// ConfigureOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) return ConfigureOutputPropertyCookie{cookie} } +// ConfigureOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureOutputPropertyCookie.Check() func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) return ConfigureOutputPropertyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ConfigureOutputPropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ConfigureOutputProperty +// configureOutputPropertyRequest writes a ConfigureOutputProperty request to a byte slice. func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) []byte { size := xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) b := 0 @@ -2292,30 +2313,35 @@ func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto. return buf } -// Request ChangeOutputProperty -// size: xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) +// ChangeOutputPropertyCookie is a cookie used only for ChangeOutputProperty requests. type ChangeOutputPropertyCookie struct { *xgb.Cookie } -// Write request to wire for ChangeOutputProperty +// ChangeOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return ChangeOutputPropertyCookie{cookie} } +// ChangeOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeOutputPropertyCookie.Check() func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return ChangeOutputPropertyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeOutputPropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeOutputProperty +// changeOutputPropertyRequest writes a ChangeOutputProperty request to a byte slice. func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) b := 0 @@ -2356,30 +2382,35 @@ func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato return buf } -// Request DeleteOutputProperty -// size: 12 +// DeleteOutputPropertyCookie is a cookie used only for DeleteOutputProperty requests. type DeleteOutputPropertyCookie struct { *xgb.Cookie } -// Write request to wire for DeleteOutputProperty +// DeleteOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) return DeleteOutputPropertyCookie{cookie} } +// DeleteOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteOutputPropertyCookie.Check() func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) return DeleteOutputPropertyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteOutputPropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteOutputProperty +// deleteOutputPropertyRequest writes a DeleteOutputProperty request to a byte slice. func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { size := 12 b := 0 @@ -2403,29 +2434,31 @@ func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato return buf } -// Request GetOutputProperty -// size: 28 +// GetOutputPropertyCookie is a cookie used only for GetOutputProperty requests. type GetOutputPropertyCookie struct { *xgb.Cookie } +// GetOutputProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOutputPropertyCookie.Reply() func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { cookie := c.NewCookie(true, true) c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return GetOutputPropertyCookie{cookie} } +// GetOutputPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { cookie := c.NewCookie(false, true) c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return GetOutputPropertyCookie{cookie} } -// Request reply for GetOutputProperty -// size: (32 + xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1))) +// GetOutputPropertyReply represents the data returned from a GetOutputProperty request. type GetOutputPropertyReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Format byte Type xproto.Atom BytesAfter uint32 @@ -2434,7 +2467,7 @@ type GetOutputPropertyReply struct { Data []byte // size: xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)) } -// Waits and reads reply data from request GetOutputProperty +// Reply blocks and returns the reply data for a GetOutputProperty request. func (cook GetOutputPropertyCookie) Reply() (*GetOutputPropertyReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2446,7 +2479,7 @@ func (cook GetOutputPropertyCookie) Reply() (*GetOutputPropertyReply, error) { return getOutputPropertyReply(buf), nil } -// Read reply into structure from buffer for GetOutputProperty +// getOutputPropertyReply reads a byte slice into a GetOutputPropertyReply value. func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { v := new(GetOutputPropertyReply) b := 1 // skip reply determinant @@ -2479,6 +2512,7 @@ func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { } // Write request to wire for GetOutputProperty +// getOutputPropertyRequest writes a GetOutputProperty request to a byte slice. func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { size := 28 b := 0 @@ -2527,35 +2561,37 @@ func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, return buf } -// Request CreateMode -// size: xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) +// CreateModeCookie is a cookie used only for CreateMode requests. type CreateModeCookie struct { *xgb.Cookie } +// CreateMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateModeCookie.Reply() func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { cookie := c.NewCookie(true, true) c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) return CreateModeCookie{cookie} } +// CreateModeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { cookie := c.NewCookie(false, true) c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) return CreateModeCookie{cookie} } -// Request reply for CreateMode -// size: 32 +// CreateModeReply represents the data returned from a CreateMode request. type CreateModeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Mode Mode // padding: 20 bytes } -// Waits and reads reply data from request CreateMode +// Reply blocks and returns the reply data for a CreateMode request. func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2567,7 +2603,7 @@ func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { return createModeReply(buf), nil } -// Read reply into structure from buffer for CreateMode +// createModeReply reads a byte slice into a CreateModeReply value. func createModeReply(buf []byte) *CreateModeReply { v := new(CreateModeReply) b := 1 // skip reply determinant @@ -2589,6 +2625,7 @@ func createModeReply(buf []byte) *CreateModeReply { } // Write request to wire for CreateMode +// createModeRequest writes a CreateMode request to a byte slice. func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) []byte { size := xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) b := 0 @@ -2618,30 +2655,35 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam return buf } -// Request DestroyMode -// size: 8 +// DestroyModeCookie is a cookie used only for DestroyMode requests. type DestroyModeCookie struct { *xgb.Cookie } -// Write request to wire for DestroyMode +// DestroyMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyModeRequest(c, Mode), cookie) return DestroyModeCookie{cookie} } +// DestroyModeChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyModeCookie.Check() func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyModeRequest(c, Mode), cookie) return DestroyModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyMode +// destroyModeRequest writes a DestroyMode request to a byte slice. func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { size := 8 b := 0 @@ -2662,30 +2704,35 @@ func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { return buf } -// Request AddOutputMode -// size: 12 +// AddOutputModeCookie is a cookie used only for AddOutputMode requests. type AddOutputModeCookie struct { *xgb.Cookie } -// Write request to wire for AddOutputMode +// AddOutputMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) return AddOutputModeCookie{cookie} } +// AddOutputModeChecked sends a checked request. +// If an error occurs, it can be retrieved using AddOutputModeCookie.Check() func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) return AddOutputModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AddOutputModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AddOutputMode +// addOutputModeRequest writes a AddOutputMode request to a byte slice. func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { size := 12 b := 0 @@ -2709,30 +2756,35 @@ func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { return buf } -// Request DeleteOutputMode -// size: 12 +// DeleteOutputModeCookie is a cookie used only for DeleteOutputMode requests. type DeleteOutputModeCookie struct { *xgb.Cookie } -// Write request to wire for DeleteOutputMode +// DeleteOutputMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) return DeleteOutputModeCookie{cookie} } +// DeleteOutputModeChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteOutputModeCookie.Check() func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) return DeleteOutputModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteOutputModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteOutputMode +// deleteOutputModeRequest writes a DeleteOutputMode request to a byte slice. func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { size := 12 b := 0 @@ -2756,29 +2808,31 @@ func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { return buf } -// Request GetCrtcInfo -// size: 12 +// GetCrtcInfoCookie is a cookie used only for GetCrtcInfo requests. type GetCrtcInfoCookie struct { *xgb.Cookie } +// GetCrtcInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcInfoCookie.Reply() func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) return GetCrtcInfoCookie{cookie} } +// GetCrtcInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) return GetCrtcInfoCookie{cookie} } -// Request reply for GetCrtcInfo -// size: ((32 + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumPossibleOutputs) * 4))) +// GetCrtcInfoReply represents the data returned from a GetCrtcInfo request. type GetCrtcInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte Timestamp xproto.Timestamp X int16 @@ -2794,7 +2848,7 @@ type GetCrtcInfoReply struct { Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) } -// Waits and reads reply data from request GetCrtcInfo +// Reply blocks and returns the reply data for a GetCrtcInfo request. func (cook GetCrtcInfoCookie) Reply() (*GetCrtcInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2806,7 +2860,7 @@ func (cook GetCrtcInfoCookie) Reply() (*GetCrtcInfoReply, error) { return getCrtcInfoReply(buf), nil } -// Read reply into structure from buffer for GetCrtcInfo +// getCrtcInfoReply reads a byte slice into a GetCrtcInfoReply value. func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { v := new(GetCrtcInfoReply) b := 1 // skip reply determinant @@ -2868,6 +2922,7 @@ func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { } // Write request to wire for GetCrtcInfo +// getCrtcInfoRequest writes a GetCrtcInfo request to a byte slice. func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) []byte { size := 12 b := 0 @@ -2891,35 +2946,37 @@ func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp return buf } -// Request SetCrtcConfig -// size: xgb.Pad((28 + xgb.Pad((len(Outputs) * 4)))) +// SetCrtcConfigCookie is a cookie used only for SetCrtcConfig requests. type SetCrtcConfigCookie struct { *xgb.Cookie } +// SetCrtcConfig sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetCrtcConfigCookie.Reply() func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { cookie := c.NewCookie(true, true) c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return SetCrtcConfigCookie{cookie} } +// SetCrtcConfigUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcConfigUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { cookie := c.NewCookie(false, true) c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return SetCrtcConfigCookie{cookie} } -// Request reply for SetCrtcConfig -// size: 32 +// SetCrtcConfigReply represents the data returned from a SetCrtcConfig request. type SetCrtcConfigReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte Timestamp xproto.Timestamp // padding: 20 bytes } -// Waits and reads reply data from request SetCrtcConfig +// Reply blocks and returns the reply data for a SetCrtcConfig request. func (cook SetCrtcConfigCookie) Reply() (*SetCrtcConfigReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2931,7 +2988,7 @@ func (cook SetCrtcConfigCookie) Reply() (*SetCrtcConfigReply, error) { return setCrtcConfigReply(buf), nil } -// Read reply into structure from buffer for SetCrtcConfig +// setCrtcConfigReply reads a byte slice into a SetCrtcConfigReply value. func setCrtcConfigReply(buf []byte) *SetCrtcConfigReply { v := new(SetCrtcConfigReply) b := 1 // skip reply determinant @@ -2954,6 +3011,7 @@ func setCrtcConfigReply(buf []byte) *SetCrtcConfigReply { } // Write request to wire for SetCrtcConfig +// setCrtcConfigRequest writes a SetCrtcConfig request to a byte slice. func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) []byte { size := xgb.Pad((28 + xgb.Pad((len(Outputs) * 4)))) b := 0 @@ -3000,35 +3058,37 @@ func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Co return buf } -// Request GetCrtcGammaSize -// size: 8 +// GetCrtcGammaSizeCookie is a cookie used only for GetCrtcGammaSize requests. type GetCrtcGammaSizeCookie struct { *xgb.Cookie } +// GetCrtcGammaSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcGammaSizeCookie.Reply() func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) return GetCrtcGammaSizeCookie{cookie} } +// GetCrtcGammaSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) return GetCrtcGammaSizeCookie{cookie} } -// Request reply for GetCrtcGammaSize -// size: 32 +// GetCrtcGammaSizeReply represents the data returned from a GetCrtcGammaSize request. type GetCrtcGammaSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Size uint16 // padding: 22 bytes } -// Waits and reads reply data from request GetCrtcGammaSize +// Reply blocks and returns the reply data for a GetCrtcGammaSize request. func (cook GetCrtcGammaSizeCookie) Reply() (*GetCrtcGammaSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3040,7 +3100,7 @@ func (cook GetCrtcGammaSizeCookie) Reply() (*GetCrtcGammaSizeReply, error) { return getCrtcGammaSizeReply(buf), nil } -// Read reply into structure from buffer for GetCrtcGammaSize +// getCrtcGammaSizeReply reads a byte slice into a GetCrtcGammaSizeReply value. func getCrtcGammaSizeReply(buf []byte) *GetCrtcGammaSizeReply { v := new(GetCrtcGammaSizeReply) b := 1 // skip reply determinant @@ -3062,6 +3122,7 @@ func getCrtcGammaSizeReply(buf []byte) *GetCrtcGammaSizeReply { } // Write request to wire for GetCrtcGammaSize +// getCrtcGammaSizeRequest writes a GetCrtcGammaSize request to a byte slice. func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { size := 8 b := 0 @@ -3082,29 +3143,31 @@ func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } -// Request GetCrtcGamma -// size: 8 +// GetCrtcGammaCookie is a cookie used only for GetCrtcGamma requests. type GetCrtcGammaCookie struct { *xgb.Cookie } +// GetCrtcGamma sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcGammaCookie.Reply() func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) return GetCrtcGammaCookie{cookie} } +// GetCrtcGammaUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) return GetCrtcGammaCookie{cookie} } -// Request reply for GetCrtcGamma -// size: (((32 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) +// GetCrtcGammaReply represents the data returned from a GetCrtcGamma request. type GetCrtcGammaReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Size uint16 // padding: 22 bytes @@ -3113,7 +3176,7 @@ type GetCrtcGammaReply struct { Blue []uint16 // size: xgb.Pad((int(Size) * 2)) } -// Waits and reads reply data from request GetCrtcGamma +// Reply blocks and returns the reply data for a GetCrtcGamma request. func (cook GetCrtcGammaCookie) Reply() (*GetCrtcGammaReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3125,7 +3188,7 @@ func (cook GetCrtcGammaCookie) Reply() (*GetCrtcGammaReply, error) { return getCrtcGammaReply(buf), nil } -// Read reply into structure from buffer for GetCrtcGamma +// getCrtcGammaReply reads a byte slice into a GetCrtcGammaReply value. func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { v := new(GetCrtcGammaReply) b := 1 // skip reply determinant @@ -3168,6 +3231,7 @@ func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { } // Write request to wire for GetCrtcGamma +// getCrtcGammaRequest writes a GetCrtcGamma request to a byte slice. func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { size := 8 b := 0 @@ -3188,30 +3252,35 @@ func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } -// Request SetCrtcGamma -// size: xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) +// SetCrtcGammaCookie is a cookie used only for SetCrtcGamma requests. type SetCrtcGammaCookie struct { *xgb.Cookie } -// Write request to wire for SetCrtcGamma +// SetCrtcGamma sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) return SetCrtcGammaCookie{cookie} } +// SetCrtcGammaChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCrtcGammaCookie.Check() func SetCrtcGammaChecked(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) return SetCrtcGammaCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetCrtcGammaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCrtcGamma +// setCrtcGammaRequest writes a SetCrtcGamma request to a byte slice. func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { size := xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) b := 0 @@ -3255,29 +3324,31 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree return buf } -// Request GetScreenResourcesCurrent -// size: 8 +// GetScreenResourcesCurrentCookie is a cookie used only for GetScreenResourcesCurrent requests. type GetScreenResourcesCurrentCookie struct { *xgb.Cookie } +// GetScreenResourcesCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCurrentCookie.Reply() func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) return GetScreenResourcesCurrentCookie{cookie} } +// GetScreenResourcesCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) return GetScreenResourcesCurrentCookie{cookie} } -// Request reply for GetScreenResourcesCurrent -// size: ((((32 + xgb.Pad((int(NumCrtcs) * 4))) + xgb.Pad((int(NumOutputs) * 4))) + xgb.Pad((int(NumModes) * 32))) + xgb.Pad((int(NamesLen) * 1))) +// GetScreenResourcesCurrentReply represents the data returned from a GetScreenResourcesCurrent request. type GetScreenResourcesCurrentReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Timestamp xproto.Timestamp ConfigTimestamp xproto.Timestamp @@ -3292,7 +3363,7 @@ type GetScreenResourcesCurrentReply struct { Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } -// Waits and reads reply data from request GetScreenResourcesCurrent +// Reply blocks and returns the reply data for a GetScreenResourcesCurrent request. func (cook GetScreenResourcesCurrentCookie) Reply() (*GetScreenResourcesCurrentReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3304,7 +3375,7 @@ func (cook GetScreenResourcesCurrentCookie) Reply() (*GetScreenResourcesCurrentR return getScreenResourcesCurrentReply(buf), nil } -// Read reply into structure from buffer for GetScreenResourcesCurrent +// getScreenResourcesCurrentReply reads a byte slice into a GetScreenResourcesCurrentReply value. func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply { v := new(GetScreenResourcesCurrentReply) b := 1 // skip reply determinant @@ -3362,6 +3433,7 @@ func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply } // Write request to wire for GetScreenResourcesCurrent +// getScreenResourcesCurrentRequest writes a GetScreenResourcesCurrent request to a byte slice. func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -3382,30 +3454,35 @@ func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte return buf } -// Request SetCrtcTransform -// size: xgb.Pad(((48 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(FilterParams) * 4)))) +// SetCrtcTransformCookie is a cookie used only for SetCrtcTransform requests. type SetCrtcTransformCookie struct { *xgb.Cookie } -// Write request to wire for SetCrtcTransform +// SetCrtcTransform sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return SetCrtcTransformCookie{cookie} } +// SetCrtcTransformChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCrtcTransformCookie.Check() func SetCrtcTransformChecked(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return SetCrtcTransformCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetCrtcTransformCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCrtcTransform +// setCrtcTransformRequest writes a SetCrtcTransform request to a byte slice. func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) []byte { size := xgb.Pad(((48 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(FilterParams) * 4)))) b := 0 @@ -3446,29 +3523,31 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, return buf } -// Request GetCrtcTransform -// size: 8 +// GetCrtcTransformCookie is a cookie used only for GetCrtcTransform requests. type GetCrtcTransformCookie struct { *xgb.Cookie } +// GetCrtcTransform sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcTransformCookie.Reply() func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) return GetCrtcTransformCookie{cookie} } +// GetCrtcTransformUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) return GetCrtcTransformCookie{cookie} } -// Request reply for GetCrtcTransform -// size: ((((96 + xgb.Pad((int(PendingLen) * 1))) + xgb.Pad((int(PendingNparams) * 4))) + xgb.Pad((int(CurrentLen) * 1))) + xgb.Pad((int(CurrentNparams) * 4))) +// GetCrtcTransformReply represents the data returned from a GetCrtcTransform request. type GetCrtcTransformReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PendingTransform render.Transform HasTransforms bool @@ -3485,7 +3564,7 @@ type GetCrtcTransformReply struct { CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) } -// Waits and reads reply data from request GetCrtcTransform +// Reply blocks and returns the reply data for a GetCrtcTransform request. func (cook GetCrtcTransformCookie) Reply() (*GetCrtcTransformReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3497,7 +3576,7 @@ func (cook GetCrtcTransformCookie) Reply() (*GetCrtcTransformReply, error) { return getCrtcTransformReply(buf), nil } -// Read reply into structure from buffer for GetCrtcTransform +// getCrtcTransformReply reads a byte slice into a GetCrtcTransformReply value. func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { v := new(GetCrtcTransformReply) b := 1 // skip reply determinant @@ -3571,6 +3650,7 @@ func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { } // Write request to wire for GetCrtcTransform +// getCrtcTransformRequest writes a GetCrtcTransform request to a byte slice. func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { size := 8 b := 0 @@ -3591,29 +3671,31 @@ func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } -// Request GetPanning -// size: 8 +// GetPanningCookie is a cookie used only for GetPanning requests. type GetPanningCookie struct { *xgb.Cookie } +// GetPanning sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPanningCookie.Reply() func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPanningRequest(c, Crtc), cookie) return GetPanningCookie{cookie} } +// GetPanningUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPanningRequest(c, Crtc), cookie) return GetPanningCookie{cookie} } -// Request reply for GetPanning -// size: 36 +// GetPanningReply represents the data returned from a GetPanning request. type GetPanningReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte Timestamp xproto.Timestamp Left uint16 @@ -3630,7 +3712,7 @@ type GetPanningReply struct { BorderBottom int16 } -// Waits and reads reply data from request GetPanning +// Reply blocks and returns the reply data for a GetPanning request. func (cook GetPanningCookie) Reply() (*GetPanningReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3642,7 +3724,7 @@ func (cook GetPanningCookie) Reply() (*GetPanningReply, error) { return getPanningReply(buf), nil } -// Read reply into structure from buffer for GetPanning +// getPanningReply reads a byte slice into a GetPanningReply value. func getPanningReply(buf []byte) *GetPanningReply { v := new(GetPanningReply) b := 1 // skip reply determinant @@ -3699,6 +3781,7 @@ func getPanningReply(buf []byte) *GetPanningReply { } // Write request to wire for GetPanning +// getPanningRequest writes a GetPanning request to a byte slice. func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { size := 8 b := 0 @@ -3719,34 +3802,36 @@ func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } -// Request SetPanning -// size: 36 +// SetPanningCookie is a cookie used only for SetPanning requests. type SetPanningCookie struct { *xgb.Cookie } +// SetPanning sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetPanningCookie.Reply() func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { cookie := c.NewCookie(true, true) c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return SetPanningCookie{cookie} } +// SetPanningUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPanningUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { cookie := c.NewCookie(false, true) c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return SetPanningCookie{cookie} } -// Request reply for SetPanning -// size: 12 +// SetPanningReply represents the data returned from a SetPanning request. type SetPanningReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte Timestamp xproto.Timestamp } -// Waits and reads reply data from request SetPanning +// Reply blocks and returns the reply data for a SetPanning request. func (cook SetPanningCookie) Reply() (*SetPanningReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3758,7 +3843,7 @@ func (cook SetPanningCookie) Reply() (*SetPanningReply, error) { return setPanningReply(buf), nil } -// Read reply into structure from buffer for SetPanning +// setPanningReply reads a byte slice into a SetPanningReply value. func setPanningReply(buf []byte) *SetPanningReply { v := new(SetPanningReply) b := 1 // skip reply determinant @@ -3779,6 +3864,7 @@ func setPanningReply(buf []byte) *SetPanningReply { } // Write request to wire for SetPanning +// setPanningRequest writes a SetPanning request to a byte slice. func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) []byte { size := 36 b := 0 @@ -3838,30 +3924,35 @@ func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left return buf } -// Request SetOutputPrimary -// size: 12 +// SetOutputPrimaryCookie is a cookie used only for SetOutputPrimary requests. type SetOutputPrimaryCookie struct { *xgb.Cookie } -// Write request to wire for SetOutputPrimary +// SetOutputPrimary sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { cookie := c.NewCookie(false, false) c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) return SetOutputPrimaryCookie{cookie} } +// SetOutputPrimaryChecked sends a checked request. +// If an error occurs, it can be retrieved using SetOutputPrimaryCookie.Check() func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { cookie := c.NewCookie(true, false) c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) return SetOutputPrimaryCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetOutputPrimaryCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetOutputPrimary +// setOutputPrimaryRequest writes a SetOutputPrimary request to a byte slice. func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) []byte { size := 12 b := 0 @@ -3885,34 +3976,36 @@ func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) [ return buf } -// Request GetOutputPrimary -// size: 8 +// GetOutputPrimaryCookie is a cookie used only for GetOutputPrimary requests. type GetOutputPrimaryCookie struct { *xgb.Cookie } +// GetOutputPrimary sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOutputPrimaryCookie.Reply() func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { cookie := c.NewCookie(true, true) c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) return GetOutputPrimaryCookie{cookie} } +// GetOutputPrimaryUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { cookie := c.NewCookie(false, true) c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) return GetOutputPrimaryCookie{cookie} } -// Request reply for GetOutputPrimary -// size: 12 +// GetOutputPrimaryReply represents the data returned from a GetOutputPrimary request. type GetOutputPrimaryReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Output Output } -// Waits and reads reply data from request GetOutputPrimary +// Reply blocks and returns the reply data for a GetOutputPrimary request. func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3924,7 +4017,7 @@ func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { return getOutputPrimaryReply(buf), nil } -// Read reply into structure from buffer for GetOutputPrimary +// getOutputPrimaryReply reads a byte slice into a GetOutputPrimaryReply value. func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { v := new(GetOutputPrimaryReply) b := 1 // skip reply determinant @@ -3944,6 +4037,7 @@ func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { } // Write request to wire for GetOutputPrimary +// getOutputPrimaryRequest writes a GetOutputPrimary request to a byte slice. func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 740353d..28b268e 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on May 10 2012 8:04:32pm EDT. + This file was generated by record.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -90,14 +90,12 @@ type ElementHeader byte type ClientSpec uint32 -// 'Range8' struct definition -// Size: 2 type Range8 struct { First byte Last byte } -// Struct read Range8 +// Range8Read reads a byte slice into a Range8 value. func Range8Read(buf []byte, v *Range8) int { b := 0 @@ -110,7 +108,7 @@ func Range8Read(buf []byte, v *Range8) int { return b } -// Struct list read Range8 +// Range8ReadList reads a byte slice into a list of Range8 values. func Range8ReadList(buf []byte, dest []Range8) int { b := 0 for i := 0; i < len(dest); i++ { @@ -120,7 +118,7 @@ func Range8ReadList(buf []byte, dest []Range8) int { return xgb.Pad(b) } -// Struct write Range8 +// Bytes writes a Range8 value to a byte slice. func (v Range8) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -134,7 +132,7 @@ func (v Range8) Bytes() []byte { return buf } -// Write struct list Range8 +// Range8ListBytes writes a list of %s(MISSING) values to a byte slice. func Range8ListBytes(buf []byte, list []Range8) int { b := 0 var structBytes []byte @@ -146,14 +144,12 @@ func Range8ListBytes(buf []byte, list []Range8) int { return b } -// 'Range16' struct definition -// Size: 4 type Range16 struct { First uint16 Last uint16 } -// Struct read Range16 +// Range16Read reads a byte slice into a Range16 value. func Range16Read(buf []byte, v *Range16) int { b := 0 @@ -166,7 +162,7 @@ func Range16Read(buf []byte, v *Range16) int { return b } -// Struct list read Range16 +// Range16ReadList reads a byte slice into a list of Range16 values. func Range16ReadList(buf []byte, dest []Range16) int { b := 0 for i := 0; i < len(dest); i++ { @@ -176,7 +172,7 @@ func Range16ReadList(buf []byte, dest []Range16) int { return xgb.Pad(b) } -// Struct write Range16 +// Bytes writes a Range16 value to a byte slice. func (v Range16) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -190,7 +186,7 @@ func (v Range16) Bytes() []byte { return buf } -// Write struct list Range16 +// Range16ListBytes writes a list of %s(MISSING) values to a byte slice. func Range16ListBytes(buf []byte, list []Range16) int { b := 0 var structBytes []byte @@ -202,14 +198,12 @@ func Range16ListBytes(buf []byte, list []Range16) int { return b } -// 'ExtRange' struct definition -// Size: 6 type ExtRange struct { Major Range8 Minor Range16 } -// Struct read ExtRange +// ExtRangeRead reads a byte slice into a ExtRange value. func ExtRangeRead(buf []byte, v *ExtRange) int { b := 0 @@ -222,7 +216,7 @@ func ExtRangeRead(buf []byte, v *ExtRange) int { return b } -// Struct list read ExtRange +// ExtRangeReadList reads a byte slice into a list of ExtRange values. func ExtRangeReadList(buf []byte, dest []ExtRange) int { b := 0 for i := 0; i < len(dest); i++ { @@ -232,7 +226,7 @@ func ExtRangeReadList(buf []byte, dest []ExtRange) int { return xgb.Pad(b) } -// Struct write ExtRange +// Bytes writes a ExtRange value to a byte slice. func (v ExtRange) Bytes() []byte { buf := make([]byte, 6) b := 0 @@ -252,7 +246,7 @@ func (v ExtRange) Bytes() []byte { return buf } -// Write struct list ExtRange +// ExtRangeListBytes writes a list of %s(MISSING) values to a byte slice. func ExtRangeListBytes(buf []byte, list []ExtRange) int { b := 0 var structBytes []byte @@ -264,8 +258,6 @@ func ExtRangeListBytes(buf []byte, list []ExtRange) int { return b } -// 'Range' struct definition -// Size: 24 type Range struct { CoreRequests Range8 CoreReplies Range8 @@ -278,7 +270,7 @@ type Range struct { ClientDied bool } -// Struct read Range +// RangeRead reads a byte slice into a Range value. func RangeRead(buf []byte, v *Range) int { b := 0 @@ -320,7 +312,7 @@ func RangeRead(buf []byte, v *Range) int { return b } -// Struct list read Range +// RangeReadList reads a byte slice into a list of Range values. func RangeReadList(buf []byte, dest []Range) int { b := 0 for i := 0; i < len(dest); i++ { @@ -330,7 +322,7 @@ func RangeReadList(buf []byte, dest []Range) int { return xgb.Pad(b) } -// Struct write Range +// Bytes writes a Range value to a byte slice. func (v Range) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -394,7 +386,7 @@ func (v Range) Bytes() []byte { return buf } -// Write struct list Range +// RangeListBytes writes a list of %s(MISSING) values to a byte slice. func RangeListBytes(buf []byte, list []Range) int { b := 0 var structBytes []byte @@ -406,15 +398,13 @@ func RangeListBytes(buf []byte, list []Range) int { return b } -// 'ClientInfo' struct definition -// Size: (8 + xgb.Pad((int(NumRanges) * 24))) type ClientInfo struct { ClientResource ClientSpec NumRanges uint32 Ranges []Range // size: xgb.Pad((int(NumRanges) * 24)) } -// Struct read ClientInfo +// ClientInfoRead reads a byte slice into a ClientInfo value. func ClientInfoRead(buf []byte, v *ClientInfo) int { b := 0 @@ -430,7 +420,7 @@ func ClientInfoRead(buf []byte, v *ClientInfo) int { return b } -// Struct list read ClientInfo +// ClientInfoReadList reads a byte slice into a list of ClientInfo values. func ClientInfoReadList(buf []byte, dest []ClientInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -440,7 +430,7 @@ func ClientInfoReadList(buf []byte, dest []ClientInfo) int { return xgb.Pad(b) } -// Struct write ClientInfo +// Bytes writes a ClientInfo value to a byte slice. func (v ClientInfo) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24)))) b := 0 @@ -456,7 +446,7 @@ func (v ClientInfo) Bytes() []byte { return buf } -// Write struct list ClientInfo +// ClientInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ClientInfoListBytes(buf []byte, list []ClientInfo) int { b := 0 var structBytes []byte @@ -468,7 +458,7 @@ func ClientInfoListBytes(buf []byte, list []ClientInfo) int { return b } -// Struct list size ClientInfo +// ClientInfoListSize computes the size (bytes) of a list of ClientInfo values. func ClientInfoListSize(list []ClientInfo) int { size := 0 for _, item := range list { @@ -477,9 +467,7 @@ func ClientInfoListSize(list []ClientInfo) int { return size } -// Error definition BadContext (0) -// Size: 32 - +// BadBadContext is the error number for a BadBadContext. const BadBadContext = 0 type BadContextError struct { @@ -488,7 +476,7 @@ type BadContextError struct { InvalidRecord uint32 } -// Error read BadContext +// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. func BadContextErrorNew(buf []byte) xgb.Error { v := BadContextError{} v.NiceName = "BadContext" @@ -505,8 +493,8 @@ func BadContextErrorNew(buf []byte) xgb.Error { return v } -func (err BadContextError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadContext error. +// This is mostly used internally. func (err BadContextError) SequenceId() uint16 { return err.Sequence } @@ -527,35 +515,37 @@ func init() { xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint16 MinorVersion uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -567,7 +557,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -590,6 +580,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) []byte { size := 8 b := 0 @@ -613,30 +604,35 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) return buf } -// Request CreateContext -// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) +// CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie } -// Write request to wire for CreateContext +// CreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return CreateContextCookie{cookie} } +// CreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return CreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) b := 0 @@ -676,30 +672,35 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea return buf } -// Request RegisterClients -// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) +// RegisterClientsCookie is a cookie used only for RegisterClients requests. type RegisterClientsCookie struct { *xgb.Cookie } -// Write request to wire for RegisterClients +// RegisterClients sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { cookie := c.NewCookie(false, false) c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RegisterClientsCookie{cookie} } +// RegisterClientsChecked sends a checked request. +// If an error occurs, it can be retrieved using RegisterClientsCookie.Check() func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { cookie := c.NewCookie(true, false) c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RegisterClientsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RegisterClientsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RegisterClients +// registerClientsRequest writes a RegisterClients request to a byte slice. func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) b := 0 @@ -739,30 +740,35 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH return buf } -// Request UnregisterClients -// size: xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4)))) +// UnregisterClientsCookie is a cookie used only for UnregisterClients requests. type UnregisterClientsCookie struct { *xgb.Cookie } -// Write request to wire for UnregisterClients +// UnregisterClients sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { cookie := c.NewCookie(false, false) c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) return UnregisterClientsCookie{cookie} } +// UnregisterClientsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnregisterClientsCookie.Check() func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { cookie := c.NewCookie(true, false) c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) return UnregisterClientsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnregisterClientsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnregisterClients +// unregisterClientsRequest writes a UnregisterClients request to a byte slice. func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) []byte { size := xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4)))) b := 0 @@ -792,29 +798,31 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3 return buf } -// Request GetContext -// size: 8 +// GetContextCookie is a cookie used only for GetContext requests. type GetContextCookie struct { *xgb.Cookie } +// GetContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply() func GetContext(c *xgb.Conn, Context Context) GetContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getContextRequest(c, Context), cookie) return GetContextCookie{cookie} } +// GetContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getContextRequest(c, Context), cookie) return GetContextCookie{cookie} } -// Request reply for GetContext -// size: (32 + ClientInfoListSize(InterceptedClients)) +// GetContextReply represents the data returned from a GetContext request. type GetContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Enabled bool ElementHeader ElementHeader // padding: 3 bytes @@ -823,7 +831,7 @@ type GetContextReply struct { InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients) } -// Waits and reads reply data from request GetContext +// Reply blocks and returns the reply data for a GetContext request. func (cook GetContextCookie) Reply() (*GetContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -835,7 +843,7 @@ func (cook GetContextCookie) Reply() (*GetContextReply, error) { return getContextReply(buf), nil } -// Read reply into structure from buffer for GetContext +// getContextReply reads a byte slice into a GetContextReply value. func getContextReply(buf []byte) *GetContextReply { v := new(GetContextReply) b := 1 // skip reply determinant @@ -870,6 +878,7 @@ func getContextReply(buf []byte) *GetContextReply { } // Write request to wire for GetContext +// getContextRequest writes a GetContext request to a byte slice. func getContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -890,29 +899,31 @@ func getContextRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request EnableContext -// size: 8 +// EnableContextCookie is a cookie used only for EnableContext requests. type EnableContextCookie struct { *xgb.Cookie } +// EnableContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply() func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(enableContextRequest(c, Context), cookie) return EnableContextCookie{cookie} } +// EnableContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(enableContextRequest(c, Context), cookie) return EnableContextCookie{cookie} } -// Request reply for EnableContext -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// EnableContextReply represents the data returned from a EnableContext request. type EnableContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Category byte ElementHeader ElementHeader ClientSwapped bool @@ -924,7 +935,7 @@ type EnableContextReply struct { Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request EnableContext +// Reply blocks and returns the reply data for a EnableContext request. func (cook EnableContextCookie) Reply() (*EnableContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -936,7 +947,7 @@ func (cook EnableContextCookie) Reply() (*EnableContextReply, error) { return enableContextReply(buf), nil } -// Read reply into structure from buffer for EnableContext +// enableContextReply reads a byte slice into a EnableContextReply value. func enableContextReply(buf []byte) *EnableContextReply { v := new(EnableContextReply) b := 1 // skip reply determinant @@ -981,6 +992,7 @@ func enableContextReply(buf []byte) *EnableContextReply { } // Write request to wire for EnableContext +// enableContextRequest writes a EnableContext request to a byte slice. func enableContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -1001,30 +1013,35 @@ func enableContextRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request DisableContext -// size: 8 +// DisableContextCookie is a cookie used only for DisableContext requests. type DisableContextCookie struct { *xgb.Cookie } -// Write request to wire for DisableContext +// DisableContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(disableContextRequest(c, Context), cookie) return DisableContextCookie{cookie} } +// DisableContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DisableContextCookie.Check() func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(disableContextRequest(c, Context), cookie) return DisableContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DisableContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DisableContext +// disableContextRequest writes a DisableContext request to a byte slice. func disableContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 @@ -1045,30 +1062,35 @@ func disableContextRequest(c *xgb.Conn, Context Context) []byte { return buf } -// Request FreeContext -// size: 8 +// FreeContextCookie is a cookie used only for FreeContext requests. type FreeContextCookie struct { *xgb.Cookie } -// Write request to wire for FreeContext +// FreeContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeContextRequest(c, Context), cookie) return FreeContextCookie{cookie} } +// FreeContextChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeContextCookie.Check() func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeContextRequest(c, Context), cookie) return FreeContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeContext +// freeContextRequest writes a FreeContext request to a byte slice. func freeContextRequest(c *xgb.Conn, Context Context) []byte { size := 8 b := 0 diff --git a/nexgb/render/render.go b/nexgb/render/render.go index ca3f9bd..61f0b96 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on May 10 2012 8:04:32pm EDT. + This file was generated by render.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( PictTypeIndexed = 0 PictTypeDirect = 1 @@ -205,8 +205,6 @@ type Glyph uint32 type Fixed int32 -// 'Directformat' struct definition -// Size: 16 type Directformat struct { RedShift uint16 RedMask uint16 @@ -218,7 +216,7 @@ type Directformat struct { AlphaMask uint16 } -// Struct read Directformat +// DirectformatRead reads a byte slice into a Directformat value. func DirectformatRead(buf []byte, v *Directformat) int { b := 0 @@ -249,7 +247,7 @@ func DirectformatRead(buf []byte, v *Directformat) int { return b } -// Struct list read Directformat +// DirectformatReadList reads a byte slice into a list of Directformat values. func DirectformatReadList(buf []byte, dest []Directformat) int { b := 0 for i := 0; i < len(dest); i++ { @@ -259,7 +257,7 @@ func DirectformatReadList(buf []byte, dest []Directformat) int { return xgb.Pad(b) } -// Struct write Directformat +// Bytes writes a Directformat value to a byte slice. func (v Directformat) Bytes() []byte { buf := make([]byte, 16) b := 0 @@ -291,7 +289,7 @@ func (v Directformat) Bytes() []byte { return buf } -// Write struct list Directformat +// DirectformatListBytes writes a list of %s(MISSING) values to a byte slice. func DirectformatListBytes(buf []byte, list []Directformat) int { b := 0 var structBytes []byte @@ -303,8 +301,6 @@ func DirectformatListBytes(buf []byte, list []Directformat) int { return b } -// 'Pictforminfo' struct definition -// Size: 28 type Pictforminfo struct { Id Pictformat Type byte @@ -314,7 +310,7 @@ type Pictforminfo struct { Colormap xproto.Colormap } -// Struct read Pictforminfo +// PictforminfoRead reads a byte slice into a Pictforminfo value. func PictforminfoRead(buf []byte, v *Pictforminfo) int { b := 0 @@ -338,7 +334,7 @@ func PictforminfoRead(buf []byte, v *Pictforminfo) int { return b } -// Struct list read Pictforminfo +// PictforminfoReadList reads a byte slice into a list of Pictforminfo values. func PictforminfoReadList(buf []byte, dest []Pictforminfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -348,7 +344,7 @@ func PictforminfoReadList(buf []byte, dest []Pictforminfo) int { return xgb.Pad(b) } -// Struct write Pictforminfo +// Bytes writes a Pictforminfo value to a byte slice. func (v Pictforminfo) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -376,7 +372,7 @@ func (v Pictforminfo) Bytes() []byte { return buf } -// Write struct list Pictforminfo +// PictforminfoListBytes writes a list of %s(MISSING) values to a byte slice. func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { b := 0 var structBytes []byte @@ -388,14 +384,12 @@ func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { return b } -// 'Pictvisual' struct definition -// Size: 8 type Pictvisual struct { Visual xproto.Visualid Format Pictformat } -// Struct read Pictvisual +// PictvisualRead reads a byte slice into a Pictvisual value. func PictvisualRead(buf []byte, v *Pictvisual) int { b := 0 @@ -408,7 +402,7 @@ func PictvisualRead(buf []byte, v *Pictvisual) int { return b } -// Struct list read Pictvisual +// PictvisualReadList reads a byte slice into a list of Pictvisual values. func PictvisualReadList(buf []byte, dest []Pictvisual) int { b := 0 for i := 0; i < len(dest); i++ { @@ -418,7 +412,7 @@ func PictvisualReadList(buf []byte, dest []Pictvisual) int { return xgb.Pad(b) } -// Struct write Pictvisual +// Bytes writes a Pictvisual value to a byte slice. func (v Pictvisual) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -432,7 +426,7 @@ func (v Pictvisual) Bytes() []byte { return buf } -// Write struct list Pictvisual +// PictvisualListBytes writes a list of %s(MISSING) values to a byte slice. func PictvisualListBytes(buf []byte, list []Pictvisual) int { b := 0 var structBytes []byte @@ -444,8 +438,6 @@ func PictvisualListBytes(buf []byte, list []Pictvisual) int { return b } -// 'Pictdepth' struct definition -// Size: (8 + xgb.Pad((int(NumVisuals) * 8))) type Pictdepth struct { Depth byte // padding: 1 bytes @@ -454,7 +446,7 @@ type Pictdepth struct { Visuals []Pictvisual // size: xgb.Pad((int(NumVisuals) * 8)) } -// Struct read Pictdepth +// PictdepthRead reads a byte slice into a Pictdepth value. func PictdepthRead(buf []byte, v *Pictdepth) int { b := 0 @@ -474,7 +466,7 @@ func PictdepthRead(buf []byte, v *Pictdepth) int { return b } -// Struct list read Pictdepth +// PictdepthReadList reads a byte slice into a list of Pictdepth values. func PictdepthReadList(buf []byte, dest []Pictdepth) int { b := 0 for i := 0; i < len(dest); i++ { @@ -484,7 +476,7 @@ func PictdepthReadList(buf []byte, dest []Pictdepth) int { return xgb.Pad(b) } -// Struct write Pictdepth +// Bytes writes a Pictdepth value to a byte slice. func (v Pictdepth) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumVisuals) * 8)))) b := 0 @@ -504,7 +496,7 @@ func (v Pictdepth) Bytes() []byte { return buf } -// Write struct list Pictdepth +// PictdepthListBytes writes a list of %s(MISSING) values to a byte slice. func PictdepthListBytes(buf []byte, list []Pictdepth) int { b := 0 var structBytes []byte @@ -516,7 +508,7 @@ func PictdepthListBytes(buf []byte, list []Pictdepth) int { return b } -// Struct list size Pictdepth +// PictdepthListSize computes the size (bytes) of a list of Pictdepth values. func PictdepthListSize(list []Pictdepth) int { size := 0 for _, item := range list { @@ -525,15 +517,13 @@ func PictdepthListSize(list []Pictdepth) int { return size } -// 'Pictscreen' struct definition -// Size: (8 + PictdepthListSize(Depths)) type Pictscreen struct { NumDepths uint32 Fallback Pictformat Depths []Pictdepth // size: PictdepthListSize(Depths) } -// Struct read Pictscreen +// PictscreenRead reads a byte slice into a Pictscreen value. func PictscreenRead(buf []byte, v *Pictscreen) int { b := 0 @@ -549,7 +539,7 @@ func PictscreenRead(buf []byte, v *Pictscreen) int { return b } -// Struct list read Pictscreen +// PictscreenReadList reads a byte slice into a list of Pictscreen values. func PictscreenReadList(buf []byte, dest []Pictscreen) int { b := 0 for i := 0; i < len(dest); i++ { @@ -559,7 +549,7 @@ func PictscreenReadList(buf []byte, dest []Pictscreen) int { return xgb.Pad(b) } -// Struct write Pictscreen +// Bytes writes a Pictscreen value to a byte slice. func (v Pictscreen) Bytes() []byte { buf := make([]byte, (8 + PictdepthListSize(v.Depths))) b := 0 @@ -575,7 +565,7 @@ func (v Pictscreen) Bytes() []byte { return buf } -// Write struct list Pictscreen +// PictscreenListBytes writes a list of %s(MISSING) values to a byte slice. func PictscreenListBytes(buf []byte, list []Pictscreen) int { b := 0 var structBytes []byte @@ -587,7 +577,7 @@ func PictscreenListBytes(buf []byte, list []Pictscreen) int { return b } -// Struct list size Pictscreen +// PictscreenListSize computes the size (bytes) of a list of Pictscreen values. func PictscreenListSize(list []Pictscreen) int { size := 0 for _, item := range list { @@ -596,8 +586,6 @@ func PictscreenListSize(list []Pictscreen) int { return size } -// 'Indexvalue' struct definition -// Size: 12 type Indexvalue struct { Pixel uint32 Red uint16 @@ -606,7 +594,7 @@ type Indexvalue struct { Alpha uint16 } -// Struct read Indexvalue +// IndexvalueRead reads a byte slice into a Indexvalue value. func IndexvalueRead(buf []byte, v *Indexvalue) int { b := 0 @@ -628,7 +616,7 @@ func IndexvalueRead(buf []byte, v *Indexvalue) int { return b } -// Struct list read Indexvalue +// IndexvalueReadList reads a byte slice into a list of Indexvalue values. func IndexvalueReadList(buf []byte, dest []Indexvalue) int { b := 0 for i := 0; i < len(dest); i++ { @@ -638,7 +626,7 @@ func IndexvalueReadList(buf []byte, dest []Indexvalue) int { return xgb.Pad(b) } -// Struct write Indexvalue +// Bytes writes a Indexvalue value to a byte slice. func (v Indexvalue) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -661,7 +649,7 @@ func (v Indexvalue) Bytes() []byte { return buf } -// Write struct list Indexvalue +// IndexvalueListBytes writes a list of %s(MISSING) values to a byte slice. func IndexvalueListBytes(buf []byte, list []Indexvalue) int { b := 0 var structBytes []byte @@ -673,8 +661,6 @@ func IndexvalueListBytes(buf []byte, list []Indexvalue) int { return b } -// 'Color' struct definition -// Size: 8 type Color struct { Red uint16 Green uint16 @@ -682,7 +668,7 @@ type Color struct { Alpha uint16 } -// Struct read Color +// ColorRead reads a byte slice into a Color value. func ColorRead(buf []byte, v *Color) int { b := 0 @@ -701,7 +687,7 @@ func ColorRead(buf []byte, v *Color) int { return b } -// Struct list read Color +// ColorReadList reads a byte slice into a list of Color values. func ColorReadList(buf []byte, dest []Color) int { b := 0 for i := 0; i < len(dest); i++ { @@ -711,7 +697,7 @@ func ColorReadList(buf []byte, dest []Color) int { return xgb.Pad(b) } -// Struct write Color +// Bytes writes a Color value to a byte slice. func (v Color) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -731,7 +717,7 @@ func (v Color) Bytes() []byte { return buf } -// Write struct list Color +// ColorListBytes writes a list of %s(MISSING) values to a byte slice. func ColorListBytes(buf []byte, list []Color) int { b := 0 var structBytes []byte @@ -743,14 +729,12 @@ func ColorListBytes(buf []byte, list []Color) int { return b } -// 'Pointfix' struct definition -// Size: 8 type Pointfix struct { X Fixed Y Fixed } -// Struct read Pointfix +// PointfixRead reads a byte slice into a Pointfix value. func PointfixRead(buf []byte, v *Pointfix) int { b := 0 @@ -763,7 +747,7 @@ func PointfixRead(buf []byte, v *Pointfix) int { return b } -// Struct list read Pointfix +// PointfixReadList reads a byte slice into a list of Pointfix values. func PointfixReadList(buf []byte, dest []Pointfix) int { b := 0 for i := 0; i < len(dest); i++ { @@ -773,7 +757,7 @@ func PointfixReadList(buf []byte, dest []Pointfix) int { return xgb.Pad(b) } -// Struct write Pointfix +// Bytes writes a Pointfix value to a byte slice. func (v Pointfix) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -787,7 +771,7 @@ func (v Pointfix) Bytes() []byte { return buf } -// Write struct list Pointfix +// PointfixListBytes writes a list of %s(MISSING) values to a byte slice. func PointfixListBytes(buf []byte, list []Pointfix) int { b := 0 var structBytes []byte @@ -799,14 +783,12 @@ func PointfixListBytes(buf []byte, list []Pointfix) int { return b } -// 'Linefix' struct definition -// Size: 16 type Linefix struct { P1 Pointfix P2 Pointfix } -// Struct read Linefix +// LinefixRead reads a byte slice into a Linefix value. func LinefixRead(buf []byte, v *Linefix) int { b := 0 @@ -819,7 +801,7 @@ func LinefixRead(buf []byte, v *Linefix) int { return b } -// Struct list read Linefix +// LinefixReadList reads a byte slice into a list of Linefix values. func LinefixReadList(buf []byte, dest []Linefix) int { b := 0 for i := 0; i < len(dest); i++ { @@ -829,7 +811,7 @@ func LinefixReadList(buf []byte, dest []Linefix) int { return xgb.Pad(b) } -// Struct write Linefix +// Bytes writes a Linefix value to a byte slice. func (v Linefix) Bytes() []byte { buf := make([]byte, 16) b := 0 @@ -849,7 +831,7 @@ func (v Linefix) Bytes() []byte { return buf } -// Write struct list Linefix +// LinefixListBytes writes a list of %s(MISSING) values to a byte slice. func LinefixListBytes(buf []byte, list []Linefix) int { b := 0 var structBytes []byte @@ -861,15 +843,13 @@ func LinefixListBytes(buf []byte, list []Linefix) int { return b } -// 'Triangle' struct definition -// Size: 24 type Triangle struct { P1 Pointfix P2 Pointfix P3 Pointfix } -// Struct read Triangle +// TriangleRead reads a byte slice into a Triangle value. func TriangleRead(buf []byte, v *Triangle) int { b := 0 @@ -885,7 +865,7 @@ func TriangleRead(buf []byte, v *Triangle) int { return b } -// Struct list read Triangle +// TriangleReadList reads a byte slice into a list of Triangle values. func TriangleReadList(buf []byte, dest []Triangle) int { b := 0 for i := 0; i < len(dest); i++ { @@ -895,7 +875,7 @@ func TriangleReadList(buf []byte, dest []Triangle) int { return xgb.Pad(b) } -// Struct write Triangle +// Bytes writes a Triangle value to a byte slice. func (v Triangle) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -921,7 +901,7 @@ func (v Triangle) Bytes() []byte { return buf } -// Write struct list Triangle +// TriangleListBytes writes a list of %s(MISSING) values to a byte slice. func TriangleListBytes(buf []byte, list []Triangle) int { b := 0 var structBytes []byte @@ -933,8 +913,6 @@ func TriangleListBytes(buf []byte, list []Triangle) int { return b } -// 'Trapezoid' struct definition -// Size: 40 type Trapezoid struct { Top Fixed Bottom Fixed @@ -942,7 +920,7 @@ type Trapezoid struct { Right Linefix } -// Struct read Trapezoid +// TrapezoidRead reads a byte slice into a Trapezoid value. func TrapezoidRead(buf []byte, v *Trapezoid) int { b := 0 @@ -961,7 +939,7 @@ func TrapezoidRead(buf []byte, v *Trapezoid) int { return b } -// Struct list read Trapezoid +// TrapezoidReadList reads a byte slice into a list of Trapezoid values. func TrapezoidReadList(buf []byte, dest []Trapezoid) int { b := 0 for i := 0; i < len(dest); i++ { @@ -971,7 +949,7 @@ func TrapezoidReadList(buf []byte, dest []Trapezoid) int { return xgb.Pad(b) } -// Struct write Trapezoid +// Bytes writes a Trapezoid value to a byte slice. func (v Trapezoid) Bytes() []byte { buf := make([]byte, 40) b := 0 @@ -997,7 +975,7 @@ func (v Trapezoid) Bytes() []byte { return buf } -// Write struct list Trapezoid +// TrapezoidListBytes writes a list of %s(MISSING) values to a byte slice. func TrapezoidListBytes(buf []byte, list []Trapezoid) int { b := 0 var structBytes []byte @@ -1009,8 +987,6 @@ func TrapezoidListBytes(buf []byte, list []Trapezoid) int { return b } -// 'Glyphinfo' struct definition -// Size: 12 type Glyphinfo struct { Width uint16 Height uint16 @@ -1020,7 +996,7 @@ type Glyphinfo struct { YOff int16 } -// Struct read Glyphinfo +// GlyphinfoRead reads a byte slice into a Glyphinfo value. func GlyphinfoRead(buf []byte, v *Glyphinfo) int { b := 0 @@ -1045,7 +1021,7 @@ func GlyphinfoRead(buf []byte, v *Glyphinfo) int { return b } -// Struct list read Glyphinfo +// GlyphinfoReadList reads a byte slice into a list of Glyphinfo values. func GlyphinfoReadList(buf []byte, dest []Glyphinfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1055,7 +1031,7 @@ func GlyphinfoReadList(buf []byte, dest []Glyphinfo) int { return xgb.Pad(b) } -// Struct write Glyphinfo +// Bytes writes a Glyphinfo value to a byte slice. func (v Glyphinfo) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1081,7 +1057,7 @@ func (v Glyphinfo) Bytes() []byte { return buf } -// Write struct list Glyphinfo +// GlyphinfoListBytes writes a list of %s(MISSING) values to a byte slice. func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { b := 0 var structBytes []byte @@ -1093,8 +1069,6 @@ func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { return b } -// 'Transform' struct definition -// Size: 36 type Transform struct { Matrix11 Fixed Matrix12 Fixed @@ -1107,7 +1081,7 @@ type Transform struct { Matrix33 Fixed } -// Struct read Transform +// TransformRead reads a byte slice into a Transform value. func TransformRead(buf []byte, v *Transform) int { b := 0 @@ -1141,7 +1115,7 @@ func TransformRead(buf []byte, v *Transform) int { return b } -// Struct list read Transform +// TransformReadList reads a byte slice into a list of Transform values. func TransformReadList(buf []byte, dest []Transform) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1151,7 +1125,7 @@ func TransformReadList(buf []byte, dest []Transform) int { return xgb.Pad(b) } -// Struct write Transform +// Bytes writes a Transform value to a byte slice. func (v Transform) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -1186,7 +1160,7 @@ func (v Transform) Bytes() []byte { return buf } -// Write struct list Transform +// TransformListBytes writes a list of %s(MISSING) values to a byte slice. func TransformListBytes(buf []byte, list []Transform) int { b := 0 var structBytes []byte @@ -1198,14 +1172,12 @@ func TransformListBytes(buf []byte, list []Transform) int { return b } -// 'Animcursorelt' struct definition -// Size: 8 type Animcursorelt struct { Cursor xproto.Cursor Delay uint32 } -// Struct read Animcursorelt +// AnimcursoreltRead reads a byte slice into a Animcursorelt value. func AnimcursoreltRead(buf []byte, v *Animcursorelt) int { b := 0 @@ -1218,7 +1190,7 @@ func AnimcursoreltRead(buf []byte, v *Animcursorelt) int { return b } -// Struct list read Animcursorelt +// AnimcursoreltReadList reads a byte slice into a list of Animcursorelt values. func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1228,7 +1200,7 @@ func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int { return xgb.Pad(b) } -// Struct write Animcursorelt +// Bytes writes a Animcursorelt value to a byte slice. func (v Animcursorelt) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1242,7 +1214,7 @@ func (v Animcursorelt) Bytes() []byte { return buf } -// Write struct list Animcursorelt +// AnimcursoreltListBytes writes a list of %s(MISSING) values to a byte slice. func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { b := 0 var structBytes []byte @@ -1254,15 +1226,13 @@ func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { return b } -// 'Spanfix' struct definition -// Size: 12 type Spanfix struct { L Fixed R Fixed Y Fixed } -// Struct read Spanfix +// SpanfixRead reads a byte slice into a Spanfix value. func SpanfixRead(buf []byte, v *Spanfix) int { b := 0 @@ -1278,7 +1248,7 @@ func SpanfixRead(buf []byte, v *Spanfix) int { return b } -// Struct list read Spanfix +// SpanfixReadList reads a byte slice into a list of Spanfix values. func SpanfixReadList(buf []byte, dest []Spanfix) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1288,7 +1258,7 @@ func SpanfixReadList(buf []byte, dest []Spanfix) int { return xgb.Pad(b) } -// Struct write Spanfix +// Bytes writes a Spanfix value to a byte slice. func (v Spanfix) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1305,7 +1275,7 @@ func (v Spanfix) Bytes() []byte { return buf } -// Write struct list Spanfix +// SpanfixListBytes writes a list of %s(MISSING) values to a byte slice. func SpanfixListBytes(buf []byte, list []Spanfix) int { b := 0 var structBytes []byte @@ -1317,14 +1287,12 @@ func SpanfixListBytes(buf []byte, list []Spanfix) int { return b } -// 'Trap' struct definition -// Size: 24 type Trap struct { Top Spanfix Bot Spanfix } -// Struct read Trap +// TrapRead reads a byte slice into a Trap value. func TrapRead(buf []byte, v *Trap) int { b := 0 @@ -1337,7 +1305,7 @@ func TrapRead(buf []byte, v *Trap) int { return b } -// Struct list read Trap +// TrapReadList reads a byte slice into a list of Trap values. func TrapReadList(buf []byte, dest []Trap) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1347,7 +1315,7 @@ func TrapReadList(buf []byte, dest []Trap) int { return xgb.Pad(b) } -// Struct write Trap +// Bytes writes a Trap value to a byte slice. func (v Trap) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -1367,7 +1335,7 @@ func (v Trap) Bytes() []byte { return buf } -// Write struct list Trap +// TrapListBytes writes a list of %s(MISSING) values to a byte slice. func TrapListBytes(buf []byte, list []Trap) int { b := 0 var structBytes []byte @@ -1379,9 +1347,7 @@ func TrapListBytes(buf []byte, list []Trap) int { return b } -// Error definition PictFormat (0) -// Size: 32 - +// BadPictFormat is the error number for a BadPictFormat. const BadPictFormat = 0 type PictFormatError struct { @@ -1389,7 +1355,7 @@ type PictFormatError struct { NiceName string } -// Error read PictFormat +// PictFormatErrorNew constructs a PictFormatError value that implements xgb.Error from a byte slice. func PictFormatErrorNew(buf []byte) xgb.Error { v := PictFormatError{} v.NiceName = "PictFormat" @@ -1403,8 +1369,8 @@ func PictFormatErrorNew(buf []byte) xgb.Error { return v } -func (err PictFormatError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadPictFormat error. +// This is mostly used internally. func (err PictFormatError) SequenceId() uint16 { return err.Sequence } @@ -1424,9 +1390,7 @@ func init() { xgb.NewExtErrorFuncs["RENDER"][0] = PictFormatErrorNew } -// Error definition Picture (1) -// Size: 32 - +// BadPicture is the error number for a BadPicture. const BadPicture = 1 type PictureError struct { @@ -1434,7 +1398,7 @@ type PictureError struct { NiceName string } -// Error read Picture +// PictureErrorNew constructs a PictureError value that implements xgb.Error from a byte slice. func PictureErrorNew(buf []byte) xgb.Error { v := PictureError{} v.NiceName = "Picture" @@ -1448,8 +1412,8 @@ func PictureErrorNew(buf []byte) xgb.Error { return v } -func (err PictureError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadPicture error. +// This is mostly used internally. func (err PictureError) SequenceId() uint16 { return err.Sequence } @@ -1469,9 +1433,7 @@ func init() { xgb.NewExtErrorFuncs["RENDER"][1] = PictureErrorNew } -// Error definition PictOp (2) -// Size: 32 - +// BadPictOp is the error number for a BadPictOp. const BadPictOp = 2 type PictOpError struct { @@ -1479,7 +1441,7 @@ type PictOpError struct { NiceName string } -// Error read PictOp +// PictOpErrorNew constructs a PictOpError value that implements xgb.Error from a byte slice. func PictOpErrorNew(buf []byte) xgb.Error { v := PictOpError{} v.NiceName = "PictOp" @@ -1493,8 +1455,8 @@ func PictOpErrorNew(buf []byte) xgb.Error { return v } -func (err PictOpError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadPictOp error. +// This is mostly used internally. func (err PictOpError) SequenceId() uint16 { return err.Sequence } @@ -1514,9 +1476,7 @@ func init() { xgb.NewExtErrorFuncs["RENDER"][2] = PictOpErrorNew } -// Error definition GlyphSet (3) -// Size: 32 - +// BadGlyphSet is the error number for a BadGlyphSet. const BadGlyphSet = 3 type GlyphSetError struct { @@ -1524,7 +1484,7 @@ type GlyphSetError struct { NiceName string } -// Error read GlyphSet +// GlyphSetErrorNew constructs a GlyphSetError value that implements xgb.Error from a byte slice. func GlyphSetErrorNew(buf []byte) xgb.Error { v := GlyphSetError{} v.NiceName = "GlyphSet" @@ -1538,8 +1498,8 @@ func GlyphSetErrorNew(buf []byte) xgb.Error { return v } -func (err GlyphSetError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGlyphSet error. +// This is mostly used internally. func (err GlyphSetError) SequenceId() uint16 { return err.Sequence } @@ -1559,9 +1519,7 @@ func init() { xgb.NewExtErrorFuncs["RENDER"][3] = GlyphSetErrorNew } -// Error definition Glyph (4) -// Size: 32 - +// BadGlyph is the error number for a BadGlyph. const BadGlyph = 4 type GlyphError struct { @@ -1569,7 +1527,7 @@ type GlyphError struct { NiceName string } -// Error read Glyph +// GlyphErrorNew constructs a GlyphError value that implements xgb.Error from a byte slice. func GlyphErrorNew(buf []byte) xgb.Error { v := GlyphError{} v.NiceName = "Glyph" @@ -1583,8 +1541,8 @@ func GlyphErrorNew(buf []byte) xgb.Error { return v } -func (err GlyphError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGlyph error. +// This is mostly used internally. func (err GlyphError) SequenceId() uint16 { return err.Sequence } @@ -1604,36 +1562,38 @@ func init() { xgb.NewExtErrorFuncs["RENDER"][4] = GlyphErrorNew } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1645,7 +1605,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -1670,6 +1630,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { size := 12 b := 0 @@ -1693,29 +1654,31 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers return buf } -// Request QueryPictFormats -// size: 4 +// QueryPictFormatsCookie is a cookie used only for QueryPictFormats requests. type QueryPictFormatsCookie struct { *xgb.Cookie } +// QueryPictFormats sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPictFormatsCookie.Reply() func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryPictFormatsRequest(c), cookie) return QueryPictFormatsCookie{cookie} } +// QueryPictFormatsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictFormatsUnchecked(c *xgb.Conn) QueryPictFormatsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryPictFormatsRequest(c), cookie) return QueryPictFormatsCookie{cookie} } -// Request reply for QueryPictFormats -// size: (((32 + xgb.Pad((int(NumFormats) * 28))) + PictscreenListSize(Screens)) + xgb.Pad((int(NumSubpixel) * 4))) +// QueryPictFormatsReply represents the data returned from a QueryPictFormats request. type QueryPictFormatsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumFormats uint32 NumScreens uint32 @@ -1728,7 +1691,7 @@ type QueryPictFormatsReply struct { Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) } -// Waits and reads reply data from request QueryPictFormats +// Reply blocks and returns the reply data for a QueryPictFormats request. func (cook QueryPictFormatsCookie) Reply() (*QueryPictFormatsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1740,7 +1703,7 @@ func (cook QueryPictFormatsCookie) Reply() (*QueryPictFormatsReply, error) { return queryPictFormatsReply(buf), nil } -// Read reply into structure from buffer for QueryPictFormats +// queryPictFormatsReply reads a byte slice into a QueryPictFormatsReply value. func queryPictFormatsReply(buf []byte) *QueryPictFormatsReply { v := new(QueryPictFormatsReply) b := 1 // skip reply determinant @@ -1787,6 +1750,7 @@ func queryPictFormatsReply(buf []byte) *QueryPictFormatsReply { } // Write request to wire for QueryPictFormats +// queryPictFormatsRequest writes a QueryPictFormats request to a byte slice. func queryPictFormatsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1804,36 +1768,38 @@ func queryPictFormatsRequest(c *xgb.Conn) []byte { return buf } -// Request QueryPictIndexValues -// size: 8 +// QueryPictIndexValuesCookie is a cookie used only for QueryPictIndexValues requests. type QueryPictIndexValuesCookie struct { *xgb.Cookie } +// QueryPictIndexValues sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPictIndexValuesCookie.Reply() func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) return QueryPictIndexValuesCookie{cookie} } +// QueryPictIndexValuesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictIndexValuesUnchecked(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) return QueryPictIndexValuesCookie{cookie} } -// Request reply for QueryPictIndexValues -// size: (32 + xgb.Pad((int(NumValues) * 12))) +// QueryPictIndexValuesReply represents the data returned from a QueryPictIndexValues request. type QueryPictIndexValuesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumValues uint32 // padding: 20 bytes Values []Indexvalue // size: xgb.Pad((int(NumValues) * 12)) } -// Waits and reads reply data from request QueryPictIndexValues +// Reply blocks and returns the reply data for a QueryPictIndexValues request. func (cook QueryPictIndexValuesCookie) Reply() (*QueryPictIndexValuesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1845,7 +1811,7 @@ func (cook QueryPictIndexValuesCookie) Reply() (*QueryPictIndexValuesReply, erro return queryPictIndexValuesReply(buf), nil } -// Read reply into structure from buffer for QueryPictIndexValues +// queryPictIndexValuesReply reads a byte slice into a QueryPictIndexValuesReply value. func queryPictIndexValuesReply(buf []byte) *QueryPictIndexValuesReply { v := new(QueryPictIndexValuesReply) b := 1 // skip reply determinant @@ -1870,6 +1836,7 @@ func queryPictIndexValuesReply(buf []byte) *QueryPictIndexValuesReply { } // Write request to wire for QueryPictIndexValues +// queryPictIndexValuesRequest writes a QueryPictIndexValues request to a byte slice. func queryPictIndexValuesRequest(c *xgb.Conn, Format Pictformat) []byte { size := 8 b := 0 @@ -1890,30 +1857,35 @@ func queryPictIndexValuesRequest(c *xgb.Conn, Format Pictformat) []byte { return buf } -// Request CreatePicture -// size: xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreatePictureCookie is a cookie used only for CreatePicture requests. type CreatePictureCookie struct { *xgb.Cookie } -// Write request to wire for CreatePicture +// CreatePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) return CreatePictureCookie{cookie} } +// CreatePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePictureCookie.Check() func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) return CreatePictureCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePictureCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePicture +// createPictureRequest writes a CreatePicture request to a byte slice. func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -1948,30 +1920,35 @@ func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Fo return buf } -// Request ChangePicture -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangePictureCookie is a cookie used only for ChangePicture requests. type ChangePictureCookie struct { *xgb.Cookie } -// Write request to wire for ChangePicture +// ChangePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { cookie := c.NewCookie(false, false) c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) return ChangePictureCookie{cookie} } +// ChangePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePictureCookie.Check() func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) return ChangePictureCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangePictureCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangePicture +// changePictureRequest writes a ChangePicture request to a byte slice. func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -2000,30 +1977,35 @@ func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueL return buf } -// Request SetPictureClipRectangles -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// SetPictureClipRectanglesCookie is a cookie used only for SetPictureClipRectangles requests. type SetPictureClipRectanglesCookie struct { *xgb.Cookie } -// Write request to wire for SetPictureClipRectangles +// SetPictureClipRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetPictureClipRectanglesCookie{cookie} } +// SetPictureClipRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureClipRectanglesCookie.Check() func SetPictureClipRectanglesChecked(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetPictureClipRectanglesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPictureClipRectanglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPictureClipRectangles +// setPictureClipRectanglesRequest writes a SetPictureClipRectangles request to a byte slice. func setPictureClipRectanglesRequest(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -2052,30 +2034,35 @@ func setPictureClipRectanglesRequest(c *xgb.Conn, Picture Picture, ClipXOrigin i return buf } -// Request FreePicture -// size: 8 +// FreePictureCookie is a cookie used only for FreePicture requests. type FreePictureCookie struct { *xgb.Cookie } -// Write request to wire for FreePicture +// FreePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { cookie := c.NewCookie(false, false) c.NewRequest(freePictureRequest(c, Picture), cookie) return FreePictureCookie{cookie} } +// FreePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using FreePictureCookie.Check() func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { cookie := c.NewCookie(true, false) c.NewRequest(freePictureRequest(c, Picture), cookie) return FreePictureCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreePictureCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreePicture +// freePictureRequest writes a FreePicture request to a byte slice. func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { size := 8 b := 0 @@ -2096,30 +2083,35 @@ func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { return buf } -// Request Composite -// size: 36 +// CompositeCookie is a cookie used only for Composite requests. type CompositeCookie struct { *xgb.Cookie } -// Write request to wire for Composite +// Composite sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { cookie := c.NewCookie(false, false) c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return CompositeCookie{cookie} } +// CompositeChecked sends a checked request. +// If an error occurs, it can be retrieved using CompositeCookie.Check() func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { cookie := c.NewCookie(true, false) c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return CompositeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CompositeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Composite +// compositeRequest writes a Composite request to a byte slice. func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 36 b := 0 @@ -2175,30 +2167,35 @@ func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Pictu return buf } -// Request Trapezoids -// size: xgb.Pad((24 + xgb.Pad((len(Traps) * 40)))) +// TrapezoidsCookie is a cookie used only for Trapezoids requests. type TrapezoidsCookie struct { *xgb.Cookie } -// Write request to wire for Trapezoids +// Trapezoids sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { cookie := c.NewCookie(false, false) c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return TrapezoidsCookie{cookie} } +// TrapezoidsChecked sends a checked request. +// If an error occurs, it can be retrieved using TrapezoidsCookie.Check() func TrapezoidsChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { cookie := c.NewCookie(true, false) c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return TrapezoidsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TrapezoidsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Trapezoids +// trapezoidsRequest writes a Trapezoids request to a byte slice. func trapezoidsRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) []byte { size := xgb.Pad((24 + xgb.Pad((len(Traps) * 40)))) b := 0 @@ -2238,30 +2235,35 @@ func trapezoidsRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma return buf } -// Request Triangles -// size: xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) +// TrianglesCookie is a cookie used only for Triangles requests. type TrianglesCookie struct { *xgb.Cookie } -// Write request to wire for Triangles +// Triangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return TrianglesCookie{cookie} } +// TrianglesChecked sends a checked request. +// If an error occurs, it can be retrieved using TrianglesCookie.Check() func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return TrianglesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TrianglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Triangles +// trianglesRequest writes a Triangles request to a byte slice. func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) []byte { size := xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) b := 0 @@ -2301,30 +2303,35 @@ func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat return buf } -// Request TriStrip -// size: xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) +// TriStripCookie is a cookie used only for TriStrip requests. type TriStripCookie struct { *xgb.Cookie } -// Write request to wire for TriStrip +// TriStrip sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { cookie := c.NewCookie(false, false) c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriStripCookie{cookie} } +// TriStripChecked sends a checked request. +// If an error occurs, it can be retrieved using TriStripCookie.Check() func TriStripChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { cookie := c.NewCookie(true, false) c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriStripCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TriStripCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for TriStrip +// triStripRequest writes a TriStrip request to a byte slice. func triStripRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) b := 0 @@ -2364,30 +2371,35 @@ func triStripRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat return buf } -// Request TriFan -// size: xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) +// TriFanCookie is a cookie used only for TriFan requests. type TriFanCookie struct { *xgb.Cookie } -// Write request to wire for TriFan +// TriFan sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { cookie := c.NewCookie(false, false) c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriFanCookie{cookie} } +// TriFanChecked sends a checked request. +// If an error occurs, it can be retrieved using TriFanCookie.Check() func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { cookie := c.NewCookie(true, false) c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriFanCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TriFanCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for TriFan +// triFanRequest writes a TriFan request to a byte slice. func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) b := 0 @@ -2427,30 +2439,35 @@ func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pi return buf } -// Request CreateGlyphSet -// size: 12 +// CreateGlyphSetCookie is a cookie used only for CreateGlyphSet requests. type CreateGlyphSetCookie struct { *xgb.Cookie } -// Write request to wire for CreateGlyphSet +// CreateGlyphSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) return CreateGlyphSetCookie{cookie} } +// CreateGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGlyphSetCookie.Check() func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) return CreateGlyphSetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateGlyphSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGlyphSet +// createGlyphSetRequest writes a CreateGlyphSet request to a byte slice. func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte { size := 12 b := 0 @@ -2474,30 +2491,35 @@ func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte return buf } -// Request ReferenceGlyphSet -// size: 12 +// ReferenceGlyphSetCookie is a cookie used only for ReferenceGlyphSet requests. type ReferenceGlyphSetCookie struct { *xgb.Cookie } -// Write request to wire for ReferenceGlyphSet +// ReferenceGlyphSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) return ReferenceGlyphSetCookie{cookie} } +// ReferenceGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ReferenceGlyphSetCookie.Check() func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) return ReferenceGlyphSetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ReferenceGlyphSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ReferenceGlyphSet +// referenceGlyphSetRequest writes a ReferenceGlyphSet request to a byte slice. func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []byte { size := 12 b := 0 @@ -2521,30 +2543,35 @@ func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []b return buf } -// Request FreeGlyphSet -// size: 8 +// FreeGlyphSetCookie is a cookie used only for FreeGlyphSet requests. type FreeGlyphSetCookie struct { *xgb.Cookie } -// Write request to wire for FreeGlyphSet +// FreeGlyphSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) return FreeGlyphSetCookie{cookie} } +// FreeGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGlyphSetCookie.Check() func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) return FreeGlyphSetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeGlyphSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeGlyphSet +// freeGlyphSetRequest writes a FreeGlyphSet request to a byte slice. func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { size := 8 b := 0 @@ -2565,30 +2592,35 @@ func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { return buf } -// Request AddGlyphs -// size: xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) +// AddGlyphsCookie is a cookie used only for AddGlyphs requests. type AddGlyphsCookie struct { *xgb.Cookie } -// Write request to wire for AddGlyphs +// AddGlyphs sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { cookie := c.NewCookie(false, false) c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return AddGlyphsCookie{cookie} } +// AddGlyphsChecked sends a checked request. +// If an error occurs, it can be retrieved using AddGlyphsCookie.Check() func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { cookie := c.NewCookie(true, false) c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return AddGlyphsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AddGlyphsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AddGlyphs +// addGlyphsRequest writes a AddGlyphs request to a byte slice. func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) b := 0 @@ -2623,30 +2655,35 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids return buf } -// Request FreeGlyphs -// size: xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) +// FreeGlyphsCookie is a cookie used only for FreeGlyphs requests. type FreeGlyphsCookie struct { *xgb.Cookie } -// Write request to wire for FreeGlyphs +// FreeGlyphs sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) return FreeGlyphsCookie{cookie} } +// FreeGlyphsChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGlyphsCookie.Check() func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) return FreeGlyphsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeGlyphsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeGlyphs +// freeGlyphsRequest writes a FreeGlyphs request to a byte slice. func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { size := xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) b := 0 @@ -2673,30 +2710,35 @@ func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { return buf } -// Request CompositeGlyphs8 -// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +// CompositeGlyphs8Cookie is a cookie used only for CompositeGlyphs8 requests. type CompositeGlyphs8Cookie struct { *xgb.Cookie } -// Write request to wire for CompositeGlyphs8 +// CompositeGlyphs8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs8Cookie{cookie} } +// CompositeGlyphs8Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs8Cookie.Check() func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs8Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CompositeGlyphs8Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CompositeGlyphs8 +// compositeGlyphs8Request writes a CompositeGlyphs8 request to a byte slice. func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) b := 0 @@ -2740,30 +2782,35 @@ func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Mas return buf } -// Request CompositeGlyphs16 -// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +// CompositeGlyphs16Cookie is a cookie used only for CompositeGlyphs16 requests. type CompositeGlyphs16Cookie struct { *xgb.Cookie } -// Write request to wire for CompositeGlyphs16 +// CompositeGlyphs16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs16Cookie{cookie} } +// CompositeGlyphs16Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs16Cookie.Check() func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs16Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CompositeGlyphs16Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CompositeGlyphs16 +// compositeGlyphs16Request writes a CompositeGlyphs16 request to a byte slice. func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) b := 0 @@ -2807,30 +2854,35 @@ func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma return buf } -// Request CompositeGlyphs32 -// size: xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) +// CompositeGlyphs32Cookie is a cookie used only for CompositeGlyphs32 requests. type CompositeGlyphs32Cookie struct { *xgb.Cookie } -// Write request to wire for CompositeGlyphs32 +// CompositeGlyphs32 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs32Cookie{cookie} } +// CompositeGlyphs32Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs32Cookie.Check() func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs32Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CompositeGlyphs32Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CompositeGlyphs32 +// compositeGlyphs32Request writes a CompositeGlyphs32 request to a byte slice. func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) b := 0 @@ -2874,30 +2926,35 @@ func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma return buf } -// Request FillRectangles -// size: xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) +// FillRectanglesCookie is a cookie used only for FillRectangles requests. type FillRectanglesCookie struct { *xgb.Cookie } -// Write request to wire for FillRectangles +// FillRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) return FillRectanglesCookie{cookie} } +// FillRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using FillRectanglesCookie.Check() func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) return FillRectanglesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FillRectanglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FillRectangles +// fillRectanglesRequest writes a FillRectangles request to a byte slice. func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) []byte { size := xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) b := 0 @@ -2931,30 +2988,35 @@ func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects return buf } -// Request CreateCursor -// size: 16 +// CreateCursorCookie is a cookie used only for CreateCursor requests. type CreateCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateCursor +// CreateCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) return CreateCursorCookie{cookie} } +// CreateCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCursorCookie.Check() func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) return CreateCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateCursor +// createCursorRequest writes a CreateCursor request to a byte slice. func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) []byte { size := 16 b := 0 @@ -2984,30 +3046,35 @@ func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint1 return buf } -// Request SetPictureTransform -// size: 44 +// SetPictureTransformCookie is a cookie used only for SetPictureTransform requests. type SetPictureTransformCookie struct { *xgb.Cookie } -// Write request to wire for SetPictureTransform +// SetPictureTransform sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) return SetPictureTransformCookie{cookie} } +// SetPictureTransformChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureTransformCookie.Check() func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) return SetPictureTransformCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPictureTransformCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPictureTransform +// setPictureTransformRequest writes a SetPictureTransform request to a byte slice. func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transform) []byte { size := 44 b := 0 @@ -3034,29 +3101,31 @@ func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transfor return buf } -// Request QueryFilters -// size: 8 +// QueryFiltersCookie is a cookie used only for QueryFilters requests. type QueryFiltersCookie struct { *xgb.Cookie } +// QueryFilters sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFiltersCookie.Reply() func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryFiltersRequest(c, Drawable), cookie) return QueryFiltersCookie{cookie} } +// QueryFiltersUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryFiltersRequest(c, Drawable), cookie) return QueryFiltersCookie{cookie} } -// Request reply for QueryFilters -// size: ((32 + xgb.Pad((int(NumAliases) * 2))) + xproto.StrListSize(Filters)) +// QueryFiltersReply represents the data returned from a QueryFilters request. type QueryFiltersReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAliases uint32 NumFilters uint32 @@ -3065,7 +3134,7 @@ type QueryFiltersReply struct { Filters []xproto.Str // size: xproto.StrListSize(Filters) } -// Waits and reads reply data from request QueryFilters +// Reply blocks and returns the reply data for a QueryFilters request. func (cook QueryFiltersCookie) Reply() (*QueryFiltersReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -3077,7 +3146,7 @@ func (cook QueryFiltersCookie) Reply() (*QueryFiltersReply, error) { return queryFiltersReply(buf), nil } -// Read reply into structure from buffer for QueryFilters +// queryFiltersReply reads a byte slice into a QueryFiltersReply value. func queryFiltersReply(buf []byte) *QueryFiltersReply { v := new(QueryFiltersReply) b := 1 // skip reply determinant @@ -3112,6 +3181,7 @@ func queryFiltersReply(buf []byte) *QueryFiltersReply { } // Write request to wire for QueryFilters +// queryFiltersRequest writes a QueryFilters request to a byte slice. func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -3132,30 +3202,35 @@ func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request SetPictureFilter -// size: xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) +// SetPictureFilterCookie is a cookie used only for SetPictureFilter requests. type SetPictureFilterCookie struct { *xgb.Cookie } -// Write request to wire for SetPictureFilter +// SetPictureFilter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) return SetPictureFilterCookie{cookie} } +// SetPictureFilterChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureFilterCookie.Check() func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) return SetPictureFilterCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPictureFilterCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPictureFilter +// setPictureFilterRequest writes a SetPictureFilter request to a byte slice. func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) []byte { size := xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) b := 0 @@ -3190,30 +3265,35 @@ func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Fil return buf } -// Request CreateAnimCursor -// size: xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) +// CreateAnimCursorCookie is a cookie used only for CreateAnimCursor requests. type CreateAnimCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateAnimCursor +// CreateAnimCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) return CreateAnimCursorCookie{cookie} } +// CreateAnimCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateAnimCursorCookie.Check() func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) return CreateAnimCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateAnimCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateAnimCursor +// createAnimCursorRequest writes a CreateAnimCursor request to a byte slice. func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) []byte { size := xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) b := 0 @@ -3236,30 +3316,35 @@ func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcurso return buf } -// Request AddTraps -// size: xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) +// AddTrapsCookie is a cookie used only for AddTraps requests. type AddTrapsCookie struct { *xgb.Cookie } -// Write request to wire for AddTraps +// AddTraps sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { cookie := c.NewCookie(false, false) c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) return AddTrapsCookie{cookie} } +// AddTrapsChecked sends a checked request. +// If an error occurs, it can be retrieved using AddTrapsCookie.Check() func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { cookie := c.NewCookie(true, false) c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) return AddTrapsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AddTrapsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AddTraps +// addTrapsRequest writes a AddTraps request to a byte slice. func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) []byte { size := xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) b := 0 @@ -3288,30 +3373,35 @@ func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps return buf } -// Request CreateSolidFill -// size: 16 +// CreateSolidFillCookie is a cookie used only for CreateSolidFill requests. type CreateSolidFillCookie struct { *xgb.Cookie } -// Write request to wire for CreateSolidFill +// CreateSolidFill sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { cookie := c.NewCookie(false, false) c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) return CreateSolidFillCookie{cookie} } +// CreateSolidFillChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateSolidFillCookie.Check() func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { cookie := c.NewCookie(true, false) c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) return CreateSolidFillCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateSolidFillCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateSolidFill +// createSolidFillRequest writes a CreateSolidFill request to a byte slice. func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { size := 16 b := 0 @@ -3338,30 +3428,35 @@ func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { return buf } -// Request CreateLinearGradient -// size: xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +// CreateLinearGradientCookie is a cookie used only for CreateLinearGradient requests. type CreateLinearGradientCookie struct { *xgb.Cookie } -// Write request to wire for CreateLinearGradient +// CreateLinearGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { cookie := c.NewCookie(false, false) c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) return CreateLinearGradientCookie{cookie} } +// CreateLinearGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateLinearGradientCookie.Check() func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { cookie := c.NewCookie(true, false) c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) return CreateLinearGradientCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateLinearGradientCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateLinearGradient +// createLinearGradientRequest writes a CreateLinearGradient request to a byte slice. func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 @@ -3405,30 +3500,35 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P return buf } -// Request CreateRadialGradient -// size: xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +// CreateRadialGradientCookie is a cookie used only for CreateRadialGradient requests. type CreateRadialGradientCookie struct { *xgb.Cookie } -// Write request to wire for CreateRadialGradient +// CreateRadialGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return CreateRadialGradientCookie{cookie} } +// CreateRadialGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRadialGradientCookie.Check() func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return CreateRadialGradientCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRadialGradientCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRadialGradient +// createRadialGradientRequest writes a CreateRadialGradient request to a byte slice. func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 @@ -3478,30 +3578,35 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O return buf } -// Request CreateConicalGradient -// size: xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) +// CreateConicalGradientCookie is a cookie used only for CreateConicalGradient requests. type CreateConicalGradientCookie struct { *xgb.Cookie } -// Write request to wire for CreateConicalGradient +// CreateConicalGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { cookie := c.NewCookie(false, false) c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) return CreateConicalGradientCookie{cookie} } +// CreateConicalGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateConicalGradientCookie.Check() func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { cookie := c.NewCookie(true, false) c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) return CreateConicalGradientCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateConicalGradientCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateConicalGradient +// createConicalGradientRequest writes a CreateConicalGradient request to a byte slice. func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 diff --git a/nexgb/res/res.go b/nexgb/res/res.go index e81fa96..ccc6192 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on May 10 2012 8:04:32pm EDT. + This file was generated by res.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -64,14 +64,12 @@ func init() { // Skipping definition for base type 'Char' -// 'Client' struct definition -// Size: 8 type Client struct { ResourceBase uint32 ResourceMask uint32 } -// Struct read Client +// ClientRead reads a byte slice into a Client value. func ClientRead(buf []byte, v *Client) int { b := 0 @@ -84,7 +82,7 @@ func ClientRead(buf []byte, v *Client) int { return b } -// Struct list read Client +// ClientReadList reads a byte slice into a list of Client values. func ClientReadList(buf []byte, dest []Client) int { b := 0 for i := 0; i < len(dest); i++ { @@ -94,7 +92,7 @@ func ClientReadList(buf []byte, dest []Client) int { return xgb.Pad(b) } -// Struct write Client +// Bytes writes a Client value to a byte slice. func (v Client) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -108,7 +106,7 @@ func (v Client) Bytes() []byte { return buf } -// Write struct list Client +// ClientListBytes writes a list of %s(MISSING) values to a byte slice. func ClientListBytes(buf []byte, list []Client) int { b := 0 var structBytes []byte @@ -120,14 +118,12 @@ func ClientListBytes(buf []byte, list []Client) int { return b } -// 'Type' struct definition -// Size: 8 type Type struct { ResourceType xproto.Atom Count uint32 } -// Struct read Type +// TypeRead reads a byte slice into a Type value. func TypeRead(buf []byte, v *Type) int { b := 0 @@ -140,7 +136,7 @@ func TypeRead(buf []byte, v *Type) int { return b } -// Struct list read Type +// TypeReadList reads a byte slice into a list of Type values. func TypeReadList(buf []byte, dest []Type) int { b := 0 for i := 0; i < len(dest); i++ { @@ -150,7 +146,7 @@ func TypeReadList(buf []byte, dest []Type) int { return xgb.Pad(b) } -// Struct write Type +// Bytes writes a Type value to a byte slice. func (v Type) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -164,7 +160,7 @@ func (v Type) Bytes() []byte { return buf } -// Write struct list Type +// TypeListBytes writes a list of %s(MISSING) values to a byte slice. func TypeListBytes(buf []byte, list []Type) int { b := 0 var structBytes []byte @@ -176,35 +172,37 @@ func TypeListBytes(buf []byte, list []Type) int { return b } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajor uint16 ServerMinor uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -216,7 +214,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -239,6 +237,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { size := 8 b := 0 @@ -262,36 +261,38 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte return buf } -// Request QueryClients -// size: 4 +// QueryClientsCookie is a cookie used only for QueryClients requests. type QueryClientsCookie struct { *xgb.Cookie } +// QueryClients sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() func QueryClients(c *xgb.Conn) QueryClientsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryClientsRequest(c), cookie) return QueryClientsCookie{cookie} } +// QueryClientsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryClientsRequest(c), cookie) return QueryClientsCookie{cookie} } -// Request reply for QueryClients -// size: (32 + xgb.Pad((int(NumClients) * 8))) +// QueryClientsReply represents the data returned from a QueryClients request. type QueryClientsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumClients uint32 // padding: 20 bytes Clients []Client // size: xgb.Pad((int(NumClients) * 8)) } -// Waits and reads reply data from request QueryClients +// Reply blocks and returns the reply data for a QueryClients request. func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -303,7 +304,7 @@ func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) { return queryClientsReply(buf), nil } -// Read reply into structure from buffer for QueryClients +// queryClientsReply reads a byte slice into a QueryClientsReply value. func queryClientsReply(buf []byte) *QueryClientsReply { v := new(QueryClientsReply) b := 1 // skip reply determinant @@ -328,6 +329,7 @@ func queryClientsReply(buf []byte) *QueryClientsReply { } // Write request to wire for QueryClients +// queryClientsRequest writes a QueryClients request to a byte slice. func queryClientsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -345,36 +347,38 @@ func queryClientsRequest(c *xgb.Conn) []byte { return buf } -// Request QueryClientResources -// size: 8 +// QueryClientResourcesCookie is a cookie used only for QueryClientResources requests. type QueryClientResourcesCookie struct { *xgb.Cookie } +// QueryClientResources sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientResourcesCookie.Reply() func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) return QueryClientResourcesCookie{cookie} } +// QueryClientResourcesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) return QueryClientResourcesCookie{cookie} } -// Request reply for QueryClientResources -// size: (32 + xgb.Pad((int(NumTypes) * 8))) +// QueryClientResourcesReply represents the data returned from a QueryClientResources request. type QueryClientResourcesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumTypes uint32 // padding: 20 bytes Types []Type // size: xgb.Pad((int(NumTypes) * 8)) } -// Waits and reads reply data from request QueryClientResources +// Reply blocks and returns the reply data for a QueryClientResources request. func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -386,7 +390,7 @@ func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, erro return queryClientResourcesReply(buf), nil } -// Read reply into structure from buffer for QueryClientResources +// queryClientResourcesReply reads a byte slice into a QueryClientResourcesReply value. func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply { v := new(QueryClientResourcesReply) b := 1 // skip reply determinant @@ -411,6 +415,7 @@ func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply { } // Write request to wire for QueryClientResources +// queryClientResourcesRequest writes a QueryClientResources request to a byte slice. func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { size := 8 b := 0 @@ -431,35 +436,37 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { return buf } -// Request QueryClientPixmapBytes -// size: 8 +// QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests. type QueryClientPixmapBytesCookie struct { *xgb.Cookie } +// QueryClientPixmapBytes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) return QueryClientPixmapBytesCookie{cookie} } +// QueryClientPixmapBytesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) return QueryClientPixmapBytesCookie{cookie} } -// Request reply for QueryClientPixmapBytes -// size: 16 +// QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request. type QueryClientPixmapBytesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Bytes uint32 BytesOverflow uint32 } -// Waits and reads reply data from request QueryClientPixmapBytes +// Reply blocks and returns the reply data for a QueryClientPixmapBytes request. func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -471,7 +478,7 @@ func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, return queryClientPixmapBytesReply(buf), nil } -// Read reply into structure from buffer for QueryClientPixmapBytes +// queryClientPixmapBytesReply reads a byte slice into a QueryClientPixmapBytesReply value. func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { v := new(QueryClientPixmapBytesReply) b := 1 // skip reply determinant @@ -494,6 +501,7 @@ func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { } // Write request to wire for QueryClientPixmapBytes +// queryClientPixmapBytesRequest writes a QueryClientPixmapBytes request to a byte slice. func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { size := 8 b := 0 diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index f11113e..0b6ef23 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on May 10 2012 8:04:32pm EDT. + This file was generated by screensaver.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - const ( KindBlanked = 0 KindInternal = 1 @@ -82,9 +82,7 @@ const ( StateDisabled = 3 ) -// Event definition Notify (0) -// Size: 32 - +// Notify is the event number for a NotifyEvent. const Notify = 0 type NotifyEvent struct { @@ -101,7 +99,7 @@ type NotifyEvent struct { // padding: 14 bytes } -// Event read Notify +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number @@ -144,7 +142,7 @@ func NotifyEventNew(buf []byte) xgb.Event { return v } -// Event write Notify +// Bytes writes a NotifyEvent value to a byte slice. func (v NotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -190,12 +188,14 @@ func (v NotifyEvent) Bytes() []byte { return buf } -func (v NotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -214,36 +214,38 @@ func init() { xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajorVersion uint16 ServerMinorVersion uint16 // padding: 20 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -255,7 +257,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -280,6 +282,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte { size := 8 b := 0 @@ -305,29 +308,31 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersio return buf } -// Request QueryInfo -// size: 8 +// QueryInfoCookie is a cookie used only for QueryInfo requests. type QueryInfoCookie struct { *xgb.Cookie } +// QueryInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryInfoCookie.Reply() func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryInfoRequest(c, Drawable), cookie) return QueryInfoCookie{cookie} } +// QueryInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryInfoRequest(c, Drawable), cookie) return QueryInfoCookie{cookie} } -// Request reply for QueryInfo -// size: 32 +// QueryInfoReply represents the data returned from a QueryInfo request. type QueryInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply State byte SaverWindow xproto.Window MsUntilServer uint32 @@ -337,7 +342,7 @@ type QueryInfoReply struct { // padding: 7 bytes } -// Waits and reads reply data from request QueryInfo +// Reply blocks and returns the reply data for a QueryInfo request. func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -349,7 +354,7 @@ func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) { return queryInfoReply(buf), nil } -// Read reply into structure from buffer for QueryInfo +// queryInfoReply reads a byte slice into a QueryInfoReply value. func queryInfoReply(buf []byte) *QueryInfoReply { v := new(QueryInfoReply) b := 1 // skip reply determinant @@ -384,6 +389,7 @@ func queryInfoReply(buf []byte) *QueryInfoReply { } // Write request to wire for QueryInfo +// queryInfoRequest writes a QueryInfo request to a byte slice. func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -404,30 +410,35 @@ func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request SelectInput -// size: 12 +// SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie } -// Write request to wire for SelectInput +// SelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) return SelectInputCookie{cookie} } +// SelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) return SelectInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) []byte { size := 12 b := 0 @@ -451,30 +462,35 @@ func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) return buf } -// Request SetAttributes -// size: xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// SetAttributesCookie is a cookie used only for SetAttributes requests. type SetAttributesCookie struct { *xgb.Cookie } -// Write request to wire for SetAttributes +// SetAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return SetAttributesCookie{cookie} } +// SetAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetAttributesCookie.Check() func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return SetAttributesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetAttributes +// setAttributesRequest writes a SetAttributes request to a byte slice. func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -527,30 +543,35 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1 return buf } -// Request UnsetAttributes -// size: 8 +// UnsetAttributesCookie is a cookie used only for UnsetAttributes requests. type UnsetAttributesCookie struct { *xgb.Cookie } -// Write request to wire for UnsetAttributes +// UnsetAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) return UnsetAttributesCookie{cookie} } +// UnsetAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using UnsetAttributesCookie.Check() func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) return UnsetAttributesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnsetAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnsetAttributes +// unsetAttributesRequest writes a UnsetAttributes request to a byte slice. func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { size := 8 b := 0 @@ -571,30 +592,35 @@ func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } -// Request Suspend -// size: 8 +// SuspendCookie is a cookie used only for Suspend requests. type SuspendCookie struct { *xgb.Cookie } -// Write request to wire for Suspend +// Suspend sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { cookie := c.NewCookie(false, false) c.NewRequest(suspendRequest(c, Suspend), cookie) return SuspendCookie{cookie} } +// SuspendChecked sends a checked request. +// If an error occurs, it can be retrieved using SuspendCookie.Check() func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie { cookie := c.NewCookie(true, false) c.NewRequest(suspendRequest(c, Suspend), cookie) return SuspendCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SuspendCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Suspend +// suspendRequest writes a Suspend request to a byte slice. func suspendRequest(c *xgb.Conn, Suspend bool) []byte { size := 8 b := 0 diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 97be0f7..664c5f4 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on May 10 2012 8:04:32pm EDT. + This file was generated by shape.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -82,9 +82,7 @@ type Op byte type Kind byte -// Event definition Notify (0) -// Size: 32 - +// Notify is the event number for a NotifyEvent. const Notify = 0 type NotifyEvent struct { @@ -100,7 +98,7 @@ type NotifyEvent struct { // padding: 11 bytes } -// Event read Notify +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number @@ -141,7 +139,7 @@ func NotifyEventNew(buf []byte) xgb.Event { return v } -// Event write Notify +// Bytes writes a NotifyEvent value to a byte slice. func (v NotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -185,12 +183,14 @@ func (v NotifyEvent) Bytes() []byte { return buf } -func (v NotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { fieldVals := make([]string, 0, 9) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -209,35 +209,37 @@ func init() { xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew } -// Request QueryVersion -// size: 4 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint16 MinorVersion uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -249,7 +251,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -272,6 +274,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -289,30 +292,35 @@ func queryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request Rectangles -// size: xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) +// RectanglesCookie is a cookie used only for Rectangles requests. type RectanglesCookie struct { *xgb.Cookie } -// Write request to wire for Rectangles +// Rectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return RectanglesCookie{cookie} } +// RectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using RectanglesCookie.Check() func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return RectanglesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RectanglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Rectangles +// rectanglesRequest writes a Rectangles request to a byte slice. func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) []byte { size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -352,30 +360,35 @@ func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering return buf } -// Request Mask -// size: 20 +// MaskCookie is a cookie used only for Mask requests. type MaskCookie struct { *xgb.Cookie } -// Write request to wire for Mask +// Mask sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { cookie := c.NewCookie(false, false) c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return MaskCookie{cookie} } +// MaskChecked sends a checked request. +// If an error occurs, it can be retrieved using MaskCookie.Check() func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { cookie := c.NewCookie(true, false) c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return MaskCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook MaskCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Mask +// maskRequest writes a Mask request to a byte slice. func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte { size := 20 b := 0 @@ -413,30 +426,35 @@ func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWin return buf } -// Request Combine -// size: 20 +// CombineCookie is a cookie used only for Combine requests. type CombineCookie struct { *xgb.Cookie } -// Write request to wire for Combine +// Combine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { cookie := c.NewCookie(false, false) c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return CombineCookie{cookie} } +// CombineChecked sends a checked request. +// If an error occurs, it can be retrieved using CombineCookie.Check() func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { cookie := c.NewCookie(true, false) c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return CombineCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CombineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Combine +// combineRequest writes a Combine request to a byte slice. func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) []byte { size := 20 b := 0 @@ -477,30 +495,35 @@ func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind return buf } -// Request Offset -// size: 16 +// OffsetCookie is a cookie used only for Offset requests. type OffsetCookie struct { *xgb.Cookie } -// Write request to wire for Offset +// Offset sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { cookie := c.NewCookie(false, false) c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return OffsetCookie{cookie} } +// OffsetChecked sends a checked request. +// If an error occurs, it can be retrieved using OffsetCookie.Check() func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { cookie := c.NewCookie(true, false) c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return OffsetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook OffsetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Offset +// offsetRequest writes a Offset request to a byte slice. func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) []byte { size := 16 b := 0 @@ -532,29 +555,31 @@ func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.W return buf } -// Request QueryExtents -// size: 8 +// QueryExtentsCookie is a cookie used only for QueryExtents requests. type QueryExtentsCookie struct { *xgb.Cookie } +// QueryExtents sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtentsCookie.Reply() func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) return QueryExtentsCookie{cookie} } +// QueryExtentsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) return QueryExtentsCookie{cookie} } -// Request reply for QueryExtents -// size: 28 +// QueryExtentsReply represents the data returned from a QueryExtents request. type QueryExtentsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes BoundingShaped bool ClipShaped bool @@ -569,7 +594,7 @@ type QueryExtentsReply struct { ClipShapeExtentsHeight uint16 } -// Waits and reads reply data from request QueryExtents +// Reply blocks and returns the reply data for a QueryExtents request. func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -581,7 +606,7 @@ func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) { return queryExtentsReply(buf), nil } -// Read reply into structure from buffer for QueryExtents +// queryExtentsReply reads a byte slice into a QueryExtentsReply value. func queryExtentsReply(buf []byte) *QueryExtentsReply { v := new(QueryExtentsReply) b := 1 // skip reply determinant @@ -638,6 +663,7 @@ func queryExtentsReply(buf []byte) *QueryExtentsReply { } // Write request to wire for QueryExtents +// queryExtentsRequest writes a QueryExtents request to a byte slice. func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { size := 8 b := 0 @@ -658,30 +684,35 @@ func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { return buf } -// Request SelectInput -// size: 12 +// SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie } -// Write request to wire for SelectInput +// SelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) return SelectInputCookie{cookie} } +// SelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) return SelectInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) []byte { size := 12 b := 0 @@ -711,33 +742,35 @@ func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable boo return buf } -// Request InputSelected -// size: 8 +// InputSelectedCookie is a cookie used only for InputSelected requests. type InputSelectedCookie struct { *xgb.Cookie } +// InputSelected sends a checked request. +// If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply() func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { cookie := c.NewCookie(true, true) c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) return InputSelectedCookie{cookie} } +// InputSelectedUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { cookie := c.NewCookie(false, true) c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) return InputSelectedCookie{cookie} } -// Request reply for InputSelected -// size: 8 +// InputSelectedReply represents the data returned from a InputSelected request. type InputSelectedReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Enabled bool } -// Waits and reads reply data from request InputSelected +// Reply blocks and returns the reply data for a InputSelected request. func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -749,7 +782,7 @@ func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) { return inputSelectedReply(buf), nil } -// Read reply into structure from buffer for InputSelected +// inputSelectedReply reads a byte slice into a InputSelectedReply value. func inputSelectedReply(buf []byte) *InputSelectedReply { v := new(InputSelectedReply) b := 1 // skip reply determinant @@ -771,6 +804,7 @@ func inputSelectedReply(buf []byte) *InputSelectedReply { } // Write request to wire for InputSelected +// inputSelectedRequest writes a InputSelected request to a byte slice. func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { size := 8 b := 0 @@ -791,36 +825,38 @@ func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { return buf } -// Request GetRectangles -// size: 12 +// GetRectanglesCookie is a cookie used only for GetRectangles requests. type GetRectanglesCookie struct { *xgb.Cookie } +// GetRectangles sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply() func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) return GetRectanglesCookie{cookie} } +// GetRectanglesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) return GetRectanglesCookie{cookie} } -// Request reply for GetRectangles -// size: (32 + xgb.Pad((int(RectanglesLen) * 8))) +// GetRectanglesReply represents the data returned from a GetRectangles request. type GetRectanglesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Ordering byte RectanglesLen uint32 // padding: 20 bytes Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8)) } -// Waits and reads reply data from request GetRectangles +// Reply blocks and returns the reply data for a GetRectangles request. func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -832,7 +868,7 @@ func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) { return getRectanglesReply(buf), nil } -// Read reply into structure from buffer for GetRectangles +// getRectanglesReply reads a byte slice into a GetRectanglesReply value. func getRectanglesReply(buf []byte) *GetRectanglesReply { v := new(GetRectanglesReply) b := 1 // skip reply determinant @@ -858,6 +894,7 @@ func getRectanglesReply(buf []byte) *GetRectanglesReply { } // Write request to wire for GetRectangles +// getRectanglesRequest writes a GetRectangles request to a byte slice. func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte { size := 12 b := 0 diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index d262667..b24be97 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on May 10 2012 8:04:32pm EDT. + This file was generated by shm.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - type Seg uint32 func NewSegId(c *xgb.Conn) (Seg, error) { @@ -74,9 +74,7 @@ func NewSegId(c *xgb.Conn) (Seg, error) { return Seg(id), nil } -// Event definition Completion (0) -// Size: 32 - +// Completion is the event number for a CompletionEvent. const Completion = 0 type CompletionEvent struct { @@ -90,7 +88,7 @@ type CompletionEvent struct { Offset uint32 } -// Event read Completion +// CompletionEventNew constructs a CompletionEvent value that implements xgb.Event from a byte slice. func CompletionEventNew(buf []byte) xgb.Event { v := CompletionEvent{} b := 1 // don't read event number @@ -120,7 +118,7 @@ func CompletionEventNew(buf []byte) xgb.Event { return v } -// Event write Completion +// Bytes writes a CompletionEvent value to a byte slice. func (v CompletionEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -153,12 +151,14 @@ func (v CompletionEvent) Bytes() []byte { return buf } -func (v CompletionEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Completion event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CompletionEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CompletionEvent. func (v CompletionEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -174,20 +174,20 @@ func init() { xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew } -// ErrorCopy definition BadSeg (0) - +// BadBadSeg is the error number for a BadBadSeg. const BadBadSeg = 0 type BadSegError xproto.ValueError +// BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice. func BadSegErrorNew(buf []byte) xgb.Error { v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError)) v.NiceName = "BadSeg" return v } -func (err BadSegError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadSeg error. +// This is mostly used internally. func (err BadSegError) SequenceId() uint16 { return err.Sequence } @@ -210,29 +210,31 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew } -// Request QueryVersion -// size: 4 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply SharedPixmaps bool MajorVersion uint16 MinorVersion uint16 @@ -242,7 +244,7 @@ type QueryVersionReply struct { // padding: 15 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -254,7 +256,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -293,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -310,30 +313,35 @@ func queryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request Attach -// size: 16 +// AttachCookie is a cookie used only for Attach requests. type AttachCookie struct { *xgb.Cookie } -// Write request to wire for Attach +// Attach sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { cookie := c.NewCookie(false, false) c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) return AttachCookie{cookie} } +// AttachChecked sends a checked request. +// If an error occurs, it can be retrieved using AttachCookie.Check() func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { cookie := c.NewCookie(true, false) c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) return AttachCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AttachCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Attach +// attachRequest writes a Attach request to a byte slice. func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte { size := 16 b := 0 @@ -366,30 +374,35 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte return buf } -// Request Detach -// size: 8 +// DetachCookie is a cookie used only for Detach requests. type DetachCookie struct { *xgb.Cookie } -// Write request to wire for Detach +// Detach sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { cookie := c.NewCookie(false, false) c.NewRequest(detachRequest(c, Shmseg), cookie) return DetachCookie{cookie} } +// DetachChecked sends a checked request. +// If an error occurs, it can be retrieved using DetachCookie.Check() func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie { cookie := c.NewCookie(true, false) c.NewRequest(detachRequest(c, Shmseg), cookie) return DetachCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DetachCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Detach +// detachRequest writes a Detach request to a byte slice. func detachRequest(c *xgb.Conn, Shmseg Seg) []byte { size := 8 b := 0 @@ -410,30 +423,35 @@ func detachRequest(c *xgb.Conn, Shmseg Seg) []byte { return buf } -// Request PutImage -// size: 40 +// PutImageCookie is a cookie used only for PutImage requests. type PutImageCookie struct { *xgb.Cookie } -// Write request to wire for PutImage +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return PutImageCookie{cookie} } +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return PutImageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) []byte { size := 40 b := 0 @@ -498,35 +516,37 @@ func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, return buf } -// Request GetImage -// size: 32 +// GetImageCookie is a cookie used only for GetImage requests. type GetImageCookie struct { *xgb.Cookie } +// GetImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { cookie := c.NewCookie(true, true) c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return GetImageCookie{cookie} } +// GetImageUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { cookie := c.NewCookie(false, true) c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return GetImageCookie{cookie} } -// Request reply for GetImage -// size: 16 +// GetImageReply represents the data returned from a GetImage request. type GetImageReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Depth byte Visual xproto.Visualid Size uint32 } -// Waits and reads reply data from request GetImage +// Reply blocks and returns the reply data for a GetImage request. func (cook GetImageCookie) Reply() (*GetImageReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -538,7 +558,7 @@ func (cook GetImageCookie) Reply() (*GetImageReply, error) { return getImageReply(buf), nil } -// Read reply into structure from buffer for GetImage +// getImageReply reads a byte slice into a GetImageReply value. func getImageReply(buf []byte) *GetImageReply { v := new(GetImageReply) b := 1 // skip reply determinant @@ -562,6 +582,7 @@ func getImageReply(buf []byte) *GetImageReply { } // Write request to wire for GetImage +// getImageRequest writes a GetImage request to a byte slice. func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) []byte { size := 32 b := 0 @@ -608,30 +629,35 @@ func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Wi return buf } -// Request CreatePixmap -// size: 28 +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. type CreatePixmapCookie struct { *xgb.Cookie } -// Write request to wire for CreatePixmap +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return CreatePixmapCookie{cookie} } +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return CreatePixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte { size := 28 b := 0 diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index cde5cab..7a32bc4 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on May 10 2012 8:04:32pm EDT. + This file was generated by sync.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( AlarmstateActive = 0 AlarmstateInactive = 1 @@ -121,14 +121,12 @@ func NewFenceId(c *xgb.Conn) (Fence, error) { return Fence(id), nil } -// 'Int64' struct definition -// Size: 8 type Int64 struct { Hi int32 Lo uint32 } -// Struct read Int64 +// Int64Read reads a byte slice into a Int64 value. func Int64Read(buf []byte, v *Int64) int { b := 0 @@ -141,7 +139,7 @@ func Int64Read(buf []byte, v *Int64) int { return b } -// Struct list read Int64 +// Int64ReadList reads a byte slice into a list of Int64 values. func Int64ReadList(buf []byte, dest []Int64) int { b := 0 for i := 0; i < len(dest); i++ { @@ -151,7 +149,7 @@ func Int64ReadList(buf []byte, dest []Int64) int { return xgb.Pad(b) } -// Struct write Int64 +// Bytes writes a Int64 value to a byte slice. func (v Int64) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -165,7 +163,7 @@ func (v Int64) Bytes() []byte { return buf } -// Write struct list Int64 +// Int64ListBytes writes a list of %s(MISSING) values to a byte slice. func Int64ListBytes(buf []byte, list []Int64) int { b := 0 var structBytes []byte @@ -177,8 +175,6 @@ func Int64ListBytes(buf []byte, list []Int64) int { return b } -// 'Systemcounter' struct definition -// Size: (14 + xgb.Pad((int(NameLen) * 1))) type Systemcounter struct { Counter Counter Resolution Int64 @@ -186,7 +182,7 @@ type Systemcounter struct { Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Struct read Systemcounter +// SystemcounterRead reads a byte slice into a Systemcounter value. func SystemcounterRead(buf []byte, v *Systemcounter) int { b := 0 @@ -209,7 +205,7 @@ func SystemcounterRead(buf []byte, v *Systemcounter) int { return b } -// Struct list read Systemcounter +// SystemcounterReadList reads a byte slice into a list of Systemcounter values. func SystemcounterReadList(buf []byte, dest []Systemcounter) int { b := 0 for i := 0; i < len(dest); i++ { @@ -219,7 +215,7 @@ func SystemcounterReadList(buf []byte, dest []Systemcounter) int { return xgb.Pad(b) } -// Struct write Systemcounter +// Bytes writes a Systemcounter value to a byte slice. func (v Systemcounter) Bytes() []byte { buf := make([]byte, (14 + xgb.Pad((int(v.NameLen) * 1)))) b := 0 @@ -242,7 +238,7 @@ func (v Systemcounter) Bytes() []byte { return buf } -// Write struct list Systemcounter +// SystemcounterListBytes writes a list of %s(MISSING) values to a byte slice. func SystemcounterListBytes(buf []byte, list []Systemcounter) int { b := 0 var structBytes []byte @@ -254,7 +250,7 @@ func SystemcounterListBytes(buf []byte, list []Systemcounter) int { return b } -// Struct list size Systemcounter +// SystemcounterListSize computes the size (bytes) of a list of Systemcounter values. func SystemcounterListSize(list []Systemcounter) int { size := 0 for _, item := range list { @@ -263,8 +259,6 @@ func SystemcounterListSize(list []Systemcounter) int { return size } -// 'Trigger' struct definition -// Size: 20 type Trigger struct { Counter Counter WaitType uint32 @@ -272,7 +266,7 @@ type Trigger struct { TestType uint32 } -// Struct read Trigger +// TriggerRead reads a byte slice into a Trigger value. func TriggerRead(buf []byte, v *Trigger) int { b := 0 @@ -291,7 +285,7 @@ func TriggerRead(buf []byte, v *Trigger) int { return b } -// Struct list read Trigger +// TriggerReadList reads a byte slice into a list of Trigger values. func TriggerReadList(buf []byte, dest []Trigger) int { b := 0 for i := 0; i < len(dest); i++ { @@ -301,7 +295,7 @@ func TriggerReadList(buf []byte, dest []Trigger) int { return xgb.Pad(b) } -// Struct write Trigger +// Bytes writes a Trigger value to a byte slice. func (v Trigger) Bytes() []byte { buf := make([]byte, 20) b := 0 @@ -324,7 +318,7 @@ func (v Trigger) Bytes() []byte { return buf } -// Write struct list Trigger +// TriggerListBytes writes a list of %s(MISSING) values to a byte slice. func TriggerListBytes(buf []byte, list []Trigger) int { b := 0 var structBytes []byte @@ -336,14 +330,12 @@ func TriggerListBytes(buf []byte, list []Trigger) int { return b } -// 'Waitcondition' struct definition -// Size: 28 type Waitcondition struct { Trigger Trigger EventThreshold Int64 } -// Struct read Waitcondition +// WaitconditionRead reads a byte slice into a Waitcondition value. func WaitconditionRead(buf []byte, v *Waitcondition) int { b := 0 @@ -356,7 +348,7 @@ func WaitconditionRead(buf []byte, v *Waitcondition) int { return b } -// Struct list read Waitcondition +// WaitconditionReadList reads a byte slice into a list of Waitcondition values. func WaitconditionReadList(buf []byte, dest []Waitcondition) int { b := 0 for i := 0; i < len(dest); i++ { @@ -366,7 +358,7 @@ func WaitconditionReadList(buf []byte, dest []Waitcondition) int { return xgb.Pad(b) } -// Struct write Waitcondition +// Bytes writes a Waitcondition value to a byte slice. func (v Waitcondition) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -386,7 +378,7 @@ func (v Waitcondition) Bytes() []byte { return buf } -// Write struct list Waitcondition +// WaitconditionListBytes writes a list of %s(MISSING) values to a byte slice. func WaitconditionListBytes(buf []byte, list []Waitcondition) int { b := 0 var structBytes []byte @@ -398,9 +390,7 @@ func WaitconditionListBytes(buf []byte, list []Waitcondition) int { return b } -// Event definition CounterNotify (0) -// Size: 32 - +// CounterNotify is the event number for a CounterNotifyEvent. const CounterNotify = 0 type CounterNotifyEvent struct { @@ -415,7 +405,7 @@ type CounterNotifyEvent struct { // padding: 1 bytes } -// Event read CounterNotify +// CounterNotifyEventNew constructs a CounterNotifyEvent value that implements xgb.Event from a byte slice. func CounterNotifyEventNew(buf []byte) xgb.Event { v := CounterNotifyEvent{} b := 1 // don't read event number @@ -453,7 +443,7 @@ func CounterNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CounterNotify +// Bytes writes a CounterNotifyEvent value to a byte slice. func (v CounterNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -500,12 +490,14 @@ func (v CounterNotifyEvent) Bytes() []byte { return buf } -func (v CounterNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CounterNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CounterNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CounterNotifyEvent. func (v CounterNotifyEvent) String() string { fieldVals := make([]string, 0, 8) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -521,9 +513,7 @@ func init() { xgb.NewExtEventFuncs["SYNC"][0] = CounterNotifyEventNew } -// Event definition AlarmNotify (1) -// Size: 32 - +// AlarmNotify is the event number for a AlarmNotifyEvent. const AlarmNotify = 1 type AlarmNotifyEvent struct { @@ -537,7 +527,7 @@ type AlarmNotifyEvent struct { // padding: 3 bytes } -// Event read AlarmNotify +// AlarmNotifyEventNew constructs a AlarmNotifyEvent value that implements xgb.Event from a byte slice. func AlarmNotifyEventNew(buf []byte) xgb.Event { v := AlarmNotifyEvent{} b := 1 // don't read event number @@ -568,7 +558,7 @@ func AlarmNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write AlarmNotify +// Bytes writes a AlarmNotifyEvent value to a byte slice. func (v AlarmNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -608,12 +598,14 @@ func (v AlarmNotifyEvent) Bytes() []byte { return buf } -func (v AlarmNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the AlarmNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v AlarmNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of AlarmNotifyEvent. func (v AlarmNotifyEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -628,9 +620,7 @@ func init() { xgb.NewExtEventFuncs["SYNC"][1] = AlarmNotifyEventNew } -// Error definition Counter (0) -// Size: 32 - +// BadCounter is the error number for a BadCounter. const BadCounter = 0 type CounterError struct { @@ -641,7 +631,7 @@ type CounterError struct { MajorOpcode byte } -// Error read Counter +// CounterErrorNew constructs a CounterError value that implements xgb.Error from a byte slice. func CounterErrorNew(buf []byte) xgb.Error { v := CounterError{} v.NiceName = "Counter" @@ -664,8 +654,8 @@ func CounterErrorNew(buf []byte) xgb.Error { return v } -func (err CounterError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadCounter error. +// This is mostly used internally. func (err CounterError) SequenceId() uint16 { return err.Sequence } @@ -688,9 +678,7 @@ func init() { xgb.NewExtErrorFuncs["SYNC"][0] = CounterErrorNew } -// Error definition Alarm (1) -// Size: 32 - +// BadAlarm is the error number for a BadAlarm. const BadAlarm = 1 type AlarmError struct { @@ -701,7 +689,7 @@ type AlarmError struct { MajorOpcode byte } -// Error read Alarm +// AlarmErrorNew constructs a AlarmError value that implements xgb.Error from a byte slice. func AlarmErrorNew(buf []byte) xgb.Error { v := AlarmError{} v.NiceName = "Alarm" @@ -724,8 +712,8 @@ func AlarmErrorNew(buf []byte) xgb.Error { return v } -func (err AlarmError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAlarm error. +// This is mostly used internally. func (err AlarmError) SequenceId() uint16 { return err.Sequence } @@ -748,36 +736,38 @@ func init() { xgb.NewExtErrorFuncs["SYNC"][1] = AlarmErrorNew } -// Request Initialize -// size: 8 +// InitializeCookie is a cookie used only for Initialize requests. type InitializeCookie struct { *xgb.Cookie } +// Initialize sends a checked request. +// If an error occurs, it will be returned with the reply by calling InitializeCookie.Reply() func Initialize(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { cookie := c.NewCookie(true, true) c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) return InitializeCookie{cookie} } +// InitializeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InitializeUnchecked(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { cookie := c.NewCookie(false, true) c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) return InitializeCookie{cookie} } -// Request reply for Initialize -// size: 32 +// InitializeReply represents the data returned from a Initialize request. type InitializeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion byte MinorVersion byte // padding: 22 bytes } -// Waits and reads reply data from request Initialize +// Reply blocks and returns the reply data for a Initialize request. func (cook InitializeCookie) Reply() (*InitializeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -789,7 +779,7 @@ func (cook InitializeCookie) Reply() (*InitializeReply, error) { return initializeReply(buf), nil } -// Read reply into structure from buffer for Initialize +// initializeReply reads a byte slice into a InitializeReply value. func initializeReply(buf []byte) *InitializeReply { v := new(InitializeReply) b := 1 // skip reply determinant @@ -814,6 +804,7 @@ func initializeReply(buf []byte) *InitializeReply { } // Write request to wire for Initialize +// initializeRequest writes a Initialize request to a byte slice. func initializeRequest(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) []byte { size := 8 b := 0 @@ -837,36 +828,38 @@ func initializeRequest(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersio return buf } -// Request ListSystemCounters -// size: 4 +// ListSystemCountersCookie is a cookie used only for ListSystemCounters requests. type ListSystemCountersCookie struct { *xgb.Cookie } +// ListSystemCounters sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSystemCountersCookie.Reply() func ListSystemCounters(c *xgb.Conn) ListSystemCountersCookie { cookie := c.NewCookie(true, true) c.NewRequest(listSystemCountersRequest(c), cookie) return ListSystemCountersCookie{cookie} } +// ListSystemCountersUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSystemCountersUnchecked(c *xgb.Conn) ListSystemCountersCookie { cookie := c.NewCookie(false, true) c.NewRequest(listSystemCountersRequest(c), cookie) return ListSystemCountersCookie{cookie} } -// Request reply for ListSystemCounters -// size: (32 + SystemcounterListSize(Counters)) +// ListSystemCountersReply represents the data returned from a ListSystemCounters request. type ListSystemCountersReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes CountersLen uint32 // padding: 20 bytes Counters []Systemcounter // size: SystemcounterListSize(Counters) } -// Waits and reads reply data from request ListSystemCounters +// Reply blocks and returns the reply data for a ListSystemCounters request. func (cook ListSystemCountersCookie) Reply() (*ListSystemCountersReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -878,7 +871,7 @@ func (cook ListSystemCountersCookie) Reply() (*ListSystemCountersReply, error) { return listSystemCountersReply(buf), nil } -// Read reply into structure from buffer for ListSystemCounters +// listSystemCountersReply reads a byte slice into a ListSystemCountersReply value. func listSystemCountersReply(buf []byte) *ListSystemCountersReply { v := new(ListSystemCountersReply) b := 1 // skip reply determinant @@ -903,6 +896,7 @@ func listSystemCountersReply(buf []byte) *ListSystemCountersReply { } // Write request to wire for ListSystemCounters +// listSystemCountersRequest writes a ListSystemCounters request to a byte slice. func listSystemCountersRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -920,30 +914,35 @@ func listSystemCountersRequest(c *xgb.Conn) []byte { return buf } -// Request CreateCounter -// size: 16 +// CreateCounterCookie is a cookie used only for CreateCounter requests. type CreateCounterCookie struct { *xgb.Cookie } -// Write request to wire for CreateCounter +// CreateCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { cookie := c.NewCookie(false, false) c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) return CreateCounterCookie{cookie} } +// CreateCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCounterCookie.Check() func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { cookie := c.NewCookie(true, false) c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) return CreateCounterCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateCounterCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateCounter +// createCounterRequest writes a CreateCounter request to a byte slice. func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { size := 16 b := 0 @@ -970,30 +969,35 @@ func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { return buf } -// Request DestroyCounter -// size: 8 +// DestroyCounterCookie is a cookie used only for DestroyCounter requests. type DestroyCounterCookie struct { *xgb.Cookie } -// Write request to wire for DestroyCounter +// DestroyCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyCounterRequest(c, Counter), cookie) return DestroyCounterCookie{cookie} } +// DestroyCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyCounterCookie.Check() func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyCounterRequest(c, Counter), cookie) return DestroyCounterCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyCounterCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyCounter +// destroyCounterRequest writes a DestroyCounter request to a byte slice. func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { size := 8 b := 0 @@ -1014,34 +1018,36 @@ func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { return buf } -// Request QueryCounter -// size: 8 +// QueryCounterCookie is a cookie used only for QueryCounter requests. type QueryCounterCookie struct { *xgb.Cookie } +// QueryCounter sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryCounterCookie.Reply() func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryCounterRequest(c, Counter), cookie) return QueryCounterCookie{cookie} } +// QueryCounterUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryCounterRequest(c, Counter), cookie) return QueryCounterCookie{cookie} } -// Request reply for QueryCounter -// size: 16 +// QueryCounterReply represents the data returned from a QueryCounter request. type QueryCounterReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes CounterValue Int64 } -// Waits and reads reply data from request QueryCounter +// Reply blocks and returns the reply data for a QueryCounter request. func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1053,7 +1059,7 @@ func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { return queryCounterReply(buf), nil } -// Read reply into structure from buffer for QueryCounter +// queryCounterReply reads a byte slice into a QueryCounterReply value. func queryCounterReply(buf []byte) *QueryCounterReply { v := new(QueryCounterReply) b := 1 // skip reply determinant @@ -1073,6 +1079,7 @@ func queryCounterReply(buf []byte) *QueryCounterReply { } // Write request to wire for QueryCounter +// queryCounterRequest writes a QueryCounter request to a byte slice. func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { size := 8 b := 0 @@ -1093,30 +1100,35 @@ func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { return buf } -// Request Await -// size: xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) +// AwaitCookie is a cookie used only for Await requests. type AwaitCookie struct { *xgb.Cookie } -// Write request to wire for Await +// Await sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { cookie := c.NewCookie(false, false) c.NewRequest(awaitRequest(c, WaitList), cookie) return AwaitCookie{cookie} } +// AwaitChecked sends a checked request. +// If an error occurs, it can be retrieved using AwaitCookie.Check() func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { cookie := c.NewCookie(true, false) c.NewRequest(awaitRequest(c, WaitList), cookie) return AwaitCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AwaitCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Await +// awaitRequest writes a Await request to a byte slice. func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { size := xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) b := 0 @@ -1136,30 +1148,35 @@ func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { return buf } -// Request ChangeCounter -// size: 16 +// ChangeCounterCookie is a cookie used only for ChangeCounter requests. type ChangeCounterCookie struct { *xgb.Cookie } -// Write request to wire for ChangeCounter +// ChangeCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) return ChangeCounterCookie{cookie} } +// ChangeCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCounterCookie.Check() func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) return ChangeCounterCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeCounterCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeCounter +// changeCounterRequest writes a ChangeCounter request to a byte slice. func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { size := 16 b := 0 @@ -1186,30 +1203,35 @@ func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { return buf } -// Request SetCounter -// size: 16 +// SetCounterCookie is a cookie used only for SetCounter requests. type SetCounterCookie struct { *xgb.Cookie } -// Write request to wire for SetCounter +// SetCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCounterRequest(c, Counter, Value), cookie) return SetCounterCookie{cookie} } +// SetCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCounterCookie.Check() func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCounterRequest(c, Counter, Value), cookie) return SetCounterCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetCounterCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCounter +// setCounterRequest writes a SetCounter request to a byte slice. func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { size := 16 b := 0 @@ -1236,30 +1258,35 @@ func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { return buf } -// Request CreateAlarm -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreateAlarmCookie is a cookie used only for CreateAlarm requests. type CreateAlarmCookie struct { *xgb.Cookie } -// Write request to wire for CreateAlarm +// CreateAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { cookie := c.NewCookie(false, false) c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) return CreateAlarmCookie{cookie} } +// CreateAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateAlarmCookie.Check() func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { cookie := c.NewCookie(true, false) c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) return CreateAlarmCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateAlarmCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateAlarm +// createAlarmRequest writes a CreateAlarm request to a byte slice. func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -1288,30 +1315,35 @@ func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uin return buf } -// Request ChangeAlarm -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeAlarmCookie is a cookie used only for ChangeAlarm requests. type ChangeAlarmCookie struct { *xgb.Cookie } -// Write request to wire for ChangeAlarm +// ChangeAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) return ChangeAlarmCookie{cookie} } +// ChangeAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeAlarmCookie.Check() func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) return ChangeAlarmCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeAlarmCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeAlarm +// changeAlarmRequest writes a ChangeAlarm request to a byte slice. func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -1340,30 +1372,35 @@ func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uin return buf } -// Request DestroyAlarm -// size: 8 +// DestroyAlarmCookie is a cookie used only for DestroyAlarm requests. type DestroyAlarmCookie struct { *xgb.Cookie } -// Write request to wire for DestroyAlarm +// DestroyAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) return DestroyAlarmCookie{cookie} } +// DestroyAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyAlarmCookie.Check() func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) return DestroyAlarmCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyAlarmCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyAlarm +// destroyAlarmRequest writes a DestroyAlarm request to a byte slice. func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { size := 8 b := 0 @@ -1384,29 +1421,31 @@ func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { return buf } -// Request QueryAlarm -// size: 8 +// QueryAlarmCookie is a cookie used only for QueryAlarm requests. type QueryAlarmCookie struct { *xgb.Cookie } +// QueryAlarm sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryAlarmCookie.Reply() func QueryAlarm(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryAlarmRequest(c, Alarm), cookie) return QueryAlarmCookie{cookie} } +// QueryAlarmUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAlarmUnchecked(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryAlarmRequest(c, Alarm), cookie) return QueryAlarmCookie{cookie} } -// Request reply for QueryAlarm -// size: 40 +// QueryAlarmReply represents the data returned from a QueryAlarm request. type QueryAlarmReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Trigger Trigger Delta Int64 @@ -1415,7 +1454,7 @@ type QueryAlarmReply struct { // padding: 2 bytes } -// Waits and reads reply data from request QueryAlarm +// Reply blocks and returns the reply data for a QueryAlarm request. func (cook QueryAlarmCookie) Reply() (*QueryAlarmReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1427,7 +1466,7 @@ func (cook QueryAlarmCookie) Reply() (*QueryAlarmReply, error) { return queryAlarmReply(buf), nil } -// Read reply into structure from buffer for QueryAlarm +// queryAlarmReply reads a byte slice into a QueryAlarmReply value. func queryAlarmReply(buf []byte) *QueryAlarmReply { v := new(QueryAlarmReply) b := 1 // skip reply determinant @@ -1462,6 +1501,7 @@ func queryAlarmReply(buf []byte) *QueryAlarmReply { } // Write request to wire for QueryAlarm +// queryAlarmRequest writes a QueryAlarm request to a byte slice. func queryAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { size := 8 b := 0 @@ -1482,30 +1522,35 @@ func queryAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { return buf } -// Request SetPriority -// size: 12 +// SetPriorityCookie is a cookie used only for SetPriority requests. type SetPriorityCookie struct { *xgb.Cookie } -// Write request to wire for SetPriority +// SetPriority sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) return SetPriorityCookie{cookie} } +// SetPriorityChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPriorityCookie.Check() func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) return SetPriorityCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPriorityCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPriority +// setPriorityRequest writes a SetPriority request to a byte slice. func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { size := 12 b := 0 @@ -1529,34 +1574,36 @@ func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { return buf } -// Request GetPriority -// size: 8 +// GetPriorityCookie is a cookie used only for GetPriority requests. type GetPriorityCookie struct { *xgb.Cookie } +// GetPriority sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPriorityCookie.Reply() func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPriorityRequest(c, Id), cookie) return GetPriorityCookie{cookie} } +// GetPriorityUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPriorityRequest(c, Id), cookie) return GetPriorityCookie{cookie} } -// Request reply for GetPriority -// size: 12 +// GetPriorityReply represents the data returned from a GetPriority request. type GetPriorityReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Priority int32 } -// Waits and reads reply data from request GetPriority +// Reply blocks and returns the reply data for a GetPriority request. func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1568,7 +1615,7 @@ func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { return getPriorityReply(buf), nil } -// Read reply into structure from buffer for GetPriority +// getPriorityReply reads a byte slice into a GetPriorityReply value. func getPriorityReply(buf []byte) *GetPriorityReply { v := new(GetPriorityReply) b := 1 // skip reply determinant @@ -1588,6 +1635,7 @@ func getPriorityReply(buf []byte) *GetPriorityReply { } // Write request to wire for GetPriority +// getPriorityRequest writes a GetPriority request to a byte slice. func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { size := 8 b := 0 @@ -1608,30 +1656,35 @@ func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { return buf } -// Request CreateFence -// size: 16 +// CreateFenceCookie is a cookie used only for CreateFence requests. type CreateFenceCookie struct { *xgb.Cookie } -// Write request to wire for CreateFence +// CreateFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { cookie := c.NewCookie(false, false) c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) return CreateFenceCookie{cookie} } +// CreateFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateFenceCookie.Check() func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { cookie := c.NewCookie(true, false) c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) return CreateFenceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateFenceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateFence +// createFenceRequest writes a CreateFence request to a byte slice. func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) []byte { size := 16 b := 0 @@ -1662,30 +1715,35 @@ func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, Init return buf } -// Request TriggerFence -// size: 8 +// TriggerFenceCookie is a cookie used only for TriggerFence requests. type TriggerFenceCookie struct { *xgb.Cookie } -// Write request to wire for TriggerFence +// TriggerFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { cookie := c.NewCookie(false, false) c.NewRequest(triggerFenceRequest(c, Fence), cookie) return TriggerFenceCookie{cookie} } +// TriggerFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using TriggerFenceCookie.Check() func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { cookie := c.NewCookie(true, false) c.NewRequest(triggerFenceRequest(c, Fence), cookie) return TriggerFenceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TriggerFenceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for TriggerFence +// triggerFenceRequest writes a TriggerFence request to a byte slice. func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { size := 8 b := 0 @@ -1706,30 +1764,35 @@ func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { return buf } -// Request ResetFence -// size: 8 +// ResetFenceCookie is a cookie used only for ResetFence requests. type ResetFenceCookie struct { *xgb.Cookie } -// Write request to wire for ResetFence +// ResetFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { cookie := c.NewCookie(false, false) c.NewRequest(resetFenceRequest(c, Fence), cookie) return ResetFenceCookie{cookie} } +// ResetFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using ResetFenceCookie.Check() func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { cookie := c.NewCookie(true, false) c.NewRequest(resetFenceRequest(c, Fence), cookie) return ResetFenceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ResetFenceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ResetFence +// resetFenceRequest writes a ResetFence request to a byte slice. func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { size := 8 b := 0 @@ -1750,30 +1813,35 @@ func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { return buf } -// Request DestroyFence -// size: 8 +// DestroyFenceCookie is a cookie used only for DestroyFence requests. type DestroyFenceCookie struct { *xgb.Cookie } -// Write request to wire for DestroyFence +// DestroyFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyFenceRequest(c, Fence), cookie) return DestroyFenceCookie{cookie} } +// DestroyFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyFenceCookie.Check() func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyFenceRequest(c, Fence), cookie) return DestroyFenceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyFenceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyFence +// destroyFenceRequest writes a DestroyFence request to a byte slice. func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { size := 8 b := 0 @@ -1794,35 +1862,37 @@ func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { return buf } -// Request QueryFence -// size: 8 +// QueryFenceCookie is a cookie used only for QueryFence requests. type QueryFenceCookie struct { *xgb.Cookie } +// QueryFence sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFenceCookie.Reply() func QueryFence(c *xgb.Conn, Fence Fence) QueryFenceCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryFenceRequest(c, Fence), cookie) return QueryFenceCookie{cookie} } +// QueryFenceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFenceUnchecked(c *xgb.Conn, Fence Fence) QueryFenceCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryFenceRequest(c, Fence), cookie) return QueryFenceCookie{cookie} } -// Request reply for QueryFence -// size: 32 +// QueryFenceReply represents the data returned from a QueryFence request. type QueryFenceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Triggered bool // padding: 23 bytes } -// Waits and reads reply data from request QueryFence +// Reply blocks and returns the reply data for a QueryFence request. func (cook QueryFenceCookie) Reply() (*QueryFenceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1834,7 +1904,7 @@ func (cook QueryFenceCookie) Reply() (*QueryFenceReply, error) { return queryFenceReply(buf), nil } -// Read reply into structure from buffer for QueryFence +// queryFenceReply reads a byte slice into a QueryFenceReply value. func queryFenceReply(buf []byte) *QueryFenceReply { v := new(QueryFenceReply) b := 1 // skip reply determinant @@ -1860,6 +1930,7 @@ func queryFenceReply(buf []byte) *QueryFenceReply { } // Write request to wire for QueryFence +// queryFenceRequest writes a QueryFence request to a byte slice. func queryFenceRequest(c *xgb.Conn, Fence Fence) []byte { size := 8 b := 0 @@ -1880,30 +1951,35 @@ func queryFenceRequest(c *xgb.Conn, Fence Fence) []byte { return buf } -// Request AwaitFence -// size: xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) +// AwaitFenceCookie is a cookie used only for AwaitFence requests. type AwaitFenceCookie struct { *xgb.Cookie } -// Write request to wire for AwaitFence +// AwaitFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { cookie := c.NewCookie(false, false) c.NewRequest(awaitFenceRequest(c, FenceList), cookie) return AwaitFenceCookie{cookie} } +// AwaitFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using AwaitFenceCookie.Check() func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { cookie := c.NewCookie(true, false) c.NewRequest(awaitFenceRequest(c, FenceList), cookie) return AwaitFenceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AwaitFenceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AwaitFence +// awaitFenceRequest writes a AwaitFence request to a byte slice. func awaitFenceRequest(c *xgb.Conn, FenceList []Fence) []byte { size := xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) b := 0 diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index d4f7b0d..5157119 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xc_misc.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -64,35 +64,37 @@ func init() { // Skipping definition for base type 'Bool' -// Request GetVersion -// size: 8 +// GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { *xgb.Cookie } +// GetVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} } +// GetVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} } -// Request reply for GetVersion -// size: 12 +// GetVersionReply represents the data returned from a GetVersion request. type GetVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajorVersion uint16 ServerMinorVersion uint16 } -// Waits and reads reply data from request GetVersion +// Reply blocks and returns the reply data for a GetVersion request. func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -104,7 +106,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { return getVersionReply(buf), nil } -// Read reply into structure from buffer for GetVersion +// getVersionReply reads a byte slice into a GetVersionReply value. func getVersionReply(buf []byte) *GetVersionReply { v := new(GetVersionReply) b := 1 // skip reply determinant @@ -127,6 +129,7 @@ func getVersionReply(buf []byte) *GetVersionReply { } // Write request to wire for GetVersion +// getVersionRequest writes a GetVersion request to a byte slice. func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { size := 8 b := 0 @@ -150,35 +153,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio return buf } -// Request GetXIDRange -// size: 4 +// GetXIDRangeCookie is a cookie used only for GetXIDRange requests. type GetXIDRangeCookie struct { *xgb.Cookie } +// GetXIDRange sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} } +// GetXIDRangeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} } -// Request reply for GetXIDRange -// size: 16 +// GetXIDRangeReply represents the data returned from a GetXIDRange request. type GetXIDRangeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes StartId uint32 Count uint32 } -// Waits and reads reply data from request GetXIDRange +// Reply blocks and returns the reply data for a GetXIDRange request. func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -190,7 +195,7 @@ func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) { return getXIDRangeReply(buf), nil } -// Read reply into structure from buffer for GetXIDRange +// getXIDRangeReply reads a byte slice into a GetXIDRangeReply value. func getXIDRangeReply(buf []byte) *GetXIDRangeReply { v := new(GetXIDRangeReply) b := 1 // skip reply determinant @@ -213,6 +218,7 @@ func getXIDRangeReply(buf []byte) *GetXIDRangeReply { } // Write request to wire for GetXIDRange +// getXIDRangeRequest writes a GetXIDRange request to a byte slice. func getXIDRangeRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -230,36 +236,38 @@ func getXIDRangeRequest(c *xgb.Conn) []byte { return buf } -// Request GetXIDList -// size: 8 +// GetXIDListCookie is a cookie used only for GetXIDList requests. type GetXIDListCookie struct { *xgb.Cookie } +// GetXIDList sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetXIDListCookie.Reply() func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { cookie := c.NewCookie(true, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} } +// GetXIDListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie { cookie := c.NewCookie(false, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} } -// Request reply for GetXIDList -// size: (32 + xgb.Pad((int(IdsLen) * 4))) +// GetXIDListReply represents the data returned from a GetXIDList request. type GetXIDListReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes IdsLen uint32 // padding: 20 bytes Ids []uint32 // size: xgb.Pad((int(IdsLen) * 4)) } -// Waits and reads reply data from request GetXIDList +// Reply blocks and returns the reply data for a GetXIDList request. func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -271,7 +279,7 @@ func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) { return getXIDListReply(buf), nil } -// Read reply into structure from buffer for GetXIDList +// getXIDListReply reads a byte slice into a GetXIDListReply value. func getXIDListReply(buf []byte) *GetXIDListReply { v := new(GetXIDListReply) b := 1 // skip reply determinant @@ -300,6 +308,7 @@ func getXIDListReply(buf []byte) *GetXIDListReply { } // Write request to wire for GetXIDList +// getXIDListRequest writes a GetXIDList request to a byte slice. func getXIDListRequest(c *xgb.Conn, Count uint32) []byte { size := 8 b := 0 diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 47d9146..3076680 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xevie.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,18 +54,26 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( DatatypeUnmodified = 0 DatatypeModified = 1 ) -// 'Event' struct definition -// Size: 32 type Event struct { // padding: 32 bytes } -// Struct read Event +// EventRead reads a byte slice into a Event value. func EventRead(buf []byte, v *Event) int { b := 0 @@ -84,7 +82,7 @@ func EventRead(buf []byte, v *Event) int { return b } -// Struct list read Event +// EventReadList reads a byte slice into a list of Event values. func EventReadList(buf []byte, dest []Event) int { b := 0 for i := 0; i < len(dest); i++ { @@ -94,7 +92,7 @@ func EventReadList(buf []byte, dest []Event) int { return xgb.Pad(b) } -// Struct write Event +// Bytes writes a Event value to a byte slice. func (v Event) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -104,7 +102,7 @@ func (v Event) Bytes() []byte { return buf } -// Write struct list Event +// EventListBytes writes a list of %s(MISSING) values to a byte slice. func EventListBytes(buf []byte, list []Event) int { b := 0 var structBytes []byte @@ -116,36 +114,38 @@ func EventListBytes(buf []byte, list []Event) int { return b } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajorVersion uint16 ServerMinorVersion uint16 // padding: 20 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -157,7 +157,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -182,6 +182,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { size := 8 b := 0 @@ -205,34 +206,36 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers return buf } -// Request Start -// size: 8 +// StartCookie is a cookie used only for Start requests. type StartCookie struct { *xgb.Cookie } +// Start sends a checked request. +// If an error occurs, it will be returned with the reply by calling StartCookie.Reply() func Start(c *xgb.Conn, Screen uint32) StartCookie { cookie := c.NewCookie(true, true) c.NewRequest(startRequest(c, Screen), cookie) return StartCookie{cookie} } +// StartUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { cookie := c.NewCookie(false, true) c.NewRequest(startRequest(c, Screen), cookie) return StartCookie{cookie} } -// Request reply for Start -// size: 32 +// StartReply represents the data returned from a Start request. type StartReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Waits and reads reply data from request Start +// Reply blocks and returns the reply data for a Start request. func (cook StartCookie) Reply() (*StartReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -244,7 +247,7 @@ func (cook StartCookie) Reply() (*StartReply, error) { return startReply(buf), nil } -// Read reply into structure from buffer for Start +// startReply reads a byte slice into a StartReply value. func startReply(buf []byte) *StartReply { v := new(StartReply) b := 1 // skip reply determinant @@ -263,6 +266,7 @@ func startReply(buf []byte) *StartReply { } // Write request to wire for Start +// startRequest writes a Start request to a byte slice. func startRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -283,34 +287,36 @@ func startRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request End -// size: 8 +// EndCookie is a cookie used only for End requests. type EndCookie struct { *xgb.Cookie } +// End sends a checked request. +// If an error occurs, it will be returned with the reply by calling EndCookie.Reply() func End(c *xgb.Conn, Cmap uint32) EndCookie { cookie := c.NewCookie(true, true) c.NewRequest(endRequest(c, Cmap), cookie) return EndCookie{cookie} } +// EndUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { cookie := c.NewCookie(false, true) c.NewRequest(endRequest(c, Cmap), cookie) return EndCookie{cookie} } -// Request reply for End -// size: 32 +// EndReply represents the data returned from a End request. type EndReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Waits and reads reply data from request End +// Reply blocks and returns the reply data for a End request. func (cook EndCookie) Reply() (*EndReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -322,7 +328,7 @@ func (cook EndCookie) Reply() (*EndReply, error) { return endReply(buf), nil } -// Read reply into structure from buffer for End +// endReply reads a byte slice into a EndReply value. func endReply(buf []byte) *EndReply { v := new(EndReply) b := 1 // skip reply determinant @@ -341,6 +347,7 @@ func endReply(buf []byte) *EndReply { } // Write request to wire for End +// endRequest writes a End request to a byte slice. func endRequest(c *xgb.Conn, Cmap uint32) []byte { size := 8 b := 0 @@ -361,34 +368,36 @@ func endRequest(c *xgb.Conn, Cmap uint32) []byte { return buf } -// Request Send -// size: 104 +// SendCookie is a cookie used only for Send requests. type SendCookie struct { *xgb.Cookie } +// Send sends a checked request. +// If an error occurs, it will be returned with the reply by calling SendCookie.Reply() func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { cookie := c.NewCookie(true, true) c.NewRequest(sendRequest(c, Event, DataType), cookie) return SendCookie{cookie} } +// SendUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie { cookie := c.NewCookie(false, true) c.NewRequest(sendRequest(c, Event, DataType), cookie) return SendCookie{cookie} } -// Request reply for Send -// size: 32 +// SendReply represents the data returned from a Send request. type SendReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Waits and reads reply data from request Send +// Reply blocks and returns the reply data for a Send request. func (cook SendCookie) Reply() (*SendReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -400,7 +409,7 @@ func (cook SendCookie) Reply() (*SendReply, error) { return sendReply(buf), nil } -// Read reply into structure from buffer for Send +// sendReply reads a byte slice into a SendReply value. func sendReply(buf []byte) *SendReply { v := new(SendReply) b := 1 // skip reply determinant @@ -419,6 +428,7 @@ func sendReply(buf []byte) *SendReply { } // Write request to wire for Send +// sendRequest writes a Send request to a byte slice. func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { size := 104 b := 0 @@ -447,34 +457,36 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { return buf } -// Request SelectInput -// size: 8 +// SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie } +// SelectInput sends a checked request. +// If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply() func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { cookie := c.NewCookie(true, true) c.NewRequest(selectInputRequest(c, EventMask), cookie) return SelectInputCookie{cookie} } +// SelectInputUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { cookie := c.NewCookie(false, true) c.NewRequest(selectInputRequest(c, EventMask), cookie) return SelectInputCookie{cookie} } -// Request reply for SelectInput -// size: 32 +// SelectInputReply represents the data returned from a SelectInput request. type SelectInputReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Waits and reads reply data from request SelectInput +// Reply blocks and returns the reply data for a SelectInput request. func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -486,7 +498,7 @@ func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { return selectInputReply(buf), nil } -// Read reply into structure from buffer for SelectInput +// selectInputReply reads a byte slice into a SelectInputReply value. func selectInputReply(buf []byte) *SelectInputReply { v := new(SelectInputReply) b := 1 // skip reply determinant @@ -505,6 +517,7 @@ func selectInputReply(buf []byte) *SelectInputReply { } // Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { size := 8 b := 0 diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index ac87c0a..cd3ff35 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xf86dri.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,8 +52,18 @@ func init() { // Skipping definition for base type 'Byte' -// 'DrmClipRect' struct definition -// Size: 8 +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + type DrmClipRect struct { X1 int16 Y1 int16 @@ -73,7 +71,7 @@ type DrmClipRect struct { X3 int16 } -// Struct read DrmClipRect +// DrmClipRectRead reads a byte slice into a DrmClipRect value. func DrmClipRectRead(buf []byte, v *DrmClipRect) int { b := 0 @@ -92,7 +90,7 @@ func DrmClipRectRead(buf []byte, v *DrmClipRect) int { return b } -// Struct list read DrmClipRect +// DrmClipRectReadList reads a byte slice into a list of DrmClipRect values. func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int { b := 0 for i := 0; i < len(dest); i++ { @@ -102,7 +100,7 @@ func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int { return xgb.Pad(b) } -// Struct write DrmClipRect +// Bytes writes a DrmClipRect value to a byte slice. func (v DrmClipRect) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -122,7 +120,7 @@ func (v DrmClipRect) Bytes() []byte { return buf } -// Write struct list DrmClipRect +// DrmClipRectListBytes writes a list of %s(MISSING) values to a byte slice. func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { b := 0 var structBytes []byte @@ -134,36 +132,38 @@ func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { return b } -// Request QueryVersion -// size: 4 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 16 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes DriMajorVersion uint16 DriMinorVersion uint16 DriMinorPatch uint32 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -175,7 +175,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -201,6 +201,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -218,34 +219,36 @@ func queryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request QueryDirectRenderingCapable -// size: 8 +// QueryDirectRenderingCapableCookie is a cookie used only for QueryDirectRenderingCapable requests. type QueryDirectRenderingCapableCookie struct { *xgb.Cookie } +// QueryDirectRenderingCapable sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) return QueryDirectRenderingCapableCookie{cookie} } +// QueryDirectRenderingCapableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) return QueryDirectRenderingCapableCookie{cookie} } -// Request reply for QueryDirectRenderingCapable -// size: 9 +// QueryDirectRenderingCapableReply represents the data returned from a QueryDirectRenderingCapable request. type QueryDirectRenderingCapableReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes IsCapable bool } -// Waits and reads reply data from request QueryDirectRenderingCapable +// Reply blocks and returns the reply data for a QueryDirectRenderingCapable request. func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -257,7 +260,7 @@ func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapa return queryDirectRenderingCapableReply(buf), nil } -// Read reply into structure from buffer for QueryDirectRenderingCapable +// queryDirectRenderingCapableReply reads a byte slice into a QueryDirectRenderingCapableReply value. func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply { v := new(QueryDirectRenderingCapableReply) b := 1 // skip reply determinant @@ -281,6 +284,7 @@ func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableRe } // Write request to wire for QueryDirectRenderingCapable +// queryDirectRenderingCapableRequest writes a QueryDirectRenderingCapable request to a byte slice. func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -301,29 +305,31 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request OpenConnection -// size: 8 +// OpenConnectionCookie is a cookie used only for OpenConnection requests. type OpenConnectionCookie struct { *xgb.Cookie } +// OpenConnection sends a checked request. +// If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { cookie := c.NewCookie(true, true) c.NewRequest(openConnectionRequest(c, Screen), cookie) return OpenConnectionCookie{cookie} } +// OpenConnectionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { cookie := c.NewCookie(false, true) c.NewRequest(openConnectionRequest(c, Screen), cookie) return OpenConnectionCookie{cookie} } -// Request reply for OpenConnection -// size: (32 + xgb.Pad((int(BusIdLen) * 1))) +// OpenConnectionReply represents the data returned from a OpenConnection request. type OpenConnectionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes SareaHandleLow uint32 SareaHandleHigh uint32 @@ -332,7 +338,7 @@ type OpenConnectionReply struct { BusId string // size: xgb.Pad((int(BusIdLen) * 1)) } -// Waits and reads reply data from request OpenConnection +// Reply blocks and returns the reply data for a OpenConnection request. func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -344,7 +350,7 @@ func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) { return openConnectionReply(buf), nil } -// Read reply into structure from buffer for OpenConnection +// openConnectionReply reads a byte slice into a OpenConnectionReply value. func openConnectionReply(buf []byte) *OpenConnectionReply { v := new(OpenConnectionReply) b := 1 // skip reply determinant @@ -379,6 +385,7 @@ func openConnectionReply(buf []byte) *OpenConnectionReply { } // Write request to wire for OpenConnection +// openConnectionRequest writes a OpenConnection request to a byte slice. func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -399,30 +406,35 @@ func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request CloseConnection -// size: 8 +// CloseConnectionCookie is a cookie used only for CloseConnection requests. type CloseConnectionCookie struct { *xgb.Cookie } -// Write request to wire for CloseConnection +// CloseConnection sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { cookie := c.NewCookie(false, false) c.NewRequest(closeConnectionRequest(c, Screen), cookie) return CloseConnectionCookie{cookie} } +// CloseConnectionChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseConnectionCookie.Check() func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie { cookie := c.NewCookie(true, false) c.NewRequest(closeConnectionRequest(c, Screen), cookie) return CloseConnectionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CloseConnectionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CloseConnection +// closeConnectionRequest writes a CloseConnection request to a byte slice. func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -443,29 +455,31 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request GetClientDriverName -// size: 8 +// GetClientDriverNameCookie is a cookie used only for GetClientDriverName requests. type GetClientDriverNameCookie struct { *xgb.Cookie } +// GetClientDriverName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetClientDriverNameCookie.Reply() func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { cookie := c.NewCookie(true, true) c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) return GetClientDriverNameCookie{cookie} } +// GetClientDriverNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { cookie := c.NewCookie(false, true) c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) return GetClientDriverNameCookie{cookie} } -// Request reply for GetClientDriverName -// size: (32 + xgb.Pad((int(ClientDriverNameLen) * 1))) +// GetClientDriverNameReply represents the data returned from a GetClientDriverName request. type GetClientDriverNameReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ClientDriverMajorVersion uint32 ClientDriverMinorVersion uint32 @@ -475,7 +489,7 @@ type GetClientDriverNameReply struct { ClientDriverName string // size: xgb.Pad((int(ClientDriverNameLen) * 1)) } -// Waits and reads reply data from request GetClientDriverName +// Reply blocks and returns the reply data for a GetClientDriverName request. func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -487,7 +501,7 @@ func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error) return getClientDriverNameReply(buf), nil } -// Read reply into structure from buffer for GetClientDriverName +// getClientDriverNameReply reads a byte slice into a GetClientDriverNameReply value. func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply { v := new(GetClientDriverNameReply) b := 1 // skip reply determinant @@ -525,6 +539,7 @@ func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply { } // Write request to wire for GetClientDriverName +// getClientDriverNameRequest writes a GetClientDriverName request to a byte slice. func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -545,34 +560,36 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request CreateContext -// size: 16 +// CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie } +// CreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) return CreateContextCookie{cookie} } +// CreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) return CreateContextCookie{cookie} } -// Request reply for CreateContext -// size: 12 +// CreateContextReply represents the data returned from a CreateContext request. type CreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes HwContext uint32 } -// Waits and reads reply data from request CreateContext +// Reply blocks and returns the reply data for a CreateContext request. func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -584,7 +601,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { return createContextReply(buf), nil } -// Read reply into structure from buffer for CreateContext +// createContextReply reads a byte slice into a CreateContextReply value. func createContextReply(buf []byte) *CreateContextReply { v := new(CreateContextReply) b := 1 // skip reply determinant @@ -604,6 +621,7 @@ func createContextReply(buf []byte) *CreateContextReply { } // Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte { size := 16 b := 0 @@ -630,30 +648,35 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin return buf } -// Request DestroyContext -// size: 12 +// DestroyContextCookie is a cookie used only for DestroyContext requests. type DestroyContextCookie struct { *xgb.Cookie } -// Write request to wire for DestroyContext +// DestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) return DestroyContextCookie{cookie} } +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) return DestroyContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { size := 12 b := 0 @@ -677,34 +700,36 @@ func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { return buf } -// Request CreateDrawable -// size: 12 +// CreateDrawableCookie is a cookie used only for CreateDrawable requests. type CreateDrawableCookie struct { *xgb.Cookie } +// CreateDrawable sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { cookie := c.NewCookie(true, true) c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) return CreateDrawableCookie{cookie} } +// CreateDrawableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { cookie := c.NewCookie(false, true) c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) return CreateDrawableCookie{cookie} } -// Request reply for CreateDrawable -// size: 12 +// CreateDrawableReply represents the data returned from a CreateDrawable request. type CreateDrawableReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes HwDrawableHandle uint32 } -// Waits and reads reply data from request CreateDrawable +// Reply blocks and returns the reply data for a CreateDrawable request. func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -716,7 +741,7 @@ func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) { return createDrawableReply(buf), nil } -// Read reply into structure from buffer for CreateDrawable +// createDrawableReply reads a byte slice into a CreateDrawableReply value. func createDrawableReply(buf []byte) *CreateDrawableReply { v := new(CreateDrawableReply) b := 1 // skip reply determinant @@ -736,6 +761,7 @@ func createDrawableReply(buf []byte) *CreateDrawableReply { } // Write request to wire for CreateDrawable +// createDrawableRequest writes a CreateDrawable request to a byte slice. func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { size := 12 b := 0 @@ -759,30 +785,35 @@ func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { return buf } -// Request DestroyDrawable -// size: 12 +// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests. type DestroyDrawableCookie struct { *xgb.Cookie } -// Write request to wire for DestroyDrawable +// DestroyDrawable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) return DestroyDrawableCookie{cookie} } +// DestroyDrawableChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) return DestroyDrawableCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyDrawableCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyDrawable +// destroyDrawableRequest writes a DestroyDrawable request to a byte slice. func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { size := 12 b := 0 @@ -806,29 +837,31 @@ func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte return buf } -// Request GetDrawableInfo -// size: 12 +// GetDrawableInfoCookie is a cookie used only for GetDrawableInfo requests. type GetDrawableInfoCookie struct { *xgb.Cookie } +// GetDrawableInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDrawableInfoCookie.Reply() func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) return GetDrawableInfoCookie{cookie} } +// GetDrawableInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) return GetDrawableInfoCookie{cookie} } -// Request reply for GetDrawableInfo -// size: ((36 + xgb.Pad((int(NumClipRects) * 8))) + xgb.Pad((int(NumBackClipRects) * 8))) +// GetDrawableInfoReply represents the data returned from a GetDrawableInfo request. type GetDrawableInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes DrawableTableIndex uint32 DrawableTableStamp uint32 @@ -844,7 +877,7 @@ type GetDrawableInfoReply struct { BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) } -// Waits and reads reply data from request GetDrawableInfo +// Reply blocks and returns the reply data for a GetDrawableInfo request. func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -856,7 +889,7 @@ func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) { return getDrawableInfoReply(buf), nil } -// Read reply into structure from buffer for GetDrawableInfo +// getDrawableInfoReply reads a byte slice into a GetDrawableInfoReply value. func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply { v := new(GetDrawableInfoReply) b := 1 // skip reply determinant @@ -909,6 +942,7 @@ func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply { } // Write request to wire for GetDrawableInfo +// getDrawableInfoRequest writes a GetDrawableInfo request to a byte slice. func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { size := 12 b := 0 @@ -932,29 +966,31 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte return buf } -// Request GetDeviceInfo -// size: 8 +// GetDeviceInfoCookie is a cookie used only for GetDeviceInfo requests. type GetDeviceInfoCookie struct { *xgb.Cookie } +// GetDeviceInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) return GetDeviceInfoCookie{cookie} } +// GetDeviceInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) return GetDeviceInfoCookie{cookie} } -// Request reply for GetDeviceInfo -// size: (32 + xgb.Pad((int(DevicePrivateSize) * 4))) +// GetDeviceInfoReply represents the data returned from a GetDeviceInfo request. type GetDeviceInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes FramebufferHandleLow uint32 FramebufferHandleHigh uint32 @@ -965,7 +1001,7 @@ type GetDeviceInfoReply struct { DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4)) } -// Waits and reads reply data from request GetDeviceInfo +// Reply blocks and returns the reply data for a GetDeviceInfo request. func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -977,7 +1013,7 @@ func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { return getDeviceInfoReply(buf), nil } -// Read reply into structure from buffer for GetDeviceInfo +// getDeviceInfoReply reads a byte slice into a GetDeviceInfoReply value. func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { v := new(GetDeviceInfoReply) b := 1 // skip reply determinant @@ -1019,6 +1055,7 @@ func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { } // Write request to wire for GetDeviceInfo +// getDeviceInfoRequest writes a GetDeviceInfo request to a byte slice. func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 @@ -1039,34 +1076,36 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// Request AuthConnection -// size: 12 +// AuthConnectionCookie is a cookie used only for AuthConnection requests. type AuthConnectionCookie struct { *xgb.Cookie } +// AuthConnection sends a checked request. +// If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { cookie := c.NewCookie(true, true) c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) return AuthConnectionCookie{cookie} } +// AuthConnectionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { cookie := c.NewCookie(false, true) c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) return AuthConnectionCookie{cookie} } -// Request reply for AuthConnection -// size: 12 +// AuthConnectionReply represents the data returned from a AuthConnection request. type AuthConnectionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Authenticated uint32 } -// Waits and reads reply data from request AuthConnection +// Reply blocks and returns the reply data for a AuthConnection request. func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1078,7 +1117,7 @@ func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { return authConnectionReply(buf), nil } -// Read reply into structure from buffer for AuthConnection +// authConnectionReply reads a byte slice into a AuthConnectionReply value. func authConnectionReply(buf []byte) *AuthConnectionReply { v := new(AuthConnectionReply) b := 1 // skip reply determinant @@ -1098,6 +1137,7 @@ func authConnectionReply(buf []byte) *AuthConnectionReply { } // Write request to wire for AuthConnection +// authConnectionRequest writes a AuthConnection request to a byte slice. func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { size := 12 b := 0 diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index d32f601..15daeb2 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xf86vidmode.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( ModeFlagPositiveHsync = 1 ModeFlagNegativeHsync = 2 @@ -93,8 +93,6 @@ type Syncrange uint32 type Dotclock uint32 -// 'ModeInfo' struct definition -// Size: 48 type ModeInfo struct { Dotclock Dotclock Hdisplay uint16 @@ -112,7 +110,7 @@ type ModeInfo struct { Privsize uint32 } -// Struct read ModeInfo +// ModeInfoRead reads a byte slice into a ModeInfo value. func ModeInfoRead(buf []byte, v *ModeInfo) int { b := 0 @@ -159,7 +157,7 @@ func ModeInfoRead(buf []byte, v *ModeInfo) int { return b } -// Struct list read ModeInfo +// ModeInfoReadList reads a byte slice into a list of ModeInfo values. func ModeInfoReadList(buf []byte, dest []ModeInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -169,7 +167,7 @@ func ModeInfoReadList(buf []byte, dest []ModeInfo) int { return xgb.Pad(b) } -// Struct write ModeInfo +// Bytes writes a ModeInfo value to a byte slice. func (v ModeInfo) Bytes() []byte { buf := make([]byte, 48) b := 0 @@ -217,7 +215,7 @@ func (v ModeInfo) Bytes() []byte { return buf } -// Write struct list ModeInfo +// ModeInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ModeInfoListBytes(buf []byte, list []ModeInfo) int { b := 0 var structBytes []byte @@ -229,9 +227,7 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return b } -// Error definition BadClock (0) -// Size: 32 - +// BadBadClock is the error number for a BadBadClock. const BadBadClock = 0 type BadClockError struct { @@ -239,7 +235,7 @@ type BadClockError struct { NiceName string } -// Error read BadClock +// BadClockErrorNew constructs a BadClockError value that implements xgb.Error from a byte slice. func BadClockErrorNew(buf []byte) xgb.Error { v := BadClockError{} v.NiceName = "BadClock" @@ -253,8 +249,8 @@ func BadClockErrorNew(buf []byte) xgb.Error { return v } -func (err BadClockError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadClock error. +// This is mostly used internally. func (err BadClockError) SequenceId() uint16 { return err.Sequence } @@ -274,9 +270,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][0] = BadClockErrorNew } -// Error definition BadHTimings (1) -// Size: 32 - +// BadBadHTimings is the error number for a BadBadHTimings. const BadBadHTimings = 1 type BadHTimingsError struct { @@ -284,7 +278,7 @@ type BadHTimingsError struct { NiceName string } -// Error read BadHTimings +// BadHTimingsErrorNew constructs a BadHTimingsError value that implements xgb.Error from a byte slice. func BadHTimingsErrorNew(buf []byte) xgb.Error { v := BadHTimingsError{} v.NiceName = "BadHTimings" @@ -298,8 +292,8 @@ func BadHTimingsErrorNew(buf []byte) xgb.Error { return v } -func (err BadHTimingsError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadHTimings error. +// This is mostly used internally. func (err BadHTimingsError) SequenceId() uint16 { return err.Sequence } @@ -319,9 +313,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][1] = BadHTimingsErrorNew } -// Error definition BadVTimings (2) -// Size: 32 - +// BadBadVTimings is the error number for a BadBadVTimings. const BadBadVTimings = 2 type BadVTimingsError struct { @@ -329,7 +321,7 @@ type BadVTimingsError struct { NiceName string } -// Error read BadVTimings +// BadVTimingsErrorNew constructs a BadVTimingsError value that implements xgb.Error from a byte slice. func BadVTimingsErrorNew(buf []byte) xgb.Error { v := BadVTimingsError{} v.NiceName = "BadVTimings" @@ -343,8 +335,8 @@ func BadVTimingsErrorNew(buf []byte) xgb.Error { return v } -func (err BadVTimingsError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadVTimings error. +// This is mostly used internally. func (err BadVTimingsError) SequenceId() uint16 { return err.Sequence } @@ -364,9 +356,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][2] = BadVTimingsErrorNew } -// Error definition ModeUnsuitable (3) -// Size: 32 - +// BadModeUnsuitable is the error number for a BadModeUnsuitable. const BadModeUnsuitable = 3 type ModeUnsuitableError struct { @@ -374,7 +364,7 @@ type ModeUnsuitableError struct { NiceName string } -// Error read ModeUnsuitable +// ModeUnsuitableErrorNew constructs a ModeUnsuitableError value that implements xgb.Error from a byte slice. func ModeUnsuitableErrorNew(buf []byte) xgb.Error { v := ModeUnsuitableError{} v.NiceName = "ModeUnsuitable" @@ -388,8 +378,8 @@ func ModeUnsuitableErrorNew(buf []byte) xgb.Error { return v } -func (err ModeUnsuitableError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadModeUnsuitable error. +// This is mostly used internally. func (err ModeUnsuitableError) SequenceId() uint16 { return err.Sequence } @@ -409,9 +399,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][3] = ModeUnsuitableErrorNew } -// Error definition ExtensionDisabled (4) -// Size: 32 - +// BadExtensionDisabled is the error number for a BadExtensionDisabled. const BadExtensionDisabled = 4 type ExtensionDisabledError struct { @@ -419,7 +407,7 @@ type ExtensionDisabledError struct { NiceName string } -// Error read ExtensionDisabled +// ExtensionDisabledErrorNew constructs a ExtensionDisabledError value that implements xgb.Error from a byte slice. func ExtensionDisabledErrorNew(buf []byte) xgb.Error { v := ExtensionDisabledError{} v.NiceName = "ExtensionDisabled" @@ -433,8 +421,8 @@ func ExtensionDisabledErrorNew(buf []byte) xgb.Error { return v } -func (err ExtensionDisabledError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadExtensionDisabled error. +// This is mostly used internally. func (err ExtensionDisabledError) SequenceId() uint16 { return err.Sequence } @@ -454,9 +442,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][4] = ExtensionDisabledErrorNew } -// Error definition ClientNotLocal (5) -// Size: 32 - +// BadClientNotLocal is the error number for a BadClientNotLocal. const BadClientNotLocal = 5 type ClientNotLocalError struct { @@ -464,7 +450,7 @@ type ClientNotLocalError struct { NiceName string } -// Error read ClientNotLocal +// ClientNotLocalErrorNew constructs a ClientNotLocalError value that implements xgb.Error from a byte slice. func ClientNotLocalErrorNew(buf []byte) xgb.Error { v := ClientNotLocalError{} v.NiceName = "ClientNotLocal" @@ -478,8 +464,8 @@ func ClientNotLocalErrorNew(buf []byte) xgb.Error { return v } -func (err ClientNotLocalError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadClientNotLocal error. +// This is mostly used internally. func (err ClientNotLocalError) SequenceId() uint16 { return err.Sequence } @@ -499,9 +485,7 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][5] = ClientNotLocalErrorNew } -// Error definition ZoomLocked (6) -// Size: 32 - +// BadZoomLocked is the error number for a BadZoomLocked. const BadZoomLocked = 6 type ZoomLockedError struct { @@ -509,7 +493,7 @@ type ZoomLockedError struct { NiceName string } -// Error read ZoomLocked +// ZoomLockedErrorNew constructs a ZoomLockedError value that implements xgb.Error from a byte slice. func ZoomLockedErrorNew(buf []byte) xgb.Error { v := ZoomLockedError{} v.NiceName = "ZoomLocked" @@ -523,8 +507,8 @@ func ZoomLockedErrorNew(buf []byte) xgb.Error { return v } -func (err ZoomLockedError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadZoomLocked error. +// This is mostly used internally. func (err ZoomLockedError) SequenceId() uint16 { return err.Sequence } @@ -544,35 +528,37 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][6] = ZoomLockedErrorNew } -// Request QueryVersion -// size: 4 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint16 MinorVersion uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -584,7 +570,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -607,6 +593,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -624,29 +611,31 @@ func queryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request GetModeLine -// size: 8 +// GetModeLineCookie is a cookie used only for GetModeLine requests. type GetModeLineCookie struct { *xgb.Cookie } +// GetModeLine sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { cookie := c.NewCookie(true, true) c.NewRequest(getModeLineRequest(c, Screen), cookie) return GetModeLineCookie{cookie} } +// GetModeLineUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { cookie := c.NewCookie(false, true) c.NewRequest(getModeLineRequest(c, Screen), cookie) return GetModeLineCookie{cookie} } -// Request reply for GetModeLine -// size: (52 + xgb.Pad((int(Privsize) * 1))) +// GetModeLineReply represents the data returned from a GetModeLine request. type GetModeLineReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Dotclock Dotclock Hdisplay uint16 @@ -665,7 +654,7 @@ type GetModeLineReply struct { Private []byte // size: xgb.Pad((int(Privsize) * 1)) } -// Waits and reads reply data from request GetModeLine +// Reply blocks and returns the reply data for a GetModeLine request. func (cook GetModeLineCookie) Reply() (*GetModeLineReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -677,7 +666,7 @@ func (cook GetModeLineCookie) Reply() (*GetModeLineReply, error) { return getModeLineReply(buf), nil } -// Read reply into structure from buffer for GetModeLine +// getModeLineReply reads a byte slice into a GetModeLineReply value. func getModeLineReply(buf []byte) *GetModeLineReply { v := new(GetModeLineReply) b := 1 // skip reply determinant @@ -738,6 +727,7 @@ func getModeLineReply(buf []byte) *GetModeLineReply { } // Write request to wire for GetModeLine +// getModeLineRequest writes a GetModeLine request to a byte slice. func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -760,30 +750,35 @@ func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request ModModeLine -// size: xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) +// ModModeLineCookie is a cookie used only for ModModeLine requests. type ModModeLineCookie struct { *xgb.Cookie } -// Write request to wire for ModModeLine +// ModModeLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { cookie := c.NewCookie(false, false) c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ModModeLineCookie{cookie} } +// ModModeLineChecked sends a checked request. +// If an error occurs, it can be retrieved using ModModeLineCookie.Check() func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { cookie := c.NewCookie(true, false) c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ModModeLineCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ModModeLineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ModModeLine +// modModeLineRequest writes a ModModeLine request to a byte slice. func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { size := xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) b := 0 @@ -844,30 +839,35 @@ func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart return buf } -// Request SwitchMode -// size: 8 +// SwitchModeCookie is a cookie used only for SwitchMode requests. type SwitchModeCookie struct { *xgb.Cookie } -// Write request to wire for SwitchMode +// SwitchMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) return SwitchModeCookie{cookie} } +// SwitchModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SwitchModeCookie.Check() func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) return SwitchModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SwitchModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SwitchMode +// switchModeRequest writes a SwitchMode request to a byte slice. func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { size := 8 b := 0 @@ -891,29 +891,31 @@ func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { return buf } -// Request GetMonitor -// size: 8 +// GetMonitorCookie is a cookie used only for GetMonitor requests. type GetMonitorCookie struct { *xgb.Cookie } +// GetMonitor sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMonitorRequest(c, Screen), cookie) return GetMonitorCookie{cookie} } +// GetMonitorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMonitorRequest(c, Screen), cookie) return GetMonitorCookie{cookie} } -// Request reply for GetMonitor -// size: (((((32 + xgb.Pad((int(NumHsync) * 4))) + xgb.Pad((int(NumVsync) * 4))) + xgb.Pad((int(VendorLength) * 1))) + xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1))) + xgb.Pad((int(ModelLength) * 1))) +// GetMonitorReply represents the data returned from a GetMonitor request. type GetMonitorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes VendorLength byte ModelLength byte @@ -927,7 +929,7 @@ type GetMonitorReply struct { Model string // size: xgb.Pad((int(ModelLength) * 1)) } -// Waits and reads reply data from request GetMonitor +// Reply blocks and returns the reply data for a GetMonitor request. func (cook GetMonitorCookie) Reply() (*GetMonitorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -939,7 +941,7 @@ func (cook GetMonitorCookie) Reply() (*GetMonitorReply, error) { return getMonitorReply(buf), nil } -// Read reply into structure from buffer for GetMonitor +// getMonitorReply reads a byte slice into a GetMonitorReply value. func getMonitorReply(buf []byte) *GetMonitorReply { v := new(GetMonitorReply) b := 1 // skip reply determinant @@ -1002,6 +1004,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply { } // Write request to wire for GetMonitor +// getMonitorRequest writes a GetMonitor request to a byte slice. func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -1024,30 +1027,35 @@ func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request LockModeSwitch -// size: 8 +// LockModeSwitchCookie is a cookie used only for LockModeSwitch requests. type LockModeSwitchCookie struct { *xgb.Cookie } -// Write request to wire for LockModeSwitch +// LockModeSwitch sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { cookie := c.NewCookie(false, false) c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) return LockModeSwitchCookie{cookie} } +// LockModeSwitchChecked sends a checked request. +// If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { cookie := c.NewCookie(true, false) c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) return LockModeSwitchCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook LockModeSwitchCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for LockModeSwitch +// lockModeSwitchRequest writes a LockModeSwitch request to a byte slice. func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { size := 8 b := 0 @@ -1071,36 +1079,38 @@ func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { return buf } -// Request GetAllModeLines -// size: 8 +// GetAllModeLinesCookie is a cookie used only for GetAllModeLines requests. type GetAllModeLinesCookie struct { *xgb.Cookie } +// GetAllModeLines sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) return GetAllModeLinesCookie{cookie} } +// GetAllModeLinesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) return GetAllModeLinesCookie{cookie} } -// Request reply for GetAllModeLines -// size: (32 + xgb.Pad((int(Modecount) * 48))) +// GetAllModeLinesReply represents the data returned from a GetAllModeLines request. type GetAllModeLinesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Modecount uint32 // padding: 20 bytes Modeinfo []ModeInfo // size: xgb.Pad((int(Modecount) * 48)) } -// Waits and reads reply data from request GetAllModeLines +// Reply blocks and returns the reply data for a GetAllModeLines request. func (cook GetAllModeLinesCookie) Reply() (*GetAllModeLinesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1112,7 +1122,7 @@ func (cook GetAllModeLinesCookie) Reply() (*GetAllModeLinesReply, error) { return getAllModeLinesReply(buf), nil } -// Read reply into structure from buffer for GetAllModeLines +// getAllModeLinesReply reads a byte slice into a GetAllModeLinesReply value. func getAllModeLinesReply(buf []byte) *GetAllModeLinesReply { v := new(GetAllModeLinesReply) b := 1 // skip reply determinant @@ -1137,6 +1147,7 @@ func getAllModeLinesReply(buf []byte) *GetAllModeLinesReply { } // Write request to wire for GetAllModeLines +// getAllModeLinesRequest writes a GetAllModeLines request to a byte slice. func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -1159,30 +1170,35 @@ func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request AddModeLine -// size: xgb.Pad((92 + xgb.Pad((int(Privsize) * 1)))) +// AddModeLineCookie is a cookie used only for AddModeLine requests. type AddModeLineCookie struct { *xgb.Cookie } -// Write request to wire for AddModeLine +// AddModeLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { cookie := c.NewCookie(false, false) c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) return AddModeLineCookie{cookie} } +// AddModeLineChecked sends a checked request. +// If an error occurs, it can be retrieved using AddModeLineCookie.Check() func AddModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { cookie := c.NewCookie(true, false) c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) return AddModeLineCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AddModeLineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AddModeLine +// addModeLineRequest writes a AddModeLine request to a byte slice. func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) []byte { size := xgb.Pad((92 + xgb.Pad((int(Privsize) * 1)))) b := 0 @@ -1283,30 +1299,35 @@ func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay return buf } -// Request DeleteModeLine -// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +// DeleteModeLineCookie is a cookie used only for DeleteModeLine requests. type DeleteModeLineCookie struct { *xgb.Cookie } -// Write request to wire for DeleteModeLine +// DeleteModeLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { cookie := c.NewCookie(false, false) c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return DeleteModeLineCookie{cookie} } +// DeleteModeLineChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteModeLineCookie.Check() func DeleteModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { cookie := c.NewCookie(true, false) c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return DeleteModeLineCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeleteModeLineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteModeLine +// deleteModeLineRequest writes a DeleteModeLine request to a byte slice. func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) b := 0 @@ -1370,35 +1391,37 @@ func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdispl return buf } -// Request ValidateModeLine -// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +// ValidateModeLineCookie is a cookie used only for ValidateModeLine requests. type ValidateModeLineCookie struct { *xgb.Cookie } +// ValidateModeLine sends a checked request. +// If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { cookie := c.NewCookie(true, true) c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ValidateModeLineCookie{cookie} } +// ValidateModeLineUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { cookie := c.NewCookie(false, true) c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ValidateModeLineCookie{cookie} } -// Request reply for ValidateModeLine -// size: 32 +// ValidateModeLineReply represents the data returned from a ValidateModeLine request. type ValidateModeLineReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status uint32 // padding: 20 bytes } -// Waits and reads reply data from request ValidateModeLine +// Reply blocks and returns the reply data for a ValidateModeLine request. func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1410,7 +1433,7 @@ func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { return validateModeLineReply(buf), nil } -// Read reply into structure from buffer for ValidateModeLine +// validateModeLineReply reads a byte slice into a ValidateModeLineReply value. func validateModeLineReply(buf []byte) *ValidateModeLineReply { v := new(ValidateModeLineReply) b := 1 // skip reply determinant @@ -1432,6 +1455,7 @@ func validateModeLineReply(buf []byte) *ValidateModeLineReply { } // Write request to wire for ValidateModeLine +// validateModeLineRequest writes a ValidateModeLine request to a byte slice. func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) b := 0 @@ -1495,30 +1519,35 @@ func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdis return buf } -// Request SwitchToMode -// size: xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) +// SwitchToModeCookie is a cookie used only for SwitchToMode requests. type SwitchToModeCookie struct { *xgb.Cookie } -// Write request to wire for SwitchToMode +// SwitchToMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return SwitchToModeCookie{cookie} } +// SwitchToModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SwitchToModeCookie.Check() func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return SwitchToModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SwitchToModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SwitchToMode +// switchToModeRequest writes a SwitchToMode request to a byte slice. func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) b := 0 @@ -1582,36 +1611,38 @@ func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay return buf } -// Request GetViewPort -// size: 8 +// GetViewPortCookie is a cookie used only for GetViewPort requests. type GetViewPortCookie struct { *xgb.Cookie } +// GetViewPort sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { cookie := c.NewCookie(true, true) c.NewRequest(getViewPortRequest(c, Screen), cookie) return GetViewPortCookie{cookie} } +// GetViewPortUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { cookie := c.NewCookie(false, true) c.NewRequest(getViewPortRequest(c, Screen), cookie) return GetViewPortCookie{cookie} } -// Request reply for GetViewPort -// size: 32 +// GetViewPortReply represents the data returned from a GetViewPort request. type GetViewPortReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes X uint32 Y uint32 // padding: 16 bytes } -// Waits and reads reply data from request GetViewPort +// Reply blocks and returns the reply data for a GetViewPort request. func (cook GetViewPortCookie) Reply() (*GetViewPortReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1623,7 +1654,7 @@ func (cook GetViewPortCookie) Reply() (*GetViewPortReply, error) { return getViewPortReply(buf), nil } -// Read reply into structure from buffer for GetViewPort +// getViewPortReply reads a byte slice into a GetViewPortReply value. func getViewPortReply(buf []byte) *GetViewPortReply { v := new(GetViewPortReply) b := 1 // skip reply determinant @@ -1648,6 +1679,7 @@ func getViewPortReply(buf []byte) *GetViewPortReply { } // Write request to wire for GetViewPort +// getViewPortRequest writes a GetViewPort request to a byte slice. func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -1670,30 +1702,35 @@ func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request SetViewPort -// size: 16 +// SetViewPortCookie is a cookie used only for SetViewPort requests. type SetViewPortCookie struct { *xgb.Cookie } -// Write request to wire for SetViewPort +// SetViewPort sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { cookie := c.NewCookie(false, false) c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) return SetViewPortCookie{cookie} } +// SetViewPortChecked sends a checked request. +// If an error occurs, it can be retrieved using SetViewPortCookie.Check() func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { cookie := c.NewCookie(true, false) c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) return SetViewPortCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetViewPortCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetViewPort +// setViewPortRequest writes a SetViewPort request to a byte slice. func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { size := 16 b := 0 @@ -1722,29 +1759,31 @@ func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { return buf } -// Request GetDotClocks -// size: 8 +// GetDotClocksCookie is a cookie used only for GetDotClocks requests. type GetDotClocksCookie struct { *xgb.Cookie } +// GetDotClocks sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDotClocksCookie.Reply() func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDotClocksRequest(c, Screen), cookie) return GetDotClocksCookie{cookie} } +// GetDotClocksUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDotClocksUnchecked(c *xgb.Conn, Screen uint16) GetDotClocksCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDotClocksRequest(c, Screen), cookie) return GetDotClocksCookie{cookie} } -// Request reply for GetDotClocks -// size: (32 + xgb.Pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4))) +// GetDotClocksReply represents the data returned from a GetDotClocks request. type GetDotClocksReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Flags uint32 Clocks uint32 @@ -1753,7 +1792,7 @@ type GetDotClocksReply struct { Clock []uint32 // size: xgb.Pad((((1 - (int(Flags) & 1)) * int(Clocks)) * 4)) } -// Waits and reads reply data from request GetDotClocks +// Reply blocks and returns the reply data for a GetDotClocks request. func (cook GetDotClocksCookie) Reply() (*GetDotClocksReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1765,7 +1804,7 @@ func (cook GetDotClocksCookie) Reply() (*GetDotClocksReply, error) { return getDotClocksReply(buf), nil } -// Read reply into structure from buffer for GetDotClocks +// getDotClocksReply reads a byte slice into a GetDotClocksReply value. func getDotClocksReply(buf []byte) *GetDotClocksReply { v := new(GetDotClocksReply) b := 1 // skip reply determinant @@ -1800,6 +1839,7 @@ func getDotClocksReply(buf []byte) *GetDotClocksReply { } // Write request to wire for GetDotClocks +// getDotClocksRequest writes a GetDotClocks request to a byte slice. func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -1822,30 +1862,35 @@ func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request SetClientVersion -// size: 8 +// SetClientVersionCookie is a cookie used only for SetClientVersion requests. type SetClientVersionCookie struct { *xgb.Cookie } -// Write request to wire for SetClientVersion +// SetClientVersion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { cookie := c.NewCookie(false, false) c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) return SetClientVersionCookie{cookie} } +// SetClientVersionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientVersionCookie.Check() func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) return SetClientVersionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetClientVersionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetClientVersion +// setClientVersionRequest writes a SetClientVersion request to a byte slice. func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { size := 8 b := 0 @@ -1869,30 +1914,35 @@ func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { return buf } -// Request SetGamma -// size: 32 +// SetGammaCookie is a cookie used only for SetGamma requests. type SetGammaCookie struct { *xgb.Cookie } -// Write request to wire for SetGamma +// SetGamma sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { cookie := c.NewCookie(false, false) c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) return SetGammaCookie{cookie} } +// SetGammaChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGammaCookie.Check() func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { cookie := c.NewCookie(true, false) c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) return SetGammaCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetGammaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetGamma +// setGammaRequest writes a SetGamma request to a byte slice. func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { size := 32 b := 0 @@ -1926,29 +1976,31 @@ func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue return buf } -// Request GetGamma -// size: 32 +// GetGammaCookie is a cookie used only for GetGamma requests. type GetGammaCookie struct { *xgb.Cookie } +// GetGamma sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGammaCookie.Reply() func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { cookie := c.NewCookie(true, true) c.NewRequest(getGammaRequest(c, Screen), cookie) return GetGammaCookie{cookie} } +// GetGammaUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaUnchecked(c *xgb.Conn, Screen uint16) GetGammaCookie { cookie := c.NewCookie(false, true) c.NewRequest(getGammaRequest(c, Screen), cookie) return GetGammaCookie{cookie} } -// Request reply for GetGamma -// size: 32 +// GetGammaReply represents the data returned from a GetGamma request. type GetGammaReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Red uint32 Green uint32 @@ -1956,7 +2008,7 @@ type GetGammaReply struct { // padding: 12 bytes } -// Waits and reads reply data from request GetGamma +// Reply blocks and returns the reply data for a GetGamma request. func (cook GetGammaCookie) Reply() (*GetGammaReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1968,7 +2020,7 @@ func (cook GetGammaCookie) Reply() (*GetGammaReply, error) { return getGammaReply(buf), nil } -// Read reply into structure from buffer for GetGamma +// getGammaReply reads a byte slice into a GetGammaReply value. func getGammaReply(buf []byte) *GetGammaReply { v := new(GetGammaReply) b := 1 // skip reply determinant @@ -1996,6 +2048,7 @@ func getGammaReply(buf []byte) *GetGammaReply { } // Write request to wire for GetGamma +// getGammaRequest writes a GetGamma request to a byte slice. func getGammaRequest(c *xgb.Conn, Screen uint16) []byte { size := 32 b := 0 @@ -2018,29 +2071,31 @@ func getGammaRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request GetGammaRamp -// size: 8 +// GetGammaRampCookie is a cookie used only for GetGammaRamp requests. type GetGammaRampCookie struct { *xgb.Cookie } +// GetGammaRamp sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGammaRampCookie.Reply() func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { cookie := c.NewCookie(true, true) c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) return GetGammaRampCookie{cookie} } +// GetGammaRampUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampUnchecked(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { cookie := c.NewCookie(false, true) c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) return GetGammaRampCookie{cookie} } -// Request reply for GetGammaRamp -// size: (((32 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) +// GetGammaRampReply represents the data returned from a GetGammaRamp request. type GetGammaRampReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Size uint16 // padding: 22 bytes @@ -2049,7 +2104,7 @@ type GetGammaRampReply struct { Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) } -// Waits and reads reply data from request GetGammaRamp +// Reply blocks and returns the reply data for a GetGammaRamp request. func (cook GetGammaRampCookie) Reply() (*GetGammaRampReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2061,7 +2116,7 @@ func (cook GetGammaRampCookie) Reply() (*GetGammaRampReply, error) { return getGammaRampReply(buf), nil } -// Read reply into structure from buffer for GetGammaRamp +// getGammaRampReply reads a byte slice into a GetGammaRampReply value. func getGammaRampReply(buf []byte) *GetGammaRampReply { v := new(GetGammaRampReply) b := 1 // skip reply determinant @@ -2104,6 +2159,7 @@ func getGammaRampReply(buf []byte) *GetGammaRampReply { } // Write request to wire for GetGammaRamp +// getGammaRampRequest writes a GetGammaRamp request to a byte slice. func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { size := 8 b := 0 @@ -2127,30 +2183,35 @@ func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { return buf } -// Request SetGammaRamp -// size: xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) +// SetGammaRampCookie is a cookie used only for SetGammaRamp requests. type SetGammaRampCookie struct { *xgb.Cookie } -// Write request to wire for SetGammaRamp +// SetGammaRamp sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { cookie := c.NewCookie(false, false) c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) return SetGammaRampCookie{cookie} } +// SetGammaRampChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGammaRampCookie.Check() func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { cookie := c.NewCookie(true, false) c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) return SetGammaRampCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetGammaRampCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetGammaRamp +// setGammaRampRequest writes a SetGammaRamp request to a byte slice. func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) b := 0 @@ -2192,35 +2253,37 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, return buf } -// Request GetGammaRampSize -// size: 8 +// GetGammaRampSizeCookie is a cookie used only for GetGammaRampSize requests. type GetGammaRampSizeCookie struct { *xgb.Cookie } +// GetGammaRampSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGammaRampSizeCookie.Reply() func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) return GetGammaRampSizeCookie{cookie} } +// GetGammaRampSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampSizeUnchecked(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) return GetGammaRampSizeCookie{cookie} } -// Request reply for GetGammaRampSize -// size: 32 +// GetGammaRampSizeReply represents the data returned from a GetGammaRampSize request. type GetGammaRampSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Size uint16 // padding: 22 bytes } -// Waits and reads reply data from request GetGammaRampSize +// Reply blocks and returns the reply data for a GetGammaRampSize request. func (cook GetGammaRampSizeCookie) Reply() (*GetGammaRampSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2232,7 +2295,7 @@ func (cook GetGammaRampSizeCookie) Reply() (*GetGammaRampSizeReply, error) { return getGammaRampSizeReply(buf), nil } -// Read reply into structure from buffer for GetGammaRampSize +// getGammaRampSizeReply reads a byte slice into a GetGammaRampSizeReply value. func getGammaRampSizeReply(buf []byte) *GetGammaRampSizeReply { v := new(GetGammaRampSizeReply) b := 1 // skip reply determinant @@ -2254,6 +2317,7 @@ func getGammaRampSizeReply(buf []byte) *GetGammaRampSizeReply { } // Write request to wire for GetGammaRampSize +// getGammaRampSizeRequest writes a GetGammaRampSize request to a byte slice. func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 @@ -2276,35 +2340,37 @@ func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// Request GetPermissions -// size: 8 +// GetPermissionsCookie is a cookie used only for GetPermissions requests. type GetPermissionsCookie struct { *xgb.Cookie } +// GetPermissions sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPermissionsCookie.Reply() func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPermissionsRequest(c, Screen), cookie) return GetPermissionsCookie{cookie} } +// GetPermissionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPermissionsUnchecked(c *xgb.Conn, Screen uint16) GetPermissionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPermissionsRequest(c, Screen), cookie) return GetPermissionsCookie{cookie} } -// Request reply for GetPermissions -// size: 32 +// GetPermissionsReply represents the data returned from a GetPermissions request. type GetPermissionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Permissions uint32 // padding: 20 bytes } -// Waits and reads reply data from request GetPermissions +// Reply blocks and returns the reply data for a GetPermissions request. func (cook GetPermissionsCookie) Reply() (*GetPermissionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2316,7 +2382,7 @@ func (cook GetPermissionsCookie) Reply() (*GetPermissionsReply, error) { return getPermissionsReply(buf), nil } -// Read reply into structure from buffer for GetPermissions +// getPermissionsReply reads a byte slice into a GetPermissionsReply value. func getPermissionsReply(buf []byte) *GetPermissionsReply { v := new(GetPermissionsReply) b := 1 // skip reply determinant @@ -2338,6 +2404,7 @@ func getPermissionsReply(buf []byte) *GetPermissionsReply { } // Write request to wire for GetPermissions +// getPermissionsRequest writes a GetPermissions request to a byte slice. func getPermissionsRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 3b6bbea..b5d9c14 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xfixes.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -42,16 +42,6 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -66,6 +56,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 @@ -115,9 +115,7 @@ func NewRegionId(c *xgb.Conn) (Region, error) { return Region(id), nil } -// Event definition SelectionNotify (0) -// Size: 32 - +// SelectionNotify is the event number for a SelectionNotifyEvent. const SelectionNotify = 0 type SelectionNotifyEvent struct { @@ -131,7 +129,7 @@ type SelectionNotifyEvent struct { // padding: 8 bytes } -// Event read SelectionNotify +// SelectionNotifyEventNew constructs a SelectionNotifyEvent value that implements xgb.Event from a byte slice. func SelectionNotifyEventNew(buf []byte) xgb.Event { v := SelectionNotifyEvent{} b := 1 // don't read event number @@ -162,7 +160,7 @@ func SelectionNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionNotify +// Bytes writes a SelectionNotifyEvent value to a byte slice. func (v SelectionNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -196,12 +194,14 @@ func (v SelectionNotifyEvent) Bytes() []byte { return buf } -func (v SelectionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionNotifyEvent. func (v SelectionNotifyEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -218,9 +218,7 @@ func init() { xgb.NewExtEventFuncs["XFIXES"][0] = SelectionNotifyEventNew } -// Event definition CursorNotify (1) -// Size: 32 - +// CursorNotify is the event number for a CursorNotifyEvent. const CursorNotify = 1 type CursorNotifyEvent struct { @@ -233,7 +231,7 @@ type CursorNotifyEvent struct { // padding: 12 bytes } -// Event read CursorNotify +// CursorNotifyEventNew constructs a CursorNotifyEvent value that implements xgb.Event from a byte slice. func CursorNotifyEventNew(buf []byte) xgb.Event { v := CursorNotifyEvent{} b := 1 // don't read event number @@ -261,7 +259,7 @@ func CursorNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CursorNotify +// Bytes writes a CursorNotifyEvent value to a byte slice. func (v CursorNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -292,12 +290,14 @@ func (v CursorNotifyEvent) Bytes() []byte { return buf } -func (v CursorNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CursorNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CursorNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CursorNotifyEvent. func (v CursorNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -313,9 +313,7 @@ func init() { xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew } -// Error definition BadRegion (0) -// Size: 32 - +// BadBadRegion is the error number for a BadBadRegion. const BadBadRegion = 0 type BadRegionError struct { @@ -323,7 +321,7 @@ type BadRegionError struct { NiceName string } -// Error read BadRegion +// BadRegionErrorNew constructs a BadRegionError value that implements xgb.Error from a byte slice. func BadRegionErrorNew(buf []byte) xgb.Error { v := BadRegionError{} v.NiceName = "BadRegion" @@ -337,8 +335,8 @@ func BadRegionErrorNew(buf []byte) xgb.Error { return v } -func (err BadRegionError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadRegion error. +// This is mostly used internally. func (err BadRegionError) SequenceId() uint16 { return err.Sequence } @@ -358,36 +356,38 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"][0] = BadRegionErrorNew } -// Request QueryVersion -// size: 12 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 32 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint32 MinorVersion uint32 // padding: 16 bytes } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -399,7 +399,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -424,6 +424,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { size := 12 b := 0 @@ -447,30 +448,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers return buf } -// Request ChangeSaveSet -// size: 12 +// ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. type ChangeSaveSetCookie struct { *xgb.Cookie } -// Write request to wire for ChangeSaveSet +// ChangeSaveSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) return ChangeSaveSetCookie{cookie} } +// ChangeSaveSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) return ChangeSaveSetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeSaveSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeSaveSet +// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. func changeSaveSetRequest(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) []byte { size := 12 b := 0 @@ -502,30 +508,35 @@ func changeSaveSetRequest(c *xgb.Conn, Mode byte, Target byte, Map byte, Window return buf } -// Request SelectSelectionInput -// size: 16 +// SelectSelectionInputCookie is a cookie used only for SelectSelectionInput requests. type SelectSelectionInputCookie struct { *xgb.Cookie } -// Write request to wire for SelectSelectionInput +// SelectSelectionInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) return SelectSelectionInputCookie{cookie} } +// SelectSelectionInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectSelectionInputCookie.Check() func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) return SelectSelectionInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectSelectionInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectSelectionInput +// selectSelectionInputRequest writes a SelectSelectionInput request to a byte slice. func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) []byte { size := 16 b := 0 @@ -552,30 +563,35 @@ func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xp return buf } -// Request SelectCursorInput -// size: 12 +// SelectCursorInputCookie is a cookie used only for SelectCursorInput requests. type SelectCursorInputCookie struct { *xgb.Cookie } -// Write request to wire for SelectCursorInput +// SelectCursorInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) return SelectCursorInputCookie{cookie} } +// SelectCursorInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectCursorInputCookie.Check() func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) return SelectCursorInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectCursorInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectCursorInput +// selectCursorInputRequest writes a SelectCursorInput request to a byte slice. func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint32) []byte { size := 12 b := 0 @@ -599,29 +615,31 @@ func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint3 return buf } -// Request GetCursorImage -// size: 4 +// GetCursorImageCookie is a cookie used only for GetCursorImage requests. type GetCursorImageCookie struct { *xgb.Cookie } +// GetCursorImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCursorImageCookie.Reply() func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCursorImageRequest(c), cookie) return GetCursorImageCookie{cookie} } +// GetCursorImageUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageUnchecked(c *xgb.Conn) GetCursorImageCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCursorImageRequest(c), cookie) return GetCursorImageCookie{cookie} } -// Request reply for GetCursorImage -// size: (32 + xgb.Pad(((int(Width) * int(Height)) * 4))) +// GetCursorImageReply represents the data returned from a GetCursorImage request. type GetCursorImageReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes X int16 Y int16 @@ -634,7 +652,7 @@ type GetCursorImageReply struct { CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) } -// Waits and reads reply data from request GetCursorImage +// Reply blocks and returns the reply data for a GetCursorImage request. func (cook GetCursorImageCookie) Reply() (*GetCursorImageReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -646,7 +664,7 @@ func (cook GetCursorImageCookie) Reply() (*GetCursorImageReply, error) { return getCursorImageReply(buf), nil } -// Read reply into structure from buffer for GetCursorImage +// getCursorImageReply reads a byte slice into a GetCursorImageReply value. func getCursorImageReply(buf []byte) *GetCursorImageReply { v := new(GetCursorImageReply) b := 1 // skip reply determinant @@ -693,6 +711,7 @@ func getCursorImageReply(buf []byte) *GetCursorImageReply { } // Write request to wire for GetCursorImage +// getCursorImageRequest writes a GetCursorImage request to a byte slice. func getCursorImageRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -710,30 +729,35 @@ func getCursorImageRequest(c *xgb.Conn) []byte { return buf } -// Request CreateRegion -// size: xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) +// CreateRegionCookie is a cookie used only for CreateRegion requests. type CreateRegionCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegion +// CreateRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) return CreateRegionCookie{cookie} } +// CreateRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionCookie.Check() func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) return CreateRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegion +// createRegionRequest writes a CreateRegion request to a byte slice. func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -756,30 +780,35 @@ func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectang return buf } -// Request CreateRegionFromBitmap -// size: 12 +// CreateRegionFromBitmapCookie is a cookie used only for CreateRegionFromBitmap requests. type CreateRegionFromBitmapCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegionFromBitmap +// CreateRegionFromBitmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) return CreateRegionFromBitmapCookie{cookie} } +// CreateRegionFromBitmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromBitmapCookie.Check() func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) return CreateRegionFromBitmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionFromBitmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegionFromBitmap +// createRegionFromBitmapRequest writes a CreateRegionFromBitmap request to a byte slice. func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) []byte { size := 12 b := 0 @@ -803,30 +832,35 @@ func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pix return buf } -// Request CreateRegionFromWindow -// size: 16 +// CreateRegionFromWindowCookie is a cookie used only for CreateRegionFromWindow requests. type CreateRegionFromWindowCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegionFromWindow +// CreateRegionFromWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) return CreateRegionFromWindowCookie{cookie} } +// CreateRegionFromWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromWindowCookie.Check() func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) return CreateRegionFromWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionFromWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegionFromWindow +// createRegionFromWindowRequest writes a CreateRegionFromWindow request to a byte slice. func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) []byte { size := 16 b := 0 @@ -855,30 +889,35 @@ func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Win return buf } -// Request CreateRegionFromGC -// size: 12 +// CreateRegionFromGCCookie is a cookie used only for CreateRegionFromGC requests. type CreateRegionFromGCCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegionFromGC +// CreateRegionFromGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) return CreateRegionFromGCCookie{cookie} } +// CreateRegionFromGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromGCCookie.Check() func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) return CreateRegionFromGCCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionFromGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegionFromGC +// createRegionFromGCRequest writes a CreateRegionFromGC request to a byte slice. func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) []byte { size := 12 b := 0 @@ -902,30 +941,35 @@ func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) [ return buf } -// Request CreateRegionFromPicture -// size: 12 +// CreateRegionFromPictureCookie is a cookie used only for CreateRegionFromPicture requests. type CreateRegionFromPictureCookie struct { *xgb.Cookie } -// Write request to wire for CreateRegionFromPicture +// CreateRegionFromPicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) return CreateRegionFromPictureCookie{cookie} } +// CreateRegionFromPictureChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromPictureCookie.Check() func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) return CreateRegionFromPictureCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateRegionFromPictureCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateRegionFromPicture +// createRegionFromPictureRequest writes a CreateRegionFromPicture request to a byte slice. func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.Picture) []byte { size := 12 b := 0 @@ -949,30 +993,35 @@ func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.P return buf } -// Request DestroyRegion -// size: 8 +// DestroyRegionCookie is a cookie used only for DestroyRegion requests. type DestroyRegionCookie struct { *xgb.Cookie } -// Write request to wire for DestroyRegion +// DestroyRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyRegionRequest(c, Region), cookie) return DestroyRegionCookie{cookie} } +// DestroyRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyRegionCookie.Check() func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyRegionRequest(c, Region), cookie) return DestroyRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyRegion +// destroyRegionRequest writes a DestroyRegion request to a byte slice. func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { size := 8 b := 0 @@ -993,30 +1042,35 @@ func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { return buf } -// Request SetRegion -// size: xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) +// SetRegionCookie is a cookie used only for SetRegion requests. type SetRegionCookie struct { *xgb.Cookie } -// Write request to wire for SetRegion +// SetRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) return SetRegionCookie{cookie} } +// SetRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetRegionCookie.Check() func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) return SetRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetRegion +// setRegionRequest writes a SetRegion request to a byte slice. func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -1039,30 +1093,35 @@ func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) return buf } -// Request CopyRegion -// size: 12 +// CopyRegionCookie is a cookie used only for CopyRegion requests. type CopyRegionCookie struct { *xgb.Cookie } -// Write request to wire for CopyRegion +// CopyRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) return CopyRegionCookie{cookie} } +// CopyRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyRegionCookie.Check() func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) return CopyRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyRegion +// copyRegionRequest writes a CopyRegion request to a byte slice. func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { size := 12 b := 0 @@ -1086,30 +1145,35 @@ func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { return buf } -// Request UnionRegion -// size: 16 +// UnionRegionCookie is a cookie used only for UnionRegion requests. type UnionRegionCookie struct { *xgb.Cookie } -// Write request to wire for UnionRegion +// UnionRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) return UnionRegionCookie{cookie} } +// UnionRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using UnionRegionCookie.Check() func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) return UnionRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnionRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnionRegion +// unionRegionRequest writes a UnionRegion request to a byte slice. func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { size := 16 b := 0 @@ -1136,30 +1200,35 @@ func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination return buf } -// Request IntersectRegion -// size: 16 +// IntersectRegionCookie is a cookie used only for IntersectRegion requests. type IntersectRegionCookie struct { *xgb.Cookie } -// Write request to wire for IntersectRegion +// IntersectRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) return IntersectRegionCookie{cookie} } +// IntersectRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using IntersectRegionCookie.Check() func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) return IntersectRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook IntersectRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for IntersectRegion +// intersectRegionRequest writes a IntersectRegion request to a byte slice. func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { size := 16 b := 0 @@ -1186,30 +1255,35 @@ func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destina return buf } -// Request SubtractRegion -// size: 16 +// SubtractRegionCookie is a cookie used only for SubtractRegion requests. type SubtractRegionCookie struct { *xgb.Cookie } -// Write request to wire for SubtractRegion +// SubtractRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) return SubtractRegionCookie{cookie} } +// SubtractRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SubtractRegionCookie.Check() func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) return SubtractRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SubtractRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SubtractRegion +// subtractRegionRequest writes a SubtractRegion request to a byte slice. func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { size := 16 b := 0 @@ -1236,30 +1310,35 @@ func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destinat return buf } -// Request InvertRegion -// size: 20 +// InvertRegionCookie is a cookie used only for InvertRegion requests. type InvertRegionCookie struct { *xgb.Cookie } -// Write request to wire for InvertRegion +// InvertRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) return InvertRegionCookie{cookie} } +// InvertRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using InvertRegionCookie.Check() func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) return InvertRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook InvertRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for InvertRegion +// invertRegionRequest writes a InvertRegion request to a byte slice. func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) []byte { size := 20 b := 0 @@ -1289,30 +1368,35 @@ func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, De return buf } -// Request TranslateRegion -// size: 12 +// TranslateRegionCookie is a cookie used only for TranslateRegion requests. type TranslateRegionCookie struct { *xgb.Cookie } -// Write request to wire for TranslateRegion +// TranslateRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) return TranslateRegionCookie{cookie} } +// TranslateRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using TranslateRegionCookie.Check() func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) return TranslateRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook TranslateRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for TranslateRegion +// translateRegionRequest writes a TranslateRegion request to a byte slice. func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []byte { size := 12 b := 0 @@ -1339,30 +1423,35 @@ func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []by return buf } -// Request RegionExtents -// size: 12 +// RegionExtentsCookie is a cookie used only for RegionExtents requests. type RegionExtentsCookie struct { *xgb.Cookie } -// Write request to wire for RegionExtents +// RegionExtents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { cookie := c.NewCookie(false, false) c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) return RegionExtentsCookie{cookie} } +// RegionExtentsChecked sends a checked request. +// If an error occurs, it can be retrieved using RegionExtentsCookie.Check() func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { cookie := c.NewCookie(true, false) c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) return RegionExtentsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RegionExtentsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RegionExtents +// regionExtentsRequest writes a RegionExtents request to a byte slice. func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte { size := 12 b := 0 @@ -1386,36 +1475,38 @@ func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte return buf } -// Request FetchRegion -// size: 8 +// FetchRegionCookie is a cookie used only for FetchRegion requests. type FetchRegionCookie struct { *xgb.Cookie } +// FetchRegion sends a checked request. +// If an error occurs, it will be returned with the reply by calling FetchRegionCookie.Reply() func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { cookie := c.NewCookie(true, true) c.NewRequest(fetchRegionRequest(c, Region), cookie) return FetchRegionCookie{cookie} } +// FetchRegionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { cookie := c.NewCookie(false, true) c.NewRequest(fetchRegionRequest(c, Region), cookie) return FetchRegionCookie{cookie} } -// Request reply for FetchRegion -// size: (32 + xgb.Pad(((int(Length) / 2) * 8))) +// FetchRegionReply represents the data returned from a FetchRegion request. type FetchRegionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Extents xproto.Rectangle // padding: 16 bytes Rectangles []xproto.Rectangle // size: xgb.Pad(((int(Length) / 2) * 8)) } -// Waits and reads reply data from request FetchRegion +// Reply blocks and returns the reply data for a FetchRegion request. func (cook FetchRegionCookie) Reply() (*FetchRegionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1427,7 +1518,7 @@ func (cook FetchRegionCookie) Reply() (*FetchRegionReply, error) { return fetchRegionReply(buf), nil } -// Read reply into structure from buffer for FetchRegion +// fetchRegionReply reads a byte slice into a FetchRegionReply value. func fetchRegionReply(buf []byte) *FetchRegionReply { v := new(FetchRegionReply) b := 1 // skip reply determinant @@ -1452,6 +1543,7 @@ func fetchRegionReply(buf []byte) *FetchRegionReply { } // Write request to wire for FetchRegion +// fetchRegionRequest writes a FetchRegion request to a byte slice. func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { size := 8 b := 0 @@ -1472,30 +1564,35 @@ func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { return buf } -// Request SetGCClipRegion -// size: 16 +// SetGCClipRegionCookie is a cookie used only for SetGCClipRegion requests. type SetGCClipRegionCookie struct { *xgb.Cookie } -// Write request to wire for SetGCClipRegion +// SetGCClipRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) return SetGCClipRegionCookie{cookie} } +// SetGCClipRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGCClipRegionCookie.Check() func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) return SetGCClipRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetGCClipRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetGCClipRegion +// setGCClipRegionRequest writes a SetGCClipRegion request to a byte slice. func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) []byte { size := 16 b := 0 @@ -1525,30 +1622,35 @@ func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOri return buf } -// Request SetWindowShapeRegion -// size: 20 +// SetWindowShapeRegionCookie is a cookie used only for SetWindowShapeRegion requests. type SetWindowShapeRegionCookie struct { *xgb.Cookie } -// Write request to wire for SetWindowShapeRegion +// SetWindowShapeRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) return SetWindowShapeRegionCookie{cookie} } +// SetWindowShapeRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetWindowShapeRegionCookie.Check() func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) return SetWindowShapeRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetWindowShapeRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetWindowShapeRegion +// setWindowShapeRegionRequest writes a SetWindowShapeRegion request to a byte slice. func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) []byte { size := 20 b := 0 @@ -1583,30 +1685,35 @@ func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape return buf } -// Request SetPictureClipRegion -// size: 16 +// SetPictureClipRegionCookie is a cookie used only for SetPictureClipRegion requests. type SetPictureClipRegionCookie struct { *xgb.Cookie } -// Write request to wire for SetPictureClipRegion +// SetPictureClipRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) return SetPictureClipRegionCookie{cookie} } +// SetPictureClipRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureClipRegionCookie.Check() func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) return SetPictureClipRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPictureClipRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPictureClipRegion +// setPictureClipRegionRequest writes a SetPictureClipRegion request to a byte slice. func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) []byte { size := 16 b := 0 @@ -1636,30 +1743,35 @@ func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Reg return buf } -// Request SetCursorName -// size: xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) +// SetCursorNameCookie is a cookie used only for SetCursorName requests. type SetCursorNameCookie struct { *xgb.Cookie } -// Write request to wire for SetCursorName +// SetCursorName sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) return SetCursorNameCookie{cookie} } +// SetCursorNameChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCursorNameCookie.Check() func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) return SetCursorNameCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetCursorNameCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCursorName +// setCursorNameRequest writes a SetCursorName request to a byte slice. func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) b := 0 @@ -1688,29 +1800,31 @@ func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name return buf } -// Request GetCursorName -// size: 8 +// GetCursorNameCookie is a cookie used only for GetCursorName requests. type GetCursorNameCookie struct { *xgb.Cookie } +// GetCursorName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCursorNameCookie.Reply() func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCursorNameRequest(c, Cursor), cookie) return GetCursorNameCookie{cookie} } +// GetCursorNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCursorNameRequest(c, Cursor), cookie) return GetCursorNameCookie{cookie} } -// Request reply for GetCursorName -// size: (32 + xgb.Pad((int(Nbytes) * 1))) +// GetCursorNameReply represents the data returned from a GetCursorName request. type GetCursorNameReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Atom xproto.Atom Nbytes uint16 @@ -1718,7 +1832,7 @@ type GetCursorNameReply struct { Name string // size: xgb.Pad((int(Nbytes) * 1)) } -// Waits and reads reply data from request GetCursorName +// Reply blocks and returns the reply data for a GetCursorName request. func (cook GetCursorNameCookie) Reply() (*GetCursorNameReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1730,7 +1844,7 @@ func (cook GetCursorNameCookie) Reply() (*GetCursorNameReply, error) { return getCursorNameReply(buf), nil } -// Read reply into structure from buffer for GetCursorName +// getCursorNameReply reads a byte slice into a GetCursorNameReply value. func getCursorNameReply(buf []byte) *GetCursorNameReply { v := new(GetCursorNameReply) b := 1 // skip reply determinant @@ -1762,6 +1876,7 @@ func getCursorNameReply(buf []byte) *GetCursorNameReply { } // Write request to wire for GetCursorName +// getCursorNameRequest writes a GetCursorName request to a byte slice. func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { size := 8 b := 0 @@ -1782,29 +1897,31 @@ func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { return buf } -// Request GetCursorImageAndName -// size: 4 +// GetCursorImageAndNameCookie is a cookie used only for GetCursorImageAndName requests. type GetCursorImageAndNameCookie struct { *xgb.Cookie } +// GetCursorImageAndName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCursorImageAndNameCookie.Reply() func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { cookie := c.NewCookie(true, true) c.NewRequest(getCursorImageAndNameRequest(c), cookie) return GetCursorImageAndNameCookie{cookie} } +// GetCursorImageAndNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageAndNameUnchecked(c *xgb.Conn) GetCursorImageAndNameCookie { cookie := c.NewCookie(false, true) c.NewRequest(getCursorImageAndNameRequest(c), cookie) return GetCursorImageAndNameCookie{cookie} } -// Request reply for GetCursorImageAndName -// size: ((32 + xgb.Pad((int(Nbytes) * 1))) + xgb.Pad(((int(Width) * int(Height)) * 4))) +// GetCursorImageAndNameReply represents the data returned from a GetCursorImageAndName request. type GetCursorImageAndNameReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes X int16 Y int16 @@ -1820,7 +1937,7 @@ type GetCursorImageAndNameReply struct { CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) } -// Waits and reads reply data from request GetCursorImageAndName +// Reply blocks and returns the reply data for a GetCursorImageAndName request. func (cook GetCursorImageAndNameCookie) Reply() (*GetCursorImageAndNameReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1832,7 +1949,7 @@ func (cook GetCursorImageAndNameCookie) Reply() (*GetCursorImageAndNameReply, er return getCursorImageAndNameReply(buf), nil } -// Read reply into structure from buffer for GetCursorImageAndName +// getCursorImageAndNameReply reads a byte slice into a GetCursorImageAndNameReply value. func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { v := new(GetCursorImageAndNameReply) b := 1 // skip reply determinant @@ -1892,6 +2009,7 @@ func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { } // Write request to wire for GetCursorImageAndName +// getCursorImageAndNameRequest writes a GetCursorImageAndName request to a byte slice. func getCursorImageAndNameRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1909,30 +2027,35 @@ func getCursorImageAndNameRequest(c *xgb.Conn) []byte { return buf } -// Request ChangeCursor -// size: 12 +// ChangeCursorCookie is a cookie used only for ChangeCursor requests. type ChangeCursorCookie struct { *xgb.Cookie } -// Write request to wire for ChangeCursor +// ChangeCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) return ChangeCursorCookie{cookie} } +// ChangeCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCursorCookie.Check() func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) return ChangeCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeCursor +// changeCursorRequest writes a ChangeCursor request to a byte slice. func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) []byte { size := 12 b := 0 @@ -1956,30 +2079,35 @@ func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.C return buf } -// Request ChangeCursorByName -// size: xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) +// ChangeCursorByNameCookie is a cookie used only for ChangeCursorByName requests. type ChangeCursorByNameCookie struct { *xgb.Cookie } -// Write request to wire for ChangeCursorByName +// ChangeCursorByName sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) return ChangeCursorByNameCookie{cookie} } +// ChangeCursorByNameChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCursorByNameCookie.Check() func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) return ChangeCursorByNameCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeCursorByNameCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeCursorByName +// changeCursorByNameRequest writes a ChangeCursorByName request to a byte slice. func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) b := 0 @@ -2008,30 +2136,35 @@ func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Na return buf } -// Request ExpandRegion -// size: 20 +// ExpandRegionCookie is a cookie used only for ExpandRegion requests. type ExpandRegionCookie struct { *xgb.Cookie } -// Write request to wire for ExpandRegion +// ExpandRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { cookie := c.NewCookie(false, false) c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) return ExpandRegionCookie{cookie} } +// ExpandRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using ExpandRegionCookie.Check() func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { cookie := c.NewCookie(true, false) c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) return ExpandRegionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ExpandRegionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ExpandRegion +// expandRegionRequest writes a ExpandRegion request to a byte slice. func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { size := 20 b := 0 @@ -2067,30 +2200,35 @@ func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left ui return buf } -// Request HideCursor -// size: 8 +// HideCursorCookie is a cookie used only for HideCursor requests. type HideCursorCookie struct { *xgb.Cookie } -// Write request to wire for HideCursor +// HideCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(hideCursorRequest(c, Window), cookie) return HideCursorCookie{cookie} } +// HideCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using HideCursorCookie.Check() func HideCursorChecked(c *xgb.Conn, Window xproto.Window) HideCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(hideCursorRequest(c, Window), cookie) return HideCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook HideCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for HideCursor +// hideCursorRequest writes a HideCursor request to a byte slice. func hideCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -2111,30 +2249,35 @@ func hideCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request ShowCursor -// size: 8 +// ShowCursorCookie is a cookie used only for ShowCursor requests. type ShowCursorCookie struct { *xgb.Cookie } -// Write request to wire for ShowCursor +// ShowCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(showCursorRequest(c, Window), cookie) return ShowCursorCookie{cookie} } +// ShowCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using ShowCursorCookie.Check() func ShowCursorChecked(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(showCursorRequest(c, Window), cookie) return ShowCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ShowCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ShowCursor +// showCursorRequest writes a ShowCursor request to a byte slice. func showCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 75af854..50cfdba 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -118,7 +118,6 @@ func (c *Conn) Close() { // Event is an interface that can contain any of the events returned by the // server. Use a type assertion switch to extract the Event structs. type Event interface { - ImplementsEvent() Bytes() []byte String() string } @@ -141,7 +140,6 @@ var NewExtEventFuncs = make(map[string]map[int]NewEventFun) // Error is an interface that can contain any of the errors returned by // the server. Use a type assertion switch to extract the Error structs. type Error interface { - ImplementsError() SequenceId() uint16 BadId() uint32 Error() string diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index b7721be..81a017b 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -6,9 +6,7 @@ import ( // Error types func (e *Error) Define(c *Context) { - c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number) - c.Putln("// Size: %s", e.Size()) - c.Putln("") + c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst()) c.Putln("const %s = %d", e.ErrConst(), e.Number) c.Putln("") c.Putln("type %s struct {", e.ErrType()) @@ -40,7 +38,8 @@ func (e *Error) Define(c *Context) { } func (e *Error) Read(c *Context) { - c.Putln("// Error read %s", e.SrcName()) + c.Putln("// %sNew constructs a %s value that implements xgb.Error from "+ + "a byte slice.", e.ErrType(), e.ErrType()) c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType()) c.Putln("v := %s{}", e.ErrType()) c.Putln("v.NiceName = \"%s\"", e.SrcName()) @@ -62,8 +61,9 @@ func (e *Error) Read(c *Context) { // ImplementsError writes functions to implement the XGB Error interface. func (e *Error) ImplementsError(c *Context) { - c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) - c.Putln("") + c.Putln("// SequenceId returns the sequence id attached to the %s error.", + e.ErrConst()) + c.Putln("// This is mostly used internally.") c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType()) c.Putln("return err.Sequence") c.Putln("}") @@ -84,8 +84,7 @@ func (e *Error) ImplementsError(c *Context) { // ErrorCopy types func (e *ErrorCopy) Define(c *Context) { - c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number) - c.Putln("") + c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst()) c.Putln("const %s = %d", e.ErrConst(), e.Number) c.Putln("") c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType()) @@ -111,6 +110,8 @@ func (e *ErrorCopy) Define(c *Context) { } func (e *ErrorCopy) Read(c *Context) { + c.Putln("// %sNew constructs a %s value that implements xgb.Error from "+ + "a byte slice.", e.ErrType(), e.ErrType()) c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType()) c.Putln("v := %s(%sNew(buf).(%s))", e.ErrType(), e.Old.(*Error).ErrType(), e.Old.(*Error).ErrType()) @@ -122,8 +123,9 @@ func (e *ErrorCopy) Read(c *Context) { // ImplementsError writes functions to implement the XGB Error interface. func (e *ErrorCopy) ImplementsError(c *Context) { - c.Putln("func (err %s) ImplementsError() { }", e.ErrType()) - c.Putln("") + c.Putln("// SequenceId returns the sequence id attached to the %s error.", + e.ErrConst()) + c.Putln("// This is mostly used internally.") c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType()) c.Putln("return err.Sequence") c.Putln("}") diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index d7ef109..9b5e748 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -6,9 +6,7 @@ import ( // Event types func (e *Event) Define(c *Context) { - c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number) - c.Putln("// Size: %s", e.Size()) - c.Putln("") + c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType()) c.Putln("const %s = %d", e.SrcName(), e.Number) c.Putln("") c.Putln("type %s struct {", e.EvType()) @@ -30,8 +28,10 @@ func (e *Event) Define(c *Context) { e.Write(c) // Makes sure that this event type is an Event interface. - c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) - c.Putln("") + c.Putln("// SequenceId returns the sequence id attached to the %s event.", + e.SrcName()) + c.Putln("// Events without a sequence number (KeymapNotify) return 0.") + c.Putln("// This is mostly used internally.") c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) if e.NoSequence { c.Putln("return uint16(0)") @@ -40,6 +40,8 @@ func (e *Event) Define(c *Context) { } c.Putln("}") c.Putln("") + c.Putln("// String is a rudimentary string representation of %s.", + e.EvType()) c.Putln("func (v %s) String() string {", e.EvType()) EventFieldString(c, e.Fields, e.SrcName()) c.Putln("}") @@ -58,7 +60,8 @@ func (e *Event) Define(c *Context) { } func (e *Event) Read(c *Context) { - c.Putln("// Event read %s", e.SrcName()) + c.Putln("// %sNew constructs a %s value that implements xgb.Event from "+ + "a byte slice.", e.EvType(), e.EvType()) c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType()) c.Putln("v := %s{}", e.EvType()) c.Putln("b := 1 // don't read event number") @@ -78,7 +81,7 @@ func (e *Event) Read(c *Context) { } func (e *Event) Write(c *Context) { - c.Putln("// Event write %s", e.SrcName()) + c.Putln("// Bytes writes a %s value to a byte slice.", e.EvType()) c.Putln("func (v %s) Bytes() []byte {", e.EvType()) c.Putln("buf := make([]byte, %s)", e.Size()) c.Putln("b := 0") @@ -102,8 +105,7 @@ func (e *Event) Write(c *Context) { // EventCopy types func (e *EventCopy) Define(c *Context) { - c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number) - c.Putln("") + c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType()) c.Putln("const %s = %d", e.SrcName(), e.Number) c.Putln("") c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType()) @@ -118,8 +120,10 @@ func (e *EventCopy) Define(c *Context) { e.Write(c) // Makes sure that this event type is an Event interface. - c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) - c.Putln("") + c.Putln("// SequenceId returns the sequence id attached to the %s event.", + e.SrcName()) + c.Putln("// Events without a sequence number (KeymapNotify) return 0.") + c.Putln("// This is mostly used internally.") c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) if e.Old.(*Event).NoSequence { c.Putln("return uint16(0)") @@ -146,6 +150,8 @@ func (e *EventCopy) Define(c *Context) { } func (e *EventCopy) Read(c *Context) { + c.Putln("// %sNew constructs a %s value that implements xgb.Event from "+ + "a byte slice.", e.EvType(), e.EvType()) c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType()) c.Putln("return %s(%sNew(buf).(%s))", e.EvType(), e.Old.(*Event).EvType(), e.Old.(*Event).EvType()) @@ -154,6 +160,7 @@ func (e *EventCopy) Read(c *Context) { } func (e *EventCopy) Write(c *Context) { + c.Putln("// Bytes writes a %s value to a byte slice.", e.EvType()) c.Putln("func (v %s) Bytes() []byte {", e.EvType()) c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType()) c.Putln("}") diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index 200260c..eca0c10 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -6,13 +6,16 @@ import ( ) func (r *Request) Define(c *Context) { - c.Putln("// Request %s", r.SrcName()) - c.Putln("// size: %s", r.Size(c)) + c.Putln("// %s is a cookie used only for %s requests.", + r.CookieName(), r.SrcName()) c.Putln("type %s struct {", r.CookieName()) c.Putln("*xgb.Cookie") c.Putln("}") c.Putln("") if r.Reply != nil { + c.Putln("// %s sends a checked request.", r.SrcName()) + c.Putln("// If an error occurs, it will be returned with the reply "+ + "by calling %s.Reply()", r.CookieName()) c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.NewCookie(true, true)") @@ -21,6 +24,9 @@ func (r *Request) Define(c *Context) { c.Putln("}") c.Putln("") + c.Putln("// %sUnchecked sends an unchecked request.", r.SrcName()) + c.Putln("// If an error occurs, it can only be retrieved using " + + "xgb.WaitForEvent or xgb.PollForEvent.") c.Putln("func %sUnchecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.NewCookie(false, true)") @@ -31,7 +37,9 @@ func (r *Request) Define(c *Context) { r.ReadReply(c) } else { - c.Putln("// Write request to wire for %s", r.SrcName()) + c.Putln("// %s sends an unchecked request.", r.SrcName()) + c.Putln("// If an error occurs, it can only be retrieved using " + + "xgb.WaitForEvent or xgb.PollForEvent.") c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.NewCookie(false, false)") @@ -40,6 +48,9 @@ func (r *Request) Define(c *Context) { c.Putln("}") c.Putln("") + c.Putln("// %sChecked sends a checked request.", r.SrcName()) + c.Putln("// If an error occurs, it can be retrieved using "+ + "%s.Check()", r.CookieName()) c.Putln("func %sChecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) c.Putln("cookie := c.NewCookie(true, false)") @@ -48,6 +59,10 @@ func (r *Request) Define(c *Context) { c.Putln("}") c.Putln("") + c.Putln("// Check returns an error if one occurred for checked " + + "requests that are not expecting a reply.") + c.Putln("// This cannot be called for requests expecting a reply, " + + "nor for unchecked requests.") c.Putln("func (cook %s) Check() error {", r.CookieName()) c.Putln("return cook.Cookie.Check()") c.Putln("}") @@ -57,18 +72,19 @@ func (r *Request) Define(c *Context) { } func (r *Request) ReadReply(c *Context) { - c.Putln("// Request reply for %s", r.SrcName()) - c.Putln("// size: %s", r.Reply.Size()) + c.Putln("// %s represents the data returned from a %s request.", + r.ReplyTypeName(), r.SrcName()) c.Putln("type %s struct {", r.ReplyTypeName()) - c.Putln("Sequence uint16") - c.Putln("Length uint32") + c.Putln("Sequence uint16 // sequence number of the request for this reply") + c.Putln("Length uint32 // number of bytes in this reply") for _, field := range r.Reply.Fields { field.Define(c) } c.Putln("}") c.Putln("") - c.Putln("// Waits and reads reply data from request %s", r.SrcName()) + c.Putln("// Reply blocks and returns the reply data for a %s request.", + r.SrcName()) c.Putln("func (cook %s) Reply() (*%s, error) {", r.CookieName(), r.ReplyTypeName()) c.Putln("buf, err := cook.Cookie.Reply()") @@ -82,7 +98,8 @@ func (r *Request) ReadReply(c *Context) { c.Putln("}") c.Putln("") - c.Putln("// Read reply into structure from buffer for %s", r.SrcName()) + c.Putln("// %s reads a byte slice into a %s value.", + r.ReplyName(), r.ReplyTypeName()) c.Putln("func %s(buf []byte) *%s {", r.ReplyName(), r.ReplyTypeName()) c.Putln("v := new(%s)", r.ReplyTypeName()) @@ -113,6 +130,8 @@ func (r *Request) WriteRequest(c *Context) { c.Putln("") } c.Putln("// Write request to wire for %s", r.SrcName()) + c.Putln("// %s writes a %s request to a byte slice.", + r.ReqName(), r.SrcName()) c.Putln("func %s(c *xgb.Conn, %s) []byte {", r.ReqName(), r.ParamNameTypes()) c.Putln("size := %s", r.Size(c)) diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 7f33b21..a988893 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -1,8 +1,6 @@ package main func (s *Struct) Define(c *Context) { - c.Putln("// '%s' struct definition", s.SrcName()) - c.Putln("// Size: %s", s.Size()) c.Putln("type %s struct {", s.SrcName()) for _, field := range s.Fields { field.Define(c) @@ -34,7 +32,8 @@ func (s *Struct) Define(c *Context) { // the number of bytes read off the buffer. // 'ReadStructName' should only be used to read raw reply data from the wire. func (s *Struct) Read(c *Context) { - c.Putln("// Struct read %s", s.SrcName()) + c.Putln("// %sRead reads a byte slice into a %s value.", + s.SrcName(), s.SrcName()) c.Putln("func %sRead(buf []byte, v *%s) int {", s.SrcName(), s.SrcName()) c.Putln("b := 0") @@ -53,10 +52,10 @@ func (s *Struct) Read(c *Context) { // a source (i.e., the buffer) byte slice, and a destination slice and returns // the number of bytes read from the byte slice. func (s *Struct) ReadList(c *Context) { - c.Putln("// Struct list read %s", s.SrcName()) + c.Putln("// %sReadList reads a byte slice into a list of %s values.", + s.SrcName(), s.SrcName()) c.Putln("func %sReadList(buf []byte, dest []%s) int {", s.SrcName(), s.SrcName()) - c.Putln("b := 0") c.Putln("for i := 0; i < len(dest); i++ {") c.Putln("dest[i] = %s{}", s.SrcName()) @@ -70,7 +69,7 @@ func (s *Struct) ReadList(c *Context) { } func (s *Struct) Write(c *Context) { - c.Putln("// Struct write %s", s.SrcName()) + c.Putln("// Bytes writes a %s value to a byte slice.", s.SrcName()) c.Putln("func (v %s) Bytes() []byte {", s.SrcName()) c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v.")) c.Putln("b := 0") @@ -85,7 +84,8 @@ func (s *Struct) Write(c *Context) { } func (s *Struct) WriteList(c *Context) { - c.Putln("// Write struct list %s", s.SrcName()) + c.Putln("// %sListBytes writes a list of %s values to a byte slice.", + s.SrcName()) c.Putln("func %sListBytes(buf []byte, list []%s) int {", s.SrcName(), s.SrcName()) c.Putln("b := 0") @@ -101,7 +101,8 @@ func (s *Struct) WriteList(c *Context) { } func (s *Struct) WriteListSize(c *Context) { - c.Putln("// Struct list size %s", s.SrcName()) + c.Putln("// %sListSize computes the size (bytes) of a list of %s values.", + s.SrcName(), s.SrcName()) c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName()) c.Putln("size := 0") if s.Size().Expression.Concrete() { diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 91300a2..1a8684c 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -2,7 +2,8 @@ package main // Union types func (u *Union) Define(c *Context) { - c.Putln("// Union definition %s", u.SrcName()) + c.Putln("// %s is a represention of the %s union type.", + u.SrcName(), u.SrcName()) c.Putln("// Note that to *create* a Union, you should *never* create") c.Putln("// this struct directly (unless you know what you're doing).") c.Putln("// Instead use one of the following constructors for '%s':", @@ -38,8 +39,8 @@ func (u *Union) Define(c *Context) { func (u *Union) New(c *Context) { for _, field := range u.Fields { - c.Putln("// Union constructor for %s for field %s.", - u.SrcName(), field.SrcName()) + c.Putln("// %s%sNew constructs a new %s union type with the %s field.", + u.SrcName(), field.SrcName(), u.SrcName(), field.SrcName()) c.Putln("func %s%sNew(%s %s) %s {", u.SrcName(), field.SrcName(), field.SrcName(), field.SrcType(), u.SrcName()) @@ -65,7 +66,8 @@ func (u *Union) New(c *Context) { } func (u *Union) Read(c *Context) { - c.Putln("// Union read %s", u.SrcName()) + c.Putln("// %sRead reads a byte slice into a %s value.", + u.SrcName(), u.SrcName()) c.Putln("func %sRead(buf []byte, v *%s) int {", u.SrcName(), u.SrcName()) c.Putln("var b int") c.Putln("") @@ -80,7 +82,8 @@ func (u *Union) Read(c *Context) { } func (u *Union) ReadList(c *Context) { - c.Putln("// Union list read %s", u.SrcName()) + c.Putln("// %sReadList reads a byte slice into a list of %s values.", + u.SrcName(), u.SrcName()) c.Putln("func %sReadList(buf []byte, dest []%s) int {", u.SrcName(), u.SrcName()) c.Putln("b := 0") @@ -99,7 +102,7 @@ func (u *Union) ReadList(c *Context) { // *same* *fixed* size. Thus, we make sure to always read bytes into // every field which allows us to simply pick the first field and write it. func (u *Union) Write(c *Context) { - c.Putln("// Union write %s", u.SrcName()) + c.Putln("// Bytes writes a %s value to a byte slice.", u.SrcName()) c.Putln("// Each field in a union must contain the same data.") c.Putln("// So simply pick the first field and write that to the wire.") c.Putln("func (v %s) Bytes() []byte {", u.SrcName()) @@ -113,7 +116,8 @@ func (u *Union) Write(c *Context) { } func (u *Union) WriteList(c *Context) { - c.Putln("// Union list write %s", u.SrcName()) + c.Putln("// %sListBytes writes a list of %s values to a byte slice.", + u.SrcName()) c.Putln("func %sListBytes(buf []byte, list []%s) int {", u.SrcName(), u.SrcName()) c.Putln("b := 0") @@ -130,6 +134,8 @@ func (u *Union) WriteList(c *Context) { func (u *Union) WriteListSize(c *Context) { c.Putln("// Union list size %s", u.SrcName()) + c.Putln("// %sListSize computes the size (bytes) of a list of %s values.", + u.SrcName()) c.Putln("func %sListSize(list []%s) int {", u.SrcName(), u.SrcName()) c.Putln("size := 0") c.Putln("for _, item := range list {") diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 587b628..cc4eaaa 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xinerama.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -64,8 +64,6 @@ func init() { // Skipping definition for base type 'Card8' -// 'ScreenInfo' struct definition -// Size: 8 type ScreenInfo struct { XOrg int16 YOrg int16 @@ -73,7 +71,7 @@ type ScreenInfo struct { Height uint16 } -// Struct read ScreenInfo +// ScreenInfoRead reads a byte slice into a ScreenInfo value. func ScreenInfoRead(buf []byte, v *ScreenInfo) int { b := 0 @@ -92,7 +90,7 @@ func ScreenInfoRead(buf []byte, v *ScreenInfo) int { return b } -// Struct list read ScreenInfo +// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values. func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -102,7 +100,7 @@ func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { return xgb.Pad(b) } -// Struct write ScreenInfo +// Bytes writes a ScreenInfo value to a byte slice. func (v ScreenInfo) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -122,7 +120,7 @@ func (v ScreenInfo) Bytes() []byte { return buf } -// Write struct list ScreenInfo +// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { b := 0 var structBytes []byte @@ -134,35 +132,37 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { return b } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Major uint16 Minor uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -174,7 +174,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -197,6 +197,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { size := 8 b := 0 @@ -220,34 +221,36 @@ func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { return buf } -// Request GetState -// size: 8 +// GetStateCookie is a cookie used only for GetState requests. type GetStateCookie struct { *xgb.Cookie } +// GetState sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply() func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { cookie := c.NewCookie(true, true) c.NewRequest(getStateRequest(c, Window), cookie) return GetStateCookie{cookie} } +// GetStateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { cookie := c.NewCookie(false, true) c.NewRequest(getStateRequest(c, Window), cookie) return GetStateCookie{cookie} } -// Request reply for GetState -// size: 12 +// GetStateReply represents the data returned from a GetState request. type GetStateReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply State byte Window xproto.Window } -// Waits and reads reply data from request GetState +// Reply blocks and returns the reply data for a GetState request. func (cook GetStateCookie) Reply() (*GetStateReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -259,7 +262,7 @@ func (cook GetStateCookie) Reply() (*GetStateReply, error) { return getStateReply(buf), nil } -// Read reply into structure from buffer for GetState +// getStateReply reads a byte slice into a GetStateReply value. func getStateReply(buf []byte) *GetStateReply { v := new(GetStateReply) b := 1 // skip reply determinant @@ -280,6 +283,7 @@ func getStateReply(buf []byte) *GetStateReply { } // Write request to wire for GetState +// getStateRequest writes a GetState request to a byte slice. func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -300,34 +304,36 @@ func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request GetScreenCount -// size: 8 +// GetScreenCountCookie is a cookie used only for GetScreenCount requests. type GetScreenCountCookie struct { *xgb.Cookie } +// GetScreenCount sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenCountCookie.Reply() func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenCountRequest(c, Window), cookie) return GetScreenCountCookie{cookie} } +// GetScreenCountUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenCountRequest(c, Window), cookie) return GetScreenCountCookie{cookie} } -// Request reply for GetScreenCount -// size: 12 +// GetScreenCountReply represents the data returned from a GetScreenCount request. type GetScreenCountReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply ScreenCount byte Window xproto.Window } -// Waits and reads reply data from request GetScreenCount +// Reply blocks and returns the reply data for a GetScreenCount request. func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -339,7 +345,7 @@ func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) { return getScreenCountReply(buf), nil } -// Read reply into structure from buffer for GetScreenCount +// getScreenCountReply reads a byte slice into a GetScreenCountReply value. func getScreenCountReply(buf []byte) *GetScreenCountReply { v := new(GetScreenCountReply) b := 1 // skip reply determinant @@ -360,6 +366,7 @@ func getScreenCountReply(buf []byte) *GetScreenCountReply { } // Write request to wire for GetScreenCount +// getScreenCountRequest writes a GetScreenCount request to a byte slice. func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -380,29 +387,31 @@ func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request GetScreenSize -// size: 12 +// GetScreenSizeCookie is a cookie used only for GetScreenSize requests. type GetScreenSizeCookie struct { *xgb.Cookie } +// GetScreenSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSizeCookie.Reply() func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) return GetScreenSizeCookie{cookie} } +// GetScreenSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) return GetScreenSizeCookie{cookie} } -// Request reply for GetScreenSize -// size: 24 +// GetScreenSizeReply represents the data returned from a GetScreenSize request. type GetScreenSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint32 Height uint32 @@ -410,7 +419,7 @@ type GetScreenSizeReply struct { Screen uint32 } -// Waits and reads reply data from request GetScreenSize +// Reply blocks and returns the reply data for a GetScreenSize request. func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -422,7 +431,7 @@ func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) { return getScreenSizeReply(buf), nil } -// Read reply into structure from buffer for GetScreenSize +// getScreenSizeReply reads a byte slice into a GetScreenSizeReply value. func getScreenSizeReply(buf []byte) *GetScreenSizeReply { v := new(GetScreenSizeReply) b := 1 // skip reply determinant @@ -451,6 +460,7 @@ func getScreenSizeReply(buf []byte) *GetScreenSizeReply { } // Write request to wire for GetScreenSize +// getScreenSizeRequest writes a GetScreenSize request to a byte slice. func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []byte { size := 12 b := 0 @@ -474,34 +484,36 @@ func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []by return buf } -// Request IsActive -// size: 4 +// IsActiveCookie is a cookie used only for IsActive requests. type IsActiveCookie struct { *xgb.Cookie } +// IsActive sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsActiveCookie.Reply() func IsActive(c *xgb.Conn) IsActiveCookie { cookie := c.NewCookie(true, true) c.NewRequest(isActiveRequest(c), cookie) return IsActiveCookie{cookie} } +// IsActiveUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie { cookie := c.NewCookie(false, true) c.NewRequest(isActiveRequest(c), cookie) return IsActiveCookie{cookie} } -// Request reply for IsActive -// size: 12 +// IsActiveReply represents the data returned from a IsActive request. type IsActiveReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes State uint32 } -// Waits and reads reply data from request IsActive +// Reply blocks and returns the reply data for a IsActive request. func (cook IsActiveCookie) Reply() (*IsActiveReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -513,7 +525,7 @@ func (cook IsActiveCookie) Reply() (*IsActiveReply, error) { return isActiveReply(buf), nil } -// Read reply into structure from buffer for IsActive +// isActiveReply reads a byte slice into a IsActiveReply value. func isActiveReply(buf []byte) *IsActiveReply { v := new(IsActiveReply) b := 1 // skip reply determinant @@ -533,6 +545,7 @@ func isActiveReply(buf []byte) *IsActiveReply { } // Write request to wire for IsActive +// isActiveRequest writes a IsActive request to a byte slice. func isActiveRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -550,36 +563,38 @@ func isActiveRequest(c *xgb.Conn) []byte { return buf } -// Request QueryScreens -// size: 4 +// QueryScreensCookie is a cookie used only for QueryScreens requests. type QueryScreensCookie struct { *xgb.Cookie } +// QueryScreens sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryScreensCookie.Reply() func QueryScreens(c *xgb.Conn) QueryScreensCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryScreensRequest(c), cookie) return QueryScreensCookie{cookie} } +// QueryScreensUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryScreensRequest(c), cookie) return QueryScreensCookie{cookie} } -// Request reply for QueryScreens -// size: (32 + xgb.Pad((int(Number) * 8))) +// QueryScreensReply represents the data returned from a QueryScreens request. type QueryScreensReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Number uint32 // padding: 20 bytes ScreenInfo []ScreenInfo // size: xgb.Pad((int(Number) * 8)) } -// Waits and reads reply data from request QueryScreens +// Reply blocks and returns the reply data for a QueryScreens request. func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -591,7 +606,7 @@ func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) { return queryScreensReply(buf), nil } -// Read reply into structure from buffer for QueryScreens +// queryScreensReply reads a byte slice into a QueryScreensReply value. func queryScreensReply(buf []byte) *QueryScreensReply { v := new(QueryScreensReply) b := 1 // skip reply determinant @@ -616,6 +631,7 @@ func queryScreensReply(buf []byte) *QueryScreensReply { } // Write request to wire for QueryScreens +// queryScreensRequest writes a QueryScreens request to a byte slice. func queryScreensRequest(c *xgb.Conn) []byte { size := 4 b := 0 diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index cdb0fec..2c2247c 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xinput.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -114,8 +114,6 @@ type KeyCode byte type EventClass uint32 -// 'DeviceInfo' struct definition -// Size: 8 type DeviceInfo struct { DeviceType xproto.Atom DeviceId byte @@ -124,7 +122,7 @@ type DeviceInfo struct { // padding: 1 bytes } -// Struct read DeviceInfo +// DeviceInfoRead reads a byte slice into a DeviceInfo value. func DeviceInfoRead(buf []byte, v *DeviceInfo) int { b := 0 @@ -145,7 +143,7 @@ func DeviceInfoRead(buf []byte, v *DeviceInfo) int { return b } -// Struct list read DeviceInfo +// DeviceInfoReadList reads a byte slice into a list of DeviceInfo values. func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -155,7 +153,7 @@ func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { return xgb.Pad(b) } -// Struct write DeviceInfo +// Bytes writes a DeviceInfo value to a byte slice. func (v DeviceInfo) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -177,7 +175,7 @@ func (v DeviceInfo) Bytes() []byte { return buf } -// Write struct list DeviceInfo +// DeviceInfoListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { b := 0 var structBytes []byte @@ -189,14 +187,12 @@ func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { return b } -// 'InputInfo' struct definition -// Size: 2 type InputInfo struct { ClassId byte Len byte } -// Struct read InputInfo +// InputInfoRead reads a byte slice into a InputInfo value. func InputInfoRead(buf []byte, v *InputInfo) int { b := 0 @@ -209,7 +205,7 @@ func InputInfoRead(buf []byte, v *InputInfo) int { return b } -// Struct list read InputInfo +// InputInfoReadList reads a byte slice into a list of InputInfo values. func InputInfoReadList(buf []byte, dest []InputInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -219,7 +215,7 @@ func InputInfoReadList(buf []byte, dest []InputInfo) int { return xgb.Pad(b) } -// Struct write InputInfo +// Bytes writes a InputInfo value to a byte slice. func (v InputInfo) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -233,7 +229,7 @@ func (v InputInfo) Bytes() []byte { return buf } -// Write struct list InputInfo +// InputInfoListBytes writes a list of %s(MISSING) values to a byte slice. func InputInfoListBytes(buf []byte, list []InputInfo) int { b := 0 var structBytes []byte @@ -245,8 +241,6 @@ func InputInfoListBytes(buf []byte, list []InputInfo) int { return b } -// 'KeyInfo' struct definition -// Size: 8 type KeyInfo struct { ClassId byte Len byte @@ -256,7 +250,7 @@ type KeyInfo struct { // padding: 2 bytes } -// Struct read KeyInfo +// KeyInfoRead reads a byte slice into a KeyInfo value. func KeyInfoRead(buf []byte, v *KeyInfo) int { b := 0 @@ -280,7 +274,7 @@ func KeyInfoRead(buf []byte, v *KeyInfo) int { return b } -// Struct list read KeyInfo +// KeyInfoReadList reads a byte slice into a list of KeyInfo values. func KeyInfoReadList(buf []byte, dest []KeyInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -290,7 +284,7 @@ func KeyInfoReadList(buf []byte, dest []KeyInfo) int { return xgb.Pad(b) } -// Struct write KeyInfo +// Bytes writes a KeyInfo value to a byte slice. func (v KeyInfo) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -315,7 +309,7 @@ func (v KeyInfo) Bytes() []byte { return buf } -// Write struct list KeyInfo +// KeyInfoListBytes writes a list of %s(MISSING) values to a byte slice. func KeyInfoListBytes(buf []byte, list []KeyInfo) int { b := 0 var structBytes []byte @@ -327,15 +321,13 @@ func KeyInfoListBytes(buf []byte, list []KeyInfo) int { return b } -// 'ButtonInfo' struct definition -// Size: 4 type ButtonInfo struct { ClassId byte Len byte NumButtons uint16 } -// Struct read ButtonInfo +// ButtonInfoRead reads a byte slice into a ButtonInfo value. func ButtonInfoRead(buf []byte, v *ButtonInfo) int { b := 0 @@ -351,7 +343,7 @@ func ButtonInfoRead(buf []byte, v *ButtonInfo) int { return b } -// Struct list read ButtonInfo +// ButtonInfoReadList reads a byte slice into a list of ButtonInfo values. func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -361,7 +353,7 @@ func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { return xgb.Pad(b) } -// Struct write ButtonInfo +// Bytes writes a ButtonInfo value to a byte slice. func (v ButtonInfo) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -378,7 +370,7 @@ func (v ButtonInfo) Bytes() []byte { return buf } -// Write struct list ButtonInfo +// ButtonInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { b := 0 var structBytes []byte @@ -390,15 +382,13 @@ func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { return b } -// 'AxisInfo' struct definition -// Size: 12 type AxisInfo struct { Resolution uint32 Minimum int32 Maximum int32 } -// Struct read AxisInfo +// AxisInfoRead reads a byte slice into a AxisInfo value. func AxisInfoRead(buf []byte, v *AxisInfo) int { b := 0 @@ -414,7 +404,7 @@ func AxisInfoRead(buf []byte, v *AxisInfo) int { return b } -// Struct list read AxisInfo +// AxisInfoReadList reads a byte slice into a list of AxisInfo values. func AxisInfoReadList(buf []byte, dest []AxisInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -424,7 +414,7 @@ func AxisInfoReadList(buf []byte, dest []AxisInfo) int { return xgb.Pad(b) } -// Struct write AxisInfo +// Bytes writes a AxisInfo value to a byte slice. func (v AxisInfo) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -441,7 +431,7 @@ func (v AxisInfo) Bytes() []byte { return buf } -// Write struct list AxisInfo +// AxisInfoListBytes writes a list of %s(MISSING) values to a byte slice. func AxisInfoListBytes(buf []byte, list []AxisInfo) int { b := 0 var structBytes []byte @@ -453,8 +443,6 @@ func AxisInfoListBytes(buf []byte, list []AxisInfo) int { return b } -// 'ValuatorInfo' struct definition -// Size: (8 + xgb.Pad((int(AxesLen) * 12))) type ValuatorInfo struct { ClassId byte Len byte @@ -464,7 +452,7 @@ type ValuatorInfo struct { Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) } -// Struct read ValuatorInfo +// ValuatorInfoRead reads a byte slice into a ValuatorInfo value. func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { b := 0 @@ -489,7 +477,7 @@ func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { return b } -// Struct list read ValuatorInfo +// ValuatorInfoReadList reads a byte slice into a list of ValuatorInfo values. func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -499,7 +487,7 @@ func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { return xgb.Pad(b) } -// Struct write ValuatorInfo +// Bytes writes a ValuatorInfo value to a byte slice. func (v ValuatorInfo) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) b := 0 @@ -524,7 +512,7 @@ func (v ValuatorInfo) Bytes() []byte { return buf } -// Write struct list ValuatorInfo +// ValuatorInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { b := 0 var structBytes []byte @@ -536,7 +524,7 @@ func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { return b } -// Struct list size ValuatorInfo +// ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. func ValuatorInfoListSize(list []ValuatorInfo) int { size := 0 for _, item := range list { @@ -545,14 +533,12 @@ func ValuatorInfoListSize(list []ValuatorInfo) int { return size } -// 'InputClassInfo' struct definition -// Size: 2 type InputClassInfo struct { ClassId byte EventTypeBase byte } -// Struct read InputClassInfo +// InputClassInfoRead reads a byte slice into a InputClassInfo value. func InputClassInfoRead(buf []byte, v *InputClassInfo) int { b := 0 @@ -565,7 +551,7 @@ func InputClassInfoRead(buf []byte, v *InputClassInfo) int { return b } -// Struct list read InputClassInfo +// InputClassInfoReadList reads a byte slice into a list of InputClassInfo values. func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -575,7 +561,7 @@ func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { return xgb.Pad(b) } -// Struct write InputClassInfo +// Bytes writes a InputClassInfo value to a byte slice. func (v InputClassInfo) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -589,7 +575,7 @@ func (v InputClassInfo) Bytes() []byte { return buf } -// Write struct list InputClassInfo +// InputClassInfoListBytes writes a list of %s(MISSING) values to a byte slice. func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { b := 0 var structBytes []byte @@ -601,13 +587,11 @@ func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { return b } -// 'DeviceTimeCoord' struct definition -// Size: 4 type DeviceTimeCoord struct { Time xproto.Timestamp } -// Struct read DeviceTimeCoord +// DeviceTimeCoordRead reads a byte slice into a DeviceTimeCoord value. func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { b := 0 @@ -617,7 +601,7 @@ func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { return b } -// Struct list read DeviceTimeCoord +// DeviceTimeCoordReadList reads a byte slice into a list of DeviceTimeCoord values. func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { b := 0 for i := 0; i < len(dest); i++ { @@ -627,7 +611,7 @@ func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { return xgb.Pad(b) } -// Struct write DeviceTimeCoord +// Bytes writes a DeviceTimeCoord value to a byte slice. func (v DeviceTimeCoord) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -638,7 +622,7 @@ func (v DeviceTimeCoord) Bytes() []byte { return buf } -// Write struct list DeviceTimeCoord +// DeviceTimeCoordListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { b := 0 var structBytes []byte @@ -650,15 +634,13 @@ func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { return b } -// 'FeedbackState' struct definition -// Size: 4 type FeedbackState struct { ClassId byte Id byte Len uint16 } -// Struct read FeedbackState +// FeedbackStateRead reads a byte slice into a FeedbackState value. func FeedbackStateRead(buf []byte, v *FeedbackState) int { b := 0 @@ -674,7 +656,7 @@ func FeedbackStateRead(buf []byte, v *FeedbackState) int { return b } -// Struct list read FeedbackState +// FeedbackStateReadList reads a byte slice into a list of FeedbackState values. func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -684,7 +666,7 @@ func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { return xgb.Pad(b) } -// Struct write FeedbackState +// Bytes writes a FeedbackState value to a byte slice. func (v FeedbackState) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -701,7 +683,7 @@ func (v FeedbackState) Bytes() []byte { return buf } -// Write struct list FeedbackState +// FeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { b := 0 var structBytes []byte @@ -713,8 +695,6 @@ func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { return b } -// 'KbdFeedbackState' struct definition -// Size: 52 type KbdFeedbackState struct { ClassId byte Id byte @@ -730,7 +710,7 @@ type KbdFeedbackState struct { AutoRepeats []byte // size: 32 } -// Struct read KbdFeedbackState +// KbdFeedbackStateRead reads a byte slice into a KbdFeedbackState value. func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { b := 0 @@ -777,7 +757,7 @@ func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { return b } -// Struct list read KbdFeedbackState +// KbdFeedbackStateReadList reads a byte slice into a list of KbdFeedbackState values. func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -787,7 +767,7 @@ func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { return xgb.Pad(b) } -// Struct write KbdFeedbackState +// Bytes writes a KbdFeedbackState value to a byte slice. func (v KbdFeedbackState) Bytes() []byte { buf := make([]byte, 52) b := 0 @@ -834,7 +814,7 @@ func (v KbdFeedbackState) Bytes() []byte { return buf } -// Write struct list KbdFeedbackState +// KbdFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { b := 0 var structBytes []byte @@ -846,7 +826,7 @@ func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { return b } -// Struct list size KbdFeedbackState +// KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. func KbdFeedbackStateListSize(list []KbdFeedbackState) int { size := 0 for _ = range list { @@ -855,8 +835,6 @@ func KbdFeedbackStateListSize(list []KbdFeedbackState) int { return size } -// 'PtrFeedbackState' struct definition -// Size: 12 type PtrFeedbackState struct { ClassId byte Id byte @@ -867,7 +845,7 @@ type PtrFeedbackState struct { Threshold uint16 } -// Struct read PtrFeedbackState +// PtrFeedbackStateRead reads a byte slice into a PtrFeedbackState value. func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { b := 0 @@ -894,7 +872,7 @@ func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { return b } -// Struct list read PtrFeedbackState +// PtrFeedbackStateReadList reads a byte slice into a list of PtrFeedbackState values. func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -904,7 +882,7 @@ func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { return xgb.Pad(b) } -// Struct write PtrFeedbackState +// Bytes writes a PtrFeedbackState value to a byte slice. func (v PtrFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -932,7 +910,7 @@ func (v PtrFeedbackState) Bytes() []byte { return buf } -// Write struct list PtrFeedbackState +// PtrFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { b := 0 var structBytes []byte @@ -944,8 +922,6 @@ func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { return b } -// 'IntegerFeedbackState' struct definition -// Size: 16 type IntegerFeedbackState struct { ClassId byte Id byte @@ -955,7 +931,7 @@ type IntegerFeedbackState struct { MaxValue int32 } -// Struct read IntegerFeedbackState +// IntegerFeedbackStateRead reads a byte slice into a IntegerFeedbackState value. func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { b := 0 @@ -980,7 +956,7 @@ func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { return b } -// Struct list read IntegerFeedbackState +// IntegerFeedbackStateReadList reads a byte slice into a list of IntegerFeedbackState values. func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -990,7 +966,7 @@ func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { return xgb.Pad(b) } -// Struct write IntegerFeedbackState +// Bytes writes a IntegerFeedbackState value to a byte slice. func (v IntegerFeedbackState) Bytes() []byte { buf := make([]byte, 16) b := 0 @@ -1016,7 +992,7 @@ func (v IntegerFeedbackState) Bytes() []byte { return buf } -// Write struct list IntegerFeedbackState +// IntegerFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { b := 0 var structBytes []byte @@ -1028,8 +1004,6 @@ func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int return b } -// 'StringFeedbackState' struct definition -// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) type StringFeedbackState struct { ClassId byte Id byte @@ -1039,7 +1013,7 @@ type StringFeedbackState struct { Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) } -// Struct read StringFeedbackState +// StringFeedbackStateRead reads a byte slice into a StringFeedbackState value. func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { b := 0 @@ -1068,7 +1042,7 @@ func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { return b } -// Struct list read StringFeedbackState +// StringFeedbackStateReadList reads a byte slice into a list of StringFeedbackState values. func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1078,7 +1052,7 @@ func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { return xgb.Pad(b) } -// Struct write StringFeedbackState +// Bytes writes a StringFeedbackState value to a byte slice. func (v StringFeedbackState) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) b := 0 @@ -1107,7 +1081,7 @@ func (v StringFeedbackState) Bytes() []byte { return buf } -// Write struct list StringFeedbackState +// StringFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { b := 0 var structBytes []byte @@ -1119,7 +1093,7 @@ func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { return b } -// Struct list size StringFeedbackState +// StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. func StringFeedbackStateListSize(list []StringFeedbackState) int { size := 0 for _, item := range list { @@ -1128,8 +1102,6 @@ func StringFeedbackStateListSize(list []StringFeedbackState) int { return size } -// 'BellFeedbackState' struct definition -// Size: 12 type BellFeedbackState struct { ClassId byte Id byte @@ -1140,7 +1112,7 @@ type BellFeedbackState struct { Duration uint16 } -// Struct read BellFeedbackState +// BellFeedbackStateRead reads a byte slice into a BellFeedbackState value. func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { b := 0 @@ -1167,7 +1139,7 @@ func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { return b } -// Struct list read BellFeedbackState +// BellFeedbackStateReadList reads a byte slice into a list of BellFeedbackState values. func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1177,7 +1149,7 @@ func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { return xgb.Pad(b) } -// Struct write BellFeedbackState +// Bytes writes a BellFeedbackState value to a byte slice. func (v BellFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1205,7 +1177,7 @@ func (v BellFeedbackState) Bytes() []byte { return buf } -// Write struct list BellFeedbackState +// BellFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { b := 0 var structBytes []byte @@ -1217,8 +1189,6 @@ func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { return b } -// 'LedFeedbackState' struct definition -// Size: 12 type LedFeedbackState struct { ClassId byte Id byte @@ -1227,7 +1197,7 @@ type LedFeedbackState struct { LedValues uint32 } -// Struct read LedFeedbackState +// LedFeedbackStateRead reads a byte slice into a LedFeedbackState value. func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { b := 0 @@ -1249,7 +1219,7 @@ func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { return b } -// Struct list read LedFeedbackState +// LedFeedbackStateReadList reads a byte slice into a list of LedFeedbackState values. func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1259,7 +1229,7 @@ func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { return xgb.Pad(b) } -// Struct write LedFeedbackState +// Bytes writes a LedFeedbackState value to a byte slice. func (v LedFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1282,7 +1252,7 @@ func (v LedFeedbackState) Bytes() []byte { return buf } -// Write struct list LedFeedbackState +// LedFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { b := 0 var structBytes []byte @@ -1294,15 +1264,13 @@ func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { return b } -// 'FeedbackCtl' struct definition -// Size: 4 type FeedbackCtl struct { ClassId byte Id byte Len uint16 } -// Struct read FeedbackCtl +// FeedbackCtlRead reads a byte slice into a FeedbackCtl value. func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { b := 0 @@ -1318,7 +1286,7 @@ func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { return b } -// Struct list read FeedbackCtl +// FeedbackCtlReadList reads a byte slice into a list of FeedbackCtl values. func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1328,7 +1296,7 @@ func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { return xgb.Pad(b) } -// Struct write FeedbackCtl +// Bytes writes a FeedbackCtl value to a byte slice. func (v FeedbackCtl) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -1345,7 +1313,7 @@ func (v FeedbackCtl) Bytes() []byte { return buf } -// Write struct list FeedbackCtl +// FeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { b := 0 var structBytes []byte @@ -1357,8 +1325,6 @@ func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { return b } -// 'KbdFeedbackCtl' struct definition -// Size: 20 type KbdFeedbackCtl struct { ClassId byte Id byte @@ -1373,7 +1339,7 @@ type KbdFeedbackCtl struct { LedValues uint32 } -// Struct read KbdFeedbackCtl +// KbdFeedbackCtlRead reads a byte slice into a KbdFeedbackCtl value. func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { b := 0 @@ -1413,7 +1379,7 @@ func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { return b } -// Struct list read KbdFeedbackCtl +// KbdFeedbackCtlReadList reads a byte slice into a list of KbdFeedbackCtl values. func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1423,7 +1389,7 @@ func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { return xgb.Pad(b) } -// Struct write KbdFeedbackCtl +// Bytes writes a KbdFeedbackCtl value to a byte slice. func (v KbdFeedbackCtl) Bytes() []byte { buf := make([]byte, 20) b := 0 @@ -1464,7 +1430,7 @@ func (v KbdFeedbackCtl) Bytes() []byte { return buf } -// Write struct list KbdFeedbackCtl +// KbdFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { b := 0 var structBytes []byte @@ -1476,8 +1442,6 @@ func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { return b } -// 'PtrFeedbackCtl' struct definition -// Size: 12 type PtrFeedbackCtl struct { ClassId byte Id byte @@ -1488,7 +1452,7 @@ type PtrFeedbackCtl struct { Threshold int16 } -// Struct read PtrFeedbackCtl +// PtrFeedbackCtlRead reads a byte slice into a PtrFeedbackCtl value. func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { b := 0 @@ -1515,7 +1479,7 @@ func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { return b } -// Struct list read PtrFeedbackCtl +// PtrFeedbackCtlReadList reads a byte slice into a list of PtrFeedbackCtl values. func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1525,7 +1489,7 @@ func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { return xgb.Pad(b) } -// Struct write PtrFeedbackCtl +// Bytes writes a PtrFeedbackCtl value to a byte slice. func (v PtrFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1553,7 +1517,7 @@ func (v PtrFeedbackCtl) Bytes() []byte { return buf } -// Write struct list PtrFeedbackCtl +// PtrFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { b := 0 var structBytes []byte @@ -1565,8 +1529,6 @@ func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { return b } -// 'IntegerFeedbackCtl' struct definition -// Size: 8 type IntegerFeedbackCtl struct { ClassId byte Id byte @@ -1574,7 +1536,7 @@ type IntegerFeedbackCtl struct { IntToDisplay int32 } -// Struct read IntegerFeedbackCtl +// IntegerFeedbackCtlRead reads a byte slice into a IntegerFeedbackCtl value. func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { b := 0 @@ -1593,7 +1555,7 @@ func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { return b } -// Struct list read IntegerFeedbackCtl +// IntegerFeedbackCtlReadList reads a byte slice into a list of IntegerFeedbackCtl values. func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1603,7 +1565,7 @@ func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { return xgb.Pad(b) } -// Struct write IntegerFeedbackCtl +// Bytes writes a IntegerFeedbackCtl value to a byte slice. func (v IntegerFeedbackCtl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1623,7 +1585,7 @@ func (v IntegerFeedbackCtl) Bytes() []byte { return buf } -// Write struct list IntegerFeedbackCtl +// IntegerFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { b := 0 var structBytes []byte @@ -1635,8 +1597,6 @@ func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { return b } -// 'StringFeedbackCtl' struct definition -// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) type StringFeedbackCtl struct { ClassId byte Id byte @@ -1646,7 +1606,7 @@ type StringFeedbackCtl struct { Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) } -// Struct read StringFeedbackCtl +// StringFeedbackCtlRead reads a byte slice into a StringFeedbackCtl value. func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { b := 0 @@ -1674,7 +1634,7 @@ func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { return b } -// Struct list read StringFeedbackCtl +// StringFeedbackCtlReadList reads a byte slice into a list of StringFeedbackCtl values. func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1684,7 +1644,7 @@ func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { return xgb.Pad(b) } -// Struct write StringFeedbackCtl +// Bytes writes a StringFeedbackCtl value to a byte slice. func (v StringFeedbackCtl) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) b := 0 @@ -1712,7 +1672,7 @@ func (v StringFeedbackCtl) Bytes() []byte { return buf } -// Write struct list StringFeedbackCtl +// StringFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { b := 0 var structBytes []byte @@ -1724,7 +1684,7 @@ func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { return b } -// Struct list size StringFeedbackCtl +// StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { size := 0 for _, item := range list { @@ -1733,8 +1693,6 @@ func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { return size } -// 'BellFeedbackCtl' struct definition -// Size: 12 type BellFeedbackCtl struct { ClassId byte Id byte @@ -1745,7 +1703,7 @@ type BellFeedbackCtl struct { Duration int16 } -// Struct read BellFeedbackCtl +// BellFeedbackCtlRead reads a byte slice into a BellFeedbackCtl value. func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { b := 0 @@ -1772,7 +1730,7 @@ func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { return b } -// Struct list read BellFeedbackCtl +// BellFeedbackCtlReadList reads a byte slice into a list of BellFeedbackCtl values. func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1782,7 +1740,7 @@ func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { return xgb.Pad(b) } -// Struct write BellFeedbackCtl +// Bytes writes a BellFeedbackCtl value to a byte slice. func (v BellFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1810,7 +1768,7 @@ func (v BellFeedbackCtl) Bytes() []byte { return buf } -// Write struct list BellFeedbackCtl +// BellFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { b := 0 var structBytes []byte @@ -1822,8 +1780,6 @@ func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { return b } -// 'LedFeedbackCtl' struct definition -// Size: 12 type LedFeedbackCtl struct { ClassId byte Id byte @@ -1832,7 +1788,7 @@ type LedFeedbackCtl struct { LedValues uint32 } -// Struct read LedFeedbackCtl +// LedFeedbackCtlRead reads a byte slice into a LedFeedbackCtl value. func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { b := 0 @@ -1854,7 +1810,7 @@ func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { return b } -// Struct list read LedFeedbackCtl +// LedFeedbackCtlReadList reads a byte slice into a list of LedFeedbackCtl values. func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1864,7 +1820,7 @@ func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { return xgb.Pad(b) } -// Struct write LedFeedbackCtl +// Bytes writes a LedFeedbackCtl value to a byte slice. func (v LedFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1887,7 +1843,7 @@ func (v LedFeedbackCtl) Bytes() []byte { return buf } -// Write struct list LedFeedbackCtl +// LedFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { b := 0 var structBytes []byte @@ -1899,15 +1855,13 @@ func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { return b } -// 'InputState' struct definition -// Size: 3 type InputState struct { ClassId byte Len byte NumItems byte } -// Struct read InputState +// InputStateRead reads a byte slice into a InputState value. func InputStateRead(buf []byte, v *InputState) int { b := 0 @@ -1923,7 +1877,7 @@ func InputStateRead(buf []byte, v *InputState) int { return b } -// Struct list read InputState +// InputStateReadList reads a byte slice into a list of InputState values. func InputStateReadList(buf []byte, dest []InputState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1933,7 +1887,7 @@ func InputStateReadList(buf []byte, dest []InputState) int { return xgb.Pad(b) } -// Struct write InputState +// Bytes writes a InputState value to a byte slice. func (v InputState) Bytes() []byte { buf := make([]byte, 3) b := 0 @@ -1950,7 +1904,7 @@ func (v InputState) Bytes() []byte { return buf } -// Write struct list InputState +// InputStateListBytes writes a list of %s(MISSING) values to a byte slice. func InputStateListBytes(buf []byte, list []InputState) int { b := 0 var structBytes []byte @@ -1962,8 +1916,6 @@ func InputStateListBytes(buf []byte, list []InputState) int { return b } -// 'KeyState' struct definition -// Size: 36 type KeyState struct { ClassId byte Len byte @@ -1972,7 +1924,7 @@ type KeyState struct { Keys []byte // size: 32 } -// Struct read KeyState +// KeyStateRead reads a byte slice into a KeyState value. func KeyStateRead(buf []byte, v *KeyState) int { b := 0 @@ -1994,7 +1946,7 @@ func KeyStateRead(buf []byte, v *KeyState) int { return b } -// Struct list read KeyState +// KeyStateReadList reads a byte slice into a list of KeyState values. func KeyStateReadList(buf []byte, dest []KeyState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2004,7 +1956,7 @@ func KeyStateReadList(buf []byte, dest []KeyState) int { return xgb.Pad(b) } -// Struct write KeyState +// Bytes writes a KeyState value to a byte slice. func (v KeyState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2026,7 +1978,7 @@ func (v KeyState) Bytes() []byte { return buf } -// Write struct list KeyState +// KeyStateListBytes writes a list of %s(MISSING) values to a byte slice. func KeyStateListBytes(buf []byte, list []KeyState) int { b := 0 var structBytes []byte @@ -2038,7 +1990,7 @@ func KeyStateListBytes(buf []byte, list []KeyState) int { return b } -// Struct list size KeyState +// KeyStateListSize computes the size (bytes) of a list of KeyState values. func KeyStateListSize(list []KeyState) int { size := 0 for _ = range list { @@ -2047,8 +1999,6 @@ func KeyStateListSize(list []KeyState) int { return size } -// 'ButtonState' struct definition -// Size: 36 type ButtonState struct { ClassId byte Len byte @@ -2057,7 +2007,7 @@ type ButtonState struct { Buttons []byte // size: 32 } -// Struct read ButtonState +// ButtonStateRead reads a byte slice into a ButtonState value. func ButtonStateRead(buf []byte, v *ButtonState) int { b := 0 @@ -2079,7 +2029,7 @@ func ButtonStateRead(buf []byte, v *ButtonState) int { return b } -// Struct list read ButtonState +// ButtonStateReadList reads a byte slice into a list of ButtonState values. func ButtonStateReadList(buf []byte, dest []ButtonState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2089,7 +2039,7 @@ func ButtonStateReadList(buf []byte, dest []ButtonState) int { return xgb.Pad(b) } -// Struct write ButtonState +// Bytes writes a ButtonState value to a byte slice. func (v ButtonState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2111,7 +2061,7 @@ func (v ButtonState) Bytes() []byte { return buf } -// Write struct list ButtonState +// ButtonStateListBytes writes a list of %s(MISSING) values to a byte slice. func ButtonStateListBytes(buf []byte, list []ButtonState) int { b := 0 var structBytes []byte @@ -2123,7 +2073,7 @@ func ButtonStateListBytes(buf []byte, list []ButtonState) int { return b } -// Struct list size ButtonState +// ButtonStateListSize computes the size (bytes) of a list of ButtonState values. func ButtonStateListSize(list []ButtonState) int { size := 0 for _ = range list { @@ -2132,8 +2082,6 @@ func ButtonStateListSize(list []ButtonState) int { return size } -// 'ValuatorState' struct definition -// Size: (4 + xgb.Pad((int(NumValuators) * 4))) type ValuatorState struct { ClassId byte Len byte @@ -2142,7 +2090,7 @@ type ValuatorState struct { Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read ValuatorState +// ValuatorStateRead reads a byte slice into a ValuatorState value. func ValuatorStateRead(buf []byte, v *ValuatorState) int { b := 0 @@ -2168,7 +2116,7 @@ func ValuatorStateRead(buf []byte, v *ValuatorState) int { return b } -// Struct list read ValuatorState +// ValuatorStateReadList reads a byte slice into a list of ValuatorState values. func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2178,7 +2126,7 @@ func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { return xgb.Pad(b) } -// Struct write ValuatorState +// Bytes writes a ValuatorState value to a byte slice. func (v ValuatorState) Bytes() []byte { buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2204,7 +2152,7 @@ func (v ValuatorState) Bytes() []byte { return buf } -// Write struct list ValuatorState +// ValuatorStateListBytes writes a list of %s(MISSING) values to a byte slice. func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { b := 0 var structBytes []byte @@ -2216,7 +2164,7 @@ func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { return b } -// Struct list size ValuatorState +// ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. func ValuatorStateListSize(list []ValuatorState) int { size := 0 for _, item := range list { @@ -2225,14 +2173,12 @@ func ValuatorStateListSize(list []ValuatorState) int { return size } -// 'DeviceState' struct definition -// Size: 4 type DeviceState struct { ControlId uint16 Len uint16 } -// Struct read DeviceState +// DeviceStateRead reads a byte slice into a DeviceState value. func DeviceStateRead(buf []byte, v *DeviceState) int { b := 0 @@ -2245,7 +2191,7 @@ func DeviceStateRead(buf []byte, v *DeviceState) int { return b } -// Struct list read DeviceState +// DeviceStateReadList reads a byte slice into a list of DeviceState values. func DeviceStateReadList(buf []byte, dest []DeviceState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2255,7 +2201,7 @@ func DeviceStateReadList(buf []byte, dest []DeviceState) int { return xgb.Pad(b) } -// Struct write DeviceState +// Bytes writes a DeviceState value to a byte slice. func (v DeviceState) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -2269,7 +2215,7 @@ func (v DeviceState) Bytes() []byte { return buf } -// Write struct list DeviceState +// DeviceStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceStateListBytes(buf []byte, list []DeviceState) int { b := 0 var structBytes []byte @@ -2281,8 +2227,6 @@ func DeviceStateListBytes(buf []byte, list []DeviceState) int { return b } -// 'DeviceResolutionState' struct definition -// Size: (((8 + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) type DeviceResolutionState struct { ControlId uint16 Len uint16 @@ -2292,7 +2236,7 @@ type DeviceResolutionState struct { ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read DeviceResolutionState +// DeviceResolutionStateRead reads a byte slice into a DeviceResolutionState value. func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { b := 0 @@ -2329,7 +2273,7 @@ func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { return b } -// Struct list read DeviceResolutionState +// DeviceResolutionStateReadList reads a byte slice into a list of DeviceResolutionState values. func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2339,7 +2283,7 @@ func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int return xgb.Pad(b) } -// Struct write DeviceResolutionState +// Bytes writes a DeviceResolutionState value to a byte slice. func (v DeviceResolutionState) Bytes() []byte { buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2374,7 +2318,7 @@ func (v DeviceResolutionState) Bytes() []byte { return buf } -// Write struct list DeviceResolutionState +// DeviceResolutionStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { b := 0 var structBytes []byte @@ -2386,7 +2330,7 @@ func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) in return b } -// Struct list size DeviceResolutionState +// DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. func DeviceResolutionStateListSize(list []DeviceResolutionState) int { size := 0 for _, item := range list { @@ -2395,8 +2339,6 @@ func DeviceResolutionStateListSize(list []DeviceResolutionState) int { return size } -// 'DeviceAbsCalibState' struct definition -// Size: 36 type DeviceAbsCalibState struct { ControlId uint16 Len uint16 @@ -2410,7 +2352,7 @@ type DeviceAbsCalibState struct { ButtonThreshold uint32 } -// Struct read DeviceAbsCalibState +// DeviceAbsCalibStateRead reads a byte slice into a DeviceAbsCalibState value. func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { b := 0 @@ -2447,7 +2389,7 @@ func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { return b } -// Struct list read DeviceAbsCalibState +// DeviceAbsCalibStateReadList reads a byte slice into a list of DeviceAbsCalibState values. func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2457,7 +2399,7 @@ func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { return xgb.Pad(b) } -// Struct write DeviceAbsCalibState +// Bytes writes a DeviceAbsCalibState value to a byte slice. func (v DeviceAbsCalibState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2495,7 +2437,7 @@ func (v DeviceAbsCalibState) Bytes() []byte { return buf } -// Write struct list DeviceAbsCalibState +// DeviceAbsCalibStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { b := 0 var structBytes []byte @@ -2507,8 +2449,6 @@ func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { return b } -// 'DeviceAbsAreaState' struct definition -// Size: 28 type DeviceAbsAreaState struct { ControlId uint16 Len uint16 @@ -2520,7 +2460,7 @@ type DeviceAbsAreaState struct { Following uint32 } -// Struct read DeviceAbsAreaState +// DeviceAbsAreaStateRead reads a byte slice into a DeviceAbsAreaState value. func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { b := 0 @@ -2551,7 +2491,7 @@ func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { return b } -// Struct list read DeviceAbsAreaState +// DeviceAbsAreaStateReadList reads a byte slice into a list of DeviceAbsAreaState values. func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2561,7 +2501,7 @@ func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { return xgb.Pad(b) } -// Struct write DeviceAbsAreaState +// Bytes writes a DeviceAbsAreaState value to a byte slice. func (v DeviceAbsAreaState) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -2593,7 +2533,7 @@ func (v DeviceAbsAreaState) Bytes() []byte { return buf } -// Write struct list DeviceAbsAreaState +// DeviceAbsAreaStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { b := 0 var structBytes []byte @@ -2605,8 +2545,6 @@ func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { return b } -// 'DeviceCoreState' struct definition -// Size: 8 type DeviceCoreState struct { ControlId uint16 Len uint16 @@ -2615,7 +2553,7 @@ type DeviceCoreState struct { // padding: 2 bytes } -// Struct read DeviceCoreState +// DeviceCoreStateRead reads a byte slice into a DeviceCoreState value. func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { b := 0 @@ -2636,7 +2574,7 @@ func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { return b } -// Struct list read DeviceCoreState +// DeviceCoreStateReadList reads a byte slice into a list of DeviceCoreState values. func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2646,7 +2584,7 @@ func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { return xgb.Pad(b) } -// Struct write DeviceCoreState +// Bytes writes a DeviceCoreState value to a byte slice. func (v DeviceCoreState) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2668,7 +2606,7 @@ func (v DeviceCoreState) Bytes() []byte { return buf } -// Write struct list DeviceCoreState +// DeviceCoreStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { b := 0 var structBytes []byte @@ -2680,8 +2618,6 @@ func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { return b } -// 'DeviceEnableState' struct definition -// Size: 8 type DeviceEnableState struct { ControlId uint16 Len uint16 @@ -2689,7 +2625,7 @@ type DeviceEnableState struct { // padding: 3 bytes } -// Struct read DeviceEnableState +// DeviceEnableStateRead reads a byte slice into a DeviceEnableState value. func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { b := 0 @@ -2707,7 +2643,7 @@ func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { return b } -// Struct list read DeviceEnableState +// DeviceEnableStateReadList reads a byte slice into a list of DeviceEnableState values. func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2717,7 +2653,7 @@ func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { return xgb.Pad(b) } -// Struct write DeviceEnableState +// Bytes writes a DeviceEnableState value to a byte slice. func (v DeviceEnableState) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2736,7 +2672,7 @@ func (v DeviceEnableState) Bytes() []byte { return buf } -// Write struct list DeviceEnableState +// DeviceEnableStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { b := 0 var structBytes []byte @@ -2748,14 +2684,12 @@ func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { return b } -// 'DeviceCtl' struct definition -// Size: 4 type DeviceCtl struct { ControlId uint16 Len uint16 } -// Struct read DeviceCtl +// DeviceCtlRead reads a byte slice into a DeviceCtl value. func DeviceCtlRead(buf []byte, v *DeviceCtl) int { b := 0 @@ -2768,7 +2702,7 @@ func DeviceCtlRead(buf []byte, v *DeviceCtl) int { return b } -// Struct list read DeviceCtl +// DeviceCtlReadList reads a byte slice into a list of DeviceCtl values. func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2778,7 +2712,7 @@ func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { return xgb.Pad(b) } -// Struct write DeviceCtl +// Bytes writes a DeviceCtl value to a byte slice. func (v DeviceCtl) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -2792,7 +2726,7 @@ func (v DeviceCtl) Bytes() []byte { return buf } -// Write struct list DeviceCtl +// DeviceCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { b := 0 var structBytes []byte @@ -2804,8 +2738,6 @@ func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { return b } -// 'DeviceResolutionCtl' struct definition -// Size: (6 + xgb.Pad((int(NumValuators) * 4))) type DeviceResolutionCtl struct { ControlId uint16 Len uint16 @@ -2814,7 +2746,7 @@ type DeviceResolutionCtl struct { ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read DeviceResolutionCtl +// DeviceResolutionCtlRead reads a byte slice into a DeviceResolutionCtl value. func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { b := 0 @@ -2840,7 +2772,7 @@ func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { return b } -// Struct list read DeviceResolutionCtl +// DeviceResolutionCtlReadList reads a byte slice into a list of DeviceResolutionCtl values. func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2850,7 +2782,7 @@ func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { return xgb.Pad(b) } -// Struct write DeviceResolutionCtl +// Bytes writes a DeviceResolutionCtl value to a byte slice. func (v DeviceResolutionCtl) Bytes() []byte { buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2876,7 +2808,7 @@ func (v DeviceResolutionCtl) Bytes() []byte { return buf } -// Write struct list DeviceResolutionCtl +// DeviceResolutionCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { b := 0 var structBytes []byte @@ -2888,7 +2820,7 @@ func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { return b } -// Struct list size DeviceResolutionCtl +// DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { size := 0 for _, item := range list { @@ -2897,8 +2829,6 @@ func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { return size } -// 'DeviceAbsCalibCtl' struct definition -// Size: 36 type DeviceAbsCalibCtl struct { ControlId uint16 Len uint16 @@ -2912,7 +2842,7 @@ type DeviceAbsCalibCtl struct { ButtonThreshold uint32 } -// Struct read DeviceAbsCalibCtl +// DeviceAbsCalibCtlRead reads a byte slice into a DeviceAbsCalibCtl value. func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { b := 0 @@ -2949,7 +2879,7 @@ func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { return b } -// Struct list read DeviceAbsCalibCtl +// DeviceAbsCalibCtlReadList reads a byte slice into a list of DeviceAbsCalibCtl values. func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2959,7 +2889,7 @@ func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { return xgb.Pad(b) } -// Struct write DeviceAbsCalibCtl +// Bytes writes a DeviceAbsCalibCtl value to a byte slice. func (v DeviceAbsCalibCtl) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2997,7 +2927,7 @@ func (v DeviceAbsCalibCtl) Bytes() []byte { return buf } -// Write struct list DeviceAbsCalibCtl +// DeviceAbsCalibCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { b := 0 var structBytes []byte @@ -3009,8 +2939,6 @@ func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { return b } -// 'DeviceAbsAreaCtrl' struct definition -// Size: 28 type DeviceAbsAreaCtrl struct { ControlId uint16 Len uint16 @@ -3022,7 +2950,7 @@ type DeviceAbsAreaCtrl struct { Following uint32 } -// Struct read DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlRead reads a byte slice into a DeviceAbsAreaCtrl value. func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { b := 0 @@ -3053,7 +2981,7 @@ func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { return b } -// Struct list read DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlReadList reads a byte slice into a list of DeviceAbsAreaCtrl values. func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3063,7 +2991,7 @@ func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { return xgb.Pad(b) } -// Struct write DeviceAbsAreaCtrl +// Bytes writes a DeviceAbsAreaCtrl value to a byte slice. func (v DeviceAbsAreaCtrl) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -3095,7 +3023,7 @@ func (v DeviceAbsAreaCtrl) Bytes() []byte { return buf } -// Write struct list DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { b := 0 var structBytes []byte @@ -3107,8 +3035,6 @@ func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { return b } -// 'DeviceCoreCtrl' struct definition -// Size: 8 type DeviceCoreCtrl struct { ControlId uint16 Len uint16 @@ -3116,7 +3042,7 @@ type DeviceCoreCtrl struct { // padding: 3 bytes } -// Struct read DeviceCoreCtrl +// DeviceCoreCtrlRead reads a byte slice into a DeviceCoreCtrl value. func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { b := 0 @@ -3134,7 +3060,7 @@ func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { return b } -// Struct list read DeviceCoreCtrl +// DeviceCoreCtrlReadList reads a byte slice into a list of DeviceCoreCtrl values. func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3144,7 +3070,7 @@ func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { return xgb.Pad(b) } -// Struct write DeviceCoreCtrl +// Bytes writes a DeviceCoreCtrl value to a byte slice. func (v DeviceCoreCtrl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -3163,7 +3089,7 @@ func (v DeviceCoreCtrl) Bytes() []byte { return buf } -// Write struct list DeviceCoreCtrl +// DeviceCoreCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { b := 0 var structBytes []byte @@ -3175,8 +3101,6 @@ func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { return b } -// 'DeviceEnableCtrl' struct definition -// Size: 8 type DeviceEnableCtrl struct { ControlId uint16 Len uint16 @@ -3184,7 +3108,7 @@ type DeviceEnableCtrl struct { // padding: 3 bytes } -// Struct read DeviceEnableCtrl +// DeviceEnableCtrlRead reads a byte slice into a DeviceEnableCtrl value. func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { b := 0 @@ -3202,7 +3126,7 @@ func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { return b } -// Struct list read DeviceEnableCtrl +// DeviceEnableCtrlReadList reads a byte slice into a list of DeviceEnableCtrl values. func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3212,7 +3136,7 @@ func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { return xgb.Pad(b) } -// Struct write DeviceEnableCtrl +// Bytes writes a DeviceEnableCtrl value to a byte slice. func (v DeviceEnableCtrl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -3231,7 +3155,7 @@ func (v DeviceEnableCtrl) Bytes() []byte { return buf } -// Write struct list DeviceEnableCtrl +// DeviceEnableCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { b := 0 var structBytes []byte @@ -3243,9 +3167,7 @@ func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { return b } -// Event definition DeviceValuator (0) -// Size: 32 - +// DeviceValuator is the event number for a DeviceValuatorEvent. const DeviceValuator = 0 type DeviceValuatorEvent struct { @@ -3257,7 +3179,7 @@ type DeviceValuatorEvent struct { Valuators []int32 // size: 24 } -// Event read DeviceValuator +// DeviceValuatorEventNew constructs a DeviceValuatorEvent value that implements xgb.Event from a byte slice. func DeviceValuatorEventNew(buf []byte) xgb.Event { v := DeviceValuatorEvent{} b := 1 // don't read event number @@ -3287,7 +3209,7 @@ func DeviceValuatorEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceValuator +// Bytes writes a DeviceValuatorEvent value to a byte slice. func (v DeviceValuatorEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3319,12 +3241,14 @@ func (v DeviceValuatorEvent) Bytes() []byte { return buf } -func (v DeviceValuatorEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceValuator event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceValuatorEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceValuatorEvent. func (v DeviceValuatorEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3339,9 +3263,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew } -// Event definition DeviceKeyPress (1) -// Size: 32 - +// DeviceKeyPress is the event number for a DeviceKeyPressEvent. const DeviceKeyPress = 1 type DeviceKeyPressEvent struct { @@ -3360,7 +3282,7 @@ type DeviceKeyPressEvent struct { DeviceId byte } -// Event read DeviceKeyPress +// DeviceKeyPressEventNew constructs a DeviceKeyPressEvent value that implements xgb.Event from a byte slice. func DeviceKeyPressEventNew(buf []byte) xgb.Event { v := DeviceKeyPressEvent{} b := 1 // don't read event number @@ -3411,7 +3333,7 @@ func DeviceKeyPressEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceKeyPress +// Bytes writes a DeviceKeyPressEvent value to a byte slice. func (v DeviceKeyPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3465,12 +3387,14 @@ func (v DeviceKeyPressEvent) Bytes() []byte { return buf } -func (v DeviceKeyPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceKeyPressEvent. func (v DeviceKeyPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3493,9 +3417,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][1] = DeviceKeyPressEventNew } -// Event definition FocusIn (6) -// Size: 32 - +// FocusIn is the event number for a FocusInEvent. const FocusIn = 6 type FocusInEvent struct { @@ -3508,7 +3430,7 @@ type FocusInEvent struct { // padding: 18 bytes } -// Event read FocusIn +// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. func FocusInEventNew(buf []byte) xgb.Event { v := FocusInEvent{} b := 1 // don't read event number @@ -3536,7 +3458,7 @@ func FocusInEventNew(buf []byte) xgb.Event { return v } -// Event write FocusIn +// Bytes writes a FocusInEvent value to a byte slice. func (v FocusInEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3567,12 +3489,14 @@ func (v FocusInEvent) Bytes() []byte { return buf } -func (v FocusInEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusInEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of FocusInEvent. func (v FocusInEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3588,9 +3512,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew } -// Event definition DeviceStateNotify (10) -// Size: 32 - +// DeviceStateNotify is the event number for a DeviceStateNotifyEvent. const DeviceStateNotify = 10 type DeviceStateNotifyEvent struct { @@ -3606,7 +3528,7 @@ type DeviceStateNotifyEvent struct { Valuators []uint32 // size: 12 } -// Event read DeviceStateNotify +// DeviceStateNotifyEventNew constructs a DeviceStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceStateNotifyEvent{} b := 1 // don't read event number @@ -3650,7 +3572,7 @@ func DeviceStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceStateNotify +// Bytes writes a DeviceStateNotifyEvent value to a byte slice. func (v DeviceStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3694,12 +3616,14 @@ func (v DeviceStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceStateNotifyEvent. func (v DeviceStateNotifyEvent) String() string { fieldVals := make([]string, 0, 9) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3716,9 +3640,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][10] = DeviceStateNotifyEventNew } -// Event definition DeviceMappingNotify (11) -// Size: 32 - +// DeviceMappingNotify is the event number for a DeviceMappingNotifyEvent. const DeviceMappingNotify = 11 type DeviceMappingNotifyEvent struct { @@ -3732,7 +3654,7 @@ type DeviceMappingNotifyEvent struct { // padding: 20 bytes } -// Event read DeviceMappingNotify +// DeviceMappingNotifyEventNew constructs a DeviceMappingNotifyEvent value that implements xgb.Event from a byte slice. func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { v := DeviceMappingNotifyEvent{} b := 1 // don't read event number @@ -3762,7 +3684,7 @@ func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceMappingNotify +// Bytes writes a DeviceMappingNotifyEvent value to a byte slice. func (v DeviceMappingNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3795,12 +3717,14 @@ func (v DeviceMappingNotifyEvent) Bytes() []byte { return buf } -func (v DeviceMappingNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceMappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceMappingNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceMappingNotifyEvent. func (v DeviceMappingNotifyEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3816,9 +3740,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew } -// Event definition ChangeDeviceNotify (12) -// Size: 32 - +// ChangeDeviceNotify is the event number for a ChangeDeviceNotifyEvent. const ChangeDeviceNotify = 12 type ChangeDeviceNotifyEvent struct { @@ -3829,7 +3751,7 @@ type ChangeDeviceNotifyEvent struct { // padding: 23 bytes } -// Event read ChangeDeviceNotify +// ChangeDeviceNotifyEventNew constructs a ChangeDeviceNotifyEvent value that implements xgb.Event from a byte slice. func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { v := ChangeDeviceNotifyEvent{} b := 1 // don't read event number @@ -3851,7 +3773,7 @@ func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ChangeDeviceNotify +// Bytes writes a ChangeDeviceNotifyEvent value to a byte slice. func (v ChangeDeviceNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3876,12 +3798,14 @@ func (v ChangeDeviceNotifyEvent) Bytes() []byte { return buf } -func (v ChangeDeviceNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ChangeDeviceNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ChangeDeviceNotifyEvent. func (v ChangeDeviceNotifyEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3895,9 +3819,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew } -// Event definition DeviceKeyStateNotify (13) -// Size: 32 - +// DeviceKeyStateNotify is the event number for a DeviceKeyStateNotifyEvent. const DeviceKeyStateNotify = 13 type DeviceKeyStateNotifyEvent struct { @@ -3906,7 +3828,7 @@ type DeviceKeyStateNotifyEvent struct { Keys []byte // size: 28 } -// Event read DeviceKeyStateNotify +// DeviceKeyStateNotifyEventNew constructs a DeviceKeyStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceKeyStateNotifyEvent{} b := 1 // don't read event number @@ -3924,7 +3846,7 @@ func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceKeyStateNotify +// Bytes writes a DeviceKeyStateNotifyEvent value to a byte slice. func (v DeviceKeyStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3944,12 +3866,14 @@ func (v DeviceKeyStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceKeyStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceKeyStateNotifyEvent. func (v DeviceKeyStateNotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3961,9 +3885,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew } -// Event definition DeviceButtonStateNotify (14) -// Size: 32 - +// DeviceButtonStateNotify is the event number for a DeviceButtonStateNotifyEvent. const DeviceButtonStateNotify = 14 type DeviceButtonStateNotifyEvent struct { @@ -3972,7 +3894,7 @@ type DeviceButtonStateNotifyEvent struct { Buttons []byte // size: 28 } -// Event read DeviceButtonStateNotify +// DeviceButtonStateNotifyEventNew constructs a DeviceButtonStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceButtonStateNotifyEvent{} b := 1 // don't read event number @@ -3990,7 +3912,7 @@ func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceButtonStateNotify +// Bytes writes a DeviceButtonStateNotifyEvent value to a byte slice. func (v DeviceButtonStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4010,12 +3932,14 @@ func (v DeviceButtonStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceButtonStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceButtonStateNotifyEvent. func (v DeviceButtonStateNotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4027,9 +3951,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew } -// Event definition DevicePresenceNotify (15) -// Size: 32 - +// DevicePresenceNotify is the event number for a DevicePresenceNotifyEvent. const DevicePresenceNotify = 15 type DevicePresenceNotifyEvent struct { @@ -4042,7 +3964,7 @@ type DevicePresenceNotifyEvent struct { // padding: 20 bytes } -// Event read DevicePresenceNotify +// DevicePresenceNotifyEventNew constructs a DevicePresenceNotifyEvent value that implements xgb.Event from a byte slice. func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { v := DevicePresenceNotifyEvent{} b := 1 // don't read event number @@ -4069,7 +3991,7 @@ func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DevicePresenceNotify +// Bytes writes a DevicePresenceNotifyEvent value to a byte slice. func (v DevicePresenceNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4099,12 +4021,14 @@ func (v DevicePresenceNotifyEvent) Bytes() []byte { return buf } -func (v DevicePresenceNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DevicePresenceNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DevicePresenceNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DevicePresenceNotifyEvent. func (v DevicePresenceNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4119,22 +4043,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew } -// EventCopy definition DeviceKeyRelease (2) - +// DeviceKeyRelease is the event number for a DeviceKeyReleaseEvent. const DeviceKeyRelease = 2 type DeviceKeyReleaseEvent DeviceKeyPressEvent +// DeviceKeyReleaseEventNew constructs a DeviceKeyReleaseEvent value that implements xgb.Event from a byte slice. func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceKeyReleaseEvent value to a byte slice. func (v DeviceKeyReleaseEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceKeyReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -4161,22 +4087,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew } -// EventCopy definition DeviceButtonPress (3) - +// DeviceButtonPress is the event number for a DeviceButtonPressEvent. const DeviceButtonPress = 3 type DeviceButtonPressEvent DeviceKeyPressEvent +// DeviceButtonPressEventNew constructs a DeviceButtonPressEvent value that implements xgb.Event from a byte slice. func DeviceButtonPressEventNew(buf []byte) xgb.Event { return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceButtonPressEvent value to a byte slice. func (v DeviceButtonPressEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceButtonPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonPressEvent) SequenceId() uint16 { return v.Sequence } @@ -4203,22 +4131,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew } -// EventCopy definition DeviceButtonRelease (4) - +// DeviceButtonRelease is the event number for a DeviceButtonReleaseEvent. const DeviceButtonRelease = 4 type DeviceButtonReleaseEvent DeviceKeyPressEvent +// DeviceButtonReleaseEventNew constructs a DeviceButtonReleaseEvent value that implements xgb.Event from a byte slice. func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceButtonReleaseEvent value to a byte slice. func (v DeviceButtonReleaseEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceButtonReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -4245,22 +4175,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew } -// EventCopy definition DeviceMotionNotify (5) - +// DeviceMotionNotify is the event number for a DeviceMotionNotifyEvent. const DeviceMotionNotify = 5 type DeviceMotionNotifyEvent DeviceKeyPressEvent +// DeviceMotionNotifyEventNew constructs a DeviceMotionNotifyEvent value that implements xgb.Event from a byte slice. func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceMotionNotifyEvent value to a byte slice. func (v DeviceMotionNotifyEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceMotionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceMotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceMotionNotifyEvent) SequenceId() uint16 { return v.Sequence } @@ -4287,22 +4219,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew } -// EventCopy definition ProximityIn (8) - +// ProximityIn is the event number for a ProximityInEvent. const ProximityIn = 8 type ProximityInEvent DeviceKeyPressEvent +// ProximityInEventNew constructs a ProximityInEvent value that implements xgb.Event from a byte slice. func ProximityInEventNew(buf []byte) xgb.Event { return ProximityInEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a ProximityInEvent value to a byte slice. func (v ProximityInEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v ProximityInEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ProximityIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ProximityInEvent) SequenceId() uint16 { return v.Sequence } @@ -4329,22 +4263,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][8] = ProximityInEventNew } -// EventCopy definition ProximityOut (9) - +// ProximityOut is the event number for a ProximityOutEvent. const ProximityOut = 9 type ProximityOutEvent DeviceKeyPressEvent +// ProximityOutEventNew constructs a ProximityOutEvent value that implements xgb.Event from a byte slice. func ProximityOutEventNew(buf []byte) xgb.Event { return ProximityOutEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a ProximityOutEvent value to a byte slice. func (v ProximityOutEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v ProximityOutEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ProximityOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ProximityOutEvent) SequenceId() uint16 { return v.Sequence } @@ -4371,22 +4307,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][9] = ProximityOutEventNew } -// EventCopy definition FocusOut (7) - +// FocusOut is the event number for a FocusOutEvent. const FocusOut = 7 type FocusOutEvent FocusInEvent +// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. func FocusOutEventNew(buf []byte) xgb.Event { return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) } +// Bytes writes a FocusOutEvent value to a byte slice. func (v FocusOutEvent) Bytes() []byte { return FocusInEvent(v).Bytes() } -func (v FocusOutEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusOutEvent) SequenceId() uint16 { return v.Sequence } @@ -4406,9 +4344,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew } -// Error definition Device (0) -// Size: 32 - +// BadDevice is the error number for a BadDevice. const BadDevice = 0 type DeviceError struct { @@ -4416,7 +4352,7 @@ type DeviceError struct { NiceName string } -// Error read Device +// DeviceErrorNew constructs a DeviceError value that implements xgb.Error from a byte slice. func DeviceErrorNew(buf []byte) xgb.Error { v := DeviceError{} v.NiceName = "Device" @@ -4430,8 +4366,8 @@ func DeviceErrorNew(buf []byte) xgb.Error { return v } -func (err DeviceError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDevice error. +// This is mostly used internally. func (err DeviceError) SequenceId() uint16 { return err.Sequence } @@ -4451,9 +4387,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew } -// Error definition Event (1) -// Size: 32 - +// BadEvent is the error number for a BadEvent. const BadEvent = 1 type EventError struct { @@ -4461,7 +4395,7 @@ type EventError struct { NiceName string } -// Error read Event +// EventErrorNew constructs a EventError value that implements xgb.Error from a byte slice. func EventErrorNew(buf []byte) xgb.Error { v := EventError{} v.NiceName = "Event" @@ -4475,8 +4409,8 @@ func EventErrorNew(buf []byte) xgb.Error { return v } -func (err EventError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadEvent error. +// This is mostly used internally. func (err EventError) SequenceId() uint16 { return err.Sequence } @@ -4496,9 +4430,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew } -// Error definition Mode (2) -// Size: 32 - +// BadMode is the error number for a BadMode. const BadMode = 2 type ModeError struct { @@ -4506,7 +4438,7 @@ type ModeError struct { NiceName string } -// Error read Mode +// ModeErrorNew constructs a ModeError value that implements xgb.Error from a byte slice. func ModeErrorNew(buf []byte) xgb.Error { v := ModeError{} v.NiceName = "Mode" @@ -4520,8 +4452,8 @@ func ModeErrorNew(buf []byte) xgb.Error { return v } -func (err ModeError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadMode error. +// This is mostly used internally. func (err ModeError) SequenceId() uint16 { return err.Sequence } @@ -4541,9 +4473,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew } -// Error definition DeviceBusy (3) -// Size: 32 - +// BadDeviceBusy is the error number for a BadDeviceBusy. const BadDeviceBusy = 3 type DeviceBusyError struct { @@ -4551,7 +4481,7 @@ type DeviceBusyError struct { NiceName string } -// Error read DeviceBusy +// DeviceBusyErrorNew constructs a DeviceBusyError value that implements xgb.Error from a byte slice. func DeviceBusyErrorNew(buf []byte) xgb.Error { v := DeviceBusyError{} v.NiceName = "DeviceBusy" @@ -4565,8 +4495,8 @@ func DeviceBusyErrorNew(buf []byte) xgb.Error { return v } -func (err DeviceBusyError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDeviceBusy error. +// This is mostly used internally. func (err DeviceBusyError) SequenceId() uint16 { return err.Sequence } @@ -4586,9 +4516,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew } -// Error definition Class (4) -// Size: 32 - +// BadClass is the error number for a BadClass. const BadClass = 4 type ClassError struct { @@ -4596,7 +4524,7 @@ type ClassError struct { NiceName string } -// Error read Class +// ClassErrorNew constructs a ClassError value that implements xgb.Error from a byte slice. func ClassErrorNew(buf []byte) xgb.Error { v := ClassError{} v.NiceName = "Class" @@ -4610,8 +4538,8 @@ func ClassErrorNew(buf []byte) xgb.Error { return v } -func (err ClassError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadClass error. +// This is mostly used internally. func (err ClassError) SequenceId() uint16 { return err.Sequence } @@ -4631,29 +4559,31 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew } -// Request GetExtensionVersion -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// GetExtensionVersionCookie is a cookie used only for GetExtensionVersion requests. type GetExtensionVersionCookie struct { *xgb.Cookie } +// GetExtensionVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} } +// GetExtensionVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} } -// Request reply for GetExtensionVersion -// size: 32 +// GetExtensionVersionReply represents the data returned from a GetExtensionVersion request. type GetExtensionVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajor uint16 ServerMinor uint16 @@ -4661,7 +4591,7 @@ type GetExtensionVersionReply struct { // padding: 19 bytes } -// Waits and reads reply data from request GetExtensionVersion +// Reply blocks and returns the reply data for a GetExtensionVersion request. func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4673,7 +4603,7 @@ func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) return getExtensionVersionReply(buf), nil } -// Read reply into structure from buffer for GetExtensionVersion +// getExtensionVersionReply reads a byte slice into a GetExtensionVersionReply value. func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { v := new(GetExtensionVersionReply) b := 1 // skip reply determinant @@ -4705,6 +4635,7 @@ func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { } // Write request to wire for GetExtensionVersion +// getExtensionVersionRequest writes a GetExtensionVersion request to a byte slice. func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -4730,36 +4661,38 @@ func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte return buf } -// Request ListInputDevices -// size: 4 +// ListInputDevicesCookie is a cookie used only for ListInputDevices requests. type ListInputDevicesCookie struct { *xgb.Cookie } +// ListInputDevices sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} } +// ListInputDevicesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} } -// Request reply for ListInputDevices -// size: (32 + xgb.Pad((int(DevicesLen) * 8))) +// ListInputDevicesReply represents the data returned from a ListInputDevices request. type ListInputDevicesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes DevicesLen byte // padding: 23 bytes Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) } -// Waits and reads reply data from request ListInputDevices +// Reply blocks and returns the reply data for a ListInputDevices request. func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4771,7 +4704,7 @@ func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { return listInputDevicesReply(buf), nil } -// Read reply into structure from buffer for ListInputDevices +// listInputDevicesReply reads a byte slice into a ListInputDevicesReply value. func listInputDevicesReply(buf []byte) *ListInputDevicesReply { v := new(ListInputDevicesReply) b := 1 // skip reply determinant @@ -4796,6 +4729,7 @@ func listInputDevicesReply(buf []byte) *ListInputDevicesReply { } // Write request to wire for ListInputDevices +// listInputDevicesRequest writes a ListInputDevices request to a byte slice. func listInputDevicesRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -4813,36 +4747,38 @@ func listInputDevicesRequest(c *xgb.Conn) []byte { return buf } -// Request OpenDevice -// size: 8 +// OpenDeviceCookie is a cookie used only for OpenDevice requests. type OpenDeviceCookie struct { *xgb.Cookie } +// OpenDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} } +// OpenDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} } -// Request reply for OpenDevice -// size: (32 + xgb.Pad((int(NumClasses) * 2))) +// OpenDeviceReply represents the data returned from a OpenDevice request. type OpenDeviceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumClasses byte // padding: 23 bytes ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) } -// Waits and reads reply data from request OpenDevice +// Reply blocks and returns the reply data for a OpenDevice request. func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4854,7 +4790,7 @@ func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { return openDeviceReply(buf), nil } -// Read reply into structure from buffer for OpenDevice +// openDeviceReply reads a byte slice into a OpenDeviceReply value. func openDeviceReply(buf []byte) *OpenDeviceReply { v := new(OpenDeviceReply) b := 1 // skip reply determinant @@ -4879,6 +4815,7 @@ func openDeviceReply(buf []byte) *OpenDeviceReply { } // Write request to wire for OpenDevice +// openDeviceRequest writes a OpenDevice request to a byte slice. func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -4901,30 +4838,35 @@ func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request CloseDevice -// size: 8 +// CloseDeviceCookie is a cookie used only for CloseDevice requests. type CloseDeviceCookie struct { *xgb.Cookie } -// Write request to wire for CloseDevice +// CloseDevice sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { cookie := c.NewCookie(false, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} } +// CloseDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseDeviceCookie.Check() func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { cookie := c.NewCookie(true, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CloseDeviceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CloseDevice +// closeDeviceRequest writes a CloseDevice request to a byte slice. func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -4947,35 +4889,37 @@ func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceMode -// size: 8 +// SetDeviceModeCookie is a cookie used only for SetDeviceMode requests. type SetDeviceModeCookie struct { *xgb.Cookie } +// SetDeviceMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} } +// SetDeviceModeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} } -// Request reply for SetDeviceMode -// size: 32 +// SetDeviceModeReply represents the data returned from a SetDeviceMode request. type SetDeviceModeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceMode +// Reply blocks and returns the reply data for a SetDeviceMode request. func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4987,7 +4931,7 @@ func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { return setDeviceModeReply(buf), nil } -// Read reply into structure from buffer for SetDeviceMode +// setDeviceModeReply reads a byte slice into a SetDeviceModeReply value. func setDeviceModeReply(buf []byte) *SetDeviceModeReply { v := new(SetDeviceModeReply) b := 1 // skip reply determinant @@ -5009,6 +4953,7 @@ func setDeviceModeReply(buf []byte) *SetDeviceModeReply { } // Write request to wire for SetDeviceMode +// setDeviceModeRequest writes a SetDeviceMode request to a byte slice. func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { size := 8 b := 0 @@ -5034,30 +4979,35 @@ func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { return buf } -// Request SelectExtensionEvent -// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +// SelectExtensionEventCookie is a cookie used only for SelectExtensionEvent requests. type SelectExtensionEventCookie struct { *xgb.Cookie } -// Write request to wire for SelectExtensionEvent +// SelectExtensionEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} } +// SelectExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectExtensionEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectExtensionEvent +// selectExtensionEventRequest writes a SelectExtensionEvent request to a byte slice. func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5089,29 +5039,31 @@ func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses u return buf } -// Request GetSelectedExtensionEvents -// size: 8 +// GetSelectedExtensionEventsCookie is a cookie used only for GetSelectedExtensionEvents requests. type GetSelectedExtensionEventsCookie struct { *xgb.Cookie } +// GetSelectedExtensionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} } +// GetSelectedExtensionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} } -// Request reply for GetSelectedExtensionEvents -// size: ((32 + xgb.Pad((int(NumThisClasses) * 4))) + xgb.Pad((int(NumAllClasses) * 4))) +// GetSelectedExtensionEventsReply represents the data returned from a GetSelectedExtensionEvents request. type GetSelectedExtensionEventsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumThisClasses uint16 NumAllClasses uint16 @@ -5120,7 +5072,7 @@ type GetSelectedExtensionEventsReply struct { AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) } -// Waits and reads reply data from request GetSelectedExtensionEvents +// Reply blocks and returns the reply data for a GetSelectedExtensionEvents request. func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5132,7 +5084,7 @@ func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEvent return getSelectedExtensionEventsReply(buf), nil } -// Read reply into structure from buffer for GetSelectedExtensionEvents +// getSelectedExtensionEventsReply reads a byte slice into a GetSelectedExtensionEventsReply value. func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { v := new(GetSelectedExtensionEventsReply) b := 1 // skip reply determinant @@ -5171,6 +5123,7 @@ func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsRepl } // Write request to wire for GetSelectedExtensionEvents +// getSelectedExtensionEventsRequest writes a GetSelectedExtensionEvents request to a byte slice. func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -5191,30 +5144,35 @@ func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte return buf } -// Request ChangeDeviceDontPropagateList -// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +// ChangeDeviceDontPropagateListCookie is a cookie used only for ChangeDeviceDontPropagateList requests. type ChangeDeviceDontPropagateListCookie struct { *xgb.Cookie } -// Write request to wire for ChangeDeviceDontPropagateList +// ChangeDeviceDontPropagateList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} } +// ChangeDeviceDontPropagateListChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDeviceDontPropagateListCookie.Check() func ChangeDeviceDontPropagateListChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeDeviceDontPropagateListCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeDeviceDontPropagateList +// changeDeviceDontPropagateListRequest writes a ChangeDeviceDontPropagateList request to a byte slice. func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) []byte { size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5249,36 +5207,38 @@ func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, Num return buf } -// Request GetDeviceDontPropagateList -// size: 8 +// GetDeviceDontPropagateListCookie is a cookie used only for GetDeviceDontPropagateList requests. type GetDeviceDontPropagateListCookie struct { *xgb.Cookie } +// GetDeviceDontPropagateList sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} } +// GetDeviceDontPropagateListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} } -// Request reply for GetDeviceDontPropagateList -// size: (32 + xgb.Pad((int(NumClasses) * 4))) +// GetDeviceDontPropagateListReply represents the data returned from a GetDeviceDontPropagateList request. type GetDeviceDontPropagateListReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumClasses uint16 // padding: 22 bytes Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) } -// Waits and reads reply data from request GetDeviceDontPropagateList +// Reply blocks and returns the reply data for a GetDeviceDontPropagateList request. func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5290,7 +5250,7 @@ func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateLis return getDeviceDontPropagateListReply(buf), nil } -// Read reply into structure from buffer for GetDeviceDontPropagateList +// getDeviceDontPropagateListReply reads a byte slice into a GetDeviceDontPropagateListReply value. func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { v := new(GetDeviceDontPropagateListReply) b := 1 // skip reply determinant @@ -5319,6 +5279,7 @@ func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListRepl } // Write request to wire for GetDeviceDontPropagateList +// getDeviceDontPropagateListRequest writes a GetDeviceDontPropagateList request to a byte slice. func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -5339,29 +5300,31 @@ func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte return buf } -// Request GetDeviceMotionEvents -// size: 16 +// GetDeviceMotionEventsCookie is a cookie used only for GetDeviceMotionEvents requests. type GetDeviceMotionEventsCookie struct { *xgb.Cookie } +// GetDeviceMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} } +// GetDeviceMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} } -// Request reply for GetDeviceMotionEvents -// size: 32 +// GetDeviceMotionEventsReply represents the data returned from a GetDeviceMotionEvents request. type GetDeviceMotionEventsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumCoords uint32 NumAxes byte @@ -5369,7 +5332,7 @@ type GetDeviceMotionEventsReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetDeviceMotionEvents +// Reply blocks and returns the reply data for a GetDeviceMotionEvents request. func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5381,7 +5344,7 @@ func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, er return getDeviceMotionEventsReply(buf), nil } -// Read reply into structure from buffer for GetDeviceMotionEvents +// getDeviceMotionEventsReply reads a byte slice into a GetDeviceMotionEventsReply value. func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { v := new(GetDeviceMotionEventsReply) b := 1 // skip reply determinant @@ -5409,6 +5372,7 @@ func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { } // Write request to wire for GetDeviceMotionEvents +// getDeviceMotionEventsRequest writes a GetDeviceMotionEvents request to a byte slice. func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { size := 16 b := 0 @@ -5435,35 +5399,37 @@ func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xpro return buf } -// Request ChangeKeyboardDevice -// size: 8 +// ChangeKeyboardDeviceCookie is a cookie used only for ChangeKeyboardDevice requests. type ChangeKeyboardDeviceCookie struct { *xgb.Cookie } +// ChangeKeyboardDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling ChangeKeyboardDeviceCookie.Reply() func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} } +// ChangeKeyboardDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardDeviceUnchecked(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} } -// Request reply for ChangeKeyboardDevice -// size: 32 +// ChangeKeyboardDeviceReply represents the data returned from a ChangeKeyboardDevice request. type ChangeKeyboardDeviceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request ChangeKeyboardDevice +// Reply blocks and returns the reply data for a ChangeKeyboardDevice request. func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5475,7 +5441,7 @@ func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, erro return changeKeyboardDeviceReply(buf), nil } -// Read reply into structure from buffer for ChangeKeyboardDevice +// changeKeyboardDeviceReply reads a byte slice into a ChangeKeyboardDeviceReply value. func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { v := new(ChangeKeyboardDeviceReply) b := 1 // skip reply determinant @@ -5497,6 +5463,7 @@ func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { } // Write request to wire for ChangeKeyboardDevice +// changeKeyboardDeviceRequest writes a ChangeKeyboardDevice request to a byte slice. func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -5519,35 +5486,37 @@ func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request ChangePointerDevice -// size: 8 +// ChangePointerDeviceCookie is a cookie used only for ChangePointerDevice requests. type ChangePointerDeviceCookie struct { *xgb.Cookie } +// ChangePointerDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling ChangePointerDeviceCookie.Reply() func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} } +// ChangePointerDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePointerDeviceUnchecked(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} } -// Request reply for ChangePointerDevice -// size: 32 +// ChangePointerDeviceReply represents the data returned from a ChangePointerDevice request. type ChangePointerDeviceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request ChangePointerDevice +// Reply blocks and returns the reply data for a ChangePointerDevice request. func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5559,7 +5528,7 @@ func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) return changePointerDeviceReply(buf), nil } -// Read reply into structure from buffer for ChangePointerDevice +// changePointerDeviceReply reads a byte slice into a ChangePointerDeviceReply value. func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { v := new(ChangePointerDeviceReply) b := 1 // skip reply determinant @@ -5581,6 +5550,7 @@ func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { } // Write request to wire for ChangePointerDevice +// changePointerDeviceRequest writes a ChangePointerDevice request to a byte slice. func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) []byte { size := 8 b := 0 @@ -5609,35 +5579,37 @@ func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId by return buf } -// Request GrabDevice -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceCookie is a cookie used only for GrabDevice requests. type GrabDeviceCookie struct { *xgb.Cookie } +// GrabDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabDeviceCookie.Reply() func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} } +// GrabDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceUnchecked(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} } -// Request reply for GrabDevice -// size: 32 +// GrabDeviceReply represents the data returned from a GrabDevice request. type GrabDeviceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request GrabDevice +// Reply blocks and returns the reply data for a GrabDevice request. func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5649,7 +5621,7 @@ func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { return grabDeviceReply(buf), nil } -// Read reply into structure from buffer for GrabDevice +// grabDeviceReply reads a byte slice into a GrabDeviceReply value. func grabDeviceReply(buf []byte) *GrabDeviceReply { v := new(GrabDeviceReply) b := 1 // skip reply determinant @@ -5671,6 +5643,7 @@ func grabDeviceReply(buf []byte) *GrabDeviceReply { } // Write request to wire for GrabDevice +// grabDeviceRequest writes a GrabDevice request to a byte slice. func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5721,30 +5694,35 @@ func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timest return buf } -// Request UngrabDevice -// size: 12 +// UngrabDeviceCookie is a cookie used only for UngrabDevice requests. type UngrabDeviceCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDevice +// UngrabDevice sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} } +// UngrabDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabDeviceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDevice +// ungrabDeviceRequest writes a UngrabDevice request to a byte slice. func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { size := 12 b := 0 @@ -5768,30 +5746,35 @@ func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []by return buf } -// Request GrabDeviceKey -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceKeyCookie is a cookie used only for GrabDeviceKey requests. type GrabDeviceKeyCookie struct { *xgb.Cookie } -// Write request to wire for GrabDeviceKey +// GrabDeviceKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} } +// GrabDeviceKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabDeviceKeyCookie.Check() func GrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabDeviceKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabDeviceKey +// grabDeviceKeyRequest writes a GrabDeviceKey request to a byte slice. func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5848,30 +5831,35 @@ func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint return buf } -// Request UngrabDeviceKey -// size: 16 +// UngrabDeviceKeyCookie is a cookie used only for UngrabDeviceKey requests. type UngrabDeviceKeyCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDeviceKey +// UngrabDeviceKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} } +// UngrabDeviceKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabDeviceKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDeviceKey +// ungrabDeviceKeyRequest writes a UngrabDeviceKey request to a byte slice. func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { size := 16 b := 0 @@ -5904,30 +5892,35 @@ func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uin return buf } -// Request GrabDeviceButton -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceButtonCookie is a cookie used only for GrabDeviceButton requests. type GrabDeviceButtonCookie struct { *xgb.Cookie } -// Write request to wire for GrabDeviceButton +// GrabDeviceButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} } +// GrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabDeviceButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabDeviceButton +// grabDeviceButtonRequest writes a GrabDeviceButton request to a byte slice. func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5980,30 +5973,35 @@ func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevic return buf } -// Request UngrabDeviceButton -// size: 16 +// UngrabDeviceButtonCookie is a cookie used only for UngrabDeviceButton requests. type UngrabDeviceButtonCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDeviceButton +// UngrabDeviceButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} } +// UngrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabDeviceButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDeviceButton +// ungrabDeviceButtonRequest writes a UngrabDeviceButton request to a byte slice. func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { size := 16 b := 0 @@ -6036,30 +6034,35 @@ func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers return buf } -// Request AllowDeviceEvents -// size: 12 +// AllowDeviceEventsCookie is a cookie used only for AllowDeviceEvents requests. type AllowDeviceEventsCookie struct { *xgb.Cookie } -// Write request to wire for AllowDeviceEvents +// AllowDeviceEvents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { cookie := c.NewCookie(false, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} } +// AllowDeviceEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { cookie := c.NewCookie(true, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AllowDeviceEventsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AllowDeviceEvents +// allowDeviceEventsRequest writes a AllowDeviceEvents request to a byte slice. func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { size := 12 b := 0 @@ -6086,29 +6089,31 @@ func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, Dev return buf } -// Request GetDeviceFocus -// size: 8 +// GetDeviceFocusCookie is a cookie used only for GetDeviceFocus requests. type GetDeviceFocusCookie struct { *xgb.Cookie } +// GetDeviceFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} } +// GetDeviceFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} } -// Request reply for GetDeviceFocus -// size: 32 +// GetDeviceFocusReply represents the data returned from a GetDeviceFocus request. type GetDeviceFocusReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Focus xproto.Window Time xproto.Timestamp @@ -6116,7 +6121,7 @@ type GetDeviceFocusReply struct { // padding: 15 bytes } -// Waits and reads reply data from request GetDeviceFocus +// Reply blocks and returns the reply data for a GetDeviceFocus request. func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6128,7 +6133,7 @@ func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { return getDeviceFocusReply(buf), nil } -// Read reply into structure from buffer for GetDeviceFocus +// getDeviceFocusReply reads a byte slice into a GetDeviceFocusReply value. func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { v := new(GetDeviceFocusReply) b := 1 // skip reply determinant @@ -6156,6 +6161,7 @@ func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { } // Write request to wire for GetDeviceFocus +// getDeviceFocusRequest writes a GetDeviceFocus request to a byte slice. func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6178,30 +6184,35 @@ func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceFocus -// size: 16 +// SetDeviceFocusCookie is a cookie used only for SetDeviceFocus requests. type SetDeviceFocusCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceFocus +// SetDeviceFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} } +// SetDeviceFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetDeviceFocusCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceFocus +// setDeviceFocusRequest writes a SetDeviceFocus request to a byte slice. func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { size := 16 b := 0 @@ -6231,35 +6242,37 @@ func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timesta return buf } -// Request GetFeedbackControl -// size: 8 +// GetFeedbackControlCookie is a cookie used only for GetFeedbackControl requests. type GetFeedbackControlCookie struct { *xgb.Cookie } +// GetFeedbackControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} } +// GetFeedbackControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} } -// Request reply for GetFeedbackControl -// size: 32 +// GetFeedbackControlReply represents the data returned from a GetFeedbackControl request. type GetFeedbackControlReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumFeedback uint16 // padding: 22 bytes } -// Waits and reads reply data from request GetFeedbackControl +// Reply blocks and returns the reply data for a GetFeedbackControl request. func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6271,7 +6284,7 @@ func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { return getFeedbackControlReply(buf), nil } -// Read reply into structure from buffer for GetFeedbackControl +// getFeedbackControlReply reads a byte slice into a GetFeedbackControlReply value. func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { v := new(GetFeedbackControlReply) b := 1 // skip reply determinant @@ -6293,6 +6306,7 @@ func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { } // Write request to wire for GetFeedbackControl +// getFeedbackControlRequest writes a GetFeedbackControl request to a byte slice. func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6315,36 +6329,38 @@ func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request GetDeviceKeyMapping -// size: 8 +// GetDeviceKeyMappingCookie is a cookie used only for GetDeviceKeyMapping requests. type GetDeviceKeyMappingCookie struct { *xgb.Cookie } +// GetDeviceKeyMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} } +// GetDeviceKeyMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} } -// Request reply for GetDeviceKeyMapping -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetDeviceKeyMappingReply represents the data returned from a GetDeviceKeyMapping request. type GetDeviceKeyMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes KeysymsPerKeycode byte // padding: 23 bytes Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetDeviceKeyMapping +// Reply blocks and returns the reply data for a GetDeviceKeyMapping request. func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6356,7 +6372,7 @@ func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) return getDeviceKeyMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceKeyMapping +// getDeviceKeyMappingReply reads a byte slice into a GetDeviceKeyMappingReply value. func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { v := new(GetDeviceKeyMappingReply) b := 1 // skip reply determinant @@ -6385,6 +6401,7 @@ func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { } // Write request to wire for GetDeviceKeyMapping +// getDeviceKeyMappingRequest writes a GetDeviceKeyMapping request to a byte slice. func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { size := 8 b := 0 @@ -6411,30 +6428,35 @@ func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode return buf } -// Request ChangeDeviceKeyMapping -// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +// ChangeDeviceKeyMappingCookie is a cookie used only for ChangeDeviceKeyMapping requests. type ChangeDeviceKeyMappingCookie struct { *xgb.Cookie } -// Write request to wire for ChangeDeviceKeyMapping +// ChangeDeviceKeyMapping sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} } +// ChangeDeviceKeyMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeDeviceKeyMappingCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeDeviceKeyMapping +// changeDeviceKeyMappingRequest writes a ChangeDeviceKeyMapping request to a byte slice. func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 @@ -6470,36 +6492,38 @@ func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyC return buf } -// Request GetDeviceModifierMapping -// size: 8 +// GetDeviceModifierMappingCookie is a cookie used only for GetDeviceModifierMapping requests. type GetDeviceModifierMappingCookie struct { *xgb.Cookie } +// GetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} } +// GetDeviceModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} } -// Request reply for GetDeviceModifierMapping -// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) +// GetDeviceModifierMappingReply represents the data returned from a GetDeviceModifierMapping request. type GetDeviceModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes KeycodesPerModifier byte // padding: 23 bytes Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) } -// Waits and reads reply data from request GetDeviceModifierMapping +// Reply blocks and returns the reply data for a GetDeviceModifierMapping request. func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6511,7 +6535,7 @@ func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingRep return getDeviceModifierMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceModifierMapping +// getDeviceModifierMappingReply reads a byte slice into a GetDeviceModifierMappingReply value. func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { v := new(GetDeviceModifierMappingReply) b := 1 // skip reply determinant @@ -6537,6 +6561,7 @@ func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { } // Write request to wire for GetDeviceModifierMapping +// getDeviceModifierMappingRequest writes a GetDeviceModifierMapping request to a byte slice. func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6559,35 +6584,37 @@ func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceModifierMapping -// size: xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) +// SetDeviceModifierMappingCookie is a cookie used only for SetDeviceModifierMapping requests. type SetDeviceModifierMappingCookie struct { *xgb.Cookie } +// SetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} } +// SetDeviceModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} } -// Request reply for SetDeviceModifierMapping -// size: 32 +// SetDeviceModifierMappingReply represents the data returned from a SetDeviceModifierMapping request. type SetDeviceModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceModifierMapping +// Reply blocks and returns the reply data for a SetDeviceModifierMapping request. func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6599,7 +6626,7 @@ func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingRep return setDeviceModifierMappingReply(buf), nil } -// Read reply into structure from buffer for SetDeviceModifierMapping +// setDeviceModifierMappingReply reads a byte slice into a SetDeviceModifierMappingReply value. func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { v := new(SetDeviceModifierMappingReply) b := 1 // skip reply determinant @@ -6621,6 +6648,7 @@ func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { } // Write request to wire for SetDeviceModifierMapping +// setDeviceModifierMappingRequest writes a SetDeviceModifierMapping request to a byte slice. func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 @@ -6649,36 +6677,38 @@ func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModi return buf } -// Request GetDeviceButtonMapping -// size: 8 +// GetDeviceButtonMappingCookie is a cookie used only for GetDeviceButtonMapping requests. type GetDeviceButtonMappingCookie struct { *xgb.Cookie } +// GetDeviceButtonMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} } +// GetDeviceButtonMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} } -// Request reply for GetDeviceButtonMapping -// size: (32 + xgb.Pad((int(MapSize) * 1))) +// GetDeviceButtonMappingReply represents the data returned from a GetDeviceButtonMapping request. type GetDeviceButtonMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MapSize byte // padding: 23 bytes Map []byte // size: xgb.Pad((int(MapSize) * 1)) } -// Waits and reads reply data from request GetDeviceButtonMapping +// Reply blocks and returns the reply data for a GetDeviceButtonMapping request. func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6690,7 +6720,7 @@ func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, return getDeviceButtonMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceButtonMapping +// getDeviceButtonMappingReply reads a byte slice into a GetDeviceButtonMappingReply value. func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { v := new(GetDeviceButtonMappingReply) b := 1 // skip reply determinant @@ -6716,6 +6746,7 @@ func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { } // Write request to wire for GetDeviceButtonMapping +// getDeviceButtonMappingRequest writes a GetDeviceButtonMapping request to a byte slice. func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6738,35 +6769,37 @@ func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceButtonMapping -// size: xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) +// SetDeviceButtonMappingCookie is a cookie used only for SetDeviceButtonMapping requests. type SetDeviceButtonMappingCookie struct { *xgb.Cookie } +// SetDeviceButtonMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceButtonMappingCookie.Reply() func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} } +// SetDeviceButtonMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} } -// Request reply for SetDeviceButtonMapping -// size: 32 +// SetDeviceButtonMappingReply represents the data returned from a SetDeviceButtonMapping request. type SetDeviceButtonMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceButtonMapping +// Reply blocks and returns the reply data for a SetDeviceButtonMapping request. func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6778,7 +6811,7 @@ func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, return setDeviceButtonMappingReply(buf), nil } -// Read reply into structure from buffer for SetDeviceButtonMapping +// setDeviceButtonMappingReply reads a byte slice into a SetDeviceButtonMappingReply value. func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { v := new(SetDeviceButtonMappingReply) b := 1 // skip reply determinant @@ -6800,6 +6833,7 @@ func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { } // Write request to wire for SetDeviceButtonMapping +// setDeviceButtonMappingRequest writes a SetDeviceButtonMapping request to a byte slice. func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) []byte { size := xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) b := 0 @@ -6828,35 +6862,37 @@ func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map return buf } -// Request QueryDeviceState -// size: 8 +// QueryDeviceStateCookie is a cookie used only for QueryDeviceState requests. type QueryDeviceStateCookie struct { *xgb.Cookie } +// QueryDeviceState sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} } +// QueryDeviceStateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} } -// Request reply for QueryDeviceState -// size: 32 +// QueryDeviceStateReply represents the data returned from a QueryDeviceState request. type QueryDeviceStateReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumClasses byte // padding: 23 bytes } -// Waits and reads reply data from request QueryDeviceState +// Reply blocks and returns the reply data for a QueryDeviceState request. func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6868,7 +6904,7 @@ func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { return queryDeviceStateReply(buf), nil } -// Read reply into structure from buffer for QueryDeviceState +// queryDeviceStateReply reads a byte slice into a QueryDeviceStateReply value. func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { v := new(QueryDeviceStateReply) b := 1 // skip reply determinant @@ -6890,6 +6926,7 @@ func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { } // Write request to wire for QueryDeviceState +// queryDeviceStateRequest writes a QueryDeviceState request to a byte slice. func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6912,30 +6949,35 @@ func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SendExtensionEvent -// size: xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) +// SendExtensionEventCookie is a cookie used only for SendExtensionEvent requests. type SendExtensionEventCookie struct { *xgb.Cookie } -// Write request to wire for SendExtensionEvent +// SendExtensionEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} } +// SendExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SendExtensionEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SendExtensionEvent +// sendExtensionEventRequest writes a SendExtensionEvent request to a byte slice. func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -6983,30 +7025,35 @@ func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId return buf } -// Request DeviceBell -// size: 8 +// DeviceBellCookie is a cookie used only for DeviceBell requests. type DeviceBellCookie struct { *xgb.Cookie } -// Write request to wire for DeviceBell +// DeviceBell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { cookie := c.NewCookie(false, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} } +// DeviceBellChecked sends a checked request. +// If an error occurs, it can be retrieved using DeviceBellCookie.Check() func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { cookie := c.NewCookie(true, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeviceBellCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeviceBell +// deviceBellRequest writes a DeviceBell request to a byte slice. func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { size := 8 b := 0 @@ -7036,35 +7083,37 @@ func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClas return buf } -// Request SetDeviceValuators -// size: xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) +// SetDeviceValuatorsCookie is a cookie used only for SetDeviceValuators requests. type SetDeviceValuatorsCookie struct { *xgb.Cookie } +// SetDeviceValuators sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceValuatorsCookie.Reply() func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} } +// SetDeviceValuatorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceValuatorsUnchecked(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} } -// Request reply for SetDeviceValuators -// size: 32 +// SetDeviceValuatorsReply represents the data returned from a SetDeviceValuators request. type SetDeviceValuatorsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceValuators +// Reply blocks and returns the reply data for a SetDeviceValuators request. func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7076,7 +7125,7 @@ func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { return setDeviceValuatorsReply(buf), nil } -// Read reply into structure from buffer for SetDeviceValuators +// setDeviceValuatorsReply reads a byte slice into a SetDeviceValuatorsReply value. func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { v := new(SetDeviceValuatorsReply) b := 1 // skip reply determinant @@ -7098,6 +7147,7 @@ func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { } // Write request to wire for SetDeviceValuators +// setDeviceValuatorsRequest writes a SetDeviceValuators request to a byte slice. func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { size := xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) b := 0 @@ -7132,35 +7182,37 @@ func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, N return buf } -// Request GetDeviceControl -// size: 8 +// GetDeviceControlCookie is a cookie used only for GetDeviceControl requests. type GetDeviceControlCookie struct { *xgb.Cookie } +// GetDeviceControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} } +// GetDeviceControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} } -// Request reply for GetDeviceControl -// size: 32 +// GetDeviceControlReply represents the data returned from a GetDeviceControl request. type GetDeviceControlReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Status byte // padding: 23 bytes } -// Waits and reads reply data from request GetDeviceControl +// Reply blocks and returns the reply data for a GetDeviceControl request. func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7172,7 +7224,7 @@ func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { return getDeviceControlReply(buf), nil } -// Read reply into structure from buffer for GetDeviceControl +// getDeviceControlReply reads a byte slice into a GetDeviceControlReply value. func getDeviceControlReply(buf []byte) *GetDeviceControlReply { v := new(GetDeviceControlReply) b := 1 // skip reply determinant @@ -7194,6 +7246,7 @@ func getDeviceControlReply(buf []byte) *GetDeviceControlReply { } // Write request to wire for GetDeviceControl +// getDeviceControlRequest writes a GetDeviceControl request to a byte slice. func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { size := 8 b := 0 diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 0037a22..237b6b5 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xprint.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + const ( GetDocFinished = 0 GetDocSecondConsumer = 1 @@ -106,8 +106,6 @@ func NewPcontextId(c *xgb.Conn) (Pcontext, error) { type String8 byte -// 'Printer' struct definition -// Size: (((4 + xgb.Pad((int(NameLen) * 1))) + 4) + xgb.Pad((int(DescLen) * 1))) type Printer struct { NameLen uint32 Name []String8 // size: xgb.Pad((int(NameLen) * 1)) @@ -115,7 +113,7 @@ type Printer struct { Description []String8 // size: xgb.Pad((int(DescLen) * 1)) } -// Struct read Printer +// PrinterRead reads a byte slice into a Printer value. func PrinterRead(buf []byte, v *Printer) int { b := 0 @@ -142,7 +140,7 @@ func PrinterRead(buf []byte, v *Printer) int { return b } -// Struct list read Printer +// PrinterReadList reads a byte slice into a list of Printer values. func PrinterReadList(buf []byte, dest []Printer) int { b := 0 for i := 0; i < len(dest); i++ { @@ -152,7 +150,7 @@ func PrinterReadList(buf []byte, dest []Printer) int { return xgb.Pad(b) } -// Struct write Printer +// Bytes writes a Printer value to a byte slice. func (v Printer) Bytes() []byte { buf := make([]byte, (((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + xgb.Pad((int(v.DescLen) * 1)))) b := 0 @@ -178,7 +176,7 @@ func (v Printer) Bytes() []byte { return buf } -// Write struct list Printer +// PrinterListBytes writes a list of %s(MISSING) values to a byte slice. func PrinterListBytes(buf []byte, list []Printer) int { b := 0 var structBytes []byte @@ -190,7 +188,7 @@ func PrinterListBytes(buf []byte, list []Printer) int { return b } -// Struct list size Printer +// PrinterListSize computes the size (bytes) of a list of Printer values. func PrinterListSize(list []Printer) int { size := 0 for _, item := range list { @@ -199,9 +197,7 @@ func PrinterListSize(list []Printer) int { return size } -// Event definition Notify (0) -// Size: 32 - +// Notify is the event number for a NotifyEvent. const Notify = 0 type NotifyEvent struct { @@ -211,7 +207,7 @@ type NotifyEvent struct { Cancel bool } -// Event read Notify +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number @@ -235,7 +231,7 @@ func NotifyEventNew(buf []byte) xgb.Event { return v } -// Event write Notify +// Bytes writes a NotifyEvent value to a byte slice. func (v NotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -262,12 +258,14 @@ func (v NotifyEvent) Bytes() []byte { return buf } -func (v NotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -281,9 +279,7 @@ func init() { xgb.NewExtEventFuncs["XpExtension"][0] = NotifyEventNew } -// Event definition AttributNotify (1) -// Size: 32 - +// AttributNotify is the event number for a AttributNotifyEvent. const AttributNotify = 1 type AttributNotifyEvent struct { @@ -292,7 +288,7 @@ type AttributNotifyEvent struct { Context Pcontext } -// Event read AttributNotify +// AttributNotifyEventNew constructs a AttributNotifyEvent value that implements xgb.Event from a byte slice. func AttributNotifyEventNew(buf []byte) xgb.Event { v := AttributNotifyEvent{} b := 1 // don't read event number @@ -309,7 +305,7 @@ func AttributNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write AttributNotify +// Bytes writes a AttributNotifyEvent value to a byte slice. func (v AttributNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -329,12 +325,14 @@ func (v AttributNotifyEvent) Bytes() []byte { return buf } -func (v AttributNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the AttributNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v AttributNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of AttributNotifyEvent. func (v AttributNotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -347,9 +345,7 @@ func init() { xgb.NewExtEventFuncs["XpExtension"][1] = AttributNotifyEventNew } -// Error definition BadContext (0) -// Size: 32 - +// BadBadContext is the error number for a BadBadContext. const BadBadContext = 0 type BadContextError struct { @@ -357,7 +353,7 @@ type BadContextError struct { NiceName string } -// Error read BadContext +// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. func BadContextErrorNew(buf []byte) xgb.Error { v := BadContextError{} v.NiceName = "BadContext" @@ -371,8 +367,8 @@ func BadContextErrorNew(buf []byte) xgb.Error { return v } -func (err BadContextError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadContext error. +// This is mostly used internally. func (err BadContextError) SequenceId() uint16 { return err.Sequence } @@ -392,9 +388,7 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"][0] = BadContextErrorNew } -// Error definition BadSequence (1) -// Size: 32 - +// BadBadSequence is the error number for a BadBadSequence. const BadBadSequence = 1 type BadSequenceError struct { @@ -402,7 +396,7 @@ type BadSequenceError struct { NiceName string } -// Error read BadSequence +// BadSequenceErrorNew constructs a BadSequenceError value that implements xgb.Error from a byte slice. func BadSequenceErrorNew(buf []byte) xgb.Error { v := BadSequenceError{} v.NiceName = "BadSequence" @@ -416,8 +410,8 @@ func BadSequenceErrorNew(buf []byte) xgb.Error { return v } -func (err BadSequenceError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadSequence error. +// This is mostly used internally. func (err BadSequenceError) SequenceId() uint16 { return err.Sequence } @@ -437,35 +431,37 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"][1] = BadSequenceErrorNew } -// Request PrintQueryVersion -// size: 4 +// PrintQueryVersionCookie is a cookie used only for PrintQueryVersion requests. type PrintQueryVersionCookie struct { *xgb.Cookie } +// PrintQueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(printQueryVersionRequest(c), cookie) return PrintQueryVersionCookie{cookie} } +// PrintQueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(printQueryVersionRequest(c), cookie) return PrintQueryVersionCookie{cookie} } -// Request reply for PrintQueryVersion -// size: 12 +// PrintQueryVersionReply represents the data returned from a PrintQueryVersion request. type PrintQueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MajorVersion uint16 MinorVersion uint16 } -// Waits and reads reply data from request PrintQueryVersion +// Reply blocks and returns the reply data for a PrintQueryVersion request. func (cook PrintQueryVersionCookie) Reply() (*PrintQueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -477,7 +473,7 @@ func (cook PrintQueryVersionCookie) Reply() (*PrintQueryVersionReply, error) { return printQueryVersionReply(buf), nil } -// Read reply into structure from buffer for PrintQueryVersion +// printQueryVersionReply reads a byte slice into a PrintQueryVersionReply value. func printQueryVersionReply(buf []byte) *PrintQueryVersionReply { v := new(PrintQueryVersionReply) b := 1 // skip reply determinant @@ -500,6 +496,7 @@ func printQueryVersionReply(buf []byte) *PrintQueryVersionReply { } // Write request to wire for PrintQueryVersion +// printQueryVersionRequest writes a PrintQueryVersion request to a byte slice. func printQueryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -517,36 +514,38 @@ func printQueryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request PrintGetPrinterList -// size: xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) +// PrintGetPrinterListCookie is a cookie used only for PrintGetPrinterList requests. type PrintGetPrinterListCookie struct { *xgb.Cookie } +// PrintGetPrinterList sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return PrintGetPrinterListCookie{cookie} } +// PrintGetPrinterListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return PrintGetPrinterListCookie{cookie} } -// Request reply for PrintGetPrinterList -// size: (32 + PrinterListSize(Printers)) +// PrintGetPrinterListReply represents the data returned from a PrintGetPrinterList request. type PrintGetPrinterListReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ListCount uint32 // padding: 20 bytes Printers []Printer // size: PrinterListSize(Printers) } -// Waits and reads reply data from request PrintGetPrinterList +// Reply blocks and returns the reply data for a PrintGetPrinterList request. func (cook PrintGetPrinterListCookie) Reply() (*PrintGetPrinterListReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -558,7 +557,7 @@ func (cook PrintGetPrinterListCookie) Reply() (*PrintGetPrinterListReply, error) return printGetPrinterListReply(buf), nil } -// Read reply into structure from buffer for PrintGetPrinterList +// printGetPrinterListReply reads a byte slice into a PrintGetPrinterListReply value. func printGetPrinterListReply(buf []byte) *PrintGetPrinterListReply { v := new(PrintGetPrinterListReply) b := 1 // skip reply determinant @@ -583,6 +582,7 @@ func printGetPrinterListReply(buf []byte) *PrintGetPrinterListReply { } // Write request to wire for PrintGetPrinterList +// printGetPrinterListRequest writes a PrintGetPrinterList request to a byte slice. func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { size := xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) b := 0 @@ -618,30 +618,35 @@ func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen ui return buf } -// Request PrintRehashPrinterList -// size: 4 +// PrintRehashPrinterListCookie is a cookie used only for PrintRehashPrinterList requests. type PrintRehashPrinterListCookie struct { *xgb.Cookie } -// Write request to wire for PrintRehashPrinterList +// PrintRehashPrinterList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { cookie := c.NewCookie(false, false) c.NewRequest(printRehashPrinterListRequest(c), cookie) return PrintRehashPrinterListCookie{cookie} } +// PrintRehashPrinterListChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { cookie := c.NewCookie(true, false) c.NewRequest(printRehashPrinterListRequest(c), cookie) return PrintRehashPrinterListCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintRehashPrinterListCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintRehashPrinterList +// printRehashPrinterListRequest writes a PrintRehashPrinterList request to a byte slice. func printRehashPrinterListRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -659,30 +664,35 @@ func printRehashPrinterListRequest(c *xgb.Conn) []byte { return buf } -// Request CreateContext -// size: xgb.Pad(((16 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) +// CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie } -// Write request to wire for CreateContext +// CreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return CreateContextCookie{cookie} } +// CreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return CreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { size := xgb.Pad(((16 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) b := 0 @@ -721,30 +731,35 @@ func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, return buf } -// Request PrintSetContext -// size: 8 +// PrintSetContextCookie is a cookie used only for PrintSetContext requests. type PrintSetContextCookie struct { *xgb.Cookie } -// Write request to wire for PrintSetContext +// PrintSetContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(printSetContextRequest(c, Context), cookie) return PrintSetContextCookie{cookie} } +// PrintSetContextChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSetContextCookie.Check() func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(printSetContextRequest(c, Context), cookie) return PrintSetContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintSetContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintSetContext +// printSetContextRequest writes a PrintSetContext request to a byte slice. func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { size := 8 b := 0 @@ -765,34 +780,36 @@ func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { return buf } -// Request PrintGetContext -// size: 4 +// PrintGetContextCookie is a cookie used only for PrintGetContext requests. type PrintGetContextCookie struct { *xgb.Cookie } +// PrintGetContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetContextCookie.Reply() func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetContextRequest(c), cookie) return PrintGetContextCookie{cookie} } +// PrintGetContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetContextUnchecked(c *xgb.Conn) PrintGetContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetContextRequest(c), cookie) return PrintGetContextCookie{cookie} } -// Request reply for PrintGetContext -// size: 12 +// PrintGetContextReply represents the data returned from a PrintGetContext request. type PrintGetContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Context uint32 } -// Waits and reads reply data from request PrintGetContext +// Reply blocks and returns the reply data for a PrintGetContext request. func (cook PrintGetContextCookie) Reply() (*PrintGetContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -804,7 +821,7 @@ func (cook PrintGetContextCookie) Reply() (*PrintGetContextReply, error) { return printGetContextReply(buf), nil } -// Read reply into structure from buffer for PrintGetContext +// printGetContextReply reads a byte slice into a PrintGetContextReply value. func printGetContextReply(buf []byte) *PrintGetContextReply { v := new(PrintGetContextReply) b := 1 // skip reply determinant @@ -824,6 +841,7 @@ func printGetContextReply(buf []byte) *PrintGetContextReply { } // Write request to wire for PrintGetContext +// printGetContextRequest writes a PrintGetContext request to a byte slice. func printGetContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -841,30 +859,35 @@ func printGetContextRequest(c *xgb.Conn) []byte { return buf } -// Request PrintDestroyContext -// size: 8 +// PrintDestroyContextCookie is a cookie used only for PrintDestroyContext requests. type PrintDestroyContextCookie struct { *xgb.Cookie } -// Write request to wire for PrintDestroyContext +// PrintDestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(printDestroyContextRequest(c, Context), cookie) return PrintDestroyContextCookie{cookie} } +// PrintDestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(printDestroyContextRequest(c, Context), cookie) return PrintDestroyContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintDestroyContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintDestroyContext +// printDestroyContextRequest writes a PrintDestroyContext request to a byte slice. func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { size := 8 b := 0 @@ -885,34 +908,36 @@ func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { return buf } -// Request PrintGetScreenOfContext -// size: 4 +// PrintGetScreenOfContextCookie is a cookie used only for PrintGetScreenOfContext requests. type PrintGetScreenOfContextCookie struct { *xgb.Cookie } +// PrintGetScreenOfContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetScreenOfContextRequest(c), cookie) return PrintGetScreenOfContextCookie{cookie} } +// PrintGetScreenOfContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetScreenOfContextRequest(c), cookie) return PrintGetScreenOfContextCookie{cookie} } -// Request reply for PrintGetScreenOfContext -// size: 12 +// PrintGetScreenOfContextReply represents the data returned from a PrintGetScreenOfContext request. type PrintGetScreenOfContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Root xproto.Window } -// Waits and reads reply data from request PrintGetScreenOfContext +// Reply blocks and returns the reply data for a PrintGetScreenOfContext request. func (cook PrintGetScreenOfContextCookie) Reply() (*PrintGetScreenOfContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -924,7 +949,7 @@ func (cook PrintGetScreenOfContextCookie) Reply() (*PrintGetScreenOfContextReply return printGetScreenOfContextReply(buf), nil } -// Read reply into structure from buffer for PrintGetScreenOfContext +// printGetScreenOfContextReply reads a byte slice into a PrintGetScreenOfContextReply value. func printGetScreenOfContextReply(buf []byte) *PrintGetScreenOfContextReply { v := new(PrintGetScreenOfContextReply) b := 1 // skip reply determinant @@ -944,6 +969,7 @@ func printGetScreenOfContextReply(buf []byte) *PrintGetScreenOfContextReply { } // Write request to wire for PrintGetScreenOfContext +// printGetScreenOfContextRequest writes a PrintGetScreenOfContext request to a byte slice. func printGetScreenOfContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -961,30 +987,35 @@ func printGetScreenOfContextRequest(c *xgb.Conn) []byte { return buf } -// Request PrintStartJob -// size: 8 +// PrintStartJobCookie is a cookie used only for PrintStartJob requests. type PrintStartJobCookie struct { *xgb.Cookie } -// Write request to wire for PrintStartJob +// PrintStartJob sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { cookie := c.NewCookie(false, false) c.NewRequest(printStartJobRequest(c, OutputMode), cookie) return PrintStartJobCookie{cookie} } +// PrintStartJobChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartJobCookie.Check() func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { cookie := c.NewCookie(true, false) c.NewRequest(printStartJobRequest(c, OutputMode), cookie) return PrintStartJobCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintStartJobCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintStartJob +// printStartJobRequest writes a PrintStartJob request to a byte slice. func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { size := 8 b := 0 @@ -1005,30 +1036,35 @@ func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { return buf } -// Request PrintEndJob -// size: 8 +// PrintEndJobCookie is a cookie used only for PrintEndJob requests. type PrintEndJobCookie struct { *xgb.Cookie } -// Write request to wire for PrintEndJob +// PrintEndJob sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { cookie := c.NewCookie(false, false) c.NewRequest(printEndJobRequest(c, Cancel), cookie) return PrintEndJobCookie{cookie} } +// PrintEndJobChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndJobCookie.Check() func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { cookie := c.NewCookie(true, false) c.NewRequest(printEndJobRequest(c, Cancel), cookie) return PrintEndJobCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintEndJobCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintEndJob +// printEndJobRequest writes a PrintEndJob request to a byte slice. func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { size := 8 b := 0 @@ -1053,30 +1089,35 @@ func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { return buf } -// Request PrintStartDoc -// size: 8 +// PrintStartDocCookie is a cookie used only for PrintStartDoc requests. type PrintStartDocCookie struct { *xgb.Cookie } -// Write request to wire for PrintStartDoc +// PrintStartDoc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { cookie := c.NewCookie(false, false) c.NewRequest(printStartDocRequest(c, DriverMode), cookie) return PrintStartDocCookie{cookie} } +// PrintStartDocChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartDocCookie.Check() func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { cookie := c.NewCookie(true, false) c.NewRequest(printStartDocRequest(c, DriverMode), cookie) return PrintStartDocCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintStartDocCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintStartDoc +// printStartDocRequest writes a PrintStartDoc request to a byte slice. func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { size := 8 b := 0 @@ -1097,30 +1138,35 @@ func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { return buf } -// Request PrintEndDoc -// size: 8 +// PrintEndDocCookie is a cookie used only for PrintEndDoc requests. type PrintEndDocCookie struct { *xgb.Cookie } -// Write request to wire for PrintEndDoc +// PrintEndDoc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { cookie := c.NewCookie(false, false) c.NewRequest(printEndDocRequest(c, Cancel), cookie) return PrintEndDocCookie{cookie} } +// PrintEndDocChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndDocCookie.Check() func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { cookie := c.NewCookie(true, false) c.NewRequest(printEndDocRequest(c, Cancel), cookie) return PrintEndDocCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintEndDocCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintEndDoc +// printEndDocRequest writes a PrintEndDoc request to a byte slice. func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { size := 8 b := 0 @@ -1145,30 +1191,35 @@ func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { return buf } -// Request PrintPutDocumentData -// size: xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) +// PrintPutDocumentDataCookie is a cookie used only for PrintPutDocumentData requests. type PrintPutDocumentDataCookie struct { *xgb.Cookie } -// Write request to wire for PrintPutDocumentData +// PrintPutDocumentData sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { cookie := c.NewCookie(false, false) c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return PrintPutDocumentDataCookie{cookie} } +// PrintPutDocumentDataChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { cookie := c.NewCookie(true, false) c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return PrintPutDocumentDataCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintPutDocumentDataCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintPutDocumentData +// printPutDocumentDataRequest writes a PrintPutDocumentData request to a byte slice. func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) []byte { size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) b := 0 @@ -1213,29 +1264,31 @@ func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData return buf } -// Request PrintGetDocumentData -// size: 12 +// PrintGetDocumentDataCookie is a cookie used only for PrintGetDocumentData requests. type PrintGetDocumentDataCookie struct { *xgb.Cookie } +// PrintGetDocumentData sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetDocumentDataCookie.Reply() func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) return PrintGetDocumentDataCookie{cookie} } +// PrintGetDocumentDataUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetDocumentDataUnchecked(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) return PrintGetDocumentDataCookie{cookie} } -// Request reply for PrintGetDocumentData -// size: (32 + xgb.Pad((int(DataLen) * 1))) +// PrintGetDocumentDataReply represents the data returned from a PrintGetDocumentData request. type PrintGetDocumentDataReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes StatusCode uint32 FinishedFlag uint32 @@ -1244,7 +1297,7 @@ type PrintGetDocumentDataReply struct { Data []byte // size: xgb.Pad((int(DataLen) * 1)) } -// Waits and reads reply data from request PrintGetDocumentData +// Reply blocks and returns the reply data for a PrintGetDocumentData request. func (cook PrintGetDocumentDataCookie) Reply() (*PrintGetDocumentDataReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1256,7 +1309,7 @@ func (cook PrintGetDocumentDataCookie) Reply() (*PrintGetDocumentDataReply, erro return printGetDocumentDataReply(buf), nil } -// Read reply into structure from buffer for PrintGetDocumentData +// printGetDocumentDataReply reads a byte slice into a PrintGetDocumentDataReply value. func printGetDocumentDataReply(buf []byte) *PrintGetDocumentDataReply { v := new(PrintGetDocumentDataReply) b := 1 // skip reply determinant @@ -1288,6 +1341,7 @@ func printGetDocumentDataReply(buf []byte) *PrintGetDocumentDataReply { } // Write request to wire for PrintGetDocumentData +// printGetDocumentDataRequest writes a PrintGetDocumentData request to a byte slice. func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) []byte { size := 12 b := 0 @@ -1311,30 +1365,35 @@ func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) return buf } -// Request PrintStartPage -// size: 8 +// PrintStartPageCookie is a cookie used only for PrintStartPage requests. type PrintStartPageCookie struct { *xgb.Cookie } -// Write request to wire for PrintStartPage +// PrintStartPage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { cookie := c.NewCookie(false, false) c.NewRequest(printStartPageRequest(c, Window), cookie) return PrintStartPageCookie{cookie} } +// PrintStartPageChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartPageCookie.Check() func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { cookie := c.NewCookie(true, false) c.NewRequest(printStartPageRequest(c, Window), cookie) return PrintStartPageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintStartPageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintStartPage +// printStartPageRequest writes a PrintStartPage request to a byte slice. func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1355,30 +1414,35 @@ func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request PrintEndPage -// size: 8 +// PrintEndPageCookie is a cookie used only for PrintEndPage requests. type PrintEndPageCookie struct { *xgb.Cookie } -// Write request to wire for PrintEndPage +// PrintEndPage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { cookie := c.NewCookie(false, false) c.NewRequest(printEndPageRequest(c, Cancel), cookie) return PrintEndPageCookie{cookie} } +// PrintEndPageChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndPageCookie.Check() func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { cookie := c.NewCookie(true, false) c.NewRequest(printEndPageRequest(c, Cancel), cookie) return PrintEndPageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintEndPageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintEndPage +// printEndPageRequest writes a PrintEndPage request to a byte slice. func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { size := 8 b := 0 @@ -1405,30 +1469,35 @@ func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { return buf } -// Request PrintSelectInput -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) +// PrintSelectInputCookie is a cookie used only for PrintSelectInput requests. type PrintSelectInputCookie struct { *xgb.Cookie } -// Write request to wire for PrintSelectInput +// PrintSelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) return PrintSelectInputCookie{cookie} } +// PrintSelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) return PrintSelectInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintSelectInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintSelectInput +// printSelectInputRequest writes a PrintSelectInput request to a byte slice. func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) b := 0 @@ -1457,29 +1526,31 @@ func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, Ev return buf } -// Request PrintInputSelected -// size: 8 +// PrintInputSelectedCookie is a cookie used only for PrintInputSelected requests. type PrintInputSelectedCookie struct { *xgb.Cookie } +// PrintInputSelected sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { cookie := c.NewCookie(true, true) c.NewRequest(printInputSelectedRequest(c, Context), cookie) return PrintInputSelectedCookie{cookie} } +// PrintInputSelectedUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { cookie := c.NewCookie(false, true) c.NewRequest(printInputSelectedRequest(c, Context), cookie) return PrintInputSelectedCookie{cookie} } -// Request reply for PrintInputSelected -// size: ((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask)))))) + (4 + xgb.Pad((4 * xgb.PopCount(int(AllEventsMask)))))) +// PrintInputSelectedReply represents the data returned from a PrintInputSelected request. type PrintInputSelectedReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes EventMask uint32 EventList []uint32 @@ -1487,7 +1558,7 @@ type PrintInputSelectedReply struct { AllEventsList []uint32 } -// Waits and reads reply data from request PrintInputSelected +// Reply blocks and returns the reply data for a PrintInputSelected request. func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1499,7 +1570,7 @@ func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { return printInputSelectedReply(buf), nil } -// Read reply into structure from buffer for PrintInputSelected +// printInputSelectedReply reads a byte slice into a PrintInputSelectedReply value. func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { v := new(PrintInputSelectedReply) b := 1 // skip reply determinant @@ -1536,6 +1607,7 @@ func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { } // Write request to wire for PrintInputSelected +// printInputSelectedRequest writes a PrintInputSelected request to a byte slice. func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { size := 8 b := 0 @@ -1556,36 +1628,38 @@ func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { return buf } -// Request PrintGetAttributes -// size: 12 +// PrintGetAttributesCookie is a cookie used only for PrintGetAttributes requests. type PrintGetAttributesCookie struct { *xgb.Cookie } +// PrintGetAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) return PrintGetAttributesCookie{cookie} } +// PrintGetAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) return PrintGetAttributesCookie{cookie} } -// Request reply for PrintGetAttributes -// size: 33 +// PrintGetAttributesReply represents the data returned from a PrintGetAttributes request. type PrintGetAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes StringLen uint32 // padding: 20 bytes Attributes String8 } -// Waits and reads reply data from request PrintGetAttributes +// Reply blocks and returns the reply data for a PrintGetAttributes request. func (cook PrintGetAttributesCookie) Reply() (*PrintGetAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1597,7 +1671,7 @@ func (cook PrintGetAttributesCookie) Reply() (*PrintGetAttributesReply, error) { return printGetAttributesReply(buf), nil } -// Read reply into structure from buffer for PrintGetAttributes +// printGetAttributesReply reads a byte slice into a PrintGetAttributesReply value. func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { v := new(PrintGetAttributesReply) b := 1 // skip reply determinant @@ -1622,6 +1696,7 @@ func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { } // Write request to wire for PrintGetAttributes +// printGetAttributesRequest writes a PrintGetAttributes request to a byte slice. func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte { size := 12 b := 0 @@ -1647,36 +1722,38 @@ func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte return buf } -// Request PrintGetOneAttributes -// size: xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) +// PrintGetOneAttributesCookie is a cookie used only for PrintGetOneAttributes requests. type PrintGetOneAttributesCookie struct { *xgb.Cookie } +// PrintGetOneAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetOneAttributesCookie.Reply() func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) return PrintGetOneAttributesCookie{cookie} } +// PrintGetOneAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetOneAttributesUnchecked(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) return PrintGetOneAttributesCookie{cookie} } -// Request reply for PrintGetOneAttributes -// size: (32 + xgb.Pad((int(ValueLen) * 1))) +// PrintGetOneAttributesReply represents the data returned from a PrintGetOneAttributes request. type PrintGetOneAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ValueLen uint32 // padding: 20 bytes Value []String8 // size: xgb.Pad((int(ValueLen) * 1)) } -// Waits and reads reply data from request PrintGetOneAttributes +// Reply blocks and returns the reply data for a PrintGetOneAttributes request. func (cook PrintGetOneAttributesCookie) Reply() (*PrintGetOneAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1688,7 +1765,7 @@ func (cook PrintGetOneAttributesCookie) Reply() (*PrintGetOneAttributesReply, er return printGetOneAttributesReply(buf), nil } -// Read reply into structure from buffer for PrintGetOneAttributes +// printGetOneAttributesReply reads a byte slice into a PrintGetOneAttributesReply value. func printGetOneAttributesReply(buf []byte) *PrintGetOneAttributesReply { v := new(PrintGetOneAttributesReply) b := 1 // skip reply determinant @@ -1717,6 +1794,7 @@ func printGetOneAttributesReply(buf []byte) *PrintGetOneAttributesReply { } // Write request to wire for PrintGetOneAttributes +// printGetOneAttributesRequest writes a PrintGetOneAttributes request to a byte slice. func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) []byte { size := xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -1751,30 +1829,35 @@ func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, return buf } -// Request PrintSetAttributes -// size: xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) +// PrintSetAttributesCookie is a cookie used only for PrintSetAttributes requests. type PrintSetAttributesCookie struct { *xgb.Cookie } -// Write request to wire for PrintSetAttributes +// PrintSetAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) return PrintSetAttributesCookie{cookie} } +// PrintSetAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) return PrintSetAttributesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PrintSetAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PrintSetAttributes +// printSetAttributesRequest writes a PrintSetAttributes request to a byte slice. func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) []byte { size := xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) b := 0 @@ -1812,29 +1895,31 @@ func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, return buf } -// Request PrintGetPageDimensions -// size: 8 +// PrintGetPageDimensionsCookie is a cookie used only for PrintGetPageDimensions requests. type PrintGetPageDimensionsCookie struct { *xgb.Cookie } +// PrintGetPageDimensions sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetPageDimensionsCookie.Reply() func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) return PrintGetPageDimensionsCookie{cookie} } +// PrintGetPageDimensionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPageDimensionsUnchecked(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) return PrintGetPageDimensionsCookie{cookie} } -// Request reply for PrintGetPageDimensions -// size: 20 +// PrintGetPageDimensionsReply represents the data returned from a PrintGetPageDimensions request. type PrintGetPageDimensionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint16 Height uint16 @@ -1844,7 +1929,7 @@ type PrintGetPageDimensionsReply struct { ReproducibleHeight uint16 } -// Waits and reads reply data from request PrintGetPageDimensions +// Reply blocks and returns the reply data for a PrintGetPageDimensions request. func (cook PrintGetPageDimensionsCookie) Reply() (*PrintGetPageDimensionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1856,7 +1941,7 @@ func (cook PrintGetPageDimensionsCookie) Reply() (*PrintGetPageDimensionsReply, return printGetPageDimensionsReply(buf), nil } -// Read reply into structure from buffer for PrintGetPageDimensions +// printGetPageDimensionsReply reads a byte slice into a PrintGetPageDimensionsReply value. func printGetPageDimensionsReply(buf []byte) *PrintGetPageDimensionsReply { v := new(PrintGetPageDimensionsReply) b := 1 // skip reply determinant @@ -1891,6 +1976,7 @@ func printGetPageDimensionsReply(buf []byte) *PrintGetPageDimensionsReply { } // Write request to wire for PrintGetPageDimensions +// printGetPageDimensionsRequest writes a PrintGetPageDimensions request to a byte slice. func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { size := 8 b := 0 @@ -1911,36 +1997,38 @@ func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { return buf } -// Request PrintQueryScreens -// size: 4 +// PrintQueryScreensCookie is a cookie used only for PrintQueryScreens requests. type PrintQueryScreensCookie struct { *xgb.Cookie } +// PrintQueryScreens sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintQueryScreensCookie.Reply() func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { cookie := c.NewCookie(true, true) c.NewRequest(printQueryScreensRequest(c), cookie) return PrintQueryScreensCookie{cookie} } +// PrintQueryScreensUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryScreensUnchecked(c *xgb.Conn) PrintQueryScreensCookie { cookie := c.NewCookie(false, true) c.NewRequest(printQueryScreensRequest(c), cookie) return PrintQueryScreensCookie{cookie} } -// Request reply for PrintQueryScreens -// size: (32 + xgb.Pad((int(ListCount) * 4))) +// PrintQueryScreensReply represents the data returned from a PrintQueryScreens request. type PrintQueryScreensReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ListCount uint32 // padding: 20 bytes Roots []xproto.Window // size: xgb.Pad((int(ListCount) * 4)) } -// Waits and reads reply data from request PrintQueryScreens +// Reply blocks and returns the reply data for a PrintQueryScreens request. func (cook PrintQueryScreensCookie) Reply() (*PrintQueryScreensReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1952,7 +2040,7 @@ func (cook PrintQueryScreensCookie) Reply() (*PrintQueryScreensReply, error) { return printQueryScreensReply(buf), nil } -// Read reply into structure from buffer for PrintQueryScreens +// printQueryScreensReply reads a byte slice into a PrintQueryScreensReply value. func printQueryScreensReply(buf []byte) *PrintQueryScreensReply { v := new(PrintQueryScreensReply) b := 1 // skip reply determinant @@ -1981,6 +2069,7 @@ func printQueryScreensReply(buf []byte) *PrintQueryScreensReply { } // Write request to wire for PrintQueryScreens +// printQueryScreensRequest writes a PrintQueryScreens request to a byte slice. func printQueryScreensRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1998,34 +2087,36 @@ func printQueryScreensRequest(c *xgb.Conn) []byte { return buf } -// Request PrintSetImageResolution -// size: 12 +// PrintSetImageResolutionCookie is a cookie used only for PrintSetImageResolution requests. type PrintSetImageResolutionCookie struct { *xgb.Cookie } +// PrintSetImageResolution sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintSetImageResolutionCookie.Reply() func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { cookie := c.NewCookie(true, true) c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) return PrintSetImageResolutionCookie{cookie} } +// PrintSetImageResolutionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { cookie := c.NewCookie(false, true) c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) return PrintSetImageResolutionCookie{cookie} } -// Request reply for PrintSetImageResolution -// size: 10 +// PrintSetImageResolutionReply represents the data returned from a PrintSetImageResolution request. type PrintSetImageResolutionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status bool PreviousResolutions uint16 } -// Waits and reads reply data from request PrintSetImageResolution +// Reply blocks and returns the reply data for a PrintSetImageResolution request. func (cook PrintSetImageResolutionCookie) Reply() (*PrintSetImageResolutionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2037,7 +2128,7 @@ func (cook PrintSetImageResolutionCookie) Reply() (*PrintSetImageResolutionReply return printSetImageResolutionReply(buf), nil } -// Read reply into structure from buffer for PrintSetImageResolution +// printSetImageResolutionReply reads a byte slice into a PrintSetImageResolutionReply value. func printSetImageResolutionReply(buf []byte) *PrintSetImageResolutionReply { v := new(PrintSetImageResolutionReply) b := 1 // skip reply determinant @@ -2062,6 +2153,7 @@ func printSetImageResolutionReply(buf []byte) *PrintSetImageResolutionReply { } // Write request to wire for PrintSetImageResolution +// printSetImageResolutionRequest writes a PrintSetImageResolution request to a byte slice. func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResolution uint16) []byte { size := 12 b := 0 @@ -2085,34 +2177,36 @@ func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResoluti return buf } -// Request PrintGetImageResolution -// size: 8 +// PrintGetImageResolutionCookie is a cookie used only for PrintGetImageResolution requests. type PrintGetImageResolutionCookie struct { *xgb.Cookie } +// PrintGetImageResolution sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { cookie := c.NewCookie(true, true) c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) return PrintGetImageResolutionCookie{cookie} } +// PrintGetImageResolutionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { cookie := c.NewCookie(false, true) c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) return PrintGetImageResolutionCookie{cookie} } -// Request reply for PrintGetImageResolution -// size: 10 +// PrintGetImageResolutionReply represents the data returned from a PrintGetImageResolution request. type PrintGetImageResolutionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ImageResolution uint16 } -// Waits and reads reply data from request PrintGetImageResolution +// Reply blocks and returns the reply data for a PrintGetImageResolution request. func (cook PrintGetImageResolutionCookie) Reply() (*PrintGetImageResolutionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2124,7 +2218,7 @@ func (cook PrintGetImageResolutionCookie) Reply() (*PrintGetImageResolutionReply return printGetImageResolutionReply(buf), nil } -// Read reply into structure from buffer for PrintGetImageResolution +// printGetImageResolutionReply reads a byte slice into a PrintGetImageResolutionReply value. func printGetImageResolutionReply(buf []byte) *PrintGetImageResolutionReply { v := new(PrintGetImageResolutionReply) b := 1 // skip reply determinant @@ -2144,6 +2238,7 @@ func printGetImageResolutionReply(buf []byte) *PrintGetImageResolutionReply { } // Write request to wire for PrintGetImageResolution +// printGetImageResolutionRequest writes a PrintGetImageResolution request to a byte slice. func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { size := 8 b := 0 diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 39956f1..6b0fb6b 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xproto.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -23,16 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -47,6 +37,16 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -733,14 +733,12 @@ type Keycode byte type Button byte -// 'Char2b' struct definition -// Size: 2 type Char2b struct { Byte1 byte Byte2 byte } -// Struct read Char2b +// Char2bRead reads a byte slice into a Char2b value. func Char2bRead(buf []byte, v *Char2b) int { b := 0 @@ -753,7 +751,7 @@ func Char2bRead(buf []byte, v *Char2b) int { return b } -// Struct list read Char2b +// Char2bReadList reads a byte slice into a list of Char2b values. func Char2bReadList(buf []byte, dest []Char2b) int { b := 0 for i := 0; i < len(dest); i++ { @@ -763,7 +761,7 @@ func Char2bReadList(buf []byte, dest []Char2b) int { return xgb.Pad(b) } -// Struct write Char2b +// Bytes writes a Char2b value to a byte slice. func (v Char2b) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -777,7 +775,7 @@ func (v Char2b) Bytes() []byte { return buf } -// Write struct list Char2b +// Char2bListBytes writes a list of %s(MISSING) values to a byte slice. func Char2bListBytes(buf []byte, list []Char2b) int { b := 0 var structBytes []byte @@ -789,14 +787,12 @@ func Char2bListBytes(buf []byte, list []Char2b) int { return b } -// 'Point' struct definition -// Size: 4 type Point struct { X int16 Y int16 } -// Struct read Point +// PointRead reads a byte slice into a Point value. func PointRead(buf []byte, v *Point) int { b := 0 @@ -809,7 +805,7 @@ func PointRead(buf []byte, v *Point) int { return b } -// Struct list read Point +// PointReadList reads a byte slice into a list of Point values. func PointReadList(buf []byte, dest []Point) int { b := 0 for i := 0; i < len(dest); i++ { @@ -819,7 +815,7 @@ func PointReadList(buf []byte, dest []Point) int { return xgb.Pad(b) } -// Struct write Point +// Bytes writes a Point value to a byte slice. func (v Point) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -833,7 +829,7 @@ func (v Point) Bytes() []byte { return buf } -// Write struct list Point +// PointListBytes writes a list of %s(MISSING) values to a byte slice. func PointListBytes(buf []byte, list []Point) int { b := 0 var structBytes []byte @@ -845,8 +841,6 @@ func PointListBytes(buf []byte, list []Point) int { return b } -// 'Rectangle' struct definition -// Size: 8 type Rectangle struct { X int16 Y int16 @@ -854,7 +848,7 @@ type Rectangle struct { Height uint16 } -// Struct read Rectangle +// RectangleRead reads a byte slice into a Rectangle value. func RectangleRead(buf []byte, v *Rectangle) int { b := 0 @@ -873,7 +867,7 @@ func RectangleRead(buf []byte, v *Rectangle) int { return b } -// Struct list read Rectangle +// RectangleReadList reads a byte slice into a list of Rectangle values. func RectangleReadList(buf []byte, dest []Rectangle) int { b := 0 for i := 0; i < len(dest); i++ { @@ -883,7 +877,7 @@ func RectangleReadList(buf []byte, dest []Rectangle) int { return xgb.Pad(b) } -// Struct write Rectangle +// Bytes writes a Rectangle value to a byte slice. func (v Rectangle) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -903,7 +897,7 @@ func (v Rectangle) Bytes() []byte { return buf } -// Write struct list Rectangle +// RectangleListBytes writes a list of %s(MISSING) values to a byte slice. func RectangleListBytes(buf []byte, list []Rectangle) int { b := 0 var structBytes []byte @@ -915,8 +909,6 @@ func RectangleListBytes(buf []byte, list []Rectangle) int { return b } -// 'Arc' struct definition -// Size: 12 type Arc struct { X int16 Y int16 @@ -926,7 +918,7 @@ type Arc struct { Angle2 int16 } -// Struct read Arc +// ArcRead reads a byte slice into a Arc value. func ArcRead(buf []byte, v *Arc) int { b := 0 @@ -951,7 +943,7 @@ func ArcRead(buf []byte, v *Arc) int { return b } -// Struct list read Arc +// ArcReadList reads a byte slice into a list of Arc values. func ArcReadList(buf []byte, dest []Arc) int { b := 0 for i := 0; i < len(dest); i++ { @@ -961,7 +953,7 @@ func ArcReadList(buf []byte, dest []Arc) int { return xgb.Pad(b) } -// Struct write Arc +// Bytes writes a Arc value to a byte slice. func (v Arc) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -987,7 +979,7 @@ func (v Arc) Bytes() []byte { return buf } -// Write struct list Arc +// ArcListBytes writes a list of %s(MISSING) values to a byte slice. func ArcListBytes(buf []byte, list []Arc) int { b := 0 var structBytes []byte @@ -999,8 +991,6 @@ func ArcListBytes(buf []byte, list []Arc) int { return b } -// 'Format' struct definition -// Size: 8 type Format struct { Depth byte BitsPerPixel byte @@ -1008,7 +998,7 @@ type Format struct { // padding: 5 bytes } -// Struct read Format +// FormatRead reads a byte slice into a Format value. func FormatRead(buf []byte, v *Format) int { b := 0 @@ -1026,7 +1016,7 @@ func FormatRead(buf []byte, v *Format) int { return b } -// Struct list read Format +// FormatReadList reads a byte slice into a list of Format values. func FormatReadList(buf []byte, dest []Format) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1036,7 +1026,7 @@ func FormatReadList(buf []byte, dest []Format) int { return xgb.Pad(b) } -// Struct write Format +// Bytes writes a Format value to a byte slice. func (v Format) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1055,7 +1045,7 @@ func (v Format) Bytes() []byte { return buf } -// Write struct list Format +// FormatListBytes writes a list of %s(MISSING) values to a byte slice. func FormatListBytes(buf []byte, list []Format) int { b := 0 var structBytes []byte @@ -1067,8 +1057,6 @@ func FormatListBytes(buf []byte, list []Format) int { return b } -// 'VisualInfo' struct definition -// Size: 24 type VisualInfo struct { VisualId Visualid Class byte @@ -1080,7 +1068,7 @@ type VisualInfo struct { // padding: 4 bytes } -// Struct read VisualInfo +// VisualInfoRead reads a byte slice into a VisualInfo value. func VisualInfoRead(buf []byte, v *VisualInfo) int { b := 0 @@ -1110,7 +1098,7 @@ func VisualInfoRead(buf []byte, v *VisualInfo) int { return b } -// Struct list read VisualInfo +// VisualInfoReadList reads a byte slice into a list of VisualInfo values. func VisualInfoReadList(buf []byte, dest []VisualInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1120,7 +1108,7 @@ func VisualInfoReadList(buf []byte, dest []VisualInfo) int { return xgb.Pad(b) } -// Struct write VisualInfo +// Bytes writes a VisualInfo value to a byte slice. func (v VisualInfo) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -1151,7 +1139,7 @@ func (v VisualInfo) Bytes() []byte { return buf } -// Write struct list VisualInfo +// VisualInfoListBytes writes a list of %s(MISSING) values to a byte slice. func VisualInfoListBytes(buf []byte, list []VisualInfo) int { b := 0 var structBytes []byte @@ -1163,8 +1151,6 @@ func VisualInfoListBytes(buf []byte, list []VisualInfo) int { return b } -// 'DepthInfo' struct definition -// Size: (8 + xgb.Pad((int(VisualsLen) * 24))) type DepthInfo struct { Depth byte // padding: 1 bytes @@ -1173,7 +1159,7 @@ type DepthInfo struct { Visuals []VisualInfo // size: xgb.Pad((int(VisualsLen) * 24)) } -// Struct read DepthInfo +// DepthInfoRead reads a byte slice into a DepthInfo value. func DepthInfoRead(buf []byte, v *DepthInfo) int { b := 0 @@ -1193,7 +1179,7 @@ func DepthInfoRead(buf []byte, v *DepthInfo) int { return b } -// Struct list read DepthInfo +// DepthInfoReadList reads a byte slice into a list of DepthInfo values. func DepthInfoReadList(buf []byte, dest []DepthInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1203,7 +1189,7 @@ func DepthInfoReadList(buf []byte, dest []DepthInfo) int { return xgb.Pad(b) } -// Struct write DepthInfo +// Bytes writes a DepthInfo value to a byte slice. func (v DepthInfo) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.VisualsLen) * 24)))) b := 0 @@ -1223,7 +1209,7 @@ func (v DepthInfo) Bytes() []byte { return buf } -// Write struct list DepthInfo +// DepthInfoListBytes writes a list of %s(MISSING) values to a byte slice. func DepthInfoListBytes(buf []byte, list []DepthInfo) int { b := 0 var structBytes []byte @@ -1235,7 +1221,7 @@ func DepthInfoListBytes(buf []byte, list []DepthInfo) int { return b } -// Struct list size DepthInfo +// DepthInfoListSize computes the size (bytes) of a list of DepthInfo values. func DepthInfoListSize(list []DepthInfo) int { size := 0 for _, item := range list { @@ -1244,8 +1230,6 @@ func DepthInfoListSize(list []DepthInfo) int { return size } -// 'ScreenInfo' struct definition -// Size: (40 + DepthInfoListSize(AllowedDepths)) type ScreenInfo struct { Root Window DefaultColormap Colormap @@ -1266,7 +1250,7 @@ type ScreenInfo struct { AllowedDepths []DepthInfo // size: DepthInfoListSize(AllowedDepths) } -// Struct read ScreenInfo +// ScreenInfoRead reads a byte slice into a ScreenInfo value. func ScreenInfoRead(buf []byte, v *ScreenInfo) int { b := 0 @@ -1328,7 +1312,7 @@ func ScreenInfoRead(buf []byte, v *ScreenInfo) int { return b } -// Struct list read ScreenInfo +// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values. func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1338,7 +1322,7 @@ func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { return xgb.Pad(b) } -// Struct write ScreenInfo +// Bytes writes a ScreenInfo value to a byte slice. func (v ScreenInfo) Bytes() []byte { buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) b := 0 @@ -1400,7 +1384,7 @@ func (v ScreenInfo) Bytes() []byte { return buf } -// Write struct list ScreenInfo +// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { b := 0 var structBytes []byte @@ -1412,7 +1396,7 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { return b } -// Struct list size ScreenInfo +// ScreenInfoListSize computes the size (bytes) of a list of ScreenInfo values. func ScreenInfoListSize(list []ScreenInfo) int { size := 0 for _, item := range list { @@ -1421,8 +1405,6 @@ func ScreenInfoListSize(list []ScreenInfo) int { return size } -// 'SetupRequest' struct definition -// Size: ((12 + xgb.Pad((int(AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(AuthorizationProtocolDataLen) * 1))) type SetupRequest struct { ByteOrder byte // padding: 1 bytes @@ -1435,7 +1417,7 @@ type SetupRequest struct { AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) } -// Struct read SetupRequest +// SetupRequestRead reads a byte slice into a SetupRequest value. func SetupRequestRead(buf []byte, v *SetupRequest) int { b := 0 @@ -1475,7 +1457,7 @@ func SetupRequestRead(buf []byte, v *SetupRequest) int { return b } -// Struct list read SetupRequest +// SetupRequestReadList reads a byte slice into a list of SetupRequest values. func SetupRequestReadList(buf []byte, dest []SetupRequest) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1485,7 +1467,7 @@ func SetupRequestReadList(buf []byte, dest []SetupRequest) int { return xgb.Pad(b) } -// Struct write SetupRequest +// Bytes writes a SetupRequest value to a byte slice. func (v SetupRequest) Bytes() []byte { buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) b := 0 @@ -1518,7 +1500,7 @@ func (v SetupRequest) Bytes() []byte { return buf } -// Write struct list SetupRequest +// SetupRequestListBytes writes a list of %s(MISSING) values to a byte slice. func SetupRequestListBytes(buf []byte, list []SetupRequest) int { b := 0 var structBytes []byte @@ -1530,7 +1512,7 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { return b } -// Struct list size SetupRequest +// SetupRequestListSize computes the size (bytes) of a list of SetupRequest values. func SetupRequestListSize(list []SetupRequest) int { size := 0 for _, item := range list { @@ -1539,8 +1521,6 @@ func SetupRequestListSize(list []SetupRequest) int { return size } -// 'SetupFailed' struct definition -// Size: (8 + xgb.Pad((int(ReasonLen) * 1))) type SetupFailed struct { Status byte ReasonLen byte @@ -1550,7 +1530,7 @@ type SetupFailed struct { Reason string // size: xgb.Pad((int(ReasonLen) * 1)) } -// Struct read SetupFailed +// SetupFailedRead reads a byte slice into a SetupFailed value. func SetupFailedRead(buf []byte, v *SetupFailed) int { b := 0 @@ -1579,7 +1559,7 @@ func SetupFailedRead(buf []byte, v *SetupFailed) int { return b } -// Struct list read SetupFailed +// SetupFailedReadList reads a byte slice into a list of SetupFailed values. func SetupFailedReadList(buf []byte, dest []SetupFailed) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1589,7 +1569,7 @@ func SetupFailedReadList(buf []byte, dest []SetupFailed) int { return xgb.Pad(b) } -// Struct write SetupFailed +// Bytes writes a SetupFailed value to a byte slice. func (v SetupFailed) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.ReasonLen) * 1)))) b := 0 @@ -1615,7 +1595,7 @@ func (v SetupFailed) Bytes() []byte { return buf } -// Write struct list SetupFailed +// SetupFailedListBytes writes a list of %s(MISSING) values to a byte slice. func SetupFailedListBytes(buf []byte, list []SetupFailed) int { b := 0 var structBytes []byte @@ -1627,7 +1607,7 @@ func SetupFailedListBytes(buf []byte, list []SetupFailed) int { return b } -// Struct list size SetupFailed +// SetupFailedListSize computes the size (bytes) of a list of SetupFailed values. func SetupFailedListSize(list []SetupFailed) int { size := 0 for _, item := range list { @@ -1636,8 +1616,6 @@ func SetupFailedListSize(list []SetupFailed) int { return size } -// 'SetupAuthenticate' struct definition -// Size: (8 + xgb.Pad(((int(Length) * 4) * 1))) type SetupAuthenticate struct { Status byte // padding: 5 bytes @@ -1645,7 +1623,7 @@ type SetupAuthenticate struct { Reason string // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Struct read SetupAuthenticate +// SetupAuthenticateRead reads a byte slice into a SetupAuthenticate value. func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { b := 0 @@ -1667,7 +1645,7 @@ func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { return b } -// Struct list read SetupAuthenticate +// SetupAuthenticateReadList reads a byte slice into a list of SetupAuthenticate values. func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1677,7 +1655,7 @@ func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { return xgb.Pad(b) } -// Struct write SetupAuthenticate +// Bytes writes a SetupAuthenticate value to a byte slice. func (v SetupAuthenticate) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad(((int(v.Length) * 4) * 1)))) b := 0 @@ -1696,7 +1674,7 @@ func (v SetupAuthenticate) Bytes() []byte { return buf } -// Write struct list SetupAuthenticate +// SetupAuthenticateListBytes writes a list of %s(MISSING) values to a byte slice. func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { b := 0 var structBytes []byte @@ -1708,7 +1686,7 @@ func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { return b } -// Struct list size SetupAuthenticate +// SetupAuthenticateListSize computes the size (bytes) of a list of SetupAuthenticate values. func SetupAuthenticateListSize(list []SetupAuthenticate) int { size := 0 for _, item := range list { @@ -1717,8 +1695,6 @@ func SetupAuthenticateListSize(list []SetupAuthenticate) int { return size } -// 'SetupInfo' struct definition -// Size: (((40 + xgb.Pad((int(VendorLen) * 1))) + xgb.Pad((int(PixmapFormatsLen) * 8))) + ScreenInfoListSize(Roots)) type SetupInfo struct { Status byte // padding: 1 bytes @@ -1745,7 +1721,7 @@ type SetupInfo struct { Roots []ScreenInfo // size: ScreenInfoListSize(Roots) } -// Struct read SetupInfo +// SetupInfoRead reads a byte slice into a SetupInfo value. func SetupInfoRead(buf []byte, v *SetupInfo) int { b := 0 @@ -1823,7 +1799,7 @@ func SetupInfoRead(buf []byte, v *SetupInfo) int { return b } -// Struct list read SetupInfo +// SetupInfoReadList reads a byte slice into a list of SetupInfo values. func SetupInfoReadList(buf []byte, dest []SetupInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1833,7 +1809,7 @@ func SetupInfoReadList(buf []byte, dest []SetupInfo) int { return xgb.Pad(b) } -// Struct write SetupInfo +// Bytes writes a SetupInfo value to a byte slice. func (v SetupInfo) Bytes() []byte { buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) b := 0 @@ -1906,7 +1882,7 @@ func (v SetupInfo) Bytes() []byte { return buf } -// Write struct list SetupInfo +// SetupInfoListBytes writes a list of %s(MISSING) values to a byte slice. func SetupInfoListBytes(buf []byte, list []SetupInfo) int { b := 0 var structBytes []byte @@ -1918,7 +1894,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { return b } -// Struct list size SetupInfo +// SetupInfoListSize computes the size (bytes) of a list of SetupInfo values. func SetupInfoListSize(list []SetupInfo) int { size := 0 for _, item := range list { @@ -1927,15 +1903,13 @@ func SetupInfoListSize(list []SetupInfo) int { return size } -// 'Timecoord' struct definition -// Size: 8 type Timecoord struct { Time Timestamp X int16 Y int16 } -// Struct read Timecoord +// TimecoordRead reads a byte slice into a Timecoord value. func TimecoordRead(buf []byte, v *Timecoord) int { b := 0 @@ -1951,7 +1925,7 @@ func TimecoordRead(buf []byte, v *Timecoord) int { return b } -// Struct list read Timecoord +// TimecoordReadList reads a byte slice into a list of Timecoord values. func TimecoordReadList(buf []byte, dest []Timecoord) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1961,7 +1935,7 @@ func TimecoordReadList(buf []byte, dest []Timecoord) int { return xgb.Pad(b) } -// Struct write Timecoord +// Bytes writes a Timecoord value to a byte slice. func (v Timecoord) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1978,7 +1952,7 @@ func (v Timecoord) Bytes() []byte { return buf } -// Write struct list Timecoord +// TimecoordListBytes writes a list of %s(MISSING) values to a byte slice. func TimecoordListBytes(buf []byte, list []Timecoord) int { b := 0 var structBytes []byte @@ -1990,14 +1964,12 @@ func TimecoordListBytes(buf []byte, list []Timecoord) int { return b } -// 'Fontprop' struct definition -// Size: 8 type Fontprop struct { Name Atom Value uint32 } -// Struct read Fontprop +// FontpropRead reads a byte slice into a Fontprop value. func FontpropRead(buf []byte, v *Fontprop) int { b := 0 @@ -2010,7 +1982,7 @@ func FontpropRead(buf []byte, v *Fontprop) int { return b } -// Struct list read Fontprop +// FontpropReadList reads a byte slice into a list of Fontprop values. func FontpropReadList(buf []byte, dest []Fontprop) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2020,7 +1992,7 @@ func FontpropReadList(buf []byte, dest []Fontprop) int { return xgb.Pad(b) } -// Struct write Fontprop +// Bytes writes a Fontprop value to a byte slice. func (v Fontprop) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2034,7 +2006,7 @@ func (v Fontprop) Bytes() []byte { return buf } -// Write struct list Fontprop +// FontpropListBytes writes a list of %s(MISSING) values to a byte slice. func FontpropListBytes(buf []byte, list []Fontprop) int { b := 0 var structBytes []byte @@ -2046,8 +2018,6 @@ func FontpropListBytes(buf []byte, list []Fontprop) int { return b } -// 'Charinfo' struct definition -// Size: 12 type Charinfo struct { LeftSideBearing int16 RightSideBearing int16 @@ -2057,7 +2027,7 @@ type Charinfo struct { Attributes uint16 } -// Struct read Charinfo +// CharinfoRead reads a byte slice into a Charinfo value. func CharinfoRead(buf []byte, v *Charinfo) int { b := 0 @@ -2082,7 +2052,7 @@ func CharinfoRead(buf []byte, v *Charinfo) int { return b } -// Struct list read Charinfo +// CharinfoReadList reads a byte slice into a list of Charinfo values. func CharinfoReadList(buf []byte, dest []Charinfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2092,7 +2062,7 @@ func CharinfoReadList(buf []byte, dest []Charinfo) int { return xgb.Pad(b) } -// Struct write Charinfo +// Bytes writes a Charinfo value to a byte slice. func (v Charinfo) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -2118,7 +2088,7 @@ func (v Charinfo) Bytes() []byte { return buf } -// Write struct list Charinfo +// CharinfoListBytes writes a list of %s(MISSING) values to a byte slice. func CharinfoListBytes(buf []byte, list []Charinfo) int { b := 0 var structBytes []byte @@ -2130,14 +2100,12 @@ func CharinfoListBytes(buf []byte, list []Charinfo) int { return b } -// 'Str' struct definition -// Size: (1 + xgb.Pad((int(NameLen) * 1))) type Str struct { NameLen byte Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Struct read Str +// StrRead reads a byte slice into a Str value. func StrRead(buf []byte, v *Str) int { b := 0 @@ -2154,7 +2122,7 @@ func StrRead(buf []byte, v *Str) int { return b } -// Struct list read Str +// StrReadList reads a byte slice into a list of Str values. func StrReadList(buf []byte, dest []Str) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2164,7 +2132,7 @@ func StrReadList(buf []byte, dest []Str) int { return xgb.Pad(b) } -// Struct write Str +// Bytes writes a Str value to a byte slice. func (v Str) Bytes() []byte { buf := make([]byte, (1 + xgb.Pad((int(v.NameLen) * 1)))) b := 0 @@ -2178,7 +2146,7 @@ func (v Str) Bytes() []byte { return buf } -// Write struct list Str +// StrListBytes writes a list of %s(MISSING) values to a byte slice. func StrListBytes(buf []byte, list []Str) int { b := 0 var structBytes []byte @@ -2190,7 +2158,7 @@ func StrListBytes(buf []byte, list []Str) int { return b } -// Struct list size Str +// StrListSize computes the size (bytes) of a list of Str values. func StrListSize(list []Str) int { size := 0 for _, item := range list { @@ -2199,8 +2167,6 @@ func StrListSize(list []Str) int { return size } -// 'Segment' struct definition -// Size: 8 type Segment struct { X1 int16 Y1 int16 @@ -2208,7 +2174,7 @@ type Segment struct { Y2 int16 } -// Struct read Segment +// SegmentRead reads a byte slice into a Segment value. func SegmentRead(buf []byte, v *Segment) int { b := 0 @@ -2227,7 +2193,7 @@ func SegmentRead(buf []byte, v *Segment) int { return b } -// Struct list read Segment +// SegmentReadList reads a byte slice into a list of Segment values. func SegmentReadList(buf []byte, dest []Segment) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2237,7 +2203,7 @@ func SegmentReadList(buf []byte, dest []Segment) int { return xgb.Pad(b) } -// Struct write Segment +// Bytes writes a Segment value to a byte slice. func (v Segment) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2257,7 +2223,7 @@ func (v Segment) Bytes() []byte { return buf } -// Write struct list Segment +// SegmentListBytes writes a list of %s(MISSING) values to a byte slice. func SegmentListBytes(buf []byte, list []Segment) int { b := 0 var structBytes []byte @@ -2269,8 +2235,6 @@ func SegmentListBytes(buf []byte, list []Segment) int { return b } -// 'Coloritem' struct definition -// Size: 12 type Coloritem struct { Pixel uint32 Red uint16 @@ -2280,7 +2244,7 @@ type Coloritem struct { // padding: 1 bytes } -// Struct read Coloritem +// ColoritemRead reads a byte slice into a Coloritem value. func ColoritemRead(buf []byte, v *Coloritem) int { b := 0 @@ -2304,7 +2268,7 @@ func ColoritemRead(buf []byte, v *Coloritem) int { return b } -// Struct list read Coloritem +// ColoritemReadList reads a byte slice into a list of Coloritem values. func ColoritemReadList(buf []byte, dest []Coloritem) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2314,7 +2278,7 @@ func ColoritemReadList(buf []byte, dest []Coloritem) int { return xgb.Pad(b) } -// Struct write Coloritem +// Bytes writes a Coloritem value to a byte slice. func (v Coloritem) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -2339,7 +2303,7 @@ func (v Coloritem) Bytes() []byte { return buf } -// Write struct list Coloritem +// ColoritemListBytes writes a list of %s(MISSING) values to a byte slice. func ColoritemListBytes(buf []byte, list []Coloritem) int { b := 0 var structBytes []byte @@ -2351,8 +2315,6 @@ func ColoritemListBytes(buf []byte, list []Coloritem) int { return b } -// 'Rgb' struct definition -// Size: 8 type Rgb struct { Red uint16 Green uint16 @@ -2360,7 +2322,7 @@ type Rgb struct { // padding: 2 bytes } -// Struct read Rgb +// RgbRead reads a byte slice into a Rgb value. func RgbRead(buf []byte, v *Rgb) int { b := 0 @@ -2378,7 +2340,7 @@ func RgbRead(buf []byte, v *Rgb) int { return b } -// Struct list read Rgb +// RgbReadList reads a byte slice into a list of Rgb values. func RgbReadList(buf []byte, dest []Rgb) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2388,7 +2350,7 @@ func RgbReadList(buf []byte, dest []Rgb) int { return xgb.Pad(b) } -// Struct write Rgb +// Bytes writes a Rgb value to a byte slice. func (v Rgb) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2407,7 +2369,7 @@ func (v Rgb) Bytes() []byte { return buf } -// Write struct list Rgb +// RgbListBytes writes a list of %s(MISSING) values to a byte slice. func RgbListBytes(buf []byte, list []Rgb) int { b := 0 var structBytes []byte @@ -2419,8 +2381,6 @@ func RgbListBytes(buf []byte, list []Rgb) int { return b } -// 'Host' struct definition -// Size: (4 + xgb.Pad((int(AddressLen) * 1))) type Host struct { Family byte // padding: 1 bytes @@ -2428,7 +2388,7 @@ type Host struct { Address []byte // size: xgb.Pad((int(AddressLen) * 1)) } -// Struct read Host +// HostRead reads a byte slice into a Host value. func HostRead(buf []byte, v *Host) int { b := 0 @@ -2447,7 +2407,7 @@ func HostRead(buf []byte, v *Host) int { return b } -// Struct list read Host +// HostReadList reads a byte slice into a list of Host values. func HostReadList(buf []byte, dest []Host) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2457,7 +2417,7 @@ func HostReadList(buf []byte, dest []Host) int { return xgb.Pad(b) } -// Struct write Host +// Bytes writes a Host value to a byte slice. func (v Host) Bytes() []byte { buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) b := 0 @@ -2476,7 +2436,7 @@ func (v Host) Bytes() []byte { return buf } -// Write struct list Host +// HostListBytes writes a list of %s(MISSING) values to a byte slice. func HostListBytes(buf []byte, list []Host) int { b := 0 var structBytes []byte @@ -2488,7 +2448,7 @@ func HostListBytes(buf []byte, list []Host) int { return b } -// Struct list size Host +// HostListSize computes the size (bytes) of a list of Host values. func HostListSize(list []Host) int { size := 0 for _, item := range list { @@ -2497,7 +2457,7 @@ func HostListSize(list []Host) int { return size } -// Union definition ClientMessageDataUnion +// ClientMessageDataUnion is a represention of the ClientMessageDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). // Instead use one of the following constructors for 'ClientMessageDataUnion': @@ -2510,7 +2470,7 @@ type ClientMessageDataUnion struct { Data32 []uint32 // size: 20 } -// Union constructor for ClientMessageDataUnion for field Data8. +// ClientMessageDataUnionData8New constructs a new ClientMessageDataUnion union type with the Data8 field. func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2547,7 +2507,7 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { return v } -// Union constructor for ClientMessageDataUnion for field Data16. +// ClientMessageDataUnionData16New constructs a new ClientMessageDataUnion union type with the Data16 field. func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2587,7 +2547,7 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { return v } -// Union constructor for ClientMessageDataUnion for field Data32. +// ClientMessageDataUnionData32New constructs a new ClientMessageDataUnion union type with the Data32 field. func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2627,7 +2587,7 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { return v } -// Union read ClientMessageDataUnion +// ClientMessageDataUnionRead reads a byte slice into a ClientMessageDataUnion value. func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { var b int @@ -2655,7 +2615,7 @@ func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { return 20 } -// Union list read ClientMessageDataUnion +// ClientMessageDataUnionReadList reads a byte slice into a list of ClientMessageDataUnion values. func ClientMessageDataUnionReadList(buf []byte, dest []ClientMessageDataUnion) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2665,7 +2625,7 @@ func ClientMessageDataUnionReadList(buf []byte, dest []ClientMessageDataUnion) i return xgb.Pad(b) } -// Union write ClientMessageDataUnion +// Bytes writes a ClientMessageDataUnion value to a byte slice. // Each field in a union must contain the same data. // So simply pick the first field and write that to the wire. func (v ClientMessageDataUnion) Bytes() []byte { @@ -2677,7 +2637,7 @@ func (v ClientMessageDataUnion) Bytes() []byte { return buf } -// Union list write ClientMessageDataUnion +// ClientMessageDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) int { b := 0 var unionBytes []byte @@ -2689,9 +2649,7 @@ func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) return b } -// Event definition KeyPress (2) -// Size: 32 - +// KeyPress is the event number for a KeyPressEvent. const KeyPress = 2 type KeyPressEvent struct { @@ -2710,7 +2668,7 @@ type KeyPressEvent struct { // padding: 1 bytes } -// Event read KeyPress +// KeyPressEventNew constructs a KeyPressEvent value that implements xgb.Event from a byte slice. func KeyPressEventNew(buf []byte) xgb.Event { v := KeyPressEvent{} b := 1 // don't read event number @@ -2760,7 +2718,7 @@ func KeyPressEventNew(buf []byte) xgb.Event { return v } -// Event write KeyPress +// Bytes writes a KeyPressEvent value to a byte slice. func (v KeyPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -2813,12 +2771,14 @@ func (v KeyPressEvent) Bytes() []byte { return buf } -func (v KeyPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeyPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeyPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of KeyPressEvent. func (v KeyPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -2840,9 +2800,7 @@ func init() { xgb.NewEventFuncs[2] = KeyPressEventNew } -// Event definition ButtonPress (4) -// Size: 32 - +// ButtonPress is the event number for a ButtonPressEvent. const ButtonPress = 4 type ButtonPressEvent struct { @@ -2861,7 +2819,7 @@ type ButtonPressEvent struct { // padding: 1 bytes } -// Event read ButtonPress +// ButtonPressEventNew constructs a ButtonPressEvent value that implements xgb.Event from a byte slice. func ButtonPressEventNew(buf []byte) xgb.Event { v := ButtonPressEvent{} b := 1 // don't read event number @@ -2911,7 +2869,7 @@ func ButtonPressEventNew(buf []byte) xgb.Event { return v } -// Event write ButtonPress +// Bytes writes a ButtonPressEvent value to a byte slice. func (v ButtonPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -2964,12 +2922,14 @@ func (v ButtonPressEvent) Bytes() []byte { return buf } -func (v ButtonPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ButtonPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ButtonPressEvent. func (v ButtonPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -2991,9 +2951,7 @@ func init() { xgb.NewEventFuncs[4] = ButtonPressEventNew } -// Event definition MotionNotify (6) -// Size: 32 - +// MotionNotify is the event number for a MotionNotifyEvent. const MotionNotify = 6 type MotionNotifyEvent struct { @@ -3012,7 +2970,7 @@ type MotionNotifyEvent struct { // padding: 1 bytes } -// Event read MotionNotify +// MotionNotifyEventNew constructs a MotionNotifyEvent value that implements xgb.Event from a byte slice. func MotionNotifyEventNew(buf []byte) xgb.Event { v := MotionNotifyEvent{} b := 1 // don't read event number @@ -3062,7 +3020,7 @@ func MotionNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MotionNotify +// Bytes writes a MotionNotifyEvent value to a byte slice. func (v MotionNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3115,12 +3073,14 @@ func (v MotionNotifyEvent) Bytes() []byte { return buf } -func (v MotionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MotionNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MotionNotifyEvent. func (v MotionNotifyEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3142,9 +3102,7 @@ func init() { xgb.NewEventFuncs[6] = MotionNotifyEventNew } -// Event definition EnterNotify (7) -// Size: 32 - +// EnterNotify is the event number for a EnterNotifyEvent. const EnterNotify = 7 type EnterNotifyEvent struct { @@ -3163,7 +3121,7 @@ type EnterNotifyEvent struct { SameScreenFocus byte } -// Event read EnterNotify +// EnterNotifyEventNew constructs a EnterNotifyEvent value that implements xgb.Event from a byte slice. func EnterNotifyEventNew(buf []byte) xgb.Event { v := EnterNotifyEvent{} b := 1 // don't read event number @@ -3210,7 +3168,7 @@ func EnterNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write EnterNotify +// Bytes writes a EnterNotifyEvent value to a byte slice. func (v EnterNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3260,12 +3218,14 @@ func (v EnterNotifyEvent) Bytes() []byte { return buf } -func (v EnterNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the EnterNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v EnterNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of EnterNotifyEvent. func (v EnterNotifyEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3288,9 +3248,7 @@ func init() { xgb.NewEventFuncs[7] = EnterNotifyEventNew } -// Event definition FocusIn (9) -// Size: 32 - +// FocusIn is the event number for a FocusInEvent. const FocusIn = 9 type FocusInEvent struct { @@ -3301,7 +3259,7 @@ type FocusInEvent struct { // padding: 3 bytes } -// Event read FocusIn +// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. func FocusInEventNew(buf []byte) xgb.Event { v := FocusInEvent{} b := 1 // don't read event number @@ -3323,7 +3281,7 @@ func FocusInEventNew(buf []byte) xgb.Event { return v } -// Event write FocusIn +// Bytes writes a FocusInEvent value to a byte slice. func (v FocusInEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3348,12 +3306,14 @@ func (v FocusInEvent) Bytes() []byte { return buf } -func (v FocusInEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusInEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of FocusInEvent. func (v FocusInEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3367,16 +3327,14 @@ func init() { xgb.NewEventFuncs[9] = FocusInEventNew } -// Event definition KeymapNotify (11) -// Size: 32 - +// KeymapNotify is the event number for a KeymapNotifyEvent. const KeymapNotify = 11 type KeymapNotifyEvent struct { Keys []byte // size: 32 } -// Event read KeymapNotify +// KeymapNotifyEventNew constructs a KeymapNotifyEvent value that implements xgb.Event from a byte slice. func KeymapNotifyEventNew(buf []byte) xgb.Event { v := KeymapNotifyEvent{} b := 1 // don't read event number @@ -3388,7 +3346,7 @@ func KeymapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write KeymapNotify +// Bytes writes a KeymapNotifyEvent value to a byte slice. func (v KeymapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3403,12 +3361,14 @@ func (v KeymapNotifyEvent) Bytes() []byte { return buf } -func (v KeymapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeymapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeymapNotifyEvent) SequenceId() uint16 { return uint16(0) } +// String is a rudimentary string representation of KeymapNotifyEvent. func (v KeymapNotifyEvent) String() string { fieldVals := make([]string, 0, 1) return "KeymapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" @@ -3418,9 +3378,7 @@ func init() { xgb.NewEventFuncs[11] = KeymapNotifyEventNew } -// Event definition Expose (12) -// Size: 32 - +// Expose is the event number for a ExposeEvent. const Expose = 12 type ExposeEvent struct { @@ -3435,7 +3393,7 @@ type ExposeEvent struct { // padding: 2 bytes } -// Event read Expose +// ExposeEventNew constructs a ExposeEvent value that implements xgb.Event from a byte slice. func ExposeEventNew(buf []byte) xgb.Event { v := ExposeEvent{} b := 1 // don't read event number @@ -3468,7 +3426,7 @@ func ExposeEventNew(buf []byte) xgb.Event { return v } -// Event write Expose +// Bytes writes a ExposeEvent value to a byte slice. func (v ExposeEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3504,12 +3462,14 @@ func (v ExposeEvent) Bytes() []byte { return buf } -func (v ExposeEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Expose event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ExposeEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ExposeEvent. func (v ExposeEvent) String() string { fieldVals := make([]string, 0, 8) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3526,9 +3486,7 @@ func init() { xgb.NewEventFuncs[12] = ExposeEventNew } -// Event definition GraphicsExposure (13) -// Size: 32 - +// GraphicsExposure is the event number for a GraphicsExposureEvent. const GraphicsExposure = 13 type GraphicsExposureEvent struct { @@ -3545,7 +3503,7 @@ type GraphicsExposureEvent struct { // padding: 3 bytes } -// Event read GraphicsExposure +// GraphicsExposureEventNew constructs a GraphicsExposureEvent value that implements xgb.Event from a byte slice. func GraphicsExposureEventNew(buf []byte) xgb.Event { v := GraphicsExposureEvent{} b := 1 // don't read event number @@ -3584,7 +3542,7 @@ func GraphicsExposureEventNew(buf []byte) xgb.Event { return v } -// Event write GraphicsExposure +// Bytes writes a GraphicsExposureEvent value to a byte slice. func (v GraphicsExposureEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3626,12 +3584,14 @@ func (v GraphicsExposureEvent) Bytes() []byte { return buf } -func (v GraphicsExposureEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the GraphicsExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v GraphicsExposureEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of GraphicsExposureEvent. func (v GraphicsExposureEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3650,9 +3610,7 @@ func init() { xgb.NewEventFuncs[13] = GraphicsExposureEventNew } -// Event definition NoExposure (14) -// Size: 32 - +// NoExposure is the event number for a NoExposureEvent. const NoExposure = 14 type NoExposureEvent struct { @@ -3664,7 +3622,7 @@ type NoExposureEvent struct { // padding: 1 bytes } -// Event read NoExposure +// NoExposureEventNew constructs a NoExposureEvent value that implements xgb.Event from a byte slice. func NoExposureEventNew(buf []byte) xgb.Event { v := NoExposureEvent{} b := 1 // don't read event number @@ -3688,7 +3646,7 @@ func NoExposureEventNew(buf []byte) xgb.Event { return v } -// Event write NoExposure +// Bytes writes a NoExposureEvent value to a byte slice. func (v NoExposureEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3715,12 +3673,14 @@ func (v NoExposureEvent) Bytes() []byte { return buf } -func (v NoExposureEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the NoExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NoExposureEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NoExposureEvent. func (v NoExposureEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3734,9 +3694,7 @@ func init() { xgb.NewEventFuncs[14] = NoExposureEventNew } -// Event definition VisibilityNotify (15) -// Size: 32 - +// VisibilityNotify is the event number for a VisibilityNotifyEvent. const VisibilityNotify = 15 type VisibilityNotifyEvent struct { @@ -3747,7 +3705,7 @@ type VisibilityNotifyEvent struct { // padding: 3 bytes } -// Event read VisibilityNotify +// VisibilityNotifyEventNew constructs a VisibilityNotifyEvent value that implements xgb.Event from a byte slice. func VisibilityNotifyEventNew(buf []byte) xgb.Event { v := VisibilityNotifyEvent{} b := 1 // don't read event number @@ -3768,7 +3726,7 @@ func VisibilityNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write VisibilityNotify +// Bytes writes a VisibilityNotifyEvent value to a byte slice. func (v VisibilityNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3792,12 +3750,14 @@ func (v VisibilityNotifyEvent) Bytes() []byte { return buf } -func (v VisibilityNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the VisibilityNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v VisibilityNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of VisibilityNotifyEvent. func (v VisibilityNotifyEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3810,9 +3770,7 @@ func init() { xgb.NewEventFuncs[15] = VisibilityNotifyEventNew } -// Event definition CreateNotify (16) -// Size: 32 - +// CreateNotify is the event number for a CreateNotifyEvent. const CreateNotify = 16 type CreateNotifyEvent struct { @@ -3829,7 +3787,7 @@ type CreateNotifyEvent struct { // padding: 1 bytes } -// Event read CreateNotify +// CreateNotifyEventNew constructs a CreateNotifyEvent value that implements xgb.Event from a byte slice. func CreateNotifyEventNew(buf []byte) xgb.Event { v := CreateNotifyEvent{} b := 1 // don't read event number @@ -3872,7 +3830,7 @@ func CreateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CreateNotify +// Bytes writes a CreateNotifyEvent value to a byte slice. func (v CreateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3918,12 +3876,14 @@ func (v CreateNotifyEvent) Bytes() []byte { return buf } -func (v CreateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CreateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CreateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CreateNotifyEvent. func (v CreateNotifyEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3942,9 +3902,7 @@ func init() { xgb.NewEventFuncs[16] = CreateNotifyEventNew } -// Event definition DestroyNotify (17) -// Size: 32 - +// DestroyNotify is the event number for a DestroyNotifyEvent. const DestroyNotify = 17 type DestroyNotifyEvent struct { @@ -3954,7 +3912,7 @@ type DestroyNotifyEvent struct { Window Window } -// Event read DestroyNotify +// DestroyNotifyEventNew constructs a DestroyNotifyEvent value that implements xgb.Event from a byte slice. func DestroyNotifyEventNew(buf []byte) xgb.Event { v := DestroyNotifyEvent{} b := 1 // don't read event number @@ -3973,7 +3931,7 @@ func DestroyNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DestroyNotify +// Bytes writes a DestroyNotifyEvent value to a byte slice. func (v DestroyNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3995,12 +3953,14 @@ func (v DestroyNotifyEvent) Bytes() []byte { return buf } -func (v DestroyNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DestroyNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DestroyNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DestroyNotifyEvent. func (v DestroyNotifyEvent) String() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4013,9 +3973,7 @@ func init() { xgb.NewEventFuncs[17] = DestroyNotifyEventNew } -// Event definition UnmapNotify (18) -// Size: 32 - +// UnmapNotify is the event number for a UnmapNotifyEvent. const UnmapNotify = 18 type UnmapNotifyEvent struct { @@ -4027,7 +3985,7 @@ type UnmapNotifyEvent struct { // padding: 3 bytes } -// Event read UnmapNotify +// UnmapNotifyEventNew constructs a UnmapNotifyEvent value that implements xgb.Event from a byte slice. func UnmapNotifyEventNew(buf []byte) xgb.Event { v := UnmapNotifyEvent{} b := 1 // don't read event number @@ -4055,7 +4013,7 @@ func UnmapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write UnmapNotify +// Bytes writes a UnmapNotifyEvent value to a byte slice. func (v UnmapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4086,12 +4044,14 @@ func (v UnmapNotifyEvent) Bytes() []byte { return buf } -func (v UnmapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the UnmapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v UnmapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of UnmapNotifyEvent. func (v UnmapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4105,9 +4065,7 @@ func init() { xgb.NewEventFuncs[18] = UnmapNotifyEventNew } -// Event definition MapNotify (19) -// Size: 32 - +// MapNotify is the event number for a MapNotifyEvent. const MapNotify = 19 type MapNotifyEvent struct { @@ -4119,7 +4077,7 @@ type MapNotifyEvent struct { // padding: 3 bytes } -// Event read MapNotify +// MapNotifyEventNew constructs a MapNotifyEvent value that implements xgb.Event from a byte slice. func MapNotifyEventNew(buf []byte) xgb.Event { v := MapNotifyEvent{} b := 1 // don't read event number @@ -4147,7 +4105,7 @@ func MapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MapNotify +// Bytes writes a MapNotifyEvent value to a byte slice. func (v MapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4178,12 +4136,14 @@ func (v MapNotifyEvent) Bytes() []byte { return buf } -func (v MapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MapNotifyEvent. func (v MapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4197,9 +4157,7 @@ func init() { xgb.NewEventFuncs[19] = MapNotifyEventNew } -// Event definition MapRequest (20) -// Size: 32 - +// MapRequest is the event number for a MapRequestEvent. const MapRequest = 20 type MapRequestEvent struct { @@ -4209,7 +4167,7 @@ type MapRequestEvent struct { Window Window } -// Event read MapRequest +// MapRequestEventNew constructs a MapRequestEvent value that implements xgb.Event from a byte slice. func MapRequestEventNew(buf []byte) xgb.Event { v := MapRequestEvent{} b := 1 // don't read event number @@ -4228,7 +4186,7 @@ func MapRequestEventNew(buf []byte) xgb.Event { return v } -// Event write MapRequest +// Bytes writes a MapRequestEvent value to a byte slice. func (v MapRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4250,12 +4208,14 @@ func (v MapRequestEvent) Bytes() []byte { return buf } -func (v MapRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MapRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MapRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MapRequestEvent. func (v MapRequestEvent) String() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4268,9 +4228,7 @@ func init() { xgb.NewEventFuncs[20] = MapRequestEventNew } -// Event definition ReparentNotify (21) -// Size: 32 - +// ReparentNotify is the event number for a ReparentNotifyEvent. const ReparentNotify = 21 type ReparentNotifyEvent struct { @@ -4285,7 +4243,7 @@ type ReparentNotifyEvent struct { // padding: 3 bytes } -// Event read ReparentNotify +// ReparentNotifyEventNew constructs a ReparentNotifyEvent value that implements xgb.Event from a byte slice. func ReparentNotifyEventNew(buf []byte) xgb.Event { v := ReparentNotifyEvent{} b := 1 // don't read event number @@ -4322,7 +4280,7 @@ func ReparentNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ReparentNotify +// Bytes writes a ReparentNotifyEvent value to a byte slice. func (v ReparentNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4362,12 +4320,14 @@ func (v ReparentNotifyEvent) Bytes() []byte { return buf } -func (v ReparentNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ReparentNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ReparentNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ReparentNotifyEvent. func (v ReparentNotifyEvent) String() string { fieldVals := make([]string, 0, 8) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4384,9 +4344,7 @@ func init() { xgb.NewEventFuncs[21] = ReparentNotifyEventNew } -// Event definition ConfigureNotify (22) -// Size: 32 - +// ConfigureNotify is the event number for a ConfigureNotifyEvent. const ConfigureNotify = 22 type ConfigureNotifyEvent struct { @@ -4404,7 +4362,7 @@ type ConfigureNotifyEvent struct { // padding: 1 bytes } -// Event read ConfigureNotify +// ConfigureNotifyEventNew constructs a ConfigureNotifyEvent value that implements xgb.Event from a byte slice. func ConfigureNotifyEventNew(buf []byte) xgb.Event { v := ConfigureNotifyEvent{} b := 1 // don't read event number @@ -4450,7 +4408,7 @@ func ConfigureNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ConfigureNotify +// Bytes writes a ConfigureNotifyEvent value to a byte slice. func (v ConfigureNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4499,12 +4457,14 @@ func (v ConfigureNotifyEvent) Bytes() []byte { return buf } -func (v ConfigureNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ConfigureNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ConfigureNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ConfigureNotifyEvent. func (v ConfigureNotifyEvent) String() string { fieldVals := make([]string, 0, 11) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4524,9 +4484,7 @@ func init() { xgb.NewEventFuncs[22] = ConfigureNotifyEventNew } -// Event definition ConfigureRequest (23) -// Size: 32 - +// ConfigureRequest is the event number for a ConfigureRequestEvent. const ConfigureRequest = 23 type ConfigureRequestEvent struct { @@ -4543,7 +4501,7 @@ type ConfigureRequestEvent struct { ValueMask uint16 } -// Event read ConfigureRequest +// ConfigureRequestEventNew constructs a ConfigureRequestEvent value that implements xgb.Event from a byte slice. func ConfigureRequestEventNew(buf []byte) xgb.Event { v := ConfigureRequestEvent{} b := 1 // don't read event number @@ -4584,7 +4542,7 @@ func ConfigureRequestEventNew(buf []byte) xgb.Event { return v } -// Event write ConfigureRequest +// Bytes writes a ConfigureRequestEvent value to a byte slice. func (v ConfigureRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4628,12 +4586,14 @@ func (v ConfigureRequestEvent) Bytes() []byte { return buf } -func (v ConfigureRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ConfigureRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ConfigureRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ConfigureRequestEvent. func (v ConfigureRequestEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4654,9 +4614,7 @@ func init() { xgb.NewEventFuncs[23] = ConfigureRequestEventNew } -// Event definition GravityNotify (24) -// Size: 32 - +// GravityNotify is the event number for a GravityNotifyEvent. const GravityNotify = 24 type GravityNotifyEvent struct { @@ -4668,7 +4626,7 @@ type GravityNotifyEvent struct { Y int16 } -// Event read GravityNotify +// GravityNotifyEventNew constructs a GravityNotifyEvent value that implements xgb.Event from a byte slice. func GravityNotifyEventNew(buf []byte) xgb.Event { v := GravityNotifyEvent{} b := 1 // don't read event number @@ -4693,7 +4651,7 @@ func GravityNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write GravityNotify +// Bytes writes a GravityNotifyEvent value to a byte slice. func (v GravityNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4721,12 +4679,14 @@ func (v GravityNotifyEvent) Bytes() []byte { return buf } -func (v GravityNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the GravityNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v GravityNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of GravityNotifyEvent. func (v GravityNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4741,9 +4701,7 @@ func init() { xgb.NewEventFuncs[24] = GravityNotifyEventNew } -// Event definition ResizeRequest (25) -// Size: 32 - +// ResizeRequest is the event number for a ResizeRequestEvent. const ResizeRequest = 25 type ResizeRequestEvent struct { @@ -4754,7 +4712,7 @@ type ResizeRequestEvent struct { Height uint16 } -// Event read ResizeRequest +// ResizeRequestEventNew constructs a ResizeRequestEvent value that implements xgb.Event from a byte slice. func ResizeRequestEventNew(buf []byte) xgb.Event { v := ResizeRequestEvent{} b := 1 // don't read event number @@ -4776,7 +4734,7 @@ func ResizeRequestEventNew(buf []byte) xgb.Event { return v } -// Event write ResizeRequest +// Bytes writes a ResizeRequestEvent value to a byte slice. func (v ResizeRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4801,12 +4759,14 @@ func (v ResizeRequestEvent) Bytes() []byte { return buf } -func (v ResizeRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ResizeRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ResizeRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ResizeRequestEvent. func (v ResizeRequestEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4820,9 +4780,7 @@ func init() { xgb.NewEventFuncs[25] = ResizeRequestEventNew } -// Event definition CirculateNotify (26) -// Size: 32 - +// CirculateNotify is the event number for a CirculateNotifyEvent. const CirculateNotify = 26 type CirculateNotifyEvent struct { @@ -4835,7 +4793,7 @@ type CirculateNotifyEvent struct { // padding: 3 bytes } -// Event read CirculateNotify +// CirculateNotifyEventNew constructs a CirculateNotifyEvent value that implements xgb.Event from a byte slice. func CirculateNotifyEventNew(buf []byte) xgb.Event { v := CirculateNotifyEvent{} b := 1 // don't read event number @@ -4861,7 +4819,7 @@ func CirculateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CirculateNotify +// Bytes writes a CirculateNotifyEvent value to a byte slice. func (v CirculateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4890,12 +4848,14 @@ func (v CirculateNotifyEvent) Bytes() []byte { return buf } -func (v CirculateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CirculateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CirculateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CirculateNotifyEvent. func (v CirculateNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4909,9 +4869,7 @@ func init() { xgb.NewEventFuncs[26] = CirculateNotifyEventNew } -// Event definition PropertyNotify (28) -// Size: 32 - +// PropertyNotify is the event number for a PropertyNotifyEvent. const PropertyNotify = 28 type PropertyNotifyEvent struct { @@ -4924,7 +4882,7 @@ type PropertyNotifyEvent struct { // padding: 3 bytes } -// Event read PropertyNotify +// PropertyNotifyEventNew constructs a PropertyNotifyEvent value that implements xgb.Event from a byte slice. func PropertyNotifyEventNew(buf []byte) xgb.Event { v := PropertyNotifyEvent{} b := 1 // don't read event number @@ -4951,7 +4909,7 @@ func PropertyNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write PropertyNotify +// Bytes writes a PropertyNotifyEvent value to a byte slice. func (v PropertyNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4981,12 +4939,14 @@ func (v PropertyNotifyEvent) Bytes() []byte { return buf } -func (v PropertyNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the PropertyNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v PropertyNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of PropertyNotifyEvent. func (v PropertyNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5001,9 +4961,7 @@ func init() { xgb.NewEventFuncs[28] = PropertyNotifyEventNew } -// Event definition SelectionClear (29) -// Size: 32 - +// SelectionClear is the event number for a SelectionClearEvent. const SelectionClear = 29 type SelectionClearEvent struct { @@ -5014,7 +4972,7 @@ type SelectionClearEvent struct { Selection Atom } -// Event read SelectionClear +// SelectionClearEventNew constructs a SelectionClearEvent value that implements xgb.Event from a byte slice. func SelectionClearEventNew(buf []byte) xgb.Event { v := SelectionClearEvent{} b := 1 // don't read event number @@ -5036,7 +4994,7 @@ func SelectionClearEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionClear +// Bytes writes a SelectionClearEvent value to a byte slice. func (v SelectionClearEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5061,12 +5019,14 @@ func (v SelectionClearEvent) Bytes() []byte { return buf } -func (v SelectionClearEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionClear event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionClearEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionClearEvent. func (v SelectionClearEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5080,9 +5040,7 @@ func init() { xgb.NewEventFuncs[29] = SelectionClearEventNew } -// Event definition SelectionRequest (30) -// Size: 32 - +// SelectionRequest is the event number for a SelectionRequestEvent. const SelectionRequest = 30 type SelectionRequestEvent struct { @@ -5096,7 +5054,7 @@ type SelectionRequestEvent struct { Property Atom } -// Event read SelectionRequest +// SelectionRequestEventNew constructs a SelectionRequestEvent value that implements xgb.Event from a byte slice. func SelectionRequestEventNew(buf []byte) xgb.Event { v := SelectionRequestEvent{} b := 1 // don't read event number @@ -5127,7 +5085,7 @@ func SelectionRequestEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionRequest +// Bytes writes a SelectionRequestEvent value to a byte slice. func (v SelectionRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5161,12 +5119,14 @@ func (v SelectionRequestEvent) Bytes() []byte { return buf } -func (v SelectionRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionRequestEvent. func (v SelectionRequestEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5183,9 +5143,7 @@ func init() { xgb.NewEventFuncs[30] = SelectionRequestEventNew } -// Event definition SelectionNotify (31) -// Size: 32 - +// SelectionNotify is the event number for a SelectionNotifyEvent. const SelectionNotify = 31 type SelectionNotifyEvent struct { @@ -5198,7 +5156,7 @@ type SelectionNotifyEvent struct { Property Atom } -// Event read SelectionNotify +// SelectionNotifyEventNew constructs a SelectionNotifyEvent value that implements xgb.Event from a byte slice. func SelectionNotifyEventNew(buf []byte) xgb.Event { v := SelectionNotifyEvent{} b := 1 // don't read event number @@ -5226,7 +5184,7 @@ func SelectionNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionNotify +// Bytes writes a SelectionNotifyEvent value to a byte slice. func (v SelectionNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5257,12 +5215,14 @@ func (v SelectionNotifyEvent) Bytes() []byte { return buf } -func (v SelectionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionNotifyEvent. func (v SelectionNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5278,9 +5238,7 @@ func init() { xgb.NewEventFuncs[31] = SelectionNotifyEventNew } -// Event definition ColormapNotify (32) -// Size: 32 - +// ColormapNotify is the event number for a ColormapNotifyEvent. const ColormapNotify = 32 type ColormapNotifyEvent struct { @@ -5293,7 +5251,7 @@ type ColormapNotifyEvent struct { // padding: 2 bytes } -// Event read ColormapNotify +// ColormapNotifyEventNew constructs a ColormapNotifyEvent value that implements xgb.Event from a byte slice. func ColormapNotifyEventNew(buf []byte) xgb.Event { v := ColormapNotifyEvent{} b := 1 // don't read event number @@ -5324,7 +5282,7 @@ func ColormapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ColormapNotify +// Bytes writes a ColormapNotifyEvent value to a byte slice. func (v ColormapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5358,12 +5316,14 @@ func (v ColormapNotifyEvent) Bytes() []byte { return buf } -func (v ColormapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ColormapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ColormapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ColormapNotifyEvent. func (v ColormapNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5378,9 +5338,7 @@ func init() { xgb.NewEventFuncs[32] = ColormapNotifyEventNew } -// Event definition ClientMessage (33) -// Size: 32 - +// ClientMessage is the event number for a ClientMessageEvent. const ClientMessage = 33 type ClientMessageEvent struct { @@ -5391,7 +5349,7 @@ type ClientMessageEvent struct { Data ClientMessageDataUnion } -// Event read ClientMessage +// ClientMessageEventNew constructs a ClientMessageEvent value that implements xgb.Event from a byte slice. func ClientMessageEventNew(buf []byte) xgb.Event { v := ClientMessageEvent{} b := 1 // don't read event number @@ -5414,7 +5372,7 @@ func ClientMessageEventNew(buf []byte) xgb.Event { return v } -// Event write ClientMessage +// Bytes writes a ClientMessageEvent value to a byte slice. func (v ClientMessageEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5443,12 +5401,14 @@ func (v ClientMessageEvent) Bytes() []byte { return buf } -func (v ClientMessageEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ClientMessage event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ClientMessageEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ClientMessageEvent. func (v ClientMessageEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5462,9 +5422,7 @@ func init() { xgb.NewEventFuncs[33] = ClientMessageEventNew } -// Event definition MappingNotify (34) -// Size: 32 - +// MappingNotify is the event number for a MappingNotifyEvent. const MappingNotify = 34 type MappingNotifyEvent struct { @@ -5476,7 +5434,7 @@ type MappingNotifyEvent struct { // padding: 1 bytes } -// Event read MappingNotify +// MappingNotifyEventNew constructs a MappingNotifyEvent value that implements xgb.Event from a byte slice. func MappingNotifyEventNew(buf []byte) xgb.Event { v := MappingNotifyEvent{} b := 1 // don't read event number @@ -5500,7 +5458,7 @@ func MappingNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MappingNotify +// Bytes writes a MappingNotifyEvent value to a byte slice. func (v MappingNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5527,12 +5485,14 @@ func (v MappingNotifyEvent) Bytes() []byte { return buf } -func (v MappingNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MappingNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MappingNotifyEvent. func (v MappingNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5546,22 +5506,24 @@ func init() { xgb.NewEventFuncs[34] = MappingNotifyEventNew } -// EventCopy definition KeyRelease (3) - +// KeyRelease is the event number for a KeyReleaseEvent. const KeyRelease = 3 type KeyReleaseEvent KeyPressEvent +// KeyReleaseEventNew constructs a KeyReleaseEvent value that implements xgb.Event from a byte slice. func KeyReleaseEventNew(buf []byte) xgb.Event { return KeyReleaseEvent(KeyPressEventNew(buf).(KeyPressEvent)) } +// Bytes writes a KeyReleaseEvent value to a byte slice. func (v KeyReleaseEvent) Bytes() []byte { return KeyPressEvent(v).Bytes() } -func (v KeyReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeyReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -5587,22 +5549,24 @@ func init() { xgb.NewEventFuncs[3] = KeyReleaseEventNew } -// EventCopy definition ButtonRelease (5) - +// ButtonRelease is the event number for a ButtonReleaseEvent. const ButtonRelease = 5 type ButtonReleaseEvent ButtonPressEvent +// ButtonReleaseEventNew constructs a ButtonReleaseEvent value that implements xgb.Event from a byte slice. func ButtonReleaseEventNew(buf []byte) xgb.Event { return ButtonReleaseEvent(ButtonPressEventNew(buf).(ButtonPressEvent)) } +// Bytes writes a ButtonReleaseEvent value to a byte slice. func (v ButtonReleaseEvent) Bytes() []byte { return ButtonPressEvent(v).Bytes() } -func (v ButtonReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ButtonReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -5628,22 +5592,24 @@ func init() { xgb.NewEventFuncs[5] = ButtonReleaseEventNew } -// EventCopy definition LeaveNotify (8) - +// LeaveNotify is the event number for a LeaveNotifyEvent. const LeaveNotify = 8 type LeaveNotifyEvent EnterNotifyEvent +// LeaveNotifyEventNew constructs a LeaveNotifyEvent value that implements xgb.Event from a byte slice. func LeaveNotifyEventNew(buf []byte) xgb.Event { return LeaveNotifyEvent(EnterNotifyEventNew(buf).(EnterNotifyEvent)) } +// Bytes writes a LeaveNotifyEvent value to a byte slice. func (v LeaveNotifyEvent) Bytes() []byte { return EnterNotifyEvent(v).Bytes() } -func (v LeaveNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the LeaveNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v LeaveNotifyEvent) SequenceId() uint16 { return v.Sequence } @@ -5670,22 +5636,24 @@ func init() { xgb.NewEventFuncs[8] = LeaveNotifyEventNew } -// EventCopy definition FocusOut (10) - +// FocusOut is the event number for a FocusOutEvent. const FocusOut = 10 type FocusOutEvent FocusInEvent +// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. func FocusOutEventNew(buf []byte) xgb.Event { return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) } +// Bytes writes a FocusOutEvent value to a byte slice. func (v FocusOutEvent) Bytes() []byte { return FocusInEvent(v).Bytes() } -func (v FocusOutEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusOutEvent) SequenceId() uint16 { return v.Sequence } @@ -5703,22 +5671,24 @@ func init() { xgb.NewEventFuncs[10] = FocusOutEventNew } -// EventCopy definition CirculateRequest (27) - +// CirculateRequest is the event number for a CirculateRequestEvent. const CirculateRequest = 27 type CirculateRequestEvent CirculateNotifyEvent +// CirculateRequestEventNew constructs a CirculateRequestEvent value that implements xgb.Event from a byte slice. func CirculateRequestEventNew(buf []byte) xgb.Event { return CirculateRequestEvent(CirculateNotifyEventNew(buf).(CirculateNotifyEvent)) } +// Bytes writes a CirculateRequestEvent value to a byte slice. func (v CirculateRequestEvent) Bytes() []byte { return CirculateNotifyEvent(v).Bytes() } -func (v CirculateRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CirculateRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CirculateRequestEvent) SequenceId() uint16 { return v.Sequence } @@ -5736,9 +5706,7 @@ func init() { xgb.NewEventFuncs[27] = CirculateRequestEventNew } -// Error definition Request (1) -// Size: 32 - +// BadRequest is the error number for a BadRequest. const BadRequest = 1 type RequestError struct { @@ -5750,7 +5718,7 @@ type RequestError struct { // padding: 1 bytes } -// Error read Request +// RequestErrorNew constructs a RequestError value that implements xgb.Error from a byte slice. func RequestErrorNew(buf []byte) xgb.Error { v := RequestError{} v.NiceName = "Request" @@ -5775,8 +5743,8 @@ func RequestErrorNew(buf []byte) xgb.Error { return v } -func (err RequestError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadRequest error. +// This is mostly used internally. func (err RequestError) SequenceId() uint16 { return err.Sequence } @@ -5799,9 +5767,7 @@ func init() { xgb.NewErrorFuncs[1] = RequestErrorNew } -// Error definition Value (2) -// Size: 32 - +// BadValue is the error number for a BadValue. const BadValue = 2 type ValueError struct { @@ -5813,7 +5779,7 @@ type ValueError struct { // padding: 1 bytes } -// Error read Value +// ValueErrorNew constructs a ValueError value that implements xgb.Error from a byte slice. func ValueErrorNew(buf []byte) xgb.Error { v := ValueError{} v.NiceName = "Value" @@ -5838,8 +5804,8 @@ func ValueErrorNew(buf []byte) xgb.Error { return v } -func (err ValueError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadValue error. +// This is mostly used internally. func (err ValueError) SequenceId() uint16 { return err.Sequence } @@ -5862,20 +5828,20 @@ func init() { xgb.NewErrorFuncs[2] = ValueErrorNew } -// ErrorCopy definition Window (3) - +// BadWindow is the error number for a BadWindow. const BadWindow = 3 type WindowError ValueError +// WindowErrorNew constructs a WindowError value that implements xgb.Error from a byte slice. func WindowErrorNew(buf []byte) xgb.Error { v := WindowError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Window" return v } -func (err WindowError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadWindow error. +// This is mostly used internally. func (err WindowError) SequenceId() uint16 { return err.Sequence } @@ -5898,20 +5864,20 @@ func init() { xgb.NewErrorFuncs[3] = WindowErrorNew } -// ErrorCopy definition Pixmap (4) - +// BadPixmap is the error number for a BadPixmap. const BadPixmap = 4 type PixmapError ValueError +// PixmapErrorNew constructs a PixmapError value that implements xgb.Error from a byte slice. func PixmapErrorNew(buf []byte) xgb.Error { v := PixmapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Pixmap" return v } -func (err PixmapError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadPixmap error. +// This is mostly used internally. func (err PixmapError) SequenceId() uint16 { return err.Sequence } @@ -5934,20 +5900,20 @@ func init() { xgb.NewErrorFuncs[4] = PixmapErrorNew } -// ErrorCopy definition Atom (5) - +// BadAtom is the error number for a BadAtom. const BadAtom = 5 type AtomError ValueError +// AtomErrorNew constructs a AtomError value that implements xgb.Error from a byte slice. func AtomErrorNew(buf []byte) xgb.Error { v := AtomError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Atom" return v } -func (err AtomError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAtom error. +// This is mostly used internally. func (err AtomError) SequenceId() uint16 { return err.Sequence } @@ -5970,20 +5936,20 @@ func init() { xgb.NewErrorFuncs[5] = AtomErrorNew } -// ErrorCopy definition Cursor (6) - +// BadCursor is the error number for a BadCursor. const BadCursor = 6 type CursorError ValueError +// CursorErrorNew constructs a CursorError value that implements xgb.Error from a byte slice. func CursorErrorNew(buf []byte) xgb.Error { v := CursorError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Cursor" return v } -func (err CursorError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadCursor error. +// This is mostly used internally. func (err CursorError) SequenceId() uint16 { return err.Sequence } @@ -6006,20 +5972,20 @@ func init() { xgb.NewErrorFuncs[6] = CursorErrorNew } -// ErrorCopy definition Font (7) - +// BadFont is the error number for a BadFont. const BadFont = 7 type FontError ValueError +// FontErrorNew constructs a FontError value that implements xgb.Error from a byte slice. func FontErrorNew(buf []byte) xgb.Error { v := FontError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Font" return v } -func (err FontError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadFont error. +// This is mostly used internally. func (err FontError) SequenceId() uint16 { return err.Sequence } @@ -6042,20 +6008,20 @@ func init() { xgb.NewErrorFuncs[7] = FontErrorNew } -// ErrorCopy definition Match (8) - +// BadMatch is the error number for a BadMatch. const BadMatch = 8 type MatchError RequestError +// MatchErrorNew constructs a MatchError value that implements xgb.Error from a byte slice. func MatchErrorNew(buf []byte) xgb.Error { v := MatchError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Match" return v } -func (err MatchError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadMatch error. +// This is mostly used internally. func (err MatchError) SequenceId() uint16 { return err.Sequence } @@ -6078,20 +6044,20 @@ func init() { xgb.NewErrorFuncs[8] = MatchErrorNew } -// ErrorCopy definition Drawable (9) - +// BadDrawable is the error number for a BadDrawable. const BadDrawable = 9 type DrawableError ValueError +// DrawableErrorNew constructs a DrawableError value that implements xgb.Error from a byte slice. func DrawableErrorNew(buf []byte) xgb.Error { v := DrawableError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Drawable" return v } -func (err DrawableError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDrawable error. +// This is mostly used internally. func (err DrawableError) SequenceId() uint16 { return err.Sequence } @@ -6114,20 +6080,20 @@ func init() { xgb.NewErrorFuncs[9] = DrawableErrorNew } -// ErrorCopy definition Access (10) - +// BadAccess is the error number for a BadAccess. const BadAccess = 10 type AccessError RequestError +// AccessErrorNew constructs a AccessError value that implements xgb.Error from a byte slice. func AccessErrorNew(buf []byte) xgb.Error { v := AccessError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Access" return v } -func (err AccessError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAccess error. +// This is mostly used internally. func (err AccessError) SequenceId() uint16 { return err.Sequence } @@ -6150,20 +6116,20 @@ func init() { xgb.NewErrorFuncs[10] = AccessErrorNew } -// ErrorCopy definition Alloc (11) - +// BadAlloc is the error number for a BadAlloc. const BadAlloc = 11 type AllocError RequestError +// AllocErrorNew constructs a AllocError value that implements xgb.Error from a byte slice. func AllocErrorNew(buf []byte) xgb.Error { v := AllocError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Alloc" return v } -func (err AllocError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAlloc error. +// This is mostly used internally. func (err AllocError) SequenceId() uint16 { return err.Sequence } @@ -6186,20 +6152,20 @@ func init() { xgb.NewErrorFuncs[11] = AllocErrorNew } -// ErrorCopy definition Colormap (12) - +// BadColormap is the error number for a BadColormap. const BadColormap = 12 type ColormapError ValueError +// ColormapErrorNew constructs a ColormapError value that implements xgb.Error from a byte slice. func ColormapErrorNew(buf []byte) xgb.Error { v := ColormapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Colormap" return v } -func (err ColormapError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadColormap error. +// This is mostly used internally. func (err ColormapError) SequenceId() uint16 { return err.Sequence } @@ -6222,20 +6188,20 @@ func init() { xgb.NewErrorFuncs[12] = ColormapErrorNew } -// ErrorCopy definition GContext (13) - +// BadGContext is the error number for a BadGContext. const BadGContext = 13 type GContextError ValueError +// GContextErrorNew constructs a GContextError value that implements xgb.Error from a byte slice. func GContextErrorNew(buf []byte) xgb.Error { v := GContextError(ValueErrorNew(buf).(ValueError)) v.NiceName = "GContext" return v } -func (err GContextError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGContext error. +// This is mostly used internally. func (err GContextError) SequenceId() uint16 { return err.Sequence } @@ -6258,20 +6224,20 @@ func init() { xgb.NewErrorFuncs[13] = GContextErrorNew } -// ErrorCopy definition IDChoice (14) - +// BadIDChoice is the error number for a BadIDChoice. const BadIDChoice = 14 type IDChoiceError ValueError +// IDChoiceErrorNew constructs a IDChoiceError value that implements xgb.Error from a byte slice. func IDChoiceErrorNew(buf []byte) xgb.Error { v := IDChoiceError(ValueErrorNew(buf).(ValueError)) v.NiceName = "IDChoice" return v } -func (err IDChoiceError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadIDChoice error. +// This is mostly used internally. func (err IDChoiceError) SequenceId() uint16 { return err.Sequence } @@ -6294,20 +6260,20 @@ func init() { xgb.NewErrorFuncs[14] = IDChoiceErrorNew } -// ErrorCopy definition Name (15) - +// BadName is the error number for a BadName. const BadName = 15 type NameError RequestError +// NameErrorNew constructs a NameError value that implements xgb.Error from a byte slice. func NameErrorNew(buf []byte) xgb.Error { v := NameError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Name" return v } -func (err NameError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadName error. +// This is mostly used internally. func (err NameError) SequenceId() uint16 { return err.Sequence } @@ -6330,20 +6296,20 @@ func init() { xgb.NewErrorFuncs[15] = NameErrorNew } -// ErrorCopy definition Length (16) - +// BadLength is the error number for a BadLength. const BadLength = 16 type LengthError RequestError +// LengthErrorNew constructs a LengthError value that implements xgb.Error from a byte slice. func LengthErrorNew(buf []byte) xgb.Error { v := LengthError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Length" return v } -func (err LengthError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadLength error. +// This is mostly used internally. func (err LengthError) SequenceId() uint16 { return err.Sequence } @@ -6366,20 +6332,20 @@ func init() { xgb.NewErrorFuncs[16] = LengthErrorNew } -// ErrorCopy definition Implementation (17) - +// BadImplementation is the error number for a BadImplementation. const BadImplementation = 17 type ImplementationError RequestError +// ImplementationErrorNew constructs a ImplementationError value that implements xgb.Error from a byte slice. func ImplementationErrorNew(buf []byte) xgb.Error { v := ImplementationError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Implementation" return v } -func (err ImplementationError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadImplementation error. +// This is mostly used internally. func (err ImplementationError) SequenceId() uint16 { return err.Sequence } @@ -6402,30 +6368,35 @@ func init() { xgb.NewErrorFuncs[17] = ImplementationErrorNew } -// Request CreateWindow -// size: xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreateWindowCookie is a cookie used only for CreateWindow requests. type CreateWindowCookie struct { *xgb.Cookie } -// Write request to wire for CreateWindow +// CreateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateWindow(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } +// CreateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateWindowCookie.Check() func CreateWindowChecked(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateWindow +// createWindowRequest writes a CreateWindow request to a byte slice. func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -6478,30 +6449,35 @@ func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X i return buf } -// Request ChangeWindowAttributes -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeWindowAttributesCookie is a cookie used only for ChangeWindowAttributes requests. type ChangeWindowAttributesCookie struct { *xgb.Cookie } -// Write request to wire for ChangeWindowAttributes +// ChangeWindowAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } +// ChangeWindowAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeWindowAttributesCookie.Check() func ChangeWindowAttributesChecked(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeWindowAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeWindowAttributes +// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -6529,29 +6505,31 @@ func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, return buf } -// Request GetWindowAttributes -// size: 8 +// GetWindowAttributesCookie is a cookie used only for GetWindowAttributes requests. type GetWindowAttributesCookie struct { *xgb.Cookie } +// GetWindowAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowAttributesCookie.Reply() func GetWindowAttributes(c *xgb.Conn, Window Window) GetWindowAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } +// GetWindowAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowAttributesUnchecked(c *xgb.Conn, Window Window) GetWindowAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } -// Request reply for GetWindowAttributes -// size: 44 +// GetWindowAttributesReply represents the data returned from a GetWindowAttributes request. type GetWindowAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply BackingStore byte Visual Visualid Class uint16 @@ -6570,7 +6548,7 @@ type GetWindowAttributesReply struct { // padding: 2 bytes } -// Waits and reads reply data from request GetWindowAttributes +// Reply blocks and returns the reply data for a GetWindowAttributes request. func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6582,7 +6560,7 @@ func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) return getWindowAttributesReply(buf), nil } -// Read reply into structure from buffer for GetWindowAttributes +// getWindowAttributesReply reads a byte slice into a GetWindowAttributesReply value. func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { v := new(GetWindowAttributesReply) b := 1 // skip reply determinant @@ -6656,6 +6634,7 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { } // Write request to wire for GetWindowAttributes +// getWindowAttributesRequest writes a GetWindowAttributes request to a byte slice. func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6675,30 +6654,35 @@ func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request DestroyWindow -// size: 8 +// DestroyWindowCookie is a cookie used only for DestroyWindow requests. type DestroyWindowCookie struct { *xgb.Cookie } -// Write request to wire for DestroyWindow +// DestroyWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{cookie} } +// DestroyWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyWindowCookie.Check() func DestroyWindowChecked(c *xgb.Conn, Window Window) DestroyWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyWindow +// destroyWindowRequest writes a DestroyWindow request to a byte slice. func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6718,30 +6702,35 @@ func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request DestroySubwindows -// size: 8 +// DestroySubwindowsCookie is a cookie used only for DestroySubwindows requests. type DestroySubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for DestroySubwindows +// DestroySubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{cookie} } +// DestroySubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySubwindowsCookie.Check() func DestroySubwindowsChecked(c *xgb.Conn, Window Window) DestroySubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroySubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroySubwindows +// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice. func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6761,30 +6750,35 @@ func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request ChangeSaveSet -// size: 8 +// ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. type ChangeSaveSetCookie struct { *xgb.Cookie } -// Write request to wire for ChangeSaveSet +// ChangeSaveSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } +// ChangeSaveSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeSaveSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeSaveSet +// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { size := 8 b := 0 @@ -6805,30 +6799,35 @@ func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { return buf } -// Request ReparentWindow -// size: 16 +// ReparentWindowCookie is a cookie used only for ReparentWindow requests. type ReparentWindowCookie struct { *xgb.Cookie } -// Write request to wire for ReparentWindow +// ReparentWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReparentWindow(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } +// ReparentWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ReparentWindowCookie.Check() func ReparentWindowChecked(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ReparentWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ReparentWindow +// reparentWindowRequest writes a ReparentWindow request to a byte slice. func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) []byte { size := 16 b := 0 @@ -6857,30 +6856,35 @@ func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y return buf } -// Request MapWindow -// size: 8 +// MapWindowCookie is a cookie used only for MapWindow requests. type MapWindowCookie struct { *xgb.Cookie } -// Write request to wire for MapWindow +// MapWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{cookie} } +// MapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using MapWindowCookie.Check() func MapWindowChecked(c *xgb.Conn, Window Window) MapWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook MapWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for MapWindow +// mapWindowRequest writes a MapWindow request to a byte slice. func mapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6900,30 +6904,35 @@ func mapWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request MapSubwindows -// size: 8 +// MapSubwindowsCookie is a cookie used only for MapSubwindows requests. type MapSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for MapSubwindows +// MapSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{cookie} } +// MapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using MapSubwindowsCookie.Check() func MapSubwindowsChecked(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook MapSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for MapSubwindows +// mapSubwindowsRequest writes a MapSubwindows request to a byte slice. func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6943,30 +6952,35 @@ func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request UnmapWindow -// size: 8 +// UnmapWindowCookie is a cookie used only for UnmapWindow requests. type UnmapWindowCookie struct { *xgb.Cookie } -// Write request to wire for UnmapWindow +// UnmapWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{cookie} } +// UnmapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapWindowCookie.Check() func UnmapWindowChecked(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnmapWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnmapWindow +// unmapWindowRequest writes a UnmapWindow request to a byte slice. func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6986,30 +7000,35 @@ func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request UnmapSubwindows -// size: 8 +// UnmapSubwindowsCookie is a cookie used only for UnmapSubwindows requests. type UnmapSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for UnmapSubwindows +// UnmapSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{cookie} } +// UnmapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapSubwindowsCookie.Check() func UnmapSubwindowsChecked(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UnmapSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnmapSubwindows +// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice. func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -7029,30 +7048,35 @@ func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request ConfigureWindow -// size: xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ConfigureWindowCookie is a cookie used only for ConfigureWindow requests. type ConfigureWindowCookie struct { *xgb.Cookie } -// Write request to wire for ConfigureWindow +// ConfigureWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } +// ConfigureWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureWindowCookie.Check() func ConfigureWindowChecked(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ConfigureWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ConfigureWindow +// configureWindowRequest writes a ConfigureWindow request to a byte slice. func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -7083,30 +7107,35 @@ func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueL return buf } -// Request CirculateWindow -// size: 8 +// CirculateWindowCookie is a cookie used only for CirculateWindow requests. type CirculateWindowCookie struct { *xgb.Cookie } -// Write request to wire for CirculateWindow +// CirculateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{cookie} } +// CirculateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CirculateWindowCookie.Check() func CirculateWindowChecked(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CirculateWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CirculateWindow +// circulateWindowRequest writes a CirculateWindow request to a byte slice. func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { size := 8 b := 0 @@ -7127,29 +7156,31 @@ func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { return buf } -// Request GetGeometry -// size: 8 +// GetGeometryCookie is a cookie used only for GetGeometry requests. type GetGeometryCookie struct { *xgb.Cookie } +// GetGeometry sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGeometryCookie.Reply() func GetGeometry(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { cookie := c.NewCookie(true, true) c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } +// GetGeometryUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { cookie := c.NewCookie(false, true) c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } -// Request reply for GetGeometry -// size: 24 +// GetGeometryReply represents the data returned from a GetGeometry request. type GetGeometryReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Depth byte Root Window X int16 @@ -7160,7 +7191,7 @@ type GetGeometryReply struct { // padding: 2 bytes } -// Waits and reads reply data from request GetGeometry +// Reply blocks and returns the reply data for a GetGeometry request. func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7172,7 +7203,7 @@ func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { return getGeometryReply(buf), nil } -// Read reply into structure from buffer for GetGeometry +// getGeometryReply reads a byte slice into a GetGeometryReply value. func getGeometryReply(buf []byte) *GetGeometryReply { v := new(GetGeometryReply) b := 1 // skip reply determinant @@ -7210,6 +7241,7 @@ func getGeometryReply(buf []byte) *GetGeometryReply { } // Write request to wire for GetGeometry +// getGeometryRequest writes a GetGeometry request to a byte slice. func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { size := 8 b := 0 @@ -7229,29 +7261,31 @@ func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { return buf } -// Request QueryTree -// size: 8 +// QueryTreeCookie is a cookie used only for QueryTree requests. type QueryTreeCookie struct { *xgb.Cookie } +// QueryTree sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTreeCookie.Reply() func QueryTree(c *xgb.Conn, Window Window) QueryTreeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } +// QueryTreeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryTreeUnchecked(c *xgb.Conn, Window Window) QueryTreeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } -// Request reply for QueryTree -// size: (32 + xgb.Pad((int(ChildrenLen) * 4))) +// QueryTreeReply represents the data returned from a QueryTree request. type QueryTreeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Root Window Parent Window @@ -7260,7 +7294,7 @@ type QueryTreeReply struct { Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) } -// Waits and reads reply data from request QueryTree +// Reply blocks and returns the reply data for a QueryTree request. func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7272,7 +7306,7 @@ func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { return queryTreeReply(buf), nil } -// Read reply into structure from buffer for QueryTree +// queryTreeReply reads a byte slice into a QueryTreeReply value. func queryTreeReply(buf []byte) *QueryTreeReply { v := new(QueryTreeReply) b := 1 // skip reply determinant @@ -7307,6 +7341,7 @@ func queryTreeReply(buf []byte) *QueryTreeReply { } // Write request to wire for QueryTree +// queryTreeRequest writes a QueryTree request to a byte slice. func queryTreeRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -7326,34 +7361,36 @@ func queryTreeRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request InternAtom -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// InternAtomCookie is a cookie used only for InternAtom requests. type InternAtomCookie struct { *xgb.Cookie } +// InternAtom sends a checked request. +// If an error occurs, it will be returned with the reply by calling InternAtomCookie.Reply() func InternAtom(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(true, true) c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } +// InternAtomUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InternAtomUnchecked(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(false, true) c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } -// Request reply for InternAtom -// size: 12 +// InternAtomReply represents the data returned from a InternAtom request. type InternAtomReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Atom Atom } -// Waits and reads reply data from request InternAtom +// Reply blocks and returns the reply data for a InternAtom request. func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7365,7 +7402,7 @@ func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { return internAtomReply(buf), nil } -// Read reply into structure from buffer for InternAtom +// internAtomReply reads a byte slice into a InternAtomReply value. func internAtomReply(buf []byte) *InternAtomReply { v := new(InternAtomReply) b := 1 // skip reply determinant @@ -7385,6 +7422,7 @@ func internAtomReply(buf []byte) *InternAtomReply { } // Write request to wire for InternAtom +// internAtomRequest writes a InternAtom request to a byte slice. func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -7414,36 +7452,38 @@ func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name stri return buf } -// Request GetAtomName -// size: 8 +// GetAtomNameCookie is a cookie used only for GetAtomName requests. type GetAtomNameCookie struct { *xgb.Cookie } +// GetAtomName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetAtomNameCookie.Reply() func GetAtomName(c *xgb.Conn, Atom Atom) GetAtomNameCookie { cookie := c.NewCookie(true, true) c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } +// GetAtomNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAtomNameUnchecked(c *xgb.Conn, Atom Atom) GetAtomNameCookie { cookie := c.NewCookie(false, true) c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } -// Request reply for GetAtomName -// size: (32 + xgb.Pad((int(NameLen) * 1))) +// GetAtomNameReply represents the data returned from a GetAtomName request. type GetAtomNameReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NameLen uint16 // padding: 22 bytes Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Waits and reads reply data from request GetAtomName +// Reply blocks and returns the reply data for a GetAtomName request. func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7455,7 +7495,7 @@ func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { return getAtomNameReply(buf), nil } -// Read reply into structure from buffer for GetAtomName +// getAtomNameReply reads a byte slice into a GetAtomNameReply value. func getAtomNameReply(buf []byte) *GetAtomNameReply { v := new(GetAtomNameReply) b := 1 // skip reply determinant @@ -7484,6 +7524,7 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { } // Write request to wire for GetAtomName +// getAtomNameRequest writes a GetAtomName request to a byte slice. func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { size := 8 b := 0 @@ -7503,30 +7544,35 @@ func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { return buf } -// Request ChangeProperty -// size: xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) +// ChangePropertyCookie is a cookie used only for ChangeProperty requests. type ChangePropertyCookie struct { *xgb.Cookie } -// Write request to wire for ChangeProperty +// ChangeProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } +// ChangePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePropertyCookie.Check() func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangePropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeProperty +// changePropertyRequest writes a ChangeProperty request to a byte slice. func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 @@ -7564,30 +7610,35 @@ func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, return buf } -// Request DeleteProperty -// size: 12 +// DeletePropertyCookie is a cookie used only for DeleteProperty requests. type DeletePropertyCookie struct { *xgb.Cookie } -// Write request to wire for DeleteProperty +// DeleteProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{cookie} } +// DeletePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeletePropertyCookie.Check() func DeletePropertyChecked(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DeletePropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteProperty +// deletePropertyRequest writes a DeleteProperty request to a byte slice. func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { size := 12 b := 0 @@ -7610,29 +7661,31 @@ func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { return buf } -// Request GetProperty -// size: 24 +// GetPropertyCookie is a cookie used only for GetProperty requests. type GetPropertyCookie struct { *xgb.Cookie } +// GetProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCookie.Reply() func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } +// GetPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } -// Request reply for GetProperty -// size: (32 + xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1))) +// GetPropertyReply represents the data returned from a GetProperty request. type GetPropertyReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Format byte Type Atom BytesAfter uint32 @@ -7641,7 +7694,7 @@ type GetPropertyReply struct { Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) } -// Waits and reads reply data from request GetProperty +// Reply blocks and returns the reply data for a GetProperty request. func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7653,7 +7706,7 @@ func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { return getPropertyReply(buf), nil } -// Read reply into structure from buffer for GetProperty +// getPropertyReply reads a byte slice into a GetPropertyReply value. func getPropertyReply(buf []byte) *GetPropertyReply { v := new(GetPropertyReply) b := 1 // skip reply determinant @@ -7686,6 +7739,7 @@ func getPropertyReply(buf []byte) *GetPropertyReply { } // Write request to wire for GetProperty +// getPropertyRequest writes a GetProperty request to a byte slice. func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 @@ -7722,36 +7776,38 @@ func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, return buf } -// Request ListProperties -// size: 8 +// ListPropertiesCookie is a cookie used only for ListProperties requests. type ListPropertiesCookie struct { *xgb.Cookie } +// ListProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window Window) ListPropertiesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } +// ListPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window Window) ListPropertiesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } -// Request reply for ListProperties -// size: (32 + xgb.Pad((int(AtomsLen) * 4))) +// ListPropertiesReply represents the data returned from a ListProperties request. type ListPropertiesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes AtomsLen uint16 // padding: 22 bytes Atoms []Atom // size: xgb.Pad((int(AtomsLen) * 4)) } -// Waits and reads reply data from request ListProperties +// Reply blocks and returns the reply data for a ListProperties request. func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7763,7 +7819,7 @@ func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { return listPropertiesReply(buf), nil } -// Read reply into structure from buffer for ListProperties +// listPropertiesReply reads a byte slice into a ListPropertiesReply value. func listPropertiesReply(buf []byte) *ListPropertiesReply { v := new(ListPropertiesReply) b := 1 // skip reply determinant @@ -7792,6 +7848,7 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { } // Write request to wire for ListProperties +// listPropertiesRequest writes a ListProperties request to a byte slice. func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -7811,30 +7868,35 @@ func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request SetSelectionOwner -// size: 16 +// SetSelectionOwnerCookie is a cookie used only for SetSelectionOwner requests. type SetSelectionOwnerCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionOwner +// SetSelectionOwner sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } +// SetSelectionOwnerChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionOwnerCookie.Check() func SetSelectionOwnerChecked(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetSelectionOwnerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionOwner +// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice. func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { size := 16 b := 0 @@ -7860,34 +7922,36 @@ func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Ti return buf } -// Request GetSelectionOwner -// size: 8 +// GetSelectionOwnerCookie is a cookie used only for GetSelectionOwner requests. type GetSelectionOwnerCookie struct { *xgb.Cookie } +// GetSelectionOwner sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionOwnerCookie.Reply() func GetSelectionOwner(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } +// GetSelectionOwnerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionOwnerUnchecked(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } -// Request reply for GetSelectionOwner -// size: 12 +// GetSelectionOwnerReply represents the data returned from a GetSelectionOwner request. type GetSelectionOwnerReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Owner Window } -// Waits and reads reply data from request GetSelectionOwner +// Reply blocks and returns the reply data for a GetSelectionOwner request. func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7899,7 +7963,7 @@ func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { return getSelectionOwnerReply(buf), nil } -// Read reply into structure from buffer for GetSelectionOwner +// getSelectionOwnerReply reads a byte slice into a GetSelectionOwnerReply value. func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { v := new(GetSelectionOwnerReply) b := 1 // skip reply determinant @@ -7919,6 +7983,7 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { } // Write request to wire for GetSelectionOwner +// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice. func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { size := 8 b := 0 @@ -7938,30 +8003,35 @@ func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { return buf } -// Request ConvertSelection -// size: 24 +// ConvertSelectionCookie is a cookie used only for ConvertSelection requests. type ConvertSelectionCookie struct { *xgb.Cookie } -// Write request to wire for ConvertSelection +// ConvertSelection sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConvertSelection(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.NewCookie(false, false) c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } +// ConvertSelectionChecked sends a checked request. +// If an error occurs, it can be retrieved using ConvertSelectionCookie.Check() func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.NewCookie(true, false) c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ConvertSelectionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ConvertSelection +// convertSelectionRequest writes a ConvertSelection request to a byte slice. func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { size := 24 b := 0 @@ -7993,30 +8063,35 @@ func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Targ return buf } -// Request SendEvent -// size: 44 +// SendEventCookie is a cookie used only for SendEvent requests. type SendEventCookie struct { *xgb.Cookie } -// Write request to wire for SendEvent +// SendEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } +// SendEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendEventCookie.Check() func SendEventChecked(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SendEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SendEvent +// sendEventRequest writes a SendEvent request to a byte slice. func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { size := 44 b := 0 @@ -8047,33 +8122,35 @@ func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask return buf } -// Request GrabPointer -// size: 24 +// GrabPointerCookie is a cookie used only for GrabPointer requests. type GrabPointerCookie struct { *xgb.Cookie } +// GrabPointer sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabPointerCookie.Reply() func GrabPointer(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } +// GrabPointerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPointerUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } -// Request reply for GrabPointer -// size: 8 +// GrabPointerReply represents the data returned from a GrabPointer request. type GrabPointerReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request GrabPointer +// Reply blocks and returns the reply data for a GrabPointer request. func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8085,7 +8162,7 @@ func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { return grabPointerReply(buf), nil } -// Read reply into structure from buffer for GrabPointer +// grabPointerReply reads a byte slice into a GrabPointerReply value. func grabPointerReply(buf []byte) *GrabPointerReply { v := new(GrabPointerReply) b := 1 // skip reply determinant @@ -8103,6 +8180,7 @@ func grabPointerReply(buf []byte) *GrabPointerReply { } // Write request to wire for GrabPointer +// grabPointerRequest writes a GrabPointer request to a byte slice. func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { size := 24 b := 0 @@ -8145,30 +8223,35 @@ func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventM return buf } -// Request UngrabPointer -// size: 8 +// UngrabPointerCookie is a cookie used only for UngrabPointer requests. type UngrabPointerCookie struct { *xgb.Cookie } -// Write request to wire for UngrabPointer +// UngrabPointer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{cookie} } +// UngrabPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabPointerCookie.Check() func UngrabPointerChecked(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabPointerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabPointer +// ungrabPointerRequest writes a UngrabPointer request to a byte slice. func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -8188,30 +8271,35 @@ func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { return buf } -// Request GrabButton -// size: 24 +// GrabButtonCookie is a cookie used only for GrabButton requests. type GrabButtonCookie struct { *xgb.Cookie } -// Write request to wire for GrabButton +// GrabButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } +// GrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabButtonCookie.Check() func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabButton +// grabButtonRequest writes a GrabButton request to a byte slice. func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { size := 24 b := 0 @@ -8259,30 +8347,35 @@ func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMa return buf } -// Request UngrabButton -// size: 12 +// UngrabButtonCookie is a cookie used only for UngrabButton requests. type UngrabButtonCookie struct { *xgb.Cookie } -// Write request to wire for UngrabButton +// UngrabButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } +// UngrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabButtonCookie.Check() func UngrabButtonChecked(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabButton +// ungrabButtonRequest writes a UngrabButton request to a byte slice. func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -8308,30 +8401,35 @@ func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers return buf } -// Request ChangeActivePointerGrab -// size: 16 +// ChangeActivePointerGrabCookie is a cookie used only for ChangeActivePointerGrab requests. type ChangeActivePointerGrabCookie struct { *xgb.Cookie } -// Write request to wire for ChangeActivePointerGrab +// ChangeActivePointerGrab sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } +// ChangeActivePointerGrabChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeActivePointerGrabCookie.Check() func ChangeActivePointerGrabChecked(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeActivePointerGrabCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeActivePointerGrab +// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice. func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 @@ -8359,33 +8457,35 @@ func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, return buf } -// Request GrabKeyboard -// size: 16 +// GrabKeyboardCookie is a cookie used only for GrabKeyboard requests. type GrabKeyboardCookie struct { *xgb.Cookie } +// GrabKeyboard sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabKeyboardCookie.Reply() func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } +// GrabKeyboardUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } -// Request reply for GrabKeyboard -// size: 8 +// GrabKeyboardReply represents the data returned from a GrabKeyboard request. type GrabKeyboardReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request GrabKeyboard +// Reply blocks and returns the reply data for a GrabKeyboard request. func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8397,7 +8497,7 @@ func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { return grabKeyboardReply(buf), nil } -// Read reply into structure from buffer for GrabKeyboard +// grabKeyboardReply reads a byte slice into a GrabKeyboardReply value. func grabKeyboardReply(buf []byte) *GrabKeyboardReply { v := new(GrabKeyboardReply) b := 1 // skip reply determinant @@ -8415,6 +8515,7 @@ func grabKeyboardReply(buf []byte) *GrabKeyboardReply { } // Write request to wire for GrabKeyboard +// grabKeyboardRequest writes a GrabKeyboard request to a byte slice. func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 @@ -8450,30 +8551,35 @@ func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time return buf } -// Request UngrabKeyboard -// size: 8 +// UngrabKeyboardCookie is a cookie used only for UngrabKeyboard requests. type UngrabKeyboardCookie struct { *xgb.Cookie } -// Write request to wire for UngrabKeyboard +// UngrabKeyboard sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{cookie} } +// UngrabKeyboardChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyboardCookie.Check() func UngrabKeyboardChecked(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabKeyboardCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabKeyboard +// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice. func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -8493,30 +8599,35 @@ func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { return buf } -// Request GrabKey -// size: 16 +// GrabKeyCookie is a cookie used only for GrabKey requests. type GrabKeyCookie struct { *xgb.Cookie } -// Write request to wire for GrabKey +// GrabKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } +// GrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabKeyCookie.Check() func GrabKeyChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabKey +// grabKeyRequest writes a GrabKey request to a byte slice. func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 @@ -8555,30 +8666,35 @@ func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers return buf } -// Request UngrabKey -// size: 12 +// UngrabKeyCookie is a cookie used only for UngrabKey requests. type UngrabKeyCookie struct { *xgb.Cookie } -// Write request to wire for UngrabKey +// UngrabKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } +// UngrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyCookie.Check() func UngrabKeyChecked(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabKey +// ungrabKeyRequest writes a UngrabKey request to a byte slice. func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -8604,30 +8720,35 @@ func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uin return buf } -// Request AllowEvents -// size: 8 +// AllowEventsCookie is a cookie used only for AllowEvents requests. type AllowEventsCookie struct { *xgb.Cookie } -// Write request to wire for AllowEvents +// AllowEvents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.NewCookie(false, false) c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{cookie} } +// AllowEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowEventsCookie.Check() func AllowEventsChecked(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.NewCookie(true, false) c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook AllowEventsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AllowEvents +// allowEventsRequest writes a AllowEvents request to a byte slice. func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { size := 8 b := 0 @@ -8648,30 +8769,35 @@ func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { return buf } -// Request GrabServer -// size: 4 +// GrabServerCookie is a cookie used only for GrabServer requests. type GrabServerCookie struct { *xgb.Cookie } -// Write request to wire for GrabServer +// GrabServer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabServer(c *xgb.Conn) GrabServerCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{cookie} } +// GrabServerChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabServerCookie.Check() func GrabServerChecked(c *xgb.Conn) GrabServerCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabServerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabServer +// grabServerRequest writes a GrabServer request to a byte slice. func grabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -8687,30 +8813,35 @@ func grabServerRequest(c *xgb.Conn) []byte { return buf } -// Request UngrabServer -// size: 4 +// UngrabServerCookie is a cookie used only for UngrabServer requests. type UngrabServerCookie struct { *xgb.Cookie } -// Write request to wire for UngrabServer +// UngrabServer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabServer(c *xgb.Conn) UngrabServerCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{cookie} } +// UngrabServerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabServerCookie.Check() func UngrabServerChecked(c *xgb.Conn) UngrabServerCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabServerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabServer +// ungrabServerRequest writes a UngrabServer request to a byte slice. func ungrabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -8726,29 +8857,31 @@ func ungrabServerRequest(c *xgb.Conn) []byte { return buf } -// Request QueryPointer -// size: 8 +// QueryPointerCookie is a cookie used only for QueryPointer requests. type QueryPointerCookie struct { *xgb.Cookie } +// QueryPointer sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPointerCookie.Reply() func QueryPointer(c *xgb.Conn, Window Window) QueryPointerCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } +// QueryPointerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } -// Request reply for QueryPointer -// size: 28 +// QueryPointerReply represents the data returned from a QueryPointer request. type QueryPointerReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply SameScreen bool Root Window Child Window @@ -8760,7 +8893,7 @@ type QueryPointerReply struct { // padding: 2 bytes } -// Waits and reads reply data from request QueryPointer +// Reply blocks and returns the reply data for a QueryPointer request. func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8772,7 +8905,7 @@ func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { return queryPointerReply(buf), nil } -// Read reply into structure from buffer for QueryPointer +// queryPointerReply reads a byte slice into a QueryPointerReply value. func queryPointerReply(buf []byte) *QueryPointerReply { v := new(QueryPointerReply) b := 1 // skip reply determinant @@ -8817,6 +8950,7 @@ func queryPointerReply(buf []byte) *QueryPointerReply { } // Write request to wire for QueryPointer +// queryPointerRequest writes a QueryPointer request to a byte slice. func queryPointerRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -8836,36 +8970,38 @@ func queryPointerRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request GetMotionEvents -// size: 16 +// GetMotionEventsCookie is a cookie used only for GetMotionEvents requests. type GetMotionEventsCookie struct { *xgb.Cookie } +// GetMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMotionEventsCookie.Reply() func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } +// GetMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } -// Request reply for GetMotionEvents -// size: (32 + xgb.Pad((int(EventsLen) * 8))) +// GetMotionEventsReply represents the data returned from a GetMotionEvents request. type GetMotionEventsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes EventsLen uint32 // padding: 20 bytes Events []Timecoord // size: xgb.Pad((int(EventsLen) * 8)) } -// Waits and reads reply data from request GetMotionEvents +// Reply blocks and returns the reply data for a GetMotionEvents request. func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8877,7 +9013,7 @@ func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { return getMotionEventsReply(buf), nil } -// Read reply into structure from buffer for GetMotionEvents +// getMotionEventsReply reads a byte slice into a GetMotionEventsReply value. func getMotionEventsReply(buf []byte) *GetMotionEventsReply { v := new(GetMotionEventsReply) b := 1 // skip reply determinant @@ -8902,6 +9038,7 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { } // Write request to wire for GetMotionEvents +// getMotionEventsRequest writes a GetMotionEvents request to a byte slice. func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 @@ -8927,36 +9064,38 @@ func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Ti return buf } -// Request TranslateCoordinates -// size: 16 +// TranslateCoordinatesCookie is a cookie used only for TranslateCoordinates requests. type TranslateCoordinatesCookie struct { *xgb.Cookie } +// TranslateCoordinates sends a checked request. +// If an error occurs, it will be returned with the reply by calling TranslateCoordinatesCookie.Reply() func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(true, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } +// TranslateCoordinatesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(false, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } -// Request reply for TranslateCoordinates -// size: 16 +// TranslateCoordinatesReply represents the data returned from a TranslateCoordinates request. type TranslateCoordinatesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply SameScreen bool Child Window DstX int16 DstY int16 } -// Waits and reads reply data from request TranslateCoordinates +// Reply blocks and returns the reply data for a TranslateCoordinates request. func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8968,7 +9107,7 @@ func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, erro return translateCoordinatesReply(buf), nil } -// Read reply into structure from buffer for TranslateCoordinates +// translateCoordinatesReply reads a byte slice into a TranslateCoordinatesReply value. func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { v := new(TranslateCoordinatesReply) b := 1 // skip reply determinant @@ -8999,6 +9138,7 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { } // Write request to wire for TranslateCoordinates +// translateCoordinatesRequest writes a TranslateCoordinates request to a byte slice. func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { size := 16 b := 0 @@ -9027,30 +9167,35 @@ func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window return buf } -// Request WarpPointer -// size: 24 +// WarpPointerCookie is a cookie used only for WarpPointer requests. type WarpPointerCookie struct { *xgb.Cookie } -// Write request to wire for WarpPointer +// WarpPointer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WarpPointer(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(false, false) c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } +// WarpPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using WarpPointerCookie.Check() func WarpPointerChecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(true, false) c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook WarpPointerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for WarpPointer +// warpPointerRequest writes a WarpPointer request to a byte slice. func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 @@ -9091,30 +9236,35 @@ func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX in return buf } -// Request SetInputFocus -// size: 12 +// SetInputFocusCookie is a cookie used only for SetInputFocus requests. type SetInputFocusCookie struct { *xgb.Cookie } -// Write request to wire for SetInputFocus +// SetInputFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.NewCookie(false, false) c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } +// SetInputFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetInputFocusCookie.Check() func SetInputFocusChecked(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.NewCookie(true, false) c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetInputFocusCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetInputFocus +// setInputFocusRequest writes a SetInputFocus request to a byte slice. func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { size := 12 b := 0 @@ -9138,34 +9288,36 @@ func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timesta return buf } -// Request GetInputFocus -// size: 4 +// GetInputFocusCookie is a cookie used only for GetInputFocus requests. type GetInputFocusCookie struct { *xgb.Cookie } +// GetInputFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetInputFocusCookie.Reply() func GetInputFocus(c *xgb.Conn) GetInputFocusCookie { cookie := c.NewCookie(true, true) c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } +// GetInputFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetInputFocusUnchecked(c *xgb.Conn) GetInputFocusCookie { cookie := c.NewCookie(false, true) c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } -// Request reply for GetInputFocus -// size: 12 +// GetInputFocusReply represents the data returned from a GetInputFocus request. type GetInputFocusReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply RevertTo byte Focus Window } -// Waits and reads reply data from request GetInputFocus +// Reply blocks and returns the reply data for a GetInputFocus request. func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9177,7 +9329,7 @@ func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { return getInputFocusReply(buf), nil } -// Read reply into structure from buffer for GetInputFocus +// getInputFocusReply reads a byte slice into a GetInputFocusReply value. func getInputFocusReply(buf []byte) *GetInputFocusReply { v := new(GetInputFocusReply) b := 1 // skip reply determinant @@ -9198,6 +9350,7 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { } // Write request to wire for GetInputFocus +// getInputFocusRequest writes a GetInputFocus request to a byte slice. func getInputFocusRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9213,34 +9366,36 @@ func getInputFocusRequest(c *xgb.Conn) []byte { return buf } -// Request QueryKeymap -// size: 4 +// QueryKeymapCookie is a cookie used only for QueryKeymap requests. type QueryKeymapCookie struct { *xgb.Cookie } +// QueryKeymap sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryKeymapCookie.Reply() func QueryKeymap(c *xgb.Conn) QueryKeymapCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } +// QueryKeymapUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryKeymapUnchecked(c *xgb.Conn) QueryKeymapCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } -// Request reply for QueryKeymap -// size: 40 +// QueryKeymapReply represents the data returned from a QueryKeymap request. type QueryKeymapReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Keys []byte // size: 32 } -// Waits and reads reply data from request QueryKeymap +// Reply blocks and returns the reply data for a QueryKeymap request. func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9252,7 +9407,7 @@ func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { return queryKeymapReply(buf), nil } -// Read reply into structure from buffer for QueryKeymap +// queryKeymapReply reads a byte slice into a QueryKeymapReply value. func queryKeymapReply(buf []byte) *QueryKeymapReply { v := new(QueryKeymapReply) b := 1 // skip reply determinant @@ -9273,6 +9428,7 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { } // Write request to wire for QueryKeymap +// queryKeymapRequest writes a QueryKeymap request to a byte slice. func queryKeymapRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9288,30 +9444,35 @@ func queryKeymapRequest(c *xgb.Conn) []byte { return buf } -// Request OpenFont -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// OpenFontCookie is a cookie used only for OpenFont requests. type OpenFontCookie struct { *xgb.Cookie } -// Write request to wire for OpenFont +// OpenFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.NewCookie(false, false) c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } +// OpenFontChecked sends a checked request. +// If an error occurs, it can be retrieved using OpenFontCookie.Check() func OpenFontChecked(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.NewCookie(true, false) c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook OpenFontCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for OpenFont +// openFontRequest writes a OpenFont request to a byte slice. func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -9339,30 +9500,35 @@ func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte return buf } -// Request CloseFont -// size: 8 +// CloseFontCookie is a cookie used only for CloseFont requests. type CloseFontCookie struct { *xgb.Cookie } -// Write request to wire for CloseFont +// CloseFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { cookie := c.NewCookie(false, false) c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{cookie} } +// CloseFontChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseFontCookie.Check() func CloseFontChecked(c *xgb.Conn, Font Font) CloseFontCookie { cookie := c.NewCookie(true, false) c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CloseFontCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CloseFont +// closeFontRequest writes a CloseFont request to a byte slice. func closeFontRequest(c *xgb.Conn, Font Font) []byte { size := 8 b := 0 @@ -9382,29 +9548,31 @@ func closeFontRequest(c *xgb.Conn, Font Font) []byte { return buf } -// Request QueryFont -// size: 8 +// QueryFontCookie is a cookie used only for QueryFont requests. type QueryFontCookie struct { *xgb.Cookie } +// QueryFont sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFontCookie.Reply() func QueryFont(c *xgb.Conn, Font Fontable) QueryFontCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } +// QueryFontUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFontUnchecked(c *xgb.Conn, Font Fontable) QueryFontCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } -// Request reply for QueryFont -// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(CharInfosLen) * 12))) +// QueryFontReply represents the data returned from a QueryFont request. type QueryFontReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes MinBounds Charinfo // padding: 4 bytes @@ -9425,7 +9593,7 @@ type QueryFontReply struct { CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) } -// Waits and reads reply data from request QueryFont +// Reply blocks and returns the reply data for a QueryFont request. func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9437,7 +9605,7 @@ func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { return queryFontReply(buf), nil } -// Read reply into structure from buffer for QueryFont +// queryFontReply reads a byte slice into a QueryFontReply value. func queryFontReply(buf []byte) *QueryFontReply { v := new(QueryFontReply) b := 1 // skip reply determinant @@ -9507,6 +9675,7 @@ func queryFontReply(buf []byte) *QueryFontReply { } // Write request to wire for QueryFont +// queryFontRequest writes a QueryFont request to a byte slice. func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { size := 8 b := 0 @@ -9526,29 +9695,31 @@ func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { return buf } -// Request QueryTextExtents -// size: xgb.Pad((8 + xgb.Pad((len(String) * 2)))) +// QueryTextExtentsCookie is a cookie used only for QueryTextExtents requests. type QueryTextExtentsCookie struct { *xgb.Cookie } +// QueryTextExtents sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTextExtentsCookie.Reply() func QueryTextExtents(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } +// QueryTextExtentsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryTextExtentsUnchecked(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } -// Request reply for QueryTextExtents -// size: 28 +// QueryTextExtentsReply represents the data returned from a QueryTextExtents request. type QueryTextExtentsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply DrawDirection byte FontAscent int16 FontDescent int16 @@ -9559,7 +9730,7 @@ type QueryTextExtentsReply struct { OverallRight int32 } -// Waits and reads reply data from request QueryTextExtents +// Reply blocks and returns the reply data for a QueryTextExtents request. func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9571,7 +9742,7 @@ func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { return queryTextExtentsReply(buf), nil } -// Read reply into structure from buffer for QueryTextExtents +// queryTextExtentsReply reads a byte slice into a QueryTextExtentsReply value. func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { v := new(QueryTextExtentsReply) b := 1 // skip reply determinant @@ -9610,6 +9781,7 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { } // Write request to wire for QueryTextExtents +// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice. func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) b := 0 @@ -9634,36 +9806,38 @@ func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, String return buf } -// Request ListFonts -// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) +// ListFontsCookie is a cookie used only for ListFonts requests. type ListFontsCookie struct { *xgb.Cookie } +// ListFonts sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListFontsCookie.Reply() func ListFonts(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } +// ListFontsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListFontsUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } -// Request reply for ListFonts -// size: (32 + StrListSize(Names)) +// ListFontsReply represents the data returned from a ListFonts request. type ListFontsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NamesLen uint16 // padding: 22 bytes Names []Str // size: StrListSize(Names) } -// Waits and reads reply data from request ListFonts +// Reply blocks and returns the reply data for a ListFonts request. func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9675,7 +9849,7 @@ func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { return listFontsReply(buf), nil } -// Read reply into structure from buffer for ListFonts +// listFontsReply reads a byte slice into a ListFontsReply value. func listFontsReply(buf []byte) *ListFontsReply { v := new(ListFontsReply) b := 1 // skip reply determinant @@ -9700,6 +9874,7 @@ func listFontsReply(buf []byte) *ListFontsReply { } // Write request to wire for ListFonts +// listFontsRequest writes a ListFonts request to a byte slice. func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 @@ -9725,29 +9900,31 @@ func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern s return buf } -// Request ListFontsWithInfo -// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) +// ListFontsWithInfoCookie is a cookie used only for ListFontsWithInfo requests. type ListFontsWithInfoCookie struct { *xgb.Cookie } +// ListFontsWithInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListFontsWithInfoCookie.Reply() func ListFontsWithInfo(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } +// ListFontsWithInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListFontsWithInfoUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } -// Request reply for ListFontsWithInfo -// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(NameLen) * 1))) +// ListFontsWithInfoReply represents the data returned from a ListFontsWithInfo request. type ListFontsWithInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply NameLen byte MinBounds Charinfo // padding: 4 bytes @@ -9768,7 +9945,7 @@ type ListFontsWithInfoReply struct { Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Waits and reads reply data from request ListFontsWithInfo +// Reply blocks and returns the reply data for a ListFontsWithInfo request. func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9780,7 +9957,7 @@ func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { return listFontsWithInfoReply(buf), nil } -// Read reply into structure from buffer for ListFontsWithInfo +// listFontsWithInfoReply reads a byte slice into a ListFontsWithInfoReply value. func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { v := new(ListFontsWithInfoReply) b := 1 // skip reply determinant @@ -9855,6 +10032,7 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { } // Write request to wire for ListFontsWithInfo +// listFontsWithInfoRequest writes a ListFontsWithInfo request to a byte slice. func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 @@ -9880,30 +10058,35 @@ func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, P return buf } -// Request SetFontPath -// size: xgb.Pad((8 + StrListSize(Font))) +// SetFontPathCookie is a cookie used only for SetFontPath requests. type SetFontPathCookie struct { *xgb.Cookie } -// Write request to wire for SetFontPath +// SetFontPath sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.NewCookie(false, false) c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{cookie} } +// SetFontPathChecked sends a checked request. +// If an error occurs, it can be retrieved using SetFontPathCookie.Check() func SetFontPathChecked(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.NewCookie(true, false) c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetFontPathCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetFontPath +// setFontPathRequest writes a SetFontPath request to a byte slice. func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { size := xgb.Pad((8 + StrListSize(Font))) b := 0 @@ -9927,36 +10110,38 @@ func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { return buf } -// Request GetFontPath -// size: 4 +// GetFontPathCookie is a cookie used only for GetFontPath requests. type GetFontPathCookie struct { *xgb.Cookie } +// GetFontPath sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFontPathCookie.Reply() func GetFontPath(c *xgb.Conn) GetFontPathCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } +// GetFontPathUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFontPathUnchecked(c *xgb.Conn) GetFontPathCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } -// Request reply for GetFontPath -// size: (32 + StrListSize(Path)) +// GetFontPathReply represents the data returned from a GetFontPath request. type GetFontPathReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PathLen uint16 // padding: 22 bytes Path []Str // size: StrListSize(Path) } -// Waits and reads reply data from request GetFontPath +// Reply blocks and returns the reply data for a GetFontPath request. func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9968,7 +10153,7 @@ func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { return getFontPathReply(buf), nil } -// Read reply into structure from buffer for GetFontPath +// getFontPathReply reads a byte slice into a GetFontPathReply value. func getFontPathReply(buf []byte) *GetFontPathReply { v := new(GetFontPathReply) b := 1 // skip reply determinant @@ -9993,6 +10178,7 @@ func getFontPathReply(buf []byte) *GetFontPathReply { } // Write request to wire for GetFontPath +// getFontPathRequest writes a GetFontPath request to a byte slice. func getFontPathRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -10008,30 +10194,35 @@ func getFontPathRequest(c *xgb.Conn) []byte { return buf } -// Request CreatePixmap -// size: 16 +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. type CreatePixmapCookie struct { *xgb.Cookie } -// Write request to wire for CreatePixmap +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { size := 16 b := 0 @@ -10061,30 +10252,35 @@ func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, return buf } -// Request FreePixmap -// size: 8 +// FreePixmapCookie is a cookie used only for FreePixmap requests. type FreePixmapCookie struct { *xgb.Cookie } -// Write request to wire for FreePixmap +// FreePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{cookie} } +// FreePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreePixmapCookie.Check() func FreePixmapChecked(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreePixmap +// freePixmapRequest writes a FreePixmap request to a byte slice. func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { size := 8 b := 0 @@ -10104,30 +10300,35 @@ func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { return buf } -// Request CreateGC -// size: xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreateGCCookie is a cookie used only for CreateGC requests. type CreateGCCookie struct { *xgb.Cookie } -// Write request to wire for CreateGC +// CreateGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } +// CreateGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGCCookie.Check() func CreateGCChecked(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGC +// createGCRequest writes a CreateGC request to a byte slice. func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -10158,30 +10359,35 @@ func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uin return buf } -// Request ChangeGC -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeGCCookie is a cookie used only for ChangeGC requests. type ChangeGCCookie struct { *xgb.Cookie } -// Write request to wire for ChangeGC +// ChangeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } +// ChangeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeGCCookie.Check() func ChangeGCChecked(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeGC +// changeGCRequest writes a ChangeGC request to a byte slice. func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -10209,30 +10415,35 @@ func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uin return buf } -// Request CopyGC -// size: 16 +// CopyGCCookie is a cookie used only for CopyGC requests. type CopyGCCookie struct { *xgb.Cookie } -// Write request to wire for CopyGC +// CopyGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyGC(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } +// CopyGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyGCCookie.Check() func CopyGCChecked(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyGC +// copyGCRequest writes a CopyGC request to a byte slice. func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { size := 16 b := 0 @@ -10258,30 +10469,35 @@ func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32 return buf } -// Request SetDashes -// size: xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) +// SetDashesCookie is a cookie used only for SetDashes requests. type SetDashesCookie struct { *xgb.Cookie } -// Write request to wire for SetDashes +// SetDashes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } +// SetDashesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDashesCookie.Check() func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetDashesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDashes +// setDashesRequest writes a SetDashes request to a byte slice. func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) b := 0 @@ -10310,30 +10526,35 @@ func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uin return buf } -// Request SetClipRectangles -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// SetClipRectanglesCookie is a cookie used only for SetClipRectangles requests. type SetClipRectanglesCookie struct { *xgb.Cookie } -// Write request to wire for SetClipRectangles +// SetClipRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } +// SetClipRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClipRectanglesCookie.Check() func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetClipRectanglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetClipRectangles +// setClipRectanglesRequest writes a SetClipRectangles request to a byte slice. func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10362,30 +10583,35 @@ func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrig return buf } -// Request FreeGC -// size: 8 +// FreeGCCookie is a cookie used only for FreeGC requests. type FreeGCCookie struct { *xgb.Cookie } -// Write request to wire for FreeGC +// FreeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{cookie} } +// FreeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGCCookie.Check() func FreeGCChecked(c *xgb.Conn, Gc Gcontext) FreeGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeGC +// freeGCRequest writes a FreeGC request to a byte slice. func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { size := 8 b := 0 @@ -10405,30 +10631,35 @@ func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { return buf } -// Request ClearArea -// size: 16 +// ClearAreaCookie is a cookie used only for ClearArea requests. type ClearAreaCookie struct { *xgb.Cookie } -// Write request to wire for ClearArea +// ClearArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.NewCookie(false, false) c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } +// ClearAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using ClearAreaCookie.Check() func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.NewCookie(true, false) c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ClearAreaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ClearArea +// clearAreaRequest writes a ClearArea request to a byte slice. func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 @@ -10465,30 +10696,35 @@ func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int return buf } -// Request CopyArea -// size: 28 +// CopyAreaCookie is a cookie used only for CopyArea requests. type CopyAreaCookie struct { *xgb.Cookie } -// Write request to wire for CopyArea +// CopyArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyArea(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } +// CopyAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyAreaCookie.Check() func CopyAreaChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyAreaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyArea +// copyAreaRequest writes a CopyArea request to a byte slice. func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 @@ -10532,30 +10768,35 @@ func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc return buf } -// Request CopyPlane -// size: 32 +// CopyPlaneCookie is a cookie used only for CopyPlane requests. type CopyPlaneCookie struct { *xgb.Cookie } -// Write request to wire for CopyPlane +// CopyPlane sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyPlane(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } +// CopyPlaneChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyPlaneCookie.Check() func CopyPlaneChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyPlaneCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyPlane +// copyPlaneRequest writes a CopyPlane request to a byte slice. func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 @@ -10602,30 +10843,35 @@ func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, G return buf } -// Request PolyPoint -// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) +// PolyPointCookie is a cookie used only for PolyPoint requests. type PolyPointCookie struct { *xgb.Cookie } -// Write request to wire for PolyPoint +// PolyPoint sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } +// PolyPointChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyPointCookie.Check() func PolyPointChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyPointCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyPoint +// polyPointRequest writes a PolyPoint request to a byte slice. func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10651,30 +10897,35 @@ func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gc return buf } -// Request PolyLine -// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) +// PolyLineCookie is a cookie used only for PolyLine requests. type PolyLineCookie struct { *xgb.Cookie } -// Write request to wire for PolyLine +// PolyLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } +// PolyLineChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyLineCookie.Check() func PolyLineChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyLineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyLine +// polyLineRequest writes a PolyLine request to a byte slice. func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10700,30 +10951,35 @@ func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gco return buf } -// Request PolySegment -// size: xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) +// PolySegmentCookie is a cookie used only for PolySegment requests. type PolySegmentCookie struct { *xgb.Cookie } -// Write request to wire for PolySegment +// PolySegment sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.NewCookie(false, false) c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } +// PolySegmentChecked sends a checked request. +// If an error occurs, it can be retrieved using PolySegmentCookie.Check() func PolySegmentChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.NewCookie(true, false) c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolySegmentCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolySegment +// polySegmentRequest writes a PolySegment request to a byte slice. func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) b := 0 @@ -10748,30 +11004,35 @@ func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments [] return buf } -// Request PolyRectangle -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// PolyRectangleCookie is a cookie used only for PolyRectangle requests. type PolyRectangleCookie struct { *xgb.Cookie } -// Write request to wire for PolyRectangle +// PolyRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } +// PolyRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyRectangleCookie.Check() func PolyRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyRectangleCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyRectangle +// polyRectangleRequest writes a PolyRectangle request to a byte slice. func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10796,30 +11057,35 @@ func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangle return buf } -// Request PolyArc -// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) +// PolyArcCookie is a cookie used only for PolyArc requests. type PolyArcCookie struct { *xgb.Cookie } -// Write request to wire for PolyArc +// PolyArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } +// PolyArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyArcCookie.Check() func PolyArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyArcCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyArc +// polyArcRequest writes a PolyArc request to a byte slice. func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -10844,30 +11110,35 @@ func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []b return buf } -// Request FillPoly -// size: xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) +// FillPolyCookie is a cookie used only for FillPoly requests. type FillPolyCookie struct { *xgb.Cookie } -// Write request to wire for FillPoly +// FillPoly sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.NewCookie(false, false) c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } +// FillPolyChecked sends a checked request. +// If an error occurs, it can be retrieved using FillPolyCookie.Check() func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.NewCookie(true, false) c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FillPolyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FillPoly +// fillPolyRequest writes a FillPoly request to a byte slice. func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10900,30 +11171,35 @@ func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, Co return buf } -// Request PolyFillRectangle -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// PolyFillRectangleCookie is a cookie used only for PolyFillRectangle requests. type PolyFillRectangleCookie struct { *xgb.Cookie } -// Write request to wire for PolyFillRectangle +// PolyFillRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } +// PolyFillRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillRectangleCookie.Check() func PolyFillRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyFillRectangleCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyFillRectangle +// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice. func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10948,30 +11224,35 @@ func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Recta return buf } -// Request PolyFillArc -// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) +// PolyFillArcCookie is a cookie used only for PolyFillArc requests. type PolyFillArcCookie struct { *xgb.Cookie } -// Write request to wire for PolyFillArc +// PolyFillArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } +// PolyFillArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillArcCookie.Check() func PolyFillArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyFillArcCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyFillArc +// polyFillArcRequest writes a PolyFillArc request to a byte slice. func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -10996,30 +11277,35 @@ func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) return buf } -// Request PutImage -// size: xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) +// PutImageCookie is a cookie used only for PutImage requests. type PutImageCookie struct { *xgb.Cookie } -// Write request to wire for PutImage +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -11066,36 +11352,38 @@ func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, W return buf } -// Request GetImage -// size: 20 +// GetImageCookie is a cookie used only for GetImage requests. type GetImageCookie struct { *xgb.Cookie } +// GetImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.NewCookie(true, true) c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } +// GetImageUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetImageUnchecked(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.NewCookie(false, true) c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } -// Request reply for GetImage -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetImageReply represents the data returned from a GetImage request. type GetImageReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Depth byte Visual Visualid // padding: 20 bytes Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetImage +// Reply blocks and returns the reply data for a GetImage request. func (cook GetImageCookie) Reply() (*GetImageReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11107,7 +11395,7 @@ func (cook GetImageCookie) Reply() (*GetImageReply, error) { return getImageReply(buf), nil } -// Read reply into structure from buffer for GetImage +// getImageReply reads a byte slice into a GetImageReply value. func getImageReply(buf []byte) *GetImageReply { v := new(GetImageReply) b := 1 // skip reply determinant @@ -11134,6 +11422,7 @@ func getImageReply(buf []byte) *GetImageReply { } // Write request to wire for GetImage +// getImageRequest writes a GetImage request to a byte slice. func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 @@ -11169,30 +11458,35 @@ func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int return buf } -// Request PolyText8 -// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) +// PolyText8Cookie is a cookie used only for PolyText8 requests. type PolyText8Cookie struct { *xgb.Cookie } -// Write request to wire for PolyText8 +// PolyText8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.NewCookie(false, false) c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } +// PolyText8Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText8Cookie.Check() func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyText8Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyText8 +// polyText8Request writes a PolyText8 request to a byte slice. func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 @@ -11224,30 +11518,35 @@ func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y in return buf } -// Request PolyText16 -// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) +// PolyText16Cookie is a cookie used only for PolyText16 requests. type PolyText16Cookie struct { *xgb.Cookie } -// Write request to wire for PolyText16 +// PolyText16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.NewCookie(false, false) c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } +// PolyText16Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText16Cookie.Check() func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PolyText16Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyText16 +// polyText16Request writes a PolyText16 request to a byte slice. func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 @@ -11279,30 +11578,35 @@ func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y i return buf } -// Request ImageText8 -// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) +// ImageText8Cookie is a cookie used only for ImageText8 requests. type ImageText8Cookie struct { *xgb.Cookie } -// Write request to wire for ImageText8 +// ImageText8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.NewCookie(false, false) c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } +// ImageText8Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText8Cookie.Check() func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ImageText8Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ImageText8 +// imageText8Request writes a ImageText8 request to a byte slice. func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) b := 0 @@ -11335,30 +11639,35 @@ func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gconte return buf } -// Request ImageText16 -// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) +// ImageText16Cookie is a cookie used only for ImageText16 requests. type ImageText16Cookie struct { *xgb.Cookie } -// Write request to wire for ImageText16 +// ImageText16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(false, false) c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } +// ImageText16Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText16Cookie.Check() func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ImageText16Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ImageText16 +// imageText16Request writes a ImageText16 request to a byte slice. func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) b := 0 @@ -11390,30 +11699,35 @@ func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcont return buf } -// Request CreateColormap -// size: 16 +// CreateColormapCookie is a cookie used only for CreateColormap requests. type CreateColormapCookie struct { *xgb.Cookie } -// Write request to wire for CreateColormap +// CreateColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } +// CreateColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateColormapCookie.Check() func CreateColormapChecked(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateColormap +// createColormapRequest writes a CreateColormap request to a byte slice. func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { size := 16 b := 0 @@ -11440,30 +11754,35 @@ func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, return buf } -// Request FreeColormap -// size: 8 +// FreeColormapCookie is a cookie used only for FreeColormap requests. type FreeColormapCookie struct { *xgb.Cookie } -// Write request to wire for FreeColormap +// FreeColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{cookie} } +// FreeColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColormapCookie.Check() func FreeColormapChecked(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeColormap +// freeColormapRequest writes a FreeColormap request to a byte slice. func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11483,30 +11802,35 @@ func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request CopyColormapAndFree -// size: 12 +// CopyColormapAndFreeCookie is a cookie used only for CopyColormapAndFree requests. type CopyColormapAndFreeCookie struct { *xgb.Cookie } -// Write request to wire for CopyColormapAndFree +// CopyColormapAndFree sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyColormapAndFree(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } +// CopyColormapAndFreeChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyColormapAndFreeCookie.Check() func CopyColormapAndFreeChecked(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CopyColormapAndFreeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyColormapAndFree +// copyColormapAndFreeRequest writes a CopyColormapAndFree request to a byte slice. func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []byte { size := 12 b := 0 @@ -11529,30 +11853,35 @@ func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []b return buf } -// Request InstallColormap -// size: 8 +// InstallColormapCookie is a cookie used only for InstallColormap requests. type InstallColormapCookie struct { *xgb.Cookie } -// Write request to wire for InstallColormap +// InstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{cookie} } +// InstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using InstallColormapCookie.Check() func InstallColormapChecked(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook InstallColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for InstallColormap +// installColormapRequest writes a InstallColormap request to a byte slice. func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11572,30 +11901,35 @@ func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request UninstallColormap -// size: 8 +// UninstallColormapCookie is a cookie used only for UninstallColormap requests. type UninstallColormapCookie struct { *xgb.Cookie } -// Write request to wire for UninstallColormap +// UninstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{cookie} } +// UninstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using UninstallColormapCookie.Check() func UninstallColormapChecked(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UninstallColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UninstallColormap +// uninstallColormapRequest writes a UninstallColormap request to a byte slice. func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11615,36 +11949,38 @@ func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request ListInstalledColormaps -// size: 8 +// ListInstalledColormapsCookie is a cookie used only for ListInstalledColormaps requests. type ListInstalledColormapsCookie struct { *xgb.Cookie } +// ListInstalledColormaps sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListInstalledColormapsCookie.Reply() func ListInstalledColormaps(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } +// ListInstalledColormapsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListInstalledColormapsUnchecked(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } -// Request reply for ListInstalledColormaps -// size: (32 + xgb.Pad((int(CmapsLen) * 4))) +// ListInstalledColormapsReply represents the data returned from a ListInstalledColormaps request. type ListInstalledColormapsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes CmapsLen uint16 // padding: 22 bytes Cmaps []Colormap // size: xgb.Pad((int(CmapsLen) * 4)) } -// Waits and reads reply data from request ListInstalledColormaps +// Reply blocks and returns the reply data for a ListInstalledColormaps request. func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11656,7 +11992,7 @@ func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, return listInstalledColormapsReply(buf), nil } -// Read reply into structure from buffer for ListInstalledColormaps +// listInstalledColormapsReply reads a byte slice into a ListInstalledColormapsReply value. func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { v := new(ListInstalledColormapsReply) b := 1 // skip reply determinant @@ -11685,6 +12021,7 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { } // Write request to wire for ListInstalledColormaps +// listInstalledColormapsRequest writes a ListInstalledColormaps request to a byte slice. func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11704,29 +12041,31 @@ func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request AllocColor -// size: 16 +// AllocColorCookie is a cookie used only for AllocColor requests. type AllocColorCookie struct { *xgb.Cookie } +// AllocColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCookie.Reply() func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } +// AllocColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } -// Request reply for AllocColor -// size: 20 +// AllocColorReply represents the data returned from a AllocColor request. type AllocColorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Red uint16 Green uint16 @@ -11735,7 +12074,7 @@ type AllocColorReply struct { Pixel uint32 } -// Waits and reads reply data from request AllocColor +// Reply blocks and returns the reply data for a AllocColor request. func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11747,7 +12086,7 @@ func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { return allocColorReply(buf), nil } -// Read reply into structure from buffer for AllocColor +// allocColorReply reads a byte slice into a AllocColorReply value. func allocColorReply(buf []byte) *AllocColorReply { v := new(AllocColorReply) b := 1 // skip reply determinant @@ -11778,6 +12117,7 @@ func allocColorReply(buf []byte) *AllocColorReply { } // Write request to wire for AllocColor +// allocColorRequest writes a AllocColor request to a byte slice. func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 @@ -11808,29 +12148,31 @@ func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blu return buf } -// Request AllocNamedColor -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// AllocNamedColorCookie is a cookie used only for AllocNamedColor requests. type AllocNamedColorCookie struct { *xgb.Cookie } +// AllocNamedColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocNamedColorCookie.Reply() func AllocNamedColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } +// AllocNamedColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocNamedColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } -// Request reply for AllocNamedColor -// size: 24 +// AllocNamedColorReply represents the data returned from a AllocNamedColor request. type AllocNamedColorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Pixel uint32 ExactRed uint16 @@ -11841,7 +12183,7 @@ type AllocNamedColorReply struct { VisualBlue uint16 } -// Waits and reads reply data from request AllocNamedColor +// Reply blocks and returns the reply data for a AllocNamedColor request. func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11853,7 +12195,7 @@ func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { return allocNamedColorReply(buf), nil } -// Read reply into structure from buffer for AllocNamedColor +// allocNamedColorReply reads a byte slice into a AllocNamedColorReply value. func allocNamedColorReply(buf []byte) *AllocNamedColorReply { v := new(AllocNamedColorReply) b := 1 // skip reply determinant @@ -11891,6 +12233,7 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { } // Write request to wire for AllocNamedColor +// allocNamedColorRequest writes a AllocNamedColor request to a byte slice. func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -11918,29 +12261,31 @@ func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name str return buf } -// Request AllocColorCells -// size: 12 +// AllocColorCellsCookie is a cookie used only for AllocColorCells requests. type AllocColorCellsCookie struct { *xgb.Cookie } +// AllocColorCells sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCellsCookie.Reply() func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } +// AllocColorCellsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } -// Request reply for AllocColorCells -// size: ((32 + xgb.Pad((int(PixelsLen) * 4))) + xgb.Pad((int(MasksLen) * 4))) +// AllocColorCellsReply represents the data returned from a AllocColorCells request. type AllocColorCellsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PixelsLen uint16 MasksLen uint16 @@ -11949,7 +12294,7 @@ type AllocColorCellsReply struct { Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) } -// Waits and reads reply data from request AllocColorCells +// Reply blocks and returns the reply data for a AllocColorCells request. func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11961,7 +12306,7 @@ func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { return allocColorCellsReply(buf), nil } -// Read reply into structure from buffer for AllocColorCells +// allocColorCellsReply reads a byte slice into a AllocColorCellsReply value. func allocColorCellsReply(buf []byte) *AllocColorCellsReply { v := new(AllocColorCellsReply) b := 1 // skip reply determinant @@ -12000,6 +12345,7 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { } // Write request to wire for AllocColorCells +// allocColorCellsRequest writes a AllocColorCells request to a byte slice. func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { size := 12 b := 0 @@ -12030,29 +12376,31 @@ func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors return buf } -// Request AllocColorPlanes -// size: 16 +// AllocColorPlanesCookie is a cookie used only for AllocColorPlanes requests. type AllocColorPlanesCookie struct { *xgb.Cookie } +// AllocColorPlanes sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorPlanesCookie.Reply() func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } +// AllocColorPlanesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } -// Request reply for AllocColorPlanes -// size: (32 + xgb.Pad((int(PixelsLen) * 4))) +// AllocColorPlanesReply represents the data returned from a AllocColorPlanes request. type AllocColorPlanesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PixelsLen uint16 // padding: 2 bytes @@ -12063,7 +12411,7 @@ type AllocColorPlanesReply struct { Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) } -// Waits and reads reply data from request AllocColorPlanes +// Reply blocks and returns the reply data for a AllocColorPlanes request. func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12075,7 +12423,7 @@ func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { return allocColorPlanesReply(buf), nil } -// Read reply into structure from buffer for AllocColorPlanes +// allocColorPlanesReply reads a byte slice into a AllocColorPlanesReply value. func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { v := new(AllocColorPlanesReply) b := 1 // skip reply determinant @@ -12115,6 +12463,7 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { } // Write request to wire for AllocColorPlanes +// allocColorPlanesRequest writes a AllocColorPlanes request to a byte slice. func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { size := 16 b := 0 @@ -12151,30 +12500,35 @@ func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors return buf } -// Request FreeColors -// size: xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) +// FreeColorsCookie is a cookie used only for FreeColors requests. type FreeColorsCookie struct { *xgb.Cookie } -// Write request to wire for FreeColors +// FreeColors sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } +// FreeColorsChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColorsCookie.Check() func FreeColorsChecked(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeColorsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeColors +// freeColorsRequest writes a FreeColors request to a byte slice. func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -12203,30 +12557,35 @@ func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []ui return buf } -// Request StoreColors -// size: xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) +// StoreColorsCookie is a cookie used only for StoreColors requests. type StoreColorsCookie struct { *xgb.Cookie } -// Write request to wire for StoreColors +// StoreColors sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StoreColors(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.NewCookie(false, false) c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{cookie} } +// StoreColorsChecked sends a checked request. +// If an error occurs, it can be retrieved using StoreColorsCookie.Check() func StoreColorsChecked(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.NewCookie(true, false) c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook StoreColorsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for StoreColors +// storeColorsRequest writes a StoreColors request to a byte slice. func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { size := xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) b := 0 @@ -12248,30 +12607,35 @@ func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { return buf } -// Request StoreNamedColor -// size: xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) +// StoreNamedColorCookie is a cookie used only for StoreNamedColor requests. type StoreNamedColorCookie struct { *xgb.Cookie } -// Write request to wire for StoreNamedColor +// StoreNamedColor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StoreNamedColor(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.NewCookie(false, false) c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } +// StoreNamedColorChecked sends a checked request. +// If an error occurs, it can be retrieved using StoreNamedColorCookie.Check() func StoreNamedColorChecked(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.NewCookie(true, false) c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook StoreNamedColorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for StoreNamedColor +// storeNamedColorRequest writes a StoreNamedColor request to a byte slice. func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) []byte { size := xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12303,36 +12667,38 @@ func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32 return buf } -// Request QueryColors -// size: xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) +// QueryColorsCookie is a cookie used only for QueryColors requests. type QueryColorsCookie struct { *xgb.Cookie } +// QueryColors sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryColorsCookie.Reply() func QueryColors(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } +// QueryColorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryColorsUnchecked(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } -// Request reply for QueryColors -// size: (32 + xgb.Pad((int(ColorsLen) * 8))) +// QueryColorsReply represents the data returned from a QueryColors request. type QueryColorsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ColorsLen uint16 // padding: 22 bytes Colors []Rgb // size: xgb.Pad((int(ColorsLen) * 8)) } -// Waits and reads reply data from request QueryColors +// Reply blocks and returns the reply data for a QueryColors request. func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12344,7 +12710,7 @@ func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { return queryColorsReply(buf), nil } -// Read reply into structure from buffer for QueryColors +// queryColorsReply reads a byte slice into a QueryColorsReply value. func queryColorsReply(buf []byte) *QueryColorsReply { v := new(QueryColorsReply) b := 1 // skip reply determinant @@ -12369,6 +12735,7 @@ func queryColorsReply(buf []byte) *QueryColorsReply { } // Write request to wire for QueryColors +// queryColorsRequest writes a QueryColors request to a byte slice. func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -12394,29 +12761,31 @@ func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { return buf } -// Request LookupColor -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// LookupColorCookie is a cookie used only for LookupColor requests. type LookupColorCookie struct { *xgb.Cookie } +// LookupColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling LookupColorCookie.Reply() func LookupColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } +// LookupColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LookupColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } -// Request reply for LookupColor -// size: 20 +// LookupColorReply represents the data returned from a LookupColor request. type LookupColorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ExactRed uint16 ExactGreen uint16 @@ -12426,7 +12795,7 @@ type LookupColorReply struct { VisualBlue uint16 } -// Waits and reads reply data from request LookupColor +// Reply blocks and returns the reply data for a LookupColor request. func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12438,7 +12807,7 @@ func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { return lookupColorReply(buf), nil } -// Read reply into structure from buffer for LookupColor +// lookupColorReply reads a byte slice into a LookupColorReply value. func lookupColorReply(buf []byte) *LookupColorReply { v := new(LookupColorReply) b := 1 // skip reply determinant @@ -12473,6 +12842,7 @@ func lookupColorReply(buf []byte) *LookupColorReply { } // Write request to wire for LookupColor +// lookupColorRequest writes a LookupColor request to a byte slice. func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12500,30 +12870,35 @@ func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) return buf } -// Request CreateCursor -// size: 32 +// CreateCursorCookie is a cookie used only for CreateCursor requests. type CreateCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateCursor +// CreateCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCursor(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } +// CreateCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCursorCookie.Check() func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateCursor +// createCursorRequest writes a CreateCursor request to a byte slice. func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 @@ -12573,30 +12948,35 @@ func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, Fo return buf } -// Request CreateGlyphCursor -// size: 32 +// CreateGlyphCursorCookie is a cookie used only for CreateGlyphCursor requests. type CreateGlyphCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateGlyphCursor +// CreateGlyphCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } +// CreateGlyphCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGlyphCursorCookie.Check() func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreateGlyphCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGlyphCursor +// createGlyphCursorRequest writes a CreateGlyphCursor request to a byte slice. func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 @@ -12646,30 +13026,35 @@ func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont return buf } -// Request FreeCursor -// size: 8 +// FreeCursorCookie is a cookie used only for FreeCursor requests. type FreeCursorCookie struct { *xgb.Cookie } -// Write request to wire for FreeCursor +// FreeCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{cookie} } +// FreeCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeCursorCookie.Check() func FreeCursorChecked(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FreeCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeCursor +// freeCursorRequest writes a FreeCursor request to a byte slice. func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { size := 8 b := 0 @@ -12689,30 +13074,35 @@ func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { return buf } -// Request RecolorCursor -// size: 20 +// RecolorCursorCookie is a cookie used only for RecolorCursor requests. type RecolorCursorCookie struct { *xgb.Cookie } -// Write request to wire for RecolorCursor +// RecolorCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } +// RecolorCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using RecolorCursorCookie.Check() func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RecolorCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RecolorCursor +// recolorCursorRequest writes a RecolorCursor request to a byte slice. func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 @@ -12750,35 +13140,37 @@ func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen return buf } -// Request QueryBestSize -// size: 12 +// QueryBestSizeCookie is a cookie used only for QueryBestSize requests. type QueryBestSizeCookie struct { *xgb.Cookie } +// QueryBestSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } +// QueryBestSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } -// Request reply for QueryBestSize -// size: 12 +// QueryBestSizeReply represents the data returned from a QueryBestSize request. type QueryBestSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint16 Height uint16 } -// Waits and reads reply data from request QueryBestSize +// Reply blocks and returns the reply data for a QueryBestSize request. func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12790,7 +13182,7 @@ func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { return queryBestSizeReply(buf), nil } -// Read reply into structure from buffer for QueryBestSize +// queryBestSizeReply reads a byte slice into a QueryBestSizeReply value. func queryBestSizeReply(buf []byte) *QueryBestSizeReply { v := new(QueryBestSizeReply) b := 1 // skip reply determinant @@ -12813,6 +13205,7 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { } // Write request to wire for QueryBestSize +// queryBestSizeRequest writes a QueryBestSize request to a byte slice. func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { size := 12 b := 0 @@ -12839,29 +13232,31 @@ func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint return buf } -// Request QueryExtension -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// QueryExtensionCookie is a cookie used only for QueryExtension requests. type QueryExtensionCookie struct { *xgb.Cookie } +// QueryExtension sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } +// QueryExtensionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } -// Request reply for QueryExtension -// size: 12 +// QueryExtensionReply represents the data returned from a QueryExtension request. type QueryExtensionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Present bool MajorOpcode byte @@ -12869,7 +13264,7 @@ type QueryExtensionReply struct { FirstError byte } -// Waits and reads reply data from request QueryExtension +// Reply blocks and returns the reply data for a QueryExtension request. func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12881,7 +13276,7 @@ func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { return queryExtensionReply(buf), nil } -// Read reply into structure from buffer for QueryExtension +// queryExtensionReply reads a byte slice into a QueryExtensionReply value. func queryExtensionReply(buf []byte) *QueryExtensionReply { v := new(QueryExtensionReply) b := 1 // skip reply determinant @@ -12914,6 +13309,7 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { } // Write request to wire for QueryExtension +// queryExtensionRequest writes a QueryExtension request to a byte slice. func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12938,35 +13334,37 @@ func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { return buf } -// Request ListExtensions -// size: 4 +// ListExtensionsCookie is a cookie used only for ListExtensions requests. type ListExtensionsCookie struct { *xgb.Cookie } +// ListExtensions sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListExtensionsCookie.Reply() func ListExtensions(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } +// ListExtensionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListExtensionsUnchecked(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } -// Request reply for ListExtensions -// size: (32 + StrListSize(Names)) +// ListExtensionsReply represents the data returned from a ListExtensions request. type ListExtensionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply NamesLen byte // padding: 24 bytes Names []Str // size: StrListSize(Names) } -// Waits and reads reply data from request ListExtensions +// Reply blocks and returns the reply data for a ListExtensions request. func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12978,7 +13376,7 @@ func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { return listExtensionsReply(buf), nil } -// Read reply into structure from buffer for ListExtensions +// listExtensionsReply reads a byte slice into a ListExtensionsReply value. func listExtensionsReply(buf []byte) *ListExtensionsReply { v := new(ListExtensionsReply) b := 1 // skip reply determinant @@ -13001,6 +13399,7 @@ func listExtensionsReply(buf []byte) *ListExtensionsReply { } // Write request to wire for ListExtensions +// listExtensionsRequest writes a ListExtensions request to a byte slice. func listExtensionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13016,30 +13415,35 @@ func listExtensionsRequest(c *xgb.Conn) []byte { return buf } -// Request ChangeKeyboardMapping -// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +// ChangeKeyboardMappingCookie is a cookie used only for ChangeKeyboardMapping requests. type ChangeKeyboardMappingCookie struct { *xgb.Cookie } -// Write request to wire for ChangeKeyboardMapping +// ChangeKeyboardMapping sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{cookie} } +// ChangeKeyboardMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardMappingCookie.Check() func ChangeKeyboardMappingChecked(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeKeyboardMappingCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardMapping +// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice. func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 @@ -13071,35 +13475,37 @@ func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode K return buf } -// Request GetKeyboardMapping -// size: 8 +// GetKeyboardMappingCookie is a cookie used only for GetKeyboardMapping requests. type GetKeyboardMappingCookie struct { *xgb.Cookie } +// GetKeyboardMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardMappingCookie.Reply() func GetKeyboardMapping(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } +// GetKeyboardMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetKeyboardMappingUnchecked(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } -// Request reply for GetKeyboardMapping -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetKeyboardMappingReply represents the data returned from a GetKeyboardMapping request. type GetKeyboardMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply KeysymsPerKeycode byte // padding: 24 bytes Keysyms []Keysym // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetKeyboardMapping +// Reply blocks and returns the reply data for a GetKeyboardMapping request. func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13111,7 +13517,7 @@ func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { return getKeyboardMappingReply(buf), nil } -// Read reply into structure from buffer for GetKeyboardMapping +// getKeyboardMappingReply reads a byte slice into a GetKeyboardMappingReply value. func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { v := new(GetKeyboardMappingReply) b := 1 // skip reply determinant @@ -13138,6 +13544,7 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { } // Write request to wire for GetKeyboardMapping +// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice. func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { size := 8 b := 0 @@ -13160,30 +13567,35 @@ func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) [] return buf } -// Request ChangeKeyboardControl -// size: xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeKeyboardControlCookie is a cookie used only for ChangeKeyboardControl requests. type ChangeKeyboardControlCookie struct { *xgb.Cookie } -// Write request to wire for ChangeKeyboardControl +// ChangeKeyboardControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{cookie} } +// ChangeKeyboardControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardControlCookie.Check() func ChangeKeyboardControlChecked(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeKeyboardControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardControl +// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -13208,29 +13620,31 @@ func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uin return buf } -// Request GetKeyboardControl -// size: 4 +// GetKeyboardControlCookie is a cookie used only for GetKeyboardControl requests. type GetKeyboardControlCookie struct { *xgb.Cookie } +// GetKeyboardControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardControlCookie.Reply() func GetKeyboardControl(c *xgb.Conn) GetKeyboardControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } +// GetKeyboardControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetKeyboardControlUnchecked(c *xgb.Conn) GetKeyboardControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } -// Request reply for GetKeyboardControl -// size: 52 +// GetKeyboardControlReply represents the data returned from a GetKeyboardControl request. type GetKeyboardControlReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply GlobalAutoRepeat byte LedMask uint32 KeyClickPercent byte @@ -13241,7 +13655,7 @@ type GetKeyboardControlReply struct { AutoRepeats []byte // size: 32 } -// Waits and reads reply data from request GetKeyboardControl +// Reply blocks and returns the reply data for a GetKeyboardControl request. func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13253,7 +13667,7 @@ func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { return getKeyboardControlReply(buf), nil } -// Read reply into structure from buffer for GetKeyboardControl +// getKeyboardControlReply reads a byte slice into a GetKeyboardControlReply value. func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v := new(GetKeyboardControlReply) b := 1 // skip reply determinant @@ -13292,6 +13706,7 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { } // Write request to wire for GetKeyboardControl +// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice. func getKeyboardControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13307,30 +13722,35 @@ func getKeyboardControlRequest(c *xgb.Conn) []byte { return buf } -// Request Bell -// size: 4 +// BellCookie is a cookie used only for Bell requests. type BellCookie struct { *xgb.Cookie } -// Write request to wire for Bell +// Bell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Bell(c *xgb.Conn, Percent int8) BellCookie { cookie := c.NewCookie(false, false) c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{cookie} } +// BellChecked sends a checked request. +// If an error occurs, it can be retrieved using BellCookie.Check() func BellChecked(c *xgb.Conn, Percent int8) BellCookie { cookie := c.NewCookie(true, false) c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook BellCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Bell +// bellRequest writes a Bell request to a byte slice. func bellRequest(c *xgb.Conn, Percent int8) []byte { size := 4 b := 0 @@ -13348,30 +13768,35 @@ func bellRequest(c *xgb.Conn, Percent int8) []byte { return buf } -// Request ChangePointerControl -// size: 12 +// ChangePointerControlCookie is a cookie used only for ChangePointerControl requests. type ChangePointerControlCookie struct { *xgb.Cookie } -// Write request to wire for ChangePointerControl +// ChangePointerControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePointerControl(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} } +// ChangePointerControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePointerControlCookie.Check() func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangePointerControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangePointerControl +// changePointerControlRequest writes a ChangePointerControl request to a byte slice. func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { size := 12 b := 0 @@ -13411,29 +13836,31 @@ func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, Accel return buf } -// Request GetPointerControl -// size: 4 +// GetPointerControlCookie is a cookie used only for GetPointerControl requests. type GetPointerControlCookie struct { *xgb.Cookie } +// GetPointerControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerControlCookie.Reply() func GetPointerControl(c *xgb.Conn) GetPointerControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } +// GetPointerControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPointerControlUnchecked(c *xgb.Conn) GetPointerControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } -// Request reply for GetPointerControl -// size: 32 +// GetPointerControlReply represents the data returned from a GetPointerControl request. type GetPointerControlReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes AccelerationNumerator uint16 AccelerationDenominator uint16 @@ -13441,7 +13868,7 @@ type GetPointerControlReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetPointerControl +// Reply blocks and returns the reply data for a GetPointerControl request. func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13453,7 +13880,7 @@ func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { return getPointerControlReply(buf), nil } -// Read reply into structure from buffer for GetPointerControl +// getPointerControlReply reads a byte slice into a GetPointerControlReply value. func getPointerControlReply(buf []byte) *GetPointerControlReply { v := new(GetPointerControlReply) b := 1 // skip reply determinant @@ -13481,6 +13908,7 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { } // Write request to wire for GetPointerControl +// getPointerControlRequest writes a GetPointerControl request to a byte slice. func getPointerControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13496,30 +13924,35 @@ func getPointerControlRequest(c *xgb.Conn) []byte { return buf } -// Request SetScreenSaver -// size: 12 +// SetScreenSaverCookie is a cookie used only for SetScreenSaver requests. type SetScreenSaverCookie struct { *xgb.Cookie } -// Write request to wire for SetScreenSaver +// SetScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenSaver(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.NewCookie(false, false) c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} } +// SetScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using SetScreenSaverCookie.Check() func SetScreenSaverChecked(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.NewCookie(true, false) c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetScreenSaverCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetScreenSaver +// setScreenSaverRequest writes a SetScreenSaver request to a byte slice. func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { size := 12 b := 0 @@ -13548,29 +13981,31 @@ func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBla return buf } -// Request GetScreenSaver -// size: 4 +// GetScreenSaverCookie is a cookie used only for GetScreenSaver requests. type GetScreenSaverCookie struct { *xgb.Cookie } +// GetScreenSaver sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSaverCookie.Reply() func GetScreenSaver(c *xgb.Conn) GetScreenSaverCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } +// GetScreenSaverUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSaverUnchecked(c *xgb.Conn) GetScreenSaverCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } -// Request reply for GetScreenSaver -// size: 32 +// GetScreenSaverReply represents the data returned from a GetScreenSaver request. type GetScreenSaverReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Timeout uint16 Interval uint16 @@ -13579,7 +14014,7 @@ type GetScreenSaverReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetScreenSaver +// Reply blocks and returns the reply data for a GetScreenSaver request. func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13591,7 +14026,7 @@ func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { return getScreenSaverReply(buf), nil } -// Read reply into structure from buffer for GetScreenSaver +// getScreenSaverReply reads a byte slice into a GetScreenSaverReply value. func getScreenSaverReply(buf []byte) *GetScreenSaverReply { v := new(GetScreenSaverReply) b := 1 // skip reply determinant @@ -13622,6 +14057,7 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { } // Write request to wire for GetScreenSaver +// getScreenSaverRequest writes a GetScreenSaver request to a byte slice. func getScreenSaverRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13637,30 +14073,35 @@ func getScreenSaverRequest(c *xgb.Conn) []byte { return buf } -// Request ChangeHosts -// size: xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) +// ChangeHostsCookie is a cookie used only for ChangeHosts requests. type ChangeHostsCookie struct { *xgb.Cookie } -// Write request to wire for ChangeHosts +// ChangeHosts sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeHosts(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} } +// ChangeHostsChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeHostsCookie.Check() func ChangeHostsChecked(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ChangeHostsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeHosts +// changeHostsRequest writes a ChangeHosts request to a byte slice. func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) b := 0 @@ -13689,36 +14130,38 @@ func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, return buf } -// Request ListHosts -// size: 4 +// ListHostsCookie is a cookie used only for ListHosts requests. type ListHostsCookie struct { *xgb.Cookie } +// ListHosts sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListHostsCookie.Reply() func ListHosts(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } +// ListHostsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListHostsUnchecked(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } -// Request reply for ListHosts -// size: (32 + HostListSize(Hosts)) +// ListHostsReply represents the data returned from a ListHosts request. type ListHostsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Mode byte HostsLen uint16 // padding: 22 bytes Hosts []Host // size: HostListSize(Hosts) } -// Waits and reads reply data from request ListHosts +// Reply blocks and returns the reply data for a ListHosts request. func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13730,7 +14173,7 @@ func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { return listHostsReply(buf), nil } -// Read reply into structure from buffer for ListHosts +// listHostsReply reads a byte slice into a ListHostsReply value. func listHostsReply(buf []byte) *ListHostsReply { v := new(ListHostsReply) b := 1 // skip reply determinant @@ -13756,6 +14199,7 @@ func listHostsReply(buf []byte) *ListHostsReply { } // Write request to wire for ListHosts +// listHostsRequest writes a ListHosts request to a byte slice. func listHostsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13771,30 +14215,35 @@ func listHostsRequest(c *xgb.Conn) []byte { return buf } -// Request SetAccessControl -// size: 4 +// SetAccessControlCookie is a cookie used only for SetAccessControl requests. type SetAccessControlCookie struct { *xgb.Cookie } -// Write request to wire for SetAccessControl +// SetAccessControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{cookie} } +// SetAccessControlChecked sends a checked request. +// If an error occurs, it can be retrieved using SetAccessControlCookie.Check() func SetAccessControlChecked(c *xgb.Conn, Mode byte) SetAccessControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetAccessControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetAccessControl +// setAccessControlRequest writes a SetAccessControl request to a byte slice. func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13812,30 +14261,35 @@ func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request SetCloseDownMode -// size: 4 +// SetCloseDownModeCookie is a cookie used only for SetCloseDownMode requests. type SetCloseDownModeCookie struct { *xgb.Cookie } -// Write request to wire for SetCloseDownMode +// SetCloseDownMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{cookie} } +// SetCloseDownModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCloseDownModeCookie.Check() func SetCloseDownModeChecked(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetCloseDownModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCloseDownMode +// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice. func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13853,30 +14307,35 @@ func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request KillClient -// size: 8 +// KillClientCookie is a cookie used only for KillClient requests. type KillClientCookie struct { *xgb.Cookie } -// Write request to wire for KillClient +// KillClient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(false, false) c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{cookie} } +// KillClientChecked sends a checked request. +// If an error occurs, it can be retrieved using KillClientCookie.Check() func KillClientChecked(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(true, false) c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook KillClientCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for KillClient +// killClientRequest writes a KillClient request to a byte slice. func killClientRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 @@ -13896,30 +14355,35 @@ func killClientRequest(c *xgb.Conn, Resource uint32) []byte { return buf } -// Request RotateProperties -// size: xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) +// RotatePropertiesCookie is a cookie used only for RotateProperties requests. type RotatePropertiesCookie struct { *xgb.Cookie } -// Write request to wire for RotateProperties +// RotateProperties sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.NewCookie(false, false) c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } +// RotatePropertiesChecked sends a checked request. +// If an error occurs, it can be retrieved using RotatePropertiesCookie.Check() func RotatePropertiesChecked(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.NewCookie(true, false) c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook RotatePropertiesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RotateProperties +// rotatePropertiesRequest writes a RotateProperties request to a byte slice. func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { size := xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) b := 0 @@ -13951,30 +14415,35 @@ func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta return buf } -// Request ForceScreenSaver -// size: 4 +// ForceScreenSaverCookie is a cookie used only for ForceScreenSaver requests. type ForceScreenSaverCookie struct { *xgb.Cookie } -// Write request to wire for ForceScreenSaver +// ForceScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { cookie := c.NewCookie(false, false) c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{cookie} } +// ForceScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using ForceScreenSaverCookie.Check() func ForceScreenSaverChecked(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { cookie := c.NewCookie(true, false) c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ForceScreenSaverCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ForceScreenSaver +// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice. func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13992,33 +14461,35 @@ func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request SetPointerMapping -// size: xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) +// SetPointerMappingCookie is a cookie used only for SetPointerMapping requests. type SetPointerMappingCookie struct { *xgb.Cookie } +// SetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetPointerMappingCookie.Reply() func SetPointerMapping(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } +// SetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPointerMappingUnchecked(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } -// Request reply for SetPointerMapping -// size: 8 +// SetPointerMappingReply represents the data returned from a SetPointerMapping request. type SetPointerMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request SetPointerMapping +// Reply blocks and returns the reply data for a SetPointerMapping request. func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14030,7 +14501,7 @@ func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { return setPointerMappingReply(buf), nil } -// Read reply into structure from buffer for SetPointerMapping +// setPointerMappingReply reads a byte slice into a SetPointerMappingReply value. func setPointerMappingReply(buf []byte) *SetPointerMappingReply { v := new(SetPointerMappingReply) b := 1 // skip reply determinant @@ -14048,6 +14519,7 @@ func setPointerMappingReply(buf []byte) *SetPointerMappingReply { } // Write request to wire for SetPointerMapping +// setPointerMappingRequest writes a SetPointerMapping request to a byte slice. func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) b := 0 @@ -14068,35 +14540,37 @@ func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { return buf } -// Request GetPointerMapping -// size: 4 +// GetPointerMappingCookie is a cookie used only for GetPointerMapping requests. type GetPointerMappingCookie struct { *xgb.Cookie } +// GetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerMappingCookie.Reply() func GetPointerMapping(c *xgb.Conn) GetPointerMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } +// GetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPointerMappingUnchecked(c *xgb.Conn) GetPointerMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } -// Request reply for GetPointerMapping -// size: (32 + xgb.Pad((int(MapLen) * 1))) +// GetPointerMappingReply represents the data returned from a GetPointerMapping request. type GetPointerMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply MapLen byte // padding: 24 bytes Map []byte // size: xgb.Pad((int(MapLen) * 1)) } -// Waits and reads reply data from request GetPointerMapping +// Reply blocks and returns the reply data for a GetPointerMapping request. func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14108,7 +14582,7 @@ func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { return getPointerMappingReply(buf), nil } -// Read reply into structure from buffer for GetPointerMapping +// getPointerMappingReply reads a byte slice into a GetPointerMappingReply value. func getPointerMappingReply(buf []byte) *GetPointerMappingReply { v := new(GetPointerMappingReply) b := 1 // skip reply determinant @@ -14132,6 +14606,7 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { } // Write request to wire for GetPointerMapping +// getPointerMappingRequest writes a GetPointerMapping request to a byte slice. func getPointerMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -14147,33 +14622,35 @@ func getPointerMappingRequest(c *xgb.Conn) []byte { return buf } -// Request SetModifierMapping -// size: xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) +// SetModifierMappingCookie is a cookie used only for SetModifierMapping requests. type SetModifierMappingCookie struct { *xgb.Cookie } +// SetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetModifierMappingCookie.Reply() func SetModifierMapping(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } +// SetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetModifierMappingUnchecked(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } -// Request reply for SetModifierMapping -// size: 8 +// SetModifierMappingReply represents the data returned from a SetModifierMapping request. type SetModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request SetModifierMapping +// Reply blocks and returns the reply data for a SetModifierMapping request. func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14185,7 +14662,7 @@ func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { return setModifierMappingReply(buf), nil } -// Read reply into structure from buffer for SetModifierMapping +// setModifierMappingReply reads a byte slice into a SetModifierMappingReply value. func setModifierMappingReply(buf []byte) *SetModifierMappingReply { v := new(SetModifierMappingReply) b := 1 // skip reply determinant @@ -14203,6 +14680,7 @@ func setModifierMappingReply(buf []byte) *SetModifierMappingReply { } // Write request to wire for SetModifierMapping +// setModifierMappingRequest writes a SetModifierMapping request to a byte slice. func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 @@ -14226,35 +14704,37 @@ func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes [ return buf } -// Request GetModifierMapping -// size: 4 +// GetModifierMappingCookie is a cookie used only for GetModifierMapping requests. type GetModifierMappingCookie struct { *xgb.Cookie } +// GetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetModifierMappingCookie.Reply() func GetModifierMapping(c *xgb.Conn) GetModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } +// GetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModifierMappingUnchecked(c *xgb.Conn) GetModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } -// Request reply for GetModifierMapping -// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) +// GetModifierMappingReply represents the data returned from a GetModifierMapping request. type GetModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply KeycodesPerModifier byte // padding: 24 bytes Keycodes []Keycode // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) } -// Waits and reads reply data from request GetModifierMapping +// Reply blocks and returns the reply data for a GetModifierMapping request. func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14266,7 +14746,7 @@ func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { return getModifierMappingReply(buf), nil } -// Read reply into structure from buffer for GetModifierMapping +// getModifierMappingReply reads a byte slice into a GetModifierMappingReply value. func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v := new(GetModifierMappingReply) b := 1 // skip reply determinant @@ -14293,6 +14773,7 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { } // Write request to wire for GetModifierMapping +// getModifierMappingRequest writes a GetModifierMapping request to a byte slice. func getModifierMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -14308,30 +14789,35 @@ func getModifierMappingRequest(c *xgb.Conn) []byte { return buf } -// Request NoOperation -// size: 4 +// NoOperationCookie is a cookie used only for NoOperation requests. type NoOperationCookie struct { *xgb.Cookie } -// Write request to wire for NoOperation +// NoOperation sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NoOperation(c *xgb.Conn) NoOperationCookie { cookie := c.NewCookie(false, false) c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{cookie} } +// NoOperationChecked sends a checked request. +// If an error occurs, it can be retrieved using NoOperationCookie.Check() func NoOperationChecked(c *xgb.Conn) NoOperationCookie { cookie := c.NewCookie(true, false) c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook NoOperationCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for NoOperation +// noOperationRequest writes a NoOperation request to a byte slice. func noOperationRequest(c *xgb.Conn) []byte { size := 4 b := 0 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index cb0532f..ac11a77 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 10 2012 8:04:33pm EDT. + This file was generated by xselinux.xml on May 10 2012 11:56:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -64,8 +64,6 @@ func init() { // Skipping definition for base type 'Byte' -// 'ListItem' struct definition -// Size: ((12 + xgb.Pad((int(ObjectContextLen) * 1))) + xgb.Pad((int(DataContextLen) * 1))) type ListItem struct { Name xproto.Atom ObjectContextLen uint32 @@ -74,7 +72,7 @@ type ListItem struct { DataContext string // size: xgb.Pad((int(DataContextLen) * 1)) } -// Struct read ListItem +// ListItemRead reads a byte slice into a ListItem value. func ListItemRead(buf []byte, v *ListItem) int { b := 0 @@ -104,7 +102,7 @@ func ListItemRead(buf []byte, v *ListItem) int { return b } -// Struct list read ListItem +// ListItemReadList reads a byte slice into a list of ListItem values. func ListItemReadList(buf []byte, dest []ListItem) int { b := 0 for i := 0; i < len(dest); i++ { @@ -114,7 +112,7 @@ func ListItemReadList(buf []byte, dest []ListItem) int { return xgb.Pad(b) } -// Struct write ListItem +// Bytes writes a ListItem value to a byte slice. func (v ListItem) Bytes() []byte { buf := make([]byte, ((12 + xgb.Pad((int(v.ObjectContextLen) * 1))) + xgb.Pad((int(v.DataContextLen) * 1)))) b := 0 @@ -137,7 +135,7 @@ func (v ListItem) Bytes() []byte { return buf } -// Write struct list ListItem +// ListItemListBytes writes a list of %s(MISSING) values to a byte slice. func ListItemListBytes(buf []byte, list []ListItem) int { b := 0 var structBytes []byte @@ -149,7 +147,7 @@ func ListItemListBytes(buf []byte, list []ListItem) int { return b } -// Struct list size ListItem +// ListItemListSize computes the size (bytes) of a list of ListItem values. func ListItemListSize(list []ListItem) int { size := 0 for _, item := range list { @@ -158,35 +156,37 @@ func ListItemListSize(list []ListItem) int { return size } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajor uint16 ServerMinor uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -198,7 +198,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -221,6 +221,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { size := 8 b := 0 @@ -244,30 +245,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte return buf } -// Request SetDeviceCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetDeviceCreateContextCookie is a cookie used only for SetDeviceCreateContext requests. type SetDeviceCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceCreateContext +// SetDeviceCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{cookie} } +// SetDeviceCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetDeviceCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceCreateContext +// setDeviceCreateContextRequest writes a SetDeviceCreateContext request to a byte slice. func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -291,36 +297,38 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetDeviceCreateContext -// size: 4 +// GetDeviceCreateContextCookie is a cookie used only for GetDeviceCreateContext requests. type GetDeviceCreateContextCookie struct { *xgb.Cookie } +// GetDeviceCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} } +// GetDeviceCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} } -// Request reply for GetDeviceCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetDeviceCreateContextReply represents the data returned from a GetDeviceCreateContext request. type GetDeviceCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetDeviceCreateContext +// Reply blocks and returns the reply data for a GetDeviceCreateContext request. func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -332,7 +340,7 @@ func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, return getDeviceCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetDeviceCreateContext +// getDeviceCreateContextReply reads a byte slice into a GetDeviceCreateContextReply value. func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { v := new(GetDeviceCreateContextReply) b := 1 // skip reply determinant @@ -361,6 +369,7 @@ func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { } // Write request to wire for GetDeviceCreateContext +// getDeviceCreateContextRequest writes a GetDeviceCreateContext request to a byte slice. func getDeviceCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -378,30 +387,35 @@ func getDeviceCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetDeviceContext -// size: xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) +// SetDeviceContextCookie is a cookie used only for SetDeviceContext requests. type SetDeviceContextCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceContext +// SetDeviceContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{cookie} } +// SetDeviceContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetDeviceContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceContext +// setDeviceContextRequest writes a SetDeviceContext request to a byte slice. func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) []byte { size := xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -428,36 +442,38 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont return buf } -// Request GetDeviceContext -// size: 8 +// GetDeviceContextCookie is a cookie used only for GetDeviceContext requests. type GetDeviceContextCookie struct { *xgb.Cookie } +// GetDeviceContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceContextCookie.Reply() func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} } +// GetDeviceContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} } -// Request reply for GetDeviceContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetDeviceContextReply represents the data returned from a GetDeviceContext request. type GetDeviceContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetDeviceContext +// Reply blocks and returns the reply data for a GetDeviceContext request. func (cook GetDeviceContextCookie) Reply() (*GetDeviceContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -469,7 +485,7 @@ func (cook GetDeviceContextCookie) Reply() (*GetDeviceContextReply, error) { return getDeviceContextReply(buf), nil } -// Read reply into structure from buffer for GetDeviceContext +// getDeviceContextReply reads a byte slice into a GetDeviceContextReply value. func getDeviceContextReply(buf []byte) *GetDeviceContextReply { v := new(GetDeviceContextReply) b := 1 // skip reply determinant @@ -498,6 +514,7 @@ func getDeviceContextReply(buf []byte) *GetDeviceContextReply { } // Write request to wire for GetDeviceContext +// getDeviceContextRequest writes a GetDeviceContext request to a byte slice. func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { size := 8 b := 0 @@ -518,30 +535,35 @@ func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { return buf } -// Request SetWindowCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetWindowCreateContextCookie is a cookie used only for SetWindowCreateContext requests. type SetWindowCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetWindowCreateContext +// SetWindowCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{cookie} } +// SetWindowCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetWindowCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetWindowCreateContext +// setWindowCreateContextRequest writes a SetWindowCreateContext request to a byte slice. func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -565,36 +587,38 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetWindowCreateContext -// size: 4 +// GetWindowCreateContextCookie is a cookie used only for GetWindowCreateContext requests. type GetWindowCreateContextCookie struct { *xgb.Cookie } +// GetWindowCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} } +// GetWindowCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} } -// Request reply for GetWindowCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetWindowCreateContextReply represents the data returned from a GetWindowCreateContext request. type GetWindowCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetWindowCreateContext +// Reply blocks and returns the reply data for a GetWindowCreateContext request. func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -606,7 +630,7 @@ func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, return getWindowCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetWindowCreateContext +// getWindowCreateContextReply reads a byte slice into a GetWindowCreateContextReply value. func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { v := new(GetWindowCreateContextReply) b := 1 // skip reply determinant @@ -635,6 +659,7 @@ func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { } // Write request to wire for GetWindowCreateContext +// getWindowCreateContextRequest writes a GetWindowCreateContext request to a byte slice. func getWindowCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -652,36 +677,38 @@ func getWindowCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetWindowContext -// size: 8 +// GetWindowContextCookie is a cookie used only for GetWindowContext requests. type GetWindowContextCookie struct { *xgb.Cookie } +// GetWindowContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} } +// GetWindowContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} } -// Request reply for GetWindowContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetWindowContextReply represents the data returned from a GetWindowContext request. type GetWindowContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetWindowContext +// Reply blocks and returns the reply data for a GetWindowContext request. func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -693,7 +720,7 @@ func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { return getWindowContextReply(buf), nil } -// Read reply into structure from buffer for GetWindowContext +// getWindowContextReply reads a byte slice into a GetWindowContextReply value. func getWindowContextReply(buf []byte) *GetWindowContextReply { v := new(GetWindowContextReply) b := 1 // skip reply determinant @@ -722,6 +749,7 @@ func getWindowContextReply(buf []byte) *GetWindowContextReply { } // Write request to wire for GetWindowContext +// getWindowContextRequest writes a GetWindowContext request to a byte slice. func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -742,30 +770,35 @@ func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request SetPropertyCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetPropertyCreateContextCookie is a cookie used only for SetPropertyCreateContext requests. type SetPropertyCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetPropertyCreateContext +// SetPropertyCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{cookie} } +// SetPropertyCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPropertyCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPropertyCreateContext +// setPropertyCreateContextRequest writes a SetPropertyCreateContext request to a byte slice. func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -789,36 +822,38 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str return buf } -// Request GetPropertyCreateContext -// size: 4 +// GetPropertyCreateContextCookie is a cookie used only for GetPropertyCreateContext requests. type GetPropertyCreateContextCookie struct { *xgb.Cookie } +// GetPropertyCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} } +// GetPropertyCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} } -// Request reply for GetPropertyCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyCreateContextReply represents the data returned from a GetPropertyCreateContext request. type GetPropertyCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyCreateContext +// Reply blocks and returns the reply data for a GetPropertyCreateContext request. func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -830,7 +865,7 @@ func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextRep return getPropertyCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyCreateContext +// getPropertyCreateContextReply reads a byte slice into a GetPropertyCreateContextReply value. func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { v := new(GetPropertyCreateContextReply) b := 1 // skip reply determinant @@ -859,6 +894,7 @@ func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { } // Write request to wire for GetPropertyCreateContext +// getPropertyCreateContextRequest writes a GetPropertyCreateContext request to a byte slice. func getPropertyCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -876,30 +912,35 @@ func getPropertyCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetPropertyUseContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetPropertyUseContextCookie is a cookie used only for SetPropertyUseContext requests. type SetPropertyUseContextCookie struct { *xgb.Cookie } -// Write request to wire for SetPropertyUseContext +// SetPropertyUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{cookie} } +// SetPropertyUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPropertyUseContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPropertyUseContext +// setPropertyUseContextRequest writes a SetPropertyUseContext request to a byte slice. func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -923,36 +964,38 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string return buf } -// Request GetPropertyUseContext -// size: 4 +// GetPropertyUseContextCookie is a cookie used only for GetPropertyUseContext requests. type GetPropertyUseContextCookie struct { *xgb.Cookie } +// GetPropertyUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} } +// GetPropertyUseContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} } -// Request reply for GetPropertyUseContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyUseContextReply represents the data returned from a GetPropertyUseContext request. type GetPropertyUseContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyUseContext +// Reply blocks and returns the reply data for a GetPropertyUseContext request. func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -964,7 +1007,7 @@ func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, er return getPropertyUseContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyUseContext +// getPropertyUseContextReply reads a byte slice into a GetPropertyUseContextReply value. func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { v := new(GetPropertyUseContextReply) b := 1 // skip reply determinant @@ -993,6 +1036,7 @@ func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { } // Write request to wire for GetPropertyUseContext +// getPropertyUseContextRequest writes a GetPropertyUseContext request to a byte slice. func getPropertyUseContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1010,36 +1054,38 @@ func getPropertyUseContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetPropertyContext -// size: 12 +// GetPropertyContextCookie is a cookie used only for GetPropertyContext requests. type GetPropertyContextCookie struct { *xgb.Cookie } +// GetPropertyContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyContextCookie.Reply() func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} } +// GetPropertyContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} } -// Request reply for GetPropertyContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyContextReply represents the data returned from a GetPropertyContext request. type GetPropertyContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyContext +// Reply blocks and returns the reply data for a GetPropertyContext request. func (cook GetPropertyContextCookie) Reply() (*GetPropertyContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1051,7 +1097,7 @@ func (cook GetPropertyContextCookie) Reply() (*GetPropertyContextReply, error) { return getPropertyContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyContext +// getPropertyContextReply reads a byte slice into a GetPropertyContextReply value. func getPropertyContextReply(buf []byte) *GetPropertyContextReply { v := new(GetPropertyContextReply) b := 1 // skip reply determinant @@ -1080,6 +1126,7 @@ func getPropertyContextReply(buf []byte) *GetPropertyContextReply { } // Write request to wire for GetPropertyContext +// getPropertyContextRequest writes a GetPropertyContext request to a byte slice. func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { size := 12 b := 0 @@ -1103,36 +1150,38 @@ func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xprot return buf } -// Request GetPropertyDataContext -// size: 12 +// GetPropertyDataContextCookie is a cookie used only for GetPropertyDataContext requests. type GetPropertyDataContextCookie struct { *xgb.Cookie } +// GetPropertyDataContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyDataContextCookie.Reply() func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} } +// GetPropertyDataContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} } -// Request reply for GetPropertyDataContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyDataContextReply represents the data returned from a GetPropertyDataContext request. type GetPropertyDataContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyDataContext +// Reply blocks and returns the reply data for a GetPropertyDataContext request. func (cook GetPropertyDataContextCookie) Reply() (*GetPropertyDataContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1144,7 +1193,7 @@ func (cook GetPropertyDataContextCookie) Reply() (*GetPropertyDataContextReply, return getPropertyDataContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyDataContext +// getPropertyDataContextReply reads a byte slice into a GetPropertyDataContextReply value. func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { v := new(GetPropertyDataContextReply) b := 1 // skip reply determinant @@ -1173,6 +1222,7 @@ func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { } // Write request to wire for GetPropertyDataContext +// getPropertyDataContextRequest writes a GetPropertyDataContext request to a byte slice. func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { size := 12 b := 0 @@ -1196,36 +1246,38 @@ func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property x return buf } -// Request ListProperties -// size: 8 +// ListPropertiesCookie is a cookie used only for ListProperties requests. type ListPropertiesCookie struct { *xgb.Cookie } +// ListProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } +// ListPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } -// Request reply for ListProperties -// size: (32 + ListItemListSize(Properties)) +// ListPropertiesReply represents the data returned from a ListProperties request. type ListPropertiesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PropertiesLen uint32 // padding: 20 bytes Properties []ListItem // size: ListItemListSize(Properties) } -// Waits and reads reply data from request ListProperties +// Reply blocks and returns the reply data for a ListProperties request. func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1237,7 +1289,7 @@ func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { return listPropertiesReply(buf), nil } -// Read reply into structure from buffer for ListProperties +// listPropertiesReply reads a byte slice into a ListPropertiesReply value. func listPropertiesReply(buf []byte) *ListPropertiesReply { v := new(ListPropertiesReply) b := 1 // skip reply determinant @@ -1262,6 +1314,7 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { } // Write request to wire for ListProperties +// listPropertiesRequest writes a ListProperties request to a byte slice. func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1282,30 +1335,35 @@ func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request SetSelectionCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetSelectionCreateContextCookie is a cookie used only for SetSelectionCreateContext requests. type SetSelectionCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionCreateContext +// SetSelectionCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{cookie} } +// SetSelectionCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetSelectionCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionCreateContext +// setSelectionCreateContextRequest writes a SetSelectionCreateContext request to a byte slice. func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -1329,36 +1387,38 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st return buf } -// Request GetSelectionCreateContext -// size: 4 +// GetSelectionCreateContextCookie is a cookie used only for GetSelectionCreateContext requests. type GetSelectionCreateContextCookie struct { *xgb.Cookie } +// GetSelectionCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} } +// GetSelectionCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} } -// Request reply for GetSelectionCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionCreateContextReply represents the data returned from a GetSelectionCreateContext request. type GetSelectionCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionCreateContext +// Reply blocks and returns the reply data for a GetSelectionCreateContext request. func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1370,7 +1430,7 @@ func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextR return getSelectionCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionCreateContext +// getSelectionCreateContextReply reads a byte slice into a GetSelectionCreateContextReply value. func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply { v := new(GetSelectionCreateContextReply) b := 1 // skip reply determinant @@ -1399,6 +1459,7 @@ func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply } // Write request to wire for GetSelectionCreateContext +// getSelectionCreateContextRequest writes a GetSelectionCreateContext request to a byte slice. func getSelectionCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1416,30 +1477,35 @@ func getSelectionCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetSelectionUseContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetSelectionUseContextCookie is a cookie used only for SetSelectionUseContext requests. type SetSelectionUseContextCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionUseContext +// SetSelectionUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{cookie} } +// SetSelectionUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetSelectionUseContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionUseContext +// setSelectionUseContextRequest writes a SetSelectionUseContext request to a byte slice. func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -1463,36 +1529,38 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetSelectionUseContext -// size: 4 +// GetSelectionUseContextCookie is a cookie used only for GetSelectionUseContext requests. type GetSelectionUseContextCookie struct { *xgb.Cookie } +// GetSelectionUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} } +// GetSelectionUseContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} } -// Request reply for GetSelectionUseContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionUseContextReply represents the data returned from a GetSelectionUseContext request. type GetSelectionUseContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionUseContext +// Reply blocks and returns the reply data for a GetSelectionUseContext request. func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1504,7 +1572,7 @@ func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, return getSelectionUseContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionUseContext +// getSelectionUseContextReply reads a byte slice into a GetSelectionUseContextReply value. func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { v := new(GetSelectionUseContextReply) b := 1 // skip reply determinant @@ -1533,6 +1601,7 @@ func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { } // Write request to wire for GetSelectionUseContext +// getSelectionUseContextRequest writes a GetSelectionUseContext request to a byte slice. func getSelectionUseContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1550,36 +1619,38 @@ func getSelectionUseContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetSelectionContext -// size: 8 +// GetSelectionContextCookie is a cookie used only for GetSelectionContext requests. type GetSelectionContextCookie struct { *xgb.Cookie } +// GetSelectionContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionContextCookie.Reply() func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} } +// GetSelectionContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} } -// Request reply for GetSelectionContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionContextReply represents the data returned from a GetSelectionContext request. type GetSelectionContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionContext +// Reply blocks and returns the reply data for a GetSelectionContext request. func (cook GetSelectionContextCookie) Reply() (*GetSelectionContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1591,7 +1662,7 @@ func (cook GetSelectionContextCookie) Reply() (*GetSelectionContextReply, error) return getSelectionContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionContext +// getSelectionContextReply reads a byte slice into a GetSelectionContextReply value. func getSelectionContextReply(buf []byte) *GetSelectionContextReply { v := new(GetSelectionContextReply) b := 1 // skip reply determinant @@ -1620,6 +1691,7 @@ func getSelectionContextReply(buf []byte) *GetSelectionContextReply { } // Write request to wire for GetSelectionContext +// getSelectionContextRequest writes a GetSelectionContext request to a byte slice. func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { size := 8 b := 0 @@ -1640,36 +1712,38 @@ func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } -// Request GetSelectionDataContext -// size: 8 +// GetSelectionDataContextCookie is a cookie used only for GetSelectionDataContext requests. type GetSelectionDataContextCookie struct { *xgb.Cookie } +// GetSelectionDataContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionDataContextCookie.Reply() func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} } +// GetSelectionDataContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} } -// Request reply for GetSelectionDataContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionDataContextReply represents the data returned from a GetSelectionDataContext request. type GetSelectionDataContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionDataContext +// Reply blocks and returns the reply data for a GetSelectionDataContext request. func (cook GetSelectionDataContextCookie) Reply() (*GetSelectionDataContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1681,7 +1755,7 @@ func (cook GetSelectionDataContextCookie) Reply() (*GetSelectionDataContextReply return getSelectionDataContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionDataContext +// getSelectionDataContextReply reads a byte slice into a GetSelectionDataContextReply value. func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { v := new(GetSelectionDataContextReply) b := 1 // skip reply determinant @@ -1710,6 +1784,7 @@ func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { } // Write request to wire for GetSelectionDataContext +// getSelectionDataContextRequest writes a GetSelectionDataContext request to a byte slice. func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { size := 8 b := 0 @@ -1730,36 +1805,38 @@ func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } -// Request ListSelections -// size: 4 +// ListSelectionsCookie is a cookie used only for ListSelections requests. type ListSelectionsCookie struct { *xgb.Cookie } +// ListSelections sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSelectionsCookie.Reply() func ListSelections(c *xgb.Conn) ListSelectionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} } +// ListSelectionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} } -// Request reply for ListSelections -// size: (32 + ListItemListSize(Selections)) +// ListSelectionsReply represents the data returned from a ListSelections request. type ListSelectionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes SelectionsLen uint32 // padding: 20 bytes Selections []ListItem // size: ListItemListSize(Selections) } -// Waits and reads reply data from request ListSelections +// Reply blocks and returns the reply data for a ListSelections request. func (cook ListSelectionsCookie) Reply() (*ListSelectionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1771,7 +1848,7 @@ func (cook ListSelectionsCookie) Reply() (*ListSelectionsReply, error) { return listSelectionsReply(buf), nil } -// Read reply into structure from buffer for ListSelections +// listSelectionsReply reads a byte slice into a ListSelectionsReply value. func listSelectionsReply(buf []byte) *ListSelectionsReply { v := new(ListSelectionsReply) b := 1 // skip reply determinant @@ -1796,6 +1873,7 @@ func listSelectionsReply(buf []byte) *ListSelectionsReply { } // Write request to wire for ListSelections +// listSelectionsRequest writes a ListSelections request to a byte slice. func listSelectionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1813,36 +1891,38 @@ func listSelectionsRequest(c *xgb.Conn) []byte { return buf } -// Request GetClientContext -// size: 8 +// GetClientContextCookie is a cookie used only for GetClientContext requests. type GetClientContextCookie struct { *xgb.Cookie } +// GetClientContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} } +// GetClientContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} } -// Request reply for GetClientContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetClientContextReply represents the data returned from a GetClientContext request. type GetClientContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetClientContext +// Reply blocks and returns the reply data for a GetClientContext request. func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1854,7 +1934,7 @@ func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { return getClientContextReply(buf), nil } -// Read reply into structure from buffer for GetClientContext +// getClientContextReply reads a byte slice into a GetClientContextReply value. func getClientContextReply(buf []byte) *GetClientContextReply { v := new(GetClientContextReply) b := 1 // skip reply determinant @@ -1883,6 +1963,7 @@ func getClientContextReply(buf []byte) *GetClientContextReply { } // Write request to wire for GetClientContext +// getClientContextRequest writes a GetClientContext request to a byte slice. func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 357b325..e2a2d80 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on May 10 2012 8:04:33pm EDT. + This file was generated by xtest.xml on May 10 2012 11:56:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -69,34 +69,36 @@ const ( CursorCurrent = 1 ) -// Request GetVersion -// size: 8 +// GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { *xgb.Cookie } +// GetVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) return GetVersionCookie{cookie} } +// GetVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) return GetVersionCookie{cookie} } -// Request reply for GetVersion -// size: 10 +// GetVersionReply represents the data returned from a GetVersion request. type GetVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply MajorVersion byte MinorVersion uint16 } -// Waits and reads reply data from request GetVersion +// Reply blocks and returns the reply data for a GetVersion request. func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -108,7 +110,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { return getVersionReply(buf), nil } -// Read reply into structure from buffer for GetVersion +// getVersionReply reads a byte slice into a GetVersionReply value. func getVersionReply(buf []byte) *GetVersionReply { v := new(GetVersionReply) b := 1 // skip reply determinant @@ -129,6 +131,7 @@ func getVersionReply(buf []byte) *GetVersionReply { } // Write request to wire for GetVersion +// getVersionRequest writes a GetVersion request to a byte slice. func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte { size := 8 b := 0 @@ -154,33 +157,35 @@ func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []by return buf } -// Request CompareCursor -// size: 12 +// CompareCursorCookie is a cookie used only for CompareCursor requests. type CompareCursorCookie struct { *xgb.Cookie } +// CompareCursor sends a checked request. +// If an error occurs, it will be returned with the reply by calling CompareCursorCookie.Reply() func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { cookie := c.NewCookie(true, true) c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) return CompareCursorCookie{cookie} } +// CompareCursorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { cookie := c.NewCookie(false, true) c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) return CompareCursorCookie{cookie} } -// Request reply for CompareCursor -// size: 8 +// CompareCursorReply represents the data returned from a CompareCursor request. type CompareCursorReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Same bool } -// Waits and reads reply data from request CompareCursor +// Reply blocks and returns the reply data for a CompareCursor request. func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -192,7 +197,7 @@ func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) { return compareCursorReply(buf), nil } -// Read reply into structure from buffer for CompareCursor +// compareCursorReply reads a byte slice into a CompareCursorReply value. func compareCursorReply(buf []byte) *CompareCursorReply { v := new(CompareCursorReply) b := 1 // skip reply determinant @@ -214,6 +219,7 @@ func compareCursorReply(buf []byte) *CompareCursorReply { } // Write request to wire for CompareCursor +// compareCursorRequest writes a CompareCursor request to a byte slice. func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) []byte { size := 12 b := 0 @@ -237,30 +243,35 @@ func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Curso return buf } -// Request FakeInput -// size: 36 +// FakeInputCookie is a cookie used only for FakeInput requests. type FakeInputCookie struct { *xgb.Cookie } -// Write request to wire for FakeInput +// FakeInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { cookie := c.NewCookie(false, false) c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return FakeInputCookie{cookie} } +// FakeInputChecked sends a checked request. +// If an error occurs, it can be retrieved using FakeInputCookie.Check() func FakeInputChecked(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { cookie := c.NewCookie(true, false) c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return FakeInputCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook FakeInputCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FakeInput +// fakeInputRequest writes a FakeInput request to a byte slice. func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) []byte { size := 36 b := 0 @@ -305,30 +316,35 @@ func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xpr return buf } -// Request GrabControl -// size: 8 +// GrabControlCookie is a cookie used only for GrabControl requests. type GrabControlCookie struct { *xgb.Cookie } -// Write request to wire for GrabControl +// GrabControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabControlRequest(c, Impervious), cookie) return GrabControlCookie{cookie} } +// GrabControlChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabControlCookie.Check() func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabControlRequest(c, Impervious), cookie) return GrabControlCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GrabControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabControl +// grabControlRequest writes a GrabControl request to a byte slice. func grabControlRequest(c *xgb.Conn, Impervious bool) []byte { size := 8 b := 0 diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 4e495cf..041b082 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on May 10 2012 8:04:33pm EDT. + This file was generated by xv.xml on May 10 2012 11:56:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,10 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -65,6 +61,10 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + const ( TypeInputMask = 1 TypeOutputMask = 2 @@ -130,14 +130,12 @@ func NewEncodingId(c *xgb.Conn) (Encoding, error) { return Encoding(id), nil } -// 'Rational' struct definition -// Size: 8 type Rational struct { Numerator int32 Denominator int32 } -// Struct read Rational +// RationalRead reads a byte slice into a Rational value. func RationalRead(buf []byte, v *Rational) int { b := 0 @@ -150,7 +148,7 @@ func RationalRead(buf []byte, v *Rational) int { return b } -// Struct list read Rational +// RationalReadList reads a byte slice into a list of Rational values. func RationalReadList(buf []byte, dest []Rational) int { b := 0 for i := 0; i < len(dest); i++ { @@ -160,7 +158,7 @@ func RationalReadList(buf []byte, dest []Rational) int { return xgb.Pad(b) } -// Struct write Rational +// Bytes writes a Rational value to a byte slice. func (v Rational) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -174,7 +172,7 @@ func (v Rational) Bytes() []byte { return buf } -// Write struct list Rational +// RationalListBytes writes a list of %s(MISSING) values to a byte slice. func RationalListBytes(buf []byte, list []Rational) int { b := 0 var structBytes []byte @@ -186,15 +184,13 @@ func RationalListBytes(buf []byte, list []Rational) int { return b } -// 'Format' struct definition -// Size: 8 type Format struct { Visual xproto.Visualid Depth byte // padding: 3 bytes } -// Struct read Format +// FormatRead reads a byte slice into a Format value. func FormatRead(buf []byte, v *Format) int { b := 0 @@ -209,7 +205,7 @@ func FormatRead(buf []byte, v *Format) int { return b } -// Struct list read Format +// FormatReadList reads a byte slice into a list of Format values. func FormatReadList(buf []byte, dest []Format) int { b := 0 for i := 0; i < len(dest); i++ { @@ -219,7 +215,7 @@ func FormatReadList(buf []byte, dest []Format) int { return xgb.Pad(b) } -// Struct write Format +// Bytes writes a Format value to a byte slice. func (v Format) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -235,7 +231,7 @@ func (v Format) Bytes() []byte { return buf } -// Write struct list Format +// FormatListBytes writes a list of %s(MISSING) values to a byte slice. func FormatListBytes(buf []byte, list []Format) int { b := 0 var structBytes []byte @@ -247,8 +243,6 @@ func FormatListBytes(buf []byte, list []Format) int { return b } -// 'AdaptorInfo' struct definition -// Size: ((12 + xgb.Pad((int(NameSize) * 1))) + xgb.Pad((int(NumFormats) * 8))) type AdaptorInfo struct { BaseId Port NameSize uint16 @@ -260,7 +254,7 @@ type AdaptorInfo struct { Formats []Format // size: xgb.Pad((int(NumFormats) * 8)) } -// Struct read AdaptorInfo +// AdaptorInfoRead reads a byte slice into a AdaptorInfo value. func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { b := 0 @@ -294,7 +288,7 @@ func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { return b } -// Struct list read AdaptorInfo +// AdaptorInfoReadList reads a byte slice into a list of AdaptorInfo values. func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -304,7 +298,7 @@ func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { return xgb.Pad(b) } -// Struct write AdaptorInfo +// Bytes writes a AdaptorInfo value to a byte slice. func (v AdaptorInfo) Bytes() []byte { buf := make([]byte, ((12 + xgb.Pad((int(v.NameSize) * 1))) + xgb.Pad((int(v.NumFormats) * 8)))) b := 0 @@ -334,7 +328,7 @@ func (v AdaptorInfo) Bytes() []byte { return buf } -// Write struct list AdaptorInfo +// AdaptorInfoListBytes writes a list of %s(MISSING) values to a byte slice. func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { b := 0 var structBytes []byte @@ -346,7 +340,7 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { return b } -// Struct list size AdaptorInfo +// AdaptorInfoListSize computes the size (bytes) of a list of AdaptorInfo values. func AdaptorInfoListSize(list []AdaptorInfo) int { size := 0 for _, item := range list { @@ -355,8 +349,6 @@ func AdaptorInfoListSize(list []AdaptorInfo) int { return size } -// 'EncodingInfo' struct definition -// Size: (20 + xgb.Pad((int(NameSize) * 1))) type EncodingInfo struct { Encoding Encoding NameSize uint16 @@ -367,7 +359,7 @@ type EncodingInfo struct { Name string // size: xgb.Pad((int(NameSize) * 1)) } -// Struct read EncodingInfo +// EncodingInfoRead reads a byte slice into a EncodingInfo value. func EncodingInfoRead(buf []byte, v *EncodingInfo) int { b := 0 @@ -398,7 +390,7 @@ func EncodingInfoRead(buf []byte, v *EncodingInfo) int { return b } -// Struct list read EncodingInfo +// EncodingInfoReadList reads a byte slice into a list of EncodingInfo values. func EncodingInfoReadList(buf []byte, dest []EncodingInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -408,7 +400,7 @@ func EncodingInfoReadList(buf []byte, dest []EncodingInfo) int { return xgb.Pad(b) } -// Struct write EncodingInfo +// Bytes writes a EncodingInfo value to a byte slice. func (v EncodingInfo) Bytes() []byte { buf := make([]byte, (20 + xgb.Pad((int(v.NameSize) * 1)))) b := 0 @@ -439,7 +431,7 @@ func (v EncodingInfo) Bytes() []byte { return buf } -// Write struct list EncodingInfo +// EncodingInfoListBytes writes a list of %s(MISSING) values to a byte slice. func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { b := 0 var structBytes []byte @@ -451,7 +443,7 @@ func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { return b } -// Struct list size EncodingInfo +// EncodingInfoListSize computes the size (bytes) of a list of EncodingInfo values. func EncodingInfoListSize(list []EncodingInfo) int { size := 0 for _, item := range list { @@ -460,8 +452,6 @@ func EncodingInfoListSize(list []EncodingInfo) int { return size } -// 'Image' struct definition -// Size: (((16 + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(DataSize) * 1))) type Image struct { Id uint32 Width uint16 @@ -473,7 +463,7 @@ type Image struct { Data []byte // size: xgb.Pad((int(DataSize) * 1)) } -// Struct read Image +// ImageRead reads a byte slice into a Image value. func ImageRead(buf []byte, v *Image) int { b := 0 @@ -513,7 +503,7 @@ func ImageRead(buf []byte, v *Image) int { return b } -// Struct list read Image +// ImageReadList reads a byte slice into a list of Image values. func ImageReadList(buf []byte, dest []Image) int { b := 0 for i := 0; i < len(dest); i++ { @@ -523,7 +513,7 @@ func ImageReadList(buf []byte, dest []Image) int { return xgb.Pad(b) } -// Struct write Image +// Bytes writes a Image value to a byte slice. func (v Image) Bytes() []byte { buf := make([]byte, (((16 + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) b := 0 @@ -561,7 +551,7 @@ func (v Image) Bytes() []byte { return buf } -// Write struct list Image +// ImageListBytes writes a list of %s(MISSING) values to a byte slice. func ImageListBytes(buf []byte, list []Image) int { b := 0 var structBytes []byte @@ -573,7 +563,7 @@ func ImageListBytes(buf []byte, list []Image) int { return b } -// Struct list size Image +// ImageListSize computes the size (bytes) of a list of Image values. func ImageListSize(list []Image) int { size := 0 for _, item := range list { @@ -582,8 +572,6 @@ func ImageListSize(list []Image) int { return size } -// 'AttributeInfo' struct definition -// Size: (16 + xgb.Pad((int(Size) * 1))) type AttributeInfo struct { Flags uint32 Min int32 @@ -592,7 +580,7 @@ type AttributeInfo struct { Name string // size: xgb.Pad((int(Size) * 1)) } -// Struct read AttributeInfo +// AttributeInfoRead reads a byte slice into a AttributeInfo value. func AttributeInfoRead(buf []byte, v *AttributeInfo) int { b := 0 @@ -618,7 +606,7 @@ func AttributeInfoRead(buf []byte, v *AttributeInfo) int { return b } -// Struct list read AttributeInfo +// AttributeInfoReadList reads a byte slice into a list of AttributeInfo values. func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -628,7 +616,7 @@ func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { return xgb.Pad(b) } -// Struct write AttributeInfo +// Bytes writes a AttributeInfo value to a byte slice. func (v AttributeInfo) Bytes() []byte { buf := make([]byte, (16 + xgb.Pad((int(v.Size) * 1)))) b := 0 @@ -651,7 +639,7 @@ func (v AttributeInfo) Bytes() []byte { return buf } -// Write struct list AttributeInfo +// AttributeInfoListBytes writes a list of %s(MISSING) values to a byte slice. func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { b := 0 var structBytes []byte @@ -663,7 +651,7 @@ func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { return b } -// Struct list size AttributeInfo +// AttributeInfoListSize computes the size (bytes) of a list of AttributeInfo values. func AttributeInfoListSize(list []AttributeInfo) int { size := 0 for _, item := range list { @@ -672,8 +660,6 @@ func AttributeInfoListSize(list []AttributeInfo) int { return size } -// 'ImageFormatInfo' struct definition -// Size: 128 type ImageFormatInfo struct { Id uint32 Type byte @@ -704,7 +690,7 @@ type ImageFormatInfo struct { // padding: 11 bytes } -// Struct read ImageFormatInfo +// ImageFormatInfoRead reads a byte slice into a ImageFormatInfo value. func ImageFormatInfoRead(buf []byte, v *ImageFormatInfo) int { b := 0 @@ -789,7 +775,7 @@ func ImageFormatInfoRead(buf []byte, v *ImageFormatInfo) int { return b } -// Struct list read ImageFormatInfo +// ImageFormatInfoReadList reads a byte slice into a list of ImageFormatInfo values. func ImageFormatInfoReadList(buf []byte, dest []ImageFormatInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -799,7 +785,7 @@ func ImageFormatInfoReadList(buf []byte, dest []ImageFormatInfo) int { return xgb.Pad(b) } -// Struct write ImageFormatInfo +// Bytes writes a ImageFormatInfo value to a byte slice. func (v ImageFormatInfo) Bytes() []byte { buf := make([]byte, 128) b := 0 @@ -883,7 +869,7 @@ func (v ImageFormatInfo) Bytes() []byte { return buf } -// Write struct list ImageFormatInfo +// ImageFormatInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { b := 0 var structBytes []byte @@ -895,7 +881,7 @@ func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { return b } -// Struct list size ImageFormatInfo +// ImageFormatInfoListSize computes the size (bytes) of a list of ImageFormatInfo values. func ImageFormatInfoListSize(list []ImageFormatInfo) int { size := 0 for _ = range list { @@ -904,9 +890,7 @@ func ImageFormatInfoListSize(list []ImageFormatInfo) int { return size } -// Event definition VideoNotify (0) -// Size: 32 - +// VideoNotify is the event number for a VideoNotifyEvent. const VideoNotify = 0 type VideoNotifyEvent struct { @@ -917,7 +901,7 @@ type VideoNotifyEvent struct { Port Port } -// Event read VideoNotify +// VideoNotifyEventNew constructs a VideoNotifyEvent value that implements xgb.Event from a byte slice. func VideoNotifyEventNew(buf []byte) xgb.Event { v := VideoNotifyEvent{} b := 1 // don't read event number @@ -940,7 +924,7 @@ func VideoNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write VideoNotify +// Bytes writes a VideoNotifyEvent value to a byte slice. func (v VideoNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -966,12 +950,14 @@ func (v VideoNotifyEvent) Bytes() []byte { return buf } -func (v VideoNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the VideoNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v VideoNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of VideoNotifyEvent. func (v VideoNotifyEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -986,9 +972,7 @@ func init() { xgb.NewExtEventFuncs["XVideo"][0] = VideoNotifyEventNew } -// Event definition PortNotify (1) -// Size: 32 - +// PortNotify is the event number for a PortNotifyEvent. const PortNotify = 1 type PortNotifyEvent struct { @@ -1000,7 +984,7 @@ type PortNotifyEvent struct { Value int32 } -// Event read PortNotify +// PortNotifyEventNew constructs a PortNotifyEvent value that implements xgb.Event from a byte slice. func PortNotifyEventNew(buf []byte) xgb.Event { v := PortNotifyEvent{} b := 1 // don't read event number @@ -1025,7 +1009,7 @@ func PortNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write PortNotify +// Bytes writes a PortNotifyEvent value to a byte slice. func (v PortNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -1053,12 +1037,14 @@ func (v PortNotifyEvent) Bytes() []byte { return buf } -func (v PortNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the PortNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v PortNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of PortNotifyEvent. func (v PortNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -1073,9 +1059,7 @@ func init() { xgb.NewExtEventFuncs["XVideo"][1] = PortNotifyEventNew } -// Error definition BadPort (0) -// Size: 32 - +// BadBadPort is the error number for a BadBadPort. const BadBadPort = 0 type BadPortError struct { @@ -1083,7 +1067,7 @@ type BadPortError struct { NiceName string } -// Error read BadPort +// BadPortErrorNew constructs a BadPortError value that implements xgb.Error from a byte slice. func BadPortErrorNew(buf []byte) xgb.Error { v := BadPortError{} v.NiceName = "BadPort" @@ -1097,8 +1081,8 @@ func BadPortErrorNew(buf []byte) xgb.Error { return v } -func (err BadPortError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadPort error. +// This is mostly used internally. func (err BadPortError) SequenceId() uint16 { return err.Sequence } @@ -1118,9 +1102,7 @@ func init() { xgb.NewExtErrorFuncs["XVideo"][0] = BadPortErrorNew } -// Error definition BadEncoding (1) -// Size: 32 - +// BadBadEncoding is the error number for a BadBadEncoding. const BadBadEncoding = 1 type BadEncodingError struct { @@ -1128,7 +1110,7 @@ type BadEncodingError struct { NiceName string } -// Error read BadEncoding +// BadEncodingErrorNew constructs a BadEncodingError value that implements xgb.Error from a byte slice. func BadEncodingErrorNew(buf []byte) xgb.Error { v := BadEncodingError{} v.NiceName = "BadEncoding" @@ -1142,8 +1124,8 @@ func BadEncodingErrorNew(buf []byte) xgb.Error { return v } -func (err BadEncodingError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadEncoding error. +// This is mostly used internally. func (err BadEncodingError) SequenceId() uint16 { return err.Sequence } @@ -1163,9 +1145,7 @@ func init() { xgb.NewExtErrorFuncs["XVideo"][1] = BadEncodingErrorNew } -// Error definition BadControl (2) -// Size: 32 - +// BadBadControl is the error number for a BadBadControl. const BadBadControl = 2 type BadControlError struct { @@ -1173,7 +1153,7 @@ type BadControlError struct { NiceName string } -// Error read BadControl +// BadControlErrorNew constructs a BadControlError value that implements xgb.Error from a byte slice. func BadControlErrorNew(buf []byte) xgb.Error { v := BadControlError{} v.NiceName = "BadControl" @@ -1187,8 +1167,8 @@ func BadControlErrorNew(buf []byte) xgb.Error { return v } -func (err BadControlError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadBadControl error. +// This is mostly used internally. func (err BadControlError) SequenceId() uint16 { return err.Sequence } @@ -1208,35 +1188,37 @@ func init() { xgb.NewExtErrorFuncs["XVideo"][2] = BadControlErrorNew } -// Request QueryExtension -// size: 4 +// QueryExtensionCookie is a cookie used only for QueryExtension requests. type QueryExtensionCookie struct { *xgb.Cookie } +// QueryExtension sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn) QueryExtensionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionRequest(c), cookie) return QueryExtensionCookie{cookie} } +// QueryExtensionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionRequest(c), cookie) return QueryExtensionCookie{cookie} } -// Request reply for QueryExtension -// size: 12 +// QueryExtensionReply represents the data returned from a QueryExtension request. type QueryExtensionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Major uint16 Minor uint16 } -// Waits and reads reply data from request QueryExtension +// Reply blocks and returns the reply data for a QueryExtension request. func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1248,7 +1230,7 @@ func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { return queryExtensionReply(buf), nil } -// Read reply into structure from buffer for QueryExtension +// queryExtensionReply reads a byte slice into a QueryExtensionReply value. func queryExtensionReply(buf []byte) *QueryExtensionReply { v := new(QueryExtensionReply) b := 1 // skip reply determinant @@ -1271,6 +1253,7 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { } // Write request to wire for QueryExtension +// queryExtensionRequest writes a QueryExtension request to a byte slice. func queryExtensionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1288,36 +1271,38 @@ func queryExtensionRequest(c *xgb.Conn) []byte { return buf } -// Request QueryAdaptors -// size: 8 +// QueryAdaptorsCookie is a cookie used only for QueryAdaptors requests. type QueryAdaptorsCookie struct { *xgb.Cookie } +// QueryAdaptors sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryAdaptorsRequest(c, Window), cookie) return QueryAdaptorsCookie{cookie} } +// QueryAdaptorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryAdaptorsRequest(c, Window), cookie) return QueryAdaptorsCookie{cookie} } -// Request reply for QueryAdaptors -// size: (32 + AdaptorInfoListSize(Info)) +// QueryAdaptorsReply represents the data returned from a QueryAdaptors request. type QueryAdaptorsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAdaptors uint16 // padding: 22 bytes Info []AdaptorInfo // size: AdaptorInfoListSize(Info) } -// Waits and reads reply data from request QueryAdaptors +// Reply blocks and returns the reply data for a QueryAdaptors request. func (cook QueryAdaptorsCookie) Reply() (*QueryAdaptorsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1329,7 +1314,7 @@ func (cook QueryAdaptorsCookie) Reply() (*QueryAdaptorsReply, error) { return queryAdaptorsReply(buf), nil } -// Read reply into structure from buffer for QueryAdaptors +// queryAdaptorsReply reads a byte slice into a QueryAdaptorsReply value. func queryAdaptorsReply(buf []byte) *QueryAdaptorsReply { v := new(QueryAdaptorsReply) b := 1 // skip reply determinant @@ -1354,6 +1339,7 @@ func queryAdaptorsReply(buf []byte) *QueryAdaptorsReply { } // Write request to wire for QueryAdaptors +// queryAdaptorsRequest writes a QueryAdaptors request to a byte slice. func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1374,36 +1360,38 @@ func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request QueryEncodings -// size: 8 +// QueryEncodingsCookie is a cookie used only for QueryEncodings requests. type QueryEncodingsCookie struct { *xgb.Cookie } +// QueryEncodings sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryEncodingsRequest(c, Port), cookie) return QueryEncodingsCookie{cookie} } +// QueryEncodingsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryEncodingsRequest(c, Port), cookie) return QueryEncodingsCookie{cookie} } -// Request reply for QueryEncodings -// size: (32 + EncodingInfoListSize(Info)) +// QueryEncodingsReply represents the data returned from a QueryEncodings request. type QueryEncodingsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumEncodings uint16 // padding: 22 bytes Info []EncodingInfo // size: EncodingInfoListSize(Info) } -// Waits and reads reply data from request QueryEncodings +// Reply blocks and returns the reply data for a QueryEncodings request. func (cook QueryEncodingsCookie) Reply() (*QueryEncodingsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1415,7 +1403,7 @@ func (cook QueryEncodingsCookie) Reply() (*QueryEncodingsReply, error) { return queryEncodingsReply(buf), nil } -// Read reply into structure from buffer for QueryEncodings +// queryEncodingsReply reads a byte slice into a QueryEncodingsReply value. func queryEncodingsReply(buf []byte) *QueryEncodingsReply { v := new(QueryEncodingsReply) b := 1 // skip reply determinant @@ -1440,6 +1428,7 @@ func queryEncodingsReply(buf []byte) *QueryEncodingsReply { } // Write request to wire for QueryEncodings +// queryEncodingsRequest writes a QueryEncodings request to a byte slice. func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { size := 8 b := 0 @@ -1460,33 +1449,35 @@ func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { return buf } -// Request GrabPort -// size: 12 +// GrabPortCookie is a cookie used only for GrabPort requests. type GrabPortCookie struct { *xgb.Cookie } +// GrabPort sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabPortRequest(c, Port, Time), cookie) return GrabPortCookie{cookie} } +// GrabPortUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabPortRequest(c, Port, Time), cookie) return GrabPortCookie{cookie} } -// Request reply for GrabPort -// size: 8 +// GrabPortReply represents the data returned from a GrabPort request. type GrabPortReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Result byte } -// Waits and reads reply data from request GrabPort +// Reply blocks and returns the reply data for a GrabPort request. func (cook GrabPortCookie) Reply() (*GrabPortReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1498,7 +1489,7 @@ func (cook GrabPortCookie) Reply() (*GrabPortReply, error) { return grabPortReply(buf), nil } -// Read reply into structure from buffer for GrabPort +// grabPortReply reads a byte slice into a GrabPortReply value. func grabPortReply(buf []byte) *GrabPortReply { v := new(GrabPortReply) b := 1 // skip reply determinant @@ -1516,6 +1507,7 @@ func grabPortReply(buf []byte) *GrabPortReply { } // Write request to wire for GrabPort +// grabPortRequest writes a GrabPort request to a byte slice. func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { size := 12 b := 0 @@ -1539,30 +1531,35 @@ func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { return buf } -// Request UngrabPort -// size: 12 +// UngrabPortCookie is a cookie used only for UngrabPort requests. type UngrabPortCookie struct { *xgb.Cookie } -// Write request to wire for UngrabPort +// UngrabPort sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) return UngrabPortCookie{cookie} } +// UngrabPortChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabPortCookie.Check() func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) return UngrabPortCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook UngrabPortCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabPort +// ungrabPortRequest writes a UngrabPort request to a byte slice. func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { size := 12 b := 0 @@ -1586,30 +1583,35 @@ func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { return buf } -// Request PutVideo -// size: 32 +// PutVideoCookie is a cookie used only for PutVideo requests. type PutVideoCookie struct { *xgb.Cookie } -// Write request to wire for PutVideo +// PutVideo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { cookie := c.NewCookie(false, false) c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutVideoCookie{cookie} } +// PutVideoChecked sends a checked request. +// If an error occurs, it can be retrieved using PutVideoCookie.Check() func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { cookie := c.NewCookie(true, false) c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutVideoCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutVideoCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutVideo +// putVideoRequest writes a PutVideo request to a byte slice. func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 @@ -1660,30 +1662,35 @@ func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// Request PutStill -// size: 32 +// PutStillCookie is a cookie used only for PutStill requests. type PutStillCookie struct { *xgb.Cookie } -// Write request to wire for PutStill +// PutStill sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { cookie := c.NewCookie(false, false) c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutStillCookie{cookie} } +// PutStillChecked sends a checked request. +// If an error occurs, it can be retrieved using PutStillCookie.Check() func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { cookie := c.NewCookie(true, false) c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutStillCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutStillCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutStill +// putStillRequest writes a PutStill request to a byte slice. func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 @@ -1734,30 +1741,35 @@ func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// Request GetVideo -// size: 32 +// GetVideoCookie is a cookie used only for GetVideo requests. type GetVideoCookie struct { *xgb.Cookie } -// Write request to wire for GetVideo +// GetVideo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { cookie := c.NewCookie(false, false) c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetVideoCookie{cookie} } +// GetVideoChecked sends a checked request. +// If an error occurs, it can be retrieved using GetVideoCookie.Check() func GetVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { cookie := c.NewCookie(true, false) c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetVideoCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GetVideoCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GetVideo +// getVideoRequest writes a GetVideo request to a byte slice. func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 @@ -1808,30 +1820,35 @@ func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// Request GetStill -// size: 32 +// GetStillCookie is a cookie used only for GetStill requests. type GetStillCookie struct { *xgb.Cookie } -// Write request to wire for GetStill +// GetStill sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { cookie := c.NewCookie(false, false) c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetStillCookie{cookie} } +// GetStillChecked sends a checked request. +// If an error occurs, it can be retrieved using GetStillCookie.Check() func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { cookie := c.NewCookie(true, false) c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetStillCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook GetStillCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GetStill +// getStillRequest writes a GetStill request to a byte slice. func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 @@ -1882,30 +1899,35 @@ func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// Request StopVideo -// size: 12 +// StopVideoCookie is a cookie used only for StopVideo requests. type StopVideoCookie struct { *xgb.Cookie } -// Write request to wire for StopVideo +// StopVideo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { cookie := c.NewCookie(false, false) c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) return StopVideoCookie{cookie} } +// StopVideoChecked sends a checked request. +// If an error occurs, it can be retrieved using StopVideoCookie.Check() func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { cookie := c.NewCookie(true, false) c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) return StopVideoCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook StopVideoCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for StopVideo +// stopVideoRequest writes a StopVideo request to a byte slice. func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { size := 12 b := 0 @@ -1929,30 +1951,35 @@ func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { return buf } -// Request SelectVideoNotify -// size: 12 +// SelectVideoNotifyCookie is a cookie used only for SelectVideoNotify requests. type SelectVideoNotifyCookie struct { *xgb.Cookie } -// Write request to wire for SelectVideoNotify +// SelectVideoNotify sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) return SelectVideoNotifyCookie{cookie} } +// SelectVideoNotifyChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) return SelectVideoNotifyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectVideoNotifyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectVideoNotify +// selectVideoNotifyRequest writes a SelectVideoNotify request to a byte slice. func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) []byte { size := 12 b := 0 @@ -1982,30 +2009,35 @@ func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) return buf } -// Request SelectPortNotify -// size: 12 +// SelectPortNotifyCookie is a cookie used only for SelectPortNotify requests. type SelectPortNotifyCookie struct { *xgb.Cookie } -// Write request to wire for SelectPortNotify +// SelectPortNotify sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) return SelectPortNotifyCookie{cookie} } +// SelectPortNotifyChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) return SelectPortNotifyCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SelectPortNotifyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectPortNotify +// selectPortNotifyRequest writes a SelectPortNotify request to a byte slice. func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { size := 12 b := 0 @@ -2035,35 +2067,37 @@ func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { return buf } -// Request QueryBestSize -// size: 20 +// QueryBestSizeCookie is a cookie used only for QueryBestSize requests. type QueryBestSizeCookie struct { *xgb.Cookie } +// QueryBestSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return QueryBestSizeCookie{cookie} } +// QueryBestSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return QueryBestSizeCookie{cookie} } -// Request reply for QueryBestSize -// size: 12 +// QueryBestSizeReply represents the data returned from a QueryBestSize request. type QueryBestSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ActualWidth uint16 ActualHeight uint16 } -// Waits and reads reply data from request QueryBestSize +// Reply blocks and returns the reply data for a QueryBestSize request. func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2075,7 +2109,7 @@ func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { return queryBestSizeReply(buf), nil } -// Read reply into structure from buffer for QueryBestSize +// queryBestSizeReply reads a byte slice into a QueryBestSizeReply value. func queryBestSizeReply(buf []byte) *QueryBestSizeReply { v := new(QueryBestSizeReply) b := 1 // skip reply determinant @@ -2098,6 +2132,7 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { } // Write request to wire for QueryBestSize +// queryBestSizeRequest writes a QueryBestSize request to a byte slice. func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) []byte { size := 20 b := 0 @@ -2139,30 +2174,35 @@ func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW return buf } -// Request SetPortAttribute -// size: 16 +// SetPortAttributeCookie is a cookie used only for SetPortAttribute requests. type SetPortAttributeCookie struct { *xgb.Cookie } -// Write request to wire for SetPortAttribute +// SetPortAttribute sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) return SetPortAttributeCookie{cookie} } +// SetPortAttributeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) return SetPortAttributeCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook SetPortAttributeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPortAttribute +// setPortAttributeRequest writes a SetPortAttribute request to a byte slice. func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) []byte { size := 16 b := 0 @@ -2189,34 +2229,36 @@ func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Valu return buf } -// Request GetPortAttribute -// size: 12 +// GetPortAttributeCookie is a cookie used only for GetPortAttribute requests. type GetPortAttributeCookie struct { *xgb.Cookie } +// GetPortAttribute sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) return GetPortAttributeCookie{cookie} } +// GetPortAttributeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) return GetPortAttributeCookie{cookie} } -// Request reply for GetPortAttribute -// size: 12 +// GetPortAttributeReply represents the data returned from a GetPortAttribute request. type GetPortAttributeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Value int32 } -// Waits and reads reply data from request GetPortAttribute +// Reply blocks and returns the reply data for a GetPortAttribute request. func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2228,7 +2270,7 @@ func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { return getPortAttributeReply(buf), nil } -// Read reply into structure from buffer for GetPortAttribute +// getPortAttributeReply reads a byte slice into a GetPortAttributeReply value. func getPortAttributeReply(buf []byte) *GetPortAttributeReply { v := new(GetPortAttributeReply) b := 1 // skip reply determinant @@ -2248,6 +2290,7 @@ func getPortAttributeReply(buf []byte) *GetPortAttributeReply { } // Write request to wire for GetPortAttribute +// getPortAttributeRequest writes a GetPortAttribute request to a byte slice. func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []byte { size := 12 b := 0 @@ -2271,29 +2314,31 @@ func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []by return buf } -// Request QueryPortAttributes -// size: 8 +// QueryPortAttributesCookie is a cookie used only for QueryPortAttributes requests. type QueryPortAttributesCookie struct { *xgb.Cookie } +// QueryPortAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryPortAttributesRequest(c, Port), cookie) return QueryPortAttributesCookie{cookie} } +// QueryPortAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryPortAttributesRequest(c, Port), cookie) return QueryPortAttributesCookie{cookie} } -// Request reply for QueryPortAttributes -// size: (32 + AttributeInfoListSize(Attributes)) +// QueryPortAttributesReply represents the data returned from a QueryPortAttributes request. type QueryPortAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumAttributes uint32 TextSize uint32 @@ -2301,7 +2346,7 @@ type QueryPortAttributesReply struct { Attributes []AttributeInfo // size: AttributeInfoListSize(Attributes) } -// Waits and reads reply data from request QueryPortAttributes +// Reply blocks and returns the reply data for a QueryPortAttributes request. func (cook QueryPortAttributesCookie) Reply() (*QueryPortAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2313,7 +2358,7 @@ func (cook QueryPortAttributesCookie) Reply() (*QueryPortAttributesReply, error) return queryPortAttributesReply(buf), nil } -// Read reply into structure from buffer for QueryPortAttributes +// queryPortAttributesReply reads a byte slice into a QueryPortAttributesReply value. func queryPortAttributesReply(buf []byte) *QueryPortAttributesReply { v := new(QueryPortAttributesReply) b := 1 // skip reply determinant @@ -2341,6 +2386,7 @@ func queryPortAttributesReply(buf []byte) *QueryPortAttributesReply { } // Write request to wire for QueryPortAttributes +// queryPortAttributesRequest writes a QueryPortAttributes request to a byte slice. func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { size := 8 b := 0 @@ -2361,36 +2407,38 @@ func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { return buf } -// Request ListImageFormats -// size: 8 +// ListImageFormatsCookie is a cookie used only for ListImageFormats requests. type ListImageFormatsCookie struct { *xgb.Cookie } +// ListImageFormats sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listImageFormatsRequest(c, Port), cookie) return ListImageFormatsCookie{cookie} } +// ListImageFormatsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listImageFormatsRequest(c, Port), cookie) return ListImageFormatsCookie{cookie} } -// Request reply for ListImageFormats -// size: (32 + ImageFormatInfoListSize(Format)) +// ListImageFormatsReply represents the data returned from a ListImageFormats request. type ListImageFormatsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumFormats uint32 // padding: 20 bytes Format []ImageFormatInfo // size: ImageFormatInfoListSize(Format) } -// Waits and reads reply data from request ListImageFormats +// Reply blocks and returns the reply data for a ListImageFormats request. func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2402,7 +2450,7 @@ func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { return listImageFormatsReply(buf), nil } -// Read reply into structure from buffer for ListImageFormats +// listImageFormatsReply reads a byte slice into a ListImageFormatsReply value. func listImageFormatsReply(buf []byte) *ListImageFormatsReply { v := new(ListImageFormatsReply) b := 1 // skip reply determinant @@ -2427,6 +2475,7 @@ func listImageFormatsReply(buf []byte) *ListImageFormatsReply { } // Write request to wire for ListImageFormats +// listImageFormatsRequest writes a ListImageFormats request to a byte slice. func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { size := 8 b := 0 @@ -2447,29 +2496,31 @@ func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { return buf } -// Request QueryImageAttributes -// size: 16 +// QueryImageAttributesCookie is a cookie used only for QueryImageAttributes requests. type QueryImageAttributesCookie struct { *xgb.Cookie } +// QueryImageAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryImageAttributesCookie.Reply() func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) return QueryImageAttributesCookie{cookie} } +// QueryImageAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryImageAttributesUnchecked(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) return QueryImageAttributesCookie{cookie} } -// Request reply for QueryImageAttributes -// size: ((32 + xgb.Pad((int(NumPlanes) * 4))) + xgb.Pad((int(NumPlanes) * 4))) +// QueryImageAttributesReply represents the data returned from a QueryImageAttributes request. type QueryImageAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes NumPlanes uint32 DataSize uint32 @@ -2480,7 +2531,7 @@ type QueryImageAttributesReply struct { Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) } -// Waits and reads reply data from request QueryImageAttributes +// Reply blocks and returns the reply data for a QueryImageAttributes request. func (cook QueryImageAttributesCookie) Reply() (*QueryImageAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -2492,7 +2543,7 @@ func (cook QueryImageAttributesCookie) Reply() (*QueryImageAttributesReply, erro return queryImageAttributesReply(buf), nil } -// Read reply into structure from buffer for QueryImageAttributes +// queryImageAttributesReply reads a byte slice into a QueryImageAttributesReply value. func queryImageAttributesReply(buf []byte) *QueryImageAttributesReply { v := new(QueryImageAttributesReply) b := 1 // skip reply determinant @@ -2537,6 +2588,7 @@ func queryImageAttributesReply(buf []byte) *QueryImageAttributesReply { } // Write request to wire for QueryImageAttributes +// queryImageAttributesRequest writes a QueryImageAttributes request to a byte slice. func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) []byte { size := 16 b := 0 @@ -2566,30 +2618,35 @@ func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16 return buf } -// Request PutImage -// size: xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) +// PutImageCookie is a cookie used only for PutImage requests. type PutImageCookie struct { *xgb.Cookie } -// Write request to wire for PutImage +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return PutImageCookie{cookie} } +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return PutImageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { size := xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -2652,30 +2709,35 @@ func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// Request ShmPutImage -// size: 52 +// ShmPutImageCookie is a cookie used only for ShmPutImage requests. type ShmPutImageCookie struct { *xgb.Cookie } -// Write request to wire for ShmPutImage +// ShmPutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { cookie := c.NewCookie(false, false) c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return ShmPutImageCookie{cookie} } +// ShmPutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using ShmPutImageCookie.Check() func ShmPutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { cookie := c.NewCookie(true, false) c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return ShmPutImageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook ShmPutImageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ShmPutImage +// shmPutImageRequest writes a ShmPutImage request to a byte slice. func shmPutImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) []byte { size := 52 b := 0 diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 60fcb2e..dc9c220 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on May 10 2012 8:04:33pm EDT. + This file was generated by xvmc.xml on May 10 2012 11:56:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,16 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -55,16 +65,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { @@ -95,8 +95,6 @@ func NewSubpictureId(c *xgb.Conn) (Subpicture, error) { return Subpicture(id), nil } -// 'SurfaceInfo' struct definition -// Size: 24 type SurfaceInfo struct { Id Surface ChromaFormat uint16 @@ -109,7 +107,7 @@ type SurfaceInfo struct { Flags uint32 } -// Struct read SurfaceInfo +// SurfaceInfoRead reads a byte slice into a SurfaceInfo value. func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int { b := 0 @@ -143,7 +141,7 @@ func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int { return b } -// Struct list read SurfaceInfo +// SurfaceInfoReadList reads a byte slice into a list of SurfaceInfo values. func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -153,7 +151,7 @@ func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int { return xgb.Pad(b) } -// Struct write SurfaceInfo +// Bytes writes a SurfaceInfo value to a byte slice. func (v SurfaceInfo) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -188,7 +186,7 @@ func (v SurfaceInfo) Bytes() []byte { return buf } -// Write struct list SurfaceInfo +// SurfaceInfoListBytes writes a list of %s(MISSING) values to a byte slice. func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { b := 0 var structBytes []byte @@ -200,35 +198,37 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { return b } -// Request QueryVersion -// size: 4 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 16 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Major uint32 Minor uint32 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -240,7 +240,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -263,6 +263,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -280,36 +281,38 @@ func queryVersionRequest(c *xgb.Conn) []byte { return buf } -// Request ListSurfaceTypes -// size: 8 +// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests. type ListSurfaceTypesCookie struct { *xgb.Cookie } +// ListSurfaceTypes sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) return ListSurfaceTypesCookie{cookie} } +// ListSurfaceTypesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) return ListSurfaceTypesCookie{cookie} } -// Request reply for ListSurfaceTypes -// size: (32 + xgb.Pad((int(Num) * 24))) +// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request. type ListSurfaceTypesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Num uint32 // padding: 20 bytes Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24)) } -// Waits and reads reply data from request ListSurfaceTypes +// Reply blocks and returns the reply data for a ListSurfaceTypes request. func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -321,7 +324,7 @@ func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) { return listSurfaceTypesReply(buf), nil } -// Read reply into structure from buffer for ListSurfaceTypes +// listSurfaceTypesReply reads a byte slice into a ListSurfaceTypesReply value. func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply { v := new(ListSurfaceTypesReply) b := 1 // skip reply determinant @@ -346,6 +349,7 @@ func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply { } // Write request to wire for ListSurfaceTypes +// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice. func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { size := 8 b := 0 @@ -366,29 +370,31 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { return buf } -// Request CreateContext -// size: 24 +// CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie } +// CreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return CreateContextCookie{cookie} } +// CreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return CreateContextCookie{cookie} } -// Request reply for CreateContext -// size: (36 + xgb.Pad((int(Length) * 4))) +// CreateContextReply represents the data returned from a CreateContext request. type CreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes WidthActual uint16 HeightActual uint16 @@ -397,7 +403,7 @@ type CreateContextReply struct { PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request CreateContext +// Reply blocks and returns the reply data for a CreateContext request. func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -409,7 +415,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { return createContextReply(buf), nil } -// Read reply into structure from buffer for CreateContext +// createContextReply reads a byte slice into a CreateContextReply value. func createContextReply(buf []byte) *CreateContextReply { v := new(CreateContextReply) b := 1 // skip reply determinant @@ -444,6 +450,7 @@ func createContextReply(buf []byte) *CreateContextReply { } // Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) []byte { size := 24 b := 0 @@ -479,30 +486,35 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac return buf } -// Request DestroyContext -// size: 8 +// DestroyContextCookie is a cookie used only for DestroyContext requests. type DestroyContextCookie struct { *xgb.Cookie } -// Write request to wire for DestroyContext +// DestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, ContextId), cookie) return DestroyContextCookie{cookie} } +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, ContextId), cookie) return DestroyContextCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroyContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { size := 8 b := 0 @@ -523,35 +535,37 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { return buf } -// Request CreateSurface -// size: 12 +// CreateSurfaceCookie is a cookie used only for CreateSurface requests. type CreateSurfaceCookie struct { *xgb.Cookie } +// CreateSurface sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { cookie := c.NewCookie(true, true) c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) return CreateSurfaceCookie{cookie} } +// CreateSurfaceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { cookie := c.NewCookie(false, true) c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) return CreateSurfaceCookie{cookie} } -// Request reply for CreateSurface -// size: (32 + xgb.Pad((int(Length) * 4))) +// CreateSurfaceReply represents the data returned from a CreateSurface request. type CreateSurfaceReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request CreateSurface +// Reply blocks and returns the reply data for a CreateSurface request. func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -563,7 +577,7 @@ func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) { return createSurfaceReply(buf), nil } -// Read reply into structure from buffer for CreateSurface +// createSurfaceReply reads a byte slice into a CreateSurfaceReply value. func createSurfaceReply(buf []byte) *CreateSurfaceReply { v := new(CreateSurfaceReply) b := 1 // skip reply determinant @@ -589,6 +603,7 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply { } // Write request to wire for CreateSurface +// createSurfaceRequest writes a CreateSurface request to a byte slice. func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte { size := 12 b := 0 @@ -612,30 +627,35 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b return buf } -// Request DestroySurface -// size: 8 +// DestroySurfaceCookie is a cookie used only for DestroySurface requests. type DestroySurfaceCookie struct { *xgb.Cookie } -// Write request to wire for DestroySurface +// DestroySurface sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) return DestroySurfaceCookie{cookie} } +// DestroySurfaceChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) return DestroySurfaceCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroySurfaceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroySurface +// destroySurfaceRequest writes a DestroySurface request to a byte slice. func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { size := 8 b := 0 @@ -656,29 +676,31 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { return buf } -// Request CreateSubpicture -// size: 20 +// CreateSubpictureCookie is a cookie used only for CreateSubpicture requests. type CreateSubpictureCookie struct { *xgb.Cookie } +// CreateSubpicture sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply() func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { cookie := c.NewCookie(true, true) c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) return CreateSubpictureCookie{cookie} } +// CreateSubpictureUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { cookie := c.NewCookie(false, true) c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) return CreateSubpictureCookie{cookie} } -// Request reply for CreateSubpicture -// size: (32 + xgb.Pad((int(Length) * 4))) +// CreateSubpictureReply represents the data returned from a CreateSubpicture request. type CreateSubpictureReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes WidthActual uint16 HeightActual uint16 @@ -689,7 +711,7 @@ type CreateSubpictureReply struct { PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request CreateSubpicture +// Reply blocks and returns the reply data for a CreateSubpicture request. func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -701,7 +723,7 @@ func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) { return createSubpictureReply(buf), nil } -// Read reply into structure from buffer for CreateSubpicture +// createSubpictureReply reads a byte slice into a CreateSubpictureReply value. func createSubpictureReply(buf []byte) *CreateSubpictureReply { v := new(CreateSubpictureReply) b := 1 // skip reply determinant @@ -743,6 +765,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply { } // Write request to wire for CreateSubpicture +// createSubpictureRequest writes a CreateSubpicture request to a byte slice. func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) []byte { size := 20 b := 0 @@ -775,30 +798,35 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte return buf } -// Request DestroySubpicture -// size: 8 +// DestroySubpictureCookie is a cookie used only for DestroySubpicture requests. type DestroySubpictureCookie struct { *xgb.Cookie } -// Write request to wire for DestroySubpicture +// DestroySubpicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) return DestroySubpictureCookie{cookie} } +// DestroySubpictureChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySubpictureCookie.Check() func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) return DestroySubpictureCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook DestroySubpictureCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroySubpicture +// destroySubpictureRequest writes a DestroySubpicture request to a byte slice. func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { size := 8 b := 0 @@ -819,36 +847,38 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { return buf } -// Request ListSubpictureTypes -// size: 12 +// ListSubpictureTypesCookie is a cookie used only for ListSubpictureTypes requests. type ListSubpictureTypesCookie struct { *xgb.Cookie } +// ListSubpictureTypes sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply() func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) return ListSubpictureTypesCookie{cookie} } +// ListSubpictureTypesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) return ListSubpictureTypesCookie{cookie} } -// Request reply for ListSubpictureTypes -// size: (32 + xv.ImageFormatInfoListSize(Types)) +// ListSubpictureTypesReply represents the data returned from a ListSubpictureTypes request. type ListSubpictureTypesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Num uint32 // padding: 20 bytes Types []xv.ImageFormatInfo // size: xv.ImageFormatInfoListSize(Types) } -// Waits and reads reply data from request ListSubpictureTypes +// Reply blocks and returns the reply data for a ListSubpictureTypes request. func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -860,7 +890,7 @@ func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) return listSubpictureTypesReply(buf), nil } -// Read reply into structure from buffer for ListSubpictureTypes +// listSubpictureTypesReply reads a byte slice into a ListSubpictureTypesReply value. func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply { v := new(ListSubpictureTypesReply) b := 1 // skip reply determinant @@ -885,6 +915,7 @@ func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply { } // Write request to wire for ListSubpictureTypes +// listSubpictureTypesRequest writes a ListSubpictureTypes request to a byte slice. func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) []byte { size := 12 b := 0 From 3e6b3544934cb71e3a3b0edf9bc184241ac1ad7f Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Fri, 11 May 2012 01:58:52 -0400 Subject: [PATCH 37/90] add a little more docs for errors --- nexgb/bigreq/bigreq.go | 6 ++--- nexgb/composite/composite.go | 6 ++--- nexgb/damage/damage.go | 21 +++++++++------- nexgb/dpms/dpms.go | 22 ++++++++-------- nexgb/dri2/dri2.go | 18 ++++++------- nexgb/ge/ge.go | 10 ++++---- nexgb/glx/glx.go | 41 ++++++++++++++++++++++++++---- nexgb/randr/randr.go | 11 +++++++- nexgb/record/record.go | 5 +++- nexgb/render/render.go | 41 ++++++++++++++++++++---------- nexgb/res/res.go | 2 +- nexgb/screensaver/screensaver.go | 22 ++++++++-------- nexgb/shape/shape.go | 10 ++++---- nexgb/shm/shm.go | 16 ++++++------ nexgb/sync/sync.go | 8 +++++- nexgb/xcmisc/xcmisc.go | 2 +- nexgb/xevie/xevie.go | 10 ++++---- nexgb/xf86dri/xf86dri.go | 6 ++--- nexgb/xf86vidmode/xf86vidmode.go | 43 ++++++++++++++++++++++++-------- nexgb/xfixes/xfixes.go | 21 +++++++++------- nexgb/xgbgen/go_error.go | 8 ++++++ nexgb/xinerama/xinerama.go | 18 ++++++------- nexgb/xinput/xinput.go | 21 +++++++++++++--- nexgb/xprint/xprint.go | 32 ++++++++++++++---------- nexgb/xproto/xproto.go | 42 ++++++++++++++++++++++++++++--- nexgb/xselinux/xselinux.go | 6 ++--- nexgb/xtest/xtest.go | 22 ++++++++-------- nexgb/xv/xv.go | 19 ++++++++++---- nexgb/xvmc/xvmc.go | 6 ++--- 29 files changed, 331 insertions(+), 164 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index 3913c5f..32dacba 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on May 10 2012 11:56:18pm EDT. + This file was generated by bigreq.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + // EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index be56807..4217736 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on May 10 2012 11:56:18pm EDT. + This file was generated by composite.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,8 +41,6 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -65,6 +63,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + const ( RedirectAutomatic = 0 RedirectManual = 1 diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 1c17501..a3ba928 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on May 10 2012 11:56:18pm EDT. + This file was generated by damage.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,14 +41,6 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -65,6 +57,14 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 @@ -212,10 +212,13 @@ func (err BadDamageError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadDamage error. If no bad value exists, 0 is returned. func (err BadDamageError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadDamage error. + func (err BadDamageError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index e3e095a..8ffb2ee 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on May 10 2012 11:56:18pm EDT. + This file was generated by dpms.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( DPMSModeOn = 0 DPMSModeStandby = 1 diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index b6398e1..deffdb6 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on May 10 2012 11:56:18pm EDT. + This file was generated by dri2.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 21fdb4b..42a60ea 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on May 10 2012 11:56:18pm EDT. + This file was generated by ge.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index d351137..6bc3615 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on May 10 2012 11:56:18pm EDT. + This file was generated by glx.xml on May 11 2012 1:58:35am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - const ( PbcetDamaged = 32791 PbcetSaved = 32792 @@ -355,10 +355,13 @@ func (err GenericError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadGeneric error. If no bad value exists, 0 is returned. func (err GenericError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadGeneric error. + func (err GenericError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -391,10 +394,12 @@ func (err BadContextError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. func (err BadContextError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadContext error. func (err BadContextError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -427,10 +432,12 @@ func (err BadContextStateError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadContextState error. If no bad value exists, 0 is returned. func (err BadContextStateError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadContextState error. func (err BadContextStateError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -463,10 +470,12 @@ func (err BadDrawableError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadDrawable error. If no bad value exists, 0 is returned. func (err BadDrawableError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadDrawable error. func (err BadDrawableError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -499,10 +508,12 @@ func (err BadPixmapError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadPixmap error. If no bad value exists, 0 is returned. func (err BadPixmapError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadPixmap error. func (err BadPixmapError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -535,10 +546,12 @@ func (err BadContextTagError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadContextTag error. If no bad value exists, 0 is returned. func (err BadContextTagError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadContextTag error. func (err BadContextTagError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -571,10 +584,12 @@ func (err BadCurrentWindowError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadCurrentWindow error. If no bad value exists, 0 is returned. func (err BadCurrentWindowError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadCurrentWindow error. func (err BadCurrentWindowError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -607,10 +622,12 @@ func (err BadRenderRequestError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadRenderRequest error. If no bad value exists, 0 is returned. func (err BadRenderRequestError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadRenderRequest error. func (err BadRenderRequestError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -643,10 +660,12 @@ func (err BadLargeRequestError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadLargeRequest error. If no bad value exists, 0 is returned. func (err BadLargeRequestError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadLargeRequest error. func (err BadLargeRequestError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -679,10 +698,12 @@ func (err UnsupportedPrivateRequestError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadUnsupportedPrivateRequest error. If no bad value exists, 0 is returned. func (err UnsupportedPrivateRequestError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadUnsupportedPrivateRequest error. func (err UnsupportedPrivateRequestError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -715,10 +736,12 @@ func (err BadFBConfigError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadFBConfig error. If no bad value exists, 0 is returned. func (err BadFBConfigError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadFBConfig error. func (err BadFBConfigError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -751,10 +774,12 @@ func (err BadPbufferError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadPbuffer error. If no bad value exists, 0 is returned. func (err BadPbufferError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadPbuffer error. func (err BadPbufferError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -787,10 +812,12 @@ func (err BadCurrentDrawableError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadCurrentDrawable error. If no bad value exists, 0 is returned. func (err BadCurrentDrawableError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadCurrentDrawable error. func (err BadCurrentDrawableError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -823,10 +850,12 @@ func (err BadWindowError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadWindow error. If no bad value exists, 0 is returned. func (err BadWindowError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadWindow error. func (err BadWindowError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -859,10 +888,12 @@ func (err GLXBadProfileARBError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadGLXBadProfileARB error. If no bad value exists, 0 is returned. func (err GLXBadProfileARBError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadGLXBadProfileARB error. func (err GLXBadProfileARBError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 35de3bf..83e7035 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on May 10 2012 11:56:19pm EDT. + This file was generated by randr.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -1103,10 +1103,13 @@ func (err BadOutputError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadOutput error. If no bad value exists, 0 is returned. func (err BadOutputError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadOutput error. + func (err BadOutputError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1146,10 +1149,13 @@ func (err BadCrtcError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadCrtc error. If no bad value exists, 0 is returned. func (err BadCrtcError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadCrtc error. + func (err BadCrtcError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1189,10 +1195,13 @@ func (err BadModeError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadMode error. If no bad value exists, 0 is returned. func (err BadModeError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadMode error. + func (err BadModeError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 28b268e..5623e50 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on May 10 2012 11:56:19pm EDT. + This file was generated by record.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -499,10 +499,13 @@ func (err BadContextError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. func (err BadContextError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadContext error. + func (err BadContextError) Error() string { fieldVals := make([]string, 0, 1) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 61f0b96..65b0723 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on May 10 2012 11:56:19pm EDT. + This file was generated by render.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + const ( PictTypeIndexed = 0 PictTypeDirect = 1 @@ -1375,10 +1375,13 @@ func (err PictFormatError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadPictFormat error. If no bad value exists, 0 is returned. func (err PictFormatError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadPictFormat error. + func (err PictFormatError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1418,10 +1421,13 @@ func (err PictureError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadPicture error. If no bad value exists, 0 is returned. func (err PictureError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadPicture error. + func (err PictureError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1461,10 +1467,13 @@ func (err PictOpError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadPictOp error. If no bad value exists, 0 is returned. func (err PictOpError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadPictOp error. + func (err PictOpError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1504,10 +1513,13 @@ func (err GlyphSetError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadGlyphSet error. If no bad value exists, 0 is returned. func (err GlyphSetError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadGlyphSet error. + func (err GlyphSetError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1547,10 +1559,13 @@ func (err GlyphError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadGlyph error. If no bad value exists, 0 is returned. func (err GlyphError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadGlyph error. + func (err GlyphError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/res/res.go b/nexgb/res/res.go index ccc6192..56f4691 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on May 10 2012 11:56:19pm EDT. + This file was generated by res.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index 0b6ef23..932e753 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on May 10 2012 11:56:19pm EDT. + This file was generated by screensaver.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Char' +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + const ( KindBlanked = 0 KindInternal = 1 diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 664c5f4..8989000 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on May 10 2012 11:56:19pm EDT. + This file was generated by shape.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( SoSet = 0 SoUnion = 1 diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index b24be97..6ae886d 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on May 10 2012 11:56:19pm EDT. + This file was generated by shm.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + type Seg uint32 func NewSegId(c *xgb.Conn) (Seg, error) { @@ -192,10 +192,12 @@ func (err BadSegError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadSeg error. If no bad value exists, 0 is returned. func (err BadSegError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadSeg error. func (err BadSegError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 7a32bc4..1904963 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on May 10 2012 11:56:19pm EDT. + This file was generated by sync.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -660,10 +660,13 @@ func (err CounterError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadCounter error. If no bad value exists, 0 is returned. func (err CounterError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadCounter error. + func (err CounterError) Error() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -718,10 +721,13 @@ func (err AlarmError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadAlarm error. If no bad value exists, 0 is returned. func (err AlarmError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadAlarm error. + func (err AlarmError) Error() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 5157119..7171969 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xc_misc.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 3076680..ef02e2c 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xevie.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( DatatypeUnmodified = 0 DatatypeModified = 1 diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index cd3ff35..1d7dd72 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xf86dri.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - type DrmClipRect struct { X1 int16 Y1 int16 diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 15daeb2..01f271c 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xf86vidmode.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( ModeFlagPositiveHsync = 1 ModeFlagNegativeHsync = 2 @@ -255,10 +255,13 @@ func (err BadClockError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadClock error. If no bad value exists, 0 is returned. func (err BadClockError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadClock error. + func (err BadClockError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -298,10 +301,13 @@ func (err BadHTimingsError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadHTimings error. If no bad value exists, 0 is returned. func (err BadHTimingsError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadHTimings error. + func (err BadHTimingsError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -341,10 +347,13 @@ func (err BadVTimingsError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadVTimings error. If no bad value exists, 0 is returned. func (err BadVTimingsError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadVTimings error. + func (err BadVTimingsError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -384,10 +393,13 @@ func (err ModeUnsuitableError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadModeUnsuitable error. If no bad value exists, 0 is returned. func (err ModeUnsuitableError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadModeUnsuitable error. + func (err ModeUnsuitableError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -427,10 +439,13 @@ func (err ExtensionDisabledError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadExtensionDisabled error. If no bad value exists, 0 is returned. func (err ExtensionDisabledError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadExtensionDisabled error. + func (err ExtensionDisabledError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -470,10 +485,13 @@ func (err ClientNotLocalError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadClientNotLocal error. If no bad value exists, 0 is returned. func (err ClientNotLocalError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadClientNotLocal error. + func (err ClientNotLocalError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -513,10 +531,13 @@ func (err ZoomLockedError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadZoomLocked error. If no bad value exists, 0 is returned. func (err ZoomLockedError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadZoomLocked error. + func (err ZoomLockedError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index b5d9c14..67dff6a 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xfixes.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -42,6 +42,14 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -58,14 +66,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 @@ -341,10 +341,13 @@ func (err BadRegionError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadRegion error. If no bad value exists, 0 is returned. func (err BadRegionError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadRegion error. + func (err BadRegionError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index 81a017b..55fd28b 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -68,6 +68,8 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") + c.Putln("// BadId returns the 'BadValue' number if one exists for the "+ + "%s error. If no bad value exists, 0 is returned.", e.ErrConst()) c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) if !c.protocol.isExt() { c.Putln("return err.BadValue") @@ -75,6 +77,8 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("return 0") } c.Putln("}") + c.Putln("// Error returns a rudimentary string representation of the %s "+ + "error.", e.ErrConst()) c.Putln("") c.Putln("func (err %s) Error() string {", e.ErrType()) ErrorFieldString(c, e.Fields, e.ErrConst()) @@ -130,6 +134,8 @@ func (e *ErrorCopy) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") + c.Putln("// BadId returns the 'BadValue' number if one exists for the "+ + "%s error. If no bad value exists, 0 is returned.", e.ErrConst()) c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) if !c.protocol.isExt() { c.Putln("return err.BadValue") @@ -138,6 +144,8 @@ func (e *ErrorCopy) ImplementsError(c *Context) { } c.Putln("}") c.Putln("") + c.Putln("// Error returns a rudimentary string representation of the %s "+ + "error.", e.ErrConst()) c.Putln("func (err %s) Error() string {", e.ErrType()) ErrorFieldString(c, e.Old.(*Error).Fields, e.ErrConst()) c.Putln("}") diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index cc4eaaa..b03a381 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xinerama.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + type ScreenInfo struct { XOrg int16 YOrg int16 diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 2c2247c..0cb711b 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xinput.xml on May 11 2012 1:58:36am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 @@ -4372,10 +4372,13 @@ func (err DeviceError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadDevice error. If no bad value exists, 0 is returned. func (err DeviceError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadDevice error. + func (err DeviceError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -4415,10 +4418,13 @@ func (err EventError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadEvent error. If no bad value exists, 0 is returned. func (err EventError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadEvent error. + func (err EventError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -4458,10 +4464,13 @@ func (err ModeError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadMode error. If no bad value exists, 0 is returned. func (err ModeError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadMode error. + func (err ModeError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -4501,10 +4510,13 @@ func (err DeviceBusyError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadDeviceBusy error. If no bad value exists, 0 is returned. func (err DeviceBusyError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadDeviceBusy error. + func (err DeviceBusyError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -4544,10 +4556,13 @@ func (err ClassError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadClass error. If no bad value exists, 0 is returned. func (err ClassError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadClass error. + func (err ClassError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 237b6b5..9f4bd6b 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xprint.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( GetDocFinished = 0 GetDocSecondConsumer = 1 @@ -373,10 +373,13 @@ func (err BadContextError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. func (err BadContextError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadContext error. + func (err BadContextError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -416,10 +419,13 @@ func (err BadSequenceError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadSequence error. If no bad value exists, 0 is returned. func (err BadSequenceError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadSequence error. + func (err BadSequenceError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 6b0fb6b..5378196 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 10 2012 11:56:19pm EDT. + This file was generated by xproto.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -23,8 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -47,6 +45,8 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -5749,10 +5749,13 @@ func (err RequestError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadRequest error. If no bad value exists, 0 is returned. func (err RequestError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadRequest error. + func (err RequestError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5810,10 +5813,13 @@ func (err ValueError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadValue error. If no bad value exists, 0 is returned. func (err ValueError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadValue error. + func (err ValueError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5846,10 +5852,12 @@ func (err WindowError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadWindow error. If no bad value exists, 0 is returned. func (err WindowError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadWindow error. func (err WindowError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5882,10 +5890,12 @@ func (err PixmapError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadPixmap error. If no bad value exists, 0 is returned. func (err PixmapError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadPixmap error. func (err PixmapError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5918,10 +5928,12 @@ func (err AtomError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadAtom error. If no bad value exists, 0 is returned. func (err AtomError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadAtom error. func (err AtomError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5954,10 +5966,12 @@ func (err CursorError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadCursor error. If no bad value exists, 0 is returned. func (err CursorError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadCursor error. func (err CursorError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -5990,10 +6004,12 @@ func (err FontError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadFont error. If no bad value exists, 0 is returned. func (err FontError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadFont error. func (err FontError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6026,10 +6042,12 @@ func (err MatchError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadMatch error. If no bad value exists, 0 is returned. func (err MatchError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadMatch error. func (err MatchError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6062,10 +6080,12 @@ func (err DrawableError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadDrawable error. If no bad value exists, 0 is returned. func (err DrawableError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadDrawable error. func (err DrawableError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6098,10 +6118,12 @@ func (err AccessError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadAccess error. If no bad value exists, 0 is returned. func (err AccessError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadAccess error. func (err AccessError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6134,10 +6156,12 @@ func (err AllocError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadAlloc error. If no bad value exists, 0 is returned. func (err AllocError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadAlloc error. func (err AllocError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6170,10 +6194,12 @@ func (err ColormapError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadColormap error. If no bad value exists, 0 is returned. func (err ColormapError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadColormap error. func (err ColormapError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6206,10 +6232,12 @@ func (err GContextError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadGContext error. If no bad value exists, 0 is returned. func (err GContextError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadGContext error. func (err GContextError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6242,10 +6270,12 @@ func (err IDChoiceError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadIDChoice error. If no bad value exists, 0 is returned. func (err IDChoiceError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadIDChoice error. func (err IDChoiceError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6278,10 +6308,12 @@ func (err NameError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadName error. If no bad value exists, 0 is returned. func (err NameError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadName error. func (err NameError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6314,10 +6346,12 @@ func (err LengthError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadLength error. If no bad value exists, 0 is returned. func (err LengthError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadLength error. func (err LengthError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -6350,10 +6384,12 @@ func (err ImplementationError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadImplementation error. If no bad value exists, 0 is returned. func (err ImplementationError) BadId() uint32 { return err.BadValue } +// Error returns a rudimentary string representation of the BadImplementation error. func (err ImplementationError) Error() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index ac11a77..10134ff 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 10 2012 11:56:20pm EDT. + This file was generated by xselinux.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + type ListItem struct { Name xproto.Atom ObjectContextLen uint32 diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index e2a2d80..8f964e4 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on May 10 2012 11:56:20pm EDT. + This file was generated by xtest.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -54,16 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( CursorNone = 0 CursorCurrent = 1 diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 041b082..c048e88 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on May 10 2012 11:56:20pm EDT. + This file was generated by xv.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,10 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - // Skipping definition for base type 'Double' // Skipping definition for base type 'Bool' @@ -65,6 +61,10 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + const ( TypeInputMask = 1 TypeOutputMask = 2 @@ -1087,10 +1087,13 @@ func (err BadPortError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadPort error. If no bad value exists, 0 is returned. func (err BadPortError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadPort error. + func (err BadPortError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1130,10 +1133,13 @@ func (err BadEncodingError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadEncoding error. If no bad value exists, 0 is returned. func (err BadEncodingError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadEncoding error. + func (err BadEncodingError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) @@ -1173,10 +1179,13 @@ func (err BadControlError) SequenceId() uint16 { return err.Sequence } +// BadId returns the 'BadValue' number if one exists for the BadBadControl error. If no bad value exists, 0 is returned. func (err BadControlError) BadId() uint32 { return 0 } +// Error returns a rudimentary string representation of the BadBadControl error. + func (err BadControlError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index dc9c220..cf794cc 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on May 10 2012 11:56:20pm EDT. + This file was generated by xvmc.xml on May 11 2012 1:58:37am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,8 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -63,8 +65,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { From fb3128ed2a83a0f644661cedebbe5bfda3f4951e Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Fri, 11 May 2012 02:01:29 -0400 Subject: [PATCH 38/90] doc updates and a quick usage --- nexgb/README | 5 +++++ nexgb/doc.go | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/nexgb/README b/nexgb/README index 22aded8..1213ab5 100644 --- a/nexgb/README +++ b/nexgb/README @@ -10,6 +10,11 @@ Please see doc.go for more info. Note that unless you know you need XGB, you can probably make your life easier by using a slightly higher level library: xgbutil. +Quick Usage +=========== +go get github.com/BurntSushi/xgb +go run go/path/src/github.com/BurntSushi/xgb/examples/create-window/main.go + BurntSushi's Fork ================= I've forked the XGB repository from Google Code due to inactivty upstream. diff --git a/nexgb/doc.go b/nexgb/doc.go index 91c6406..9a9531c 100644 --- a/nexgb/doc.go +++ b/nexgb/doc.go @@ -142,14 +142,5 @@ that GLX also does not work (however, there is Go source code for GLX that compiles, unlike XKB). I don't currently have any intention of getting XKB working, due to its complexity and my current mental incapacity to test it. -There are so many functions - -Indeed. Everything below this initial overview is useful insomuch as your -browser's "Find" feature is useful. The following list of types and functions -should act as a reference to the Go representation of a request, type or reply -of something you *already know about*. To search the following list in hopes -of attaining understanding is a quest in folly. For understanding, please see -the X Protocol Reference Manual: http://goo.gl/aMd2e - */ package xgb From 29942bf078c92fea681e42ca5029592526f00718 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Fri, 11 May 2012 23:58:52 -0400 Subject: [PATCH 39/90] panic when an extension request is issued before an extension has been initialized. but give a nice error message for the happy people. --- nexgb/bigreq/bigreq.go | 16 +- nexgb/composite/composite.go | 76 +++- nexgb/damage/damage.go | 56 ++- nexgb/dpms/dpms.go | 66 +++- nexgb/dri2/dri2.go | 96 ++++- nexgb/ge/ge.go | 8 +- nexgb/glx/glx.go | 622 ++++++++++++++++++++++++++++++- nexgb/randr/randr.go | 182 ++++++++- nexgb/record/record.go | 50 ++- nexgb/render/render.go | 200 +++++++++- nexgb/res/res.go | 38 +- nexgb/screensaver/screensaver.go | 50 ++- nexgb/shape/shape.go | 64 +++- nexgb/shm/shm.go | 50 ++- nexgb/sync/sync.go | 126 ++++++- nexgb/xcmisc/xcmisc.go | 44 ++- nexgb/xevie/xevie.go | 32 +- nexgb/xf86dri/xf86dri.go | 78 +++- nexgb/xf86vidmode/xf86vidmode.go | 152 +++++++- nexgb/xfixes/xfixes.go | 204 +++++++++- nexgb/xgbgen/go_request_reply.go | 16 + nexgb/xinerama/xinerama.go | 50 ++- nexgb/xinput/xinput.go | 216 ++++++++++- nexgb/xprint/xprint.go | 172 ++++++++- nexgb/xproto/xproto.go | 18 +- nexgb/xselinux/xselinux.go | 156 +++++++- nexgb/xtest/xtest.go | 34 +- nexgb/xv/xv.go | 130 ++++++- nexgb/xvmc/xvmc.go | 76 +++- 29 files changed, 2876 insertions(+), 202 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index 32dacba..43a15a4 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on May 11 2012 1:58:35am EDT. + This file was generated by bigreq.xml on May 11 2012 11:57:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie @@ -72,6 +72,9 @@ type EnableCookie struct { // Enable sends a checked request. // If an error occurs, it will be returned with the reply by calling EnableCookie.Reply() func Enable(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["BIG-REQUESTS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'BIG-REQUESTS'. bigreq.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} @@ -80,6 +83,9 @@ func Enable(c *xgb.Conn) EnableCookie { // EnableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableUnchecked(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["BIG-REQUESTS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'BIG-REQUESTS'. bigreq.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index 4217736..68e8dbe 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on May 11 2012 1:58:35am EDT. + This file was generated by composite.xml on May 11 2012 11:57:18pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,16 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -55,16 +65,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( RedirectAutomatic = 0 RedirectManual = 1 @@ -78,6 +78,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -86,6 +89,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -170,6 +176,9 @@ type RedirectWindowCookie struct { // RedirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) return RedirectWindowCookie{cookie} @@ -178,6 +187,9 @@ func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWind // RedirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectWindowCookie.Check() func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(redirectWindowRequest(c, Window, Update), cookie) return RedirectWindowCookie{cookie} @@ -224,6 +236,9 @@ type RedirectSubwindowsCookie struct { // RedirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) return RedirectSubwindowsCookie{cookie} @@ -232,6 +247,9 @@ func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Redirect // RedirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) return RedirectSubwindowsCookie{cookie} @@ -278,6 +296,9 @@ type UnredirectWindowCookie struct { // UnredirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) return UnredirectWindowCookie{cookie} @@ -286,6 +307,9 @@ func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) Unredirect // UnredirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectWindowCookie.Check() func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie) return UnredirectWindowCookie{cookie} @@ -332,6 +356,9 @@ type UnredirectSubwindowsCookie struct { // UnredirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) return UnredirectSubwindowsCookie{cookie} @@ -340,6 +367,9 @@ func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Unredi // UnredirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) return UnredirectSubwindowsCookie{cookie} @@ -386,6 +416,9 @@ type CreateRegionFromBorderClipCookie struct { // CreateRegionFromBorderClip sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) return CreateRegionFromBorderClipCookie{cookie} @@ -394,6 +427,9 @@ func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto // CreateRegionFromBorderClipChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) return CreateRegionFromBorderClipCookie{cookie} @@ -438,6 +474,9 @@ type NameWindowPixmapCookie struct { // NameWindowPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) return NameWindowPixmapCookie{cookie} @@ -446,6 +485,9 @@ func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) N // NameWindowPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) return NameWindowPixmapCookie{cookie} @@ -490,6 +532,9 @@ type GetOverlayWindowCookie struct { // GetOverlayWindow sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getOverlayWindowRequest(c, Window), cookie) return GetOverlayWindowCookie{cookie} @@ -498,6 +543,9 @@ func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie // GetOverlayWindowUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getOverlayWindowRequest(c, Window), cookie) return GetOverlayWindowCookie{cookie} @@ -575,6 +623,9 @@ type ReleaseOverlayWindowCookie struct { // ReleaseOverlayWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) return ReleaseOverlayWindowCookie{cookie} @@ -583,6 +634,9 @@ func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindo // ReleaseOverlayWindowChecked sends a checked request. // If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) return ReleaseOverlayWindowCookie{cookie} diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index a3ba928..f9aee61 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on May 11 2012 1:58:35am EDT. + This file was generated by damage.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,18 +41,6 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -65,6 +53,18 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 @@ -238,6 +238,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -246,6 +249,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -330,6 +336,9 @@ type CreateCookie struct { // Create sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Create' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) return CreateCookie{cookie} @@ -338,6 +347,9 @@ func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) Cr // CreateChecked sends a checked request. // If an error occurs, it can be retrieved using CreateCookie.Check() func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Create' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie) return CreateCookie{cookie} @@ -387,6 +399,9 @@ type DestroyCookie struct { // Destroy sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Destroy' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyRequest(c, Damage), cookie) return DestroyCookie{cookie} @@ -395,6 +410,9 @@ func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { // DestroyChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyCookie.Check() func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Destroy' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyRequest(c, Damage), cookie) return DestroyCookie{cookie} @@ -436,6 +454,9 @@ type SubtractCookie struct { // Subtract sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Subtract' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) return SubtractCookie{cookie} @@ -444,6 +465,9 @@ func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Reg // SubtractChecked sends a checked request. // If an error occurs, it can be retrieved using SubtractCookie.Check() func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Subtract' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie) return SubtractCookie{cookie} @@ -491,6 +515,9 @@ type AddCookie struct { // Add sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(addRequest(c, Drawable, Region), cookie) return AddCookie{cookie} @@ -499,6 +526,9 @@ func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie // AddChecked sends a checked request. // If an error occurs, it can be retrieved using AddCookie.Check() func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(addRequest(c, Drawable, Region), cookie) return AddCookie{cookie} diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 8ffb2ee..d1142ce 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on May 11 2012 1:58:35am EDT. + This file was generated by dpms.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - // Skipping definition for base type 'Double' // Skipping definition for base type 'Bool' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + const ( DPMSModeOn = 0 DPMSModeStandby = 1 @@ -79,6 +79,9 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -87,6 +90,9 @@ func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint1 // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -168,6 +174,9 @@ type CapableCookie struct { // Capable sends a checked request. // If an error occurs, it will be returned with the reply by calling CapableCookie.Reply() func Capable(c *xgb.Conn) CapableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Capable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(capableRequest(c), cookie) return CapableCookie{cookie} @@ -176,6 +185,9 @@ func Capable(c *xgb.Conn) CapableCookie { // CapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CapableUnchecked(c *xgb.Conn) CapableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Capable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(capableRequest(c), cookie) return CapableCookie{cookie} @@ -254,6 +266,9 @@ type GetTimeoutsCookie struct { // GetTimeouts sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTimeoutsCookie.Reply() func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'GetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTimeoutsRequest(c), cookie) return GetTimeoutsCookie{cookie} @@ -262,6 +277,9 @@ func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { // GetTimeoutsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'GetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTimeoutsRequest(c), cookie) return GetTimeoutsCookie{cookie} @@ -344,6 +362,9 @@ type SetTimeoutsCookie struct { // SetTimeouts sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) return SetTimeoutsCookie{cookie} @@ -352,6 +373,9 @@ func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffT // SetTimeoutsChecked sends a checked request. // If an error occurs, it can be retrieved using SetTimeoutsCookie.Check() func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) return SetTimeoutsCookie{cookie} @@ -399,6 +423,9 @@ type EnableCookie struct { // Enable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Enable(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} @@ -407,6 +434,9 @@ func Enable(c *xgb.Conn) EnableCookie { // EnableChecked sends a checked request. // If an error occurs, it can be retrieved using EnableCookie.Check() func EnableChecked(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(enableRequest(c), cookie) return EnableCookie{cookie} @@ -445,6 +475,9 @@ type DisableCookie struct { // Disable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Disable(c *xgb.Conn) DisableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(disableRequest(c), cookie) return DisableCookie{cookie} @@ -453,6 +486,9 @@ func Disable(c *xgb.Conn) DisableCookie { // DisableChecked sends a checked request. // If an error occurs, it can be retrieved using DisableCookie.Check() func DisableChecked(c *xgb.Conn) DisableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(disableRequest(c), cookie) return DisableCookie{cookie} @@ -491,6 +527,9 @@ type ForceLevelCookie struct { // ForceLevel sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) return ForceLevelCookie{cookie} @@ -499,6 +538,9 @@ func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { // ForceLevelChecked sends a checked request. // If an error occurs, it can be retrieved using ForceLevelCookie.Check() func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) return ForceLevelCookie{cookie} @@ -540,6 +582,9 @@ type InfoCookie struct { // Info sends a checked request. // If an error occurs, it will be returned with the reply by calling InfoCookie.Reply() func Info(c *xgb.Conn) InfoCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Info' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(infoRequest(c), cookie) return InfoCookie{cookie} @@ -548,6 +593,9 @@ func Info(c *xgb.Conn) InfoCookie { // InfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InfoUnchecked(c *xgb.Conn) InfoCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Info' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(infoRequest(c), cookie) return InfoCookie{cookie} diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index deffdb6..7a10897 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on May 11 2012 1:58:35am EDT. + This file was generated by dri2.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 @@ -405,6 +405,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -413,6 +416,9 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -494,6 +500,9 @@ type ConnectCookie struct { // Connect sends a checked request. // If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply() func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'Connect' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(connectRequest(c, Window, DriverType), cookie) return ConnectCookie{cookie} @@ -502,6 +511,9 @@ func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie // ConnectUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'Connect' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(connectRequest(c, Window, DriverType), cookie) return ConnectCookie{cookie} @@ -607,6 +619,9 @@ type AuthenticateCookie struct { // Authenticate sends a checked request. // If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply() func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(authenticateRequest(c, Window, Magic), cookie) return AuthenticateCookie{cookie} @@ -615,6 +630,9 @@ func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateC // AuthenticateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(authenticateRequest(c, Window, Magic), cookie) return AuthenticateCookie{cookie} @@ -692,6 +710,9 @@ type CreateDrawableCookie struct { // CreateDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createDrawableRequest(c, Drawable), cookie) return CreateDrawableCookie{cookie} @@ -700,6 +721,9 @@ func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie // CreateDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using CreateDrawableCookie.Check() func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createDrawableRequest(c, Drawable), cookie) return CreateDrawableCookie{cookie} @@ -741,6 +765,9 @@ type DestroyDrawableCookie struct { // DestroyDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) return DestroyDrawableCookie{cookie} @@ -749,6 +776,9 @@ func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCooki // DestroyDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyDrawableRequest(c, Drawable), cookie) return DestroyDrawableCookie{cookie} @@ -790,6 +820,9 @@ type GetBuffersCookie struct { // GetBuffers sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply() func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersCookie{cookie} @@ -798,6 +831,9 @@ func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments // GetBuffersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersCookie{cookie} @@ -896,6 +932,9 @@ type CopyRegionCookie struct { // CopyRegion sends a checked request. // If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply() func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) return CopyRegionCookie{cookie} @@ -904,6 +943,9 @@ func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint3 // CopyRegionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) return CopyRegionCookie{cookie} @@ -983,6 +1025,9 @@ type GetBuffersWithFormatCookie struct { // GetBuffersWithFormat sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply() func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetBuffersWithFormat' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersWithFormatCookie{cookie} @@ -991,6 +1036,9 @@ func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, A // GetBuffersWithFormatUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetBuffersWithFormat' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie) return GetBuffersWithFormatCookie{cookie} @@ -1085,6 +1133,9 @@ type SwapBuffersCookie struct { // SwapBuffers sends a checked request. // If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply() func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return SwapBuffersCookie{cookie} @@ -1093,6 +1144,9 @@ func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, Targ // SwapBuffersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return SwapBuffersCookie{cookie} @@ -1189,6 +1243,9 @@ type GetMSCCookie struct { // GetMSC sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply() func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMSCRequest(c, Drawable), cookie) return GetMSCCookie{cookie} @@ -1197,6 +1254,9 @@ func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { // GetMSCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMSCRequest(c, Drawable), cookie) return GetMSCCookie{cookie} @@ -1291,6 +1351,9 @@ type WaitMSCCookie struct { // WaitMSC sends a checked request. // If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply() func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'WaitMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return WaitMSCCookie{cookie} @@ -1299,6 +1362,9 @@ func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMs // WaitMSCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'WaitMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie) return WaitMSCCookie{cookie} @@ -1411,6 +1477,9 @@ type WaitSBCCookie struct { // WaitSBC sends a checked request. // If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply() func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'WaitSBC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) return WaitSBCCookie{cookie} @@ -1419,6 +1488,9 @@ func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSb // WaitSBCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'WaitSBC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie) return WaitSBCCookie{cookie} @@ -1519,6 +1591,9 @@ type SwapIntervalCookie struct { // SwapInterval sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) return SwapIntervalCookie{cookie} @@ -1527,6 +1602,9 @@ func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIn // SwapIntervalChecked sends a checked request. // If an error occurs, it can be retrieved using SwapIntervalCookie.Check() func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) return SwapIntervalCookie{cookie} diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 42a60ea..e7592d8 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on May 11 2012 1:58:35am EDT. + This file was generated by ge.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -72,6 +72,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -80,6 +83,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 6bc3615..0f67127 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on May 11 2012 1:58:35am EDT. + This file was generated by glx.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( PbcetDamaged = 32791 PbcetSaved = 32792 @@ -916,6 +916,9 @@ type RenderCookie struct { // Render sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(renderRequest(c, ContextTag, Data), cookie) return RenderCookie{cookie} @@ -924,6 +927,9 @@ func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { // RenderChecked sends a checked request. // If an error occurs, it can be retrieved using RenderCookie.Check() func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(renderRequest(c, ContextTag, Data), cookie) return RenderCookie{cookie} @@ -968,6 +974,9 @@ type RenderLargeCookie struct { // RenderLarge sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) return RenderLargeCookie{cookie} @@ -976,6 +985,9 @@ func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestT // RenderLargeChecked sends a checked request. // If an error occurs, it can be retrieved using RenderLargeCookie.Check() func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) return RenderLargeCookie{cookie} @@ -1029,6 +1041,9 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) return CreateContextCookie{cookie} @@ -1037,6 +1052,9 @@ func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, Context, Visual, Screen, ShareList, IsDirect), cookie) return CreateContextCookie{cookie} @@ -1096,6 +1114,9 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, Context), cookie) return DestroyContextCookie{cookie} @@ -1104,6 +1125,9 @@ func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, Context), cookie) return DestroyContextCookie{cookie} @@ -1145,6 +1169,9 @@ type MakeCurrentCookie struct { // MakeCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling MakeCurrentCookie.Reply() func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) return MakeCurrentCookie{cookie} @@ -1153,6 +1180,9 @@ func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag // MakeCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) return MakeCurrentCookie{cookie} @@ -1236,6 +1266,9 @@ type IsDirectCookie struct { // IsDirect sends a checked request. // If an error occurs, it will be returned with the reply by calling IsDirectCookie.Reply() func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(isDirectRequest(c, Context), cookie) return IsDirectCookie{cookie} @@ -1244,6 +1277,9 @@ func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { // IsDirectUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(isDirectRequest(c, Context), cookie) return IsDirectCookie{cookie} @@ -1325,6 +1361,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1333,6 +1372,9 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1417,6 +1459,9 @@ type WaitGLCookie struct { // WaitGL sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(waitGLRequest(c, ContextTag), cookie) return WaitGLCookie{cookie} @@ -1425,6 +1470,9 @@ func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { // WaitGLChecked sends a checked request. // If an error occurs, it can be retrieved using WaitGLCookie.Check() func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(waitGLRequest(c, ContextTag), cookie) return WaitGLCookie{cookie} @@ -1466,6 +1514,9 @@ type WaitXCookie struct { // WaitX sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(waitXRequest(c, ContextTag), cookie) return WaitXCookie{cookie} @@ -1474,6 +1525,9 @@ func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { // WaitXChecked sends a checked request. // If an error occurs, it can be retrieved using WaitXCookie.Check() func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(waitXRequest(c, ContextTag), cookie) return WaitXCookie{cookie} @@ -1515,6 +1569,9 @@ type CopyContextCookie struct { // CopyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) return CopyContextCookie{cookie} @@ -1523,6 +1580,9 @@ func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContext // CopyContextChecked sends a checked request. // If an error occurs, it can be retrieved using CopyContextCookie.Check() func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) return CopyContextCookie{cookie} @@ -1573,6 +1633,9 @@ type SwapBuffersCookie struct { // SwapBuffers sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) return SwapBuffersCookie{cookie} @@ -1581,6 +1644,9 @@ func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuff // SwapBuffersChecked sends a checked request. // If an error occurs, it can be retrieved using SwapBuffersCookie.Check() func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) return SwapBuffersCookie{cookie} @@ -1625,6 +1691,9 @@ type UseXFontCookie struct { // UseXFont sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) return UseXFontCookie{cookie} @@ -1633,6 +1702,9 @@ func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32 // UseXFontChecked sends a checked request. // If an error occurs, it can be retrieved using UseXFontCookie.Check() func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) return UseXFontCookie{cookie} @@ -1686,6 +1758,9 @@ type CreateGLXPixmapCookie struct { // CreateGLXPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) return CreateGLXPixmapCookie{cookie} @@ -1694,6 +1769,9 @@ func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap // CreateGLXPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreateGLXPixmapCookie.Check() func CreateGLXPixmapChecked(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createGLXPixmapRequest(c, Screen, Visual, Pixmap, GlxPixmap), cookie) return CreateGLXPixmapCookie{cookie} @@ -1744,6 +1822,9 @@ type GetVisualConfigsCookie struct { // GetVisualConfigs sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVisualConfigsCookie.Reply() func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) return GetVisualConfigsCookie{cookie} @@ -1752,6 +1833,9 @@ func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { // GetVisualConfigsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) return GetVisualConfigsCookie{cookie} @@ -1841,6 +1925,9 @@ type DestroyGLXPixmapCookie struct { // DestroyGLXPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) return DestroyGLXPixmapCookie{cookie} @@ -1849,6 +1936,9 @@ func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { // DestroyGLXPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyGLXPixmapCookie.Check() func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) return DestroyGLXPixmapCookie{cookie} @@ -1890,6 +1980,9 @@ type VendorPrivateCookie struct { // VendorPrivate sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateCookie{cookie} @@ -1898,6 +1991,9 @@ func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data [ // VendorPrivateChecked sends a checked request. // If an error occurs, it can be retrieved using VendorPrivateCookie.Check() func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateCookie{cookie} @@ -1945,6 +2041,9 @@ type VendorPrivateWithReplyCookie struct { // VendorPrivateWithReply sends a checked request. // If an error occurs, it will be returned with the reply by calling VendorPrivateWithReplyCookie.Reply() func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateWithReplyCookie{cookie} @@ -1953,6 +2052,9 @@ func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTa // VendorPrivateWithReplyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) return VendorPrivateWithReplyCookie{cookie} @@ -2043,6 +2145,9 @@ type QueryExtensionsStringCookie struct { // QueryExtensionsString sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtensionsStringCookie.Reply() func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) return QueryExtensionsStringCookie{cookie} @@ -2051,6 +2156,9 @@ func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCook // QueryExtensionsStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) return QueryExtensionsStringCookie{cookie} @@ -2131,6 +2239,9 @@ type QueryServerStringCookie struct { // QueryServerString sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryServerStringCookie.Reply() func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) return QueryServerStringCookie{cookie} @@ -2139,6 +2250,9 @@ func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStrin // QueryServerStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) return QueryServerStringCookie{cookie} @@ -2230,6 +2344,9 @@ type ClientInfoCookie struct { // ClientInfo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) return ClientInfoCookie{cookie} @@ -2238,6 +2355,9 @@ func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen ui // ClientInfoChecked sends a checked request. // If an error occurs, it can be retrieved using ClientInfoCookie.Check() func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) return ClientInfoCookie{cookie} @@ -2288,6 +2408,9 @@ type GetFBConfigsCookie struct { // GetFBConfigs sends a checked request. // If an error occurs, it will be returned with the reply by calling GetFBConfigsCookie.Reply() func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getFBConfigsRequest(c, Screen), cookie) return GetFBConfigsCookie{cookie} @@ -2296,6 +2419,9 @@ func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { // GetFBConfigsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getFBConfigsRequest(c, Screen), cookie) return GetFBConfigsCookie{cookie} @@ -2385,6 +2511,9 @@ type CreatePixmapCookie struct { // CreatePixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return CreatePixmapCookie{cookie} @@ -2393,6 +2522,9 @@ func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.P // CreatePixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) return CreatePixmapCookie{cookie} @@ -2452,6 +2584,9 @@ type DestroyPixmapCookie struct { // DestroyPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) return DestroyPixmapCookie{cookie} @@ -2460,6 +2595,9 @@ func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { // DestroyPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyPixmapCookie.Check() func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) return DestroyPixmapCookie{cookie} @@ -2501,6 +2639,9 @@ type CreateNewContextCookie struct { // CreateNewContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateNewContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return CreateNewContextCookie{cookie} @@ -2509,6 +2650,9 @@ func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen ui // CreateNewContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateNewContextCookie.Check() func CreateNewContextChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateNewContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createNewContextRequest(c, Context, Fbconfig, Screen, RenderType, ShareList, IsDirect), cookie) return CreateNewContextCookie{cookie} @@ -2571,6 +2715,9 @@ type QueryContextCookie struct { // QueryContext sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryContextCookie.Reply() func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryContextRequest(c, Context), cookie) return QueryContextCookie{cookie} @@ -2579,6 +2726,9 @@ func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { // QueryContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryContextRequest(c, Context), cookie) return QueryContextCookie{cookie} @@ -2664,6 +2814,9 @@ type MakeContextCurrentCookie struct { // MakeContextCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling MakeContextCurrentCookie.Reply() func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) return MakeContextCurrentCookie{cookie} @@ -2672,6 +2825,9 @@ func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable // MakeContextCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) return MakeContextCurrentCookie{cookie} @@ -2758,6 +2914,9 @@ type CreatePbufferCookie struct { // CreatePbuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreatePbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return CreatePbufferCookie{cookie} @@ -2766,6 +2925,9 @@ func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffe // CreatePbufferChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePbufferCookie.Check() func CreatePbufferChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreatePbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createPbufferRequest(c, Screen, Fbconfig, Pbuffer, NumAttribs, Attribs), cookie) return CreatePbufferCookie{cookie} @@ -2822,6 +2984,9 @@ type DestroyPbufferCookie struct { // DestroyPbuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) return DestroyPbufferCookie{cookie} @@ -2830,6 +2995,9 @@ func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { // DestroyPbufferChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyPbufferCookie.Check() func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) return DestroyPbufferCookie{cookie} @@ -2871,6 +3039,9 @@ type GetDrawableAttributesCookie struct { // GetDrawableAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDrawableAttributesCookie.Reply() func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) return GetDrawableAttributesCookie{cookie} @@ -2879,6 +3050,9 @@ func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributes // GetDrawableAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) return GetDrawableAttributesCookie{cookie} @@ -2964,6 +3138,9 @@ type ChangeDrawableAttributesCookie struct { // ChangeDrawableAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) return ChangeDrawableAttributesCookie{cookie} @@ -2972,6 +3149,9 @@ func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, // ChangeDrawableAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeDrawableAttributesCookie.Check() func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) return ChangeDrawableAttributesCookie{cookie} @@ -3022,6 +3202,9 @@ type CreateWindowCookie struct { // CreateWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return CreateWindowCookie{cookie} @@ -3030,6 +3213,9 @@ func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.W // CreateWindowChecked sends a checked request. // If an error occurs, it can be retrieved using CreateWindowCookie.Check() func CreateWindowChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createWindowRequest(c, Screen, Fbconfig, Window, GlxWindow, NumAttribs, Attribs), cookie) return CreateWindowCookie{cookie} @@ -3089,6 +3275,9 @@ type DeleteWindowCookie struct { // DeleteWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) return DeleteWindowCookie{cookie} @@ -3097,6 +3286,9 @@ func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { // DeleteWindowChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteWindowCookie.Check() func DeleteWindowChecked(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteWindowRequest(c, Glxwindow), cookie) return DeleteWindowCookie{cookie} @@ -3138,6 +3330,9 @@ type SetClientInfoARBCookie struct { // SetClientInfoARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfoARBCookie{cookie} @@ -3146,6 +3341,9 @@ func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, Num // SetClientInfoARBChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientInfoARBCookie.Check() func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfoARBCookie{cookie} @@ -3211,6 +3409,9 @@ type CreateContextAttribsARBCookie struct { // CreateContextAttribsARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return CreateContextAttribsARBCookie{cookie} @@ -3219,6 +3420,9 @@ func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Sc // CreateContextAttribsARBChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextAttribsARBCookie.Check() func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) return CreateContextAttribsARBCookie{cookie} @@ -3287,6 +3491,9 @@ type SetClientInfo2ARBCookie struct { // SetClientInfo2ARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfo2ARBCookie{cookie} @@ -3295,6 +3502,9 @@ func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, Nu // SetClientInfo2ARBChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientInfo2ARBCookie.Check() func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) return SetClientInfo2ARBCookie{cookie} @@ -3360,6 +3570,9 @@ type NewListCookie struct { // NewList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) return NewListCookie{cookie} @@ -3368,6 +3581,9 @@ func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewLi // NewListChecked sends a checked request. // If an error occurs, it can be retrieved using NewListCookie.Check() func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) return NewListCookie{cookie} @@ -3415,6 +3631,9 @@ type EndListCookie struct { // EndList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'EndList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(endListRequest(c, ContextTag), cookie) return EndListCookie{cookie} @@ -3423,6 +3642,9 @@ func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { // EndListChecked sends a checked request. // If an error occurs, it can be retrieved using EndListCookie.Check() func EndListChecked(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'EndList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(endListRequest(c, ContextTag), cookie) return EndListCookie{cookie} @@ -3464,6 +3686,9 @@ type DeleteListsCookie struct { // DeleteLists sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) return DeleteListsCookie{cookie} @@ -3472,6 +3697,9 @@ func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) D // DeleteListsChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteListsCookie.Check() func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) return DeleteListsCookie{cookie} @@ -3519,6 +3747,9 @@ type GenListsCookie struct { // GenLists sends a checked request. // If an error occurs, it will be returned with the reply by calling GenListsCookie.Reply() func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) return GenListsCookie{cookie} @@ -3527,6 +3758,9 @@ func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { // GenListsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenListsUnchecked(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(genListsRequest(c, ContextTag, Range), cookie) return GenListsCookie{cookie} @@ -3604,6 +3838,9 @@ type FeedbackBufferCookie struct { // FeedbackBuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) return FeedbackBufferCookie{cookie} @@ -3612,6 +3849,9 @@ func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) // FeedbackBufferChecked sends a checked request. // If an error occurs, it can be retrieved using FeedbackBufferCookie.Check() func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) return FeedbackBufferCookie{cookie} @@ -3659,6 +3899,9 @@ type SelectBufferCookie struct { // SelectBuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) return SelectBufferCookie{cookie} @@ -3667,6 +3910,9 @@ func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCo // SelectBufferChecked sends a checked request. // If an error occurs, it can be retrieved using SelectBufferCookie.Check() func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) return SelectBufferCookie{cookie} @@ -3711,6 +3957,9 @@ type RenderModeCookie struct { // RenderMode sends a checked request. // If an error occurs, it will be returned with the reply by calling RenderModeCookie.Reply() func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) return RenderModeCookie{cookie} @@ -3719,6 +3968,9 @@ func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCooki // RenderModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) return RenderModeCookie{cookie} @@ -3815,6 +4067,9 @@ type FinishCookie struct { // Finish sends a checked request. // If an error occurs, it will be returned with the reply by calling FinishCookie.Reply() func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(finishRequest(c, ContextTag), cookie) return FinishCookie{cookie} @@ -3823,6 +4078,9 @@ func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { // FinishUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(finishRequest(c, ContextTag), cookie) return FinishCookie{cookie} @@ -3893,6 +4151,9 @@ type PixelStorefCookie struct { // PixelStoref sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) return PixelStorefCookie{cookie} @@ -3901,6 +4162,9 @@ func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32 // PixelStorefChecked sends a checked request. // If an error occurs, it can be retrieved using PixelStorefCookie.Check() func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) return PixelStorefCookie{cookie} @@ -3948,6 +4212,9 @@ type PixelStoreiCookie struct { // PixelStorei sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) return PixelStoreiCookie{cookie} @@ -3956,6 +4223,9 @@ func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) // PixelStoreiChecked sends a checked request. // If an error occurs, it can be retrieved using PixelStoreiCookie.Check() func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) return PixelStoreiCookie{cookie} @@ -4003,6 +4273,9 @@ type ReadPixelsCookie struct { // ReadPixels sends a checked request. // If an error occurs, it will be returned with the reply by calling ReadPixelsCookie.Reply() func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) return ReadPixelsCookie{cookie} @@ -4011,6 +4284,9 @@ func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int3 // ReadPixelsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) return ReadPixelsCookie{cookie} @@ -4121,6 +4397,9 @@ type GetBooleanvCookie struct { // GetBooleanv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBooleanvCookie.Reply() func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetBooleanv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) return GetBooleanvCookie{cookie} @@ -4129,6 +4408,9 @@ func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCoo // GetBooleanvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBooleanvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetBooleanv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getBooleanvRequest(c, ContextTag, Pname), cookie) return GetBooleanvCookie{cookie} @@ -4232,6 +4514,9 @@ type GetClipPlaneCookie struct { // GetClipPlane sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClipPlaneCookie.Reply() func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetClipPlane' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) return GetClipPlaneCookie{cookie} @@ -4240,6 +4525,9 @@ func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneC // GetClipPlaneUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClipPlaneUnchecked(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetClipPlane' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getClipPlaneRequest(c, ContextTag, Plane), cookie) return GetClipPlaneCookie{cookie} @@ -4324,6 +4612,9 @@ type GetDoublevCookie struct { // GetDoublev sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDoublevCookie.Reply() func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDoublev' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) return GetDoublevCookie{cookie} @@ -4332,6 +4623,9 @@ func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCook // GetDoublevUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDoublevUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDoublev' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDoublevRequest(c, ContextTag, Pname), cookie) return GetDoublevCookie{cookie} @@ -4427,6 +4721,9 @@ type GetErrorCookie struct { // GetError sends a checked request. // If an error occurs, it will be returned with the reply by calling GetErrorCookie.Reply() func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetError' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getErrorRequest(c, ContextTag), cookie) return GetErrorCookie{cookie} @@ -4435,6 +4732,9 @@ func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { // GetErrorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetErrorUnchecked(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetError' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getErrorRequest(c, ContextTag), cookie) return GetErrorCookie{cookie} @@ -4509,6 +4809,9 @@ type GetFloatvCookie struct { // GetFloatv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetFloatvCookie.Reply() func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFloatv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) return GetFloatvCookie{cookie} @@ -4517,6 +4820,9 @@ func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie // GetFloatvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFloatvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFloatv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getFloatvRequest(c, ContextTag, Pname), cookie) return GetFloatvCookie{cookie} @@ -4612,6 +4918,9 @@ type GetIntegervCookie struct { // GetIntegerv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetIntegervCookie.Reply() func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetIntegerv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) return GetIntegervCookie{cookie} @@ -4620,6 +4929,9 @@ func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCo // GetIntegervUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetIntegervUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetIntegerv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getIntegervRequest(c, ContextTag, Pname), cookie) return GetIntegervCookie{cookie} @@ -4715,6 +5027,9 @@ type GetLightfvCookie struct { // GetLightfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetLightfvCookie.Reply() func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetLightfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) return GetLightfvCookie{cookie} @@ -4723,6 +5038,9 @@ func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) // GetLightfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetLightfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getLightfvRequest(c, ContextTag, Light, Pname), cookie) return GetLightfvCookie{cookie} @@ -4821,6 +5139,9 @@ type GetLightivCookie struct { // GetLightiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetLightivCookie.Reply() func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetLightiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) return GetLightivCookie{cookie} @@ -4829,6 +5150,9 @@ func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) // GetLightivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightivUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetLightiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getLightivRequest(c, ContextTag, Light, Pname), cookie) return GetLightivCookie{cookie} @@ -4927,6 +5251,9 @@ type GetMapdvCookie struct { // GetMapdv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapdvCookie.Reply() func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapdv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) return GetMapdvCookie{cookie} @@ -4935,6 +5262,9 @@ func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapdvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapdvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapdv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMapdvRequest(c, ContextTag, Target, Query), cookie) return GetMapdvCookie{cookie} @@ -5033,6 +5363,9 @@ type GetMapfvCookie struct { // GetMapfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapfvCookie.Reply() func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) return GetMapfvCookie{cookie} @@ -5041,6 +5374,9 @@ func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMapfvRequest(c, ContextTag, Target, Query), cookie) return GetMapfvCookie{cookie} @@ -5139,6 +5475,9 @@ type GetMapivCookie struct { // GetMapiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapivCookie.Reply() func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) return GetMapivCookie{cookie} @@ -5147,6 +5486,9 @@ func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMapiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMapivRequest(c, ContextTag, Target, Query), cookie) return GetMapivCookie{cookie} @@ -5245,6 +5587,9 @@ type GetMaterialfvCookie struct { // GetMaterialfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMaterialfvCookie.Reply() func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMaterialfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialfvCookie{cookie} @@ -5253,6 +5598,9 @@ func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32 // GetMaterialfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMaterialfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMaterialfvRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialfvCookie{cookie} @@ -5351,6 +5699,9 @@ type GetMaterialivCookie struct { // GetMaterialiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMaterialivCookie.Reply() func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMaterialiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialivCookie{cookie} @@ -5359,6 +5710,9 @@ func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32 // GetMaterialivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialivUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMaterialiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMaterialivRequest(c, ContextTag, Face, Pname), cookie) return GetMaterialivCookie{cookie} @@ -5457,6 +5811,9 @@ type GetPixelMapfvCookie struct { // GetPixelMapfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapfvCookie.Reply() func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) return GetPixelMapfvCookie{cookie} @@ -5465,6 +5822,9 @@ func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfv // GetPixelMapfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapfvRequest(c, ContextTag, Map), cookie) return GetPixelMapfvCookie{cookie} @@ -5560,6 +5920,9 @@ type GetPixelMapuivCookie struct { // GetPixelMapuiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapuivCookie.Reply() func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapuiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) return GetPixelMapuivCookie{cookie} @@ -5568,6 +5931,9 @@ func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapu // GetPixelMapuivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapuivUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapuiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapuivRequest(c, ContextTag, Map), cookie) return GetPixelMapuivCookie{cookie} @@ -5663,6 +6029,9 @@ type GetPixelMapusvCookie struct { // GetPixelMapusv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapusvCookie.Reply() func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapusv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) return GetPixelMapusvCookie{cookie} @@ -5671,6 +6040,9 @@ func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapu // GetPixelMapusvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapusvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPixelMapusv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPixelMapusvRequest(c, ContextTag, Map), cookie) return GetPixelMapusvCookie{cookie} @@ -5766,6 +6138,9 @@ type GetPolygonStippleCookie struct { // GetPolygonStipple sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPolygonStippleCookie.Reply() func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPolygonStipple' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) return GetPolygonStippleCookie{cookie} @@ -5774,6 +6149,9 @@ func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPol // GetPolygonStippleUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPolygonStippleUnchecked(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetPolygonStipple' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPolygonStippleRequest(c, ContextTag, LsbFirst), cookie) return GetPolygonStippleCookie{cookie} @@ -5859,6 +6237,9 @@ type GetStringCookie struct { // GetString sends a checked request. // If an error occurs, it will be returned with the reply by calling GetStringCookie.Reply() func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) return GetStringCookie{cookie} @@ -5867,6 +6248,9 @@ func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie // GetStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStringUnchecked(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getStringRequest(c, ContextTag, Name), cookie) return GetStringCookie{cookie} @@ -5958,6 +6342,9 @@ type GetTexEnvfvCookie struct { // GetTexEnvfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexEnvfvCookie.Reply() func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexEnvfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvfvCookie{cookie} @@ -5966,6 +6353,9 @@ func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32 // GetTexEnvfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexEnvfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexEnvfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvfvCookie{cookie} @@ -6064,6 +6454,9 @@ type GetTexEnvivCookie struct { // GetTexEnviv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexEnvivCookie.Reply() func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexEnviv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvivCookie{cookie} @@ -6072,6 +6465,9 @@ func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32 // GetTexEnvivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexEnviv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexEnvivRequest(c, ContextTag, Target, Pname), cookie) return GetTexEnvivCookie{cookie} @@ -6170,6 +6566,9 @@ type GetTexGendvCookie struct { // GetTexGendv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGendvCookie.Reply() func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGendv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGendvCookie{cookie} @@ -6178,6 +6577,9 @@ func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGendvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGendvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGendv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexGendvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGendvCookie{cookie} @@ -6276,6 +6678,9 @@ type GetTexGenfvCookie struct { // GetTexGenfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGenfvCookie.Reply() func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGenfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenfvCookie{cookie} @@ -6284,6 +6689,9 @@ func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGenfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGenfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexGenfvRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenfvCookie{cookie} @@ -6382,6 +6790,9 @@ type GetTexGenivCookie struct { // GetTexGeniv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGenivCookie.Reply() func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGeniv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenivCookie{cookie} @@ -6390,6 +6801,9 @@ func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGenivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenivUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexGeniv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexGenivRequest(c, ContextTag, Coord, Pname), cookie) return GetTexGenivCookie{cookie} @@ -6488,6 +6902,9 @@ type GetTexImageCookie struct { // GetTexImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexImageCookie.Reply() func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexImage' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) return GetTexImageCookie{cookie} @@ -6496,6 +6913,9 @@ func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, // GetTexImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexImageUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexImage' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexImageRequest(c, ContextTag, Target, Level, Format, Type, SwapBytes), cookie) return GetTexImageCookie{cookie} @@ -6608,6 +7028,9 @@ type GetTexParameterfvCookie struct { // GetTexParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexParameterfvCookie.Reply() func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterfvCookie{cookie} @@ -6616,6 +7039,9 @@ func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname // GetTexParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterfvCookie{cookie} @@ -6714,6 +7140,9 @@ type GetTexParameterivCookie struct { // GetTexParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexParameterivCookie.Reply() func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterivCookie{cookie} @@ -6722,6 +7151,9 @@ func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname // GetTexParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetTexParameterivCookie{cookie} @@ -6820,6 +7252,9 @@ type GetTexLevelParameterfvCookie struct { // GetTexLevelParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexLevelParameterfvCookie.Reply() func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexLevelParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterfvCookie{cookie} @@ -6828,6 +7263,9 @@ func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, L // GetTexLevelParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexLevelParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexLevelParameterfvRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterfvCookie{cookie} @@ -6929,6 +7367,9 @@ type GetTexLevelParameterivCookie struct { // GetTexLevelParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexLevelParameterivCookie.Reply() func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexLevelParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterivCookie{cookie} @@ -6937,6 +7378,9 @@ func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, L // GetTexLevelParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexLevelParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getTexLevelParameterivRequest(c, ContextTag, Target, Level, Pname), cookie) return GetTexLevelParameterivCookie{cookie} @@ -7038,6 +7482,9 @@ type IsListCookie struct { // IsList sends a checked request. // If an error occurs, it will be returned with the reply by calling IsListCookie.Reply() func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(isListRequest(c, ContextTag, List), cookie) return IsListCookie{cookie} @@ -7046,6 +7493,9 @@ func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { // IsListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsListUnchecked(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(isListRequest(c, ContextTag, List), cookie) return IsListCookie{cookie} @@ -7123,6 +7573,9 @@ type FlushCookie struct { // Flush sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(flushRequest(c, ContextTag), cookie) return FlushCookie{cookie} @@ -7131,6 +7584,9 @@ func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { // FlushChecked sends a checked request. // If an error occurs, it can be retrieved using FlushCookie.Check() func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(flushRequest(c, ContextTag), cookie) return FlushCookie{cookie} @@ -7172,6 +7628,9 @@ type AreTexturesResidentCookie struct { // AreTexturesResident sends a checked request. // If an error occurs, it will be returned with the reply by calling AreTexturesResidentCookie.Reply() func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) return AreTexturesResidentCookie{cookie} @@ -7180,6 +7639,9 @@ func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures [ // AreTexturesResidentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) return AreTexturesResidentCookie{cookie} @@ -7278,6 +7740,9 @@ type DeleteTexturesCookie struct { // DeleteTextures sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) return DeleteTexturesCookie{cookie} @@ -7286,6 +7751,9 @@ func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint // DeleteTexturesChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteTexturesCookie.Check() func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) return DeleteTexturesCookie{cookie} @@ -7336,6 +7804,9 @@ type GenTexturesCookie struct { // GenTextures sends a checked request. // If an error occurs, it will be returned with the reply by calling GenTexturesCookie.Reply() func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) return GenTexturesCookie{cookie} @@ -7344,6 +7815,9 @@ func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie // GenTexturesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) return GenTexturesCookie{cookie} @@ -7428,6 +7902,9 @@ type IsTextureCookie struct { // IsTexture sends a checked request. // If an error occurs, it will be returned with the reply by calling IsTextureCookie.Reply() func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) return IsTextureCookie{cookie} @@ -7436,6 +7913,9 @@ func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCook // IsTextureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) return IsTextureCookie{cookie} @@ -7513,6 +7993,9 @@ type GetColorTableCookie struct { // GetColorTable sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableCookie.Reply() func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetColorTableCookie{cookie} @@ -7521,6 +8004,9 @@ func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uin // GetColorTableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetColorTableCookie{cookie} @@ -7622,6 +8108,9 @@ type GetColorTableParameterfvCookie struct { // GetColorTableParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableParameterfvCookie.Reply() func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterfvCookie{cookie} @@ -7630,6 +8119,9 @@ func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetColorTableParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterfvCookie{cookie} @@ -7728,6 +8220,9 @@ type GetColorTableParameterivCookie struct { // GetColorTableParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableParameterivCookie.Reply() func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterivCookie{cookie} @@ -7736,6 +8231,9 @@ func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetColorTableParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetColorTableParameterivCookie{cookie} @@ -7834,6 +8332,9 @@ type GetConvolutionFilterCookie struct { // GetConvolutionFilter sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionFilterCookie.Reply() func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetConvolutionFilterCookie{cookie} @@ -7842,6 +8343,9 @@ func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, For // GetConvolutionFilterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetConvolutionFilterCookie{cookie} @@ -7947,6 +8451,9 @@ type GetConvolutionParameterfvCookie struct { // GetConvolutionParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionParameterfvCookie.Reply() func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterfvCookie{cookie} @@ -7955,6 +8462,9 @@ func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32 // GetConvolutionParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterfvCookie{cookie} @@ -8053,6 +8563,9 @@ type GetConvolutionParameterivCookie struct { // GetConvolutionParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionParameterivCookie.Reply() func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterivCookie{cookie} @@ -8061,6 +8574,9 @@ func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32 // GetConvolutionParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetConvolutionParameterivCookie{cookie} @@ -8159,6 +8675,9 @@ type GetSeparableFilterCookie struct { // GetSeparableFilter sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSeparableFilterCookie.Reply() func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetSeparableFilterCookie{cookie} @@ -8167,6 +8686,9 @@ func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Forma // GetSeparableFilterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) return GetSeparableFilterCookie{cookie} @@ -8272,6 +8794,9 @@ type GetHistogramCookie struct { // GetHistogram sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramCookie.Reply() func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetHistogramCookie{cookie} @@ -8280,6 +8805,9 @@ func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint // GetHistogramUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetHistogramCookie{cookie} @@ -8388,6 +8916,9 @@ type GetHistogramParameterfvCookie struct { // GetHistogramParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramParameterfvCookie.Reply() func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterfvCookie{cookie} @@ -8396,6 +8927,9 @@ func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetHistogramParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterfvCookie{cookie} @@ -8494,6 +9028,9 @@ type GetHistogramParameterivCookie struct { // GetHistogramParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramParameterivCookie.Reply() func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterivCookie{cookie} @@ -8502,6 +9039,9 @@ func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetHistogramParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetHistogramParameterivCookie{cookie} @@ -8600,6 +9140,9 @@ type GetMinmaxCookie struct { // GetMinmax sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxCookie.Reply() func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetMinmaxCookie{cookie} @@ -8608,6 +9151,9 @@ func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, // GetMinmaxUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) return GetMinmaxCookie{cookie} @@ -8709,6 +9255,9 @@ type GetMinmaxParameterfvCookie struct { // GetMinmaxParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxParameterfvCookie.Reply() func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterfvCookie{cookie} @@ -8717,6 +9266,9 @@ func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna // GetMinmaxParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterfvCookie{cookie} @@ -8815,6 +9367,9 @@ type GetMinmaxParameterivCookie struct { // GetMinmaxParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxParameterivCookie.Reply() func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterivCookie{cookie} @@ -8823,6 +9378,9 @@ func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna // GetMinmaxParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) return GetMinmaxParameterivCookie{cookie} @@ -8921,6 +9479,9 @@ type GetCompressedTexImageARBCookie struct { // GetCompressedTexImageARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCompressedTexImageARBCookie.Reply() func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) return GetCompressedTexImageARBCookie{cookie} @@ -8929,6 +9490,9 @@ func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetCompressedTexImageARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) return GetCompressedTexImageARBCookie{cookie} @@ -9020,6 +9584,9 @@ type DeleteQueriesARBCookie struct { // DeleteQueriesARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) return DeleteQueriesARBCookie{cookie} @@ -9028,6 +9595,9 @@ func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) // DeleteQueriesARBChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteQueriesARBCookie.Check() func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) return DeleteQueriesARBCookie{cookie} @@ -9078,6 +9648,9 @@ type GenQueriesARBCookie struct { // GenQueriesARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GenQueriesARBCookie.Reply() func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) return GenQueriesARBCookie{cookie} @@ -9086,6 +9659,9 @@ func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCoo // GenQueriesARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) return GenQueriesARBCookie{cookie} @@ -9170,6 +9746,9 @@ type IsQueryARBCookie struct { // IsQueryARB sends a checked request. // If an error occurs, it will be returned with the reply by calling IsQueryARBCookie.Reply() func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsQueryARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) return IsQueryARBCookie{cookie} @@ -9178,6 +9757,9 @@ func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie // IsQueryARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsQueryARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsQueryARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(isQueryARBRequest(c, ContextTag, Id), cookie) return IsQueryARBCookie{cookie} @@ -9255,6 +9837,9 @@ type GetQueryivARBCookie struct { // GetQueryivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryivARBCookie.Reply() func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) return GetQueryivARBCookie{cookie} @@ -9263,6 +9848,9 @@ func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint // GetQueryivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) return GetQueryivARBCookie{cookie} @@ -9361,6 +9949,9 @@ type GetQueryObjectivARBCookie struct { // GetQueryObjectivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryObjectivARBCookie.Reply() func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectivARBCookie{cookie} @@ -9369,6 +9960,9 @@ func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname ui // GetQueryObjectivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectivARBCookie{cookie} @@ -9467,6 +10061,9 @@ type GetQueryObjectuivARBCookie struct { // GetQueryObjectuivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryObjectuivARBCookie.Reply() func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectuivARBCookie{cookie} @@ -9475,6 +10072,9 @@ func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname u // GetQueryObjectuivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) return GetQueryObjectuivARBCookie{cookie} diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 83e7035..9a6e89f 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on May 11 2012 1:58:36am EDT. + This file was generated by randr.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -1221,6 +1221,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1229,6 +1232,9 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1313,6 +1319,9 @@ type SetScreenConfigCookie struct { // SetScreenConfig sends a checked request. // If an error occurs, it will be returned with the reply by calling SetScreenConfigCookie.Reply() func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return SetScreenConfigCookie{cookie} @@ -1321,6 +1330,9 @@ func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timesta // SetScreenConfigUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) return SetScreenConfigCookie{cookie} @@ -1428,6 +1440,9 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, Window, Enable), cookie) return SelectInputCookie{cookie} @@ -1436,6 +1451,9 @@ func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCo // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, Window, Enable), cookie) return SelectInputCookie{cookie} @@ -1482,6 +1500,9 @@ type GetScreenInfoCookie struct { // GetScreenInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenInfoCookie.Reply() func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenInfoRequest(c, Window), cookie) return GetScreenInfoCookie{cookie} @@ -1490,6 +1511,9 @@ func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { // GetScreenInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenInfoRequest(c, Window), cookie) return GetScreenInfoCookie{cookie} @@ -1604,6 +1628,9 @@ type GetScreenSizeRangeCookie struct { // GetScreenSizeRange sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenSizeRangeCookie.Reply() func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) return GetScreenSizeRangeCookie{cookie} @@ -1612,6 +1639,9 @@ func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCoo // GetScreenSizeRangeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) return GetScreenSizeRangeCookie{cookie} @@ -1701,6 +1731,9 @@ type SetScreenSizeCookie struct { // SetScreenSize sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) return SetScreenSizeCookie{cookie} @@ -1709,6 +1742,9 @@ func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint1 // SetScreenSizeChecked sends a checked request. // If an error occurs, it can be retrieved using SetScreenSizeCookie.Check() func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) return SetScreenSizeCookie{cookie} @@ -1762,6 +1798,9 @@ type GetScreenResourcesCookie struct { // GetScreenResources sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenResourcesCookie.Reply() func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenResourcesRequest(c, Window), cookie) return GetScreenResourcesCookie{cookie} @@ -1770,6 +1809,9 @@ func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCoo // GetScreenResourcesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenResourcesRequest(c, Window), cookie) return GetScreenResourcesCookie{cookie} @@ -1892,6 +1934,9 @@ type GetOutputInfoCookie struct { // GetOutputInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputInfoCookie.Reply() func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) return GetOutputInfoCookie{cookie} @@ -1900,6 +1945,9 @@ func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) // GetOutputInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputInfoUnchecked(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getOutputInfoRequest(c, Output, ConfigTimestamp), cookie) return GetOutputInfoCookie{cookie} @@ -2047,6 +2095,9 @@ type ListOutputPropertiesCookie struct { // ListOutputProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListOutputPropertiesCookie.Reply() func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ListOutputProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) return ListOutputPropertiesCookie{cookie} @@ -2055,6 +2106,9 @@ func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie // ListOutputPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListOutputPropertiesUnchecked(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ListOutputProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listOutputPropertiesRequest(c, Output), cookie) return ListOutputPropertiesCookie{cookie} @@ -2140,6 +2194,9 @@ type QueryOutputPropertyCookie struct { // QueryOutputProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryOutputPropertyCookie.Reply() func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) return QueryOutputPropertyCookie{cookie} @@ -2148,6 +2205,9 @@ func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) Query // QueryOutputPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryOutputPropertyRequest(c, Output, Property), cookie) return QueryOutputPropertyCookie{cookie} @@ -2256,6 +2316,9 @@ type ConfigureOutputPropertyCookie struct { // ConfigureOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) return ConfigureOutputPropertyCookie{cookie} @@ -2264,6 +2327,9 @@ func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, P // ConfigureOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ConfigureOutputPropertyCookie.Check() func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) return ConfigureOutputPropertyCookie{cookie} @@ -2330,6 +2396,9 @@ type ChangeOutputPropertyCookie struct { // ChangeOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return ChangeOutputPropertyCookie{cookie} @@ -2338,6 +2407,9 @@ func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type // ChangeOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeOutputPropertyCookie.Check() func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) return ChangeOutputPropertyCookie{cookie} @@ -2399,6 +2471,9 @@ type DeleteOutputPropertyCookie struct { // DeleteOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) return DeleteOutputPropertyCookie{cookie} @@ -2407,6 +2482,9 @@ func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) Dele // DeleteOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteOutputPropertyCookie.Check() func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) return DeleteOutputPropertyCookie{cookie} @@ -2451,6 +2529,9 @@ type GetOutputPropertyCookie struct { // GetOutputProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputPropertyCookie.Reply() func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return GetOutputPropertyCookie{cookie} @@ -2459,6 +2540,9 @@ func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xp // GetOutputPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) return GetOutputPropertyCookie{cookie} @@ -2578,6 +2662,9 @@ type CreateModeCookie struct { // CreateMode sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateModeCookie.Reply() func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) return CreateModeCookie{cookie} @@ -2586,6 +2673,9 @@ func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name strin // CreateModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) return CreateModeCookie{cookie} @@ -2672,6 +2762,9 @@ type DestroyModeCookie struct { // DestroyMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyModeRequest(c, Mode), cookie) return DestroyModeCookie{cookie} @@ -2680,6 +2773,9 @@ func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { // DestroyModeChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyModeCookie.Check() func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyModeRequest(c, Mode), cookie) return DestroyModeCookie{cookie} @@ -2721,6 +2817,9 @@ type AddOutputModeCookie struct { // AddOutputMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) return AddOutputModeCookie{cookie} @@ -2729,6 +2828,9 @@ func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { // AddOutputModeChecked sends a checked request. // If an error occurs, it can be retrieved using AddOutputModeCookie.Check() func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) return AddOutputModeCookie{cookie} @@ -2773,6 +2875,9 @@ type DeleteOutputModeCookie struct { // DeleteOutputMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) return DeleteOutputModeCookie{cookie} @@ -2781,6 +2886,9 @@ func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCoo // DeleteOutputModeChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteOutputModeCookie.Check() func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) return DeleteOutputModeCookie{cookie} @@ -2825,6 +2933,9 @@ type GetCrtcInfoCookie struct { // GetCrtcInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcInfoCookie.Reply() func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) return GetCrtcInfoCookie{cookie} @@ -2833,6 +2944,9 @@ func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCr // GetCrtcInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) return GetCrtcInfoCookie{cookie} @@ -2963,6 +3077,9 @@ type SetCrtcConfigCookie struct { // SetCrtcConfig sends a checked request. // If an error occurs, it will be returned with the reply by calling SetCrtcConfigCookie.Reply() func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return SetCrtcConfigCookie{cookie} @@ -2971,6 +3088,9 @@ func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTim // SetCrtcConfigUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcConfigUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setCrtcConfigRequest(c, Crtc, Timestamp, ConfigTimestamp, X, Y, Mode, Rotation, Outputs), cookie) return SetCrtcConfigCookie{cookie} @@ -3075,6 +3195,9 @@ type GetCrtcGammaSizeCookie struct { // GetCrtcGammaSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcGammaSizeCookie.Reply() func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) return GetCrtcGammaSizeCookie{cookie} @@ -3083,6 +3206,9 @@ func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { // GetCrtcGammaSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) return GetCrtcGammaSizeCookie{cookie} @@ -3160,6 +3286,9 @@ type GetCrtcGammaCookie struct { // GetCrtcGamma sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcGammaCookie.Reply() func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) return GetCrtcGammaCookie{cookie} @@ -3168,6 +3297,9 @@ func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { // GetCrtcGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) return GetCrtcGammaCookie{cookie} @@ -3269,6 +3401,9 @@ type SetCrtcGammaCookie struct { // SetCrtcGamma sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) return SetCrtcGammaCookie{cookie} @@ -3277,6 +3412,9 @@ func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uin // SetCrtcGammaChecked sends a checked request. // If an error occurs, it can be retrieved using SetCrtcGammaCookie.Check() func SetCrtcGammaChecked(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setCrtcGammaRequest(c, Crtc, Size, Red, Green, Blue), cookie) return SetCrtcGammaCookie{cookie} @@ -3341,6 +3479,9 @@ type GetScreenResourcesCurrentCookie struct { // GetScreenResourcesCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenResourcesCurrentCookie.Reply() func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) return GetScreenResourcesCurrentCookie{cookie} @@ -3349,6 +3490,9 @@ func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResou // GetScreenResourcesCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) return GetScreenResourcesCurrentCookie{cookie} @@ -3471,6 +3615,9 @@ type SetCrtcTransformCookie struct { // SetCrtcTransform sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return SetCrtcTransformCookie{cookie} @@ -3479,6 +3626,9 @@ func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, Filter // SetCrtcTransformChecked sends a checked request. // If an error occurs, it can be retrieved using SetCrtcTransformCookie.Check() func SetCrtcTransformChecked(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setCrtcTransformRequest(c, Crtc, Transform, FilterLen, FilterName, FilterParams), cookie) return SetCrtcTransformCookie{cookie} @@ -3540,6 +3690,9 @@ type GetCrtcTransformCookie struct { // GetCrtcTransform sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcTransformCookie.Reply() func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) return GetCrtcTransformCookie{cookie} @@ -3548,6 +3701,9 @@ func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { // GetCrtcTransformUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) return GetCrtcTransformCookie{cookie} @@ -3688,6 +3844,9 @@ type GetPanningCookie struct { // GetPanning sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPanningCookie.Reply() func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPanningRequest(c, Crtc), cookie) return GetPanningCookie{cookie} @@ -3696,6 +3855,9 @@ func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { // GetPanningUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPanningRequest(c, Crtc), cookie) return GetPanningCookie{cookie} @@ -3819,6 +3981,9 @@ type SetPanningCookie struct { // SetPanning sends a checked request. // If an error occurs, it will be returned with the reply by calling SetPanningCookie.Reply() func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return SetPanningCookie{cookie} @@ -3827,6 +3992,9 @@ func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, // SetPanningUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPanningUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setPanningRequest(c, Crtc, Timestamp, Left, Top, Width, Height, TrackLeft, TrackTop, TrackWidth, TrackHeight, BorderLeft, BorderTop, BorderRight, BorderBottom), cookie) return SetPanningCookie{cookie} @@ -3941,6 +4109,9 @@ type SetOutputPrimaryCookie struct { // SetOutputPrimary sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) return SetOutputPrimaryCookie{cookie} @@ -3949,6 +4120,9 @@ func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutpu // SetOutputPrimaryChecked sends a checked request. // If an error occurs, it can be retrieved using SetOutputPrimaryCookie.Check() func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) return SetOutputPrimaryCookie{cookie} @@ -3993,6 +4167,9 @@ type GetOutputPrimaryCookie struct { // GetOutputPrimary sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputPrimaryCookie.Reply() func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) return GetOutputPrimaryCookie{cookie} @@ -4001,6 +4178,9 @@ func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie // GetOutputPrimaryUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) return GetOutputPrimaryCookie{cookie} diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 5623e50..a9ae7ea 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on May 11 2012 1:58:36am EDT. + This file was generated by record.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -526,6 +526,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -534,6 +537,9 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) return QueryVersionCookie{cookie} @@ -615,6 +621,9 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return CreateContextCookie{cookie} @@ -623,6 +632,9 @@ func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, Nu // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return CreateContextCookie{cookie} @@ -683,6 +695,9 @@ type RegisterClientsCookie struct { // RegisterClients sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'RegisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RegisterClientsCookie{cookie} @@ -691,6 +706,9 @@ func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, // RegisterClientsChecked sends a checked request. // If an error occurs, it can be retrieved using RegisterClientsCookie.Check() func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'RegisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) return RegisterClientsCookie{cookie} @@ -751,6 +769,9 @@ type UnregisterClientsCookie struct { // UnregisterClients sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'UnregisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) return UnregisterClientsCookie{cookie} @@ -759,6 +780,9 @@ func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, Clie // UnregisterClientsChecked sends a checked request. // If an error occurs, it can be retrieved using UnregisterClientsCookie.Check() func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'UnregisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie) return UnregisterClientsCookie{cookie} @@ -809,6 +833,9 @@ type GetContextCookie struct { // GetContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply() func GetContext(c *xgb.Conn, Context Context) GetContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getContextRequest(c, Context), cookie) return GetContextCookie{cookie} @@ -817,6 +844,9 @@ func GetContext(c *xgb.Conn, Context Context) GetContextCookie { // GetContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getContextRequest(c, Context), cookie) return GetContextCookie{cookie} @@ -910,6 +940,9 @@ type EnableContextCookie struct { // EnableContext sends a checked request. // If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply() func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(enableContextRequest(c, Context), cookie) return EnableContextCookie{cookie} @@ -918,6 +951,9 @@ func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { // EnableContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(enableContextRequest(c, Context), cookie) return EnableContextCookie{cookie} @@ -1024,6 +1060,9 @@ type DisableContextCookie struct { // DisableContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(disableContextRequest(c, Context), cookie) return DisableContextCookie{cookie} @@ -1032,6 +1071,9 @@ func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { // DisableContextChecked sends a checked request. // If an error occurs, it can be retrieved using DisableContextCookie.Check() func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(disableContextRequest(c, Context), cookie) return DisableContextCookie{cookie} @@ -1073,6 +1115,9 @@ type FreeContextCookie struct { // FreeContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(freeContextRequest(c, Context), cookie) return FreeContextCookie{cookie} @@ -1081,6 +1126,9 @@ func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { // FreeContextChecked sends a checked request. // If an error occurs, it can be retrieved using FreeContextCookie.Check() func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(freeContextRequest(c, Context), cookie) return FreeContextCookie{cookie} diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 65b0723..f7fa79f 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on May 11 2012 1:58:36am EDT. + This file was generated by render.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Char' +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( PictTypeIndexed = 0 PictTypeDirect = 1 @@ -1585,6 +1585,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1593,6 +1596,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -1677,6 +1683,9 @@ type QueryPictFormatsCookie struct { // QueryPictFormats sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPictFormatsCookie.Reply() func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryPictFormats' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryPictFormatsRequest(c), cookie) return QueryPictFormatsCookie{cookie} @@ -1685,6 +1694,9 @@ func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { // QueryPictFormatsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictFormatsUnchecked(c *xgb.Conn) QueryPictFormatsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryPictFormats' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryPictFormatsRequest(c), cookie) return QueryPictFormatsCookie{cookie} @@ -1791,6 +1803,9 @@ type QueryPictIndexValuesCookie struct { // QueryPictIndexValues sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPictIndexValuesCookie.Reply() func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryPictIndexValues' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) return QueryPictIndexValuesCookie{cookie} @@ -1799,6 +1814,9 @@ func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCo // QueryPictIndexValuesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictIndexValuesUnchecked(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryPictIndexValues' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryPictIndexValuesRequest(c, Format), cookie) return QueryPictIndexValuesCookie{cookie} @@ -1880,6 +1898,9 @@ type CreatePictureCookie struct { // CreatePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) return CreatePictureCookie{cookie} @@ -1888,6 +1909,9 @@ func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pi // CreatePictureChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePictureCookie.Check() func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) return CreatePictureCookie{cookie} @@ -1943,6 +1967,9 @@ type ChangePictureCookie struct { // ChangePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) return ChangePictureCookie{cookie} @@ -1951,6 +1978,9 @@ func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []u // ChangePictureChecked sends a checked request. // If an error occurs, it can be retrieved using ChangePictureCookie.Check() func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) return ChangePictureCookie{cookie} @@ -2000,6 +2030,9 @@ type SetPictureClipRectanglesCookie struct { // SetPictureClipRectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureClipRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetPictureClipRectanglesCookie{cookie} @@ -2008,6 +2041,9 @@ func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, C // SetPictureClipRectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureClipRectanglesCookie.Check() func SetPictureClipRectanglesChecked(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureClipRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPictureClipRectanglesRequest(c, Picture, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetPictureClipRectanglesCookie{cookie} @@ -2057,6 +2093,9 @@ type FreePictureCookie struct { // FreePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(freePictureRequest(c, Picture), cookie) return FreePictureCookie{cookie} @@ -2065,6 +2104,9 @@ func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { // FreePictureChecked sends a checked request. // If an error occurs, it can be retrieved using FreePictureCookie.Check() func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(freePictureRequest(c, Picture), cookie) return FreePictureCookie{cookie} @@ -2106,6 +2148,9 @@ type CompositeCookie struct { // Composite sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return CompositeCookie{cookie} @@ -2114,6 +2159,9 @@ func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, Src // CompositeChecked sends a checked request. // If an error occurs, it can be retrieved using CompositeCookie.Check() func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) return CompositeCookie{cookie} @@ -2190,6 +2238,9 @@ type TrapezoidsCookie struct { // Trapezoids sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Trapezoids' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return TrapezoidsCookie{cookie} @@ -2198,6 +2249,9 @@ func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictf // TrapezoidsChecked sends a checked request. // If an error occurs, it can be retrieved using TrapezoidsCookie.Check() func TrapezoidsChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Trapezoids' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(trapezoidsRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Traps), cookie) return TrapezoidsCookie{cookie} @@ -2258,6 +2312,9 @@ type TrianglesCookie struct { // Triangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return TrianglesCookie{cookie} @@ -2266,6 +2323,9 @@ func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictfo // TrianglesChecked sends a checked request. // If an error occurs, it can be retrieved using TrianglesCookie.Check() func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) return TrianglesCookie{cookie} @@ -2326,6 +2386,9 @@ type TriStripCookie struct { // TriStrip sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'TriStrip' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriStripCookie{cookie} @@ -2334,6 +2397,9 @@ func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictfor // TriStripChecked sends a checked request. // If an error occurs, it can be retrieved using TriStripCookie.Check() func TriStripChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'TriStrip' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(triStripRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriStripCookie{cookie} @@ -2394,6 +2460,9 @@ type TriFanCookie struct { // TriFan sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriFanCookie{cookie} @@ -2402,6 +2471,9 @@ func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictforma // TriFanChecked sends a checked request. // If an error occurs, it can be retrieved using TriFanCookie.Check() func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) return TriFanCookie{cookie} @@ -2462,6 +2534,9 @@ type CreateGlyphSetCookie struct { // CreateGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) return CreateGlyphSetCookie{cookie} @@ -2470,6 +2545,9 @@ func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSe // CreateGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using CreateGlyphSetCookie.Check() func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) return CreateGlyphSetCookie{cookie} @@ -2514,6 +2592,9 @@ type ReferenceGlyphSetCookie struct { // ReferenceGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) return ReferenceGlyphSetCookie{cookie} @@ -2522,6 +2603,9 @@ func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceG // ReferenceGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using ReferenceGlyphSetCookie.Check() func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) return ReferenceGlyphSetCookie{cookie} @@ -2566,6 +2650,9 @@ type FreeGlyphSetCookie struct { // FreeGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) return FreeGlyphSetCookie{cookie} @@ -2574,6 +2661,9 @@ func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { // FreeGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using FreeGlyphSetCookie.Check() func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) return FreeGlyphSetCookie{cookie} @@ -2615,6 +2705,9 @@ type AddGlyphsCookie struct { // AddGlyphs sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return AddGlyphsCookie{cookie} @@ -2623,6 +2716,9 @@ func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint // AddGlyphsChecked sends a checked request. // If an error occurs, it can be retrieved using AddGlyphsCookie.Check() func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) return AddGlyphsCookie{cookie} @@ -2678,6 +2774,9 @@ type FreeGlyphsCookie struct { // FreeGlyphs sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) return FreeGlyphsCookie{cookie} @@ -2686,6 +2785,9 @@ func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie // FreeGlyphsChecked sends a checked request. // If an error occurs, it can be retrieved using FreeGlyphsCookie.Check() func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) return FreeGlyphsCookie{cookie} @@ -2733,6 +2835,9 @@ type CompositeGlyphs8Cookie struct { // CompositeGlyphs8 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs8Cookie{cookie} @@ -2741,6 +2846,9 @@ func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat // CompositeGlyphs8Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs8Cookie.Check() func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs8Cookie{cookie} @@ -2805,6 +2913,9 @@ type CompositeGlyphs16Cookie struct { // CompositeGlyphs16 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs16Cookie{cookie} @@ -2813,6 +2924,9 @@ func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma // CompositeGlyphs16Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs16Cookie.Check() func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs16Cookie{cookie} @@ -2877,6 +2991,9 @@ type CompositeGlyphs32Cookie struct { // CompositeGlyphs32 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs32Cookie{cookie} @@ -2885,6 +3002,9 @@ func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma // CompositeGlyphs32Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs32Cookie.Check() func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) return CompositeGlyphs32Cookie{cookie} @@ -2949,6 +3069,9 @@ type FillRectanglesCookie struct { // FillRectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) return FillRectanglesCookie{cookie} @@ -2957,6 +3080,9 @@ func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xpro // FillRectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using FillRectanglesCookie.Check() func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) return FillRectanglesCookie{cookie} @@ -3011,6 +3137,9 @@ type CreateCursorCookie struct { // CreateCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) return CreateCursorCookie{cookie} @@ -3019,6 +3148,9 @@ func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y ui // CreateCursorChecked sends a checked request. // If an error occurs, it can be retrieved using CreateCursorCookie.Check() func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) return CreateCursorCookie{cookie} @@ -3069,6 +3201,9 @@ type SetPictureTransformCookie struct { // SetPictureTransform sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) return SetPictureTransformCookie{cookie} @@ -3077,6 +3212,9 @@ func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetP // SetPictureTransformChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureTransformCookie.Check() func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) return SetPictureTransformCookie{cookie} @@ -3124,6 +3262,9 @@ type QueryFiltersCookie struct { // QueryFilters sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryFiltersCookie.Reply() func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryFiltersRequest(c, Drawable), cookie) return QueryFiltersCookie{cookie} @@ -3132,6 +3273,9 @@ func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { // QueryFiltersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryFiltersRequest(c, Drawable), cookie) return QueryFiltersCookie{cookie} @@ -3225,6 +3369,9 @@ type SetPictureFilterCookie struct { // SetPictureFilter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) return SetPictureFilterCookie{cookie} @@ -3233,6 +3380,9 @@ func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter str // SetPictureFilterChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureFilterCookie.Check() func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) return SetPictureFilterCookie{cookie} @@ -3288,6 +3438,9 @@ type CreateAnimCursorCookie struct { // CreateAnimCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) return CreateAnimCursorCookie{cookie} @@ -3296,6 +3449,9 @@ func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) C // CreateAnimCursorChecked sends a checked request. // If an error occurs, it can be retrieved using CreateAnimCursorCookie.Check() func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) return CreateAnimCursorCookie{cookie} @@ -3339,6 +3495,9 @@ type AddTrapsCookie struct { // AddTraps sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) return AddTrapsCookie{cookie} @@ -3347,6 +3506,9 @@ func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap // AddTrapsChecked sends a checked request. // If an error occurs, it can be retrieved using AddTrapsCookie.Check() func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) return AddTrapsCookie{cookie} @@ -3396,6 +3558,9 @@ type CreateSolidFillCookie struct { // CreateSolidFill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) return CreateSolidFillCookie{cookie} @@ -3404,6 +3569,9 @@ func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillC // CreateSolidFillChecked sends a checked request. // If an error occurs, it can be retrieved using CreateSolidFillCookie.Check() func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) return CreateSolidFillCookie{cookie} @@ -3451,6 +3619,9 @@ type CreateLinearGradientCookie struct { // CreateLinearGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) return CreateLinearGradientCookie{cookie} @@ -3459,6 +3630,9 @@ func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix // CreateLinearGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateLinearGradientCookie.Check() func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) return CreateLinearGradientCookie{cookie} @@ -3523,6 +3697,9 @@ type CreateRadialGradientCookie struct { // CreateRadialGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return CreateRadialGradientCookie{cookie} @@ -3531,6 +3708,9 @@ func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Po // CreateRadialGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRadialGradientCookie.Check() func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) return CreateRadialGradientCookie{cookie} @@ -3601,6 +3781,9 @@ type CreateConicalGradientCookie struct { // CreateConicalGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) return CreateConicalGradientCookie{cookie} @@ -3609,6 +3792,9 @@ func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle // CreateConicalGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateConicalGradientCookie.Check() func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) return CreateConicalGradientCookie{cookie} diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 56f4691..c5700c3 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on May 11 2012 1:58:36am EDT. + This file was generated by res.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,12 @@ func init() { xgb.NewExtErrorFuncs["X-Resource"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Byte' -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - type Client struct { ResourceBase uint32 ResourceMask uint32 @@ -180,6 +180,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} @@ -188,6 +191,9 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} @@ -269,6 +275,9 @@ type QueryClientsCookie struct { // QueryClients sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() func QueryClients(c *xgb.Conn) QueryClientsCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryClientsRequest(c), cookie) return QueryClientsCookie{cookie} @@ -277,6 +286,9 @@ func QueryClients(c *xgb.Conn) QueryClientsCookie { // QueryClientsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryClientsRequest(c), cookie) return QueryClientsCookie{cookie} @@ -355,6 +367,9 @@ type QueryClientResourcesCookie struct { // QueryClientResources sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientResourcesCookie.Reply() func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) return QueryClientResourcesCookie{cookie} @@ -363,6 +378,9 @@ func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { // QueryClientResourcesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryClientResourcesRequest(c, Xid), cookie) return QueryClientResourcesCookie{cookie} @@ -444,6 +462,9 @@ type QueryClientPixmapBytesCookie struct { // QueryClientPixmapBytes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) return QueryClientPixmapBytesCookie{cookie} @@ -452,6 +473,9 @@ func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCooki // QueryClientPixmapBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) return QueryClientPixmapBytesCookie{cookie} diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index 932e753..a06d8a6 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on May 11 2012 1:58:36am EDT. + This file was generated by screensaver.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + const ( KindBlanked = 0 KindInternal = 1 @@ -222,6 +222,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -230,6 +233,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -316,6 +322,9 @@ type QueryInfoCookie struct { // QueryInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryInfoCookie.Reply() func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryInfo' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryInfoRequest(c, Drawable), cookie) return QueryInfoCookie{cookie} @@ -324,6 +333,9 @@ func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { // QueryInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryInfo' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryInfoRequest(c, Drawable), cookie) return QueryInfoCookie{cookie} @@ -418,6 +430,9 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) return SelectInputCookie{cookie} @@ -426,6 +441,9 @@ func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) Select // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie) return SelectInputCookie{cookie} @@ -470,6 +488,9 @@ type SetAttributesCookie struct { // SetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'SetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return SetAttributesCookie{cookie} @@ -478,6 +499,9 @@ func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Widt // SetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using SetAttributesCookie.Check() func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'SetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie) return SetAttributesCookie{cookie} @@ -551,6 +575,9 @@ type UnsetAttributesCookie struct { // UnsetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) return UnsetAttributesCookie{cookie} @@ -559,6 +586,9 @@ func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCooki // UnsetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using UnsetAttributesCookie.Check() func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) return UnsetAttributesCookie{cookie} @@ -600,6 +630,9 @@ type SuspendCookie struct { // Suspend sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'Suspend' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(suspendRequest(c, Suspend), cookie) return SuspendCookie{cookie} @@ -608,6 +641,9 @@ func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { // SuspendChecked sends a checked request. // If an error occurs, it can be retrieved using SuspendCookie.Check() func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'Suspend' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(suspendRequest(c, Suspend), cookie) return SuspendCookie{cookie} diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 8989000..83d9020 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on May 11 2012 1:58:36am EDT. + This file was generated by shape.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( SoSet = 0 SoUnion = 1 @@ -217,6 +217,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -225,6 +228,9 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -300,6 +306,9 @@ type RectanglesCookie struct { // Rectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return RectanglesCookie{cookie} @@ -308,6 +317,9 @@ func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, // RectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using RectanglesCookie.Check() func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) return RectanglesCookie{cookie} @@ -368,6 +380,9 @@ type MaskCookie struct { // Mask sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return MaskCookie{cookie} @@ -376,6 +391,9 @@ func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xpr // MaskChecked sends a checked request. // If an error occurs, it can be retrieved using MaskCookie.Check() func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) return MaskCookie{cookie} @@ -434,6 +452,9 @@ type CombineCookie struct { // Combine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Combine' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return CombineCookie{cookie} @@ -442,6 +463,9 @@ func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, D // CombineChecked sends a checked request. // If an error occurs, it can be retrieved using CombineCookie.Check() func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Combine' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie) return CombineCookie{cookie} @@ -503,6 +527,9 @@ type OffsetCookie struct { // Offset sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Offset' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return OffsetCookie{cookie} @@ -511,6 +538,9 @@ func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, // OffsetChecked sends a checked request. // If an error occurs, it can be retrieved using OffsetCookie.Check() func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Offset' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie) return OffsetCookie{cookie} @@ -563,6 +593,9 @@ type QueryExtentsCookie struct { // QueryExtents sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtentsCookie.Reply() func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryExtents' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) return QueryExtentsCookie{cookie} @@ -571,6 +604,9 @@ func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCook // QueryExtentsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryExtents' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie) return QueryExtentsCookie{cookie} @@ -692,6 +728,9 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) return SelectInputCookie{cookie} @@ -700,6 +739,9 @@ func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) Sele // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie) return SelectInputCookie{cookie} @@ -750,6 +792,9 @@ type InputSelectedCookie struct { // InputSelected sends a checked request. // If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply() func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) return InputSelectedCookie{cookie} @@ -758,6 +803,9 @@ func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCo // InputSelectedUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) return InputSelectedCookie{cookie} @@ -833,6 +881,9 @@ type GetRectanglesCookie struct { // GetRectangles sends a checked request. // If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply() func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) return GetRectanglesCookie{cookie} @@ -841,6 +892,9 @@ func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectan // GetRectanglesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) return GetRectanglesCookie{cookie} diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index 6ae886d..ac53579 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on May 11 2012 1:58:36am EDT. + This file was generated by shm.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,12 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - type Seg uint32 func NewSegId(c *xgb.Conn) (Seg, error) { @@ -220,6 +220,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -228,6 +231,9 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -323,6 +329,9 @@ type AttachCookie struct { // Attach sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'Attach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) return AttachCookie{cookie} @@ -331,6 +340,9 @@ func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { // AttachChecked sends a checked request. // If an error occurs, it can be retrieved using AttachCookie.Check() func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'Attach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie) return AttachCookie{cookie} @@ -384,6 +396,9 @@ type DetachCookie struct { // Detach sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'Detach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(detachRequest(c, Shmseg), cookie) return DetachCookie{cookie} @@ -392,6 +407,9 @@ func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { // DetachChecked sends a checked request. // If an error occurs, it can be retrieved using DetachCookie.Check() func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'Detach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(detachRequest(c, Shmseg), cookie) return DetachCookie{cookie} @@ -433,6 +451,9 @@ type PutImageCookie struct { // PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return PutImageCookie{cookie} @@ -441,6 +462,9 @@ func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWi // PutImageChecked sends a checked request. // If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) return PutImageCookie{cookie} @@ -526,6 +550,9 @@ type GetImageCookie struct { // GetImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'GetImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return GetImageCookie{cookie} @@ -534,6 +561,9 @@ func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uin // GetImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'GetImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie) return GetImageCookie{cookie} @@ -639,6 +669,9 @@ type CreatePixmapCookie struct { // CreatePixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return CreatePixmapCookie{cookie} @@ -647,6 +680,9 @@ func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Widt // CreatePixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) return CreatePixmapCookie{cookie} diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 1904963..5aa019e 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on May 11 2012 1:58:36am EDT. + This file was generated by sync.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - const ( AlarmstateActive = 0 AlarmstateInactive = 1 @@ -750,6 +750,9 @@ type InitializeCookie struct { // Initialize sends a checked request. // If an error occurs, it will be returned with the reply by calling InitializeCookie.Reply() func Initialize(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Initialize' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) return InitializeCookie{cookie} @@ -758,6 +761,9 @@ func Initialize(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) // InitializeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InitializeUnchecked(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Initialize' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) return InitializeCookie{cookie} @@ -842,6 +848,9 @@ type ListSystemCountersCookie struct { // ListSystemCounters sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSystemCountersCookie.Reply() func ListSystemCounters(c *xgb.Conn) ListSystemCountersCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ListSystemCounters' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listSystemCountersRequest(c), cookie) return ListSystemCountersCookie{cookie} @@ -850,6 +859,9 @@ func ListSystemCounters(c *xgb.Conn) ListSystemCountersCookie { // ListSystemCountersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSystemCountersUnchecked(c *xgb.Conn) ListSystemCountersCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ListSystemCounters' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listSystemCountersRequest(c), cookie) return ListSystemCountersCookie{cookie} @@ -928,6 +940,9 @@ type CreateCounterCookie struct { // CreateCounter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) return CreateCounterCookie{cookie} @@ -936,6 +951,9 @@ func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCoo // CreateCounterChecked sends a checked request. // If an error occurs, it can be retrieved using CreateCounterCookie.Check() func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) return CreateCounterCookie{cookie} @@ -983,6 +1001,9 @@ type DestroyCounterCookie struct { // DestroyCounter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyCounterRequest(c, Counter), cookie) return DestroyCounterCookie{cookie} @@ -991,6 +1012,9 @@ func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { // DestroyCounterChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyCounterCookie.Check() func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyCounterRequest(c, Counter), cookie) return DestroyCounterCookie{cookie} @@ -1032,6 +1056,9 @@ type QueryCounterCookie struct { // QueryCounter sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryCounterCookie.Reply() func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryCounterRequest(c, Counter), cookie) return QueryCounterCookie{cookie} @@ -1040,6 +1067,9 @@ func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { // QueryCounterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryCounterRequest(c, Counter), cookie) return QueryCounterCookie{cookie} @@ -1114,6 +1144,9 @@ type AwaitCookie struct { // Await sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(awaitRequest(c, WaitList), cookie) return AwaitCookie{cookie} @@ -1122,6 +1155,9 @@ func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { // AwaitChecked sends a checked request. // If an error occurs, it can be retrieved using AwaitCookie.Check() func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(awaitRequest(c, WaitList), cookie) return AwaitCookie{cookie} @@ -1162,6 +1198,9 @@ type ChangeCounterCookie struct { // ChangeCounter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) return ChangeCounterCookie{cookie} @@ -1170,6 +1209,9 @@ func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCook // ChangeCounterChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeCounterCookie.Check() func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) return ChangeCounterCookie{cookie} @@ -1217,6 +1259,9 @@ type SetCounterCookie struct { // SetCounter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setCounterRequest(c, Counter, Value), cookie) return SetCounterCookie{cookie} @@ -1225,6 +1270,9 @@ func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { // SetCounterChecked sends a checked request. // If an error occurs, it can be retrieved using SetCounterCookie.Check() func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setCounterRequest(c, Counter, Value), cookie) return SetCounterCookie{cookie} @@ -1272,6 +1320,9 @@ type CreateAlarmCookie struct { // CreateAlarm sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) return CreateAlarmCookie{cookie} @@ -1280,6 +1331,9 @@ func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) Cr // CreateAlarmChecked sends a checked request. // If an error occurs, it can be retrieved using CreateAlarmCookie.Check() func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) return CreateAlarmCookie{cookie} @@ -1329,6 +1383,9 @@ type ChangeAlarmCookie struct { // ChangeAlarm sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) return ChangeAlarmCookie{cookie} @@ -1337,6 +1394,9 @@ func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) Ch // ChangeAlarmChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeAlarmCookie.Check() func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) return ChangeAlarmCookie{cookie} @@ -1386,6 +1446,9 @@ type DestroyAlarmCookie struct { // DestroyAlarm sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) return DestroyAlarmCookie{cookie} @@ -1394,6 +1457,9 @@ func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { // DestroyAlarmChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyAlarmCookie.Check() func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) return DestroyAlarmCookie{cookie} @@ -1435,6 +1501,9 @@ type QueryAlarmCookie struct { // QueryAlarm sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryAlarmCookie.Reply() func QueryAlarm(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryAlarmRequest(c, Alarm), cookie) return QueryAlarmCookie{cookie} @@ -1443,6 +1512,9 @@ func QueryAlarm(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { // QueryAlarmUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAlarmUnchecked(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryAlarmRequest(c, Alarm), cookie) return QueryAlarmCookie{cookie} @@ -1536,6 +1608,9 @@ type SetPriorityCookie struct { // SetPriority sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) return SetPriorityCookie{cookie} @@ -1544,6 +1619,9 @@ func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { // SetPriorityChecked sends a checked request. // If an error occurs, it can be retrieved using SetPriorityCookie.Check() func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) return SetPriorityCookie{cookie} @@ -1588,6 +1666,9 @@ type GetPriorityCookie struct { // GetPriority sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPriorityCookie.Reply() func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPriorityRequest(c, Id), cookie) return GetPriorityCookie{cookie} @@ -1596,6 +1677,9 @@ func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { // GetPriorityUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPriorityRequest(c, Id), cookie) return GetPriorityCookie{cookie} @@ -1670,6 +1754,9 @@ type CreateFenceCookie struct { // CreateFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) return CreateFenceCookie{cookie} @@ -1678,6 +1765,9 @@ func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTr // CreateFenceChecked sends a checked request. // If an error occurs, it can be retrieved using CreateFenceCookie.Check() func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) return CreateFenceCookie{cookie} @@ -1729,6 +1819,9 @@ type TriggerFenceCookie struct { // TriggerFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(triggerFenceRequest(c, Fence), cookie) return TriggerFenceCookie{cookie} @@ -1737,6 +1830,9 @@ func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { // TriggerFenceChecked sends a checked request. // If an error occurs, it can be retrieved using TriggerFenceCookie.Check() func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(triggerFenceRequest(c, Fence), cookie) return TriggerFenceCookie{cookie} @@ -1778,6 +1874,9 @@ type ResetFenceCookie struct { // ResetFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(resetFenceRequest(c, Fence), cookie) return ResetFenceCookie{cookie} @@ -1786,6 +1885,9 @@ func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { // ResetFenceChecked sends a checked request. // If an error occurs, it can be retrieved using ResetFenceCookie.Check() func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(resetFenceRequest(c, Fence), cookie) return ResetFenceCookie{cookie} @@ -1827,6 +1929,9 @@ type DestroyFenceCookie struct { // DestroyFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyFenceRequest(c, Fence), cookie) return DestroyFenceCookie{cookie} @@ -1835,6 +1940,9 @@ func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { // DestroyFenceChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyFenceCookie.Check() func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyFenceRequest(c, Fence), cookie) return DestroyFenceCookie{cookie} @@ -1876,6 +1984,9 @@ type QueryFenceCookie struct { // QueryFence sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryFenceCookie.Reply() func QueryFence(c *xgb.Conn, Fence Fence) QueryFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryFenceRequest(c, Fence), cookie) return QueryFenceCookie{cookie} @@ -1884,6 +1995,9 @@ func QueryFence(c *xgb.Conn, Fence Fence) QueryFenceCookie { // QueryFenceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFenceUnchecked(c *xgb.Conn, Fence Fence) QueryFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'QueryFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryFenceRequest(c, Fence), cookie) return QueryFenceCookie{cookie} @@ -1965,6 +2079,9 @@ type AwaitFenceCookie struct { // AwaitFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(awaitFenceRequest(c, FenceList), cookie) return AwaitFenceCookie{cookie} @@ -1973,6 +2090,9 @@ func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { // AwaitFenceChecked sends a checked request. // If an error occurs, it can be retrieved using AwaitFenceCookie.Check() func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(awaitFenceRequest(c, FenceList), cookie) return AwaitFenceCookie{cookie} diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 7171969..0a4b4ce 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 11 2012 1:58:36am EDT. + This file was generated by xc_misc.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XC-MISC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { *xgb.Cookie @@ -72,6 +72,9 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -80,6 +83,9 @@ func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint1 // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -161,6 +167,9 @@ type GetXIDRangeCookie struct { // GetXIDRange sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} @@ -169,6 +178,9 @@ func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { // GetXIDRangeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} @@ -244,6 +256,9 @@ type GetXIDListCookie struct { // GetXIDList sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDListCookie.Reply() func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} @@ -252,6 +267,9 @@ func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { // GetXIDListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index ef02e2c..0628ffd 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on May 11 2012 1:58:36am EDT. + This file was generated by xevie.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -122,6 +122,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -130,6 +133,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -214,6 +220,9 @@ type StartCookie struct { // Start sends a checked request. // If an error occurs, it will be returned with the reply by calling StartCookie.Reply() func Start(c *xgb.Conn, Screen uint32) StartCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(startRequest(c, Screen), cookie) return StartCookie{cookie} @@ -222,6 +231,9 @@ func Start(c *xgb.Conn, Screen uint32) StartCookie { // StartUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(startRequest(c, Screen), cookie) return StartCookie{cookie} @@ -295,6 +307,9 @@ type EndCookie struct { // End sends a checked request. // If an error occurs, it will be returned with the reply by calling EndCookie.Reply() func End(c *xgb.Conn, Cmap uint32) EndCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(endRequest(c, Cmap), cookie) return EndCookie{cookie} @@ -303,6 +318,9 @@ func End(c *xgb.Conn, Cmap uint32) EndCookie { // EndUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(endRequest(c, Cmap), cookie) return EndCookie{cookie} @@ -376,6 +394,9 @@ type SendCookie struct { // Send sends a checked request. // If an error occurs, it will be returned with the reply by calling SendCookie.Reply() func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'Send' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(sendRequest(c, Event, DataType), cookie) return SendCookie{cookie} @@ -384,6 +405,9 @@ func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { // SendUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'Send' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(sendRequest(c, Event, DataType), cookie) return SendCookie{cookie} @@ -465,6 +489,9 @@ type SelectInputCookie struct { // SelectInput sends a checked request. // If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply() func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(selectInputRequest(c, EventMask), cookie) return SelectInputCookie{cookie} @@ -473,6 +500,9 @@ func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { // SelectInputUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(selectInputRequest(c, EventMask), cookie) return SelectInputCookie{cookie} diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 1d7dd72..f0224a5 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on May 11 2012 1:58:36am EDT. + This file was generated by xf86dri.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + type DrmClipRect struct { X1 int16 Y1 int16 @@ -140,6 +140,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -148,6 +151,9 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -227,6 +233,9 @@ type QueryDirectRenderingCapableCookie struct { // QueryDirectRenderingCapable sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) return QueryDirectRenderingCapableCookie{cookie} @@ -235,6 +244,9 @@ func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderin // QueryDirectRenderingCapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) return QueryDirectRenderingCapableCookie{cookie} @@ -313,6 +325,9 @@ type OpenConnectionCookie struct { // OpenConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(openConnectionRequest(c, Screen), cookie) return OpenConnectionCookie{cookie} @@ -321,6 +336,9 @@ func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { // OpenConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(openConnectionRequest(c, Screen), cookie) return OpenConnectionCookie{cookie} @@ -414,6 +432,9 @@ type CloseConnectionCookie struct { // CloseConnection sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(closeConnectionRequest(c, Screen), cookie) return CloseConnectionCookie{cookie} @@ -422,6 +443,9 @@ func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { // CloseConnectionChecked sends a checked request. // If an error occurs, it can be retrieved using CloseConnectionCookie.Check() func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(closeConnectionRequest(c, Screen), cookie) return CloseConnectionCookie{cookie} @@ -463,6 +487,9 @@ type GetClientDriverNameCookie struct { // GetClientDriverName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientDriverNameCookie.Reply() func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) return GetClientDriverNameCookie{cookie} @@ -471,6 +498,9 @@ func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { // GetClientDriverNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getClientDriverNameRequest(c, Screen), cookie) return GetClientDriverNameCookie{cookie} @@ -568,6 +598,9 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) return CreateContextCookie{cookie} @@ -576,6 +609,9 @@ func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) Cr // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) return CreateContextCookie{cookie} @@ -656,6 +692,9 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) return DestroyContextCookie{cookie} @@ -664,6 +703,9 @@ func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCo // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) return DestroyContextCookie{cookie} @@ -708,6 +750,9 @@ type CreateDrawableCookie struct { // CreateDrawable sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) return CreateDrawableCookie{cookie} @@ -716,6 +761,9 @@ func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableC // CreateDrawableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) return CreateDrawableCookie{cookie} @@ -793,6 +841,9 @@ type DestroyDrawableCookie struct { // DestroyDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) return DestroyDrawableCookie{cookie} @@ -801,6 +852,9 @@ func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawabl // DestroyDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) return DestroyDrawableCookie{cookie} @@ -845,6 +899,9 @@ type GetDrawableInfoCookie struct { // GetDrawableInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDrawableInfoCookie.Reply() func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) return GetDrawableInfoCookie{cookie} @@ -853,6 +910,9 @@ func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInf // GetDrawableInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie) return GetDrawableInfoCookie{cookie} @@ -974,6 +1034,9 @@ type GetDeviceInfoCookie struct { // GetDeviceInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) return GetDeviceInfoCookie{cookie} @@ -982,6 +1045,9 @@ func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { // GetDeviceInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) return GetDeviceInfoCookie{cookie} @@ -1084,6 +1150,9 @@ type AuthConnectionCookie struct { // AuthConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) return AuthConnectionCookie{cookie} @@ -1092,6 +1161,9 @@ func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCook // AuthConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) return AuthConnectionCookie{cookie} diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 01f271c..be41acd 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 11 2012 1:58:36am EDT. + This file was generated by xf86vidmode.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( ModeFlagPositiveHsync = 1 ModeFlagNegativeHsync = 2 @@ -557,6 +557,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -565,6 +568,9 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -640,6 +646,9 @@ type GetModeLineCookie struct { // GetModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getModeLineRequest(c, Screen), cookie) return GetModeLineCookie{cookie} @@ -648,6 +657,9 @@ func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { // GetModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getModeLineRequest(c, Screen), cookie) return GetModeLineCookie{cookie} @@ -779,6 +791,9 @@ type ModModeLineCookie struct { // ModModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ModModeLineCookie{cookie} @@ -787,6 +802,9 @@ func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, // ModModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using ModModeLineCookie.Check() func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ModModeLineCookie{cookie} @@ -868,6 +886,9 @@ type SwitchModeCookie struct { // SwitchMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) return SwitchModeCookie{cookie} @@ -876,6 +897,9 @@ func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { // SwitchModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchModeCookie.Check() func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) return SwitchModeCookie{cookie} @@ -920,6 +944,9 @@ type GetMonitorCookie struct { // GetMonitor sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getMonitorRequest(c, Screen), cookie) return GetMonitorCookie{cookie} @@ -928,6 +955,9 @@ func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { // GetMonitorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getMonitorRequest(c, Screen), cookie) return GetMonitorCookie{cookie} @@ -1056,6 +1086,9 @@ type LockModeSwitchCookie struct { // LockModeSwitch sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) return LockModeSwitchCookie{cookie} @@ -1064,6 +1097,9 @@ func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCooki // LockModeSwitchChecked sends a checked request. // If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) return LockModeSwitchCookie{cookie} @@ -1108,6 +1144,9 @@ type GetAllModeLinesCookie struct { // GetAllModeLines sends a checked request. // If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) return GetAllModeLinesCookie{cookie} @@ -1116,6 +1155,9 @@ func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { // GetAllModeLinesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) return GetAllModeLinesCookie{cookie} @@ -1199,6 +1241,9 @@ type AddModeLineCookie struct { // AddModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) return AddModeLineCookie{cookie} @@ -1207,6 +1252,9 @@ func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, // AddModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using AddModeLineCookie.Check() func AddModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(addModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, AfterDotclock, AfterHdisplay, AfterHsyncstart, AfterHsyncend, AfterHtotal, AfterHskew, AfterVdisplay, AfterVsyncstart, AfterVsyncend, AfterVtotal, AfterFlags, Private), cookie) return AddModeLineCookie{cookie} @@ -1328,6 +1376,9 @@ type DeleteModeLineCookie struct { // DeleteModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return DeleteModeLineCookie{cookie} @@ -1336,6 +1387,9 @@ func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint // DeleteModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteModeLineCookie.Check() func DeleteModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deleteModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return DeleteModeLineCookie{cookie} @@ -1420,6 +1474,9 @@ type ValidateModeLineCookie struct { // ValidateModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ValidateModeLineCookie{cookie} @@ -1428,6 +1485,9 @@ func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay ui // ValidateModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return ValidateModeLineCookie{cookie} @@ -1548,6 +1608,9 @@ type SwitchToModeCookie struct { // SwitchToMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return SwitchToModeCookie{cookie} @@ -1556,6 +1619,9 @@ func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16 // SwitchToModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchToModeCookie.Check() func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) return SwitchToModeCookie{cookie} @@ -1640,6 +1706,9 @@ type GetViewPortCookie struct { // GetViewPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getViewPortRequest(c, Screen), cookie) return GetViewPortCookie{cookie} @@ -1648,6 +1717,9 @@ func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { // GetViewPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getViewPortRequest(c, Screen), cookie) return GetViewPortCookie{cookie} @@ -1731,6 +1803,9 @@ type SetViewPortCookie struct { // SetViewPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) return SetViewPortCookie{cookie} @@ -1739,6 +1814,9 @@ func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCook // SetViewPortChecked sends a checked request. // If an error occurs, it can be retrieved using SetViewPortCookie.Check() func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) return SetViewPortCookie{cookie} @@ -1788,6 +1866,9 @@ type GetDotClocksCookie struct { // GetDotClocks sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDotClocksCookie.Reply() func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDotClocksRequest(c, Screen), cookie) return GetDotClocksCookie{cookie} @@ -1796,6 +1877,9 @@ func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { // GetDotClocksUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDotClocksUnchecked(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDotClocksRequest(c, Screen), cookie) return GetDotClocksCookie{cookie} @@ -1891,6 +1975,9 @@ type SetClientVersionCookie struct { // SetClientVersion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) return SetClientVersionCookie{cookie} @@ -1899,6 +1986,9 @@ func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionC // SetClientVersionChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientVersionCookie.Check() func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) return SetClientVersionCookie{cookie} @@ -1943,6 +2033,9 @@ type SetGammaCookie struct { // SetGamma sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) return SetGammaCookie{cookie} @@ -1951,6 +2044,9 @@ func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) // SetGammaChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaCookie.Check() func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) return SetGammaCookie{cookie} @@ -2005,6 +2101,9 @@ type GetGammaCookie struct { // GetGamma sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaCookie.Reply() func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getGammaRequest(c, Screen), cookie) return GetGammaCookie{cookie} @@ -2013,6 +2112,9 @@ func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { // GetGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaUnchecked(c *xgb.Conn, Screen uint16) GetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getGammaRequest(c, Screen), cookie) return GetGammaCookie{cookie} @@ -2100,6 +2202,9 @@ type GetGammaRampCookie struct { // GetGammaRamp sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampCookie.Reply() func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) return GetGammaRampCookie{cookie} @@ -2108,6 +2213,9 @@ func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { // GetGammaRampUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampUnchecked(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getGammaRampRequest(c, Screen, Size), cookie) return GetGammaRampCookie{cookie} @@ -2212,6 +2320,9 @@ type SetGammaRampCookie struct { // SetGammaRamp sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) return SetGammaRampCookie{cookie} @@ -2220,6 +2331,9 @@ func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green [ // SetGammaRampChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaRampCookie.Check() func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) return SetGammaRampCookie{cookie} @@ -2282,6 +2396,9 @@ type GetGammaRampSizeCookie struct { // GetGammaRampSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampSizeCookie.Reply() func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) return GetGammaRampSizeCookie{cookie} @@ -2290,6 +2407,9 @@ func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { // GetGammaRampSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampSizeUnchecked(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getGammaRampSizeRequest(c, Screen), cookie) return GetGammaRampSizeCookie{cookie} @@ -2369,6 +2489,9 @@ type GetPermissionsCookie struct { // GetPermissions sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPermissionsCookie.Reply() func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPermissionsRequest(c, Screen), cookie) return GetPermissionsCookie{cookie} @@ -2377,6 +2500,9 @@ func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { // GetPermissionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPermissionsUnchecked(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPermissionsRequest(c, Screen), cookie) return GetPermissionsCookie{cookie} diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 67dff6a..08cb596 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on May 11 2012 1:58:36am EDT. + This file was generated by xfixes.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -42,14 +42,6 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -66,6 +58,14 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 @@ -367,6 +367,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -375,6 +378,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return QueryVersionCookie{cookie} @@ -459,6 +465,9 @@ type ChangeSaveSetCookie struct { // ChangeSaveSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeSaveSet' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) return ChangeSaveSetCookie{cookie} @@ -467,6 +476,9 @@ func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto. // ChangeSaveSetChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeSaveSet' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeSaveSetRequest(c, Mode, Target, Map, Window), cookie) return ChangeSaveSetCookie{cookie} @@ -519,6 +531,9 @@ type SelectSelectionInputCookie struct { // SelectSelectionInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) return SelectSelectionInputCookie{cookie} @@ -527,6 +542,9 @@ func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.At // SelectSelectionInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectSelectionInputCookie.Check() func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) return SelectSelectionInputCookie{cookie} @@ -574,6 +592,9 @@ type SelectCursorInputCookie struct { // SelectCursorInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) return SelectCursorInputCookie{cookie} @@ -582,6 +603,9 @@ func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) Sele // SelectCursorInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectCursorInputCookie.Check() func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) return SelectCursorInputCookie{cookie} @@ -626,6 +650,9 @@ type GetCursorImageCookie struct { // GetCursorImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorImageCookie.Reply() func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorImage' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCursorImageRequest(c), cookie) return GetCursorImageCookie{cookie} @@ -634,6 +661,9 @@ func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { // GetCursorImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageUnchecked(c *xgb.Conn) GetCursorImageCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorImage' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCursorImageRequest(c), cookie) return GetCursorImageCookie{cookie} @@ -740,6 +770,9 @@ type CreateRegionCookie struct { // CreateRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) return CreateRegionCookie{cookie} @@ -748,6 +781,9 @@ func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) Cre // CreateRegionChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionCookie.Check() func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) return CreateRegionCookie{cookie} @@ -791,6 +827,9 @@ type CreateRegionFromBitmapCookie struct { // CreateRegionFromBitmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) return CreateRegionFromBitmapCookie{cookie} @@ -799,6 +838,9 @@ func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) Cr // CreateRegionFromBitmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromBitmapCookie.Check() func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) return CreateRegionFromBitmapCookie{cookie} @@ -843,6 +885,9 @@ type CreateRegionFromWindowCookie struct { // CreateRegionFromWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) return CreateRegionFromWindowCookie{cookie} @@ -851,6 +896,9 @@ func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Ki // CreateRegionFromWindowChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromWindowCookie.Check() func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) return CreateRegionFromWindowCookie{cookie} @@ -900,6 +948,9 @@ type CreateRegionFromGCCookie struct { // CreateRegionFromGC sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) return CreateRegionFromGCCookie{cookie} @@ -908,6 +959,9 @@ func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRe // CreateRegionFromGCChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromGCCookie.Check() func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) return CreateRegionFromGCCookie{cookie} @@ -952,6 +1006,9 @@ type CreateRegionFromPictureCookie struct { // CreateRegionFromPicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) return CreateRegionFromPictureCookie{cookie} @@ -960,6 +1017,9 @@ func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) // CreateRegionFromPictureChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromPictureCookie.Check() func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) return CreateRegionFromPictureCookie{cookie} @@ -1004,6 +1064,9 @@ type DestroyRegionCookie struct { // DestroyRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyRegionRequest(c, Region), cookie) return DestroyRegionCookie{cookie} @@ -1012,6 +1075,9 @@ func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { // DestroyRegionChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyRegionCookie.Check() func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyRegionRequest(c, Region), cookie) return DestroyRegionCookie{cookie} @@ -1053,6 +1119,9 @@ type SetRegionCookie struct { // SetRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) return SetRegionCookie{cookie} @@ -1061,6 +1130,9 @@ func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetReg // SetRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetRegionCookie.Check() func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) return SetRegionCookie{cookie} @@ -1104,6 +1176,9 @@ type CopyRegionCookie struct { // CopyRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) return CopyRegionCookie{cookie} @@ -1112,6 +1187,9 @@ func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie // CopyRegionChecked sends a checked request. // If an error occurs, it can be retrieved using CopyRegionCookie.Check() func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) return CopyRegionCookie{cookie} @@ -1156,6 +1234,9 @@ type UnionRegionCookie struct { // UnionRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) return UnionRegionCookie{cookie} @@ -1164,6 +1245,9 @@ func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region // UnionRegionChecked sends a checked request. // If an error occurs, it can be retrieved using UnionRegionCookie.Check() func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) return UnionRegionCookie{cookie} @@ -1211,6 +1295,9 @@ type IntersectRegionCookie struct { // IntersectRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) return IntersectRegionCookie{cookie} @@ -1219,6 +1306,9 @@ func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Re // IntersectRegionChecked sends a checked request. // If an error occurs, it can be retrieved using IntersectRegionCookie.Check() func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) return IntersectRegionCookie{cookie} @@ -1266,6 +1356,9 @@ type SubtractRegionCookie struct { // SubtractRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) return SubtractRegionCookie{cookie} @@ -1274,6 +1367,9 @@ func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Reg // SubtractRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SubtractRegionCookie.Check() func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) return SubtractRegionCookie{cookie} @@ -1321,6 +1417,9 @@ type InvertRegionCookie struct { // InvertRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) return InvertRegionCookie{cookie} @@ -1329,6 +1428,9 @@ func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destinati // InvertRegionChecked sends a checked request. // If an error occurs, it can be retrieved using InvertRegionCookie.Check() func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) return InvertRegionCookie{cookie} @@ -1379,6 +1481,9 @@ type TranslateRegionCookie struct { // TranslateRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) return TranslateRegionCookie{cookie} @@ -1387,6 +1492,9 @@ func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRe // TranslateRegionChecked sends a checked request. // If an error occurs, it can be retrieved using TranslateRegionCookie.Check() func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) return TranslateRegionCookie{cookie} @@ -1434,6 +1542,9 @@ type RegionExtentsCookie struct { // RegionExtents sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) return RegionExtentsCookie{cookie} @@ -1442,6 +1553,9 @@ func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtents // RegionExtentsChecked sends a checked request. // If an error occurs, it can be retrieved using RegionExtentsCookie.Check() func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) return RegionExtentsCookie{cookie} @@ -1486,6 +1600,9 @@ type FetchRegionCookie struct { // FetchRegion sends a checked request. // If an error occurs, it will be returned with the reply by calling FetchRegionCookie.Reply() func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(fetchRegionRequest(c, Region), cookie) return FetchRegionCookie{cookie} @@ -1494,6 +1611,9 @@ func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { // FetchRegionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(fetchRegionRequest(c, Region), cookie) return FetchRegionCookie{cookie} @@ -1575,6 +1695,9 @@ type SetGCClipRegionCookie struct { // SetGCClipRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) return SetGCClipRegionCookie{cookie} @@ -1583,6 +1706,9 @@ func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int // SetGCClipRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetGCClipRegionCookie.Check() func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) return SetGCClipRegionCookie{cookie} @@ -1633,6 +1759,9 @@ type SetWindowShapeRegionCookie struct { // SetWindowShapeRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) return SetWindowShapeRegionCookie{cookie} @@ -1641,6 +1770,9 @@ func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, // SetWindowShapeRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetWindowShapeRegionCookie.Check() func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) return SetWindowShapeRegionCookie{cookie} @@ -1696,6 +1828,9 @@ type SetPictureClipRegionCookie struct { // SetPictureClipRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) return SetPictureClipRegionCookie{cookie} @@ -1704,6 +1839,9 @@ func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XO // SetPictureClipRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureClipRegionCookie.Check() func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) return SetPictureClipRegionCookie{cookie} @@ -1754,6 +1892,9 @@ type SetCursorNameCookie struct { // SetCursorName sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) return SetCursorNameCookie{cookie} @@ -1762,6 +1903,9 @@ func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string // SetCursorNameChecked sends a checked request. // If an error occurs, it can be retrieved using SetCursorNameCookie.Check() func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) return SetCursorNameCookie{cookie} @@ -1811,6 +1955,9 @@ type GetCursorNameCookie struct { // GetCursorName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorNameCookie.Reply() func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCursorNameRequest(c, Cursor), cookie) return GetCursorNameCookie{cookie} @@ -1819,6 +1966,9 @@ func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { // GetCursorNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCursorNameRequest(c, Cursor), cookie) return GetCursorNameCookie{cookie} @@ -1908,6 +2058,9 @@ type GetCursorImageAndNameCookie struct { // GetCursorImageAndName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorImageAndNameCookie.Reply() func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorImageAndName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getCursorImageAndNameRequest(c), cookie) return GetCursorImageAndNameCookie{cookie} @@ -1916,6 +2069,9 @@ func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { // GetCursorImageAndNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageAndNameUnchecked(c *xgb.Conn) GetCursorImageAndNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorImageAndName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getCursorImageAndNameRequest(c), cookie) return GetCursorImageAndNameCookie{cookie} @@ -2038,6 +2194,9 @@ type ChangeCursorCookie struct { // ChangeCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) return ChangeCursorCookie{cookie} @@ -2046,6 +2205,9 @@ func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) // ChangeCursorChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeCursorCookie.Check() func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) return ChangeCursorCookie{cookie} @@ -2090,6 +2252,9 @@ type ChangeCursorByNameCookie struct { // ChangeCursorByName sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) return ChangeCursorByNameCookie{cookie} @@ -2098,6 +2263,9 @@ func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name stri // ChangeCursorByNameChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeCursorByNameCookie.Check() func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) return ChangeCursorByNameCookie{cookie} @@ -2147,6 +2315,9 @@ type ExpandRegionCookie struct { // ExpandRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) return ExpandRegionCookie{cookie} @@ -2155,6 +2326,9 @@ func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, R // ExpandRegionChecked sends a checked request. // If an error occurs, it can be retrieved using ExpandRegionCookie.Check() func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) return ExpandRegionCookie{cookie} @@ -2211,6 +2385,9 @@ type HideCursorCookie struct { // HideCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'HideCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(hideCursorRequest(c, Window), cookie) return HideCursorCookie{cookie} @@ -2219,6 +2396,9 @@ func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { // HideCursorChecked sends a checked request. // If an error occurs, it can be retrieved using HideCursorCookie.Check() func HideCursorChecked(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'HideCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(hideCursorRequest(c, Window), cookie) return HideCursorCookie{cookie} @@ -2260,6 +2440,9 @@ type ShowCursorCookie struct { // ShowCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ShowCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(showCursorRequest(c, Window), cookie) return ShowCursorCookie{cookie} @@ -2268,6 +2451,9 @@ func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { // ShowCursorChecked sends a checked request. // If an error occurs, it can be retrieved using ShowCursorCookie.Check() func ShowCursorChecked(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ShowCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(showCursorRequest(c, Window), cookie) return ShowCursorCookie{cookie} diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index eca0c10..62d9936 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -18,6 +18,7 @@ func (r *Request) Define(c *Context) { "by calling %s.Reply()", r.CookieName()) c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) + r.CheckExt(c) c.Putln("cookie := c.NewCookie(true, true)") c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) @@ -29,6 +30,7 @@ func (r *Request) Define(c *Context) { "xgb.WaitForEvent or xgb.PollForEvent.") c.Putln("func %sUnchecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) + r.CheckExt(c) c.Putln("cookie := c.NewCookie(false, true)") c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) @@ -42,6 +44,7 @@ func (r *Request) Define(c *Context) { "xgb.WaitForEvent or xgb.PollForEvent.") c.Putln("func %s(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) + r.CheckExt(c) c.Putln("cookie := c.NewCookie(false, false)") c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) @@ -53,6 +56,7 @@ func (r *Request) Define(c *Context) { "%s.Check()", r.CookieName()) c.Putln("func %sChecked(c *xgb.Conn, %s) %s {", r.SrcName(), r.ParamNameTypes(), r.CookieName()) + r.CheckExt(c) c.Putln("cookie := c.NewCookie(true, false)") c.Putln("c.NewRequest(%s(c, %s), cookie)", r.ReqName(), r.ParamNames()) c.Putln("return %s{cookie}", r.CookieName()) @@ -71,6 +75,18 @@ func (r *Request) Define(c *Context) { r.WriteRequest(c) } +func (r *Request) CheckExt(c *Context) { + if !c.protocol.isExt() { + return + } + c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", + strings.ToUpper(c.protocol.ExtXName)) + c.Putln("panic(\"Cannot issue request '%s' using the uninitialized " + + "extension '%s'. %s.Init(connObj) must be called first.\")", + r.SrcName(), c.protocol.ExtXName, c.protocol.PkgName()) + c.Putln("}") +} + func (r *Request) ReadReply(c *Context) { c.Putln("// %s represents the data returned from a %s request.", r.ReplyTypeName(), r.SrcName()) diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index b03a381..51b270a 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on May 11 2012 1:58:36am EDT. + This file was generated by xinerama.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,12 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -58,12 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - type ScreenInfo struct { XOrg int16 YOrg int16 @@ -140,6 +140,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) return QueryVersionCookie{cookie} @@ -148,6 +151,9 @@ func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) return QueryVersionCookie{cookie} @@ -229,6 +235,9 @@ type GetStateCookie struct { // GetState sends a checked request. // If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply() func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getStateRequest(c, Window), cookie) return GetStateCookie{cookie} @@ -237,6 +246,9 @@ func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { // GetStateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getStateRequest(c, Window), cookie) return GetStateCookie{cookie} @@ -312,6 +324,9 @@ type GetScreenCountCookie struct { // GetScreenCount sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenCountCookie.Reply() func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetScreenCount' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenCountRequest(c, Window), cookie) return GetScreenCountCookie{cookie} @@ -320,6 +335,9 @@ func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { // GetScreenCountUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetScreenCount' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenCountRequest(c, Window), cookie) return GetScreenCountCookie{cookie} @@ -395,6 +413,9 @@ type GetScreenSizeCookie struct { // GetScreenSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenSizeCookie.Reply() func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetScreenSize' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) return GetScreenSizeCookie{cookie} @@ -403,6 +424,9 @@ func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSi // GetScreenSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetScreenSize' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie) return GetScreenSizeCookie{cookie} @@ -492,6 +516,9 @@ type IsActiveCookie struct { // IsActive sends a checked request. // If an error occurs, it will be returned with the reply by calling IsActiveCookie.Reply() func IsActive(c *xgb.Conn) IsActiveCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'IsActive' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(isActiveRequest(c), cookie) return IsActiveCookie{cookie} @@ -500,6 +527,9 @@ func IsActive(c *xgb.Conn) IsActiveCookie { // IsActiveUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'IsActive' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(isActiveRequest(c), cookie) return IsActiveCookie{cookie} @@ -571,6 +601,9 @@ type QueryScreensCookie struct { // QueryScreens sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryScreensCookie.Reply() func QueryScreens(c *xgb.Conn) QueryScreensCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryScreens' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryScreensRequest(c), cookie) return QueryScreensCookie{cookie} @@ -579,6 +612,9 @@ func QueryScreens(c *xgb.Conn) QueryScreensCookie { // QueryScreensUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryScreens' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryScreensRequest(c), cookie) return QueryScreensCookie{cookie} diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 0cb711b..2ed45b8 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 11 2012 1:58:36am EDT. + This file was generated by xinput.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 @@ -4582,6 +4582,9 @@ type GetExtensionVersionCookie struct { // GetExtensionVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} @@ -4590,6 +4593,9 @@ func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionV // GetExtensionVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} @@ -4684,6 +4690,9 @@ type ListInputDevicesCookie struct { // ListInputDevices sends a checked request. // If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} @@ -4692,6 +4701,9 @@ func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { // ListInputDevicesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} @@ -4770,6 +4782,9 @@ type OpenDeviceCookie struct { // OpenDevice sends a checked request. // If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} @@ -4778,6 +4793,9 @@ func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { // OpenDeviceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} @@ -4861,6 +4879,9 @@ type CloseDeviceCookie struct { // CloseDevice sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} @@ -4869,6 +4890,9 @@ func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { // CloseDeviceChecked sends a checked request. // If an error occurs, it can be retrieved using CloseDeviceCookie.Check() func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} @@ -4912,6 +4936,9 @@ type SetDeviceModeCookie struct { // SetDeviceMode sends a checked request. // If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} @@ -4920,6 +4947,9 @@ func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { // SetDeviceModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} @@ -5002,6 +5032,9 @@ type SelectExtensionEventCookie struct { // SelectExtensionEvent sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} @@ -5010,6 +5043,9 @@ func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, // SelectExtensionEventChecked sends a checked request. // If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} @@ -5062,6 +5098,9 @@ type GetSelectedExtensionEventsCookie struct { // GetSelectedExtensionEvents sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} @@ -5070,6 +5109,9 @@ func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedEx // GetSelectedExtensionEventsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} @@ -5167,6 +5209,9 @@ type ChangeDeviceDontPropagateListCookie struct { // ChangeDeviceDontPropagateList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} @@ -5175,6 +5220,9 @@ func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses // ChangeDeviceDontPropagateListChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeDeviceDontPropagateListCookie.Check() func ChangeDeviceDontPropagateListChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} @@ -5230,6 +5278,9 @@ type GetDeviceDontPropagateListCookie struct { // GetDeviceDontPropagateList sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} @@ -5238,6 +5289,9 @@ func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDont // GetDeviceDontPropagateListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} @@ -5323,6 +5377,9 @@ type GetDeviceMotionEventsCookie struct { // GetDeviceMotionEvents sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} @@ -5331,6 +5388,9 @@ func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Time // GetDeviceMotionEventsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} @@ -5422,6 +5482,9 @@ type ChangeKeyboardDeviceCookie struct { // ChangeKeyboardDevice sends a checked request. // If an error occurs, it will be returned with the reply by calling ChangeKeyboardDeviceCookie.Reply() func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} @@ -5430,6 +5493,9 @@ func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie // ChangeKeyboardDeviceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardDeviceUnchecked(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} @@ -5509,6 +5575,9 @@ type ChangePointerDeviceCookie struct { // ChangePointerDevice sends a checked request. // If an error occurs, it will be returned with the reply by calling ChangePointerDeviceCookie.Reply() func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} @@ -5517,6 +5586,9 @@ func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) Cha // ChangePointerDeviceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePointerDeviceUnchecked(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} @@ -5602,6 +5674,9 @@ type GrabDeviceCookie struct { // GrabDevice sends a checked request. // If an error occurs, it will be returned with the reply by calling GrabDeviceCookie.Reply() func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} @@ -5610,6 +5685,9 @@ func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, Nu // GrabDeviceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceUnchecked(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} @@ -5717,6 +5795,9 @@ type UngrabDeviceCookie struct { // UngrabDevice sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} @@ -5725,6 +5806,9 @@ func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDevic // UngrabDeviceChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} @@ -5769,6 +5853,9 @@ type GrabDeviceKeyCookie struct { // GrabDeviceKey sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} @@ -5777,6 +5864,9 @@ func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Mod // GrabDeviceKeyChecked sends a checked request. // If an error occurs, it can be retrieved using GrabDeviceKeyCookie.Check() func GrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} @@ -5854,6 +5944,9 @@ type UngrabDeviceKeyCookie struct { // UngrabDeviceKey sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} @@ -5862,6 +5955,9 @@ func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, Mo // UngrabDeviceKeyChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} @@ -5915,6 +6011,9 @@ type GrabDeviceButtonCookie struct { // GrabDeviceButton sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} @@ -5923,6 +6022,9 @@ func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, // GrabDeviceButtonChecked sends a checked request. // If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} @@ -5996,6 +6098,9 @@ type UngrabDeviceButtonCookie struct { // UngrabDeviceButton sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} @@ -6004,6 +6109,9 @@ func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, // UngrabDeviceButtonChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} @@ -6057,6 +6165,9 @@ type AllowDeviceEventsCookie struct { // AllowDeviceEvents sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} @@ -6065,6 +6176,9 @@ func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId b // AllowDeviceEventsChecked sends a checked request. // If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} @@ -6112,6 +6226,9 @@ type GetDeviceFocusCookie struct { // GetDeviceFocus sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} @@ -6120,6 +6237,9 @@ func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { // GetDeviceFocusUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} @@ -6207,6 +6327,9 @@ type SetDeviceFocusCookie struct { // SetDeviceFocus sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} @@ -6215,6 +6338,9 @@ func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, Rev // SetDeviceFocusChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} @@ -6265,6 +6391,9 @@ type GetFeedbackControlCookie struct { // GetFeedbackControl sends a checked request. // If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} @@ -6273,6 +6402,9 @@ func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { // GetFeedbackControlUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} @@ -6352,6 +6484,9 @@ type GetDeviceKeyMappingCookie struct { // GetDeviceKeyMapping sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} @@ -6360,6 +6495,9 @@ func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count // GetDeviceKeyMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} @@ -6451,6 +6589,9 @@ type ChangeDeviceKeyMappingCookie struct { // ChangeDeviceKeyMapping sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} @@ -6459,6 +6600,9 @@ func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Ke // ChangeDeviceKeyMappingChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} @@ -6515,6 +6659,9 @@ type GetDeviceModifierMappingCookie struct { // GetDeviceModifierMapping sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} @@ -6523,6 +6670,9 @@ func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappi // GetDeviceModifierMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} @@ -6607,6 +6757,9 @@ type SetDeviceModifierMappingCookie struct { // SetDeviceModifierMapping sends a checked request. // If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} @@ -6615,6 +6768,9 @@ func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier by // SetDeviceModifierMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} @@ -6700,6 +6856,9 @@ type GetDeviceButtonMappingCookie struct { // GetDeviceButtonMapping sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} @@ -6708,6 +6867,9 @@ func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCo // GetDeviceButtonMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} @@ -6792,6 +6954,9 @@ type SetDeviceButtonMappingCookie struct { // SetDeviceButtonMapping sends a checked request. // If an error occurs, it will be returned with the reply by calling SetDeviceButtonMappingCookie.Reply() func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} @@ -6800,6 +6965,9 @@ func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte // SetDeviceButtonMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} @@ -6885,6 +7053,9 @@ type QueryDeviceStateCookie struct { // QueryDeviceState sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} @@ -6893,6 +7064,9 @@ func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { // QueryDeviceStateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} @@ -6972,6 +7146,9 @@ type SendExtensionEventCookie struct { // SendExtensionEvent sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} @@ -6980,6 +7157,9 @@ func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, P // SendExtensionEventChecked sends a checked request. // If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} @@ -7048,6 +7228,9 @@ type DeviceBellCookie struct { // DeviceBell sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} @@ -7056,6 +7239,9 @@ func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, // DeviceBellChecked sends a checked request. // If an error occurs, it can be retrieved using DeviceBellCookie.Check() func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} @@ -7106,6 +7292,9 @@ type SetDeviceValuatorsCookie struct { // SetDeviceValuators sends a checked request. // If an error occurs, it will be returned with the reply by calling SetDeviceValuatorsCookie.Reply() func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} @@ -7114,6 +7303,9 @@ func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValua // SetDeviceValuatorsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceValuatorsUnchecked(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} @@ -7205,6 +7397,9 @@ type GetDeviceControlCookie struct { // GetDeviceControl sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} @@ -7213,6 +7408,9 @@ func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceCon // GetDeviceControlUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 9f4bd6b..8e6f470 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on May 11 2012 1:58:37am EDT. + This file was generated by xprint.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -54,16 +64,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - const ( GetDocFinished = 0 GetDocSecondConsumer = 1 @@ -445,6 +445,9 @@ type PrintQueryVersionCookie struct { // PrintQueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printQueryVersionRequest(c), cookie) return PrintQueryVersionCookie{cookie} @@ -453,6 +456,9 @@ func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { // PrintQueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printQueryVersionRequest(c), cookie) return PrintQueryVersionCookie{cookie} @@ -528,6 +534,9 @@ type PrintGetPrinterListCookie struct { // PrintGetPrinterList sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return PrintGetPrinterListCookie{cookie} @@ -536,6 +545,9 @@ func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, P // PrintGetPrinterListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return PrintGetPrinterListCookie{cookie} @@ -632,6 +644,9 @@ type PrintRehashPrinterListCookie struct { // PrintRehashPrinterList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printRehashPrinterListRequest(c), cookie) return PrintRehashPrinterListCookie{cookie} @@ -640,6 +655,9 @@ func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { // PrintRehashPrinterListChecked sends a checked request. // If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printRehashPrinterListRequest(c), cookie) return PrintRehashPrinterListCookie{cookie} @@ -678,6 +696,9 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return CreateContextCookie{cookie} @@ -686,6 +707,9 @@ func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleL // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(createContextRequest(c, ContextId, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) return CreateContextCookie{cookie} @@ -745,6 +769,9 @@ type PrintSetContextCookie struct { // PrintSetContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printSetContextRequest(c, Context), cookie) return PrintSetContextCookie{cookie} @@ -753,6 +780,9 @@ func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { // PrintSetContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetContextCookie.Check() func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printSetContextRequest(c, Context), cookie) return PrintSetContextCookie{cookie} @@ -794,6 +824,9 @@ type PrintGetContextCookie struct { // PrintGetContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetContextCookie.Reply() func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetContextRequest(c), cookie) return PrintGetContextCookie{cookie} @@ -802,6 +835,9 @@ func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { // PrintGetContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetContextUnchecked(c *xgb.Conn) PrintGetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetContextRequest(c), cookie) return PrintGetContextCookie{cookie} @@ -873,6 +909,9 @@ type PrintDestroyContextCookie struct { // PrintDestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printDestroyContextRequest(c, Context), cookie) return PrintDestroyContextCookie{cookie} @@ -881,6 +920,9 @@ func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie // PrintDestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printDestroyContextRequest(c, Context), cookie) return PrintDestroyContextCookie{cookie} @@ -922,6 +964,9 @@ type PrintGetScreenOfContextCookie struct { // PrintGetScreenOfContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetScreenOfContextRequest(c), cookie) return PrintGetScreenOfContextCookie{cookie} @@ -930,6 +975,9 @@ func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { // PrintGetScreenOfContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetScreenOfContextRequest(c), cookie) return PrintGetScreenOfContextCookie{cookie} @@ -1001,6 +1049,9 @@ type PrintStartJobCookie struct { // PrintStartJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printStartJobRequest(c, OutputMode), cookie) return PrintStartJobCookie{cookie} @@ -1009,6 +1060,9 @@ func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { // PrintStartJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartJobCookie.Check() func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printStartJobRequest(c, OutputMode), cookie) return PrintStartJobCookie{cookie} @@ -1050,6 +1104,9 @@ type PrintEndJobCookie struct { // PrintEndJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printEndJobRequest(c, Cancel), cookie) return PrintEndJobCookie{cookie} @@ -1058,6 +1115,9 @@ func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { // PrintEndJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndJobCookie.Check() func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printEndJobRequest(c, Cancel), cookie) return PrintEndJobCookie{cookie} @@ -1103,6 +1163,9 @@ type PrintStartDocCookie struct { // PrintStartDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printStartDocRequest(c, DriverMode), cookie) return PrintStartDocCookie{cookie} @@ -1111,6 +1174,9 @@ func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { // PrintStartDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartDocCookie.Check() func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printStartDocRequest(c, DriverMode), cookie) return PrintStartDocCookie{cookie} @@ -1152,6 +1218,9 @@ type PrintEndDocCookie struct { // PrintEndDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printEndDocRequest(c, Cancel), cookie) return PrintEndDocCookie{cookie} @@ -1160,6 +1229,9 @@ func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { // PrintEndDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndDocCookie.Check() func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printEndDocRequest(c, Cancel), cookie) return PrintEndDocCookie{cookie} @@ -1205,6 +1277,9 @@ type PrintPutDocumentDataCookie struct { // PrintPutDocumentData sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return PrintPutDocumentDataCookie{cookie} @@ -1213,6 +1288,9 @@ func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, // PrintPutDocumentDataChecked sends a checked request. // If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) return PrintPutDocumentDataCookie{cookie} @@ -1278,6 +1356,9 @@ type PrintGetDocumentDataCookie struct { // PrintGetDocumentData sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetDocumentDataCookie.Reply() func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) return PrintGetDocumentDataCookie{cookie} @@ -1286,6 +1367,9 @@ func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintG // PrintGetDocumentDataUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetDocumentDataUnchecked(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetDocumentDataRequest(c, Context, MaxBytes), cookie) return PrintGetDocumentDataCookie{cookie} @@ -1379,6 +1463,9 @@ type PrintStartPageCookie struct { // PrintStartPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printStartPageRequest(c, Window), cookie) return PrintStartPageCookie{cookie} @@ -1387,6 +1474,9 @@ func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { // PrintStartPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartPageCookie.Check() func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printStartPageRequest(c, Window), cookie) return PrintStartPageCookie{cookie} @@ -1428,6 +1518,9 @@ type PrintEndPageCookie struct { // PrintEndPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printEndPageRequest(c, Cancel), cookie) return PrintEndPageCookie{cookie} @@ -1436,6 +1529,9 @@ func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { // PrintEndPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndPageCookie.Check() func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printEndPageRequest(c, Cancel), cookie) return PrintEndPageCookie{cookie} @@ -1483,6 +1579,9 @@ type PrintSelectInputCookie struct { // PrintSelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) return PrintSelectInputCookie{cookie} @@ -1491,6 +1590,9 @@ func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList // PrintSelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) return PrintSelectInputCookie{cookie} @@ -1540,6 +1642,9 @@ type PrintInputSelectedCookie struct { // PrintInputSelected sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printInputSelectedRequest(c, Context), cookie) return PrintInputSelectedCookie{cookie} @@ -1548,6 +1653,9 @@ func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie // PrintInputSelectedUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printInputSelectedRequest(c, Context), cookie) return PrintInputSelectedCookie{cookie} @@ -1642,6 +1750,9 @@ type PrintGetAttributesCookie struct { // PrintGetAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) return PrintGetAttributesCookie{cookie} @@ -1650,6 +1761,9 @@ func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttrib // PrintGetAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) return PrintGetAttributesCookie{cookie} @@ -1736,6 +1850,9 @@ type PrintGetOneAttributesCookie struct { // PrintGetOneAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetOneAttributesCookie.Reply() func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) return PrintGetOneAttributesCookie{cookie} @@ -1744,6 +1861,9 @@ func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool b // PrintGetOneAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetOneAttributesUnchecked(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetOneAttributesRequest(c, Context, NameLen, Pool, Name), cookie) return PrintGetOneAttributesCookie{cookie} @@ -1843,6 +1963,9 @@ type PrintSetAttributesCookie struct { // PrintSetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) return PrintSetAttributesCookie{cookie} @@ -1851,6 +1974,9 @@ func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool by // PrintSetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) return PrintSetAttributesCookie{cookie} @@ -1909,6 +2035,9 @@ type PrintGetPageDimensionsCookie struct { // PrintGetPageDimensions sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPageDimensionsCookie.Reply() func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) return PrintGetPageDimensionsCookie{cookie} @@ -1917,6 +2046,9 @@ func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimension // PrintGetPageDimensionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPageDimensionsUnchecked(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetPageDimensionsRequest(c, Context), cookie) return PrintGetPageDimensionsCookie{cookie} @@ -2011,6 +2143,9 @@ type PrintQueryScreensCookie struct { // PrintQueryScreens sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryScreensCookie.Reply() func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printQueryScreensRequest(c), cookie) return PrintQueryScreensCookie{cookie} @@ -2019,6 +2154,9 @@ func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { // PrintQueryScreensUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryScreensUnchecked(c *xgb.Conn) PrintQueryScreensCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printQueryScreensRequest(c), cookie) return PrintQueryScreensCookie{cookie} @@ -2101,6 +2239,9 @@ type PrintSetImageResolutionCookie struct { // PrintSetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintSetImageResolutionCookie.Reply() func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) return PrintSetImageResolutionCookie{cookie} @@ -2109,6 +2250,9 @@ func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint // PrintSetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printSetImageResolutionRequest(c, Context, ImageResolution), cookie) return PrintSetImageResolutionCookie{cookie} @@ -2191,6 +2335,9 @@ type PrintGetImageResolutionCookie struct { // PrintGetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) return PrintGetImageResolutionCookie{cookie} @@ -2199,6 +2346,9 @@ func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolut // PrintGetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) return PrintGetImageResolutionCookie{cookie} diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 5378196..f19e99e 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 11 2012 1:58:37am EDT. + This file was generated by xproto.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -23,14 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -47,6 +39,14 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 10134ff..115feb7 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 11 2012 1:58:37am EDT. + This file was generated by xselinux.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - type ListItem struct { Name xproto.Atom ObjectContextLen uint32 @@ -164,6 +164,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} @@ -172,6 +175,9 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} @@ -253,6 +259,9 @@ type SetDeviceCreateContextCookie struct { // SetDeviceCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{cookie} @@ -261,6 +270,9 @@ func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetD // SetDeviceCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{cookie} @@ -305,6 +317,9 @@ type GetDeviceCreateContextCookie struct { // GetDeviceCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} @@ -313,6 +328,9 @@ func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { // GetDeviceCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} @@ -395,6 +413,9 @@ type SetDeviceContextCookie struct { // SetDeviceContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{cookie} @@ -403,6 +424,9 @@ func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context str // SetDeviceContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{cookie} @@ -450,6 +474,9 @@ type GetDeviceContextCookie struct { // GetDeviceContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceContextCookie.Reply() func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} @@ -458,6 +485,9 @@ func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { // GetDeviceContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} @@ -543,6 +573,9 @@ type SetWindowCreateContextCookie struct { // SetWindowCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{cookie} @@ -551,6 +584,9 @@ func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetW // SetWindowCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{cookie} @@ -595,6 +631,9 @@ type GetWindowCreateContextCookie struct { // GetWindowCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} @@ -603,6 +642,9 @@ func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { // GetWindowCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} @@ -685,6 +727,9 @@ type GetWindowContextCookie struct { // GetWindowContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} @@ -693,6 +738,9 @@ func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie // GetWindowContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} @@ -778,6 +826,9 @@ type SetPropertyCreateContextCookie struct { // SetPropertyCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{cookie} @@ -786,6 +837,9 @@ func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) Se // SetPropertyCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{cookie} @@ -830,6 +884,9 @@ type GetPropertyCreateContextCookie struct { // GetPropertyCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} @@ -838,6 +895,9 @@ func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { // GetPropertyCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} @@ -920,6 +980,9 @@ type SetPropertyUseContextCookie struct { // SetPropertyUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{cookie} @@ -928,6 +991,9 @@ func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPr // SetPropertyUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{cookie} @@ -972,6 +1038,9 @@ type GetPropertyUseContextCookie struct { // GetPropertyUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} @@ -980,6 +1049,9 @@ func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { // GetPropertyUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} @@ -1062,6 +1134,9 @@ type GetPropertyContextCookie struct { // GetPropertyContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyContextCookie.Reply() func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} @@ -1070,6 +1145,9 @@ func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) // GetPropertyContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} @@ -1158,6 +1236,9 @@ type GetPropertyDataContextCookie struct { // GetPropertyDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyDataContextCookie.Reply() func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} @@ -1166,6 +1247,9 @@ func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.A // GetPropertyDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} @@ -1254,6 +1338,9 @@ type ListPropertiesCookie struct { // ListProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} @@ -1262,6 +1349,9 @@ func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { // ListPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} @@ -1343,6 +1433,9 @@ type SetSelectionCreateContextCookie struct { // SetSelectionCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{cookie} @@ -1351,6 +1444,9 @@ func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) S // SetSelectionCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{cookie} @@ -1395,6 +1491,9 @@ type GetSelectionCreateContextCookie struct { // GetSelectionCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} @@ -1403,6 +1502,9 @@ func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { // GetSelectionCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} @@ -1485,6 +1587,9 @@ type SetSelectionUseContextCookie struct { // SetSelectionUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{cookie} @@ -1493,6 +1598,9 @@ func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetS // SetSelectionUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{cookie} @@ -1537,6 +1645,9 @@ type GetSelectionUseContextCookie struct { // GetSelectionUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} @@ -1545,6 +1656,9 @@ func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { // GetSelectionUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} @@ -1627,6 +1741,9 @@ type GetSelectionContextCookie struct { // GetSelectionContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionContextCookie.Reply() func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} @@ -1635,6 +1752,9 @@ func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContext // GetSelectionContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} @@ -1720,6 +1840,9 @@ type GetSelectionDataContextCookie struct { // GetSelectionDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionDataContextCookie.Reply() func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} @@ -1728,6 +1851,9 @@ func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDat // GetSelectionDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} @@ -1813,6 +1939,9 @@ type ListSelectionsCookie struct { // ListSelections sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSelectionsCookie.Reply() func ListSelections(c *xgb.Conn) ListSelectionsCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} @@ -1821,6 +1950,9 @@ func ListSelections(c *xgb.Conn) ListSelectionsCookie { // ListSelectionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} @@ -1899,6 +2031,9 @@ type GetClientContextCookie struct { // GetClientContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} @@ -1907,6 +2042,9 @@ func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { // GetClientContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 8f964e4..3fab056 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on May 11 2012 1:58:37am EDT. + This file was generated by xtest.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( CursorNone = 0 CursorCurrent = 1 @@ -77,6 +77,9 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) return GetVersionCookie{cookie} @@ -85,6 +88,9 @@ func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionC // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) return GetVersionCookie{cookie} @@ -165,6 +171,9 @@ type CompareCursorCookie struct { // CompareCursor sends a checked request. // If an error occurs, it will be returned with the reply by calling CompareCursorCookie.Reply() func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'CompareCursor' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) return CompareCursorCookie{cookie} @@ -173,6 +182,9 @@ func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) Comp // CompareCursorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'CompareCursor' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie) return CompareCursorCookie{cookie} @@ -251,6 +263,9 @@ type FakeInputCookie struct { // FakeInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'FakeInput' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return FakeInputCookie{cookie} @@ -259,6 +274,9 @@ func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Win // FakeInputChecked sends a checked request. // If an error occurs, it can be retrieved using FakeInputCookie.Check() func FakeInputChecked(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'FakeInput' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie) return FakeInputCookie{cookie} @@ -324,6 +342,9 @@ type GrabControlCookie struct { // GrabControl sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GrabControl' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(grabControlRequest(c, Impervious), cookie) return GrabControlCookie{cookie} @@ -332,6 +353,9 @@ func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { // GrabControlChecked sends a checked request. // If an error occurs, it can be retrieved using GrabControlCookie.Check() func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GrabControl' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(grabControlRequest(c, Impervious), cookie) return GrabControlCookie{cookie} diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index c048e88..c6ba384 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on May 11 2012 1:58:37am EDT. + This file was generated by xv.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,10 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -65,6 +61,10 @@ func init() { // Skipping definition for base type 'Card32' +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( TypeInputMask = 1 TypeOutputMask = 2 @@ -1205,6 +1205,9 @@ type QueryExtensionCookie struct { // QueryExtension sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn) QueryExtensionCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionRequest(c), cookie) return QueryExtensionCookie{cookie} @@ -1213,6 +1216,9 @@ func QueryExtension(c *xgb.Conn) QueryExtensionCookie { // QueryExtensionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionRequest(c), cookie) return QueryExtensionCookie{cookie} @@ -1288,6 +1294,9 @@ type QueryAdaptorsCookie struct { // QueryAdaptors sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryAdaptorsRequest(c, Window), cookie) return QueryAdaptorsCookie{cookie} @@ -1296,6 +1305,9 @@ func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { // QueryAdaptorsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryAdaptorsRequest(c, Window), cookie) return QueryAdaptorsCookie{cookie} @@ -1377,6 +1389,9 @@ type QueryEncodingsCookie struct { // QueryEncodings sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryEncodingsRequest(c, Port), cookie) return QueryEncodingsCookie{cookie} @@ -1385,6 +1400,9 @@ func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { // QueryEncodingsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryEncodingsRequest(c, Port), cookie) return QueryEncodingsCookie{cookie} @@ -1466,6 +1484,9 @@ type GrabPortCookie struct { // GrabPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(grabPortRequest(c, Port, Time), cookie) return GrabPortCookie{cookie} @@ -1474,6 +1495,9 @@ func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { // GrabPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(grabPortRequest(c, Port, Time), cookie) return GrabPortCookie{cookie} @@ -1548,6 +1572,9 @@ type UngrabPortCookie struct { // UngrabPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) return UngrabPortCookie{cookie} @@ -1556,6 +1583,9 @@ func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie // UngrabPortChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabPortCookie.Check() func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) return UngrabPortCookie{cookie} @@ -1600,6 +1630,9 @@ type PutVideoCookie struct { // PutVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutVideoCookie{cookie} @@ -1608,6 +1641,9 @@ func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutVideoChecked sends a checked request. // If an error occurs, it can be retrieved using PutVideoCookie.Check() func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutVideoCookie{cookie} @@ -1679,6 +1715,9 @@ type PutStillCookie struct { // PutStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutStillCookie{cookie} @@ -1687,6 +1726,9 @@ func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutStillChecked sends a checked request. // If an error occurs, it can be retrieved using PutStillCookie.Check() func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return PutStillCookie{cookie} @@ -1758,6 +1800,9 @@ type GetVideoCookie struct { // GetVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetVideoCookie{cookie} @@ -1766,6 +1811,9 @@ func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetVideoChecked sends a checked request. // If an error occurs, it can be retrieved using GetVideoCookie.Check() func GetVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(getVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetVideoCookie{cookie} @@ -1837,6 +1885,9 @@ type GetStillCookie struct { // GetStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetStillCookie{cookie} @@ -1845,6 +1896,9 @@ func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetStillChecked sends a checked request. // If an error occurs, it can be retrieved using GetStillCookie.Check() func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) return GetStillCookie{cookie} @@ -1916,6 +1970,9 @@ type StopVideoCookie struct { // StopVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) return StopVideoCookie{cookie} @@ -1924,6 +1981,9 @@ func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie // StopVideoChecked sends a checked request. // If an error occurs, it can be retrieved using StopVideoCookie.Check() func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) return StopVideoCookie{cookie} @@ -1968,6 +2028,9 @@ type SelectVideoNotifyCookie struct { // SelectVideoNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) return SelectVideoNotifyCookie{cookie} @@ -1976,6 +2039,9 @@ func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) Select // SelectVideoNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) return SelectVideoNotifyCookie{cookie} @@ -2026,6 +2092,9 @@ type SelectPortNotifyCookie struct { // SelectPortNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) return SelectPortNotifyCookie{cookie} @@ -2034,6 +2103,9 @@ func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie // SelectPortNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) return SelectPortNotifyCookie{cookie} @@ -2084,6 +2156,9 @@ type QueryBestSizeCookie struct { // QueryBestSize sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return QueryBestSizeCookie{cookie} @@ -2092,6 +2167,9 @@ func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16 // QueryBestSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryBestSizeRequest(c, Port, VidW, VidH, DrwW, DrwH, Motion), cookie) return QueryBestSizeCookie{cookie} @@ -2191,6 +2269,9 @@ type SetPortAttributeCookie struct { // SetPortAttribute sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) return SetPortAttributeCookie{cookie} @@ -2199,6 +2280,9 @@ func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32 // SetPortAttributeChecked sends a checked request. // If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) return SetPortAttributeCookie{cookie} @@ -2246,6 +2330,9 @@ type GetPortAttributeCookie struct { // GetPortAttribute sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) return GetPortAttributeCookie{cookie} @@ -2254,6 +2341,9 @@ func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttr // GetPortAttributeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) return GetPortAttributeCookie{cookie} @@ -2331,6 +2421,9 @@ type QueryPortAttributesCookie struct { // QueryPortAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryPortAttributesRequest(c, Port), cookie) return QueryPortAttributesCookie{cookie} @@ -2339,6 +2432,9 @@ func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { // QueryPortAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryPortAttributesRequest(c, Port), cookie) return QueryPortAttributesCookie{cookie} @@ -2424,6 +2520,9 @@ type ListImageFormatsCookie struct { // ListImageFormats sends a checked request. // If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listImageFormatsRequest(c, Port), cookie) return ListImageFormatsCookie{cookie} @@ -2432,6 +2531,9 @@ func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { // ListImageFormatsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listImageFormatsRequest(c, Port), cookie) return ListImageFormatsCookie{cookie} @@ -2513,6 +2615,9 @@ type QueryImageAttributesCookie struct { // QueryImageAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryImageAttributesCookie.Reply() func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) return QueryImageAttributesCookie{cookie} @@ -2521,6 +2626,9 @@ func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Heigh // QueryImageAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryImageAttributesUnchecked(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryImageAttributesRequest(c, Port, Id, Width, Height), cookie) return QueryImageAttributesCookie{cookie} @@ -2635,6 +2743,9 @@ type PutImageCookie struct { // PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return PutImageCookie{cookie} @@ -2643,6 +2754,9 @@ func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutImageChecked sends a checked request. // If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) return PutImageCookie{cookie} @@ -2726,6 +2840,9 @@ type ShmPutImageCookie struct { // ShmPutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return ShmPutImageCookie{cookie} @@ -2734,6 +2851,9 @@ func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gco // ShmPutImageChecked sends a checked request. // If an error occurs, it can be retrieved using ShmPutImageCookie.Check() func ShmPutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(shmPutImageRequest(c, Port, Drawable, Gc, Shmseg, Id, Offset, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, SendEvent), cookie) return ShmPutImageCookie{cookie} diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index cf794cc..19b1c83 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on May 11 2012 1:58:37am EDT. + This file was generated by xvmc.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,16 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,16 +65,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { @@ -206,6 +206,9 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -214,6 +217,9 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c), cookie) return QueryVersionCookie{cookie} @@ -289,6 +295,9 @@ type ListSurfaceTypesCookie struct { // ListSurfaceTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) return ListSurfaceTypesCookie{cookie} @@ -297,6 +306,9 @@ func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { // ListSurfaceTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) return ListSurfaceTypesCookie{cookie} @@ -378,6 +390,9 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return CreateContextCookie{cookie} @@ -386,6 +401,9 @@ func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Sur // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie) return CreateContextCookie{cookie} @@ -494,6 +512,9 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroyContextRequest(c, ContextId), cookie) return DestroyContextCookie{cookie} @@ -502,6 +523,9 @@ func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroyContextRequest(c, ContextId), cookie) return DestroyContextCookie{cookie} @@ -543,6 +567,9 @@ type CreateSurfaceCookie struct { // CreateSurface sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) return CreateSurfaceCookie{cookie} @@ -551,6 +578,9 @@ func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurf // CreateSurfaceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) return CreateSurfaceCookie{cookie} @@ -635,6 +665,9 @@ type DestroySurfaceCookie struct { // DestroySurface sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) return DestroySurfaceCookie{cookie} @@ -643,6 +676,9 @@ func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { // DestroySurfaceChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) return DestroySurfaceCookie{cookie} @@ -684,6 +720,9 @@ type CreateSubpictureCookie struct { // CreateSubpicture sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply() func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) return CreateSubpictureCookie{cookie} @@ -692,6 +731,9 @@ func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, Xvi // CreateSubpictureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie) return CreateSubpictureCookie{cookie} @@ -806,6 +848,9 @@ type DestroySubpictureCookie struct { // DestroySubpicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) return DestroySubpictureCookie{cookie} @@ -814,6 +859,9 @@ func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCo // DestroySubpictureChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySubpictureCookie.Check() func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie) return DestroySubpictureCookie{cookie} @@ -855,6 +903,9 @@ type ListSubpictureTypesCookie struct { // ListSubpictureTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply() func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) return ListSubpictureTypesCookie{cookie} @@ -863,6 +914,9 @@ func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSub // ListSubpictureTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie) return ListSubpictureTypesCookie{cookie} From aa95801b2de1d48da97968d395c740e5a438a277 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Fri, 11 May 2012 23:59:38 -0400 Subject: [PATCH 40/90] panic when an extension request is issued before an extension has been initialized. but give a nice error message for the happy people. --- nexgb/xgbgen/go_request_reply.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index 62d9936..ee5c974 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -81,7 +81,7 @@ func (r *Request) CheckExt(c *Context) { } c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", strings.ToUpper(c.protocol.ExtXName)) - c.Putln("panic(\"Cannot issue request '%s' using the uninitialized " + + c.Putln("panic(\"Cannot issue request '%s' using the uninitialized "+ "extension '%s'. %s.Init(connObj) must be called first.\")", r.SrcName(), c.protocol.ExtXName, c.protocol.PkgName()) c.Putln("}") From f77feff864545c590ad4f717ecf47278703e1792 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 12 May 2012 21:27:47 -0400 Subject: [PATCH 41/90] some docs in the Makefile and removing a prefix that isn't needed. --- nexgb/Makefile | 25 ++++++++++++++++++++++--- nexgb/{xgb_help.go => help.go} | 0 2 files changed, 22 insertions(+), 3 deletions(-) rename nexgb/{xgb_help.go => help.go} (100%) diff --git a/nexgb/Makefile b/nexgb/Makefile index 7fa8b9b..6809661 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -1,10 +1,20 @@ # This Makefile is used by the developer. It is not needed in any way to build # a checkout of the XGB repository. # It will be useful, however, if you are hacking at the code generator. +# i.e., after making a change to the code generator, run 'make' in the +# xgb directory. This will build xgbgen and regenerate each sub-package. +# 'make test' will then run any appropriate tests (just tests xproto right now). +# 'make bench' will test a couple of benchmarks. +# 'make build-all' will then try to build each extension. This isn't strictly +# necessary, but it's a good idea to make sure each sub-package is a valid +# Go package. +# My path to the X protocol XML descriptions. XPROTO=/usr/share/xcb # All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_- +# This is intended to build xgbgen and generate Go code for each supported +# extension. all: build-xgbgen \ bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ ge.xml glx.xml randr.xml record.xml render.xml res.xml \ @@ -16,6 +26,7 @@ all: build-xgbgen \ build-xgbgen: (cd xgbgen && go build) +# Builds each individual sub-package to make sure its valid Go code. build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ record.b render.b res.b screensaver.b shape.b shm.b sync.b xcmisc.b \ xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \ @@ -24,6 +35,8 @@ build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ %.b: (cd $* ; go build) +# xc_misc is special because it has an underscore. +# There's probably a way to do this better, but Makefiles aren't my strong suit. xc_misc.xml: build-xgbgen mkdir -p xcmisc xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go @@ -32,14 +45,20 @@ xc_misc.xml: build-xgbgen mkdir -p $* xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go +# Just test the xproto core protocol for now. test: (cd xproto ; go test) +# Force all xproto benchmarks to run and no tests. bench: (cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,6) +# gofmt all non-auto-generated code. +# (auto-generated code is already gofmt'd.) +# Also do a column check (80 cols) after a gofmt. +# But don't check columns on auto-generated code, since I don't care if they +# break 80 cols. gofmt: - gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go - colcheck xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go \ - auth.go conn.go cookie.go doc.go xgb.go xgb_help.go + gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go + colcheck *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go diff --git a/nexgb/xgb_help.go b/nexgb/help.go similarity index 100% rename from nexgb/xgb_help.go rename to nexgb/help.go From 24fef4062ad441c935f5a87e908c5f293d8a2f42 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 12 May 2012 21:36:31 -0400 Subject: [PATCH 42/90] docs --- nexgb/auth.go | 10 ++++++---- nexgb/conn.go | 7 +++++++ nexgb/help.go | 10 ++++++++++ nexgb/sync.go | 2 +- nexgb/xgb.go | 7 +++++-- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/nexgb/auth.go b/nexgb/auth.go index 85e2d56..396e832 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -1,9 +1,11 @@ -// Copyright 2009 The XGB Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - package xgb +/* +auth.go contains functions to facilitate the parsing of .Xauthority files. + +It is largely unmodified from the original XGB package that I forked. +*/ + import ( "bufio" "errors" diff --git a/nexgb/conn.go b/nexgb/conn.go index 662a059..9baf86c 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -1,5 +1,12 @@ package xgb +/* +conn.go contains a couple of functions that do some real dirty work related +to the initial connection handshake with X. + +This code is largely unmodified from the original XGB package that I forked. +*/ + import ( "errors" "fmt" diff --git a/nexgb/help.go b/nexgb/help.go index 36fe98b..5729917 100644 --- a/nexgb/help.go +++ b/nexgb/help.go @@ -1,5 +1,15 @@ package xgb +/* +help.go is meant to contain a rough hodge podge of functions that are mainly +used in the auto generated code. Indeed, several functions here are simple +wrappers so that the sub-packages don't need to be smart about which stdlib +packages to import. + +Also, the 'Get..' and 'Put..' functions are used through the core xgb package +too. (xgbutil uses them too.) +*/ + import ( "fmt" "strings" diff --git a/nexgb/sync.go b/nexgb/sync.go index d671e62..59d0de1 100644 --- a/nexgb/sync.go +++ b/nexgb/sync.go @@ -1,6 +1,6 @@ package xgb -// Sync sends a round trip request and wait for the response. +// Sync sends a round trip request and waits for the response. // This forces all pending cookies to be dealt with. // You actually shouldn't need to use this like you might with Xlib. Namely, // buffers are automatically flushed using Go's channels and round trip requests diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 50cfdba..b2cf56c 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -166,8 +166,11 @@ type eventOrError interface{} // NewID generates a new unused ID for use with requests like CreateWindow. // If no new ids can be generated, the id returned is 0 and error is non-nil. -// Note that the value returned will need to be converted to the proper -// type. i.e., xproto.Window(id). +// This shouldn't be used directly, and is exported for use in the extension +// sub-packages. +// If you need identifiers, use the appropriate constructor. +// e.g., For a window id, use xproto.NewWindowId. For +// a new pixmap id, use xproto.NewPixmapId. And so on. func (c *Conn) NewId() (uint32, error) { xid := <-c.xidChan if xid.err != nil { From 7abc9c6455b8281d5dfd5604ec6ca6fe0d459318 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 12 May 2012 21:44:53 -0400 Subject: [PATCH 43/90] added some docs and removed some extraneous code --- nexgb/xproto/xproto_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nexgb/xproto/xproto_test.go b/nexgb/xproto/xproto_test.go index f061198..8d0ca88 100644 --- a/nexgb/xproto/xproto_test.go +++ b/nexgb/xproto/xproto_test.go @@ -12,7 +12,11 @@ package xproto There are also a couple of benchmarks that show the difference between correctly issuing lots of requests and gathering replies and incorrectly doing the same. (This particular difference is one of the - claimed advantages of the XCB, and therefore XGB, family. + claimed advantages of the XCB, and therefore XGB, family.) + + In sum, these tests are more focused on testing the core xgb package itself, + rather than whether xproto has properly implemented the core X client + protocol. */ import ( @@ -164,8 +168,6 @@ func TestWindowEvents(t *testing.T) { t.Fatalf("ConfigureWindow: %s", err) } - TestProperty(t) - evOrErr := waitForEvent(t, 5) switch event := evOrErr.ev.(type) { case ConfigureNotifyEvent: From 6bdfd1d1b14071e22d9b09fa5e526f715798c379 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 12 May 2012 21:55:57 -0400 Subject: [PATCH 44/90] A more idiomatic way of trying a non-blocking send on a buffered channel and falling back to a blocking send inside a goroutine. This really needs to be fixed. The situation only arises when events are sent and aren't pulled off the channel using {Wait,Poll}ForEvent. Namely, if the event send blocks, the entire program will deadlock. Using a goroutine is not ideal because we lose a guarantee of order: that events are processed in the order of their arrival. However, it seems OK as a temporary band-aide for a situation that probably doesn't arise too often. What I need to do is implement a dynamic queue. Here is a reference implementation: http://play.golang.org/p/AiHBsxTFpj --- nexgb/xgb.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index b2cf56c..c52f722 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -379,12 +379,14 @@ func (c *Conn) readResponses() { // FIXME: I'm not sure if using a goroutine here to guarantee // a non-blocking send is the right way to go. I should implement // a proper dynamic queue. - if cap(c.eventChan) == len(c.eventChan) { + // I am pretty sure this also loses a guarantee of events being + // processed in order of being received. + select { + case c.eventChan <- event: + default: go func() { c.eventChan <- event }() - } else { - c.eventChan <- event } // No more processing for events. From 45a4ee92ebe7a20ed78777e53b69c4a2f810c5d8 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 12 May 2012 22:17:10 -0400 Subject: [PATCH 45/90] close channels. --- nexgb/xgb.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index c52f722..ff4e461 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -188,10 +188,13 @@ type xid struct { } // generateXids sends new Ids down the channel for NewId to use. +// generateXids should be run in its own goroutine. // This needs to be updated to use the XC Misc extension once we run out of // new ids. // Thanks to libxcb/src/xcb_xid.c. This code is greatly inspired by it. func (conn *Conn) generateXIds() { + defer close(conn.xidChan) + // This requires some explanation. From the horse's mouth: // "The resource-id-mask contains a single contiguous set of bits (at least // 18). The client allocates resource IDs for types WINDOW, PIXMAP, @@ -234,7 +237,8 @@ func (c *Conn) newSequenceId() uint16 { return <-c.seqChan } -// generateSeqIds returns new sequence ids. +// generateSeqIds returns new sequence ids. It is meant to be run in its +// own goroutine. // A sequence id is generated for *every* request. It's the identifier used // to match up replies with requests. // Since sequence ids can only be 16 bit integers we start over at zero when it @@ -242,6 +246,8 @@ func (c *Conn) newSequenceId() uint16 { // N.B. As long as the cookie buffer is less than 2^16, there are no limitations // on the number (or kind) of requests made in sequence. func (c *Conn) generateSeqIds() { + defer close(c.seqChan) + seqid := uint16(1) for { c.seqChan <- seqid @@ -271,7 +277,11 @@ func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { // sendRequests is run as a single goroutine that takes requests and writes // the bytes to the wire and adds the cookie to the cookie queue. +// It is meant to be run as its own goroutine. func (c *Conn) sendRequests() { + defer close(c.reqChan) + defer close(c.cookieChan) + for req := range c.reqChan { // ho there! if the cookie channel is nearly full, force a round // trip to clear out the cookie buffer. @@ -309,6 +319,8 @@ func (c *Conn) writeBuffer(buf []byte) { // channel. (It is an error if no such cookie exists in this case.) // Finally, cookies that came "before" this reply are always cleaned up. func (c *Conn) readResponses() { + defer close(c.eventChan) + var ( err Error event Event From 424f293671b256bb5e253eea1cbb83519f4243f3 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Wed, 16 May 2012 23:26:19 -0400 Subject: [PATCH 46/90] export logger so it can be disabled --- nexgb/conn.go | 4 ++-- nexgb/xgb.go | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/nexgb/conn.go b/nexgb/conn.go index 9baf86c..62c31e9 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -33,8 +33,8 @@ func (c *Conn) connect(display string) error { authName, authData, err := readAuthority(c.host, c.display) noauth := false if err != nil { - logger.Printf("Could not get authority info: %v", err) - logger.Println("Trying connection without authority info...") + Logger.Printf("Could not get authority info: %v", err) + Logger.Println("Trying connection without authority info...") authName = "" authData = []byte{} noauth = true diff --git a/nexgb/xgb.go b/nexgb/xgb.go index ff4e461..dad0ed5 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -10,7 +10,7 @@ import ( ) var ( - logger = log.New(os.Stderr, "XGB: ", 0) + Logger = log.New(os.Stderr, "XGB: ", 0) // ExtLock is a lock used whenever new extensions are initialized. // It should not be used. It is exported for use in the extension @@ -304,8 +304,8 @@ func (c *Conn) sendRequests() { // writeBuffer is a convenience function for writing a byte slice to the wire. func (c *Conn) writeBuffer(buf []byte) { if _, err := c.conn.Write(buf); err != nil { - logger.Printf("Write error: %s", err) - logger.Fatal("A write error is unrecoverable. Exiting...") + Logger.Printf("Write error: %s", err) + Logger.Fatal("A write error is unrecoverable. Exiting...") } } @@ -333,8 +333,8 @@ func (c *Conn) readResponses() { err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - logger.Printf("Read error: %s", err) - logger.Fatal("A read error is unrecoverable. Exiting...") + Logger.Printf("Read error: %s", err) + Logger.Fatal("A read error is unrecoverable. Exiting...") } switch buf[0] { @@ -343,7 +343,7 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := NewErrorFuncs[int(buf[1])] if !ok { - logger.Printf("BUG: Could not find error constructor function "+ + Logger.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) continue } @@ -362,8 +362,8 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - logger.Printf("Read error: %s", err) - logger.Fatal("A read error is unrecoverable. Exiting...") + Logger.Printf("Read error: %s", err) + Logger.Fatal("A read error is unrecoverable. Exiting...") } replyBytes = biggerBuf } else { @@ -380,7 +380,7 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := NewEventFuncs[evNum] if !ok { - logger.Printf("BUG: Could not find event construct function "+ + Logger.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) continue } @@ -429,7 +429,7 @@ func (c *Conn) readResponses() { } } else { // this is a reply if cookie.replyChan == nil { - logger.Printf("Reply with sequence id %d does not "+ + Logger.Printf("Reply with sequence id %d does not "+ "have a cookie with a valid reply channel.", seq) continue } else { @@ -442,12 +442,12 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - logger.Printf("Found cookie with sequence id %d that is "+ + Logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply but will never get it. Currently "+ "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - logger.Printf("Found cookie with sequence id %d that is "+ + Logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply (and not an error) but will never "+ "get it. Currently on sequence number %d", cookie.Sequence, seq) @@ -470,7 +470,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { case Error: return nil, ee default: - logger.Printf("Invalid event/error type: %T", everr) + Logger.Printf("Invalid event/error type: %T", everr) return nil, nil } panic("unreachable") From acb84171e55d46dc1a5b9cc10b2bff53c2d2846b Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Wed, 16 May 2012 23:57:26 -0400 Subject: [PATCH 47/90] Add new logger type so that it can be shut off. --- nexgb/conn.go | 4 +-- nexgb/log.go | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ nexgb/xgb.go | 28 ++++++++--------- 3 files changed, 100 insertions(+), 17 deletions(-) create mode 100644 nexgb/log.go diff --git a/nexgb/conn.go b/nexgb/conn.go index 62c31e9..9baf86c 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -33,8 +33,8 @@ func (c *Conn) connect(display string) error { authName, authData, err := readAuthority(c.host, c.display) noauth := false if err != nil { - Logger.Printf("Could not get authority info: %v", err) - Logger.Println("Trying connection without authority info...") + logger.Printf("Could not get authority info: %v", err) + logger.Println("Trying connection without authority info...") authName = "" authData = []byte{} noauth = true diff --git a/nexgb/log.go b/nexgb/log.go new file mode 100644 index 0000000..eaaa57e --- /dev/null +++ b/nexgb/log.go @@ -0,0 +1,85 @@ +package xgb + +import ( + "log" + "os" +) + +// Log controls whether XGB emits errors to stderr. By default, it is enabled. +var PrintLog = true + +// log is a wrapper around a log.PrintLogger so we can control whether it should +// output anything. +type xgblog struct { + *log.Logger +} + +func newLogger() xgblog { + return xgblog{log.New(os.Stderr, "XGB: ", log.Lshortfile)} +} + +func (lg xgblog) Print(v ...interface{}) { + if PrintLog { + lg.Logger.Print(v...) + } +} + +func (lg xgblog) Printf(format string, v ...interface{}) { + if PrintLog { + lg.Logger.Printf(format, v...) + } +} + +func (lg xgblog) Println(v ...interface{}) { + if PrintLog { + lg.Logger.Println(v...) + } +} + +func (lg xgblog) Fatal(v ...interface{}) { + if PrintLog { + lg.Logger.Fatal(v...) + } else { + os.Exit(1) + } +} + +func (lg xgblog) Fatalf(format string, v ...interface{}) { + if PrintLog { + lg.Logger.Fatalf(format, v...) + } else { + os.Exit(1) + } +} + +func (lg xgblog) Fatalln(v ...interface{}) { + if PrintLog { + lg.Logger.Fatalln(v...) + } else { + os.Exit(1) + } +} + +func (lg xgblog) Panic(v ...interface{}) { + if PrintLog { + lg.Logger.Panic(v...) + } else { + panic("") + } +} + +func (lg xgblog) Panicf(format string, v ...interface{}) { + if PrintLog { + lg.Logger.Panicf(format, v...) + } else { + panic("") + } +} + +func (lg xgblog) Panicln(v ...interface{}) { + if PrintLog { + lg.Logger.Panicln(v...) + } else { + panic("") + } +} diff --git a/nexgb/xgb.go b/nexgb/xgb.go index dad0ed5..b0a7307 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -3,14 +3,12 @@ package xgb import ( "errors" "io" - "log" "net" - "os" "sync" ) var ( - Logger = log.New(os.Stderr, "XGB: ", 0) + logger = newLogger() // ExtLock is a lock used whenever new extensions are initialized. // It should not be used. It is exported for use in the extension @@ -304,8 +302,8 @@ func (c *Conn) sendRequests() { // writeBuffer is a convenience function for writing a byte slice to the wire. func (c *Conn) writeBuffer(buf []byte) { if _, err := c.conn.Write(buf); err != nil { - Logger.Printf("Write error: %s", err) - Logger.Fatal("A write error is unrecoverable. Exiting...") + logger.Printf("Write error: %s", err) + logger.Fatal("A write error is unrecoverable. Exiting...") } } @@ -333,8 +331,8 @@ func (c *Conn) readResponses() { err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - Logger.Printf("Read error: %s", err) - Logger.Fatal("A read error is unrecoverable. Exiting...") + logger.Printf("Read error: %s", err) + logger.Fatal("A read error is unrecoverable. Exiting...") } switch buf[0] { @@ -343,7 +341,7 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := NewErrorFuncs[int(buf[1])] if !ok { - Logger.Printf("BUG: Could not find error constructor function "+ + logger.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) continue } @@ -362,8 +360,8 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - Logger.Printf("Read error: %s", err) - Logger.Fatal("A read error is unrecoverable. Exiting...") + logger.Printf("Read error: %s", err) + logger.Fatal("A read error is unrecoverable. Exiting...") } replyBytes = biggerBuf } else { @@ -380,7 +378,7 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := NewEventFuncs[evNum] if !ok { - Logger.Printf("BUG: Could not find event construct function "+ + logger.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) continue } @@ -429,7 +427,7 @@ func (c *Conn) readResponses() { } } else { // this is a reply if cookie.replyChan == nil { - Logger.Printf("Reply with sequence id %d does not "+ + logger.Printf("Reply with sequence id %d does not "+ "have a cookie with a valid reply channel.", seq) continue } else { @@ -442,12 +440,12 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - Logger.Printf("Found cookie with sequence id %d that is "+ + logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply but will never get it. Currently "+ "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - Logger.Printf("Found cookie with sequence id %d that is "+ + logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply (and not an error) but will never "+ "get it. Currently on sequence number %d", cookie.Sequence, seq) @@ -470,7 +468,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { case Error: return nil, ee default: - Logger.Printf("Invalid event/error type: %T", everr) + logger.Printf("Invalid event/error type: %T", everr) return nil, nil } panic("unreachable") From 58bb2572c5d1e88689aa1b30dc55b702acf57f4f Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 26 May 2012 18:22:25 -0400 Subject: [PATCH 48/90] Doc touchups. --- nexgb/cookie.go | 2 +- nexgb/doc.go | 14 +++++++------- nexgb/xgb.go | 23 ++++++++++++++--------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/nexgb/cookie.go b/nexgb/cookie.go index 0f32990..e75e53c 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -16,7 +16,7 @@ type Cookie struct { pingChan chan bool } -// newCookie creates a new cookie with the correct channels initialized +// NewCookie creates a new cookie with the correct channels initialized // depending upon the values of 'checked' and 'reply'. Together, there are // four different kinds of cookies. (See more detailed comments in the // function for more info on those.) diff --git a/nexgb/doc.go b/nexgb/doc.go index 9a9531c..a5bb6fe 100644 --- a/nexgb/doc.go +++ b/nexgb/doc.go @@ -107,16 +107,16 @@ can be found in examples/xinerama. Parallelism XGB can benefit greatly from parallelism due to its concurrent design. For -evidence of this claim, please see the benchmarks in xgb_test.go. +evidence of this claim, please see the benchmarks in xproto/xproto_test.go. Tests -xgb_test.go contains a number of contrived tests that stress particular corners -of XGB that I presume could be problem areas. Namely: requests with no replies, -requests with replies, checked errors, unchecked errors, sequence number -wrapping, cookie buffer flushing (i.e., forcing a round trip every N requests -made that don't have a reply), getting/setting properties and creating a window -and listening to StructureNotify events. +xproto/xproto_test.go contains a number of contrived tests that stress +particular corners of XGB that I presume could be problem areas. Namely: +requests with no replies, requests with replies, checked errors, unchecked +errors, sequence number wrapping, cookie buffer flushing (i.e., forcing a round +trip every N requests made that don't have a reply), getting/setting properties +and creating a window and listening to StructureNotify events. Code Generator diff --git a/nexgb/xgb.go b/nexgb/xgb.go index b0a7307..7df0fac 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -78,10 +78,10 @@ func NewConn() (*Conn, error) { // If 'display' is empty it will be taken from os.Getenv("DISPLAY"). // // Examples: -// NewConn(":1") -> net.Dial("unix", "", "/tmp/.X11-unix/X1") -// NewConn("/tmp/launch-123/:0") -> net.Dial("unix", "", "/tmp/launch-123/:0") -// NewConn("hostname:2.1") -> net.Dial("tcp", "", "hostname:6002") -// NewConn("tcp/hostname:1.0") -> net.Dial("tcp", "", "hostname:6001") +// NewConn(":1") -> net.Dial("unix", "", "/tmp/.X11-unix/X1") +// NewConn("/tmp/launch-12/:0") -> net.Dial("unix", "", "/tmp/launch-12/:0") +// NewConn("hostname:2.1") -> net.Dial("tcp", "", "hostname:6002") +// NewConn("tcp/hostname:1.0") -> net.Dial("tcp", "", "hostname:6001") func NewConnDisplay(display string) (*Conn, error) { conn := &Conn{} @@ -265,10 +265,10 @@ type request struct { cookie *Cookie } -// NewRequest takes the bytes an a cookie, constructs a request type, -// and sends it over the Conn.reqChan channel. +// NewRequest takes the bytes and a cookie of a particular request, constructs +// a request type, and sends it over the Conn.reqChan channel. // Note that the sequence number is added to the cookie after it is sent -// over the request channel. +// over the request channel, but before it is sent to X. func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { c.reqChan <- &request{buf: buf, cookie: cookie} } @@ -476,13 +476,18 @@ func processEventOrError(everr eventOrError) (Event, Error) { // WaitForEvent returns the next event from the server. // It will block until an event is available. +// WaitForEvent returns either an Event or an Error. (Returning neither or both +// is a bug.) Note than an Error here is an X error and not an XGB error. That +// is, X errors are sometimes completely expected (and you may want to ignore +// them in some cases). func (c *Conn) WaitForEvent() (Event, Error) { return processEventOrError(<-c.eventChan) } // PollForEvent returns the next event from the server if one is available in -// the internal queue. -// It will not block. +// the internal queue without blocking. Note that unlike WaitForEvent, both +// Event and Error could be nil. Indeed, they are both nil when the event queue +// is empty. func (c *Conn) PollForEvent() (Event, Error) { select { case everr := <-c.eventChan: From 4ea94ca0fef7786ce21722cbb02a9cf069bdedd9 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 26 May 2012 18:24:52 -0400 Subject: [PATCH 49/90] Bug fix in the generator that was outputting %(MISSING) crud. --- nexgb/bigreq/bigreq.go | 14 +++--- nexgb/composite/composite.go | 10 ++-- nexgb/damage/damage.go | 26 +++++----- nexgb/dpms/dpms.go | 26 +++++----- nexgb/dri2/dri2.go | 30 ++++++------ nexgb/ge/ge.go | 6 +-- nexgb/glx/glx.go | 2 +- nexgb/randr/randr.go | 18 +++---- nexgb/record/record.go | 16 +++---- nexgb/render/render.go | 58 +++++++++++----------- nexgb/res/res.go | 6 +-- nexgb/screensaver/screensaver.go | 22 ++++----- nexgb/shape/shape.go | 22 ++++----- nexgb/shm/shm.go | 26 +++++----- nexgb/sync/sync.go | 30 ++++++------ nexgb/xcmisc/xcmisc.go | 2 +- nexgb/xevie/xevie.go | 8 ++-- nexgb/xf86dri/xf86dri.go | 24 +++++----- nexgb/xf86vidmode/xf86vidmode.go | 24 +++++----- nexgb/xfixes/xfixes.go | 18 +++---- nexgb/xgbgen/go_struct.go | 2 +- nexgb/xinerama/xinerama.go | 12 ++--- nexgb/xinput/xinput.go | 82 ++++++++++++++++---------------- nexgb/xprint/xprint.go | 24 +++++----- nexgb/xproto/xproto.go | 62 ++++++++++++------------ nexgb/xselinux/xselinux.go | 24 +++++----- nexgb/xtest/xtest.go | 14 +++--- nexgb/xv/xv.go | 32 ++++++------- nexgb/xvmc/xvmc.go | 24 +++++----- 29 files changed, 332 insertions(+), 332 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index 43a15a4..e7bdfc8 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on May 11 2012 11:57:18pm EDT. + This file was generated by bigreq.xml on May 26 2012 6:23:12pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + // EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index 68e8dbe..b188544 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on May 11 2012 11:57:18pm EDT. + This file was generated by composite.xml on May 26 2012 6:23:12pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,10 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -61,10 +65,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - const ( RedirectAutomatic = 0 RedirectManual = 1 diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index f9aee61..1c844db 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on May 11 2012 11:57:19pm EDT. + This file was generated by damage.xml on May 26 2012 6:23:12pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,18 +41,6 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -65,6 +53,18 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index d1142ce..0ef913c 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on May 11 2012 11:57:19pm EDT. + This file was generated by dpms.xml on May 26 2012 6:23:12pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Card32' +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( DPMSModeOn = 0 DPMSModeStandby = 1 diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 7a10897..5ad8c62 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on May 11 2012 11:57:19pm EDT. + This file was generated by dri2.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 @@ -152,7 +152,7 @@ func (v DRI2Buffer) Bytes() []byte { return buf } -// DRI2BufferListBytes writes a list of %s(MISSING) values to a byte slice. +// DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice. func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { b := 0 var structBytes []byte @@ -206,7 +206,7 @@ func (v AttachFormat) Bytes() []byte { return buf } -// AttachFormatListBytes writes a list of %s(MISSING) values to a byte slice. +// AttachFormatListBytes writes a list of AttachFormat values to a byte slice. func AttachFormatListBytes(buf []byte, list []AttachFormat) int { b := 0 var structBytes []byte diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index e7592d8..b0bbbd7 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on May 11 2012 11:57:19pm EDT. + This file was generated by ge.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 0f67127..6be52c2 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on May 11 2012 11:57:19pm EDT. + This file was generated by glx.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 9a6e89f..b17cb83 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on May 11 2012 11:57:19pm EDT. + This file was generated by randr.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,8 +41,6 @@ func init() { xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -65,6 +63,8 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + const ( RotationRotate0 = 1 RotationRotate90 = 2 @@ -203,7 +203,7 @@ func (v ScreenSize) Bytes() []byte { return buf } -// ScreenSizeListBytes writes a list of %s(MISSING) values to a byte slice. +// ScreenSizeListBytes writes a list of ScreenSize values to a byte slice. func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { b := 0 var structBytes []byte @@ -264,7 +264,7 @@ func (v RefreshRates) Bytes() []byte { return buf } -// RefreshRatesListBytes writes a list of %s(MISSING) values to a byte slice. +// RefreshRatesListBytes writes a list of RefreshRates values to a byte slice. func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { b := 0 var structBytes []byte @@ -404,7 +404,7 @@ func (v ModeInfo) Bytes() []byte { return buf } -// ModeInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ModeInfoListBytes writes a list of ModeInfo values to a byte slice. func ModeInfoListBytes(buf []byte, list []ModeInfo) int { b := 0 var structBytes []byte @@ -512,7 +512,7 @@ func (v CrtcChange) Bytes() []byte { return buf } -// CrtcChangeListBytes writes a list of %s(MISSING) values to a byte slice. +// CrtcChangeListBytes writes a list of CrtcChange values to a byte slice. func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { b := 0 var structBytes []byte @@ -615,7 +615,7 @@ func (v OutputChange) Bytes() []byte { return buf } -// OutputChangeListBytes writes a list of %s(MISSING) values to a byte slice. +// OutputChangeListBytes writes a list of OutputChange values to a byte slice. func OutputChangeListBytes(buf []byte, list []OutputChange) int { b := 0 var structBytes []byte @@ -695,7 +695,7 @@ func (v OutputProperty) Bytes() []byte { return buf } -// OutputPropertyListBytes writes a list of %s(MISSING) values to a byte slice. +// OutputPropertyListBytes writes a list of OutputProperty values to a byte slice. func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { b := 0 var structBytes []byte diff --git a/nexgb/record/record.go b/nexgb/record/record.go index a9ae7ea..0ae6d81 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on May 11 2012 11:57:19pm EDT. + This file was generated by record.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RECORD"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + const ( HTypeFromServerTime = 1 HTypeFromClientTime = 2 @@ -132,7 +132,7 @@ func (v Range8) Bytes() []byte { return buf } -// Range8ListBytes writes a list of %s(MISSING) values to a byte slice. +// Range8ListBytes writes a list of Range8 values to a byte slice. func Range8ListBytes(buf []byte, list []Range8) int { b := 0 var structBytes []byte @@ -186,7 +186,7 @@ func (v Range16) Bytes() []byte { return buf } -// Range16ListBytes writes a list of %s(MISSING) values to a byte slice. +// Range16ListBytes writes a list of Range16 values to a byte slice. func Range16ListBytes(buf []byte, list []Range16) int { b := 0 var structBytes []byte @@ -246,7 +246,7 @@ func (v ExtRange) Bytes() []byte { return buf } -// ExtRangeListBytes writes a list of %s(MISSING) values to a byte slice. +// ExtRangeListBytes writes a list of ExtRange values to a byte slice. func ExtRangeListBytes(buf []byte, list []ExtRange) int { b := 0 var structBytes []byte @@ -386,7 +386,7 @@ func (v Range) Bytes() []byte { return buf } -// RangeListBytes writes a list of %s(MISSING) values to a byte slice. +// RangeListBytes writes a list of Range values to a byte slice. func RangeListBytes(buf []byte, list []Range) int { b := 0 var structBytes []byte @@ -446,7 +446,7 @@ func (v ClientInfo) Bytes() []byte { return buf } -// ClientInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ClientInfoListBytes writes a list of ClientInfo values to a byte slice. func ClientInfoListBytes(buf []byte, list []ClientInfo) int { b := 0 var structBytes []byte diff --git a/nexgb/render/render.go b/nexgb/render/render.go index f7fa79f..e435aa8 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on May 11 2012 11:57:19pm EDT. + This file was generated by render.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( PictTypeIndexed = 0 PictTypeDirect = 1 @@ -289,7 +289,7 @@ func (v Directformat) Bytes() []byte { return buf } -// DirectformatListBytes writes a list of %s(MISSING) values to a byte slice. +// DirectformatListBytes writes a list of Directformat values to a byte slice. func DirectformatListBytes(buf []byte, list []Directformat) int { b := 0 var structBytes []byte @@ -372,7 +372,7 @@ func (v Pictforminfo) Bytes() []byte { return buf } -// PictforminfoListBytes writes a list of %s(MISSING) values to a byte slice. +// PictforminfoListBytes writes a list of Pictforminfo values to a byte slice. func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { b := 0 var structBytes []byte @@ -426,7 +426,7 @@ func (v Pictvisual) Bytes() []byte { return buf } -// PictvisualListBytes writes a list of %s(MISSING) values to a byte slice. +// PictvisualListBytes writes a list of Pictvisual values to a byte slice. func PictvisualListBytes(buf []byte, list []Pictvisual) int { b := 0 var structBytes []byte @@ -496,7 +496,7 @@ func (v Pictdepth) Bytes() []byte { return buf } -// PictdepthListBytes writes a list of %s(MISSING) values to a byte slice. +// PictdepthListBytes writes a list of Pictdepth values to a byte slice. func PictdepthListBytes(buf []byte, list []Pictdepth) int { b := 0 var structBytes []byte @@ -565,7 +565,7 @@ func (v Pictscreen) Bytes() []byte { return buf } -// PictscreenListBytes writes a list of %s(MISSING) values to a byte slice. +// PictscreenListBytes writes a list of Pictscreen values to a byte slice. func PictscreenListBytes(buf []byte, list []Pictscreen) int { b := 0 var structBytes []byte @@ -649,7 +649,7 @@ func (v Indexvalue) Bytes() []byte { return buf } -// IndexvalueListBytes writes a list of %s(MISSING) values to a byte slice. +// IndexvalueListBytes writes a list of Indexvalue values to a byte slice. func IndexvalueListBytes(buf []byte, list []Indexvalue) int { b := 0 var structBytes []byte @@ -717,7 +717,7 @@ func (v Color) Bytes() []byte { return buf } -// ColorListBytes writes a list of %s(MISSING) values to a byte slice. +// ColorListBytes writes a list of Color values to a byte slice. func ColorListBytes(buf []byte, list []Color) int { b := 0 var structBytes []byte @@ -771,7 +771,7 @@ func (v Pointfix) Bytes() []byte { return buf } -// PointfixListBytes writes a list of %s(MISSING) values to a byte slice. +// PointfixListBytes writes a list of Pointfix values to a byte slice. func PointfixListBytes(buf []byte, list []Pointfix) int { b := 0 var structBytes []byte @@ -831,7 +831,7 @@ func (v Linefix) Bytes() []byte { return buf } -// LinefixListBytes writes a list of %s(MISSING) values to a byte slice. +// LinefixListBytes writes a list of Linefix values to a byte slice. func LinefixListBytes(buf []byte, list []Linefix) int { b := 0 var structBytes []byte @@ -901,7 +901,7 @@ func (v Triangle) Bytes() []byte { return buf } -// TriangleListBytes writes a list of %s(MISSING) values to a byte slice. +// TriangleListBytes writes a list of Triangle values to a byte slice. func TriangleListBytes(buf []byte, list []Triangle) int { b := 0 var structBytes []byte @@ -975,7 +975,7 @@ func (v Trapezoid) Bytes() []byte { return buf } -// TrapezoidListBytes writes a list of %s(MISSING) values to a byte slice. +// TrapezoidListBytes writes a list of Trapezoid values to a byte slice. func TrapezoidListBytes(buf []byte, list []Trapezoid) int { b := 0 var structBytes []byte @@ -1057,7 +1057,7 @@ func (v Glyphinfo) Bytes() []byte { return buf } -// GlyphinfoListBytes writes a list of %s(MISSING) values to a byte slice. +// GlyphinfoListBytes writes a list of Glyphinfo values to a byte slice. func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { b := 0 var structBytes []byte @@ -1160,7 +1160,7 @@ func (v Transform) Bytes() []byte { return buf } -// TransformListBytes writes a list of %s(MISSING) values to a byte slice. +// TransformListBytes writes a list of Transform values to a byte slice. func TransformListBytes(buf []byte, list []Transform) int { b := 0 var structBytes []byte @@ -1214,7 +1214,7 @@ func (v Animcursorelt) Bytes() []byte { return buf } -// AnimcursoreltListBytes writes a list of %s(MISSING) values to a byte slice. +// AnimcursoreltListBytes writes a list of Animcursorelt values to a byte slice. func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { b := 0 var structBytes []byte @@ -1275,7 +1275,7 @@ func (v Spanfix) Bytes() []byte { return buf } -// SpanfixListBytes writes a list of %s(MISSING) values to a byte slice. +// SpanfixListBytes writes a list of Spanfix values to a byte slice. func SpanfixListBytes(buf []byte, list []Spanfix) int { b := 0 var structBytes []byte @@ -1335,7 +1335,7 @@ func (v Trap) Bytes() []byte { return buf } -// TrapListBytes writes a list of %s(MISSING) values to a byte slice. +// TrapListBytes writes a list of Trap values to a byte slice. func TrapListBytes(buf []byte, list []Trap) int { b := 0 var structBytes []byte diff --git a/nexgb/res/res.go b/nexgb/res/res.go index c5700c3..3859f34 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on May 11 2012 11:57:19pm EDT. + This file was generated by res.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -106,7 +106,7 @@ func (v Client) Bytes() []byte { return buf } -// ClientListBytes writes a list of %s(MISSING) values to a byte slice. +// ClientListBytes writes a list of Client values to a byte slice. func ClientListBytes(buf []byte, list []Client) int { b := 0 var structBytes []byte @@ -160,7 +160,7 @@ func (v Type) Bytes() []byte { return buf } -// TypeListBytes writes a list of %s(MISSING) values to a byte slice. +// TypeListBytes writes a list of Type values to a byte slice. func TypeListBytes(buf []byte, list []Type) int { b := 0 var structBytes []byte diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index a06d8a6..285c3d7 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on May 11 2012 11:57:19pm EDT. + This file was generated by screensaver.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - // Skipping definition for base type 'Double' // Skipping definition for base type 'Bool' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Void' +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + const ( KindBlanked = 0 KindInternal = 1 diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 83d9020..92ec1fd 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on May 11 2012 11:57:19pm EDT. + This file was generated by shape.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( SoSet = 0 SoUnion = 1 diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index ac53579..1bb8408 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on May 11 2012 11:57:19pm EDT. + This file was generated by shm.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + type Seg uint32 func NewSegId(c *xgb.Conn) (Seg, error) { diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 5aa019e..bc63a45 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on May 11 2012 11:57:19pm EDT. + This file was generated by sync.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -54,16 +64,6 @@ func init() { // Skipping definition for base type 'Int8' -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - const ( AlarmstateActive = 0 AlarmstateInactive = 1 @@ -163,7 +163,7 @@ func (v Int64) Bytes() []byte { return buf } -// Int64ListBytes writes a list of %s(MISSING) values to a byte slice. +// Int64ListBytes writes a list of Int64 values to a byte slice. func Int64ListBytes(buf []byte, list []Int64) int { b := 0 var structBytes []byte @@ -238,7 +238,7 @@ func (v Systemcounter) Bytes() []byte { return buf } -// SystemcounterListBytes writes a list of %s(MISSING) values to a byte slice. +// SystemcounterListBytes writes a list of Systemcounter values to a byte slice. func SystemcounterListBytes(buf []byte, list []Systemcounter) int { b := 0 var structBytes []byte @@ -318,7 +318,7 @@ func (v Trigger) Bytes() []byte { return buf } -// TriggerListBytes writes a list of %s(MISSING) values to a byte slice. +// TriggerListBytes writes a list of Trigger values to a byte slice. func TriggerListBytes(buf []byte, list []Trigger) int { b := 0 var structBytes []byte @@ -378,7 +378,7 @@ func (v Waitcondition) Bytes() []byte { return buf } -// WaitconditionListBytes writes a list of %s(MISSING) values to a byte slice. +// WaitconditionListBytes writes a list of Waitcondition values to a byte slice. func WaitconditionListBytes(buf []byte, list []Waitcondition) int { b := 0 var structBytes []byte diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 0a4b4ce..0ca4094 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 11 2012 11:57:19pm EDT. + This file was generated by xc_misc.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 0628ffd..ebcd99c 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on May 11 2012 11:57:19pm EDT. + This file was generated by xevie.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - const ( DatatypeUnmodified = 0 DatatypeModified = 1 @@ -102,7 +102,7 @@ func (v Event) Bytes() []byte { return buf } -// EventListBytes writes a list of %s(MISSING) values to a byte slice. +// EventListBytes writes a list of Event values to a byte slice. func EventListBytes(buf []byte, list []Event) int { b := 0 var structBytes []byte diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index f0224a5..0737f5b 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on May 11 2012 11:57:19pm EDT. + This file was generated by xf86dri.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + type DrmClipRect struct { X1 int16 Y1 int16 @@ -120,7 +120,7 @@ func (v DrmClipRect) Bytes() []byte { return buf } -// DrmClipRectListBytes writes a list of %s(MISSING) values to a byte slice. +// DrmClipRectListBytes writes a list of DrmClipRect values to a byte slice. func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { b := 0 var structBytes []byte diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index be41acd..ae57983 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 11 2012 11:57:19pm EDT. + This file was generated by xf86vidmode.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - // Skipping definition for base type 'Bool' // Skipping definition for base type 'Float' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + const ( ModeFlagPositiveHsync = 1 ModeFlagNegativeHsync = 2 @@ -215,7 +215,7 @@ func (v ModeInfo) Bytes() []byte { return buf } -// ModeInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ModeInfoListBytes writes a list of ModeInfo values to a byte slice. func ModeInfoListBytes(buf []byte, list []ModeInfo) int { b := 0 var structBytes []byte diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 08cb596..daafe7e 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xfixes.xml on May 26 2012 6:23:13pm EDT. This file is automatically generated. Edit at your peril! */ @@ -42,6 +42,14 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -58,14 +66,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index a988893..cb765a0 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -85,7 +85,7 @@ func (s *Struct) Write(c *Context) { func (s *Struct) WriteList(c *Context) { c.Putln("// %sListBytes writes a list of %s values to a byte slice.", - s.SrcName()) + s.SrcName(), s.SrcName()) c.Putln("func %sListBytes(buf []byte, list []%s) int {", s.SrcName(), s.SrcName()) c.Putln("b := 0") diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 51b270a..24cba4a 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xinerama.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + type ScreenInfo struct { XOrg int16 YOrg int16 @@ -120,7 +120,7 @@ func (v ScreenInfo) Bytes() []byte { return buf } -// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { b := 0 var structBytes []byte diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 2ed45b8..6144528 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xinput.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Int16' -// Skipping definition for base type 'Int32' - const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 @@ -175,7 +175,7 @@ func (v DeviceInfo) Bytes() []byte { return buf } -// DeviceInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceInfoListBytes writes a list of DeviceInfo values to a byte slice. func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { b := 0 var structBytes []byte @@ -229,7 +229,7 @@ func (v InputInfo) Bytes() []byte { return buf } -// InputInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// InputInfoListBytes writes a list of InputInfo values to a byte slice. func InputInfoListBytes(buf []byte, list []InputInfo) int { b := 0 var structBytes []byte @@ -309,7 +309,7 @@ func (v KeyInfo) Bytes() []byte { return buf } -// KeyInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// KeyInfoListBytes writes a list of KeyInfo values to a byte slice. func KeyInfoListBytes(buf []byte, list []KeyInfo) int { b := 0 var structBytes []byte @@ -370,7 +370,7 @@ func (v ButtonInfo) Bytes() []byte { return buf } -// ButtonInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ButtonInfoListBytes writes a list of ButtonInfo values to a byte slice. func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { b := 0 var structBytes []byte @@ -431,7 +431,7 @@ func (v AxisInfo) Bytes() []byte { return buf } -// AxisInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// AxisInfoListBytes writes a list of AxisInfo values to a byte slice. func AxisInfoListBytes(buf []byte, list []AxisInfo) int { b := 0 var structBytes []byte @@ -512,7 +512,7 @@ func (v ValuatorInfo) Bytes() []byte { return buf } -// ValuatorInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ValuatorInfoListBytes writes a list of ValuatorInfo values to a byte slice. func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { b := 0 var structBytes []byte @@ -575,7 +575,7 @@ func (v InputClassInfo) Bytes() []byte { return buf } -// InputClassInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// InputClassInfoListBytes writes a list of InputClassInfo values to a byte slice. func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { b := 0 var structBytes []byte @@ -622,7 +622,7 @@ func (v DeviceTimeCoord) Bytes() []byte { return buf } -// DeviceTimeCoordListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceTimeCoordListBytes writes a list of DeviceTimeCoord values to a byte slice. func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { b := 0 var structBytes []byte @@ -683,7 +683,7 @@ func (v FeedbackState) Bytes() []byte { return buf } -// FeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// FeedbackStateListBytes writes a list of FeedbackState values to a byte slice. func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { b := 0 var structBytes []byte @@ -814,7 +814,7 @@ func (v KbdFeedbackState) Bytes() []byte { return buf } -// KbdFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// KbdFeedbackStateListBytes writes a list of KbdFeedbackState values to a byte slice. func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { b := 0 var structBytes []byte @@ -910,7 +910,7 @@ func (v PtrFeedbackState) Bytes() []byte { return buf } -// PtrFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// PtrFeedbackStateListBytes writes a list of PtrFeedbackState values to a byte slice. func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { b := 0 var structBytes []byte @@ -992,7 +992,7 @@ func (v IntegerFeedbackState) Bytes() []byte { return buf } -// IntegerFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// IntegerFeedbackStateListBytes writes a list of IntegerFeedbackState values to a byte slice. func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { b := 0 var structBytes []byte @@ -1081,7 +1081,7 @@ func (v StringFeedbackState) Bytes() []byte { return buf } -// StringFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// StringFeedbackStateListBytes writes a list of StringFeedbackState values to a byte slice. func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { b := 0 var structBytes []byte @@ -1177,7 +1177,7 @@ func (v BellFeedbackState) Bytes() []byte { return buf } -// BellFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// BellFeedbackStateListBytes writes a list of BellFeedbackState values to a byte slice. func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { b := 0 var structBytes []byte @@ -1252,7 +1252,7 @@ func (v LedFeedbackState) Bytes() []byte { return buf } -// LedFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. +// LedFeedbackStateListBytes writes a list of LedFeedbackState values to a byte slice. func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { b := 0 var structBytes []byte @@ -1313,7 +1313,7 @@ func (v FeedbackCtl) Bytes() []byte { return buf } -// FeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// FeedbackCtlListBytes writes a list of FeedbackCtl values to a byte slice. func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { b := 0 var structBytes []byte @@ -1430,7 +1430,7 @@ func (v KbdFeedbackCtl) Bytes() []byte { return buf } -// KbdFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// KbdFeedbackCtlListBytes writes a list of KbdFeedbackCtl values to a byte slice. func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { b := 0 var structBytes []byte @@ -1517,7 +1517,7 @@ func (v PtrFeedbackCtl) Bytes() []byte { return buf } -// PtrFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// PtrFeedbackCtlListBytes writes a list of PtrFeedbackCtl values to a byte slice. func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { b := 0 var structBytes []byte @@ -1585,7 +1585,7 @@ func (v IntegerFeedbackCtl) Bytes() []byte { return buf } -// IntegerFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// IntegerFeedbackCtlListBytes writes a list of IntegerFeedbackCtl values to a byte slice. func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { b := 0 var structBytes []byte @@ -1672,7 +1672,7 @@ func (v StringFeedbackCtl) Bytes() []byte { return buf } -// StringFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// StringFeedbackCtlListBytes writes a list of StringFeedbackCtl values to a byte slice. func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { b := 0 var structBytes []byte @@ -1768,7 +1768,7 @@ func (v BellFeedbackCtl) Bytes() []byte { return buf } -// BellFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// BellFeedbackCtlListBytes writes a list of BellFeedbackCtl values to a byte slice. func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { b := 0 var structBytes []byte @@ -1843,7 +1843,7 @@ func (v LedFeedbackCtl) Bytes() []byte { return buf } -// LedFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// LedFeedbackCtlListBytes writes a list of LedFeedbackCtl values to a byte slice. func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { b := 0 var structBytes []byte @@ -1904,7 +1904,7 @@ func (v InputState) Bytes() []byte { return buf } -// InputStateListBytes writes a list of %s(MISSING) values to a byte slice. +// InputStateListBytes writes a list of InputState values to a byte slice. func InputStateListBytes(buf []byte, list []InputState) int { b := 0 var structBytes []byte @@ -1978,7 +1978,7 @@ func (v KeyState) Bytes() []byte { return buf } -// KeyStateListBytes writes a list of %s(MISSING) values to a byte slice. +// KeyStateListBytes writes a list of KeyState values to a byte slice. func KeyStateListBytes(buf []byte, list []KeyState) int { b := 0 var structBytes []byte @@ -2061,7 +2061,7 @@ func (v ButtonState) Bytes() []byte { return buf } -// ButtonStateListBytes writes a list of %s(MISSING) values to a byte slice. +// ButtonStateListBytes writes a list of ButtonState values to a byte slice. func ButtonStateListBytes(buf []byte, list []ButtonState) int { b := 0 var structBytes []byte @@ -2152,7 +2152,7 @@ func (v ValuatorState) Bytes() []byte { return buf } -// ValuatorStateListBytes writes a list of %s(MISSING) values to a byte slice. +// ValuatorStateListBytes writes a list of ValuatorState values to a byte slice. func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { b := 0 var structBytes []byte @@ -2215,7 +2215,7 @@ func (v DeviceState) Bytes() []byte { return buf } -// DeviceStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceStateListBytes writes a list of DeviceState values to a byte slice. func DeviceStateListBytes(buf []byte, list []DeviceState) int { b := 0 var structBytes []byte @@ -2318,7 +2318,7 @@ func (v DeviceResolutionState) Bytes() []byte { return buf } -// DeviceResolutionStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceResolutionStateListBytes writes a list of DeviceResolutionState values to a byte slice. func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { b := 0 var structBytes []byte @@ -2437,7 +2437,7 @@ func (v DeviceAbsCalibState) Bytes() []byte { return buf } -// DeviceAbsCalibStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceAbsCalibStateListBytes writes a list of DeviceAbsCalibState values to a byte slice. func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { b := 0 var structBytes []byte @@ -2533,7 +2533,7 @@ func (v DeviceAbsAreaState) Bytes() []byte { return buf } -// DeviceAbsAreaStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceAbsAreaStateListBytes writes a list of DeviceAbsAreaState values to a byte slice. func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { b := 0 var structBytes []byte @@ -2606,7 +2606,7 @@ func (v DeviceCoreState) Bytes() []byte { return buf } -// DeviceCoreStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceCoreStateListBytes writes a list of DeviceCoreState values to a byte slice. func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { b := 0 var structBytes []byte @@ -2672,7 +2672,7 @@ func (v DeviceEnableState) Bytes() []byte { return buf } -// DeviceEnableStateListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceEnableStateListBytes writes a list of DeviceEnableState values to a byte slice. func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { b := 0 var structBytes []byte @@ -2726,7 +2726,7 @@ func (v DeviceCtl) Bytes() []byte { return buf } -// DeviceCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceCtlListBytes writes a list of DeviceCtl values to a byte slice. func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { b := 0 var structBytes []byte @@ -2808,7 +2808,7 @@ func (v DeviceResolutionCtl) Bytes() []byte { return buf } -// DeviceResolutionCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceResolutionCtlListBytes writes a list of DeviceResolutionCtl values to a byte slice. func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { b := 0 var structBytes []byte @@ -2927,7 +2927,7 @@ func (v DeviceAbsCalibCtl) Bytes() []byte { return buf } -// DeviceAbsCalibCtlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceAbsCalibCtlListBytes writes a list of DeviceAbsCalibCtl values to a byte slice. func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { b := 0 var structBytes []byte @@ -3023,7 +3023,7 @@ func (v DeviceAbsAreaCtrl) Bytes() []byte { return buf } -// DeviceAbsAreaCtrlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceAbsAreaCtrlListBytes writes a list of DeviceAbsAreaCtrl values to a byte slice. func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { b := 0 var structBytes []byte @@ -3089,7 +3089,7 @@ func (v DeviceCoreCtrl) Bytes() []byte { return buf } -// DeviceCoreCtrlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceCoreCtrlListBytes writes a list of DeviceCoreCtrl values to a byte slice. func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { b := 0 var structBytes []byte @@ -3155,7 +3155,7 @@ func (v DeviceEnableCtrl) Bytes() []byte { return buf } -// DeviceEnableCtrlListBytes writes a list of %s(MISSING) values to a byte slice. +// DeviceEnableCtrlListBytes writes a list of DeviceEnableCtrl values to a byte slice. func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { b := 0 var structBytes []byte diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 8e6f470..a7a537a 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xprint.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( GetDocFinished = 0 GetDocSecondConsumer = 1 @@ -176,7 +176,7 @@ func (v Printer) Bytes() []byte { return buf } -// PrinterListBytes writes a list of %s(MISSING) values to a byte slice. +// PrinterListBytes writes a list of Printer values to a byte slice. func PrinterListBytes(buf []byte, list []Printer) int { b := 0 var structBytes []byte diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index f19e99e..3ee3850 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xproto.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -23,6 +23,16 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -37,16 +47,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -775,7 +775,7 @@ func (v Char2b) Bytes() []byte { return buf } -// Char2bListBytes writes a list of %s(MISSING) values to a byte slice. +// Char2bListBytes writes a list of Char2b values to a byte slice. func Char2bListBytes(buf []byte, list []Char2b) int { b := 0 var structBytes []byte @@ -829,7 +829,7 @@ func (v Point) Bytes() []byte { return buf } -// PointListBytes writes a list of %s(MISSING) values to a byte slice. +// PointListBytes writes a list of Point values to a byte slice. func PointListBytes(buf []byte, list []Point) int { b := 0 var structBytes []byte @@ -897,7 +897,7 @@ func (v Rectangle) Bytes() []byte { return buf } -// RectangleListBytes writes a list of %s(MISSING) values to a byte slice. +// RectangleListBytes writes a list of Rectangle values to a byte slice. func RectangleListBytes(buf []byte, list []Rectangle) int { b := 0 var structBytes []byte @@ -979,7 +979,7 @@ func (v Arc) Bytes() []byte { return buf } -// ArcListBytes writes a list of %s(MISSING) values to a byte slice. +// ArcListBytes writes a list of Arc values to a byte slice. func ArcListBytes(buf []byte, list []Arc) int { b := 0 var structBytes []byte @@ -1045,7 +1045,7 @@ func (v Format) Bytes() []byte { return buf } -// FormatListBytes writes a list of %s(MISSING) values to a byte slice. +// FormatListBytes writes a list of Format values to a byte slice. func FormatListBytes(buf []byte, list []Format) int { b := 0 var structBytes []byte @@ -1139,7 +1139,7 @@ func (v VisualInfo) Bytes() []byte { return buf } -// VisualInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// VisualInfoListBytes writes a list of VisualInfo values to a byte slice. func VisualInfoListBytes(buf []byte, list []VisualInfo) int { b := 0 var structBytes []byte @@ -1209,7 +1209,7 @@ func (v DepthInfo) Bytes() []byte { return buf } -// DepthInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// DepthInfoListBytes writes a list of DepthInfo values to a byte slice. func DepthInfoListBytes(buf []byte, list []DepthInfo) int { b := 0 var structBytes []byte @@ -1384,7 +1384,7 @@ func (v ScreenInfo) Bytes() []byte { return buf } -// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { b := 0 var structBytes []byte @@ -1500,7 +1500,7 @@ func (v SetupRequest) Bytes() []byte { return buf } -// SetupRequestListBytes writes a list of %s(MISSING) values to a byte slice. +// SetupRequestListBytes writes a list of SetupRequest values to a byte slice. func SetupRequestListBytes(buf []byte, list []SetupRequest) int { b := 0 var structBytes []byte @@ -1595,7 +1595,7 @@ func (v SetupFailed) Bytes() []byte { return buf } -// SetupFailedListBytes writes a list of %s(MISSING) values to a byte slice. +// SetupFailedListBytes writes a list of SetupFailed values to a byte slice. func SetupFailedListBytes(buf []byte, list []SetupFailed) int { b := 0 var structBytes []byte @@ -1674,7 +1674,7 @@ func (v SetupAuthenticate) Bytes() []byte { return buf } -// SetupAuthenticateListBytes writes a list of %s(MISSING) values to a byte slice. +// SetupAuthenticateListBytes writes a list of SetupAuthenticate values to a byte slice. func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { b := 0 var structBytes []byte @@ -1882,7 +1882,7 @@ func (v SetupInfo) Bytes() []byte { return buf } -// SetupInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// SetupInfoListBytes writes a list of SetupInfo values to a byte slice. func SetupInfoListBytes(buf []byte, list []SetupInfo) int { b := 0 var structBytes []byte @@ -1952,7 +1952,7 @@ func (v Timecoord) Bytes() []byte { return buf } -// TimecoordListBytes writes a list of %s(MISSING) values to a byte slice. +// TimecoordListBytes writes a list of Timecoord values to a byte slice. func TimecoordListBytes(buf []byte, list []Timecoord) int { b := 0 var structBytes []byte @@ -2006,7 +2006,7 @@ func (v Fontprop) Bytes() []byte { return buf } -// FontpropListBytes writes a list of %s(MISSING) values to a byte slice. +// FontpropListBytes writes a list of Fontprop values to a byte slice. func FontpropListBytes(buf []byte, list []Fontprop) int { b := 0 var structBytes []byte @@ -2088,7 +2088,7 @@ func (v Charinfo) Bytes() []byte { return buf } -// CharinfoListBytes writes a list of %s(MISSING) values to a byte slice. +// CharinfoListBytes writes a list of Charinfo values to a byte slice. func CharinfoListBytes(buf []byte, list []Charinfo) int { b := 0 var structBytes []byte @@ -2146,7 +2146,7 @@ func (v Str) Bytes() []byte { return buf } -// StrListBytes writes a list of %s(MISSING) values to a byte slice. +// StrListBytes writes a list of Str values to a byte slice. func StrListBytes(buf []byte, list []Str) int { b := 0 var structBytes []byte @@ -2223,7 +2223,7 @@ func (v Segment) Bytes() []byte { return buf } -// SegmentListBytes writes a list of %s(MISSING) values to a byte slice. +// SegmentListBytes writes a list of Segment values to a byte slice. func SegmentListBytes(buf []byte, list []Segment) int { b := 0 var structBytes []byte @@ -2303,7 +2303,7 @@ func (v Coloritem) Bytes() []byte { return buf } -// ColoritemListBytes writes a list of %s(MISSING) values to a byte slice. +// ColoritemListBytes writes a list of Coloritem values to a byte slice. func ColoritemListBytes(buf []byte, list []Coloritem) int { b := 0 var structBytes []byte @@ -2369,7 +2369,7 @@ func (v Rgb) Bytes() []byte { return buf } -// RgbListBytes writes a list of %s(MISSING) values to a byte slice. +// RgbListBytes writes a list of Rgb values to a byte slice. func RgbListBytes(buf []byte, list []Rgb) int { b := 0 var structBytes []byte @@ -2436,7 +2436,7 @@ func (v Host) Bytes() []byte { return buf } -// HostListBytes writes a list of %s(MISSING) values to a byte slice. +// HostListBytes writes a list of Host values to a byte slice. func HostListBytes(buf []byte, list []Host) int { b := 0 var structBytes []byte diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 115feb7..5f31984 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xselinux.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - // Skipping definition for base type 'Char' // Skipping definition for base type 'Card32' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + type ListItem struct { Name xproto.Atom ObjectContextLen uint32 @@ -135,7 +135,7 @@ func (v ListItem) Bytes() []byte { return buf } -// ListItemListBytes writes a list of %s(MISSING) values to a byte slice. +// ListItemListBytes writes a list of ListItem values to a byte slice. func ListItemListBytes(buf []byte, list []ListItem) int { b := 0 var structBytes []byte diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 3fab056..3612649 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xtest.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( CursorNone = 0 CursorCurrent = 1 diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index c6ba384..c3deb75 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xv.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,14 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -65,6 +57,14 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( TypeInputMask = 1 TypeOutputMask = 2 @@ -172,7 +172,7 @@ func (v Rational) Bytes() []byte { return buf } -// RationalListBytes writes a list of %s(MISSING) values to a byte slice. +// RationalListBytes writes a list of Rational values to a byte slice. func RationalListBytes(buf []byte, list []Rational) int { b := 0 var structBytes []byte @@ -231,7 +231,7 @@ func (v Format) Bytes() []byte { return buf } -// FormatListBytes writes a list of %s(MISSING) values to a byte slice. +// FormatListBytes writes a list of Format values to a byte slice. func FormatListBytes(buf []byte, list []Format) int { b := 0 var structBytes []byte @@ -328,7 +328,7 @@ func (v AdaptorInfo) Bytes() []byte { return buf } -// AdaptorInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// AdaptorInfoListBytes writes a list of AdaptorInfo values to a byte slice. func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { b := 0 var structBytes []byte @@ -431,7 +431,7 @@ func (v EncodingInfo) Bytes() []byte { return buf } -// EncodingInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// EncodingInfoListBytes writes a list of EncodingInfo values to a byte slice. func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { b := 0 var structBytes []byte @@ -551,7 +551,7 @@ func (v Image) Bytes() []byte { return buf } -// ImageListBytes writes a list of %s(MISSING) values to a byte slice. +// ImageListBytes writes a list of Image values to a byte slice. func ImageListBytes(buf []byte, list []Image) int { b := 0 var structBytes []byte @@ -639,7 +639,7 @@ func (v AttributeInfo) Bytes() []byte { return buf } -// AttributeInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// AttributeInfoListBytes writes a list of AttributeInfo values to a byte slice. func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { b := 0 var structBytes []byte @@ -869,7 +869,7 @@ func (v ImageFormatInfo) Bytes() []byte { return buf } -// ImageFormatInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// ImageFormatInfoListBytes writes a list of ImageFormatInfo values to a byte slice. func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { b := 0 var structBytes []byte diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 19b1c83..dc6a950 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on May 11 2012 11:57:20pm EDT. + This file was generated by xvmc.xml on May 26 2012 6:23:14pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,16 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -65,6 +55,16 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { @@ -186,7 +186,7 @@ func (v SurfaceInfo) Bytes() []byte { return buf } -// SurfaceInfoListBytes writes a list of %s(MISSING) values to a byte slice. +// SurfaceInfoListBytes writes a list of SurfaceInfo values to a byte slice. func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { b := 0 var structBytes []byte From cd22f99b20b3520f578bd146847ad5c8b0603d57 Mon Sep 17 00:00:00 2001 From: Paul Sbarra Date: Mon, 28 May 2012 17:04:02 -0500 Subject: [PATCH 50/90] auth: use encoding.binary --- nexgb/auth.go | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/nexgb/auth.go b/nexgb/auth.go index 396e832..a6fad90 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -7,7 +7,7 @@ It is largely unmodified from the original XGB package that I forked. */ import ( - "bufio" + "encoding/binary" "errors" "io" "os" @@ -21,7 +21,7 @@ func readAuthority(hostname, display string) ( // b is a scratch buffer to use and should be at least 256 bytes long // (i.e. it should be able to hold a hostname). - var b [256]byte + b := make([]byte, 256) // As per /usr/include/X11/Xauth.h. const familyLocal = 256 @@ -49,29 +49,28 @@ func readAuthority(hostname, display string) ( } defer r.Close() - br := bufio.NewReader(r) for { - family, err := getU16BE(br, b[0:2]) + var family uint16 + if err := binary.Read(r, binary.BigEndian, &family); err != nil { + return "", nil, err + } + + addr, err := getString(r, b) if err != nil { return "", nil, err } - addr, err := getString(br, b[0:]) + disp, err := getString(r, b) if err != nil { return "", nil, err } - disp, err := getString(br, b[0:]) + name0, err := getString(r, b) if err != nil { return "", nil, err } - name0, err := getString(br, b[0:]) - if err != nil { - return "", nil, err - } - - data0, err := getBytes(br, b[0:]) + data0, err := getBytes(r, b) if err != nil { return "", nil, err } @@ -83,24 +82,15 @@ func readAuthority(hostname, display string) ( panic("unreachable") } -func getU16BE(r io.Reader, b []byte) (uint16, error) { - _, err := io.ReadFull(r, b[0:2]) - if err != nil { - return 0, err - } - return uint16(b[0])<<8 + uint16(b[1]), nil -} - func getBytes(r io.Reader, b []byte) ([]byte, error) { - n, err := getU16BE(r, b) - if err != nil { + var n uint16 + if err := binary.Read(r, binary.BigEndian, &n); err != nil { return nil, err - } - if int(n) > len(b) { + } else if n > uint16(len(b)) { return nil, errors.New("bytes too long for buffer") } - _, err = io.ReadFull(r, b[0:n]) - if err != nil { + + if _, err := io.ReadFull(r, b[0:n]); err != nil { return nil, err } return b[0:n], nil From e960f4d34effe41b3d0ff327001f7df833f69cba Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 28 May 2012 20:43:03 -0400 Subject: [PATCH 51/90] Add some style guidelines. --- nexgb/STYLE | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 nexgb/STYLE diff --git a/nexgb/STYLE b/nexgb/STYLE new file mode 100644 index 0000000..b827c3c --- /dev/null +++ b/nexgb/STYLE @@ -0,0 +1,29 @@ +I like to keep all my code to 80 columns or less. I have plenty of screen real +estate, but enjoy 80 columns so that I can have multiple code windows open side +to side and not be plagued by the ugly auto-wrapping of a text editor. + +If you don't oblige me, I will fix any patch you submit to abide 80 columns. + +Note that this style restriction does not preclude gofmt, but introduces a few +peculiarities. The first is that gofmt will occasionally add spacing (typically +to comments) that ends up going over 80 columns. Either shorten the comment or +put it on its own line. + +The second and more common hiccup is when a function definition extends beyond +80 columns. If one adds line breaks to keep it below 80 columns, gofmt will +indent all subsequent lines in a function definition to the same indentation +level of the function body. This results in a less-than-ideal separation +between function definition and function body. To remedy this, simply add a +line break like so: + + func RestackWindowExtra(xu *xgbutil.XUtil, win xproto.Window, stackMode int, + sibling xproto.Window, source int) error { + + return ClientEvent(xu, win, "_NET_RESTACK_WINDOW", source, int(sibling), + stackMode) + } + +Something similar should also be applied to long 'if' or 'for' conditionals, +although it would probably be preferrable to break up the conditional to +smaller chunks with a few helper variables. + From 8ee0ea98997eaa967f862da029cc04e5ae18b90e Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 2 Jun 2012 12:59:44 -0400 Subject: [PATCH 52/90] A pathological example for profiling purposes. Use 'make test'. --- nexgb/examples/atoms/.gitignore | 3 ++ nexgb/examples/atoms/Makefile | 12 +++++ nexgb/examples/atoms/main.go | 91 +++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 nexgb/examples/atoms/.gitignore create mode 100644 nexgb/examples/atoms/Makefile create mode 100644 nexgb/examples/atoms/main.go diff --git a/nexgb/examples/atoms/.gitignore b/nexgb/examples/atoms/.gitignore new file mode 100644 index 0000000..01e08a1 --- /dev/null +++ b/nexgb/examples/atoms/.gitignore @@ -0,0 +1,3 @@ +atoms +*.info +*.prof diff --git a/nexgb/examples/atoms/Makefile b/nexgb/examples/atoms/Makefile new file mode 100644 index 0000000..c192a37 --- /dev/null +++ b/nexgb/examples/atoms/Makefile @@ -0,0 +1,12 @@ +atoms: + go build + +test: atoms + ./atoms --requests 500000 --cpu 1 \ + --cpuprof cpu1.prof --memprof mem1.prof > atoms1.info 2>&1 + ./atoms --requests 500000 --cpu 2 \ + --cpuprof cpu2.prof --memprof mem2.prof > atoms2.info 2>&1 + ./atoms --requests 500000 --cpu 3 \ + --cpuprof cpu3.prof --memprof mem3.prof > atoms3.info 2>&1 + ./atoms --requests 500000 --cpu 6 \ + --cpuprof cpu6.prof --memprof mem6.prof > atoms6.info 2>&1 diff --git a/nexgb/examples/atoms/main.go b/nexgb/examples/atoms/main.go new file mode 100644 index 0000000..8985768 --- /dev/null +++ b/nexgb/examples/atoms/main.go @@ -0,0 +1,91 @@ +package main + +import ( + "flag" + "fmt" + "log" + "os" + "runtime" + "runtime/pprof" + "time" + + "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xproto" +) + +var ( + flagRequests int + flagGOMAXPROCS int + flagCpuProfName string + flagMemProfName string +) + +func init() { + flag.IntVar(&flagRequests, "requests", 100000, "Number of atoms to intern.") + flag.IntVar(&flagGOMAXPROCS, "cpu", 1, "Value of GOMAXPROCS.") + flag.StringVar(&flagCpuProfName, "cpuprof", "cpu.prof", + "Name of CPU profile file.") + flag.StringVar(&flagMemProfName, "memprof", "mem.prof", + "Name of memory profile file.") + + flag.Parse() + + runtime.GOMAXPROCS(flagGOMAXPROCS) +} + +func seqNames(n int) []string { + names := make([]string, n) + for i := range names { + names[i] = fmt.Sprintf("NAME%d", i) + } + return names +} + +func main() { + X, err := xgb.NewConn() + if err != nil { + log.Fatal(err) + } + + names := seqNames(flagRequests) + + fcpu, err := os.Create(flagCpuProfName) + if err != nil { + log.Fatal(err) + } + defer fcpu.Close() + pprof.StartCPUProfile(fcpu) + defer pprof.StopCPUProfile() + + start := time.Now() + cookies := make([]xproto.InternAtomCookie, flagRequests) + for i := 0; i < flagRequests; i++ { + cookies[i] = xproto.InternAtom(X, + false, uint16(len(names[i])), names[i]) + } + for _, cookie := range cookies { + cookie.Reply() + } + fmt.Printf("Exec time: %s\n\n", time.Since(start)) + + fmem, err := os.Create(flagMemProfName) + if err != nil { + log.Fatal(err) + } + defer fmem.Close() + pprof.WriteHeapProfile(fmem) + + memStats := &runtime.MemStats{} + runtime.ReadMemStats(memStats) + + // This isn't right. I'm not sure what's wrong. + lastGcTime := time.Unix(int64(memStats.LastGC/1000000000), + int64(memStats.LastGC-memStats.LastGC/1000000000)) + + fmt.Printf("Alloc: %d\n", memStats.Alloc) + fmt.Printf("TotalAlloc: %d\n", memStats.TotalAlloc) + fmt.Printf("LastGC: %s\n", lastGcTime) + fmt.Printf("PauseTotalNs: %d\n", memStats.PauseTotalNs) + fmt.Printf("PauseNs: %d\n", memStats.PauseNs) + fmt.Printf("NumGC: %d\n", memStats.NumGC) +} From 744c9688cc58cbf83415439e281c9aa2825fd7f7 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 2 Jun 2012 12:59:53 -0400 Subject: [PATCH 53/90] Benchmark with gomaxprocs=3 too --- nexgb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/Makefile b/nexgb/Makefile index 6809661..f32e824 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -51,7 +51,7 @@ test: # Force all xproto benchmarks to run and no tests. bench: - (cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,6) + (cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,3,6) # gofmt all non-auto-generated code. # (auto-generated code is already gofmt'd.) From e9dc18b4f9a6a3f02dceaef93bafee3c826b8dd3 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 4 Jun 2012 23:55:20 -0400 Subject: [PATCH 54/90] Doc fix. --- nexgb/help.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/help.go b/nexgb/help.go index 5729917..f692442 100644 --- a/nexgb/help.go +++ b/nexgb/help.go @@ -37,7 +37,7 @@ func Pad(n int) int { return (n + 3) & ^3 } -// popCount counts the number of bits set in a value list mask. +// PopCount counts the number of bits set in a value list mask. func PopCount(mask0 int) int { mask := uint32(mask0) n := 0 From 22ceab8074f24734de307ace4753728142240d65 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 5 Jun 2012 00:14:07 -0400 Subject: [PATCH 55/90] Add rules for installing all packages. --- nexgb/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nexgb/Makefile b/nexgb/Makefile index f32e824..953b100 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -35,6 +35,16 @@ build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ %.b: (cd $* ; go build) +# Installs each individual sub-package. +install: bigreq.i composite.i damage.i dpms.i dri2.i ge.i glx.i randr.i \ + record.i render.i res.i screensaver.i shape.i shm.i sync.i xcmisc.i \ + xevie.i xf86dri.i xf86vidmode.i xfixes.i xinerama.i xinput.i \ + xprint.i xproto.i xselinux.i xtest.i xv.i xvmc.i + go install + +%.i: + (cd $* ; go install) + # xc_misc is special because it has an underscore. # There's probably a way to do this better, but Makefiles aren't my strong suit. xc_misc.xml: build-xgbgen From a9eae45cb3977bce5983e817d00d4584d176b044 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 5 Jun 2012 00:14:34 -0400 Subject: [PATCH 56/90] Refresh build. Eh. --- nexgb/bigreq/bigreq.go | 10 +++++----- nexgb/composite/composite.go | 14 +++++++------- nexgb/damage/damage.go | 22 +++++++++++----------- nexgb/dpms/dpms.go | 10 +++++----- nexgb/dri2/dri2.go | 6 +++--- nexgb/ge/ge.go | 22 +++++++++++----------- nexgb/glx/glx.go | 6 +++--- nexgb/randr/randr.go | 22 +++++++++++----------- nexgb/record/record.go | 6 +++--- nexgb/render/render.go | 26 +++++++++++++------------- nexgb/res/res.go | 6 +++--- nexgb/screensaver/screensaver.go | 10 +++++----- nexgb/shape/shape.go | 22 +++++++++++----------- nexgb/shm/shm.go | 6 +++--- nexgb/sync/sync.go | 22 +++++++++++----------- nexgb/xcmisc/xcmisc.go | 2 +- nexgb/xevie/xevie.go | 10 +++++----- nexgb/xf86dri/xf86dri.go | 10 +++++----- nexgb/xf86vidmode/xf86vidmode.go | 14 +++++++------- nexgb/xfixes/xfixes.go | 2 +- nexgb/xinerama/xinerama.go | 18 +++++++++--------- nexgb/xinput/xinput.go | 10 +++++----- nexgb/xprint/xprint.go | 18 +++++++++--------- nexgb/xproto/xproto.go | 18 +++++++++--------- nexgb/xselinux/xselinux.go | 18 +++++++++--------- nexgb/xtest/xtest.go | 10 +++++----- nexgb/xv/xv.go | 14 +++++++------- nexgb/xvmc/xvmc.go | 22 +++++++++++----------- 28 files changed, 188 insertions(+), 188 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index e7bdfc8..af03110 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on May 26 2012 6:23:12pm EDT. + This file was generated by bigreq.xml on Jun 5 2012 12:11:58am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index b188544..d1f19b9 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on May 26 2012 6:23:12pm EDT. + This file was generated by composite.xml on Jun 5 2012 12:11:58am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,12 +41,6 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -65,6 +59,12 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + const ( RedirectAutomatic = 0 RedirectManual = 1 diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 1c844db..abf2206 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on May 26 2012 6:23:12pm EDT. + This file was generated by damage.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,16 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -55,16 +65,6 @@ func init() { // Skipping definition for base type 'Card8' -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 0ef913c..f7d6ffe 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on May 26 2012 6:23:12pm EDT. + This file was generated by dpms.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Int32' +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + const ( DPMSModeOn = 0 DPMSModeStandby = 1 diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 5ad8c62..f047e54 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on May 26 2012 6:23:13pm EDT. + This file was generated by dri2.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + const ( AttachmentBufferFrontLeft = 0 AttachmentBufferBackLeft = 1 diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index b0bbbd7..9084275 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on May 26 2012 6:23:13pm EDT. + This file was generated by ge.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 6be52c2..cc6ab68 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on May 26 2012 6:23:13pm EDT. + This file was generated by glx.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + const ( PbcetDamaged = 32791 PbcetSaved = 32792 diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index b17cb83..6e2eecc 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on May 26 2012 6:23:13pm EDT. + This file was generated by randr.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,16 +41,6 @@ func init() { xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -65,6 +55,16 @@ func init() { // Skipping definition for base type 'Card8' +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + const ( RotationRotate0 = 1 RotationRotate90 = 2 diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 0ae6d81..4bed730 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on May 26 2012 6:23:13pm EDT. + This file was generated by record.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["RECORD"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Bool' -// Skipping definition for base type 'Float' - const ( HTypeFromServerTime = 1 HTypeFromClientTime = 2 diff --git a/nexgb/render/render.go b/nexgb/render/render.go index e435aa8..2f1ae13 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on May 26 2012 6:23:13pm EDT. + This file was generated by render.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( PictTypeIndexed = 0 PictTypeDirect = 1 diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 3859f34..cbbd8cc 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on May 26 2012 6:23:13pm EDT. + This file was generated by res.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,8 +40,6 @@ func init() { xgb.NewExtErrorFuncs["X-Resource"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +62,8 @@ func init() { // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Int8' + type Client struct { ResourceBase uint32 ResourceMask uint32 diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index 285c3d7..f336d0d 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on May 26 2012 6:23:13pm EDT. + This file was generated by screensaver.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + // Skipping definition for base type 'Double' // Skipping definition for base type 'Bool' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - const ( KindBlanked = 0 KindInternal = 1 diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 92ec1fd..b98a001 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on May 26 2012 6:23:13pm EDT. + This file was generated by shape.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,16 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -54,16 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( SoSet = 0 SoUnion = 1 diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index 1bb8408..97ce9ff 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on May 26 2012 6:23:13pm EDT. + This file was generated by shm.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,8 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Char' + // Skipping definition for base type 'Card32' // Skipping definition for base type 'Double' @@ -62,8 +64,6 @@ func init() { // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - type Seg uint32 func NewSegId(c *xgb.Conn) (Seg, error) { diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index bc63a45..a7046b7 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on May 26 2012 6:23:13pm EDT. + This file was generated by sync.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,16 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +54,16 @@ func init() { // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + const ( AlarmstateActive = 0 AlarmstateInactive = 1 diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 0ca4094..dce0e9d 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 26 2012 6:23:13pm EDT. + This file was generated by xc_misc.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index ebcd99c..83dadef 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on May 26 2012 6:23:13pm EDT. + This file was generated by xevie.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + // Skipping definition for base type 'Int32' // Skipping definition for base type 'Void' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - const ( DatatypeUnmodified = 0 DatatypeModified = 1 diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 0737f5b..d52654d 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on May 26 2012 6:23:13pm EDT. + This file was generated by xf86dri.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - // Skipping definition for base type 'Card16' // Skipping definition for base type 'Char' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Void' +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Int8' + type DrmClipRect struct { X1 int16 Y1 int16 diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index ae57983..7665cbf 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on May 26 2012 6:23:13pm EDT. + This file was generated by xf86vidmode.xml on Jun 5 2012 12:11:59am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,12 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +58,12 @@ func init() { // Skipping definition for base type 'Double' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + const ( ModeFlagPositiveHsync = 1 ModeFlagNegativeHsync = 2 diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index daafe7e..42e9e99 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on May 26 2012 6:23:13pm EDT. + This file was generated by xfixes.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 24cba4a..927ab82 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xinerama.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - type ScreenInfo struct { XOrg int16 YOrg int16 diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 6144528..0637653 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xinput.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,10 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -64,6 +60,10 @@ func init() { // Skipping definition for base type 'Int16' +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index a7a537a..54fb065 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xprint.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,14 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -56,14 +64,6 @@ func init() { // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - const ( GetDocFinished = 0 GetDocSecondConsumer = 1 diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 3ee3850..7527db5 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xproto.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -23,14 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - // Skipping definition for base type 'Byte' // Skipping definition for base type 'Int8' @@ -47,6 +39,14 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 5f31984..6024d65 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xselinux.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' // Skipping definition for base type 'Card8' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + type ListItem struct { Name xproto.Atom ObjectContextLen uint32 diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 3612649..30d96ec 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xtest.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -40,6 +40,10 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -60,10 +64,6 @@ func init() { // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( CursorNone = 0 CursorCurrent = 1 diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index c3deb75..ed10b3b 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xv.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,12 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -59,12 +65,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( TypeInputMask = 1 TypeOutputMask = 2 diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index dc6a950..0ddf369 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on May 26 2012 6:23:14pm EDT. + This file was generated by xvmc.xml on Jun 5 2012 12:12:00am EDT. This file is automatically generated. Edit at your peril! */ @@ -41,6 +41,16 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -55,16 +65,6 @@ func init() { // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { From 08275ebda825e8f6f03e3329793b72e34affad2f Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 5 Jun 2012 00:15:14 -0400 Subject: [PATCH 57/90] Doc fixes and stop exporting ReplyChecked and ReplyUnchecked --- nexgb/cookie.go | 33 +++++++++++++++++++++------------ nexgb/xgb.go | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/nexgb/cookie.go b/nexgb/cookie.go index e75e53c..6b1e4fb 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -22,8 +22,9 @@ type Cookie struct { // function for more info on those.) // Note that a sequence number is not set until just before the request // corresponding to this cookie is sent over the wire. -// This function should not be used. It is exported for use in the extension -// sub-packages. +// +// Unless you're building requests from bytes by hand, this method should +// not be used. func (c *Conn) NewCookie(checked, reply bool) *Cookie { cookie := &Cookie{ conn: c, @@ -64,21 +65,25 @@ func (c *Conn) NewCookie(checked, reply bool) *Cookie { // Reply detects whether this is a checked or unchecked cookie, and calls // 'replyChecked' or 'replyUnchecked' appropriately. -// This should not be used. It is exported for use in extension sub-packages. +// +// Unless you're building requests from bytes by hand, this method should +// not be used. func (c Cookie) Reply() ([]byte, error) { // checked if c.errorChan != nil { - return c.ReplyChecked() + return c.replyChecked() } - return c.ReplyUnchecked() + return c.replyUnchecked() } -// ReplyChecked waits for a response on either the replyChan or errorChan +// replyChecked waits for a response on either the replyChan or errorChan // channels. If the former arrives, the bytes are returned with a nil error. // If the latter arrives, no bytes are returned (nil) and the error received // is returned. -// This should not be used. It is exported for use in extension sub-packages. -func (c Cookie) ReplyChecked() ([]byte, error) { +// +// Unless you're building requests from bytes by hand, this method should +// not be used. +func (c Cookie) replyChecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyChecked' on a cookie that " + "is not expecting a *reply* or an error.") @@ -97,14 +102,16 @@ func (c Cookie) ReplyChecked() ([]byte, error) { panic("unreachable") } -// ReplyChecked waits for a response on either the replyChan or pingChan +// replyUnchecked waits for a response on either the replyChan or pingChan // channels. If the former arrives, the bytes are returned with a nil error. // If the latter arrives, no bytes are returned (nil) and a nil error // is returned. (In the latter case, the corresponding error can be retrieved // from (Wait|Poll)ForEvent asynchronously.) // In all honesty, you *probably* don't want to use this method. -// This should not be used. It is exported for use in extension sub-packages. -func (c Cookie) ReplyUnchecked() ([]byte, error) { +// +// Unless you're building requests from bytes by hand, this method should +// not be used. +func (c Cookie) replyUnchecked() ([]byte, error) { if c.replyChan == nil { return nil, errors.New("Cannot call 'replyUnchecked' on a cookie " + "that is not expecting a *reply*.") @@ -127,7 +134,9 @@ func (c Cookie) ReplyUnchecked() ([]byte, error) { // Thus, pingChan is sent a value when the *next* reply is read. // If no more replies are being processed, we force a round trip request with // GetInputFocus. -// This should not be used. It is exported for use in extension sub-packages. +// +// Unless you're building requests from bytes by hand, this method should +// not be used. func (c Cookie) Check() error { if c.replyChan != nil { return errors.New("Cannot call 'Check' on a cookie that is " + diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 7df0fac..c62cc85 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -162,7 +162,7 @@ var NewExtErrorFuncs = make(map[string]map[int]NewErrorFun) // error. type eventOrError interface{} -// NewID generates a new unused ID for use with requests like CreateWindow. +// NewId generates a new unused ID for use with requests like CreateWindow. // If no new ids can be generated, the id returned is 0 and error is non-nil. // This shouldn't be used directly, and is exported for use in the extension // sub-packages. @@ -269,6 +269,20 @@ type request struct { // a request type, and sends it over the Conn.reqChan channel. // Note that the sequence number is added to the cookie after it is sent // over the request channel, but before it is sent to X. +// +// Note that you may safely use NewRequest to send arbitrary byte requests +// to X. The resulting cookie can be used just like any normal cookie and +// abides by the same rules, except that for replies, you'll get back the +// raw byte data. This may be useful for performance critical sections where +// every allocation counts, since all X requests in XGB allocate a new byte +// slice. In contrast, NewRequest allocates one small request struct and +// nothing else. (Except when the cookie buffer is full and has to be flushed.) +// +// If you're using NewRequest manually, you'll need to use NewCookie to create +// a new cookie. +// +// In all likelihood, you should be able to copy and paste with some minor +// edits the generated code for the request you want to issue. func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { c.reqChan <- &request{buf: buf, cookie: cookie} } From 13eff4bec3ce71d26f6cc423a43cb158b60842a4 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Mon, 15 Oct 2012 13:35:03 -0400 Subject: [PATCH 58/90] Tests were move to xproto package a long time ago. Update README. --- nexgb/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/README b/nexgb/README index 1213ab5..c96a5fb 100644 --- a/nexgb/README +++ b/nexgb/README @@ -3,7 +3,7 @@ core X protocol and many of the X extensions. It is closely modeled after XCB and xpyb. It is thread safe and gets immediate improvement from parallelism when -GOMAXPROCS > 1. (See the benchmarks in xgb_test.go for evidence.) +GOMAXPROCS > 1. (See the benchmarks in xproto/xproto_test.go for evidence.) Please see doc.go for more info. From 269a7b9cc68b16d3618c1302f829048ee501dfab Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Tue, 16 Oct 2012 23:40:59 -0400 Subject: [PATCH 59/90] The hack continues. I've increased the event channel buffer. I know I'm goofing here. What I'd personally like to do is just use an "infinite" channel. That is, push the limit of how many events can be processed to the machine and not set an artificial limit in XGB. Some day... --- nexgb/xgb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index c62cc85..1c6ef93 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -41,7 +41,7 @@ const ( // that can be loaded off the wire and not grabbed with WaitForEvent // until reading an event blocks. This value should be big enough to handle // bursts of events. - eventBuffer = 500 + eventBuffer = 5000 ) // A Conn represents a connection to an X server. @@ -409,6 +409,7 @@ func (c *Conn) readResponses() { case c.eventChan <- event: default: go func() { + println("overflowing...") c.eventChan <- event }() } From e635de5e1d64d5d642c05ad24ebb207846022272 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 26 Jan 2013 12:51:21 -0500 Subject: [PATCH 60/90] Provide access to the X display number in the XGB Conn. --- nexgb/conn.go | 8 +++++--- nexgb/xgb.go | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nexgb/conn.go b/nexgb/conn.go index 9baf86c..bb2f413 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -141,8 +141,9 @@ func (c *Conn) dial(display string) error { scr = display[dotIdx+1:] } - dispnum, err := strconv.Atoi(c.display) - if err != nil || dispnum < 0 { + var err error + c.DisplayNumber, err = strconv.Atoi(c.display) + if err != nil || c.DisplayNumber < 0 { return errors.New("bad display string: " + display0) } @@ -160,7 +161,8 @@ func (c *Conn) dial(display string) error { if protocol == "" { protocol = "tcp" } - c.conn, err = net.Dial(protocol, c.host+":"+strconv.Itoa(6000+dispnum)) + c.conn, err = net.Dial(protocol, + c.host+":"+strconv.Itoa(6000+c.DisplayNumber)) } else { c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) } diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 1c6ef93..b123ba1 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -49,6 +49,7 @@ type Conn struct { host string conn net.Conn display string + DisplayNumber int DefaultScreen int SetupBytes []byte From 3658686aeea7acc61621782c7c1e6dad66517479 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 26 Jan 2013 12:51:48 -0500 Subject: [PATCH 61/90] gofmt --- nexgb/conn.go | 2 +- nexgb/doc.go | 20 ++++++++++---------- nexgb/xgb.go | 24 ++++++++++++------------ nexgb/xgbgen/expression.go | 2 +- nexgb/xgbgen/field.go | 2 +- nexgb/xgbgen/go_struct.go | 4 ++-- nexgb/xgbgen/request_reply.go | 2 +- nexgb/xproto/xproto_test.go | 4 ++-- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/nexgb/conn.go b/nexgb/conn.go index bb2f413..7f4cf08 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -162,7 +162,7 @@ func (c *Conn) dial(display string) error { protocol = "tcp" } c.conn, err = net.Dial(protocol, - c.host+":"+strconv.Itoa(6000+c.DisplayNumber)) + c.host+":"+strconv.Itoa(6000+c.DisplayNumber)) } else { c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) } diff --git a/nexgb/doc.go b/nexgb/doc.go index a5bb6fe..64540e9 100644 --- a/nexgb/doc.go +++ b/nexgb/doc.go @@ -15,8 +15,8 @@ https://github.com/BurntSushi/xgbutil Example This is an extremely terse example that demonstrates how to connect to X, -create a window, listen to StructureNotify events and Key{Press,Release} -events, map the window, and print out all events received. An example with +create a window, listen to StructureNotify events and Key{Press,Release} +events, map the window, and print out all events received. An example with accompanying documentation can be found in examples/create-window. package main @@ -111,11 +111,11 @@ evidence of this claim, please see the benchmarks in xproto/xproto_test.go. Tests -xproto/xproto_test.go contains a number of contrived tests that stress -particular corners of XGB that I presume could be problem areas. Namely: -requests with no replies, requests with replies, checked errors, unchecked -errors, sequence number wrapping, cookie buffer flushing (i.e., forcing a round -trip every N requests made that don't have a reply), getting/setting properties +xproto/xproto_test.go contains a number of contrived tests that stress +particular corners of XGB that I presume could be problem areas. Namely: +requests with no replies, requests with replies, checked errors, unchecked +errors, sequence number wrapping, cookie buffer flushing (i.e., forcing a round +trip every N requests made that don't have a reply), getting/setting properties and creating a window and listening to StructureNotify events. Code Generator @@ -131,15 +131,15 @@ What works I am reasonably confident that the core X protocol is in full working form. I've also tested the Xinerama and RandR extensions sparingly. Many of the other -existing extensions have Go source generated (and are compilable) and are -included in this package, but I am currently unsure of their status. They +existing extensions have Go source generated (and are compilable) and are +included in this package, but I am currently unsure of their status. They *should* work. What does not work XKB is the only extension that intentionally does not work, although I suspect that GLX also does not work (however, there is Go source code for GLX that -compiles, unlike XKB). I don't currently have any intention of getting XKB +compiles, unlike XKB). I don't currently have any intention of getting XKB working, due to its complexity and my current mental incapacity to test it. */ diff --git a/nexgb/xgb.go b/nexgb/xgb.go index b123ba1..3078c17 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -29,7 +29,7 @@ const ( xidBuffer = 5 // seqBuffer represents the queue size of the sequence number channel. - // I don't think this value matters much, since sequence number generation + // I don't think this value matters much, since sequence number generation // is not that expensive. seqBuffer = 5 @@ -132,7 +132,7 @@ var NewEventFuncs = make(map[int]NewEventFun) // NewExtEventFuncs is a temporary map that stores event constructor functions // for each extension. When an extension is initialized, each event for that -// extension is added to the 'NewEventFuncs' map. It should not be used. It is +// extension is added to the 'NewEventFuncs' map. It should not be used. It is // exported for use in the extension sub-packages. var NewExtEventFuncs = make(map[string]map[int]NewEventFun) @@ -195,11 +195,11 @@ func (conn *Conn) generateXIds() { defer close(conn.xidChan) // This requires some explanation. From the horse's mouth: - // "The resource-id-mask contains a single contiguous set of bits (at least - // 18). The client allocates resource IDs for types WINDOW, PIXMAP, - // CURSOR, FONT, GCONTEXT, and COLORMAP by choosing a value with only some - // subset of these bits set and ORing it with resource-id-base. Only values - // constructed in this way can be used to name newly created resources over + // "The resource-id-mask contains a single contiguous set of bits (at least + // 18). The client allocates resource IDs for types WINDOW, PIXMAP, + // CURSOR, FONT, GCONTEXT, and COLORMAP by choosing a value with only some + // subset of these bits set and ORing it with resource-id-base. Only values + // constructed in this way can be used to name newly created resources over // this connection." // So for example (using 8 bit integers), the mask might look like: // 00111000 @@ -240,7 +240,7 @@ func (c *Conn) newSequenceId() uint16 { // own goroutine. // A sequence id is generated for *every* request. It's the identifier used // to match up replies with requests. -// Since sequence ids can only be 16 bit integers we start over at zero when it +// Since sequence ids can only be 16 bit integers we start over at zero when it // comes time to wrap. // N.B. As long as the cookie buffer is less than 2^16, there are no limitations // on the number (or kind) of requests made in sequence. @@ -266,7 +266,7 @@ type request struct { cookie *Cookie } -// NewRequest takes the bytes and a cookie of a particular request, constructs +// NewRequest takes the bytes and a cookie of a particular request, constructs // a request type, and sends it over the Conn.reqChan channel. // Note that the sequence number is added to the cookie after it is sent // over the request channel, but before it is sent to X. @@ -500,9 +500,9 @@ func (c *Conn) WaitForEvent() (Event, Error) { return processEventOrError(<-c.eventChan) } -// PollForEvent returns the next event from the server if one is available in -// the internal queue without blocking. Note that unlike WaitForEvent, both -// Event and Error could be nil. Indeed, they are both nil when the event queue +// PollForEvent returns the next event from the server if one is available in +// the internal queue without blocking. Note that unlike WaitForEvent, both +// Event and Error could be nil. Indeed, they are both nil when the event queue // is empty. func (c *Conn) PollForEvent() (Event, Error) { select { diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index 2047b5f..f88232c 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -322,7 +322,7 @@ func (e *FieldRef) Initialize(p *Protocol) { } // EnumRef represents a reference to some enumeration field. -// EnumKind is the "group" an EnumItem is the name of the specific enumeration +// EnumKind is the "group" an EnumItem is the name of the specific enumeration // value inside that group. type EnumRef struct { EnumKind Type diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 78475f8..16760d4 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -138,7 +138,7 @@ func (f *ListField) Length() Size { // Size computes the *size* of a list (in bytes). // It it typically a simple matter of multiplying the length of the list by // the size of the type of the list. -// But if it's a list of struct where the struct has a list field, we use a +// But if it's a list of struct where the struct has a list field, we use a // special function written in go_struct.go to compute the size (since the // size in this case can only be computed recursively). func (f *ListField) Size() Size { diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index cb765a0..984a336 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -27,7 +27,7 @@ func (s *Struct) Define(c *Context) { } } -// Read for a struct creates a function 'ReadStructName' that takes a source +// Read for a struct creates a function 'ReadStructName' that takes a source // byte slice (i.e., the buffer) and a destination struct, and returns // the number of bytes read off the buffer. // 'ReadStructName' should only be used to read raw reply data from the wire. @@ -49,7 +49,7 @@ func (s *Struct) Read(c *Context) { } // ReadList for a struct creates a function 'ReadStructNameList' that takes -// a source (i.e., the buffer) byte slice, and a destination slice and returns +// a source (i.e., the buffer) byte slice, and a destination slice and returns // the number of bytes read from the byte slice. func (s *Struct) ReadList(c *Context) { c.Putln("// %sReadList reads a byte slice into a list of %s values.", diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index 637266b..b8afe48 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -88,7 +88,7 @@ func (r *Request) Size(c *Context) Size { size := newFixedSize(0) // If this is a core protocol request, we squeeze in an extra byte of - // data (from the fields below) between the opcode and the size of the + // data (from the fields below) between the opcode and the size of the // request. In an extension request, this byte is always occupied // by the opcode of the request (while the first byte is always occupied // by the opcode of the extension). diff --git a/nexgb/xproto/xproto_test.go b/nexgb/xproto/xproto_test.go index 8d0ca88..44d3285 100644 --- a/nexgb/xproto/xproto_test.go +++ b/nexgb/xproto/xproto_test.go @@ -88,8 +88,8 @@ func TestCookieBuffer(t *testing.T) { TestProperty(t) } -// TestSequenceWrap issues (2^16) + n requests w/ replies to guarantee that the -// sequence number (which is a 16 bit integer) will wrap. It then issues one +// TestSequenceWrap issues (2^16) + n requests w/ replies to guarantee that the +// sequence number (which is a 16 bit integer) will wrap. It then issues one // final request to ensure things still work properly. func TestSequenceWrap(t *testing.T) { n := (1 << 16) + 10 From 5d96993ee16d821b9448f4532328cb7caad223c9 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 19:33:56 -0400 Subject: [PATCH 62/90] Fixed a nasty bug where closing could cause ReadFull to crash the program. Close #4. --- nexgb/xgb.go | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 3078c17..c894be1 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -61,6 +61,7 @@ type Conn struct { xidChan chan xid seqChan chan uint16 reqChan chan *request + closing chan chan struct{} // Extensions is a map from extension name to major opcode. It should // not be used. It is exported for use in the extension sub-packages. @@ -100,6 +101,7 @@ func NewConnDisplay(display string) (*Conn, error) { conn.seqChan = make(chan uint16, seqBuffer) conn.reqChan = make(chan *request, reqBuffer) conn.eventChan = make(chan eventOrError, eventBuffer) + conn.closing = make(chan chan struct{}, 1) go conn.generateXIds() go conn.generateSeqIds() @@ -109,9 +111,9 @@ func NewConnDisplay(display string) (*Conn, error) { return conn, nil } -// Close closes the connection to the X server. +// Close gracefully closes the connection to the X server. func (c *Conn) Close() { - c.conn.Close() + close(c.reqChan) } // Event is an interface that can contain any of the events returned by the @@ -292,7 +294,6 @@ func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { // the bytes to the wire and adds the cookie to the cookie queue. // It is meant to be run as its own goroutine. func (c *Conn) sendRequests() { - defer close(c.reqChan) defer close(c.cookieChan) for req := range c.reqChan { @@ -301,17 +302,27 @@ func (c *Conn) sendRequests() { // Note that we circumvent the request channel, because we're *in* // the request channel. if len(c.cookieChan) == cookieBuffer-1 { - cookie := c.NewCookie(true, true) - cookie.Sequence = c.newSequenceId() - c.cookieChan <- cookie - c.writeBuffer(c.getInputFocusRequest()) - cookie.Reply() // wait for the buffer to clear + c.noop() } - req.cookie.Sequence = c.newSequenceId() c.cookieChan <- req.cookie c.writeBuffer(req.buf) } + response := make(chan struct{}) + c.closing <- response + c.noop() // Flush the response reading goroutine. + <-response + c.conn.Close() +} + +// noop circumvents the usual request sending goroutines and forces a round +// trip request manually. +func (c *Conn) noop() { + cookie := c.NewCookie(true, true) + cookie.Sequence = c.newSequenceId() + c.cookieChan <- cookie + c.writeBuffer(c.getInputFocusRequest()) + cookie.Reply() // wait for the buffer to clear } // writeBuffer is a convenience function for writing a byte slice to the wire. @@ -342,12 +353,19 @@ func (c *Conn) readResponses() { ) for { + select { + case respond := <-c.closing: + respond <- struct{}{} + return + default: + } + buf := make([]byte, 32) err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - logger.Printf("Read error: %s", err) - logger.Fatal("A read error is unrecoverable. Exiting...") + logger.Println("A read error is unrecoverable.") + panic(err) } switch buf[0] { From 4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:42:36 -0400 Subject: [PATCH 63/90] Updated to work with new xproto XML files. Namely, the "doc" element is ignored. Also, I've sorted everything before output so that diff isn't completely useless. --- nexgb/xgbgen/context.go | 5 +++++ nexgb/xgbgen/protocol.go | 6 ++++++ nexgb/xgbgen/request_reply.go | 6 ++++++ nexgb/xgbgen/translation.go | 28 ++++++++++++++++++---------- nexgb/xgbgen/type.go | 10 ++++++++++ 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index c40313f..697413e 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -5,6 +5,7 @@ import ( "encoding/xml" "fmt" "log" + "sort" "time" ) @@ -70,6 +71,8 @@ func (c *Context) Morph(xmlBytes []byte) { if c.protocol.isExt() { c.Putln("\"github.com/BurntSushi/xgb/xproto\"") } + + sort.Sort(Protocols(c.protocol.Imports)) for _, imp := range c.protocol.Imports { // We always import xproto, so skip it if it's explicitly imported if imp.Name == "xproto" { @@ -142,6 +145,8 @@ func (c *Context) Morph(xmlBytes []byte) { } // Now write Go source code + sort.Sort(Types(c.protocol.Types)) + sort.Sort(Requests(c.protocol.Requests)) for _, typ := range c.protocol.Types { typ.Define(c) } diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go index d56663d..433f4e2 100644 --- a/nexgb/xgbgen/protocol.go +++ b/nexgb/xgbgen/protocol.go @@ -22,6 +22,12 @@ type Protocol struct { Requests []*Request } +type Protocols []*Protocol + +func (ps Protocols) Len() int { return len(ps) } +func (ps Protocols) Swap(i, j int) { ps[i], ps[j] = ps[j], ps[i] } +func (ps Protocols) Less(i, j int) bool { return ps[i].ExtName < ps[j].ExtName } + // Initialize traverses all structures, looks for 'Translation' type, // and looks up the real type in the namespace. It also sets the source // name for all relevant fields/structures. diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index b8afe48..11a4e44 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -17,6 +17,12 @@ type Request struct { Reply *Reply // A reply, if one exists for this request. } +type Requests []*Request + +func (rs Requests) Len() int { return len(rs) } +func (rs Requests) Swap(i, j int) { rs[i], rs[j] = rs[j], rs[i] } +func (rs Requests) Less(i, j int) bool { return rs[i].xmlName < rs[j].xmlName } + // Initialize creates the proper Go source name for this request. // It also initializes the reply if one exists, and all fields in this request. func (r *Request) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 0123669..778304f 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -137,10 +137,13 @@ func (x *XMLEvent) Translate() *Event { xmlName: x.Name, Number: x.Number, NoSequence: x.NoSequence, - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, 0, len(x.Fields)), } - for i, field := range x.Fields { - ev.Fields[i] = field.Translate(ev) + for _, field := range x.Fields { + if field.XMLName.Local == "doc" { + continue + } + ev.Fields = append(ev.Fields, field.Translate(ev)) } return ev } @@ -200,11 +203,14 @@ func (x *XMLRequest) Translate() *Request { xmlName: x.Name, Opcode: x.Opcode, Combine: x.Combine, - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, 0, len(x.Fields)), Reply: x.Reply.Translate(), } - for i, field := range x.Fields { - r.Fields[i] = field.Translate(r) + for _, field := range x.Fields { + if field.XMLName.Local == "doc" { + continue + } + r.Fields = append(r.Fields, field.Translate(r)) } // Address bug (or legacy code) in QueryTextExtents. @@ -229,10 +235,13 @@ func (x *XMLReply) Translate() *Reply { } r := &Reply{ - Fields: make([]Field, len(x.Fields)), + Fields: make([]Field, 0, len(x.Fields)), } - for i, field := range x.Fields { - r.Fields[i] = field.Translate(r) + for _, field := range x.Fields { + if field.XMLName.Local == "doc" { + continue + } + r.Fields = append(r.Fields, field.Translate(r)) } return r } @@ -380,7 +389,6 @@ func SrcName(p *Protocol, name string) string { if newn, ok := NameMap[name]; ok { return newn } - return splitAndTitle(name) } diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index 521f67e..ded5be2 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -14,6 +14,16 @@ type Type interface { Define(c *Context) } +type Types []Type + +func (ts Types) Len() int { return len(ts) } +func (ts Types) Swap(i, j int) { ts[i], ts[j] = ts[j], ts[i] } +func (ts Types) Less(i, j int) bool { + x1, x2 := ts[i].XmlName(), ts[j].XmlName() + s1, s2 := ts[i].SrcName(), ts[j].SrcName() + return (s1 == s2 && x1 < x2) || s1 < s2 +} + // Translation is used *only* when transitioning from XML types to // our better representation. They are placeholders for the real types (below) // that will replace them. From 0685fb57e14104ee4ad9f70ec94f787a9a22c028 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:43:26 -0400 Subject: [PATCH 64/90] Update to latest xproto XML. --- nexgb/bigreq/bigreq.go | 32 +- nexgb/composite/composite.go | 708 +- nexgb/damage/damage.go | 360 +- nexgb/dpms/dpms.go | 580 +- nexgb/dri2/dri2.go | 938 +- nexgb/ge/ge.go | 22 +- nexgb/glx/glx.go | 11352 +++++++------- nexgb/randr/randr.go | 5150 +++---- nexgb/record/record.go | 1216 +- nexgb/render/render.go | 5272 +++---- nexgb/res/res.go | 368 +- nexgb/screensaver/screensaver.go | 354 +- nexgb/shape/shape.go | 902 +- nexgb/shm/shm.go | 562 +- nexgb/sync/sync.go | 2490 ++-- nexgb/xcmisc/xcmisc.go | 198 +- nexgb/xevie/xevie.go | 328 +- nexgb/xf86dri/xf86dri.go | 1148 +- nexgb/xf86vidmode/xf86vidmode.go | 2834 ++-- nexgb/xfixes/xfixes.go | 3530 ++--- nexgb/xinerama/xinerama.go | 394 +- nexgb/xinput/xinput.go | 9920 ++++++------- nexgb/xprint/xprint.go | 2698 ++-- nexgb/xproto/xproto.go | 22928 ++++++++++++++--------------- nexgb/xselinux/xselinux.go | 2250 +-- nexgb/xtest/xtest.go | 214 +- nexgb/xv/xv.go | 2730 ++-- nexgb/xvmc/xvmc.go | 830 +- 28 files changed, 40204 insertions(+), 40104 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index af03110..2ff767a 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -2,7 +2,7 @@ package bigreq /* - This file was generated by bigreq.xml on Jun 5 2012 12:11:58am EDT. + This file was generated by bigreq.xml on Aug 11 2013 8:39:42pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,30 @@ func init() { xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Void' +// Skipping definition for base type 'Bool' // Skipping definition for base type 'Byte' +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // EnableCookie is a cookie used only for Enable requests. type EnableCookie struct { *xgb.Cookie diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index d1f19b9..de1b773 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -2,7 +2,7 @@ package composite /* - This file was generated by composite.xml on Jun 5 2012 12:11:58am EDT. + This file was generated by composite.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,34 +41,241 @@ func init() { xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int32' +const ( + RedirectAutomatic = 0 + RedirectManual = 1 +) + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' // Skipping definition for base type 'Void' -// Skipping definition for base type 'Byte' +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' -// Skipping definition for base type 'Char' - // Skipping definition for base type 'Card32' -// Skipping definition for base type 'Double' +// CreateRegionFromBorderClipCookie is a cookie used only for CreateRegionFromBorderClip requests. +type CreateRegionFromBorderClipCookie struct { + *xgb.Cookie +} -// Skipping definition for base type 'Bool' +// CreateRegionFromBorderClip sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) + return CreateRegionFromBorderClipCookie{cookie} +} -// Skipping definition for base type 'Float' +// CreateRegionFromBorderClipChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() +func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) + return CreateRegionFromBorderClipCookie{cookie} +} -// Skipping definition for base type 'Card8' +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionFromBorderClipCookie) Check() error { + return cook.Cookie.Check() +} -// Skipping definition for base type 'Int16' +// Write request to wire for CreateRegionFromBorderClip +// createRegionFromBorderClipRequest writes a CreateRegionFromBorderClip request to a byte slice. +func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte { + size := 12 + b := 0 + buf := make([]byte, size) -const ( - RedirectAutomatic = 0 - RedirectManual = 1 -) + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetOverlayWindowCookie is a cookie used only for GetOverlayWindow requests. +type GetOverlayWindowCookie struct { + *xgb.Cookie +} + +// GetOverlayWindow sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() +func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getOverlayWindowRequest(c, Window), cookie) + return GetOverlayWindowCookie{cookie} +} + +// GetOverlayWindowUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getOverlayWindowRequest(c, Window), cookie) + return GetOverlayWindowCookie{cookie} +} + +// GetOverlayWindowReply represents the data returned from a GetOverlayWindow request. +type GetOverlayWindowReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + OverlayWin xproto.Window + // padding: 20 bytes +} + +// Reply blocks and returns the reply data for a GetOverlayWindow request. +func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOverlayWindowReply(buf), nil +} + +// getOverlayWindowReply reads a byte slice into a GetOverlayWindowReply value. +func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply { + v := new(GetOverlayWindowReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.OverlayWin = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for GetOverlayWindow +// getOverlayWindowRequest writes a GetOverlayWindow request to a byte slice. +func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// NameWindowPixmapCookie is a cookie used only for NameWindowPixmap requests. +type NameWindowPixmapCookie struct { + *xgb.Cookie +} + +// NameWindowPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) + return NameWindowPixmapCookie{cookie} +} + +// NameWindowPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() +func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) + return NameWindowPixmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook NameWindowPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for NameWindowPixmap +// nameWindowPixmapRequest writes a NameWindowPixmap request to a byte slice. +func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Pixmap)) + b += 4 + + return buf +} // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { @@ -168,6 +375,66 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers return buf } +// RedirectSubwindowsCookie is a cookie used only for RedirectSubwindows requests. +type RedirectSubwindowsCookie struct { + *xgb.Cookie +} + +// RedirectSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) + return RedirectSubwindowsCookie{cookie} +} + +// RedirectSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() +func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) + return RedirectSubwindowsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RedirectSubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RedirectSubwindows +// redirectSubwindowsRequest writes a RedirectSubwindows request to a byte slice. +func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = Update + b += 1 + + b += 3 // padding + + return buf +} + // RedirectWindowCookie is a cookie used only for RedirectWindow requests. type RedirectWindowCookie struct { *xgb.Cookie @@ -228,42 +495,97 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt return buf } -// RedirectSubwindowsCookie is a cookie used only for RedirectSubwindows requests. -type RedirectSubwindowsCookie struct { +// ReleaseOverlayWindowCookie is a cookie used only for ReleaseOverlayWindow requests. +type ReleaseOverlayWindowCookie struct { *xgb.Cookie } -// RedirectSubwindows sends an unchecked request. +// ReleaseOverlayWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { +func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) - return RedirectSubwindowsCookie{cookie} + c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) + return ReleaseOverlayWindowCookie{cookie} } -// RedirectSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() -func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { +// ReleaseOverlayWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() +func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie) - return RedirectSubwindowsCookie{cookie} + c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) + return ReleaseOverlayWindowCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RedirectSubwindowsCookie) Check() error { +func (cook ReleaseOverlayWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for RedirectSubwindows -// redirectSubwindowsRequest writes a RedirectSubwindows request to a byte slice. -func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { +// Write request to wire for ReleaseOverlayWindow +// releaseOverlayWindowRequest writes a ReleaseOverlayWindow request to a byte slice. +func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["COMPOSITE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// UnredirectSubwindowsCookie is a cookie used only for UnredirectSubwindows requests. +type UnredirectSubwindowsCookie struct { + *xgb.Cookie +} + +// UnredirectSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) + return UnredirectSubwindowsCookie{cookie} +} + +// UnredirectSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() +func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + if _, ok := c.Extensions["COMPOSITE"]; !ok { + panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) + return UnredirectSubwindowsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UnredirectSubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnredirectSubwindows +// unredirectSubwindowsRequest writes a UnredirectSubwindows request to a byte slice. +func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -271,7 +593,7 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [ buf[b] = c.Extensions["COMPOSITE"] b += 1 - buf[b] = 2 // request opcode + buf[b] = 4 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -347,325 +669,3 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b return buf } - -// UnredirectSubwindowsCookie is a cookie used only for UnredirectSubwindows requests. -type UnredirectSubwindowsCookie struct { - *xgb.Cookie -} - -// UnredirectSubwindows sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) - return UnredirectSubwindowsCookie{cookie} -} - -// UnredirectSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() -func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie) - return UnredirectSubwindowsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UnredirectSubwindowsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UnredirectSubwindows -// unredirectSubwindowsRequest writes a UnredirectSubwindows request to a byte slice. -func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["COMPOSITE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = Update - b += 1 - - b += 3 // padding - - return buf -} - -// CreateRegionFromBorderClipCookie is a cookie used only for CreateRegionFromBorderClip requests. -type CreateRegionFromBorderClipCookie struct { - *xgb.Cookie -} - -// CreateRegionFromBorderClip sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) - return CreateRegionFromBorderClipCookie{cookie} -} - -// CreateRegionFromBorderClipChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() -func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie) - return CreateRegionFromBorderClipCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionFromBorderClipCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegionFromBorderClip -// createRegionFromBorderClipRequest writes a CreateRegionFromBorderClip request to a byte slice. -func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["COMPOSITE"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// NameWindowPixmapCookie is a cookie used only for NameWindowPixmap requests. -type NameWindowPixmapCookie struct { - *xgb.Cookie -} - -// NameWindowPixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) - return NameWindowPixmapCookie{cookie} -} - -// NameWindowPixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() -func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie) - return NameWindowPixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook NameWindowPixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for NameWindowPixmap -// nameWindowPixmapRequest writes a NameWindowPixmap request to a byte slice. -func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["COMPOSITE"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Pixmap)) - b += 4 - - return buf -} - -// GetOverlayWindowCookie is a cookie used only for GetOverlayWindow requests. -type GetOverlayWindowCookie struct { - *xgb.Cookie -} - -// GetOverlayWindow sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() -func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getOverlayWindowRequest(c, Window), cookie) - return GetOverlayWindowCookie{cookie} -} - -// GetOverlayWindowUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getOverlayWindowRequest(c, Window), cookie) - return GetOverlayWindowCookie{cookie} -} - -// GetOverlayWindowReply represents the data returned from a GetOverlayWindow request. -type GetOverlayWindowReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - OverlayWin xproto.Window - // padding: 20 bytes -} - -// Reply blocks and returns the reply data for a GetOverlayWindow request. -func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getOverlayWindowReply(buf), nil -} - -// getOverlayWindowReply reads a byte slice into a GetOverlayWindowReply value. -func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply { - v := new(GetOverlayWindowReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.OverlayWin = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -// Write request to wire for GetOverlayWindow -// getOverlayWindowRequest writes a GetOverlayWindow request to a byte slice. -func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["COMPOSITE"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// ReleaseOverlayWindowCookie is a cookie used only for ReleaseOverlayWindow requests. -type ReleaseOverlayWindowCookie struct { - *xgb.Cookie -} - -// ReleaseOverlayWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) - return ReleaseOverlayWindowCookie{cookie} -} - -// ReleaseOverlayWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() -func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { - panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie) - return ReleaseOverlayWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ReleaseOverlayWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ReleaseOverlayWindow -// releaseOverlayWindowRequest writes a ReleaseOverlayWindow request to a byte slice. -func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["COMPOSITE"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index abf2206..72e0f3d 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -2,7 +2,7 @@ package damage /* - This file was generated by damage.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by damage.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,36 +41,51 @@ func init() { xgb.NewExtErrorFuncs["DAMAGE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' +// BadBadDamage is the error number for a BadBadDamage. +const BadBadDamage = 0 -// Skipping definition for base type 'Int32' +type BadDamageError struct { + Sequence uint16 + NiceName string +} -// Skipping definition for base type 'Void' +// BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice. +func BadDamageErrorNew(buf []byte) xgb.Error { + v := BadDamageError{} + v.NiceName = "BadDamage" -// Skipping definition for base type 'Byte' + b := 1 // skip error determinant + b += 1 // don't read error number -// Skipping definition for base type 'Int8' + v.Sequence = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Card16' + return v +} -// Skipping definition for base type 'Char' +// SequenceId returns the sequence id attached to the BadBadDamage error. +// This is mostly used internally. +func (err BadDamageError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Card32' +// BadId returns the 'BadValue' number if one exists for the BadBadDamage error. If no bad value exists, 0 is returned. +func (err BadDamageError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Double' +// Error returns a rudimentary string representation of the BadBadDamage error. -// Skipping definition for base type 'Bool' +func (err BadDamageError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadDamage {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - ReportLevelRawRectangles = 0 - ReportLevelDeltaRectangles = 1 - ReportLevelBoundingBox = 2 - ReportLevelNonEmpty = 3 -) +func init() { + xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew +} type Damage uint32 @@ -184,128 +199,73 @@ func init() { xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew } -// BadBadDamage is the error number for a BadBadDamage. -const BadBadDamage = 0 +const ( + ReportLevelRawRectangles = 0 + ReportLevelDeltaRectangles = 1 + ReportLevelBoundingBox = 2 + ReportLevelNonEmpty = 3 +) -type BadDamageError struct { - Sequence uint16 - NiceName string -} +// Skipping definition for base type 'Bool' -// BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice. -func BadDamageErrorNew(buf []byte) xgb.Error { - v := BadDamageError{} - v.NiceName = "BadDamage" +// Skipping definition for base type 'Byte' - b := 1 // skip error determinant - b += 1 // don't read error number +// Skipping definition for base type 'Card8' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Char' - return v -} +// Skipping definition for base type 'Void' -// SequenceId returns the sequence id attached to the BadBadDamage error. -// This is mostly used internally. -func (err BadDamageError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Double' -// BadId returns the 'BadValue' number if one exists for the BadBadDamage error. If no bad value exists, 0 is returned. -func (err BadDamageError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Float' -// Error returns a rudimentary string representation of the BadBadDamage error. +// Skipping definition for base type 'Int16' -func (err BadDamageError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadDamage {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Int32' -func init() { - xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew -} +// Skipping definition for base type 'Int8' -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AddCookie is a cookie used only for Add requests. +type AddCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["DAMAGE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionUnchecked sends an unchecked request. +// Add sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { +func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { if _, ok := c.Extensions["DAMAGE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(addRequest(c, Drawable, Region), cookie) + return AddCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err +// AddChecked sends a checked request. +// If an error occurs, it can be retrieved using AddCookie.Check() +func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil + cookie := c.NewCookie(true, false) + c.NewRequest(addRequest(c, Drawable, Region), cookie) + return AddCookie{cookie} } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = xgb.Get32(buf[b:]) - b += 4 - - v.MinorVersion = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AddCookie) Check() error { + return cook.Cookie.Check() } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { +// Write request to wire for Add +// addRequest writes a Add request to a byte slice. +func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -313,16 +273,16 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers buf[b] = c.Extensions["DAMAGE"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 4 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], ClientMajorVersion) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - xgb.Put32(buf[b:], ClientMinorVersion) + xgb.Put32(buf[b:], uint32(Region)) b += 4 return buf @@ -446,6 +406,104 @@ func destroyRequest(c *xgb.Conn, Damage Damage) []byte { return buf } +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DAMAGE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DAMAGE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + // SubtractCookie is a cookie used only for Subtract requests. type SubtractCookie struct { *xgb.Cookie @@ -506,61 +564,3 @@ func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfi return buf } - -// AddCookie is a cookie used only for Add requests. -type AddCookie struct { - *xgb.Cookie -} - -// Add sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { - if _, ok := c.Extensions["DAMAGE"]; !ok { - panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(addRequest(c, Drawable, Region), cookie) - return AddCookie{cookie} -} - -// AddChecked sends a checked request. -// If an error occurs, it can be retrieved using AddCookie.Check() -func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { - if _, ok := c.Extensions["DAMAGE"]; !ok { - panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(addRequest(c, Drawable, Region), cookie) - return AddCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AddCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Add -// addRequest writes a Add request to a byte slice. -func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DAMAGE"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index f7d6ffe..96d82f0 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -2,7 +2,7 @@ package dpms /* - This file was generated by dpms.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by dpms.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - const ( DPMSModeOn = 0 DPMSModeStandby = 1 @@ -71,100 +47,29 @@ const ( DPMSModeOff = 3 ) -// GetVersionCookie is a cookie used only for GetVersion requests. -type GetVersionCookie struct { - *xgb.Cookie -} +// Skipping definition for base type 'Bool' -// GetVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() -func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return GetVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// GetVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return GetVersionCookie{cookie} -} +// Skipping definition for base type 'Card8' -// GetVersionReply represents the data returned from a GetVersion request. -type GetVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 -} +// Skipping definition for base type 'Char' -// Reply blocks and returns the reply data for a GetVersion request. -func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getVersionReply(buf), nil -} +// Skipping definition for base type 'Void' -// getVersionReply reads a byte slice into a GetVersionReply value. -func getVersionReply(buf []byte) *GetVersionReply { - v := new(GetVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Double' - b += 1 // padding +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int32' - v.ServerMajorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int8' - v.ServerMinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Card16' - return v -} - -// Write request to wire for GetVersion -// getVersionRequest writes a GetVersion request to a byte slice. -func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DPMS"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], ClientMajorVersion) - b += 2 - - xgb.Put16(buf[b:], ClientMinorVersion) - b += 2 - - return buf -} +// Skipping definition for base type 'Card32' // CapableCookie is a cookie used only for Capable requests. type CapableCookie struct { @@ -258,6 +163,165 @@ func capableRequest(c *xgb.Conn) []byte { return buf } +// DisableCookie is a cookie used only for Disable requests. +type DisableCookie struct { + *xgb.Cookie +} + +// Disable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Disable(c *xgb.Conn) DisableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(disableRequest(c), cookie) + return DisableCookie{cookie} +} + +// DisableChecked sends a checked request. +// If an error occurs, it can be retrieved using DisableCookie.Check() +func DisableChecked(c *xgb.Conn) DisableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(disableRequest(c), cookie) + return DisableCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DisableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Disable +// disableRequest writes a Disable request to a byte slice. +func disableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// EnableCookie is a cookie used only for Enable requests. +type EnableCookie struct { + *xgb.Cookie +} + +// Enable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Enable(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +// EnableChecked sends a checked request. +// If an error occurs, it can be retrieved using EnableCookie.Check() +func EnableChecked(c *xgb.Conn) EnableCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(enableRequest(c), cookie) + return EnableCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook EnableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Enable +// enableRequest writes a Enable request to a byte slice. +func enableRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// ForceLevelCookie is a cookie used only for ForceLevel requests. +type ForceLevelCookie struct { + *xgb.Cookie +} + +// ForceLevel sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) + return ForceLevelCookie{cookie} +} + +// ForceLevelChecked sends a checked request. +// If an error occurs, it can be retrieved using ForceLevelCookie.Check() +func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) + return ForceLevelCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ForceLevelCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ForceLevel +// forceLevelRequest writes a ForceLevel request to a byte slice. +func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], PowerLevel) + b += 2 + + return buf +} + // GetTimeoutsCookie is a cookie used only for GetTimeouts requests. type GetTimeoutsCookie struct { *xgb.Cookie @@ -354,207 +418,79 @@ func getTimeoutsRequest(c *xgb.Conn) []byte { return buf } -// SetTimeoutsCookie is a cookie used only for SetTimeouts requests. -type SetTimeoutsCookie struct { +// GetVersionCookie is a cookie used only for GetVersion requests. +type GetVersionCookie struct { *xgb.Cookie } -// SetTimeouts sends an unchecked request. +// GetVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() +func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { +func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) - return SetTimeoutsCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return GetVersionCookie{cookie} } -// SetTimeoutsChecked sends a checked request. -// If an error occurs, it can be retrieved using SetTimeoutsCookie.Check() -func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") +// GetVersionReply represents the data returned from a GetVersion request. +type GetVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 +} + +// Reply blocks and returns the reply data for a GetVersion request. +func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) - return SetTimeoutsCookie{cookie} + if buf == nil { + return nil, nil + } + return getVersionReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetTimeoutsCookie) Check() error { - return cook.Cookie.Check() -} +// getVersionReply reads a byte slice into a GetVersionReply value. +func getVersionReply(buf []byte) *GetVersionReply { + v := new(GetVersionReply) + b := 1 // skip reply determinant -// Write request to wire for SetTimeouts -// setTimeoutsRequest writes a SetTimeouts request to a byte slice. -func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) + b += 1 // padding - buf[b] = c.Extensions["DPMS"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + v.Sequence = xgb.Get16(buf[b:]) b += 2 - xgb.Put16(buf[b:], StandbyTimeout) + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) b += 2 - xgb.Put16(buf[b:], SuspendTimeout) + v.ServerMinorVersion = xgb.Get16(buf[b:]) b += 2 - xgb.Put16(buf[b:], OffTimeout) - b += 2 - - return buf + return v } -// EnableCookie is a cookie used only for Enable requests. -type EnableCookie struct { - *xgb.Cookie -} - -// Enable sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Enable(c *xgb.Conn) EnableCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(enableRequest(c), cookie) - return EnableCookie{cookie} -} - -// EnableChecked sends a checked request. -// If an error occurs, it can be retrieved using EnableCookie.Check() -func EnableChecked(c *xgb.Conn) EnableCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(enableRequest(c), cookie) - return EnableCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook EnableCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Enable -// enableRequest writes a Enable request to a byte slice. -func enableRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DPMS"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// DisableCookie is a cookie used only for Disable requests. -type DisableCookie struct { - *xgb.Cookie -} - -// Disable sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Disable(c *xgb.Conn) DisableCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(disableRequest(c), cookie) - return DisableCookie{cookie} -} - -// DisableChecked sends a checked request. -// If an error occurs, it can be retrieved using DisableCookie.Check() -func DisableChecked(c *xgb.Conn) DisableCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(disableRequest(c), cookie) - return DisableCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DisableCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Disable -// disableRequest writes a Disable request to a byte slice. -func disableRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DPMS"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// ForceLevelCookie is a cookie used only for ForceLevel requests. -type ForceLevelCookie struct { - *xgb.Cookie -} - -// ForceLevel sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) - return ForceLevelCookie{cookie} -} - -// ForceLevelChecked sends a checked request. -// If an error occurs, it can be retrieved using ForceLevelCookie.Check() -func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { - if _, ok := c.Extensions["DPMS"]; !ok { - panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(forceLevelRequest(c, PowerLevel), cookie) - return ForceLevelCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ForceLevelCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ForceLevel -// forceLevelRequest writes a ForceLevel request to a byte slice. -func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { +// Write request to wire for GetVersion +// getVersionRequest writes a GetVersion request to a byte slice. +func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -562,13 +498,16 @@ func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { buf[b] = c.Extensions["DPMS"] b += 1 - buf[b] = 6 // request opcode + buf[b] = 0 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put16(buf[b:], PowerLevel) + xgb.Put16(buf[b:], ClientMajorVersion) + b += 2 + + xgb.Put16(buf[b:], ClientMinorVersion) b += 2 return buf @@ -669,3 +608,64 @@ func infoRequest(c *xgb.Conn) []byte { return buf } + +// SetTimeoutsCookie is a cookie used only for SetTimeouts requests. +type SetTimeoutsCookie struct { + *xgb.Cookie +} + +// SetTimeouts sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return SetTimeoutsCookie{cookie} +} + +// SetTimeoutsChecked sends a checked request. +// If an error occurs, it can be retrieved using SetTimeoutsCookie.Check() +func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + if _, ok := c.Extensions["DPMS"]; !ok { + panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie) + return SetTimeoutsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetTimeoutsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetTimeouts +// setTimeoutsRequest writes a SetTimeouts request to a byte slice. +func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DPMS"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], StandbyTimeout) + b += 2 + + xgb.Put16(buf[b:], SuspendTimeout) + b += 2 + + xgb.Put16(buf[b:], OffTimeout) + b += 2 + + return buf +} diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index f047e54..3c63af5 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -2,7 +2,7 @@ package dri2 /* - This file was generated by dri2.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by dri2.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,130 +40,6 @@ func init() { xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -const ( - AttachmentBufferFrontLeft = 0 - AttachmentBufferBackLeft = 1 - AttachmentBufferFrontRight = 2 - AttachmentBufferBackRight = 3 - AttachmentBufferDepth = 4 - AttachmentBufferStencil = 5 - AttachmentBufferAccum = 6 - AttachmentBufferFakeFrontLeft = 7 - AttachmentBufferFakeFrontRight = 8 - AttachmentBufferDepthStencil = 9 - AttachmentBufferHiz = 10 -) - -const ( - DriverTypeDri = 0 - DriverTypeVdpau = 1 -) - -const ( - EventTypeExchangeComplete = 1 - EventTypeBlitComplete = 2 - EventTypeFlipComplete = 3 -) - -type DRI2Buffer struct { - Attachment uint32 - Name uint32 - Pitch uint32 - Cpp uint32 - Flags uint32 -} - -// DRI2BufferRead reads a byte slice into a DRI2Buffer value. -func DRI2BufferRead(buf []byte, v *DRI2Buffer) int { - b := 0 - - v.Attachment = xgb.Get32(buf[b:]) - b += 4 - - v.Name = xgb.Get32(buf[b:]) - b += 4 - - v.Pitch = xgb.Get32(buf[b:]) - b += 4 - - v.Cpp = xgb.Get32(buf[b:]) - b += 4 - - v.Flags = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values. -func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DRI2Buffer{} - b += DRI2BufferRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DRI2Buffer value to a byte slice. -func (v DRI2Buffer) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - xgb.Put32(buf[b:], v.Attachment) - b += 4 - - xgb.Put32(buf[b:], v.Name) - b += 4 - - xgb.Put32(buf[b:], v.Pitch) - b += 4 - - xgb.Put32(buf[b:], v.Cpp) - b += 4 - - xgb.Put32(buf[b:], v.Flags) - b += 4 - - return buf -} - -// DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice. -func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type AttachFormat struct { Attachment uint32 Format uint32 @@ -218,6 +94,20 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int { return b } +const ( + AttachmentBufferFrontLeft = 0 + AttachmentBufferBackLeft = 1 + AttachmentBufferFrontRight = 2 + AttachmentBufferBackRight = 3 + AttachmentBufferDepth = 4 + AttachmentBufferStencil = 5 + AttachmentBufferAccum = 6 + AttachmentBufferFakeFrontLeft = 7 + AttachmentBufferFakeFrontRight = 8 + AttachmentBufferDepthStencil = 9 + AttachmentBufferHiz = 10 +) + // BufferSwapComplete is the event number for a BufferSwapCompleteEvent. const BufferSwapComplete = 0 @@ -334,6 +224,92 @@ func init() { xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew } +type DRI2Buffer struct { + Attachment uint32 + Name uint32 + Pitch uint32 + Cpp uint32 + Flags uint32 +} + +// DRI2BufferRead reads a byte slice into a DRI2Buffer value. +func DRI2BufferRead(buf []byte, v *DRI2Buffer) int { + b := 0 + + v.Attachment = xgb.Get32(buf[b:]) + b += 4 + + v.Name = xgb.Get32(buf[b:]) + b += 4 + + v.Pitch = xgb.Get32(buf[b:]) + b += 4 + + v.Cpp = xgb.Get32(buf[b:]) + b += 4 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values. +func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DRI2Buffer{} + b += DRI2BufferRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DRI2Buffer value to a byte slice. +func (v DRI2Buffer) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + xgb.Put32(buf[b:], v.Attachment) + b += 4 + + xgb.Put32(buf[b:], v.Name) + b += 4 + + xgb.Put32(buf[b:], v.Pitch) + b += 4 + + xgb.Put32(buf[b:], v.Cpp) + b += 4 + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + return buf +} + +// DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice. +func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + DriverTypeDri = 0 + DriverTypeVdpau = 1 +) + +const ( + EventTypeExchangeComplete = 1 + EventTypeBlitComplete = 2 + EventTypeFlipComplete = 3 +) + // InvalidateBuffers is the event number for a InvalidateBuffersEvent. const InvalidateBuffers = 1 @@ -397,44 +373,67 @@ func init() { xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AuthenticateCookie is a cookie used only for Authenticate requests. +type AuthenticateCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { +// Authenticate sends a checked request. +// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply() +func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(authenticateRequest(c, Window, Magic), cookie) + return AuthenticateCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// AuthenticateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { +func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(authenticateRequest(c, Window, Magic), cookie) + return AuthenticateCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { +// AuthenticateReply represents the data returned from a Authenticate request. +type AuthenticateReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 + Authenticated uint32 } -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { +// Reply blocks and returns the reply data for a Authenticate request. +func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -442,12 +441,12 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { if buf == nil { return nil, nil } - return queryVersionReply(buf), nil + return authenticateReply(buf), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) +// authenticateReply reads a byte slice into a AuthenticateReply value. +func authenticateReply(buf []byte) *AuthenticateReply { + v := new(AuthenticateReply) b := 1 // skip reply determinant b += 1 // padding @@ -458,18 +457,15 @@ func queryVersionReply(buf []byte) *QueryVersionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.MajorVersion = xgb.Get32(buf[b:]) - b += 4 - - v.MinorVersion = xgb.Get32(buf[b:]) + v.Authenticated = xgb.Get32(buf[b:]) b += 4 return v } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { +// Write request to wire for Authenticate +// authenticateRequest writes a Authenticate request to a byte slice. +func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -477,16 +473,16 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) buf[b] = c.Extensions["DRI2"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], MajorVersion) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - xgb.Put32(buf[b:], MinorVersion) + xgb.Put32(buf[b:], Magic) b += 4 return buf @@ -611,43 +607,42 @@ func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte return buf } -// AuthenticateCookie is a cookie used only for Authenticate requests. -type AuthenticateCookie struct { +// CopyRegionCookie is a cookie used only for CopyRegion requests. +type CopyRegionCookie struct { *xgb.Cookie } -// Authenticate sends a checked request. -// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply() -func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { +// CopyRegion sends a checked request. +// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply() +func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(authenticateRequest(c, Window, Magic), cookie) - return AuthenticateCookie{cookie} + c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) + return CopyRegionCookie{cookie} } -// AuthenticateUnchecked sends an unchecked request. +// CopyRegionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { +func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(authenticateRequest(c, Window, Magic), cookie) - return AuthenticateCookie{cookie} + c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) + return CopyRegionCookie{cookie} } -// AuthenticateReply represents the data returned from a Authenticate request. -type AuthenticateReply struct { +// CopyRegionReply represents the data returned from a CopyRegion request. +type CopyRegionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Authenticated uint32 } -// Reply blocks and returns the reply data for a Authenticate request. -func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { +// Reply blocks and returns the reply data for a CopyRegion request. +func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -655,12 +650,12 @@ func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) { if buf == nil { return nil, nil } - return authenticateReply(buf), nil + return copyRegionReply(buf), nil } -// authenticateReply reads a byte slice into a AuthenticateReply value. -func authenticateReply(buf []byte) *AuthenticateReply { - v := new(AuthenticateReply) +// copyRegionReply reads a byte slice into a CopyRegionReply value. +func copyRegionReply(buf []byte) *CopyRegionReply { + v := new(CopyRegionReply) b := 1 // skip reply determinant b += 1 // padding @@ -671,32 +666,35 @@ func authenticateReply(buf []byte) *AuthenticateReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Authenticated = xgb.Get32(buf[b:]) - b += 4 - return v } -// Write request to wire for Authenticate -// authenticateRequest writes a Authenticate request to a byte slice. -func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte { - size := 12 +// Write request to wire for CopyRegion +// copyRegionRequest writes a CopyRegion request to a byte slice. +func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte { + size := 20 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["DRI2"] b += 1 - buf[b] = 2 // request opcode + buf[b] = 6 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - xgb.Put32(buf[b:], Magic) + xgb.Put32(buf[b:], Region) + b += 4 + + xgb.Put32(buf[b:], Dest) + b += 4 + + xgb.Put32(buf[b:], Src) b += 4 return buf @@ -924,99 +922,6 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta return buf } -// CopyRegionCookie is a cookie used only for CopyRegion requests. -type CopyRegionCookie struct { - *xgb.Cookie -} - -// CopyRegion sends a checked request. -// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply() -func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { - if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) - return CopyRegionCookie{cookie} -} - -// CopyRegionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { - if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie) - return CopyRegionCookie{cookie} -} - -// CopyRegionReply represents the data returned from a CopyRegion request. -type CopyRegionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes -} - -// Reply blocks and returns the reply data for a CopyRegion request. -func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return copyRegionReply(buf), nil -} - -// copyRegionReply reads a byte slice into a CopyRegionReply value. -func copyRegionReply(buf []byte) *CopyRegionReply { - v := new(CopyRegionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -// Write request to wire for CopyRegion -// copyRegionRequest writes a CopyRegion request to a byte slice. -func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DRI2"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], Region) - b += 4 - - xgb.Put32(buf[b:], Dest) - b += 4 - - xgb.Put32(buf[b:], Src) - b += 4 - - return buf -} - // GetBuffersWithFormatCookie is a cookie used only for GetBuffersWithFormat requests. type GetBuffersWithFormatCookie struct { *xgb.Cookie @@ -1125,6 +1030,309 @@ func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count ui return buf } +// GetMSCCookie is a cookie used only for GetMSC requests. +type GetMSCCookie struct { + *xgb.Cookie +} + +// GetMSC sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply() +func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMSCRequest(c, Drawable), cookie) + return GetMSCCookie{cookie} +} + +// GetMSCUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMSCRequest(c, Drawable), cookie) + return GetMSCCookie{cookie} +} + +// GetMSCReply represents the data returned from a GetMSC request. +type GetMSCReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + SbcHi uint32 + SbcLo uint32 +} + +// Reply blocks and returns the reply data for a GetMSC request. +func (cook GetMSCCookie) Reply() (*GetMSCReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMSCReply(buf), nil +} + +// getMSCReply reads a byte slice into a GetMSCReply value. +func getMSCReply(buf []byte) *GetMSCReply { + v := new(GetMSCReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.SbcHi = xgb.Get32(buf[b:]) + b += 4 + + v.SbcLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetMSC +// getMSCRequest writes a GetMSC request to a byte slice. +func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// GetParamCookie is a cookie used only for GetParam requests. +type GetParamCookie struct { + *xgb.Cookie +} + +// GetParam sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetParamCookie.Reply() +func GetParam(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetParam' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getParamRequest(c, Drawable, Param), cookie) + return GetParamCookie{cookie} +} + +// GetParamUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetParamUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'GetParam' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getParamRequest(c, Drawable, Param), cookie) + return GetParamCookie{cookie} +} + +// GetParamReply represents the data returned from a GetParam request. +type GetParamReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + IsParamRecognized bool + ValueHi uint32 + ValueLo uint32 +} + +// Reply blocks and returns the reply data for a GetParam request. +func (cook GetParamCookie) Reply() (*GetParamReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getParamReply(buf), nil +} + +// getParamReply reads a byte slice into a GetParamReply value. +func getParamReply(buf []byte) *GetParamReply { + v := new(GetParamReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.IsParamRecognized = true + } else { + v.IsParamRecognized = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ValueHi = xgb.Get32(buf[b:]) + b += 4 + + v.ValueLo = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetParam +// getParamRequest writes a GetParam request to a byte slice. +func getParamRequest(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], Param) + b += 4 + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["DRI2"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + // SwapBuffersCookie is a cookie used only for SwapBuffers requests. type SwapBuffersCookie struct { *xgb.Cookie @@ -1235,103 +1443,50 @@ func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint3 return buf } -// GetMSCCookie is a cookie used only for GetMSC requests. -type GetMSCCookie struct { +// SwapIntervalCookie is a cookie used only for SwapInterval requests. +type SwapIntervalCookie struct { *xgb.Cookie } -// GetMSC sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply() -func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { - if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getMSCRequest(c, Drawable), cookie) - return GetMSCCookie{cookie} -} - -// GetMSCUnchecked sends an unchecked request. +// SwapInterval sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { +func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") + panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(getMSCRequest(c, Drawable), cookie) - return GetMSCCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) + return SwapIntervalCookie{cookie} } -// GetMSCReply represents the data returned from a GetMSC request. -type GetMSCReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - UstHi uint32 - UstLo uint32 - MscHi uint32 - MscLo uint32 - SbcHi uint32 - SbcLo uint32 -} - -// Reply blocks and returns the reply data for a GetMSC request. -func (cook GetMSCCookie) Reply() (*GetMSCReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err +// SwapIntervalChecked sends a checked request. +// If an error occurs, it can be retrieved using SwapIntervalCookie.Check() +func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + if _, ok := c.Extensions["DRI2"]; !ok { + panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } - if buf == nil { - return nil, nil - } - return getMSCReply(buf), nil + cookie := c.NewCookie(true, false) + c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) + return SwapIntervalCookie{cookie} } -// getMSCReply reads a byte slice into a GetMSCReply value. -func getMSCReply(buf []byte) *GetMSCReply { - v := new(GetMSCReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.UstHi = xgb.Get32(buf[b:]) - b += 4 - - v.UstLo = xgb.Get32(buf[b:]) - b += 4 - - v.MscHi = xgb.Get32(buf[b:]) - b += 4 - - v.MscLo = xgb.Get32(buf[b:]) - b += 4 - - v.SbcHi = xgb.Get32(buf[b:]) - b += 4 - - v.SbcLo = xgb.Get32(buf[b:]) - b += 4 - - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SwapIntervalCookie) Check() error { + return cook.Cookie.Check() } -// Write request to wire for GetMSC -// getMSCRequest writes a GetMSC request to a byte slice. -func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { - size := 8 +// Write request to wire for SwapInterval +// swapIntervalRequest writes a SwapInterval request to a byte slice. +func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["DRI2"] b += 1 - buf[b] = 9 // request opcode + buf[b] = 12 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1340,6 +1495,9 @@ func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { xgb.Put32(buf[b:], uint32(Drawable)) b += 4 + xgb.Put32(buf[b:], Interval) + b += 4 + return buf } @@ -1582,61 +1740,3 @@ func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, T return buf } - -// SwapIntervalCookie is a cookie used only for SwapInterval requests. -type SwapIntervalCookie struct { - *xgb.Cookie -} - -// SwapInterval sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { - if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) - return SwapIntervalCookie{cookie} -} - -// SwapIntervalChecked sends a checked request. -// If an error occurs, it can be retrieved using SwapIntervalCookie.Check() -func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { - if _, ok := c.Extensions["DRI2"]; !ok { - panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie) - return SwapIntervalCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SwapIntervalCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SwapInterval -// swapIntervalRequest writes a SwapInterval request to a byte slice. -func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["DRI2"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], Interval) - b += 4 - - return buf -} diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 9084275..5e01d1e 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -2,7 +2,7 @@ package ge /* - This file was generated by ge.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by ge.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,30 @@ func init() { xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' +// Skipping definition for base type 'Void' // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index cc6ab68..facf12e 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -2,7 +2,7 @@ package glx /* - This file was generated by glx.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by glx.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,39 +40,537 @@ func init() { xgb.NewExtErrorFuncs["GLX"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' +// BadBadContext is the error number for a BadBadContext. +const BadBadContext = 0 -// Skipping definition for base type 'Int16' +type BadContextError GenericError -// Skipping definition for base type 'Int32' +// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. +func BadContextErrorNew(buf []byte) xgb.Error { + v := BadContextError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContext" + return v +} -// Skipping definition for base type 'Void' +// SequenceId returns the sequence id attached to the BadBadContext error. +// This is mostly used internally. +func (err BadContextError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Byte' +// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. +func (err BadContextError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Int8' +// Error returns a rudimentary string representation of the BadBadContext error. +func (err BadContextError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Card16' +func init() { + xgb.NewExtErrorFuncs["GLX"][0] = BadContextErrorNew +} -// Skipping definition for base type 'Char' +// BadBadContextState is the error number for a BadBadContextState. +const BadBadContextState = 1 -// Skipping definition for base type 'Card32' +type BadContextStateError GenericError -// Skipping definition for base type 'Double' +// BadContextStateErrorNew constructs a BadContextStateError value that implements xgb.Error from a byte slice. +func BadContextStateErrorNew(buf []byte) xgb.Error { + v := BadContextStateError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContextState" + return v +} -// Skipping definition for base type 'Bool' +// SequenceId returns the sequence id attached to the BadBadContextState error. +// This is mostly used internally. +func (err BadContextStateError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Float' +// BadId returns the 'BadValue' number if one exists for the BadBadContextState error. If no bad value exists, 0 is returned. +func (err BadContextStateError) BadId() uint32 { + return 0 +} -const ( - PbcetDamaged = 32791 - PbcetSaved = 32792 -) +// Error returns a rudimentary string representation of the BadBadContextState error. +func (err BadContextStateError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContextState {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -const ( - PbcdtWindow = 32793 - PbcdtPbuffer = 32794 -) +func init() { + xgb.NewExtErrorFuncs["GLX"][1] = BadContextStateErrorNew +} + +// BadBadContextTag is the error number for a BadBadContextTag. +const BadBadContextTag = 4 + +type BadContextTagError GenericError + +// BadContextTagErrorNew constructs a BadContextTagError value that implements xgb.Error from a byte slice. +func BadContextTagErrorNew(buf []byte) xgb.Error { + v := BadContextTagError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadContextTag" + return v +} + +// SequenceId returns the sequence id attached to the BadBadContextTag error. +// This is mostly used internally. +func (err BadContextTagError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadContextTag error. If no bad value exists, 0 is returned. +func (err BadContextTagError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadContextTag error. +func (err BadContextTagError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadContextTag {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][4] = BadContextTagErrorNew +} + +// BadBadCurrentDrawable is the error number for a BadBadCurrentDrawable. +const BadBadCurrentDrawable = 11 + +type BadCurrentDrawableError GenericError + +// BadCurrentDrawableErrorNew constructs a BadCurrentDrawableError value that implements xgb.Error from a byte slice. +func BadCurrentDrawableErrorNew(buf []byte) xgb.Error { + v := BadCurrentDrawableError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadCurrentDrawable" + return v +} + +// SequenceId returns the sequence id attached to the BadBadCurrentDrawable error. +// This is mostly used internally. +func (err BadCurrentDrawableError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadCurrentDrawable error. If no bad value exists, 0 is returned. +func (err BadCurrentDrawableError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadCurrentDrawable error. +func (err BadCurrentDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadCurrentDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][11] = BadCurrentDrawableErrorNew +} + +// BadBadCurrentWindow is the error number for a BadBadCurrentWindow. +const BadBadCurrentWindow = 5 + +type BadCurrentWindowError GenericError + +// BadCurrentWindowErrorNew constructs a BadCurrentWindowError value that implements xgb.Error from a byte slice. +func BadCurrentWindowErrorNew(buf []byte) xgb.Error { + v := BadCurrentWindowError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadCurrentWindow" + return v +} + +// SequenceId returns the sequence id attached to the BadBadCurrentWindow error. +// This is mostly used internally. +func (err BadCurrentWindowError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadCurrentWindow error. If no bad value exists, 0 is returned. +func (err BadCurrentWindowError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadCurrentWindow error. +func (err BadCurrentWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadCurrentWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][5] = BadCurrentWindowErrorNew +} + +// BadBadDrawable is the error number for a BadBadDrawable. +const BadBadDrawable = 2 + +type BadDrawableError GenericError + +// BadDrawableErrorNew constructs a BadDrawableError value that implements xgb.Error from a byte slice. +func BadDrawableErrorNew(buf []byte) xgb.Error { + v := BadDrawableError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadDrawable" + return v +} + +// SequenceId returns the sequence id attached to the BadBadDrawable error. +// This is mostly used internally. +func (err BadDrawableError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadDrawable error. If no bad value exists, 0 is returned. +func (err BadDrawableError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadDrawable error. +func (err BadDrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][2] = BadDrawableErrorNew +} + +// BadBadFBConfig is the error number for a BadBadFBConfig. +const BadBadFBConfig = 9 + +type BadFBConfigError GenericError + +// BadFBConfigErrorNew constructs a BadFBConfigError value that implements xgb.Error from a byte slice. +func BadFBConfigErrorNew(buf []byte) xgb.Error { + v := BadFBConfigError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadFBConfig" + return v +} + +// SequenceId returns the sequence id attached to the BadBadFBConfig error. +// This is mostly used internally. +func (err BadFBConfigError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadFBConfig error. If no bad value exists, 0 is returned. +func (err BadFBConfigError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadFBConfig error. +func (err BadFBConfigError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadFBConfig {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][9] = BadFBConfigErrorNew +} + +// BadBadLargeRequest is the error number for a BadBadLargeRequest. +const BadBadLargeRequest = 7 + +type BadLargeRequestError GenericError + +// BadLargeRequestErrorNew constructs a BadLargeRequestError value that implements xgb.Error from a byte slice. +func BadLargeRequestErrorNew(buf []byte) xgb.Error { + v := BadLargeRequestError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadLargeRequest" + return v +} + +// SequenceId returns the sequence id attached to the BadBadLargeRequest error. +// This is mostly used internally. +func (err BadLargeRequestError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadLargeRequest error. If no bad value exists, 0 is returned. +func (err BadLargeRequestError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadLargeRequest error. +func (err BadLargeRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadLargeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][7] = BadLargeRequestErrorNew +} + +// BadBadPbuffer is the error number for a BadBadPbuffer. +const BadBadPbuffer = 10 + +type BadPbufferError GenericError + +// BadPbufferErrorNew constructs a BadPbufferError value that implements xgb.Error from a byte slice. +func BadPbufferErrorNew(buf []byte) xgb.Error { + v := BadPbufferError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadPbuffer" + return v +} + +// SequenceId returns the sequence id attached to the BadBadPbuffer error. +// This is mostly used internally. +func (err BadPbufferError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadPbuffer error. If no bad value exists, 0 is returned. +func (err BadPbufferError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadPbuffer error. +func (err BadPbufferError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadPbuffer {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][10] = BadPbufferErrorNew +} + +// BadBadPixmap is the error number for a BadBadPixmap. +const BadBadPixmap = 3 + +type BadPixmapError GenericError + +// BadPixmapErrorNew constructs a BadPixmapError value that implements xgb.Error from a byte slice. +func BadPixmapErrorNew(buf []byte) xgb.Error { + v := BadPixmapError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadPixmap" + return v +} + +// SequenceId returns the sequence id attached to the BadBadPixmap error. +// This is mostly used internally. +func (err BadPixmapError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadPixmap error. If no bad value exists, 0 is returned. +func (err BadPixmapError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadPixmap error. +func (err BadPixmapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][3] = BadPixmapErrorNew +} + +// BadBadRenderRequest is the error number for a BadBadRenderRequest. +const BadBadRenderRequest = 6 + +type BadRenderRequestError GenericError + +// BadRenderRequestErrorNew constructs a BadRenderRequestError value that implements xgb.Error from a byte slice. +func BadRenderRequestErrorNew(buf []byte) xgb.Error { + v := BadRenderRequestError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadRenderRequest" + return v +} + +// SequenceId returns the sequence id attached to the BadBadRenderRequest error. +// This is mostly used internally. +func (err BadRenderRequestError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadRenderRequest error. If no bad value exists, 0 is returned. +func (err BadRenderRequestError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadRenderRequest error. +func (err BadRenderRequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadRenderRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][6] = BadRenderRequestErrorNew +} + +// BadBadWindow is the error number for a BadBadWindow. +const BadBadWindow = 12 + +type BadWindowError GenericError + +// BadWindowErrorNew constructs a BadWindowError value that implements xgb.Error from a byte slice. +func BadWindowErrorNew(buf []byte) xgb.Error { + v := BadWindowError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "BadWindow" + return v +} + +// SequenceId returns the sequence id attached to the BadBadWindow error. +// This is mostly used internally. +func (err BadWindowError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadWindow error. If no bad value exists, 0 is returned. +func (err BadWindowError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadWindow error. +func (err BadWindowError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][12] = BadWindowErrorNew +} + +type Bool32 uint32 + +type Context uint32 + +func NewContextId(c *xgb.Conn) (Context, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Context(id), nil +} + +type ContextTag uint32 + +type Drawable uint32 + +func NewDrawableId(c *xgb.Conn) (Drawable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Drawable(id), nil +} + +type Fbconfig uint32 + +func NewFbconfigId(c *xgb.Conn) (Fbconfig, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Fbconfig(id), nil +} + +type Float32 float64 + +type Float64 float64 + +// BadGLXBadProfileARB is the error number for a BadGLXBadProfileARB. +const BadGLXBadProfileARB = 13 + +type GLXBadProfileARBError GenericError + +// GLXBadProfileARBErrorNew constructs a GLXBadProfileARBError value that implements xgb.Error from a byte slice. +func GLXBadProfileARBErrorNew(buf []byte) xgb.Error { + v := GLXBadProfileARBError(GenericErrorNew(buf).(GenericError)) + v.NiceName = "GLXBadProfileARB" + return v +} + +// SequenceId returns the sequence id attached to the BadGLXBadProfileARB error. +// This is mostly used internally. +func (err GLXBadProfileARBError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadGLXBadProfileARB error. If no bad value exists, 0 is returned. +func (err GLXBadProfileARBError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadGLXBadProfileARB error. +func (err GLXBadProfileARBError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGLXBadProfileARB {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][13] = GLXBadProfileARBErrorNew +} const ( GcGlCurrentBit = 1 @@ -98,31 +596,79 @@ const ( GcGlAllAttribBits = 16777215 ) +// BadGeneric is the error number for a BadGeneric. +const BadGeneric = -1 + +type GenericError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 21 bytes +} + +// GenericErrorNew constructs a GenericError value that implements xgb.Error from a byte slice. +func GenericErrorNew(buf []byte) xgb.Error { + v := GenericError{} + v.NiceName = "Generic" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadValue = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 21 // padding + + return v +} + +// SequenceId returns the sequence id attached to the BadGeneric error. +// This is mostly used internally. +func (err GenericError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadGeneric error. If no bad value exists, 0 is returned. +func (err GenericError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadGeneric error. + +func (err GenericError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGeneric {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["GLX"][-1] = GenericErrorNew +} + const ( - RmGlRender = 7168 - RmGlFeedback = 7169 - RmGlSelect = 7170 + PbcdtWindow = 32793 + PbcdtPbuffer = 32794 ) -type Pixmap uint32 - -func NewPixmapId(c *xgb.Conn) (Pixmap, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Pixmap(id), nil -} - -type Context uint32 - -func NewContextId(c *xgb.Conn) (Context, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Context(id), nil -} +const ( + PbcetDamaged = 32791 + PbcetSaved = 32792 +) type Pbuffer uint32 @@ -134,44 +680,6 @@ func NewPbufferId(c *xgb.Conn) (Pbuffer, error) { return Pbuffer(id), nil } -type Window uint32 - -func NewWindowId(c *xgb.Conn) (Window, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Window(id), nil -} - -type Fbconfig uint32 - -func NewFbconfigId(c *xgb.Conn) (Fbconfig, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Fbconfig(id), nil -} - -type Drawable uint32 - -func NewDrawableId(c *xgb.Conn) (Drawable, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Drawable(id), nil -} - -type Float32 float64 - -type Float64 float64 - -type Bool32 uint32 - -type ContextTag uint32 - // PbufferClobber is the event number for a PbufferClobberEvent. const PbufferClobber = 0 @@ -312,373 +820,21 @@ func init() { xgb.NewExtEventFuncs["GLX"][0] = PbufferClobberEventNew } -// BadGeneric is the error number for a BadGeneric. -const BadGeneric = -1 +type Pixmap uint32 -type GenericError struct { - Sequence uint16 - NiceName string - BadValue uint32 - MinorOpcode uint16 - MajorOpcode byte - // padding: 21 bytes +func NewPixmapId(c *xgb.Conn) (Pixmap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pixmap(id), nil } -// GenericErrorNew constructs a GenericError value that implements xgb.Error from a byte slice. -func GenericErrorNew(buf []byte) xgb.Error { - v := GenericError{} - v.NiceName = "Generic" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadValue = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - b += 21 // padding - - return v -} - -// SequenceId returns the sequence id attached to the BadGeneric error. -// This is mostly used internally. -func (err GenericError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadGeneric error. If no bad value exists, 0 is returned. -func (err GenericError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadGeneric error. - -func (err GenericError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGeneric {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][-1] = GenericErrorNew -} - -// BadBadContext is the error number for a BadBadContext. -const BadBadContext = 0 - -type BadContextError GenericError - -// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. -func BadContextErrorNew(buf []byte) xgb.Error { - v := BadContextError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadContext" - return v -} - -// SequenceId returns the sequence id attached to the BadBadContext error. -// This is mostly used internally. -func (err BadContextError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. -func (err BadContextError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadContext error. -func (err BadContextError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][0] = BadContextErrorNew -} - -// BadBadContextState is the error number for a BadBadContextState. -const BadBadContextState = 1 - -type BadContextStateError GenericError - -// BadContextStateErrorNew constructs a BadContextStateError value that implements xgb.Error from a byte slice. -func BadContextStateErrorNew(buf []byte) xgb.Error { - v := BadContextStateError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadContextState" - return v -} - -// SequenceId returns the sequence id attached to the BadBadContextState error. -// This is mostly used internally. -func (err BadContextStateError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadContextState error. If no bad value exists, 0 is returned. -func (err BadContextStateError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadContextState error. -func (err BadContextStateError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadContextState {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][1] = BadContextStateErrorNew -} - -// BadBadDrawable is the error number for a BadBadDrawable. -const BadBadDrawable = 2 - -type BadDrawableError GenericError - -// BadDrawableErrorNew constructs a BadDrawableError value that implements xgb.Error from a byte slice. -func BadDrawableErrorNew(buf []byte) xgb.Error { - v := BadDrawableError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadDrawable" - return v -} - -// SequenceId returns the sequence id attached to the BadBadDrawable error. -// This is mostly used internally. -func (err BadDrawableError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadDrawable error. If no bad value exists, 0 is returned. -func (err BadDrawableError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadDrawable error. -func (err BadDrawableError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][2] = BadDrawableErrorNew -} - -// BadBadPixmap is the error number for a BadBadPixmap. -const BadBadPixmap = 3 - -type BadPixmapError GenericError - -// BadPixmapErrorNew constructs a BadPixmapError value that implements xgb.Error from a byte slice. -func BadPixmapErrorNew(buf []byte) xgb.Error { - v := BadPixmapError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadPixmap" - return v -} - -// SequenceId returns the sequence id attached to the BadBadPixmap error. -// This is mostly used internally. -func (err BadPixmapError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadPixmap error. If no bad value exists, 0 is returned. -func (err BadPixmapError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadPixmap error. -func (err BadPixmapError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][3] = BadPixmapErrorNew -} - -// BadBadContextTag is the error number for a BadBadContextTag. -const BadBadContextTag = 4 - -type BadContextTagError GenericError - -// BadContextTagErrorNew constructs a BadContextTagError value that implements xgb.Error from a byte slice. -func BadContextTagErrorNew(buf []byte) xgb.Error { - v := BadContextTagError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadContextTag" - return v -} - -// SequenceId returns the sequence id attached to the BadBadContextTag error. -// This is mostly used internally. -func (err BadContextTagError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadContextTag error. If no bad value exists, 0 is returned. -func (err BadContextTagError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadContextTag error. -func (err BadContextTagError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadContextTag {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][4] = BadContextTagErrorNew -} - -// BadBadCurrentWindow is the error number for a BadBadCurrentWindow. -const BadBadCurrentWindow = 5 - -type BadCurrentWindowError GenericError - -// BadCurrentWindowErrorNew constructs a BadCurrentWindowError value that implements xgb.Error from a byte slice. -func BadCurrentWindowErrorNew(buf []byte) xgb.Error { - v := BadCurrentWindowError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadCurrentWindow" - return v -} - -// SequenceId returns the sequence id attached to the BadBadCurrentWindow error. -// This is mostly used internally. -func (err BadCurrentWindowError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadCurrentWindow error. If no bad value exists, 0 is returned. -func (err BadCurrentWindowError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadCurrentWindow error. -func (err BadCurrentWindowError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadCurrentWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][5] = BadCurrentWindowErrorNew -} - -// BadBadRenderRequest is the error number for a BadBadRenderRequest. -const BadBadRenderRequest = 6 - -type BadRenderRequestError GenericError - -// BadRenderRequestErrorNew constructs a BadRenderRequestError value that implements xgb.Error from a byte slice. -func BadRenderRequestErrorNew(buf []byte) xgb.Error { - v := BadRenderRequestError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadRenderRequest" - return v -} - -// SequenceId returns the sequence id attached to the BadBadRenderRequest error. -// This is mostly used internally. -func (err BadRenderRequestError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadRenderRequest error. If no bad value exists, 0 is returned. -func (err BadRenderRequestError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadRenderRequest error. -func (err BadRenderRequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadRenderRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][6] = BadRenderRequestErrorNew -} - -// BadBadLargeRequest is the error number for a BadBadLargeRequest. -const BadBadLargeRequest = 7 - -type BadLargeRequestError GenericError - -// BadLargeRequestErrorNew constructs a BadLargeRequestError value that implements xgb.Error from a byte slice. -func BadLargeRequestErrorNew(buf []byte) xgb.Error { - v := BadLargeRequestError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadLargeRequest" - return v -} - -// SequenceId returns the sequence id attached to the BadBadLargeRequest error. -// This is mostly used internally. -func (err BadLargeRequestError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadLargeRequest error. If no bad value exists, 0 is returned. -func (err BadLargeRequestError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadLargeRequest error. -func (err BadLargeRequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadLargeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][7] = BadLargeRequestErrorNew -} +const ( + RmGlRender = 7168 + RmGlFeedback = 7169 + RmGlSelect = 7170 +) // BadUnsupportedPrivateRequest is the error number for a BadUnsupportedPrivateRequest. const BadUnsupportedPrivateRequest = 8 @@ -718,240 +874,132 @@ func init() { xgb.NewExtErrorFuncs["GLX"][8] = UnsupportedPrivateRequestErrorNew } -// BadBadFBConfig is the error number for a BadBadFBConfig. -const BadBadFBConfig = 9 +type Window uint32 -type BadFBConfigError GenericError - -// BadFBConfigErrorNew constructs a BadFBConfigError value that implements xgb.Error from a byte slice. -func BadFBConfigErrorNew(buf []byte) xgb.Error { - v := BadFBConfigError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadFBConfig" - return v +func NewWindowId(c *xgb.Conn) (Window, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Window(id), nil } -// SequenceId returns the sequence id attached to the BadBadFBConfig error. -// This is mostly used internally. -func (err BadFBConfigError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Bool' -// BadId returns the 'BadValue' number if one exists for the BadBadFBConfig error. If no bad value exists, 0 is returned. -func (err BadFBConfigError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Byte' -// Error returns a rudimentary string representation of the BadBadFBConfig error. -func (err BadFBConfigError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadFBConfig {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Card8' -func init() { - xgb.NewExtErrorFuncs["GLX"][9] = BadFBConfigErrorNew -} +// Skipping definition for base type 'Char' -// BadBadPbuffer is the error number for a BadBadPbuffer. -const BadBadPbuffer = 10 +// Skipping definition for base type 'Void' -type BadPbufferError GenericError +// Skipping definition for base type 'Double' -// BadPbufferErrorNew constructs a BadPbufferError value that implements xgb.Error from a byte slice. -func BadPbufferErrorNew(buf []byte) xgb.Error { - v := BadPbufferError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadPbuffer" - return v -} +// Skipping definition for base type 'Float' -// SequenceId returns the sequence id attached to the BadBadPbuffer error. -// This is mostly used internally. -func (err BadPbufferError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Int16' -// BadId returns the 'BadValue' number if one exists for the BadBadPbuffer error. If no bad value exists, 0 is returned. -func (err BadPbufferError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Int32' -// Error returns a rudimentary string representation of the BadBadPbuffer error. -func (err BadPbufferError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadPbuffer {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Int8' -func init() { - xgb.NewExtErrorFuncs["GLX"][10] = BadPbufferErrorNew -} +// Skipping definition for base type 'Card16' -// BadBadCurrentDrawable is the error number for a BadBadCurrentDrawable. -const BadBadCurrentDrawable = 11 +// Skipping definition for base type 'Card32' -type BadCurrentDrawableError GenericError - -// BadCurrentDrawableErrorNew constructs a BadCurrentDrawableError value that implements xgb.Error from a byte slice. -func BadCurrentDrawableErrorNew(buf []byte) xgb.Error { - v := BadCurrentDrawableError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadCurrentDrawable" - return v -} - -// SequenceId returns the sequence id attached to the BadBadCurrentDrawable error. -// This is mostly used internally. -func (err BadCurrentDrawableError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadCurrentDrawable error. If no bad value exists, 0 is returned. -func (err BadCurrentDrawableError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadCurrentDrawable error. -func (err BadCurrentDrawableError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadCurrentDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][11] = BadCurrentDrawableErrorNew -} - -// BadBadWindow is the error number for a BadBadWindow. -const BadBadWindow = 12 - -type BadWindowError GenericError - -// BadWindowErrorNew constructs a BadWindowError value that implements xgb.Error from a byte slice. -func BadWindowErrorNew(buf []byte) xgb.Error { - v := BadWindowError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "BadWindow" - return v -} - -// SequenceId returns the sequence id attached to the BadBadWindow error. -// This is mostly used internally. -func (err BadWindowError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadWindow error. If no bad value exists, 0 is returned. -func (err BadWindowError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadWindow error. -func (err BadWindowError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadWindow {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][12] = BadWindowErrorNew -} - -// BadGLXBadProfileARB is the error number for a BadGLXBadProfileARB. -const BadGLXBadProfileARB = 13 - -type GLXBadProfileARBError GenericError - -// GLXBadProfileARBErrorNew constructs a GLXBadProfileARBError value that implements xgb.Error from a byte slice. -func GLXBadProfileARBErrorNew(buf []byte) xgb.Error { - v := GLXBadProfileARBError(GenericErrorNew(buf).(GenericError)) - v.NiceName = "GLXBadProfileARB" - return v -} - -// SequenceId returns the sequence id attached to the BadGLXBadProfileARB error. -// This is mostly used internally. -func (err GLXBadProfileARBError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadGLXBadProfileARB error. If no bad value exists, 0 is returned. -func (err GLXBadProfileARBError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadGLXBadProfileARB error. -func (err GLXBadProfileARBError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGLXBadProfileARB {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["GLX"][13] = GLXBadProfileARBErrorNew -} - -// RenderCookie is a cookie used only for Render requests. -type RenderCookie struct { +// AreTexturesResidentCookie is a cookie used only for AreTexturesResident requests. +type AreTexturesResidentCookie struct { *xgb.Cookie } -// Render sends an unchecked request. +// AreTexturesResident sends a checked request. +// If an error occurs, it will be returned with the reply by calling AreTexturesResidentCookie.Reply() +func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) + return AreTexturesResidentCookie{cookie} +} + +// AreTexturesResidentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { +func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(renderRequest(c, ContextTag, Data), cookie) - return RenderCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) + return AreTexturesResidentCookie{cookie} } -// RenderChecked sends a checked request. -// If an error occurs, it can be retrieved using RenderCookie.Check() -func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") +// AreTexturesResidentReply represents the data returned from a AreTexturesResident request. +type AreTexturesResidentReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + RetVal Bool32 + // padding: 20 bytes + Data []bool // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a AreTexturesResident request. +func (cook AreTexturesResidentCookie) Reply() (*AreTexturesResidentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(renderRequest(c, ContextTag, Data), cookie) - return RenderCookie{cookie} + if buf == nil { + return nil, nil + } + return areTexturesResidentReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RenderCookie) Check() error { - return cook.Cookie.Check() +// areTexturesResidentReply reads a byte slice into a AreTexturesResidentReply value. +func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { + v := new(AreTexturesResidentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]bool, (int(v.Length) * 4)) + for i := 0; i < int((int(v.Length) * 4)); i++ { + if buf[b] == 1 { + v.Data[i] = true + } else { + v.Data[i] = false + } + b += 1 + } + b = xgb.Pad(b) + + return v } -// Write request to wire for Render -// renderRequest writes a Render request to a byte slice. -func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) +// Write request to wire for AreTexturesResident +// areTexturesResidentRequest writes a AreTexturesResident request to a byte slice. +func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 1 // request opcode + buf[b] = 143 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -960,75 +1008,206 @@ func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Textures[i]) + b += 4 + } + b = xgb.Pad(b) return buf } -// RenderLargeCookie is a cookie used only for RenderLarge requests. -type RenderLargeCookie struct { +// ChangeDrawableAttributesCookie is a cookie used only for ChangeDrawableAttributes requests. +type ChangeDrawableAttributesCookie struct { *xgb.Cookie } -// RenderLarge sends an unchecked request. +// ChangeDrawableAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { +func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) - return RenderLargeCookie{cookie} + c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) + return ChangeDrawableAttributesCookie{cookie} } -// RenderLargeChecked sends a checked request. -// If an error occurs, it can be retrieved using RenderLargeCookie.Check() -func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { +// ChangeDrawableAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDrawableAttributesCookie.Check() +func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) - return RenderLargeCookie{cookie} + c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) + return ChangeDrawableAttributesCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RenderLargeCookie) Check() error { +func (cook ChangeDrawableAttributesCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for RenderLarge -// renderLargeRequest writes a RenderLarge request to a byte slice. -func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { - size := xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) +// Write request to wire for ChangeDrawableAttributes +// changeDrawableAttributesRequest writes a ChangeDrawableAttributes request to a byte slice. +func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 2 // request opcode + buf[b] = 30 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(ContextTag)) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - xgb.Put16(buf[b:], RequestNum) - b += 2 - - xgb.Put16(buf[b:], RequestTotal) - b += 2 - - xgb.Put32(buf[b:], DataLen) + xgb.Put32(buf[b:], NumAttribs) b += 4 - copy(buf[b:], Data[:DataLen]) - b += xgb.Pad(int(DataLen)) + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ClientInfoCookie is a cookie used only for ClientInfo requests. +type ClientInfoCookie struct { + *xgb.Cookie +} + +// ClientInfo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) + return ClientInfoCookie{cookie} +} + +// ClientInfoChecked sends a checked request. +// If an error occurs, it can be retrieved using ClientInfoCookie.Check() +func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) + return ClientInfoCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ClientInfoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ClientInfo +// clientInfoRequest writes a ClientInfo request to a byte slice. +func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], StrLen) + b += 4 + + copy(buf[b:], String[:StrLen]) + b += xgb.Pad(int(StrLen)) + + return buf +} + +// CopyContextCookie is a cookie used only for CopyContext requests. +type CopyContextCookie struct { + *xgb.Cookie +} + +// CopyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) + return CopyContextCookie{cookie} +} + +// CopyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyContextCookie.Check() +func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) + return CopyContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CopyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyContext +// copyContextRequest writes a CopyContext request to a byte slice. +func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dest)) + b += 4 + + xgb.Put32(buf[b:], Mask) + b += 4 + + xgb.Put32(buf[b:], uint32(SrcContextTag)) + b += 4 return buf } @@ -1106,50 +1285,50 @@ func createContextRequest(c *xgb.Conn, Context Context, Visual xproto.Visualid, return buf } -// DestroyContextCookie is a cookie used only for DestroyContext requests. -type DestroyContextCookie struct { +// CreateContextAttribsARBCookie is a cookie used only for CreateContextAttribsARB requests. +type CreateContextAttribsARBCookie struct { *xgb.Cookie } -// DestroyContext sends an unchecked request. +// CreateContextAttribsARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { +func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(destroyContextRequest(c, Context), cookie) - return DestroyContextCookie{cookie} + c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return CreateContextAttribsARBCookie{cookie} } -// DestroyContextChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyContextCookie.Check() -func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { +// CreateContextAttribsARBChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextAttribsARBCookie.Check() +func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(destroyContextRequest(c, Context), cookie) - return DestroyContextCookie{cookie} + c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) + return CreateContextAttribsARBCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyContextCookie) Check() error { +func (cook CreateContextAttribsARBCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DestroyContext -// destroyContextRequest writes a DestroyContext request to a byte slice. -func destroyContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 +// Write request to wire for CreateContextAttribsARB +// createContextAttribsARBRequest writes a CreateContextAttribsARB request to a byte slice. +func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 4 // request opcode + buf[b] = 34 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1158,594 +1337,32 @@ func destroyContextRequest(c *xgb.Conn, Context Context) []byte { xgb.Put32(buf[b:], uint32(Context)) b += 4 - return buf -} - -// MakeCurrentCookie is a cookie used only for MakeCurrent requests. -type MakeCurrentCookie struct { - *xgb.Cookie -} - -// MakeCurrent sends a checked request. -// If an error occurs, it will be returned with the reply by calling MakeCurrentCookie.Reply() -func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) - return MakeCurrentCookie{cookie} -} - -// MakeCurrentUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) - return MakeCurrentCookie{cookie} -} - -// MakeCurrentReply represents the data returned from a MakeCurrent request. -type MakeCurrentReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextTag ContextTag - // padding: 20 bytes -} - -// Reply blocks and returns the reply data for a MakeCurrent request. -func (cook MakeCurrentCookie) Reply() (*MakeCurrentReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return makeCurrentReply(buf), nil -} - -// makeCurrentReply reads a byte slice into a MakeCurrentReply value. -func makeCurrentReply(buf []byte) *MakeCurrentReply { - v := new(MakeCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(Fbconfig)) b += 4 - v.ContextTag = ContextTag(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], Screen) b += 4 - b += 20 // padding - - return v -} - -// Write request to wire for MakeCurrent -// makeCurrentRequest writes a MakeCurrent request to a byte slice. -func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(ShareList)) b += 4 - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - xgb.Put32(buf[b:], uint32(OldContextTag)) - b += 4 - - return buf -} - -// IsDirectCookie is a cookie used only for IsDirect requests. -type IsDirectCookie struct { - *xgb.Cookie -} - -// IsDirect sends a checked request. -// If an error occurs, it will be returned with the reply by calling IsDirectCookie.Reply() -func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(isDirectRequest(c, Context), cookie) - return IsDirectCookie{cookie} -} - -// IsDirectUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(isDirectRequest(c, Context), cookie) - return IsDirectCookie{cookie} -} - -// IsDirectReply represents the data returned from a IsDirect request. -type IsDirectReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - IsDirect bool - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a IsDirect request. -func (cook IsDirectCookie) Reply() (*IsDirectReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return isDirectReply(buf), nil -} - -// isDirectReply reads a byte slice into a IsDirectReply value. -func isDirectReply(buf []byte) *IsDirectReply { - v := new(IsDirectReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.IsDirect = true + if IsDirect { + buf[b] = 1 } else { - v.IsDirect = false + buf[b] = 0 } b += 1 - b += 23 // padding + b += 3 // padding - return v -} - -// Write request to wire for IsDirect -// isDirectRequest writes a IsDirect request to a byte slice. -func isDirectRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) + xgb.Put32(buf[b:], NumAttribs) b += 4 - return buf -} - -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} - -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + for i := 0; i < int((int(NumAttribs) * 2)); i++ { + xgb.Put32(buf[b:], Attribs[i]) + b += 4 } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} - -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = xgb.Get32(buf[b:]) - b += 4 - - v.MinorVersion = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], MajorVersion) - b += 4 - - xgb.Put32(buf[b:], MinorVersion) - b += 4 - - return buf -} - -// WaitGLCookie is a cookie used only for WaitGL requests. -type WaitGLCookie struct { - *xgb.Cookie -} - -// WaitGL sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(waitGLRequest(c, ContextTag), cookie) - return WaitGLCookie{cookie} -} - -// WaitGLChecked sends a checked request. -// If an error occurs, it can be retrieved using WaitGLCookie.Check() -func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(waitGLRequest(c, ContextTag), cookie) - return WaitGLCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook WaitGLCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for WaitGL -// waitGLRequest writes a WaitGL request to a byte slice. -func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// WaitXCookie is a cookie used only for WaitX requests. -type WaitXCookie struct { - *xgb.Cookie -} - -// WaitX sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(waitXRequest(c, ContextTag), cookie) - return WaitXCookie{cookie} -} - -// WaitXChecked sends a checked request. -// If an error occurs, it can be retrieved using WaitXCookie.Check() -func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(waitXRequest(c, ContextTag), cookie) - return WaitXCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook WaitXCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for WaitX -// waitXRequest writes a WaitX request to a byte slice. -func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// CopyContextCookie is a cookie used only for CopyContext requests. -type CopyContextCookie struct { - *xgb.Cookie -} - -// CopyContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) - return CopyContextCookie{cookie} -} - -// CopyContextChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyContextCookie.Check() -func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(copyContextRequest(c, Src, Dest, Mask, SrcContextTag), cookie) - return CopyContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyContext -// copyContextRequest writes a CopyContext request to a byte slice. -func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Src)) - b += 4 - - xgb.Put32(buf[b:], uint32(Dest)) - b += 4 - - xgb.Put32(buf[b:], Mask) - b += 4 - - xgb.Put32(buf[b:], uint32(SrcContextTag)) - b += 4 - - return buf -} - -// SwapBuffersCookie is a cookie used only for SwapBuffers requests. -type SwapBuffersCookie struct { - *xgb.Cookie -} - -// SwapBuffers sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) - return SwapBuffersCookie{cookie} -} - -// SwapBuffersChecked sends a checked request. -// If an error occurs, it can be retrieved using SwapBuffersCookie.Check() -func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) - return SwapBuffersCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SwapBuffersCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SwapBuffers -// swapBuffersRequest writes a SwapBuffers request to a byte slice. -func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// UseXFontCookie is a cookie used only for UseXFont requests. -type UseXFontCookie struct { - *xgb.Cookie -} - -// UseXFont sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) - return UseXFontCookie{cookie} -} - -// UseXFontChecked sends a checked request. -// If an error occurs, it can be retrieved using UseXFontCookie.Check() -func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) - return UseXFontCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UseXFontCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UseXFont -// useXFontRequest writes a UseXFont request to a byte slice. -func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(Font)) - b += 4 - - xgb.Put32(buf[b:], First) - b += 4 - - xgb.Put32(buf[b:], Count) - b += 4 - - xgb.Put32(buf[b:], ListBase) - b += 4 + b = xgb.Pad(b) return buf } @@ -1814,823 +1431,6 @@ func createGLXPixmapRequest(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, return buf } -// GetVisualConfigsCookie is a cookie used only for GetVisualConfigs requests. -type GetVisualConfigsCookie struct { - *xgb.Cookie -} - -// GetVisualConfigs sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetVisualConfigsCookie.Reply() -func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) - return GetVisualConfigsCookie{cookie} -} - -// GetVisualConfigsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) - return GetVisualConfigsCookie{cookie} -} - -// GetVisualConfigsReply represents the data returned from a GetVisualConfigs request. -type GetVisualConfigsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumVisuals uint32 - NumProperties uint32 - // padding: 16 bytes - PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GetVisualConfigs request. -func (cook GetVisualConfigsCookie) Reply() (*GetVisualConfigsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getVisualConfigsReply(buf), nil -} - -// getVisualConfigsReply reads a byte slice into a GetVisualConfigsReply value. -func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { - v := new(GetVisualConfigsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumVisuals = xgb.Get32(buf[b:]) - b += 4 - - v.NumProperties = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.PropertyList = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PropertyList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetVisualConfigs -// getVisualConfigsRequest writes a GetVisualConfigs request to a byte slice. -func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// DestroyGLXPixmapCookie is a cookie used only for DestroyGLXPixmap requests. -type DestroyGLXPixmapCookie struct { - *xgb.Cookie -} - -// DestroyGLXPixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) - return DestroyGLXPixmapCookie{cookie} -} - -// DestroyGLXPixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyGLXPixmapCookie.Check() -func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) - return DestroyGLXPixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyGLXPixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyGLXPixmap -// destroyGLXPixmapRequest writes a DestroyGLXPixmap request to a byte slice. -func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - return buf -} - -// VendorPrivateCookie is a cookie used only for VendorPrivate requests. -type VendorPrivateCookie struct { - *xgb.Cookie -} - -// VendorPrivate sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) - return VendorPrivateCookie{cookie} -} - -// VendorPrivateChecked sends a checked request. -// If an error occurs, it can be retrieved using VendorPrivateCookie.Check() -func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) - return VendorPrivateCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook VendorPrivateCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for VendorPrivate -// vendorPrivateRequest writes a VendorPrivate request to a byte slice. -func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], VendorCode) - b += 4 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) - - return buf -} - -// VendorPrivateWithReplyCookie is a cookie used only for VendorPrivateWithReply requests. -type VendorPrivateWithReplyCookie struct { - *xgb.Cookie -} - -// VendorPrivateWithReply sends a checked request. -// If an error occurs, it will be returned with the reply by calling VendorPrivateWithReplyCookie.Reply() -func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) - return VendorPrivateWithReplyCookie{cookie} -} - -// VendorPrivateWithReplyUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) - return VendorPrivateWithReplyCookie{cookie} -} - -// VendorPrivateWithReplyReply represents the data returned from a VendorPrivateWithReply request. -type VendorPrivateWithReplyReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Retval uint32 - Data1 []byte // size: 24 - Data2 []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a VendorPrivateWithReply request. -func (cook VendorPrivateWithReplyCookie) Reply() (*VendorPrivateWithReplyReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return vendorPrivateWithReplyReply(buf), nil -} - -// vendorPrivateWithReplyReply reads a byte slice into a VendorPrivateWithReplyReply value. -func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { - v := new(VendorPrivateWithReplyReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Retval = xgb.Get32(buf[b:]) - b += 4 - - v.Data1 = make([]byte, 24) - copy(v.Data1[:24], buf[b:]) - b += xgb.Pad(int(24)) - - v.Data2 = make([]byte, (int(v.Length) * 4)) - copy(v.Data2[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for VendorPrivateWithReply -// vendorPrivateWithReplyRequest writes a VendorPrivateWithReply request to a byte slice. -func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], VendorCode) - b += 4 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) - - return buf -} - -// QueryExtensionsStringCookie is a cookie used only for QueryExtensionsString requests. -type QueryExtensionsStringCookie struct { - *xgb.Cookie -} - -// QueryExtensionsString sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryExtensionsStringCookie.Reply() -func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) - return QueryExtensionsStringCookie{cookie} -} - -// QueryExtensionsStringUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) - return QueryExtensionsStringCookie{cookie} -} - -// QueryExtensionsStringReply represents the data returned from a QueryExtensionsString request. -type QueryExtensionsStringReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a QueryExtensionsString request. -func (cook QueryExtensionsStringCookie) Reply() (*QueryExtensionsStringReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryExtensionsStringReply(buf), nil -} - -// queryExtensionsStringReply reads a byte slice into a QueryExtensionsStringReply value. -func queryExtensionsStringReply(buf []byte) *QueryExtensionsStringReply { - v := new(QueryExtensionsStringReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v -} - -// Write request to wire for QueryExtensionsString -// queryExtensionsStringRequest writes a QueryExtensionsString request to a byte slice. -func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// QueryServerStringCookie is a cookie used only for QueryServerString requests. -type QueryServerStringCookie struct { - *xgb.Cookie -} - -// QueryServerString sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryServerStringCookie.Reply() -func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) - return QueryServerStringCookie{cookie} -} - -// QueryServerStringUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) - return QueryServerStringCookie{cookie} -} - -// QueryServerStringReply represents the data returned from a QueryServerString request. -type QueryServerStringReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - StrLen uint32 - // padding: 16 bytes - String string // size: xgb.Pad((int(StrLen) * 1)) -} - -// Reply blocks and returns the reply data for a QueryServerString request. -func (cook QueryServerStringCookie) Reply() (*QueryServerStringReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryServerStringReply(buf), nil -} - -// queryServerStringReply reads a byte slice into a QueryServerStringReply value. -func queryServerStringReply(buf []byte) *QueryServerStringReply { - v := new(QueryServerStringReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.StrLen = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - { - byteString := make([]byte, v.StrLen) - copy(byteString[:v.StrLen], buf[b:]) - v.String = string(byteString) - b += xgb.Pad(int(v.StrLen)) - } - - return v -} - -// Write request to wire for QueryServerString -// queryServerStringRequest writes a QueryServerString request to a byte slice. -func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], Name) - b += 4 - - return buf -} - -// ClientInfoCookie is a cookie used only for ClientInfo requests. -type ClientInfoCookie struct { - *xgb.Cookie -} - -// ClientInfo sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) - return ClientInfoCookie{cookie} -} - -// ClientInfoChecked sends a checked request. -// If an error occurs, it can be retrieved using ClientInfoCookie.Check() -func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(clientInfoRequest(c, MajorVersion, MinorVersion, StrLen, String), cookie) - return ClientInfoCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ClientInfoCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ClientInfo -// clientInfoRequest writes a ClientInfo request to a byte slice. -func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) []byte { - size := xgb.Pad((16 + xgb.Pad((int(StrLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], MajorVersion) - b += 4 - - xgb.Put32(buf[b:], MinorVersion) - b += 4 - - xgb.Put32(buf[b:], StrLen) - b += 4 - - copy(buf[b:], String[:StrLen]) - b += xgb.Pad(int(StrLen)) - - return buf -} - -// GetFBConfigsCookie is a cookie used only for GetFBConfigs requests. -type GetFBConfigsCookie struct { - *xgb.Cookie -} - -// GetFBConfigs sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetFBConfigsCookie.Reply() -func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getFBConfigsRequest(c, Screen), cookie) - return GetFBConfigsCookie{cookie} -} - -// GetFBConfigsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getFBConfigsRequest(c, Screen), cookie) - return GetFBConfigsCookie{cookie} -} - -// GetFBConfigsReply represents the data returned from a GetFBConfigs request. -type GetFBConfigsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumFbConfigs uint32 - NumProperties uint32 - // padding: 16 bytes - PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GetFBConfigs request. -func (cook GetFBConfigsCookie) Reply() (*GetFBConfigsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getFBConfigsReply(buf), nil -} - -// getFBConfigsReply reads a byte slice into a GetFBConfigsReply value. -func getFBConfigsReply(buf []byte) *GetFBConfigsReply { - v := new(GetFBConfigsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFbConfigs = xgb.Get32(buf[b:]) - b += 4 - - v.NumProperties = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.PropertyList = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PropertyList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetFBConfigs -// getFBConfigsRequest writes a GetFBConfigs request to a byte slice. -func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// CreatePixmapCookie is a cookie used only for CreatePixmap requests. -type CreatePixmapCookie struct { - *xgb.Cookie -} - -// CreatePixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) - return CreatePixmapCookie{cookie} -} - -// CreatePixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() -func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) - return CreatePixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreatePixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreatePixmap -// createPixmapRequest writes a CreatePixmap request to a byte slice. -func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) []byte { - size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - xgb.Put32(buf[b:], uint32(Pixmap)) - b += 4 - - xgb.Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - xgb.Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - xgb.Put32(buf[b:], Attribs[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DestroyPixmapCookie is a cookie used only for DestroyPixmap requests. -type DestroyPixmapCookie struct { - *xgb.Cookie -} - -// DestroyPixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) - return DestroyPixmapCookie{cookie} -} - -// DestroyPixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyPixmapCookie.Check() -func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) - return DestroyPixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyPixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyPixmap -// destroyPixmapRequest writes a DestroyPixmap request to a byte slice. -func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GlxPixmap)) - b += 4 - - return buf -} - // CreateNewContextCookie is a cookie used only for CreateNewContext requests. type CreateNewContextCookie struct { *xgb.Cookie @@ -2707,205 +1507,6 @@ func createNewContextRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Sc return buf } -// QueryContextCookie is a cookie used only for QueryContext requests. -type QueryContextCookie struct { - *xgb.Cookie -} - -// QueryContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryContextCookie.Reply() -func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryContextRequest(c, Context), cookie) - return QueryContextCookie{cookie} -} - -// QueryContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryContextRequest(c, Context), cookie) - return QueryContextCookie{cookie} -} - -// QueryContextReply represents the data returned from a QueryContext request. -type QueryContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumAttribs uint32 - // padding: 20 bytes - Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) -} - -// Reply blocks and returns the reply data for a QueryContext request. -func (cook QueryContextCookie) Reply() (*QueryContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryContextReply(buf), nil -} - -// queryContextReply reads a byte slice into a QueryContextReply value. -func queryContextReply(buf []byte) *QueryContextReply { - v := new(QueryContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAttribs = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) - for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { - v.Attribs[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for QueryContext -// queryContextRequest writes a QueryContext request to a byte slice. -func queryContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// MakeContextCurrentCookie is a cookie used only for MakeContextCurrent requests. -type MakeContextCurrentCookie struct { - *xgb.Cookie -} - -// MakeContextCurrent sends a checked request. -// If an error occurs, it will be returned with the reply by calling MakeContextCurrentCookie.Reply() -func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) - return MakeContextCurrentCookie{cookie} -} - -// MakeContextCurrentUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) - return MakeContextCurrentCookie{cookie} -} - -// MakeContextCurrentReply represents the data returned from a MakeContextCurrent request. -type MakeContextCurrentReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextTag ContextTag - // padding: 20 bytes -} - -// Reply blocks and returns the reply data for a MakeContextCurrent request. -func (cook MakeContextCurrentCookie) Reply() (*MakeContextCurrentReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return makeContextCurrentReply(buf), nil -} - -// makeContextCurrentReply reads a byte slice into a MakeContextCurrentReply value. -func makeContextCurrentReply(buf []byte) *MakeContextCurrentReply { - v := new(MakeContextCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextTag = ContextTag(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -// Write request to wire for MakeContextCurrent -// makeContextCurrentRequest writes a MakeContextCurrent request to a byte slice. -func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(OldContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(ReadDrawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - // CreatePbufferCookie is a cookie used only for CreatePbuffer requests. type CreatePbufferCookie struct { *xgb.Cookie @@ -2976,210 +1577,65 @@ func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer return buf } -// DestroyPbufferCookie is a cookie used only for DestroyPbuffer requests. -type DestroyPbufferCookie struct { +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. +type CreatePixmapCookie struct { *xgb.Cookie } -// DestroyPbuffer sends an unchecked request. +// CreatePixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { +func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) - return DestroyPbufferCookie{cookie} + c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return CreatePixmapCookie{cookie} } -// DestroyPbufferChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyPbufferCookie.Check() -func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() +func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) - return DestroyPbufferCookie{cookie} + c.NewRequest(createPixmapRequest(c, Screen, Fbconfig, Pixmap, GlxPixmap, NumAttribs, Attribs), cookie) + return CreatePixmapCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyPbufferCookie) Check() error { +func (cook CreatePixmapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DestroyPbuffer -// destroyPbufferRequest writes a DestroyPbuffer request to a byte slice. -func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { - size := 8 +// Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. +func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) []byte { + size := xgb.Pad((24 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 28 // request opcode + buf[b] = 22 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Pbuffer)) + xgb.Put32(buf[b:], Screen) b += 4 - return buf -} - -// GetDrawableAttributesCookie is a cookie used only for GetDrawableAttributes requests. -type GetDrawableAttributesCookie struct { - *xgb.Cookie -} - -// GetDrawableAttributes sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDrawableAttributesCookie.Reply() -func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) - return GetDrawableAttributesCookie{cookie} -} - -// GetDrawableAttributesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) - return GetDrawableAttributesCookie{cookie} -} - -// GetDrawableAttributesReply represents the data returned from a GetDrawableAttributes request. -type GetDrawableAttributesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumAttribs uint32 - // padding: 20 bytes - Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) -} - -// Reply blocks and returns the reply data for a GetDrawableAttributes request. -func (cook GetDrawableAttributesCookie) Reply() (*GetDrawableAttributesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDrawableAttributesReply(buf), nil -} - -// getDrawableAttributesReply reads a byte slice into a GetDrawableAttributesReply value. -func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { - v := new(GetDrawableAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(Fbconfig)) b += 4 - v.NumAttribs = xgb.Get32(buf[b:]) + xgb.Put32(buf[b:], uint32(Pixmap)) b += 4 - b += 20 // padding - - v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) - for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { - v.Attribs[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetDrawableAttributes -// getDrawableAttributesRequest writes a GetDrawableAttributes request to a byte slice. -func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// ChangeDrawableAttributesCookie is a cookie used only for ChangeDrawableAttributes requests. -type ChangeDrawableAttributesCookie struct { - *xgb.Cookie -} - -// ChangeDrawableAttributes sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) - return ChangeDrawableAttributesCookie{cookie} -} - -// ChangeDrawableAttributesChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeDrawableAttributesCookie.Check() -func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeDrawableAttributesRequest(c, Drawable, NumAttribs, Attribs), cookie) - return ChangeDrawableAttributesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeDrawableAttributesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeDrawableAttributes -// changeDrawableAttributesRequest writes a ChangeDrawableAttributes request to a byte slice. -func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) []byte { - size := xgb.Pad((12 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(GlxPixmap)) b += 4 xgb.Put32(buf[b:], NumAttribs) @@ -3267,6 +1723,195 @@ func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window x return buf } +// DeleteListsCookie is a cookie used only for DeleteLists requests. +type DeleteListsCookie struct { + *xgb.Cookie +} + +// DeleteLists sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) + return DeleteListsCookie{cookie} +} + +// DeleteListsChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteListsCookie.Check() +func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) + return DeleteListsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteListsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteLists +// deleteListsRequest writes a DeleteLists request to a byte slice. +func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 103 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], List) + b += 4 + + xgb.Put32(buf[b:], uint32(Range)) + b += 4 + + return buf +} + +// DeleteQueriesARBCookie is a cookie used only for DeleteQueriesARB requests. +type DeleteQueriesARBCookie struct { + *xgb.Cookie +} + +// DeleteQueriesARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) + return DeleteQueriesARBCookie{cookie} +} + +// DeleteQueriesARBChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteQueriesARBCookie.Check() +func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) + return DeleteQueriesARBCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteQueriesARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteQueriesARB +// deleteQueriesARBRequest writes a DeleteQueriesARB request to a byte slice. +func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 161 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Ids[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// DeleteTexturesCookie is a cookie used only for DeleteTextures requests. +type DeleteTexturesCookie struct { + *xgb.Cookie +} + +// DeleteTextures sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) + return DeleteTexturesCookie{cookie} +} + +// DeleteTexturesChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteTexturesCookie.Check() +func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) + return DeleteTexturesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteTexturesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteTextures +// deleteTexturesRequest writes a DeleteTextures request to a byte slice. +func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 144 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + + for i := 0; i < int(N); i++ { + xgb.Put32(buf[b:], Textures[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + // DeleteWindowCookie is a cookie used only for DeleteWindow requests. type DeleteWindowCookie struct { *xgb.Cookie @@ -3322,129 +1967,50 @@ func deleteWindowRequest(c *xgb.Conn, Glxwindow Window) []byte { return buf } -// SetClientInfoARBCookie is a cookie used only for SetClientInfoARB requests. -type SetClientInfoARBCookie struct { +// DestroyContextCookie is a cookie used only for DestroyContext requests. +type DestroyContextCookie struct { *xgb.Cookie } -// SetClientInfoARB sends an unchecked request. +// DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { +func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return SetClientInfoARBCookie{cookie} + c.NewRequest(destroyContextRequest(c, Context), cookie) + return DestroyContextCookie{cookie} } -// SetClientInfoARBChecked sends a checked request. -// If an error occurs, it can be retrieved using SetClientInfoARBCookie.Check() -func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() +func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return SetClientInfoARBCookie{cookie} + c.NewRequest(destroyContextRequest(c, Context), cookie) + return DestroyContextCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetClientInfoARBCookie) Check() error { +func (cook DestroyContextCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetClientInfoARB -// setClientInfoARBRequest writes a SetClientInfoARB request to a byte slice. -func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { - size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +// Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. +func destroyContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 33 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], MajorVersion) - b += 4 - - xgb.Put32(buf[b:], MinorVersion) - b += 4 - - xgb.Put32(buf[b:], NumVersions) - b += 4 - - xgb.Put32(buf[b:], GlStrLen) - b += 4 - - xgb.Put32(buf[b:], GlxStrLen) - b += 4 - - for i := 0; i < int((int(NumVersions) * 2)); i++ { - xgb.Put32(buf[b:], GlVersions[i]) - b += 4 - } - b = xgb.Pad(b) - - copy(buf[b:], GlExtensionString[:GlStrLen]) - b += xgb.Pad(int(GlStrLen)) - - copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += xgb.Pad(int(GlxStrLen)) - - return buf -} - -// CreateContextAttribsARBCookie is a cookie used only for CreateContextAttribsARB requests. -type CreateContextAttribsARBCookie struct { - *xgb.Cookie -} - -// CreateContextAttribsARB sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) - return CreateContextAttribsARBCookie{cookie} -} - -// CreateContextAttribsARBChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateContextAttribsARBCookie.Check() -func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createContextAttribsARBRequest(c, Context, Fbconfig, Screen, ShareList, IsDirect, NumAttribs, Attribs), cookie) - return CreateContextAttribsARBCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateContextAttribsARBCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateContextAttribsARB -// createContextAttribsARBRequest writes a CreateContextAttribsARB request to a byte slice. -func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) []byte { - size := xgb.Pad((28 + xgb.Pad(((int(NumAttribs) * 2) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 34 // request opcode + buf[b] = 4 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -3453,171 +2019,169 @@ func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbcon xgb.Put32(buf[b:], uint32(Context)) b += 4 - xgb.Put32(buf[b:], uint32(Fbconfig)) - b += 4 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], uint32(ShareList)) - b += 4 - - if IsDirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], NumAttribs) - b += 4 - - for i := 0; i < int((int(NumAttribs) * 2)); i++ { - xgb.Put32(buf[b:], Attribs[i]) - b += 4 - } - b = xgb.Pad(b) - return buf } -// SetClientInfo2ARBCookie is a cookie used only for SetClientInfo2ARB requests. -type SetClientInfo2ARBCookie struct { +// DestroyGLXPixmapCookie is a cookie used only for DestroyGLXPixmap requests. +type DestroyGLXPixmapCookie struct { *xgb.Cookie } -// SetClientInfo2ARB sends an unchecked request. +// DestroyGLXPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { +func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return SetClientInfo2ARBCookie{cookie} + c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) + return DestroyGLXPixmapCookie{cookie} } -// SetClientInfo2ARBChecked sends a checked request. -// If an error occurs, it can be retrieved using SetClientInfo2ARBCookie.Check() -func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { +// DestroyGLXPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyGLXPixmapCookie.Check() +func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) - return SetClientInfo2ARBCookie{cookie} + c.NewRequest(destroyGLXPixmapRequest(c, GlxPixmap), cookie) + return DestroyGLXPixmapCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetClientInfo2ARBCookie) Check() error { +func (cook DestroyGLXPixmapCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetClientInfo2ARB -// setClientInfo2ARBRequest writes a SetClientInfo2ARB request to a byte slice. -func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { - size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) +// Write request to wire for DestroyGLXPixmap +// destroyGLXPixmapRequest writes a DestroyGLXPixmap request to a byte slice. +func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 35 // request opcode + buf[b] = 15 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], MajorVersion) + xgb.Put32(buf[b:], uint32(GlxPixmap)) b += 4 - xgb.Put32(buf[b:], MinorVersion) - b += 4 - - xgb.Put32(buf[b:], NumVersions) - b += 4 - - xgb.Put32(buf[b:], GlStrLen) - b += 4 - - xgb.Put32(buf[b:], GlxStrLen) - b += 4 - - for i := 0; i < int((int(NumVersions) * 3)); i++ { - xgb.Put32(buf[b:], GlVersions[i]) - b += 4 - } - b = xgb.Pad(b) - - copy(buf[b:], GlExtensionString[:GlStrLen]) - b += xgb.Pad(int(GlStrLen)) - - copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += xgb.Pad(int(GlxStrLen)) - return buf } -// NewListCookie is a cookie used only for NewList requests. -type NewListCookie struct { +// DestroyPbufferCookie is a cookie used only for DestroyPbuffer requests. +type DestroyPbufferCookie struct { *xgb.Cookie } -// NewList sends an unchecked request. +// DestroyPbuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { +func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) - return NewListCookie{cookie} + c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) + return DestroyPbufferCookie{cookie} } -// NewListChecked sends a checked request. -// If an error occurs, it can be retrieved using NewListCookie.Check() -func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { +// DestroyPbufferChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyPbufferCookie.Check() +func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) - return NewListCookie{cookie} + c.NewRequest(destroyPbufferRequest(c, Pbuffer), cookie) + return DestroyPbufferCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook NewListCookie) Check() error { +func (cook DestroyPbufferCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for NewList -// newListRequest writes a NewList request to a byte slice. -func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) []byte { - size := 16 +// Write request to wire for DestroyPbuffer +// destroyPbufferRequest writes a DestroyPbuffer request to a byte slice. +func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 101 // request opcode + buf[b] = 28 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(ContextTag)) + xgb.Put32(buf[b:], uint32(Pbuffer)) b += 4 - xgb.Put32(buf[b:], List) - b += 4 + return buf +} - xgb.Put32(buf[b:], Mode) +// DestroyPixmapCookie is a cookie used only for DestroyPixmap requests. +type DestroyPixmapCookie struct { + *xgb.Cookie +} + +// DestroyPixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) + return DestroyPixmapCookie{cookie} +} + +// DestroyPixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyPixmapCookie.Check() +func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyPixmapRequest(c, GlxPixmap), cookie) + return DestroyPixmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyPixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyPixmap +// destroyPixmapRequest writes a DestroyPixmap request to a byte slice. +func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GlxPixmap)) b += 4 return buf @@ -3678,42 +2242,42 @@ func endListRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } -// DeleteListsCookie is a cookie used only for DeleteLists requests. -type DeleteListsCookie struct { +// FeedbackBufferCookie is a cookie used only for FeedbackBuffer requests. +type FeedbackBufferCookie struct { *xgb.Cookie } -// DeleteLists sends an unchecked request. +// FeedbackBuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { +func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) - return DeleteListsCookie{cookie} + c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) + return FeedbackBufferCookie{cookie} } -// DeleteListsChecked sends a checked request. -// If an error occurs, it can be retrieved using DeleteListsCookie.Check() -func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { +// FeedbackBufferChecked sends a checked request. +// If an error occurs, it can be retrieved using FeedbackBufferCookie.Check() +func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(deleteListsRequest(c, ContextTag, List, Range), cookie) - return DeleteListsCookie{cookie} + c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) + return FeedbackBufferCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeleteListsCookie) Check() error { +func (cook FeedbackBufferCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DeleteLists -// deleteListsRequest writes a DeleteLists request to a byte slice. -func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) []byte { +// Write request to wire for FeedbackBuffer +// feedbackBufferRequest writes a FeedbackBuffer request to a byte slice. +func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -3721,7 +2285,7 @@ func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range i buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 103 // request opcode + buf[b] = 105 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -3730,10 +2294,149 @@ func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range i xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 - xgb.Put32(buf[b:], List) + xgb.Put32(buf[b:], uint32(Size)) b += 4 - xgb.Put32(buf[b:], uint32(Range)) + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + return buf +} + +// FinishCookie is a cookie used only for Finish requests. +type FinishCookie struct { + *xgb.Cookie +} + +// Finish sends a checked request. +// If an error occurs, it will be returned with the reply by calling FinishCookie.Reply() +func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(finishRequest(c, ContextTag), cookie) + return FinishCookie{cookie} +} + +// FinishUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(finishRequest(c, ContextTag), cookie) + return FinishCookie{cookie} +} + +// FinishReply represents the data returned from a Finish request. +type FinishReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes +} + +// Reply blocks and returns the reply data for a Finish request. +func (cook FinishCookie) Reply() (*FinishReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return finishReply(buf), nil +} + +// finishReply reads a byte slice into a FinishReply value. +func finishReply(buf []byte) *FinishReply { + v := new(FinishReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for Finish +// finishRequest writes a Finish request to a byte slice. +func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 108 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// FlushCookie is a cookie used only for Flush requests. +type FlushCookie struct { + *xgb.Cookie +} + +// Flush sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(flushRequest(c, ContextTag), cookie) + return FlushCookie{cookie} +} + +// FlushChecked sends a checked request. +// If an error occurs, it can be retrieved using FlushCookie.Check() +func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(flushRequest(c, ContextTag), cookie) + return FlushCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FlushCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Flush +// flushRequest writes a Flush request to a byte slice. +func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 142 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 return buf @@ -3830,479 +2533,44 @@ func genListsRequest(c *xgb.Conn, ContextTag ContextTag, Range int32) []byte { return buf } -// FeedbackBufferCookie is a cookie used only for FeedbackBuffer requests. -type FeedbackBufferCookie struct { +// GenQueriesARBCookie is a cookie used only for GenQueriesARB requests. +type GenQueriesARBCookie struct { *xgb.Cookie } -// FeedbackBuffer sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { +// GenQueriesARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GenQueriesARBCookie.Reply() +func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) - return FeedbackBufferCookie{cookie} -} - -// FeedbackBufferChecked sends a checked request. -// If an error occurs, it can be retrieved using FeedbackBufferCookie.Check() -func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(feedbackBufferRequest(c, ContextTag, Size, Type), cookie) - return FeedbackBufferCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FeedbackBufferCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FeedbackBuffer -// feedbackBufferRequest writes a FeedbackBuffer request to a byte slice. -func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 105 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(Size)) - b += 4 - - xgb.Put32(buf[b:], uint32(Type)) - b += 4 - - return buf -} - -// SelectBufferCookie is a cookie used only for SelectBuffer requests. -type SelectBufferCookie struct { - *xgb.Cookie -} - -// SelectBuffer sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) - return SelectBufferCookie{cookie} -} - -// SelectBufferChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectBufferCookie.Check() -func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) - return SelectBufferCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectBufferCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectBuffer -// selectBufferRequest writes a SelectBuffer request to a byte slice. -func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 106 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(Size)) - b += 4 - - return buf -} - -// RenderModeCookie is a cookie used only for RenderMode requests. -type RenderModeCookie struct { - *xgb.Cookie -} - -// RenderMode sends a checked request. -// If an error occurs, it will be returned with the reply by calling RenderModeCookie.Reply() -func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) - return RenderModeCookie{cookie} + c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) + return GenQueriesARBCookie{cookie} } -// RenderModeUnchecked sends an unchecked request. +// GenQueriesARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { +func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) - return RenderModeCookie{cookie} + c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) + return GenQueriesARBCookie{cookie} } -// RenderModeReply represents the data returned from a RenderMode request. -type RenderModeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - RetVal uint32 - N uint32 - NewMode uint32 - // padding: 12 bytes - Data []uint32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a RenderMode request. -func (cook RenderModeCookie) Reply() (*RenderModeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return renderModeReply(buf), nil -} - -// renderModeReply reads a byte slice into a RenderModeReply value. -func renderModeReply(buf []byte) *RenderModeReply { - v := new(RenderModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = xgb.Get32(buf[b:]) - b += 4 - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.NewMode = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]uint32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for RenderMode -// renderModeRequest writes a RenderMode request to a byte slice. -func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 107 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Mode) - b += 4 - - return buf -} - -// FinishCookie is a cookie used only for Finish requests. -type FinishCookie struct { - *xgb.Cookie -} - -// Finish sends a checked request. -// If an error occurs, it will be returned with the reply by calling FinishCookie.Reply() -func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(finishRequest(c, ContextTag), cookie) - return FinishCookie{cookie} -} - -// FinishUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(finishRequest(c, ContextTag), cookie) - return FinishCookie{cookie} -} - -// FinishReply represents the data returned from a Finish request. -type FinishReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes -} - -// Reply blocks and returns the reply data for a Finish request. -func (cook FinishCookie) Reply() (*FinishReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return finishReply(buf), nil -} - -// finishReply reads a byte slice into a FinishReply value. -func finishReply(buf []byte) *FinishReply { - v := new(FinishReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -// Write request to wire for Finish -// finishRequest writes a Finish request to a byte slice. -func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 108 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// PixelStorefCookie is a cookie used only for PixelStoref requests. -type PixelStorefCookie struct { - *xgb.Cookie -} - -// PixelStoref sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) - return PixelStorefCookie{cookie} -} - -// PixelStorefChecked sends a checked request. -// If an error occurs, it can be retrieved using PixelStorefCookie.Check() -func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) - return PixelStorefCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PixelStorefCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PixelStoref -// pixelStorefRequest writes a PixelStoref request to a byte slice. -func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 109 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - xgb.Put32(buf[b:], uint32(Datum)) - b += 4 - - return buf -} - -// PixelStoreiCookie is a cookie used only for PixelStorei requests. -type PixelStoreiCookie struct { - *xgb.Cookie -} - -// PixelStorei sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) - return PixelStoreiCookie{cookie} -} - -// PixelStoreiChecked sends a checked request. -// If an error occurs, it can be retrieved using PixelStoreiCookie.Check() -func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) - return PixelStoreiCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PixelStoreiCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PixelStorei -// pixelStoreiRequest writes a PixelStorei request to a byte slice. -func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 110 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - xgb.Put32(buf[b:], uint32(Datum)) - b += 4 - - return buf -} - -// ReadPixelsCookie is a cookie used only for ReadPixels requests. -type ReadPixelsCookie struct { - *xgb.Cookie -} - -// ReadPixels sends a checked request. -// If an error occurs, it will be returned with the reply by calling ReadPixelsCookie.Reply() -func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) - return ReadPixelsCookie{cookie} -} - -// ReadPixelsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) - return ReadPixelsCookie{cookie} -} - -// ReadPixelsReply represents the data returned from a ReadPixels request. -type ReadPixelsReply struct { +// GenQueriesARBReply represents the data returned from a GenQueriesARB request. +type GenQueriesARBReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) + Data []uint32 // size: xgb.Pad((int(Length) * 4)) } -// Reply blocks and returns the reply data for a ReadPixels request. -func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { +// Reply blocks and returns the reply data for a GenQueriesARB request. +func (cook GenQueriesARBCookie) Reply() (*GenQueriesARBReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -4310,12 +2578,12 @@ func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { if buf == nil { return nil, nil } - return readPixelsReply(buf), nil + return genQueriesARBReply(buf), nil } -// readPixelsReply reads a byte slice into a ReadPixelsReply value. -func readPixelsReply(buf []byte) *ReadPixelsReply { - v := new(ReadPixelsReply) +// genQueriesARBReply reads a byte slice into a GenQueriesARBReply value. +func genQueriesARBReply(buf []byte) *GenQueriesARBReply { + v := new(GenQueriesARBReply) b := 1 // skip reply determinant b += 1 // padding @@ -4328,24 +2596,27 @@ func readPixelsReply(buf []byte) *ReadPixelsReply { b += 24 // padding - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) return v } -// Write request to wire for ReadPixels -// readPixelsRequest writes a ReadPixels request to a byte slice. -func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { - size := 36 +// Write request to wire for GenQueriesARB +// genQueriesARBRequest writes a GenQueriesARB request to a byte slice. +func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 111 // request opcode + buf[b] = 162 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -4354,38 +2625,107 @@ func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Wid xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 - xgb.Put32(buf[b:], uint32(X)) + xgb.Put32(buf[b:], uint32(N)) b += 4 - xgb.Put32(buf[b:], uint32(Y)) - b += 4 + return buf +} - xgb.Put32(buf[b:], uint32(Width)) - b += 4 +// GenTexturesCookie is a cookie used only for GenTextures requests. +type GenTexturesCookie struct { + *xgb.Cookie +} - xgb.Put32(buf[b:], uint32(Height)) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 +// GenTextures sends a checked request. +// If an error occurs, it will be returned with the reply by calling GenTexturesCookie.Reply() +func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } + cookie := c.NewCookie(true, true) + c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) + return GenTexturesCookie{cookie} +} + +// GenTexturesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) + return GenTexturesCookie{cookie} +} + +// GenTexturesReply represents the data returned from a GenTextures request. +type GenTexturesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 24 bytes + Data []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a GenTextures request. +func (cook GenTexturesCookie) Reply() (*GenTexturesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return genTexturesReply(buf), nil +} + +// genTexturesReply reads a byte slice into a GenTexturesReply value. +func genTexturesReply(buf []byte) *GenTexturesReply { + v := new(GenTexturesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GenTextures +// genTexturesRequest writes a GenTextures request to a byte slice. +func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] b += 1 - if LsbFirst { - buf[b] = 1 - } else { - buf[b] = 0 - } + buf[b] = 145 // request opcode b += 1 + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(N)) + b += 4 + return buf } @@ -4604,6 +2944,793 @@ func getClipPlaneRequest(c *xgb.Conn, ContextTag ContextTag, Plane int32) []byte return buf } +// GetColorTableCookie is a cookie used only for GetColorTable requests. +type GetColorTableCookie struct { + *xgb.Cookie +} + +// GetColorTable sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableCookie.Reply() +func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetColorTableCookie{cookie} +} + +// GetColorTableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetColorTableCookie{cookie} +} + +// GetColorTableReply represents the data returned from a GetColorTable request. +type GetColorTableReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetColorTable request. +func (cook GetColorTableCookie) Reply() (*GetColorTableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableReply(buf), nil +} + +// getColorTableReply reads a byte slice into a GetColorTableReply value. +func getColorTableReply(buf []byte) *GetColorTableReply { + v := new(GetColorTableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetColorTable +// getColorTableRequest writes a GetColorTable request to a byte slice. +func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 147 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// GetColorTableParameterfvCookie is a cookie used only for GetColorTableParameterfv requests. +type GetColorTableParameterfvCookie struct { + *xgb.Cookie +} + +// GetColorTableParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableParameterfvCookie.Reply() +func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterfvCookie{cookie} +} + +// GetColorTableParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterfvCookie{cookie} +} + +// GetColorTableParameterfvReply represents the data returned from a GetColorTableParameterfv request. +type GetColorTableParameterfvReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetColorTableParameterfv request. +func (cook GetColorTableParameterfvCookie) Reply() (*GetColorTableParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableParameterfvReply(buf), nil +} + +// getColorTableParameterfvReply reads a byte slice into a GetColorTableParameterfvReply value. +func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { + v := new(GetColorTableParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetColorTableParameterfv +// getColorTableParameterfvRequest writes a GetColorTableParameterfv request to a byte slice. +func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 148 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetColorTableParameterivCookie is a cookie used only for GetColorTableParameteriv requests. +type GetColorTableParameterivCookie struct { + *xgb.Cookie +} + +// GetColorTableParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetColorTableParameterivCookie.Reply() +func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterivCookie{cookie} +} + +// GetColorTableParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetColorTableParameterivCookie{cookie} +} + +// GetColorTableParameterivReply represents the data returned from a GetColorTableParameteriv request. +type GetColorTableParameterivReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetColorTableParameteriv request. +func (cook GetColorTableParameterivCookie) Reply() (*GetColorTableParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getColorTableParameterivReply(buf), nil +} + +// getColorTableParameterivReply reads a byte slice into a GetColorTableParameterivReply value. +func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { + v := new(GetColorTableParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetColorTableParameteriv +// getColorTableParameterivRequest writes a GetColorTableParameteriv request to a byte slice. +func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 149 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetCompressedTexImageARBCookie is a cookie used only for GetCompressedTexImageARB requests. +type GetCompressedTexImageARBCookie struct { + *xgb.Cookie +} + +// GetCompressedTexImageARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCompressedTexImageARBCookie.Reply() +func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) + return GetCompressedTexImageARBCookie{cookie} +} + +// GetCompressedTexImageARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) + return GetCompressedTexImageARBCookie{cookie} +} + +// GetCompressedTexImageARBReply represents the data returned from a GetCompressedTexImageARB request. +type GetCompressedTexImageARBReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 8 bytes + Size int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetCompressedTexImageARB request. +func (cook GetCompressedTexImageARBCookie) Reply() (*GetCompressedTexImageARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCompressedTexImageARBReply(buf), nil +} + +// getCompressedTexImageARBReply reads a byte slice into a GetCompressedTexImageARBReply value. +func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { + v := new(GetCompressedTexImageARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Size = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetCompressedTexImageARB +// getCompressedTexImageARBRequest writes a GetCompressedTexImageARB request to a byte slice. +func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 160 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], uint32(Level)) + b += 4 + + return buf +} + +// GetConvolutionFilterCookie is a cookie used only for GetConvolutionFilter requests. +type GetConvolutionFilterCookie struct { + *xgb.Cookie +} + +// GetConvolutionFilter sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionFilterCookie.Reply() +func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetConvolutionFilterCookie{cookie} +} + +// GetConvolutionFilterUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetConvolutionFilterCookie{cookie} +} + +// GetConvolutionFilterReply represents the data returned from a GetConvolutionFilter request. +type GetConvolutionFilterReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 8 bytes + Width int32 + Height int32 + // padding: 8 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetConvolutionFilter request. +func (cook GetConvolutionFilterCookie) Reply() (*GetConvolutionFilterReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionFilterReply(buf), nil +} + +// getConvolutionFilterReply reads a byte slice into a GetConvolutionFilterReply value. +func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { + v := new(GetConvolutionFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Height = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetConvolutionFilter +// getConvolutionFilterRequest writes a GetConvolutionFilter request to a byte slice. +func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 150 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// GetConvolutionParameterfvCookie is a cookie used only for GetConvolutionParameterfv requests. +type GetConvolutionParameterfvCookie struct { + *xgb.Cookie +} + +// GetConvolutionParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterfvCookie.Reply() +func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterfvCookie{cookie} +} + +// GetConvolutionParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterfvCookie{cookie} +} + +// GetConvolutionParameterfvReply represents the data returned from a GetConvolutionParameterfv request. +type GetConvolutionParameterfvReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetConvolutionParameterfv request. +func (cook GetConvolutionParameterfvCookie) Reply() (*GetConvolutionParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionParameterfvReply(buf), nil +} + +// getConvolutionParameterfvReply reads a byte slice into a GetConvolutionParameterfvReply value. +func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply { + v := new(GetConvolutionParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetConvolutionParameterfv +// getConvolutionParameterfvRequest writes a GetConvolutionParameterfv request to a byte slice. +func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 151 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetConvolutionParameterivCookie is a cookie used only for GetConvolutionParameteriv requests. +type GetConvolutionParameterivCookie struct { + *xgb.Cookie +} + +// GetConvolutionParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterivCookie.Reply() +func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterivCookie{cookie} +} + +// GetConvolutionParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetConvolutionParameterivCookie{cookie} +} + +// GetConvolutionParameterivReply represents the data returned from a GetConvolutionParameteriv request. +type GetConvolutionParameterivReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetConvolutionParameteriv request. +func (cook GetConvolutionParameterivCookie) Reply() (*GetConvolutionParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getConvolutionParameterivReply(buf), nil +} + +// getConvolutionParameterivReply reads a byte slice into a GetConvolutionParameterivReply value. +func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply { + v := new(GetConvolutionParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetConvolutionParameteriv +// getConvolutionParameterivRequest writes a GetConvolutionParameteriv request to a byte slice. +func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 152 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + // GetDoublevCookie is a cookie used only for GetDoublev requests. type GetDoublevCookie struct { *xgb.Cookie @@ -4713,6 +3840,105 @@ func getDoublevRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte return buf } +// GetDrawableAttributesCookie is a cookie used only for GetDrawableAttributes requests. +type GetDrawableAttributesCookie struct { + *xgb.Cookie +} + +// GetDrawableAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDrawableAttributesCookie.Reply() +func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) + return GetDrawableAttributesCookie{cookie} +} + +// GetDrawableAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDrawableAttributesRequest(c, Drawable), cookie) + return GetDrawableAttributesCookie{cookie} +} + +// GetDrawableAttributesReply represents the data returned from a GetDrawableAttributes request. +type GetDrawableAttributesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) +} + +// Reply blocks and returns the reply data for a GetDrawableAttributes request. +func (cook GetDrawableAttributesCookie) Reply() (*GetDrawableAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDrawableAttributesReply(buf), nil +} + +// getDrawableAttributesReply reads a byte slice into a GetDrawableAttributesReply value. +func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { + v := new(GetDrawableAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDrawableAttributes +// getDrawableAttributesRequest writes a GetDrawableAttributes request to a byte slice. +func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 29 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + // GetErrorCookie is a cookie used only for GetError requests. type GetErrorCookie struct { *xgb.Cookie @@ -4801,6 +4027,109 @@ func getErrorRequest(c *xgb.Conn, ContextTag ContextTag) []byte { return buf } +// GetFBConfigsCookie is a cookie used only for GetFBConfigs requests. +type GetFBConfigsCookie struct { + *xgb.Cookie +} + +// GetFBConfigs sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFBConfigsCookie.Reply() +func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getFBConfigsRequest(c, Screen), cookie) + return GetFBConfigsCookie{cookie} +} + +// GetFBConfigsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getFBConfigsRequest(c, Screen), cookie) + return GetFBConfigsCookie{cookie} +} + +// GetFBConfigsReply represents the data returned from a GetFBConfigs request. +type GetFBConfigsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumFbConfigs uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a GetFBConfigs request. +func (cook GetFBConfigsCookie) Reply() (*GetFBConfigsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFBConfigsReply(buf), nil +} + +// getFBConfigsReply reads a byte slice into a GetFBConfigsReply value. +func getFBConfigsReply(buf []byte) *GetFBConfigsReply { + v := new(GetFBConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFbConfigs = xgb.Get32(buf[b:]) + b += 4 + + v.NumProperties = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetFBConfigs +// getFBConfigsRequest writes a GetFBConfigs request to a byte slice. +func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + // GetFloatvCookie is a cookie used only for GetFloatv requests. type GetFloatvCookie struct { *xgb.Cookie @@ -4910,6 +4239,352 @@ func getFloatvRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { return buf } +// GetHistogramCookie is a cookie used only for GetHistogram requests. +type GetHistogramCookie struct { + *xgb.Cookie +} + +// GetHistogram sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramCookie.Reply() +func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetHistogramCookie{cookie} +} + +// GetHistogramUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetHistogramCookie{cookie} +} + +// GetHistogramReply represents the data returned from a GetHistogram request. +type GetHistogramReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 8 bytes + Width int32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetHistogram request. +func (cook GetHistogramCookie) Reply() (*GetHistogramReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramReply(buf), nil +} + +// getHistogramReply reads a byte slice into a GetHistogramReply value. +func getHistogramReply(buf []byte) *GetHistogramReply { + v := new(GetHistogramReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetHistogram +// getHistogramRequest writes a GetHistogram request to a byte slice. +func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 154 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// GetHistogramParameterfvCookie is a cookie used only for GetHistogramParameterfv requests. +type GetHistogramParameterfvCookie struct { + *xgb.Cookie +} + +// GetHistogramParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramParameterfvCookie.Reply() +func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterfvCookie{cookie} +} + +// GetHistogramParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterfvCookie{cookie} +} + +// GetHistogramParameterfvReply represents the data returned from a GetHistogramParameterfv request. +type GetHistogramParameterfvReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetHistogramParameterfv request. +func (cook GetHistogramParameterfvCookie) Reply() (*GetHistogramParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramParameterfvReply(buf), nil +} + +// getHistogramParameterfvReply reads a byte slice into a GetHistogramParameterfvReply value. +func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { + v := new(GetHistogramParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetHistogramParameterfv +// getHistogramParameterfvRequest writes a GetHistogramParameterfv request to a byte slice. +func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 155 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetHistogramParameterivCookie is a cookie used only for GetHistogramParameteriv requests. +type GetHistogramParameterivCookie struct { + *xgb.Cookie +} + +// GetHistogramParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetHistogramParameterivCookie.Reply() +func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterivCookie{cookie} +} + +// GetHistogramParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetHistogramParameterivCookie{cookie} +} + +// GetHistogramParameterivReply represents the data returned from a GetHistogramParameteriv request. +type GetHistogramParameterivReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetHistogramParameteriv request. +func (cook GetHistogramParameterivCookie) Reply() (*GetHistogramParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getHistogramParameterivReply(buf), nil +} + +// getHistogramParameterivReply reads a byte slice into a GetHistogramParameterivReply value. +func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { + v := new(GetHistogramParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetHistogramParameteriv +// getHistogramParameterivRequest writes a GetHistogramParameteriv request to a byte slice. +func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 156 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + // GetIntegervCookie is a cookie used only for GetIntegerv requests. type GetIntegervCookie struct { *xgb.Cookie @@ -5803,6 +5478,345 @@ func getMaterialivRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname return buf } +// GetMinmaxCookie is a cookie used only for GetMinmax requests. +type GetMinmaxCookie struct { + *xgb.Cookie +} + +// GetMinmax sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxCookie.Reply() +func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetMinmaxCookie{cookie} +} + +// GetMinmaxUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) + return GetMinmaxCookie{cookie} +} + +// GetMinmaxReply represents the data returned from a GetMinmax request. +type GetMinmaxReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetMinmax request. +func (cook GetMinmaxCookie) Reply() (*GetMinmaxReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxReply(buf), nil +} + +// getMinmaxReply reads a byte slice into a GetMinmaxReply value. +func getMinmaxReply(buf []byte) *GetMinmaxReply { + v := new(GetMinmaxReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetMinmax +// getMinmaxRequest writes a GetMinmax request to a byte slice. +func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 157 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Reset { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// GetMinmaxParameterfvCookie is a cookie used only for GetMinmaxParameterfv requests. +type GetMinmaxParameterfvCookie struct { + *xgb.Cookie +} + +// GetMinmaxParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterfvCookie.Reply() +func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterfvCookie{cookie} +} + +// GetMinmaxParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterfvCookie{cookie} +} + +// GetMinmaxParameterfvReply represents the data returned from a GetMinmaxParameterfv request. +type GetMinmaxParameterfvReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetMinmaxParameterfv request. +func (cook GetMinmaxParameterfvCookie) Reply() (*GetMinmaxParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxParameterfvReply(buf), nil +} + +// getMinmaxParameterfvReply reads a byte slice into a GetMinmaxParameterfvReply value. +func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { + v := new(GetMinmaxParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMinmaxParameterfv +// getMinmaxParameterfvRequest writes a GetMinmaxParameterfv request to a byte slice. +func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 158 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetMinmaxParameterivCookie is a cookie used only for GetMinmaxParameteriv requests. +type GetMinmaxParameterivCookie struct { + *xgb.Cookie +} + +// GetMinmaxParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterivCookie.Reply() +func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterivCookie{cookie} +} + +// GetMinmaxParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetMinmaxParameterivCookie{cookie} +} + +// GetMinmaxParameterivReply represents the data returned from a GetMinmaxParameteriv request. +type GetMinmaxParameterivReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetMinmaxParameteriv request. +func (cook GetMinmaxParameterivCookie) Reply() (*GetMinmaxParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMinmaxParameterivReply(buf), nil +} + +// getMinmaxParameterivReply reads a byte slice into a GetMinmaxParameterivReply value. +func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { + v := new(GetMinmaxParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetMinmaxParameteriv +// getMinmaxParameterivRequest writes a GetMinmaxParameteriv request to a byte slice. +func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 159 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + // GetPixelMapfvCookie is a cookie used only for GetPixelMapfv requests. type GetPixelMapfvCookie struct { *xgb.Cookie @@ -6229,6 +6243,461 @@ func getPolygonStippleRequest(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) return buf } +// GetQueryObjectivARBCookie is a cookie used only for GetQueryObjectivARB requests. +type GetQueryObjectivARBCookie struct { + *xgb.Cookie +} + +// GetQueryObjectivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryObjectivARBCookie.Reply() +func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectivARBCookie{cookie} +} + +// GetQueryObjectivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectivARBCookie{cookie} +} + +// GetQueryObjectivARBReply represents the data returned from a GetQueryObjectivARB request. +type GetQueryObjectivARBReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetQueryObjectivARB request. +func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryObjectivARBReply(buf), nil +} + +// getQueryObjectivARBReply reads a byte slice into a GetQueryObjectivARBReply value. +func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { + v := new(GetQueryObjectivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryObjectivARB +// getQueryObjectivARBRequest writes a GetQueryObjectivARB request to a byte slice. +func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 165 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetQueryObjectuivARBCookie is a cookie used only for GetQueryObjectuivARB requests. +type GetQueryObjectuivARBCookie struct { + *xgb.Cookie +} + +// GetQueryObjectuivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryObjectuivARBCookie.Reply() +func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectuivARBCookie{cookie} +} + +// GetQueryObjectuivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) + return GetQueryObjectuivARBCookie{cookie} +} + +// GetQueryObjectuivARBReply represents the data returned from a GetQueryObjectuivARB request. +type GetQueryObjectuivARBReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum uint32 + // padding: 12 bytes + Data []uint32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetQueryObjectuivARB request. +func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryObjectuivARBReply(buf), nil +} + +// getQueryObjectuivARBReply reads a byte slice into a GetQueryObjectuivARBReply value. +func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { + v := new(GetQueryObjectuivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]uint32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryObjectuivARB +// getQueryObjectuivARBRequest writes a GetQueryObjectuivARB request to a byte slice. +func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 166 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetQueryivARBCookie is a cookie used only for GetQueryivARB requests. +type GetQueryivARBCookie struct { + *xgb.Cookie +} + +// GetQueryivARB sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetQueryivARBCookie.Reply() +func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) + return GetQueryivARBCookie{cookie} +} + +// GetQueryivARBUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) + return GetQueryivARBCookie{cookie} +} + +// GetQueryivARBReply represents the data returned from a GetQueryivARB request. +type GetQueryivARBReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetQueryivARB request. +func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getQueryivARBReply(buf), nil +} + +// getQueryivARBReply reads a byte slice into a GetQueryivARBReply value. +func getQueryivARBReply(buf []byte) *GetQueryivARBReply { + v := new(GetQueryivARBReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetQueryivARB +// getQueryivARBRequest writes a GetQueryivARB request to a byte slice. +func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 164 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetSeparableFilterCookie is a cookie used only for GetSeparableFilter requests. +type GetSeparableFilterCookie struct { + *xgb.Cookie +} + +// GetSeparableFilter sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSeparableFilterCookie.Reply() +func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetSeparableFilterCookie{cookie} +} + +// GetSeparableFilterUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) + return GetSeparableFilterCookie{cookie} +} + +// GetSeparableFilterReply represents the data returned from a GetSeparableFilter request. +type GetSeparableFilterReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 8 bytes + RowW int32 + ColH int32 + // padding: 8 bytes + RowsAndCols []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetSeparableFilter request. +func (cook GetSeparableFilterCookie) Reply() (*GetSeparableFilterReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSeparableFilterReply(buf), nil +} + +// getSeparableFilterReply reads a byte slice into a GetSeparableFilterReply value. +func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { + v := new(GetSeparableFilterReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 8 // padding + + v.RowW = int32(xgb.Get32(buf[b:])) + b += 4 + + v.ColH = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 8 // padding + + v.RowsAndCols = make([]byte, (int(v.Length) * 4)) + copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetSeparableFilter +// getSeparableFilterRequest writes a GetSeparableFilter request to a byte slice. +func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 153 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + // GetStringCookie is a cookie used only for GetString requests. type GetStringCookie struct { *xgb.Cookie @@ -7020,230 +7489,6 @@ func getTexImageRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level return buf } -// GetTexParameterfvCookie is a cookie used only for GetTexParameterfv requests. -type GetTexParameterfvCookie struct { - *xgb.Cookie -} - -// GetTexParameterfv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetTexParameterfvCookie.Reply() -func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetTexParameterfvCookie{cookie} -} - -// GetTexParameterfvUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetTexParameterfvCookie{cookie} -} - -// GetTexParameterfvReply represents the data returned from a GetTexParameterfv request. -type GetTexParameterfvReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum Float32 - // padding: 12 bytes - Data []Float32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetTexParameterfv request. -func (cook GetTexParameterfvCookie) Reply() (*GetTexParameterfvReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getTexParameterfvReply(buf), nil -} - -// getTexParameterfvReply reads a byte slice into a GetTexParameterfvReply value. -func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { - v := new(GetTexParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = Float32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]Float32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Float32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetTexParameterfv -// getTexParameterfvRequest writes a GetTexParameterfv request to a byte slice. -func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 136 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetTexParameterivCookie is a cookie used only for GetTexParameteriv requests. -type GetTexParameterivCookie struct { - *xgb.Cookie -} - -// GetTexParameteriv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetTexParameterivCookie.Reply() -func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetTexParameterivCookie{cookie} -} - -// GetTexParameterivUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetTexParameterivCookie{cookie} -} - -// GetTexParameterivReply represents the data returned from a GetTexParameteriv request. -type GetTexParameterivReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetTexParameteriv request. -func (cook GetTexParameterivCookie) Reply() (*GetTexParameterivReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getTexParameterivReply(buf), nil -} - -// getTexParameterivReply reads a byte slice into a GetTexParameterivReply value. -func getTexParameterivReply(buf []byte) *GetTexParameterivReply { - v := new(GetTexParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetTexParameteriv -// getTexParameterivRequest writes a GetTexParameteriv request to a byte slice. -func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 137 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - // GetTexLevelParameterfvCookie is a cookie used only for GetTexLevelParameterfv requests. type GetTexLevelParameterfvCookie struct { *xgb.Cookie @@ -7474,6 +7719,428 @@ func getTexLevelParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target ui return buf } +// GetTexParameterfvCookie is a cookie used only for GetTexParameterfv requests. +type GetTexParameterfvCookie struct { + *xgb.Cookie +} + +// GetTexParameterfv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexParameterfvCookie.Reply() +func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterfvCookie{cookie} +} + +// GetTexParameterfvUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getTexParameterfvRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterfvCookie{cookie} +} + +// GetTexParameterfvReply represents the data returned from a GetTexParameterfv request. +type GetTexParameterfvReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum Float32 + // padding: 12 bytes + Data []Float32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetTexParameterfv request. +func (cook GetTexParameterfvCookie) Reply() (*GetTexParameterfvReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexParameterfvReply(buf), nil +} + +// getTexParameterfvReply reads a byte slice into a GetTexParameterfvReply value. +func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { + v := new(GetTexParameterfvReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = Float32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]Float32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = Float32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexParameterfv +// getTexParameterfvRequest writes a GetTexParameterfv request to a byte slice. +func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 136 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetTexParameterivCookie is a cookie used only for GetTexParameteriv requests. +type GetTexParameterivCookie struct { + *xgb.Cookie +} + +// GetTexParameteriv sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetTexParameterivCookie.Reply() +func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterivCookie{cookie} +} + +// GetTexParameterivUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getTexParameterivRequest(c, ContextTag, Target, Pname), cookie) + return GetTexParameterivCookie{cookie} +} + +// GetTexParameterivReply represents the data returned from a GetTexParameteriv request. +type GetTexParameterivReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + Datum int32 + // padding: 12 bytes + Data []int32 // size: xgb.Pad((int(N) * 4)) +} + +// Reply blocks and returns the reply data for a GetTexParameteriv request. +func (cook GetTexParameterivCookie) Reply() (*GetTexParameterivReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getTexParameterivReply(buf), nil +} + +// getTexParameterivReply reads a byte slice into a GetTexParameterivReply value. +func getTexParameterivReply(buf []byte) *GetTexParameterivReply { + v := new(GetTexParameterivReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 4 // padding + + v.N = xgb.Get32(buf[b:]) + b += 4 + + v.Datum = int32(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + v.Data = make([]int32, v.N) + for i := 0; i < int(v.N); i++ { + v.Data[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetTexParameteriv +// getTexParameterivRequest writes a GetTexParameteriv request to a byte slice. +func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 137 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Target) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + return buf +} + +// GetVisualConfigsCookie is a cookie used only for GetVisualConfigs requests. +type GetVisualConfigsCookie struct { + *xgb.Cookie +} + +// GetVisualConfigs sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVisualConfigsCookie.Reply() +func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) + return GetVisualConfigsCookie{cookie} +} + +// GetVisualConfigsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getVisualConfigsRequest(c, Screen), cookie) + return GetVisualConfigsCookie{cookie} +} + +// GetVisualConfigsReply represents the data returned from a GetVisualConfigs request. +type GetVisualConfigsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumVisuals uint32 + NumProperties uint32 + // padding: 16 bytes + PropertyList []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a GetVisualConfigs request. +func (cook GetVisualConfigsCookie) Reply() (*GetVisualConfigsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVisualConfigsReply(buf), nil +} + +// getVisualConfigsReply reads a byte slice into a GetVisualConfigsReply value. +func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { + v := new(GetVisualConfigsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumVisuals = xgb.Get32(buf[b:]) + b += 4 + + v.NumProperties = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.PropertyList = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PropertyList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetVisualConfigs +// getVisualConfigsRequest writes a GetVisualConfigs request to a byte slice. +func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + return buf +} + +// IsDirectCookie is a cookie used only for IsDirect requests. +type IsDirectCookie struct { + *xgb.Cookie +} + +// IsDirect sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsDirectCookie.Reply() +func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(isDirectRequest(c, Context), cookie) + return IsDirectCookie{cookie} +} + +// IsDirectUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(isDirectRequest(c, Context), cookie) + return IsDirectCookie{cookie} +} + +// IsDirectReply represents the data returned from a IsDirect request. +type IsDirectReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + IsDirect bool + // padding: 23 bytes +} + +// Reply blocks and returns the reply data for a IsDirect request. +func (cook IsDirectCookie) Reply() (*IsDirectReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isDirectReply(buf), nil +} + +// isDirectReply reads a byte slice into a IsDirectReply value. +func isDirectReply(buf []byte) *IsDirectReply { + v := new(IsDirectReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.IsDirect = true + } else { + v.IsDirect = false + } + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for IsDirect +// isDirectRequest writes a IsDirect request to a byte slice. +func isDirectRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + // IsListCookie is a cookie used only for IsList requests. type IsListCookie struct { *xgb.Cookie @@ -7565,2179 +8232,6 @@ func isListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32) []byte { return buf } -// FlushCookie is a cookie used only for Flush requests. -type FlushCookie struct { - *xgb.Cookie -} - -// Flush sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(flushRequest(c, ContextTag), cookie) - return FlushCookie{cookie} -} - -// FlushChecked sends a checked request. -// If an error occurs, it can be retrieved using FlushCookie.Check() -func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(flushRequest(c, ContextTag), cookie) - return FlushCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FlushCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Flush -// flushRequest writes a Flush request to a byte slice. -func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 142 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - return buf -} - -// AreTexturesResidentCookie is a cookie used only for AreTexturesResident requests. -type AreTexturesResidentCookie struct { - *xgb.Cookie -} - -// AreTexturesResident sends a checked request. -// If an error occurs, it will be returned with the reply by calling AreTexturesResidentCookie.Reply() -func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) - return AreTexturesResidentCookie{cookie} -} - -// AreTexturesResidentUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(areTexturesResidentRequest(c, ContextTag, N, Textures), cookie) - return AreTexturesResidentCookie{cookie} -} - -// AreTexturesResidentReply represents the data returned from a AreTexturesResident request. -type AreTexturesResidentReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - RetVal Bool32 - // padding: 20 bytes - Data []bool // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a AreTexturesResident request. -func (cook AreTexturesResidentCookie) Reply() (*AreTexturesResidentReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return areTexturesResidentReply(buf), nil -} - -// areTexturesResidentReply reads a byte slice into a AreTexturesResidentReply value. -func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { - v := new(AreTexturesResidentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = Bool32(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding - - v.Data = make([]bool, (int(v.Length) * 4)) - for i := 0; i < int((int(v.Length) * 4)); i++ { - if buf[b] == 1 { - v.Data[i] = true - } else { - v.Data[i] = false - } - b += 1 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for AreTexturesResident -// areTexturesResidentRequest writes a AreTexturesResident request to a byte slice. -func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { - size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 143 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - xgb.Put32(buf[b:], Textures[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DeleteTexturesCookie is a cookie used only for DeleteTextures requests. -type DeleteTexturesCookie struct { - *xgb.Cookie -} - -// DeleteTextures sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) - return DeleteTexturesCookie{cookie} -} - -// DeleteTexturesChecked sends a checked request. -// If an error occurs, it can be retrieved using DeleteTexturesCookie.Check() -func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deleteTexturesRequest(c, ContextTag, N, Textures), cookie) - return DeleteTexturesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeleteTexturesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeleteTextures -// deleteTexturesRequest writes a DeleteTextures request to a byte slice. -func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) []byte { - size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 144 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - xgb.Put32(buf[b:], Textures[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GenTexturesCookie is a cookie used only for GenTextures requests. -type GenTexturesCookie struct { - *xgb.Cookie -} - -// GenTextures sends a checked request. -// If an error occurs, it will be returned with the reply by calling GenTexturesCookie.Reply() -func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) - return GenTexturesCookie{cookie} -} - -// GenTexturesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(genTexturesRequest(c, ContextTag, N), cookie) - return GenTexturesCookie{cookie} -} - -// GenTexturesReply represents the data returned from a GenTextures request. -type GenTexturesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 24 bytes - Data []uint32 // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GenTextures request. -func (cook GenTexturesCookie) Reply() (*GenTexturesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return genTexturesReply(buf), nil -} - -// genTexturesReply reads a byte slice into a GenTexturesReply value. -func genTexturesReply(buf []byte) *GenTexturesReply { - v := new(GenTexturesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Data[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GenTextures -// genTexturesRequest writes a GenTextures request to a byte slice. -func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 145 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(N)) - b += 4 - - return buf -} - -// IsTextureCookie is a cookie used only for IsTexture requests. -type IsTextureCookie struct { - *xgb.Cookie -} - -// IsTexture sends a checked request. -// If an error occurs, it will be returned with the reply by calling IsTextureCookie.Reply() -func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) - return IsTextureCookie{cookie} -} - -// IsTextureUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) - return IsTextureCookie{cookie} -} - -// IsTextureReply represents the data returned from a IsTexture request. -type IsTextureReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - RetVal Bool32 -} - -// Reply blocks and returns the reply data for a IsTexture request. -func (cook IsTextureCookie) Reply() (*IsTextureReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return isTextureReply(buf), nil -} - -// isTextureReply reads a byte slice into a IsTextureReply value. -func isTextureReply(buf []byte) *IsTextureReply { - v := new(IsTextureReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.RetVal = Bool32(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for IsTexture -// isTextureRequest writes a IsTexture request to a byte slice. -func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 146 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Texture) - b += 4 - - return buf -} - -// GetColorTableCookie is a cookie used only for GetColorTable requests. -type GetColorTableCookie struct { - *xgb.Cookie -} - -// GetColorTable sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetColorTableCookie.Reply() -func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetColorTableCookie{cookie} -} - -// GetColorTableUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getColorTableRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetColorTableCookie{cookie} -} - -// GetColorTableReply represents the data returned from a GetColorTable request. -type GetColorTableReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 8 bytes - Width int32 - // padding: 12 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetColorTable request. -func (cook GetColorTableCookie) Reply() (*GetColorTableReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getColorTableReply(buf), nil -} - -// getColorTableReply reads a byte slice into a GetColorTableReply value. -func getColorTableReply(buf []byte) *GetColorTableReply { - v := new(GetColorTableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetColorTable -// getColorTableRequest writes a GetColorTable request to a byte slice. -func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 147 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetColorTableParameterfvCookie is a cookie used only for GetColorTableParameterfv requests. -type GetColorTableParameterfvCookie struct { - *xgb.Cookie -} - -// GetColorTableParameterfv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetColorTableParameterfvCookie.Reply() -func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetColorTableParameterfvCookie{cookie} -} - -// GetColorTableParameterfvUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getColorTableParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetColorTableParameterfvCookie{cookie} -} - -// GetColorTableParameterfvReply represents the data returned from a GetColorTableParameterfv request. -type GetColorTableParameterfvReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum Float32 - // padding: 12 bytes - Data []Float32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetColorTableParameterfv request. -func (cook GetColorTableParameterfvCookie) Reply() (*GetColorTableParameterfvReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getColorTableParameterfvReply(buf), nil -} - -// getColorTableParameterfvReply reads a byte slice into a GetColorTableParameterfvReply value. -func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { - v := new(GetColorTableParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = Float32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]Float32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Float32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetColorTableParameterfv -// getColorTableParameterfvRequest writes a GetColorTableParameterfv request to a byte slice. -func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 148 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetColorTableParameterivCookie is a cookie used only for GetColorTableParameteriv requests. -type GetColorTableParameterivCookie struct { - *xgb.Cookie -} - -// GetColorTableParameteriv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetColorTableParameterivCookie.Reply() -func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetColorTableParameterivCookie{cookie} -} - -// GetColorTableParameterivUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getColorTableParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetColorTableParameterivCookie{cookie} -} - -// GetColorTableParameterivReply represents the data returned from a GetColorTableParameteriv request. -type GetColorTableParameterivReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetColorTableParameteriv request. -func (cook GetColorTableParameterivCookie) Reply() (*GetColorTableParameterivReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getColorTableParameterivReply(buf), nil -} - -// getColorTableParameterivReply reads a byte slice into a GetColorTableParameterivReply value. -func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { - v := new(GetColorTableParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetColorTableParameteriv -// getColorTableParameterivRequest writes a GetColorTableParameteriv request to a byte slice. -func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 149 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetConvolutionFilterCookie is a cookie used only for GetConvolutionFilter requests. -type GetConvolutionFilterCookie struct { - *xgb.Cookie -} - -// GetConvolutionFilter sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetConvolutionFilterCookie.Reply() -func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetConvolutionFilterCookie{cookie} -} - -// GetConvolutionFilterUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getConvolutionFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetConvolutionFilterCookie{cookie} -} - -// GetConvolutionFilterReply represents the data returned from a GetConvolutionFilter request. -type GetConvolutionFilterReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 8 bytes - Width int32 - Height int32 - // padding: 8 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetConvolutionFilter request. -func (cook GetConvolutionFilterCookie) Reply() (*GetConvolutionFilterReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getConvolutionFilterReply(buf), nil -} - -// getConvolutionFilterReply reads a byte slice into a GetConvolutionFilterReply value. -func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { - v := new(GetConvolutionFilterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Height = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 8 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetConvolutionFilter -// getConvolutionFilterRequest writes a GetConvolutionFilter request to a byte slice. -func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 150 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetConvolutionParameterfvCookie is a cookie used only for GetConvolutionParameterfv requests. -type GetConvolutionParameterfvCookie struct { - *xgb.Cookie -} - -// GetConvolutionParameterfv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterfvCookie.Reply() -func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetConvolutionParameterfvCookie{cookie} -} - -// GetConvolutionParameterfvUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getConvolutionParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetConvolutionParameterfvCookie{cookie} -} - -// GetConvolutionParameterfvReply represents the data returned from a GetConvolutionParameterfv request. -type GetConvolutionParameterfvReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum Float32 - // padding: 12 bytes - Data []Float32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetConvolutionParameterfv request. -func (cook GetConvolutionParameterfvCookie) Reply() (*GetConvolutionParameterfvReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getConvolutionParameterfvReply(buf), nil -} - -// getConvolutionParameterfvReply reads a byte slice into a GetConvolutionParameterfvReply value. -func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply { - v := new(GetConvolutionParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = Float32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]Float32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Float32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetConvolutionParameterfv -// getConvolutionParameterfvRequest writes a GetConvolutionParameterfv request to a byte slice. -func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 151 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetConvolutionParameterivCookie is a cookie used only for GetConvolutionParameteriv requests. -type GetConvolutionParameterivCookie struct { - *xgb.Cookie -} - -// GetConvolutionParameteriv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetConvolutionParameterivCookie.Reply() -func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetConvolutionParameterivCookie{cookie} -} - -// GetConvolutionParameterivUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getConvolutionParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetConvolutionParameterivCookie{cookie} -} - -// GetConvolutionParameterivReply represents the data returned from a GetConvolutionParameteriv request. -type GetConvolutionParameterivReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetConvolutionParameteriv request. -func (cook GetConvolutionParameterivCookie) Reply() (*GetConvolutionParameterivReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getConvolutionParameterivReply(buf), nil -} - -// getConvolutionParameterivReply reads a byte slice into a GetConvolutionParameterivReply value. -func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply { - v := new(GetConvolutionParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetConvolutionParameteriv -// getConvolutionParameterivRequest writes a GetConvolutionParameteriv request to a byte slice. -func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 152 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetSeparableFilterCookie is a cookie used only for GetSeparableFilter requests. -type GetSeparableFilterCookie struct { - *xgb.Cookie -} - -// GetSeparableFilter sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSeparableFilterCookie.Reply() -func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetSeparableFilterCookie{cookie} -} - -// GetSeparableFilterUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getSeparableFilterRequest(c, ContextTag, Target, Format, Type, SwapBytes), cookie) - return GetSeparableFilterCookie{cookie} -} - -// GetSeparableFilterReply represents the data returned from a GetSeparableFilter request. -type GetSeparableFilterReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 8 bytes - RowW int32 - ColH int32 - // padding: 8 bytes - RowsAndCols []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetSeparableFilter request. -func (cook GetSeparableFilterCookie) Reply() (*GetSeparableFilterReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getSeparableFilterReply(buf), nil -} - -// getSeparableFilterReply reads a byte slice into a GetSeparableFilterReply value. -func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { - v := new(GetSeparableFilterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.RowW = int32(xgb.Get32(buf[b:])) - b += 4 - - v.ColH = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 8 // padding - - v.RowsAndCols = make([]byte, (int(v.Length) * 4)) - copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetSeparableFilter -// getSeparableFilterRequest writes a GetSeparableFilter request to a byte slice. -func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 153 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetHistogramCookie is a cookie used only for GetHistogram requests. -type GetHistogramCookie struct { - *xgb.Cookie -} - -// GetHistogram sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetHistogramCookie.Reply() -func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GetHistogramCookie{cookie} -} - -// GetHistogramUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getHistogramRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GetHistogramCookie{cookie} -} - -// GetHistogramReply represents the data returned from a GetHistogram request. -type GetHistogramReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 8 bytes - Width int32 - // padding: 12 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetHistogram request. -func (cook GetHistogramCookie) Reply() (*GetHistogramReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getHistogramReply(buf), nil -} - -// getHistogramReply reads a byte slice into a GetHistogramReply value. -func getHistogramReply(buf []byte) *GetHistogramReply { - v := new(GetHistogramReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Width = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetHistogram -// getHistogramRequest writes a GetHistogram request to a byte slice. -func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 154 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Reset { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetHistogramParameterfvCookie is a cookie used only for GetHistogramParameterfv requests. -type GetHistogramParameterfvCookie struct { - *xgb.Cookie -} - -// GetHistogramParameterfv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetHistogramParameterfvCookie.Reply() -func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetHistogramParameterfvCookie{cookie} -} - -// GetHistogramParameterfvUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getHistogramParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetHistogramParameterfvCookie{cookie} -} - -// GetHistogramParameterfvReply represents the data returned from a GetHistogramParameterfv request. -type GetHistogramParameterfvReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum Float32 - // padding: 12 bytes - Data []Float32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetHistogramParameterfv request. -func (cook GetHistogramParameterfvCookie) Reply() (*GetHistogramParameterfvReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getHistogramParameterfvReply(buf), nil -} - -// getHistogramParameterfvReply reads a byte slice into a GetHistogramParameterfvReply value. -func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { - v := new(GetHistogramParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = Float32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]Float32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Float32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetHistogramParameterfv -// getHistogramParameterfvRequest writes a GetHistogramParameterfv request to a byte slice. -func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 155 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetHistogramParameterivCookie is a cookie used only for GetHistogramParameteriv requests. -type GetHistogramParameterivCookie struct { - *xgb.Cookie -} - -// GetHistogramParameteriv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetHistogramParameterivCookie.Reply() -func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetHistogramParameterivCookie{cookie} -} - -// GetHistogramParameterivUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getHistogramParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetHistogramParameterivCookie{cookie} -} - -// GetHistogramParameterivReply represents the data returned from a GetHistogramParameteriv request. -type GetHistogramParameterivReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetHistogramParameteriv request. -func (cook GetHistogramParameterivCookie) Reply() (*GetHistogramParameterivReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getHistogramParameterivReply(buf), nil -} - -// getHistogramParameterivReply reads a byte slice into a GetHistogramParameterivReply value. -func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { - v := new(GetHistogramParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetHistogramParameteriv -// getHistogramParameterivRequest writes a GetHistogramParameteriv request to a byte slice. -func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 156 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetMinmaxCookie is a cookie used only for GetMinmax requests. -type GetMinmaxCookie struct { - *xgb.Cookie -} - -// GetMinmax sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMinmaxCookie.Reply() -func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GetMinmaxCookie{cookie} -} - -// GetMinmaxUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getMinmaxRequest(c, ContextTag, Target, Format, Type, SwapBytes, Reset), cookie) - return GetMinmaxCookie{cookie} -} - -// GetMinmaxReply represents the data returned from a GetMinmax request. -type GetMinmaxReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 24 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetMinmax request. -func (cook GetMinmaxCookie) Reply() (*GetMinmaxReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getMinmaxReply(buf), nil -} - -// getMinmaxReply reads a byte slice into a GetMinmaxReply value. -func getMinmaxReply(buf []byte) *GetMinmaxReply { - v := new(GetMinmaxReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetMinmax -// getMinmaxRequest writes a GetMinmax request to a byte slice. -func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 157 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Format) - b += 4 - - xgb.Put32(buf[b:], Type) - b += 4 - - if SwapBytes { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Reset { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetMinmaxParameterfvCookie is a cookie used only for GetMinmaxParameterfv requests. -type GetMinmaxParameterfvCookie struct { - *xgb.Cookie -} - -// GetMinmaxParameterfv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterfvCookie.Reply() -func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetMinmaxParameterfvCookie{cookie} -} - -// GetMinmaxParameterfvUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getMinmaxParameterfvRequest(c, ContextTag, Target, Pname), cookie) - return GetMinmaxParameterfvCookie{cookie} -} - -// GetMinmaxParameterfvReply represents the data returned from a GetMinmaxParameterfv request. -type GetMinmaxParameterfvReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum Float32 - // padding: 12 bytes - Data []Float32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetMinmaxParameterfv request. -func (cook GetMinmaxParameterfvCookie) Reply() (*GetMinmaxParameterfvReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getMinmaxParameterfvReply(buf), nil -} - -// getMinmaxParameterfvReply reads a byte slice into a GetMinmaxParameterfvReply value. -func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { - v := new(GetMinmaxParameterfvReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = Float32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]Float32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = Float32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetMinmaxParameterfv -// getMinmaxParameterfvRequest writes a GetMinmaxParameterfv request to a byte slice. -func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 158 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetMinmaxParameterivCookie is a cookie used only for GetMinmaxParameteriv requests. -type GetMinmaxParameterivCookie struct { - *xgb.Cookie -} - -// GetMinmaxParameteriv sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMinmaxParameterivCookie.Reply() -func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetMinmaxParameterivCookie{cookie} -} - -// GetMinmaxParameterivUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getMinmaxParameterivRequest(c, ContextTag, Target, Pname), cookie) - return GetMinmaxParameterivCookie{cookie} -} - -// GetMinmaxParameterivReply represents the data returned from a GetMinmaxParameteriv request. -type GetMinmaxParameterivReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) -} - -// Reply blocks and returns the reply data for a GetMinmaxParameteriv request. -func (cook GetMinmaxParameterivCookie) Reply() (*GetMinmaxParameterivReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getMinmaxParameterivReply(buf), nil -} - -// getMinmaxParameterivReply reads a byte slice into a GetMinmaxParameterivReply value. -func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { - v := new(GetMinmaxParameterivReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 4 // padding - - v.N = xgb.Get32(buf[b:]) - b += 4 - - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetMinmaxParameteriv -// getMinmaxParameterivRequest writes a GetMinmaxParameteriv request to a byte slice. -func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 159 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) - b += 4 - - return buf -} - -// GetCompressedTexImageARBCookie is a cookie used only for GetCompressedTexImageARB requests. -type GetCompressedTexImageARBCookie struct { - *xgb.Cookie -} - -// GetCompressedTexImageARB sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCompressedTexImageARBCookie.Reply() -func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) - return GetCompressedTexImageARBCookie{cookie} -} - -// GetCompressedTexImageARBUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getCompressedTexImageARBRequest(c, ContextTag, Target, Level), cookie) - return GetCompressedTexImageARBCookie{cookie} -} - -// GetCompressedTexImageARBReply represents the data returned from a GetCompressedTexImageARB request. -type GetCompressedTexImageARBReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 8 bytes - Size int32 - // padding: 12 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetCompressedTexImageARB request. -func (cook GetCompressedTexImageARBCookie) Reply() (*GetCompressedTexImageARBReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCompressedTexImageARBReply(buf), nil -} - -// getCompressedTexImageARBReply reads a byte slice into a GetCompressedTexImageARBReply value. -func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { - v := new(GetCompressedTexImageARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 8 // padding - - v.Size = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetCompressedTexImageARB -// getCompressedTexImageARBRequest writes a GetCompressedTexImageARB request to a byte slice. -func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 160 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], uint32(Level)) - b += 4 - - return buf -} - -// DeleteQueriesARBCookie is a cookie used only for DeleteQueriesARB requests. -type DeleteQueriesARBCookie struct { - *xgb.Cookie -} - -// DeleteQueriesARB sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) - return DeleteQueriesARBCookie{cookie} -} - -// DeleteQueriesARBChecked sends a checked request. -// If an error occurs, it can be retrieved using DeleteQueriesARBCookie.Check() -func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deleteQueriesARBRequest(c, ContextTag, N, Ids), cookie) - return DeleteQueriesARBCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeleteQueriesARBCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeleteQueriesARB -// deleteQueriesARBRequest writes a DeleteQueriesARB request to a byte slice. -func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) []byte { - size := xgb.Pad((12 + xgb.Pad((int(N) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 161 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(N)) - b += 4 - - for i := 0; i < int(N); i++ { - xgb.Put32(buf[b:], Ids[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GenQueriesARBCookie is a cookie used only for GenQueriesARB requests. -type GenQueriesARBCookie struct { - *xgb.Cookie -} - -// GenQueriesARB sends a checked request. -// If an error occurs, it will be returned with the reply by calling GenQueriesARBCookie.Reply() -func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) - return GenQueriesARBCookie{cookie} -} - -// GenQueriesARBUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { - if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(genQueriesARBRequest(c, ContextTag, N), cookie) - return GenQueriesARBCookie{cookie} -} - -// GenQueriesARBReply represents the data returned from a GenQueriesARB request. -type GenQueriesARBReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 24 bytes - Data []uint32 // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GenQueriesARB request. -func (cook GenQueriesARBCookie) Reply() (*GenQueriesARBReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return genQueriesARBReply(buf), nil -} - -// genQueriesARBReply reads a byte slice into a GenQueriesARBReply value. -func genQueriesARBReply(buf []byte) *GenQueriesARBReply { - v := new(GenQueriesARBReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Data = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Data[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GenQueriesARB -// genQueriesARBRequest writes a GenQueriesARB request to a byte slice. -func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["GLX"] - b += 1 - - buf[b] = 162 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], uint32(N)) - b += 4 - - return buf -} - // IsQueryARBCookie is a cookie used only for IsQueryARB requests. type IsQueryARBCookie struct { *xgb.Cookie @@ -9829,47 +8323,43 @@ func isQueryARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32) []byte { return buf } -// GetQueryivARBCookie is a cookie used only for GetQueryivARB requests. -type GetQueryivARBCookie struct { +// IsTextureCookie is a cookie used only for IsTexture requests. +type IsTextureCookie struct { *xgb.Cookie } -// GetQueryivARB sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetQueryivARBCookie.Reply() -func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { +// IsTexture sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsTextureCookie.Reply() +func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) - return GetQueryivARBCookie{cookie} + c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) + return IsTextureCookie{cookie} } -// GetQueryivARBUnchecked sends an unchecked request. +// IsTextureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { +func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getQueryivARBRequest(c, ContextTag, Target, Pname), cookie) - return GetQueryivARBCookie{cookie} + c.NewRequest(isTextureRequest(c, ContextTag, Texture), cookie) + return IsTextureCookie{cookie} } -// GetQueryivARBReply represents the data returned from a GetQueryivARB request. -type GetQueryivARBReply struct { +// IsTextureReply represents the data returned from a IsTexture request. +type IsTextureReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) + RetVal Bool32 } -// Reply blocks and returns the reply data for a GetQueryivARB request. -func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { +// Reply blocks and returns the reply data for a IsTexture request. +func (cook IsTextureCookie) Reply() (*IsTextureReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -9877,12 +8367,584 @@ func (cook GetQueryivARBCookie) Reply() (*GetQueryivARBReply, error) { if buf == nil { return nil, nil } - return getQueryivARBReply(buf), nil + return isTextureReply(buf), nil } -// getQueryivARBReply reads a byte slice into a GetQueryivARBReply value. -func getQueryivARBReply(buf []byte) *GetQueryivARBReply { - v := new(GetQueryivARBReply) +// isTextureReply reads a byte slice into a IsTextureReply value. +func isTextureReply(buf []byte) *IsTextureReply { + v := new(IsTextureReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for IsTexture +// isTextureRequest writes a IsTexture request to a byte slice. +func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 146 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Texture) + b += 4 + + return buf +} + +// MakeContextCurrentCookie is a cookie used only for MakeContextCurrent requests. +type MakeContextCurrentCookie struct { + *xgb.Cookie +} + +// MakeContextCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling MakeContextCurrentCookie.Reply() +func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) + return MakeContextCurrentCookie{cookie} +} + +// MakeContextCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(makeContextCurrentRequest(c, OldContextTag, Drawable, ReadDrawable, Context), cookie) + return MakeContextCurrentCookie{cookie} +} + +// MakeContextCurrentReply represents the data returned from a MakeContextCurrent request. +type MakeContextCurrentReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextTag ContextTag + // padding: 20 bytes +} + +// Reply blocks and returns the reply data for a MakeContextCurrent request. +func (cook MakeContextCurrentCookie) Reply() (*MakeContextCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return makeContextCurrentReply(buf), nil +} + +// makeContextCurrentReply reads a byte slice into a MakeContextCurrentReply value. +func makeContextCurrentReply(buf []byte) *MakeContextCurrentReply { + v := new(MakeContextCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = ContextTag(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for MakeContextCurrent +// makeContextCurrentRequest writes a MakeContextCurrent request to a byte slice. +func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(ReadDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// MakeCurrentCookie is a cookie used only for MakeCurrent requests. +type MakeCurrentCookie struct { + *xgb.Cookie +} + +// MakeCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling MakeCurrentCookie.Reply() +func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) + return MakeCurrentCookie{cookie} +} + +// MakeCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(makeCurrentRequest(c, Drawable, Context, OldContextTag), cookie) + return MakeCurrentCookie{cookie} +} + +// MakeCurrentReply represents the data returned from a MakeCurrent request. +type MakeCurrentReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextTag ContextTag + // padding: 20 bytes +} + +// Reply blocks and returns the reply data for a MakeCurrent request. +func (cook MakeCurrentCookie) Reply() (*MakeCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return makeCurrentReply(buf), nil +} + +// makeCurrentReply reads a byte slice into a MakeCurrentReply value. +func makeCurrentReply(buf []byte) *MakeCurrentReply { + v := new(MakeCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextTag = ContextTag(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for MakeCurrent +// makeCurrentRequest writes a MakeCurrent request to a byte slice. +func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], uint32(OldContextTag)) + b += 4 + + return buf +} + +// NewListCookie is a cookie used only for NewList requests. +type NewListCookie struct { + *xgb.Cookie +} + +// NewList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) + return NewListCookie{cookie} +} + +// NewListChecked sends a checked request. +// If an error occurs, it can be retrieved using NewListCookie.Check() +func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(newListRequest(c, ContextTag, List, Mode), cookie) + return NewListCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook NewListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for NewList +// newListRequest writes a NewList request to a byte slice. +func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 101 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], List) + b += 4 + + xgb.Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// PixelStorefCookie is a cookie used only for PixelStoref requests. +type PixelStorefCookie struct { + *xgb.Cookie +} + +// PixelStoref sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStorefCookie{cookie} +} + +// PixelStorefChecked sends a checked request. +// If an error occurs, it can be retrieved using PixelStorefCookie.Check() +func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(pixelStorefRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStorefCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PixelStorefCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PixelStoref +// pixelStorefRequest writes a PixelStoref request to a byte slice. +func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 109 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + xgb.Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// PixelStoreiCookie is a cookie used only for PixelStorei requests. +type PixelStoreiCookie struct { + *xgb.Cookie +} + +// PixelStorei sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStoreiCookie{cookie} +} + +// PixelStoreiChecked sends a checked request. +// If an error occurs, it can be retrieved using PixelStoreiCookie.Check() +func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(pixelStoreiRequest(c, ContextTag, Pname, Datum), cookie) + return PixelStoreiCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PixelStoreiCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PixelStorei +// pixelStoreiRequest writes a PixelStorei request to a byte slice. +func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 110 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Pname) + b += 4 + + xgb.Put32(buf[b:], uint32(Datum)) + b += 4 + + return buf +} + +// QueryContextCookie is a cookie used only for QueryContext requests. +type QueryContextCookie struct { + *xgb.Cookie +} + +// QueryContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryContextCookie.Reply() +func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryContextRequest(c, Context), cookie) + return QueryContextCookie{cookie} +} + +// QueryContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryContextRequest(c, Context), cookie) + return QueryContextCookie{cookie} +} + +// QueryContextReply represents the data returned from a QueryContext request. +type QueryContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumAttribs uint32 + // padding: 20 bytes + Attribs []uint32 // size: xgb.Pad(((int(NumAttribs) * 2) * 4)) +} + +// Reply blocks and returns the reply data for a QueryContext request. +func (cook QueryContextCookie) Reply() (*QueryContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryContextReply(buf), nil +} + +// queryContextReply reads a byte slice into a QueryContextReply value. +func queryContextReply(buf []byte) *QueryContextReply { + v := new(QueryContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttribs = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attribs = make([]uint32, (int(v.NumAttribs) * 2)) + for i := 0; i < int((int(v.NumAttribs) * 2)); i++ { + v.Attribs[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryContext +// queryContextRequest writes a QueryContext request to a byte slice. +func queryContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// QueryExtensionsStringCookie is a cookie used only for QueryExtensionsString requests. +type QueryExtensionsStringCookie struct { + *xgb.Cookie +} + +// QueryExtensionsString sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionsStringCookie.Reply() +func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) + return QueryExtensionsStringCookie{cookie} +} + +// QueryExtensionsStringUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtensionsStringRequest(c, Screen), cookie) + return QueryExtensionsStringCookie{cookie} +} + +// QueryExtensionsStringReply represents the data returned from a QueryExtensionsString request. +type QueryExtensionsStringReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 4 bytes + N uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a QueryExtensionsString request. +func (cook QueryExtensionsStringCookie) Reply() (*QueryExtensionsStringReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryExtensionsStringReply(buf), nil +} + +// queryExtensionsStringReply reads a byte slice into a QueryExtensionsStringReply value. +func queryExtensionsStringReply(buf []byte) *QueryExtensionsStringReply { + v := new(QueryExtensionsStringReply) b := 1 // skip reply determinant b += 1 // padding @@ -9898,90 +8960,73 @@ func getQueryivARBReply(buf []byte) *GetQueryivARBReply { v.N = xgb.Get32(buf[b:]) b += 4 - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 - - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) + b += 16 // padding return v } -// Write request to wire for GetQueryivARB -// getQueryivARBRequest writes a GetQueryivARB request to a byte slice. -func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) []byte { - size := 16 +// Write request to wire for QueryExtensionsString +// queryExtensionsStringRequest writes a QueryExtensionsString request to a byte slice. +func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 164 // request opcode + buf[b] = 18 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(ContextTag)) - b += 4 - - xgb.Put32(buf[b:], Target) - b += 4 - - xgb.Put32(buf[b:], Pname) + xgb.Put32(buf[b:], Screen) b += 4 return buf } -// GetQueryObjectivARBCookie is a cookie used only for GetQueryObjectivARB requests. -type GetQueryObjectivARBCookie struct { +// QueryServerStringCookie is a cookie used only for QueryServerString requests. +type QueryServerStringCookie struct { *xgb.Cookie } -// GetQueryObjectivARB sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetQueryObjectivARBCookie.Reply() -func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { +// QueryServerString sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryServerStringCookie.Reply() +func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) - return GetQueryObjectivARBCookie{cookie} + c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) + return QueryServerStringCookie{cookie} } -// GetQueryObjectivARBUnchecked sends an unchecked request. +// QueryServerStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { +func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getQueryObjectivARBRequest(c, ContextTag, Id, Pname), cookie) - return GetQueryObjectivARBCookie{cookie} + c.NewRequest(queryServerStringRequest(c, Screen, Name), cookie) + return QueryServerStringCookie{cookie} } -// GetQueryObjectivARBReply represents the data returned from a GetQueryObjectivARB request. -type GetQueryObjectivARBReply struct { +// QueryServerStringReply represents the data returned from a QueryServerString request. +type QueryServerStringReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 4 bytes - N uint32 - Datum int32 - // padding: 12 bytes - Data []int32 // size: xgb.Pad((int(N) * 4)) + StrLen uint32 + // padding: 16 bytes + String string // size: xgb.Pad((int(StrLen) * 1)) } -// Reply blocks and returns the reply data for a GetQueryObjectivARB request. -func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) { +// Reply blocks and returns the reply data for a QueryServerString request. +func (cook QueryServerStringCookie) Reply() (*QueryServerStringReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -9989,12 +9034,12 @@ func (cook GetQueryObjectivARBCookie) Reply() (*GetQueryObjectivARBReply, error) if buf == nil { return nil, nil } - return getQueryObjectivARBReply(buf), nil + return queryServerStringReply(buf), nil } -// getQueryObjectivARBReply reads a byte slice into a GetQueryObjectivARBReply value. -func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { - v := new(GetQueryObjectivARBReply) +// queryServerStringReply reads a byte slice into a QueryServerStringReply value. +func queryServerStringReply(buf []byte) *QueryServerStringReply { + v := new(QueryServerStringReply) b := 1 // skip reply determinant b += 1 // padding @@ -10007,35 +9052,225 @@ func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { b += 4 // padding - v.N = xgb.Get32(buf[b:]) + v.StrLen = xgb.Get32(buf[b:]) b += 4 - v.Datum = int32(xgb.Get32(buf[b:])) - b += 4 + b += 16 // padding - b += 12 // padding - - v.Data = make([]int32, v.N) - for i := 0; i < int(v.N); i++ { - v.Data[i] = int32(xgb.Get32(buf[b:])) - b += 4 + { + byteString := make([]byte, v.StrLen) + copy(byteString[:v.StrLen], buf[b:]) + v.String = string(byteString) + b += xgb.Pad(int(v.StrLen)) } - b = xgb.Pad(b) return v } -// Write request to wire for GetQueryObjectivARB -// getQueryObjectivARBRequest writes a GetQueryObjectivARB request to a byte slice. -func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { - size := 16 +// Write request to wire for QueryServerString +// queryServerStringRequest writes a QueryServerString request to a byte slice. +func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 165 // request opcode + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Name) + b += 4 + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// ReadPixelsCookie is a cookie used only for ReadPixels requests. +type ReadPixelsCookie struct { + *xgb.Cookie +} + +// ReadPixels sends a checked request. +// If an error occurs, it will be returned with the reply by calling ReadPixelsCookie.Reply() +func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return ReadPixelsCookie{cookie} +} + +// ReadPixelsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(readPixelsRequest(c, ContextTag, X, Y, Width, Height, Format, Type, SwapBytes, LsbFirst), cookie) + return ReadPixelsCookie{cookie} +} + +// ReadPixelsReply represents the data returned from a ReadPixels request. +type ReadPixelsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 24 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a ReadPixels request. +func (cook ReadPixelsCookie) Reply() (*ReadPixelsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return readPixelsReply(buf), nil +} + +// readPixelsReply reads a byte slice into a ReadPixelsReply value. +func readPixelsReply(buf []byte) *ReadPixelsReply { + v := new(ReadPixelsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for ReadPixels +// readPixelsRequest writes a ReadPixels request to a byte slice. +func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 111 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -10044,56 +9279,207 @@ func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, P xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 - xgb.Put32(buf[b:], Id) + xgb.Put32(buf[b:], uint32(X)) b += 4 - xgb.Put32(buf[b:], Pname) + xgb.Put32(buf[b:], uint32(Y)) b += 4 + xgb.Put32(buf[b:], uint32(Width)) + b += 4 + + xgb.Put32(buf[b:], uint32(Height)) + b += 4 + + xgb.Put32(buf[b:], Format) + b += 4 + + xgb.Put32(buf[b:], Type) + b += 4 + + if SwapBytes { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if LsbFirst { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + return buf } -// GetQueryObjectuivARBCookie is a cookie used only for GetQueryObjectuivARB requests. -type GetQueryObjectuivARBCookie struct { +// RenderCookie is a cookie used only for Render requests. +type RenderCookie struct { *xgb.Cookie } -// GetQueryObjectuivARB sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetQueryObjectuivARBCookie.Reply() -func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { +// Render sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(renderRequest(c, ContextTag, Data), cookie) + return RenderCookie{cookie} +} + +// RenderChecked sends a checked request. +// If an error occurs, it can be retrieved using RenderCookie.Check() +func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(renderRequest(c, ContextTag, Data), cookie) + return RenderCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RenderCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Render +// renderRequest writes a Render request to a byte slice. +func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// RenderLargeCookie is a cookie used only for RenderLarge requests. +type RenderLargeCookie struct { + *xgb.Cookie +} + +// RenderLarge sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return RenderLargeCookie{cookie} +} + +// RenderLargeChecked sends a checked request. +// If an error occurs, it can be retrieved using RenderLargeCookie.Check() +func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(renderLargeRequest(c, ContextTag, RequestNum, RequestTotal, DataLen, Data), cookie) + return RenderLargeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RenderLargeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RenderLarge +// renderLargeRequest writes a RenderLarge request to a byte slice. +func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((int(DataLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put16(buf[b:], RequestNum) + b += 2 + + xgb.Put16(buf[b:], RequestTotal) + b += 2 + + xgb.Put32(buf[b:], DataLen) + b += 4 + + copy(buf[b:], Data[:DataLen]) + b += xgb.Pad(int(DataLen)) + + return buf +} + +// RenderModeCookie is a cookie used only for RenderMode requests. +type RenderModeCookie struct { + *xgb.Cookie +} + +// RenderMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling RenderModeCookie.Reply() +func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) - return GetQueryObjectuivARBCookie{cookie} + c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) + return RenderModeCookie{cookie} } -// GetQueryObjectuivARBUnchecked sends an unchecked request. +// RenderModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { +func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { if _, ok := c.Extensions["GLX"]; !ok { - panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getQueryObjectuivARBRequest(c, ContextTag, Id, Pname), cookie) - return GetQueryObjectuivARBCookie{cookie} + c.NewRequest(renderModeRequest(c, ContextTag, Mode), cookie) + return RenderModeCookie{cookie} } -// GetQueryObjectuivARBReply represents the data returned from a GetQueryObjectuivARB request. -type GetQueryObjectuivARBReply struct { +// RenderModeReply represents the data returned from a RenderMode request. +type RenderModeReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - // padding: 4 bytes - N uint32 - Datum uint32 + RetVal uint32 + N uint32 + NewMode uint32 // padding: 12 bytes Data []uint32 // size: xgb.Pad((int(N) * 4)) } -// Reply blocks and returns the reply data for a GetQueryObjectuivARB request. -func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, error) { +// Reply blocks and returns the reply data for a RenderMode request. +func (cook RenderModeCookie) Reply() (*RenderModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -10101,12 +9487,12 @@ func (cook GetQueryObjectuivARBCookie) Reply() (*GetQueryObjectuivARBReply, erro if buf == nil { return nil, nil } - return getQueryObjectuivARBReply(buf), nil + return renderModeReply(buf), nil } -// getQueryObjectuivARBReply reads a byte slice into a GetQueryObjectuivARBReply value. -func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { - v := new(GetQueryObjectuivARBReply) +// renderModeReply reads a byte slice into a RenderModeReply value. +func renderModeReply(buf []byte) *RenderModeReply { + v := new(RenderModeReply) b := 1 // skip reply determinant b += 1 // padding @@ -10117,12 +9503,13 @@ func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - b += 4 // padding + v.RetVal = xgb.Get32(buf[b:]) + b += 4 v.N = xgb.Get32(buf[b:]) b += 4 - v.Datum = xgb.Get32(buf[b:]) + v.NewMode = xgb.Get32(buf[b:]) b += 4 b += 12 // padding @@ -10137,17 +9524,17 @@ func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { return v } -// Write request to wire for GetQueryObjectuivARB -// getQueryObjectuivARBRequest writes a GetQueryObjectuivARB request to a byte slice. -func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) []byte { - size := 16 +// Write request to wire for RenderMode +// renderModeRequest writes a RenderMode request to a byte slice. +func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["GLX"] b += 1 - buf[b] = 166 // request opcode + buf[b] = 107 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -10156,10 +9543,623 @@ func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 - xgb.Put32(buf[b:], Id) - b += 4 - - xgb.Put32(buf[b:], Pname) + xgb.Put32(buf[b:], Mode) + b += 4 + + return buf +} + +// SelectBufferCookie is a cookie used only for SelectBuffer requests. +type SelectBufferCookie struct { + *xgb.Cookie +} + +// SelectBuffer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) + return SelectBufferCookie{cookie} +} + +// SelectBufferChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectBufferCookie.Check() +func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectBufferRequest(c, ContextTag, Size), cookie) + return SelectBufferCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectBufferCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectBuffer +// selectBufferRequest writes a SelectBuffer request to a byte slice. +func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 106 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Size)) + b += 4 + + return buf +} + +// SetClientInfo2ARBCookie is a cookie used only for SetClientInfo2ARB requests. +type SetClientInfo2ARBCookie struct { + *xgb.Cookie +} + +// SetClientInfo2ARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfo2ARBCookie{cookie} +} + +// SetClientInfo2ARBChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientInfo2ARBCookie.Check() +func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setClientInfo2ARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfo2ARBCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetClientInfo2ARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientInfo2ARB +// setClientInfo2ARBRequest writes a SetClientInfo2ARB request to a byte slice. +func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 3) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], NumVersions) + b += 4 + + xgb.Put32(buf[b:], GlStrLen) + b += 4 + + xgb.Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 3)); i++ { + xgb.Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = xgb.Pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += xgb.Pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += xgb.Pad(int(GlxStrLen)) + + return buf +} + +// SetClientInfoARBCookie is a cookie used only for SetClientInfoARB requests. +type SetClientInfoARBCookie struct { + *xgb.Cookie +} + +// SetClientInfoARB sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfoARBCookie{cookie} +} + +// SetClientInfoARBChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientInfoARBCookie.Check() +func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setClientInfoARBRequest(c, MajorVersion, MinorVersion, NumVersions, GlStrLen, GlxStrLen, GlVersions, GlExtensionString, GlxExtensionString), cookie) + return SetClientInfoARBCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetClientInfoARBCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientInfoARB +// setClientInfoARBRequest writes a SetClientInfoARB request to a byte slice. +func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) []byte { + size := xgb.Pad((((24 + xgb.Pad(((int(NumVersions) * 2) * 4))) + xgb.Pad((int(GlStrLen) * 1))) + xgb.Pad((int(GlxStrLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + xgb.Put32(buf[b:], NumVersions) + b += 4 + + xgb.Put32(buf[b:], GlStrLen) + b += 4 + + xgb.Put32(buf[b:], GlxStrLen) + b += 4 + + for i := 0; i < int((int(NumVersions) * 2)); i++ { + xgb.Put32(buf[b:], GlVersions[i]) + b += 4 + } + b = xgb.Pad(b) + + copy(buf[b:], GlExtensionString[:GlStrLen]) + b += xgb.Pad(int(GlStrLen)) + + copy(buf[b:], GlxExtensionString[:GlxStrLen]) + b += xgb.Pad(int(GlxStrLen)) + + return buf +} + +// SwapBuffersCookie is a cookie used only for SwapBuffers requests. +type SwapBuffersCookie struct { + *xgb.Cookie +} + +// SwapBuffers sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) + return SwapBuffersCookie{cookie} +} + +// SwapBuffersChecked sends a checked request. +// If an error occurs, it can be retrieved using SwapBuffersCookie.Check() +func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(swapBuffersRequest(c, ContextTag, Drawable), cookie) + return SwapBuffersCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SwapBuffersCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwapBuffers +// swapBuffersRequest writes a SwapBuffers request to a byte slice. +func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// UseXFontCookie is a cookie used only for UseXFont requests. +type UseXFontCookie struct { + *xgb.Cookie +} + +// UseXFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) + return UseXFontCookie{cookie} +} + +// UseXFontChecked sends a checked request. +// If an error occurs, it can be retrieved using UseXFontCookie.Check() +func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(useXFontRequest(c, ContextTag, Font, First, Count, ListBase), cookie) + return UseXFontCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UseXFontCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UseXFont +// useXFontRequest writes a UseXFont request to a byte slice. +func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], uint32(Font)) + b += 4 + + xgb.Put32(buf[b:], First) + b += 4 + + xgb.Put32(buf[b:], Count) + b += 4 + + xgb.Put32(buf[b:], ListBase) + b += 4 + + return buf +} + +// VendorPrivateCookie is a cookie used only for VendorPrivate requests. +type VendorPrivateCookie struct { + *xgb.Cookie +} + +// VendorPrivate sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateCookie{cookie} +} + +// VendorPrivateChecked sends a checked request. +// If an error occurs, it can be retrieved using VendorPrivateCookie.Check() +func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(vendorPrivateRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook VendorPrivateCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for VendorPrivate +// vendorPrivateRequest writes a VendorPrivate request to a byte slice. +func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], VendorCode) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// VendorPrivateWithReplyCookie is a cookie used only for VendorPrivateWithReply requests. +type VendorPrivateWithReplyCookie struct { + *xgb.Cookie +} + +// VendorPrivateWithReply sends a checked request. +// If an error occurs, it will be returned with the reply by calling VendorPrivateWithReplyCookie.Reply() +func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateWithReplyCookie{cookie} +} + +// VendorPrivateWithReplyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(vendorPrivateWithReplyRequest(c, VendorCode, ContextTag, Data), cookie) + return VendorPrivateWithReplyCookie{cookie} +} + +// VendorPrivateWithReplyReply represents the data returned from a VendorPrivateWithReply request. +type VendorPrivateWithReplyReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Retval uint32 + Data1 []byte // size: 24 + Data2 []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a VendorPrivateWithReply request. +func (cook VendorPrivateWithReplyCookie) Reply() (*VendorPrivateWithReplyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return vendorPrivateWithReplyReply(buf), nil +} + +// vendorPrivateWithReplyReply reads a byte slice into a VendorPrivateWithReplyReply value. +func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { + v := new(VendorPrivateWithReplyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Retval = xgb.Get32(buf[b:]) + b += 4 + + v.Data1 = make([]byte, 24) + copy(v.Data1[:24], buf[b:]) + b += xgb.Pad(int(24)) + + v.Data2 = make([]byte, (int(v.Length) * 4)) + copy(v.Data2[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for VendorPrivateWithReply +// vendorPrivateWithReplyRequest writes a VendorPrivateWithReply request to a byte slice. +func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], VendorCode) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// WaitGLCookie is a cookie used only for WaitGL requests. +type WaitGLCookie struct { + *xgb.Cookie +} + +// WaitGL sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(waitGLRequest(c, ContextTag), cookie) + return WaitGLCookie{cookie} +} + +// WaitGLChecked sends a checked request. +// If an error occurs, it can be retrieved using WaitGLCookie.Check() +func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(waitGLRequest(c, ContextTag), cookie) + return WaitGLCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook WaitGLCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for WaitGL +// waitGLRequest writes a WaitGL request to a byte slice. +func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + return buf +} + +// WaitXCookie is a cookie used only for WaitX requests. +type WaitXCookie struct { + *xgb.Cookie +} + +// WaitX sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(waitXRequest(c, ContextTag), cookie) + return WaitXCookie{cookie} +} + +// WaitXChecked sends a checked request. +// If an error occurs, it can be retrieved using WaitXCookie.Check() +func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(waitXRequest(c, ContextTag), cookie) + return WaitXCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook WaitXCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for WaitX +// waitXRequest writes a WaitX request to a byte slice. +func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["GLX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) b += 4 return buf diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 6e2eecc..81104eb 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -2,7 +2,7 @@ package randr /* - This file was generated by randr.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by randr.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,52 +41,277 @@ func init() { xgb.NewExtErrorFuncs["RANDR"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' +// BadBadCrtc is the error number for a BadBadCrtc. +const BadBadCrtc = 1 -// Skipping definition for base type 'Char' +type BadCrtcError struct { + Sequence uint16 + NiceName string +} -// Skipping definition for base type 'Card32' +// BadCrtcErrorNew constructs a BadCrtcError value that implements xgb.Error from a byte slice. +func BadCrtcErrorNew(buf []byte) xgb.Error { + v := BadCrtcError{} + v.NiceName = "BadCrtc" -// Skipping definition for base type 'Double' + b := 1 // skip error determinant + b += 1 // don't read error number -// Skipping definition for base type 'Bool' + v.Sequence = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Float' + return v +} -// Skipping definition for base type 'Card8' +// SequenceId returns the sequence id attached to the BadBadCrtc error. +// This is mostly used internally. +func (err BadCrtcError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Int16' +// BadId returns the 'BadValue' number if one exists for the BadBadCrtc error. If no bad value exists, 0 is returned. +func (err BadCrtcError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Int32' +// Error returns a rudimentary string representation of the BadBadCrtc error. -// Skipping definition for base type 'Void' +func (err BadCrtcError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadCrtc {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Byte' +func init() { + xgb.NewExtErrorFuncs["RANDR"][1] = BadCrtcErrorNew +} -// Skipping definition for base type 'Int8' +// BadBadMode is the error number for a BadBadMode. +const BadBadMode = 2 + +type BadModeError struct { + Sequence uint16 + NiceName string +} + +// BadModeErrorNew constructs a BadModeError value that implements xgb.Error from a byte slice. +func BadModeErrorNew(buf []byte) xgb.Error { + v := BadModeError{} + v.NiceName = "BadMode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadMode error. +// This is mostly used internally. +func (err BadModeError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadMode error. If no bad value exists, 0 is returned. +func (err BadModeError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadMode error. + +func (err BadModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][2] = BadModeErrorNew +} + +// BadBadOutput is the error number for a BadBadOutput. +const BadBadOutput = 0 + +type BadOutputError struct { + Sequence uint16 + NiceName string +} + +// BadOutputErrorNew constructs a BadOutputError value that implements xgb.Error from a byte slice. +func BadOutputErrorNew(buf []byte) xgb.Error { + v := BadOutputError{} + v.NiceName = "BadOutput" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadOutput error. +// This is mostly used internally. +func (err BadOutputError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadOutput error. If no bad value exists, 0 is returned. +func (err BadOutputError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadOutput error. + +func (err BadOutputError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadOutput {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][0] = BadOutputErrorNew +} const ( - RotationRotate0 = 1 - RotationRotate90 = 2 - RotationRotate180 = 4 - RotationRotate270 = 8 - RotationReflectX = 16 - RotationReflectY = 32 + ConnectionConnected = 0 + ConnectionDisconnected = 1 + ConnectionUnknown = 2 ) -const ( - SetConfigSuccess = 0 - SetConfigInvalidConfigTime = 1 - SetConfigInvalidTime = 2 - SetConfigFailed = 3 -) +type Crtc uint32 -const ( - NotifyMaskScreenChange = 1 - NotifyMaskCrtcChange = 2 - NotifyMaskOutputChange = 4 - NotifyMaskOutputProperty = 8 -) +func NewCrtcId(c *xgb.Conn) (Crtc, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Crtc(id), nil +} + +type CrtcChange struct { + Timestamp xproto.Timestamp + Window xproto.Window + Crtc Crtc + Mode Mode + Rotation uint16 + // padding: 2 bytes + X int16 + Y int16 + Width uint16 + Height uint16 +} + +// CrtcChangeRead reads a byte slice into a CrtcChange value. +func CrtcChangeRead(buf []byte, v *CrtcChange) int { + b := 0 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Crtc = Crtc(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = Mode(xgb.Get32(buf[b:])) + b += 4 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// CrtcChangeReadList reads a byte slice into a list of CrtcChange values. +func CrtcChangeReadList(buf []byte, dest []CrtcChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = CrtcChange{} + b += CrtcChangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a CrtcChange value to a byte slice. +func (v CrtcChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Mode)) + b += 4 + + xgb.Put16(buf[b:], v.Rotation) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// CrtcChangeListBytes writes a list of CrtcChange values to a byte slice. +func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Mode uint32 + +func NewModeId(c *xgb.Conn) (Mode, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Mode(id), nil +} const ( ModeFlagHsyncPositive = 1 @@ -105,186 +330,6 @@ const ( ModeFlagHalveClock = 8192 ) -const ( - ConnectionConnected = 0 - ConnectionDisconnected = 1 - ConnectionUnknown = 2 -) - -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 -) - -type Mode uint32 - -func NewModeId(c *xgb.Conn) (Mode, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Mode(id), nil -} - -type Crtc uint32 - -func NewCrtcId(c *xgb.Conn) (Crtc, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Crtc(id), nil -} - -type Output uint32 - -func NewOutputId(c *xgb.Conn) (Output, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Output(id), nil -} - -type ScreenSize struct { - Width uint16 - Height uint16 - Mwidth uint16 - Mheight uint16 -} - -// ScreenSizeRead reads a byte slice into a ScreenSize value. -func ScreenSizeRead(buf []byte, v *ScreenSize) int { - b := 0 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.Mwidth = xgb.Get16(buf[b:]) - b += 2 - - v.Mheight = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// ScreenSizeReadList reads a byte slice into a list of ScreenSize values. -func ScreenSizeReadList(buf []byte, dest []ScreenSize) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ScreenSize{} - b += ScreenSizeRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ScreenSize value to a byte slice. -func (v ScreenSize) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 - - xgb.Put16(buf[b:], v.Mwidth) - b += 2 - - xgb.Put16(buf[b:], v.Mheight) - b += 2 - - return buf -} - -// ScreenSizeListBytes writes a list of ScreenSize values to a byte slice. -func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type RefreshRates struct { - NRates uint16 - Rates []uint16 // size: xgb.Pad((int(NRates) * 2)) -} - -// RefreshRatesRead reads a byte slice into a RefreshRates value. -func RefreshRatesRead(buf []byte, v *RefreshRates) int { - b := 0 - - v.NRates = xgb.Get16(buf[b:]) - b += 2 - - v.Rates = make([]uint16, v.NRates) - for i := 0; i < int(v.NRates); i++ { - v.Rates[i] = xgb.Get16(buf[b:]) - b += 2 - } - b = xgb.Pad(b) - - return b -} - -// RefreshRatesReadList reads a byte slice into a list of RefreshRates values. -func RefreshRatesReadList(buf []byte, dest []RefreshRates) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = RefreshRates{} - b += RefreshRatesRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a RefreshRates value to a byte slice. -func (v RefreshRates) Bytes() []byte { - buf := make([]byte, (2 + xgb.Pad((int(v.NRates) * 2)))) - b := 0 - - xgb.Put16(buf[b:], v.NRates) - b += 2 - - for i := 0; i < int(v.NRates); i++ { - xgb.Put16(buf[b:], v.Rates[i]) - b += 2 - } - b = xgb.Pad(b) - - return buf -} - -// RefreshRatesListBytes writes a list of RefreshRates values to a byte slice. -func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// RefreshRatesListSize computes the size (bytes) of a list of RefreshRates values. -func RefreshRatesListSize(list []RefreshRates) int { - size := 0 - for _, item := range list { - size += (2 + xgb.Pad((int(item.NRates) * 2))) - } - return size -} - type ModeInfo struct { Id uint32 Width uint16 @@ -416,114 +461,259 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return b } -type CrtcChange struct { - Timestamp xproto.Timestamp - Window xproto.Window - Crtc Crtc - Mode Mode - Rotation uint16 - // padding: 2 bytes - X int16 - Y int16 - Width uint16 - Height uint16 +// Notify is the event number for a NotifyEvent. +const Notify = 1 + +type NotifyEvent struct { + Sequence uint16 + SubCode byte + U NotifyDataUnion } -// CrtcChangeRead reads a byte slice into a CrtcChange value. -func CrtcChangeRead(buf []byte, v *CrtcChange) int { - b := 0 +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 + v.SubCode = buf[b] + b += 1 - v.Window = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Crtc = Crtc(xgb.Get32(buf[b:])) - b += 4 - - v.Mode = Mode(xgb.Get32(buf[b:])) - b += 4 - - v.Rotation = xgb.Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - b += 2 // padding + v.U = NotifyDataUnion{} + b += NotifyDataUnionRead(buf[b:], &v.U) - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - return b + return v } -// CrtcChangeReadList reads a byte slice into a list of CrtcChange values. -func CrtcChangeReadList(buf []byte, dest []CrtcChange) int { +// Bytes writes a NotifyEvent value to a byte slice. +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = CrtcChange{} - b += CrtcChangeRead(buf[b:], &dest[i]) + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.SubCode + b += 1 + + b += 2 // skip sequence number + + { + unionBytes := v.U.Bytes() + copy(buf[b:], unionBytes) + b += xgb.Pad(len(unionBytes)) } - return xgb.Pad(b) -} - -// Bytes writes a CrtcChange value to a byte slice. -func (v CrtcChange) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Crtc)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Mode)) - b += 4 - - xgb.Put16(buf[b:], v.Rotation) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 return buf } -// CrtcChangeListBytes writes a list of CrtcChange values to a byte slice. -func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of NotifyEvent. +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("SubCode: %d", v.SubCode)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew +} + +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 +) + +// NotifyDataUnion is a represention of the NotifyDataUnion union type. +// Note that to *create* a Union, you should *never* create +// this struct directly (unless you know what you're doing). +// Instead use one of the following constructors for 'NotifyDataUnion': +// NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion +// NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion +// NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion +type NotifyDataUnion struct { + Cc CrtcChange + Oc OutputChange + Op OutputProperty +} + +// NotifyDataUnionCcNew constructs a new NotifyDataUnion union type with the Cc field. +func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Cc.Bytes() copy(buf[b:], structBytes) b += xgb.Pad(len(structBytes)) } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// NotifyDataUnionOcNew constructs a new NotifyDataUnion union type with the Oc field. +func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Oc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// NotifyDataUnionOpNew constructs a new NotifyDataUnion union type with the Op field. +func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Op.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return v +} + +// NotifyDataUnionRead reads a byte slice into a NotifyDataUnion value. +func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { + var b int + + b = 0 // re-read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // re-read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // re-read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + return 28 +} + +// NotifyDataUnionReadList reads a byte slice into a list of NotifyDataUnion values. +func NotifyDataUnionReadList(buf []byte, dest []NotifyDataUnion) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = NotifyDataUnion{} + b += NotifyDataUnionRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a NotifyDataUnion value to a byte slice. +// Each field in a union must contain the same data. +// So simply pick the first field and write that to the wire. +func (v NotifyDataUnion) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + { + structBytes := v.Cc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return buf +} + +// NotifyDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. +func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { + b := 0 + var unionBytes []byte + for _, item := range list { + unionBytes = item.Bytes() + copy(buf[b:], unionBytes) + b += xgb.Pad(len(unionBytes)) + } return b } +const ( + NotifyMaskScreenChange = 1 + NotifyMaskCrtcChange = 2 + NotifyMaskOutputChange = 4 + NotifyMaskOutputProperty = 8 +) + +type Output uint32 + +func NewOutputId(c *xgb.Conn) (Output, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Output(id), nil +} + type OutputChange struct { Timestamp xproto.Timestamp ConfigTimestamp xproto.Timestamp @@ -707,168 +897,85 @@ func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { return b } -// NotifyDataUnion is a represention of the NotifyDataUnion union type. -// Note that to *create* a Union, you should *never* create -// this struct directly (unless you know what you're doing). -// Instead use one of the following constructors for 'NotifyDataUnion': -// NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion -// NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion -// NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion -type NotifyDataUnion struct { - Cc CrtcChange - Oc OutputChange - Op OutputProperty +type RefreshRates struct { + NRates uint16 + Rates []uint16 // size: xgb.Pad((int(NRates) * 2)) } -// NotifyDataUnionCcNew constructs a new NotifyDataUnion union type with the Cc field. -func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { - var b int - buf := make([]byte, 28) +// RefreshRatesRead reads a byte slice into a RefreshRates value. +func RefreshRatesRead(buf []byte, v *RefreshRates) int { + b := 0 - { - structBytes := Cc.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + v.NRates = xgb.Get16(buf[b:]) + b += 2 + + v.Rates = make([]uint16, v.NRates) + for i := 0; i < int(v.NRates); i++ { + v.Rates[i] = xgb.Get16(buf[b:]) + b += 2 } + b = xgb.Pad(b) - // Create the Union type - v := NotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = CrtcChange{} - b += CrtcChangeRead(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = OutputChange{} - b += OutputChangeRead(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = OutputProperty{} - b += OutputPropertyRead(buf[b:], &v.Op) - - return v + return b } -// NotifyDataUnionOcNew constructs a new NotifyDataUnion union type with the Oc field. -func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { - var b int - buf := make([]byte, 28) - - { - structBytes := Oc.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - // Create the Union type - v := NotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = CrtcChange{} - b += CrtcChangeRead(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = OutputChange{} - b += OutputChangeRead(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = OutputProperty{} - b += OutputPropertyRead(buf[b:], &v.Op) - - return v -} - -// NotifyDataUnionOpNew constructs a new NotifyDataUnion union type with the Op field. -func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { - var b int - buf := make([]byte, 28) - - { - structBytes := Op.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - // Create the Union type - v := NotifyDataUnion{} - - // Now copy buf into all fields - - b = 0 // always read the same bytes - v.Cc = CrtcChange{} - b += CrtcChangeRead(buf[b:], &v.Cc) - - b = 0 // always read the same bytes - v.Oc = OutputChange{} - b += OutputChangeRead(buf[b:], &v.Oc) - - b = 0 // always read the same bytes - v.Op = OutputProperty{} - b += OutputPropertyRead(buf[b:], &v.Op) - - return v -} - -// NotifyDataUnionRead reads a byte slice into a NotifyDataUnion value. -func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { - var b int - - b = 0 // re-read the same bytes - v.Cc = CrtcChange{} - b += CrtcChangeRead(buf[b:], &v.Cc) - - b = 0 // re-read the same bytes - v.Oc = OutputChange{} - b += OutputChangeRead(buf[b:], &v.Oc) - - b = 0 // re-read the same bytes - v.Op = OutputProperty{} - b += OutputPropertyRead(buf[b:], &v.Op) - - return 28 -} - -// NotifyDataUnionReadList reads a byte slice into a list of NotifyDataUnion values. -func NotifyDataUnionReadList(buf []byte, dest []NotifyDataUnion) int { +// RefreshRatesReadList reads a byte slice into a list of RefreshRates values. +func RefreshRatesReadList(buf []byte, dest []RefreshRates) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = NotifyDataUnion{} - b += NotifyDataUnionRead(buf[b:], &dest[i]) + dest[i] = RefreshRates{} + b += RefreshRatesRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a NotifyDataUnion value to a byte slice. -// Each field in a union must contain the same data. -// So simply pick the first field and write that to the wire. -func (v NotifyDataUnion) Bytes() []byte { - buf := make([]byte, 28) +// Bytes writes a RefreshRates value to a byte slice. +func (v RefreshRates) Bytes() []byte { + buf := make([]byte, (2 + xgb.Pad((int(v.NRates) * 2)))) b := 0 - { - structBytes := v.Cc.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + xgb.Put16(buf[b:], v.NRates) + b += 2 + + for i := 0; i < int(v.NRates); i++ { + xgb.Put16(buf[b:], v.Rates[i]) + b += 2 } + b = xgb.Pad(b) + return buf } -// NotifyDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. -func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { +// RefreshRatesListBytes writes a list of RefreshRates values to a byte slice. +func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { b := 0 - var unionBytes []byte + var structBytes []byte for _, item := range list { - unionBytes = item.Bytes() - copy(buf[b:], unionBytes) - b += xgb.Pad(len(unionBytes)) + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) } return b } +// RefreshRatesListSize computes the size (bytes) of a list of RefreshRates values. +func RefreshRatesListSize(list []RefreshRates) int { + size := 0 + for _, item := range list { + size += (2 + xgb.Pad((int(item.NRates) * 2))) + } + return size +} + +const ( + RotationRotate0 = 1 + RotationRotate90 = 2 + RotationRotate180 = 4 + RotationRotate270 = 8 + RotationReflectX = 16 + RotationReflectY = 32 +) + // ScreenChangeNotify is the event number for a ScreenChangeNotifyEvent. const ScreenChangeNotify = 0 @@ -1007,251 +1114,356 @@ func init() { xgb.NewExtEventFuncs["RANDR"][0] = ScreenChangeNotifyEventNew } -// Notify is the event number for a NotifyEvent. -const Notify = 1 - -type NotifyEvent struct { - Sequence uint16 - SubCode byte - U NotifyDataUnion +type ScreenSize struct { + Width uint16 + Height uint16 + Mwidth uint16 + Mheight uint16 } -// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. -func NotifyEventNew(buf []byte) xgb.Event { - v := NotifyEvent{} - b := 1 // don't read event number - - v.SubCode = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.U = NotifyDataUnion{} - b += NotifyDataUnionRead(buf[b:], &v.U) - - return v -} - -// Bytes writes a NotifyEvent value to a byte slice. -func (v NotifyEvent) Bytes() []byte { - buf := make([]byte, 32) +// ScreenSizeRead reads a byte slice into a ScreenSize value. +func ScreenSizeRead(buf []byte, v *ScreenSize) int { b := 0 - // write event number - buf[b] = 1 - b += 1 + v.Width = xgb.Get16(buf[b:]) + b += 2 - buf[b] = v.SubCode - b += 1 + v.Height = xgb.Get16(buf[b:]) + b += 2 - b += 2 // skip sequence number + v.Mwidth = xgb.Get16(buf[b:]) + b += 2 - { - unionBytes := v.U.Bytes() - copy(buf[b:], unionBytes) - b += xgb.Pad(len(unionBytes)) + v.Mheight = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// ScreenSizeReadList reads a byte slice into a list of ScreenSize values. +func ScreenSizeReadList(buf []byte, dest []ScreenSize) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ScreenSize{} + b += ScreenSizeRead(buf[b:], &dest[i]) } + return xgb.Pad(b) +} + +// Bytes writes a ScreenSize value to a byte slice. +func (v ScreenSize) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.Mwidth) + b += 2 + + xgb.Put16(buf[b:], v.Mheight) + b += 2 return buf } -// SequenceId returns the sequence id attached to the Notify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v NotifyEvent) SequenceId() uint16 { - return v.Sequence +// ScreenSizeListBytes writes a list of ScreenSize values to a byte slice. +func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -// String is a rudimentary string representation of NotifyEvent. -func (v NotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("SubCode: %d", v.SubCode)) - return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +const ( + SetConfigSuccess = 0 + SetConfigInvalidConfigTime = 1 + SetConfigInvalidTime = 2 + SetConfigFailed = 3 +) -func init() { - xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew -} +// Skipping definition for base type 'Bool' -// BadBadOutput is the error number for a BadBadOutput. -const BadBadOutput = 0 +// Skipping definition for base type 'Byte' -type BadOutputError struct { - Sequence uint16 - NiceName string -} +// Skipping definition for base type 'Card8' -// BadOutputErrorNew constructs a BadOutputError value that implements xgb.Error from a byte slice. -func BadOutputErrorNew(buf []byte) xgb.Error { - v := BadOutputError{} - v.NiceName = "BadOutput" +// Skipping definition for base type 'Char' - b := 1 // skip error determinant - b += 1 // don't read error number +// Skipping definition for base type 'Void' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Double' - return v -} +// Skipping definition for base type 'Float' -// SequenceId returns the sequence id attached to the BadBadOutput error. -// This is mostly used internally. -func (err BadOutputError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Int16' -// BadId returns the 'BadValue' number if one exists for the BadBadOutput error. If no bad value exists, 0 is returned. -func (err BadOutputError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Int32' -// Error returns a rudimentary string representation of the BadBadOutput error. +// Skipping definition for base type 'Int8' -func (err BadOutputError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadOutput {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Card16' -func init() { - xgb.NewExtErrorFuncs["RANDR"][0] = BadOutputErrorNew -} +// Skipping definition for base type 'Card32' -// BadBadCrtc is the error number for a BadBadCrtc. -const BadBadCrtc = 1 - -type BadCrtcError struct { - Sequence uint16 - NiceName string -} - -// BadCrtcErrorNew constructs a BadCrtcError value that implements xgb.Error from a byte slice. -func BadCrtcErrorNew(buf []byte) xgb.Error { - v := BadCrtcError{} - v.NiceName = "BadCrtc" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadBadCrtc error. -// This is mostly used internally. -func (err BadCrtcError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadCrtc error. If no bad value exists, 0 is returned. -func (err BadCrtcError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadCrtc error. - -func (err BadCrtcError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadCrtc {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["RANDR"][1] = BadCrtcErrorNew -} - -// BadBadMode is the error number for a BadBadMode. -const BadBadMode = 2 - -type BadModeError struct { - Sequence uint16 - NiceName string -} - -// BadModeErrorNew constructs a BadModeError value that implements xgb.Error from a byte slice. -func BadModeErrorNew(buf []byte) xgb.Error { - v := BadModeError{} - v.NiceName = "BadMode" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadBadMode error. -// This is mostly used internally. -func (err BadModeError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadMode error. If no bad value exists, 0 is returned. -func (err BadModeError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadMode error. - -func (err BadModeError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["RANDR"][2] = BadModeErrorNew -} - -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// AddOutputModeCookie is a cookie used only for AddOutputMode requests. +type AddOutputModeCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { +// AddOutputMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) + return AddOutputModeCookie{cookie} +} + +// AddOutputModeChecked sends a checked request. +// If an error occurs, it can be retrieved using AddOutputModeCookie.Check() +func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) + return AddOutputModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AddOutputModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddOutputMode +// addOutputModeRequest writes a AddOutputMode request to a byte slice. +func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// ChangeOutputPropertyCookie is a cookie used only for ChangeOutputProperty requests. +type ChangeOutputPropertyCookie struct { + *xgb.Cookie +} + +// ChangeOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return ChangeOutputPropertyCookie{cookie} +} + +// ChangeOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeOutputPropertyCookie.Check() +func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) + return ChangeOutputPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeOutputProperty +// changeOutputPropertyRequest writes a ChangeOutputProperty request to a byte slice. +func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], NumUnits) + b += 4 + + copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) + b += xgb.Pad(int(((int(NumUnits) * int(Format)) / 8))) + + return buf +} + +// ConfigureOutputPropertyCookie is a cookie used only for ConfigureOutputProperty requests. +type ConfigureOutputPropertyCookie struct { + *xgb.Cookie +} + +// ConfigureOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) + return ConfigureOutputPropertyCookie{cookie} +} + +// ConfigureOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureOutputPropertyCookie.Check() +func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) + return ConfigureOutputPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ConfigureOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ConfigureOutputProperty +// configureOutputPropertyRequest writes a ConfigureOutputProperty request to a byte slice. +func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Range { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Values)); i++ { + xgb.Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CreateModeCookie is a cookie used only for CreateMode requests. +type CreateModeCookie struct { + *xgb.Cookie +} + +// CreateMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateModeCookie.Reply() +func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) + return CreateModeCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// CreateModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { +func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) + return CreateModeCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { +// CreateModeReply represents the data returned from a CreateMode request. +type CreateModeReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes + Mode Mode + // padding: 20 bytes } -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { +// Reply blocks and returns the reply data for a CreateMode request. +func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1259,12 +1471,12 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { if buf == nil { return nil, nil } - return queryVersionReply(buf), nil + return createModeReply(buf), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) +// createModeReply reads a byte slice into a CreateModeReply value. +func createModeReply(buf []byte) *CreateModeReply { + v := new(CreateModeReply) b := 1 // skip reply determinant b += 1 // padding @@ -1275,20 +1487,81 @@ func queryVersionReply(buf []byte) *QueryVersionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.MajorVersion = xgb.Get32(buf[b:]) + v.Mode = Mode(xgb.Get32(buf[b:])) b += 4 - v.MinorVersion = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding + b += 20 // padding return v } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { +// Write request to wire for CreateMode +// createModeRequest writes a CreateMode request to a byte slice. +func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) []byte { + size := xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + { + structBytes := ModeInfo.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + copy(buf[b:], Name[:len(Name)]) + b += xgb.Pad(int(len(Name))) + + return buf +} + +// DeleteOutputModeCookie is a cookie used only for DeleteOutputMode requests. +type DeleteOutputModeCookie struct { + *xgb.Cookie +} + +// DeleteOutputMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) + return DeleteOutputModeCookie{cookie} +} + +// DeleteOutputModeChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteOutputModeCookie.Check() +func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) + return DeleteOutputModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteOutputModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteOutputMode +// deleteOutputModeRequest writes a DeleteOutputMode request to a byte slice. +func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1296,62 +1569,175 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) buf[b] = c.Extensions["RANDR"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 19 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], MajorVersion) + xgb.Put32(buf[b:], uint32(Output)) b += 4 - xgb.Put32(buf[b:], MinorVersion) + xgb.Put32(buf[b:], uint32(Mode)) b += 4 return buf } -// SetScreenConfigCookie is a cookie used only for SetScreenConfig requests. -type SetScreenConfigCookie struct { +// DeleteOutputPropertyCookie is a cookie used only for DeleteOutputProperty requests. +type DeleteOutputPropertyCookie struct { *xgb.Cookie } -// SetScreenConfig sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetScreenConfigCookie.Reply() -func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { +// DeleteOutputProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) + return DeleteOutputPropertyCookie{cookie} +} + +// DeleteOutputPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteOutputPropertyCookie.Check() +func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) + return DeleteOutputPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteOutputPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteOutputProperty +// deleteOutputPropertyRequest writes a DeleteOutputProperty request to a byte slice. +func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + +// DestroyModeCookie is a cookie used only for DestroyMode requests. +type DestroyModeCookie struct { + *xgb.Cookie +} + +// DestroyMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyModeRequest(c, Mode), cookie) + return DestroyModeCookie{cookie} +} + +// DestroyModeChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyModeCookie.Check() +func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyModeRequest(c, Mode), cookie) + return DestroyModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyMode +// destroyModeRequest writes a DestroyMode request to a byte slice. +func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Mode)) + b += 4 + + return buf +} + +// GetCrtcGammaCookie is a cookie used only for GetCrtcGamma requests. +type GetCrtcGammaCookie struct { + *xgb.Cookie +} + +// GetCrtcGamma sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcGammaCookie.Reply() +func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) - return SetScreenConfigCookie{cookie} + c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) + return GetCrtcGammaCookie{cookie} } -// SetScreenConfigUnchecked sends an unchecked request. +// GetCrtcGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { +func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) - return SetScreenConfigCookie{cookie} + c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) + return GetCrtcGammaCookie{cookie} } -// SetScreenConfigReply represents the data returned from a SetScreenConfig request. -type SetScreenConfigReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte - NewTimestamp xproto.Timestamp - ConfigTimestamp xproto.Timestamp - Root xproto.Window - SubpixelOrder uint16 - // padding: 10 bytes +// GetCrtcGammaReply represents the data returned from a GetCrtcGamma request. +type GetCrtcGammaReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Size uint16 + // padding: 22 bytes + Red []uint16 // size: xgb.Pad((int(Size) * 2)) + Green []uint16 // size: xgb.Pad((int(Size) * 2)) + Blue []uint16 // size: xgb.Pad((int(Size) * 2)) } -// Reply blocks and returns the reply data for a SetScreenConfig request. -func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { +// Reply blocks and returns the reply data for a GetCrtcGamma request. +func (cook GetCrtcGammaCookie) Reply() (*GetCrtcGammaReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1359,12 +1745,225 @@ func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { if buf == nil { return nil, nil } - return setScreenConfigReply(buf), nil + return getCrtcGammaReply(buf), nil } -// setScreenConfigReply reads a byte slice into a SetScreenConfigReply value. -func setScreenConfigReply(buf []byte) *SetScreenConfigReply { - v := new(SetScreenConfigReply) +// getCrtcGammaReply reads a byte slice into a GetCrtcGammaReply value. +func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { + v := new(GetCrtcGammaReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Red = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Red[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Green = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Green[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Blue = make([]uint16, v.Size) + for i := 0; i < int(v.Size); i++ { + v.Blue[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCrtcGamma +// getCrtcGammaRequest writes a GetCrtcGamma request to a byte slice. +func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// GetCrtcGammaSizeCookie is a cookie used only for GetCrtcGammaSize requests. +type GetCrtcGammaSizeCookie struct { + *xgb.Cookie +} + +// GetCrtcGammaSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcGammaSizeCookie.Reply() +func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) + return GetCrtcGammaSizeCookie{cookie} +} + +// GetCrtcGammaSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) + return GetCrtcGammaSizeCookie{cookie} +} + +// GetCrtcGammaSizeReply represents the data returned from a GetCrtcGammaSize request. +type GetCrtcGammaSizeReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Size uint16 + // padding: 22 bytes +} + +// Reply blocks and returns the reply data for a GetCrtcGammaSize request. +func (cook GetCrtcGammaSizeCookie) Reply() (*GetCrtcGammaSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcGammaSizeReply(buf), nil +} + +// getCrtcGammaSizeReply reads a byte slice into a GetCrtcGammaSizeReply value. +func getCrtcGammaSizeReply(buf []byte) *GetCrtcGammaSizeReply { + v := new(GetCrtcGammaSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Size = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +// Write request to wire for GetCrtcGammaSize +// getCrtcGammaSizeRequest writes a GetCrtcGammaSize request to a byte slice. +func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// GetCrtcInfoCookie is a cookie used only for GetCrtcInfo requests. +type GetCrtcInfoCookie struct { + *xgb.Cookie +} + +// GetCrtcInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcInfoCookie.Reply() +func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) + return GetCrtcInfoCookie{cookie} +} + +// GetCrtcInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) + return GetCrtcInfoCookie{cookie} +} + +// GetCrtcInfoReply represents the data returned from a GetCrtcInfo request. +type GetCrtcInfoReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte + Timestamp xproto.Timestamp + X int16 + Y int16 + Width uint16 + Height uint16 + Mode Mode + Rotation uint16 + Rotations uint16 + NumOutputs uint16 + NumPossibleOutputs uint16 + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) +} + +// Reply blocks and returns the reply data for a GetCrtcInfo request. +func (cook GetCrtcInfoCookie) Reply() (*GetCrtcInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcInfoReply(buf), nil +} + +// getCrtcInfoReply reads a byte slice into a GetCrtcInfoReply value. +func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { + v := new(GetCrtcInfoReply) b := 1 // skip reply determinant v.Status = buf[b] @@ -1376,517 +1975,36 @@ func setScreenConfigReply(buf []byte) *SetScreenConfigReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.NewTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Root = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.SubpixelOrder = xgb.Get16(buf[b:]) - b += 2 - - b += 10 // padding - - return v -} - -// Write request to wire for SetScreenConfig -// setScreenConfigRequest writes a SetScreenConfig request to a byte slice. -func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Timestamp)) - b += 4 - - xgb.Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 - - xgb.Put16(buf[b:], SizeID) - b += 2 - - xgb.Put16(buf[b:], Rotation) - b += 2 - - xgb.Put16(buf[b:], Rate) - b += 2 - - b += 2 // padding - - return buf -} - -// SelectInputCookie is a cookie used only for SelectInput requests. -type SelectInputCookie struct { - *xgb.Cookie -} - -// SelectInput sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectInputRequest(c, Window, Enable), cookie) - return SelectInputCookie{cookie} -} - -// SelectInputChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectInputCookie.Check() -func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectInputRequest(c, Window, Enable), cookie) - return SelectInputCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectInputCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectInput -// selectInputRequest writes a SelectInput request to a byte slice. -func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], Enable) - b += 2 - - b += 2 // padding - - return buf -} - -// GetScreenInfoCookie is a cookie used only for GetScreenInfo requests. -type GetScreenInfoCookie struct { - *xgb.Cookie -} - -// GetScreenInfo sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenInfoCookie.Reply() -func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getScreenInfoRequest(c, Window), cookie) - return GetScreenInfoCookie{cookie} -} - -// GetScreenInfoUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getScreenInfoRequest(c, Window), cookie) - return GetScreenInfoCookie{cookie} -} - -// GetScreenInfoReply represents the data returned from a GetScreenInfo request. -type GetScreenInfoReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Rotations byte - Root xproto.Window - Timestamp xproto.Timestamp - ConfigTimestamp xproto.Timestamp - NSizes uint16 - SizeID uint16 - Rotation uint16 - Rate uint16 - NInfo uint16 - // padding: 2 bytes - Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) - Rates []RefreshRates // size: RefreshRatesListSize(Rates) -} - -// Reply blocks and returns the reply data for a GetScreenInfo request. -func (cook GetScreenInfoCookie) Reply() (*GetScreenInfoReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getScreenInfoReply(buf), nil -} - -// getScreenInfoReply reads a byte slice into a GetScreenInfoReply value. -func getScreenInfoReply(buf []byte) *GetScreenInfoReply { - v := new(GetScreenInfoReply) - b := 1 // skip reply determinant - - v.Rotations = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) b += 4 - v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Mode = Mode(xgb.Get32(buf[b:])) b += 4 - v.NSizes = xgb.Get16(buf[b:]) - b += 2 - - v.SizeID = xgb.Get16(buf[b:]) - b += 2 - v.Rotation = xgb.Get16(buf[b:]) b += 2 - v.Rate = xgb.Get16(buf[b:]) - b += 2 - - v.NInfo = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Sizes = make([]ScreenSize, v.NSizes) - b += ScreenSizeReadList(buf[b:], v.Sizes) - - v.Rates = make([]RefreshRates, (int(v.NInfo) - int(v.NSizes))) - b += RefreshRatesReadList(buf[b:], v.Rates) - - return v -} - -// Write request to wire for GetScreenInfo -// getScreenInfoRequest writes a GetScreenInfo request to a byte slice. -func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// GetScreenSizeRangeCookie is a cookie used only for GetScreenSizeRange requests. -type GetScreenSizeRangeCookie struct { - *xgb.Cookie -} - -// GetScreenSizeRange sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenSizeRangeCookie.Reply() -func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) - return GetScreenSizeRangeCookie{cookie} -} - -// GetScreenSizeRangeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) - return GetScreenSizeRangeCookie{cookie} -} - -// GetScreenSizeRangeReply represents the data returned from a GetScreenSizeRange request. -type GetScreenSizeRangeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MinWidth uint16 - MinHeight uint16 - MaxWidth uint16 - MaxHeight uint16 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a GetScreenSizeRange request. -func (cook GetScreenSizeRangeCookie) Reply() (*GetScreenSizeRangeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getScreenSizeRangeReply(buf), nil -} - -// getScreenSizeRangeReply reads a byte slice into a GetScreenSizeRangeReply value. -func getScreenSizeRangeReply(buf []byte) *GetScreenSizeRangeReply { - v := new(GetScreenSizeRangeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MinWidth = xgb.Get16(buf[b:]) - b += 2 - - v.MinHeight = xgb.Get16(buf[b:]) - b += 2 - - v.MaxWidth = xgb.Get16(buf[b:]) - b += 2 - - v.MaxHeight = xgb.Get16(buf[b:]) - b += 2 - - b += 16 // padding - - return v -} - -// Write request to wire for GetScreenSizeRange -// getScreenSizeRangeRequest writes a GetScreenSizeRange request to a byte slice. -func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// SetScreenSizeCookie is a cookie used only for SetScreenSize requests. -type SetScreenSizeCookie struct { - *xgb.Cookie -} - -// SetScreenSize sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) - return SetScreenSizeCookie{cookie} -} - -// SetScreenSizeChecked sends a checked request. -// If an error occurs, it can be retrieved using SetScreenSizeCookie.Check() -func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) - return SetScreenSizeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetScreenSizeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetScreenSize -// setScreenSizeRequest writes a SetScreenSize request to a byte slice. -func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - xgb.Put32(buf[b:], MmWidth) - b += 4 - - xgb.Put32(buf[b:], MmHeight) - b += 4 - - return buf -} - -// GetScreenResourcesCookie is a cookie used only for GetScreenResources requests. -type GetScreenResourcesCookie struct { - *xgb.Cookie -} - -// GetScreenResources sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCookie.Reply() -func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getScreenResourcesRequest(c, Window), cookie) - return GetScreenResourcesCookie{cookie} -} - -// GetScreenResourcesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getScreenResourcesRequest(c, Window), cookie) - return GetScreenResourcesCookie{cookie} -} - -// GetScreenResourcesReply represents the data returned from a GetScreenResources request. -type GetScreenResourcesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Timestamp xproto.Timestamp - ConfigTimestamp xproto.Timestamp - NumCrtcs uint16 - NumOutputs uint16 - NumModes uint16 - NamesLen uint16 - // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetScreenResources request. -func (cook GetScreenResourcesCookie) Reply() (*GetScreenResourcesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getScreenResourcesReply(buf), nil -} - -// getScreenResourcesReply reads a byte slice into a GetScreenResourcesReply value. -func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { - v := new(GetScreenResourcesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.NumCrtcs = xgb.Get16(buf[b:]) + v.Rotations = xgb.Get16(buf[b:]) b += 2 v.NumOutputs = xgb.Get16(buf[b:]) b += 2 - v.NumModes = xgb.Get16(buf[b:]) + v.NumPossibleOutputs = xgb.Get16(buf[b:]) b += 2 - v.NamesLen = xgb.Get16(buf[b:]) - b += 2 - - b += 8 // padding - - v.Crtcs = make([]Crtc, v.NumCrtcs) - for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) @@ -1894,19 +2012,176 @@ func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { } b = xgb.Pad(b) - v.Modes = make([]ModeInfo, v.NumModes) - b += ModeInfoReadList(buf[b:], v.Modes) - - v.Names = make([]byte, v.NamesLen) - copy(v.Names[:v.NamesLen], buf[b:]) - b += xgb.Pad(int(v.NamesLen)) + v.Possible = make([]Output, v.NumPossibleOutputs) + for i := 0; i < int(v.NumPossibleOutputs); i++ { + v.Possible[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) return v } -// Write request to wire for GetScreenResources -// getScreenResourcesRequest writes a GetScreenResources request to a byte slice. -func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { +// Write request to wire for GetCrtcInfo +// getCrtcInfoRequest writes a GetCrtcInfo request to a byte slice. +func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// GetCrtcTransformCookie is a cookie used only for GetCrtcTransform requests. +type GetCrtcTransformCookie struct { + *xgb.Cookie +} + +// GetCrtcTransform sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCrtcTransformCookie.Reply() +func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) + return GetCrtcTransformCookie{cookie} +} + +// GetCrtcTransformUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) + return GetCrtcTransformCookie{cookie} +} + +// GetCrtcTransformReply represents the data returned from a GetCrtcTransform request. +type GetCrtcTransformReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + PendingTransform render.Transform + HasTransforms bool + // padding: 3 bytes + CurrentTransform render.Transform + // padding: 4 bytes + PendingLen uint16 + PendingNparams uint16 + CurrentLen uint16 + CurrentNparams uint16 + PendingFilterName string // size: xgb.Pad((int(PendingLen) * 1)) + PendingParams []render.Fixed // size: xgb.Pad((int(PendingNparams) * 4)) + CurrentFilterName string // size: xgb.Pad((int(CurrentLen) * 1)) + CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) +} + +// Reply blocks and returns the reply data for a GetCrtcTransform request. +func (cook GetCrtcTransformCookie) Reply() (*GetCrtcTransformReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getCrtcTransformReply(buf), nil +} + +// getCrtcTransformReply reads a byte slice into a GetCrtcTransformReply value. +func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { + v := new(GetCrtcTransformReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PendingTransform = render.Transform{} + b += render.TransformRead(buf[b:], &v.PendingTransform) + + if buf[b] == 1 { + v.HasTransforms = true + } else { + v.HasTransforms = false + } + b += 1 + + b += 3 // padding + + v.CurrentTransform = render.Transform{} + b += render.TransformRead(buf[b:], &v.CurrentTransform) + + b += 4 // padding + + v.PendingLen = xgb.Get16(buf[b:]) + b += 2 + + v.PendingNparams = xgb.Get16(buf[b:]) + b += 2 + + v.CurrentLen = xgb.Get16(buf[b:]) + b += 2 + + v.CurrentNparams = xgb.Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.PendingLen) + copy(byteString[:v.PendingLen], buf[b:]) + v.PendingFilterName = string(byteString) + b += xgb.Pad(int(v.PendingLen)) + } + + v.PendingParams = make([]render.Fixed, v.PendingNparams) + for i := 0; i < int(v.PendingNparams); i++ { + v.PendingParams[i] = render.Fixed(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + { + byteString := make([]byte, v.CurrentLen) + copy(byteString[:v.CurrentLen], buf[b:]) + v.CurrentFilterName = string(byteString) + b += xgb.Pad(int(v.CurrentLen)) + } + + v.CurrentParams = make([]render.Fixed, v.CurrentNparams) + for i := 0; i < int(v.CurrentNparams); i++ { + v.CurrentParams[i] = render.Fixed(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetCrtcTransform +// getCrtcTransformRequest writes a GetCrtcTransform request to a byte slice. +func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1914,13 +2189,13 @@ func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { buf[b] = c.Extensions["RANDR"] b += 1 - buf[b] = 8 // request opcode + buf[b] = 27 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Crtc)) b += 4 return buf @@ -2087,6 +2362,867 @@ func getOutputInfoRequest(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Tim return buf } +// GetOutputPrimaryCookie is a cookie used only for GetOutputPrimary requests. +type GetOutputPrimaryCookie struct { + *xgb.Cookie +} + +// GetOutputPrimary sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOutputPrimaryCookie.Reply() +func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) + return GetOutputPrimaryCookie{cookie} +} + +// GetOutputPrimaryUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) + return GetOutputPrimaryCookie{cookie} +} + +// GetOutputPrimaryReply represents the data returned from a GetOutputPrimary request. +type GetOutputPrimaryReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Output Output +} + +// Reply blocks and returns the reply data for a GetOutputPrimary request. +func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOutputPrimaryReply(buf), nil +} + +// getOutputPrimaryReply reads a byte slice into a GetOutputPrimaryReply value. +func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { + v := new(GetOutputPrimaryReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Output = Output(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetOutputPrimary +// getOutputPrimaryRequest writes a GetOutputPrimary request to a byte slice. +func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetOutputPropertyCookie is a cookie used only for GetOutputProperty requests. +type GetOutputPropertyCookie struct { + *xgb.Cookie +} + +// GetOutputProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetOutputPropertyCookie.Reply() +func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetOutputPropertyCookie{cookie} +} + +// GetOutputPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetOutputPropertyCookie{cookie} +} + +// GetOutputPropertyReply represents the data returned from a GetOutputProperty request. +type GetOutputPropertyReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Format byte + Type xproto.Atom + BytesAfter uint32 + NumItems uint32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)) +} + +// Reply blocks and returns the reply data for a GetOutputProperty request. +func (cook GetOutputPropertyCookie) Reply() (*GetOutputPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getOutputPropertyReply(buf), nil +} + +// getOutputPropertyReply reads a byte slice into a GetOutputPropertyReply value. +func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { + v := new(GetOutputPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.BytesAfter = xgb.Get32(buf[b:]) + b += 4 + + v.NumItems = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) + copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) + b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + + return v +} + +// Write request to wire for GetOutputProperty +// getOutputPropertyRequest writes a GetOutputProperty request to a byte slice. +func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Output)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + xgb.Put32(buf[b:], LongOffset) + b += 4 + + xgb.Put32(buf[b:], LongLength) + b += 4 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + return buf +} + +// GetPanningCookie is a cookie used only for GetPanning requests. +type GetPanningCookie struct { + *xgb.Cookie +} + +// GetPanning sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPanningCookie.Reply() +func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getPanningRequest(c, Crtc), cookie) + return GetPanningCookie{cookie} +} + +// GetPanningUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getPanningRequest(c, Crtc), cookie) + return GetPanningCookie{cookie} +} + +// GetPanningReply represents the data returned from a GetPanning request. +type GetPanningReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte + Timestamp xproto.Timestamp + Left uint16 + Top uint16 + Width uint16 + Height uint16 + TrackLeft uint16 + TrackTop uint16 + TrackWidth uint16 + TrackHeight uint16 + BorderLeft int16 + BorderTop int16 + BorderRight int16 + BorderBottom int16 +} + +// Reply blocks and returns the reply data for a GetPanning request. +func (cook GetPanningCookie) Reply() (*GetPanningReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPanningReply(buf), nil +} + +// getPanningReply reads a byte slice into a GetPanningReply value. +func getPanningReply(buf []byte) *GetPanningReply { + v := new(GetPanningReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Left = xgb.Get16(buf[b:]) + b += 2 + + v.Top = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.TrackLeft = xgb.Get16(buf[b:]) + b += 2 + + v.TrackTop = xgb.Get16(buf[b:]) + b += 2 + + v.TrackWidth = xgb.Get16(buf[b:]) + b += 2 + + v.TrackHeight = xgb.Get16(buf[b:]) + b += 2 + + v.BorderLeft = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderTop = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderRight = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BorderBottom = int16(xgb.Get16(buf[b:])) + b += 2 + + return v +} + +// Write request to wire for GetPanning +// getPanningRequest writes a GetPanning request to a byte slice. +func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Crtc)) + b += 4 + + return buf +} + +// GetScreenInfoCookie is a cookie used only for GetScreenInfo requests. +type GetScreenInfoCookie struct { + *xgb.Cookie +} + +// GetScreenInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenInfoCookie.Reply() +func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenInfoRequest(c, Window), cookie) + return GetScreenInfoCookie{cookie} +} + +// GetScreenInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenInfoRequest(c, Window), cookie) + return GetScreenInfoCookie{cookie} +} + +// GetScreenInfoReply represents the data returned from a GetScreenInfo request. +type GetScreenInfoReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Rotations byte + Root xproto.Window + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NSizes uint16 + SizeID uint16 + Rotation uint16 + Rate uint16 + NInfo uint16 + // padding: 2 bytes + Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) + Rates []RefreshRates // size: RefreshRatesListSize(Rates) +} + +// Reply blocks and returns the reply data for a GetScreenInfo request. +func (cook GetScreenInfoCookie) Reply() (*GetScreenInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenInfoReply(buf), nil +} + +// getScreenInfoReply reads a byte slice into a GetScreenInfoReply value. +func getScreenInfoReply(buf []byte) *GetScreenInfoReply { + v := new(GetScreenInfoReply) + b := 1 // skip reply determinant + + v.Rotations = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NSizes = xgb.Get16(buf[b:]) + b += 2 + + v.SizeID = xgb.Get16(buf[b:]) + b += 2 + + v.Rotation = xgb.Get16(buf[b:]) + b += 2 + + v.Rate = xgb.Get16(buf[b:]) + b += 2 + + v.NInfo = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Sizes = make([]ScreenSize, v.NSizes) + b += ScreenSizeReadList(buf[b:], v.Sizes) + + v.Rates = make([]RefreshRates, (int(v.NInfo) - int(v.NSizes))) + b += RefreshRatesReadList(buf[b:], v.Rates) + + return v +} + +// Write request to wire for GetScreenInfo +// getScreenInfoRequest writes a GetScreenInfo request to a byte slice. +func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetScreenResourcesCookie is a cookie used only for GetScreenResources requests. +type GetScreenResourcesCookie struct { + *xgb.Cookie +} + +// GetScreenResources sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCookie.Reply() +func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenResourcesRequest(c, Window), cookie) + return GetScreenResourcesCookie{cookie} +} + +// GetScreenResourcesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenResourcesRequest(c, Window), cookie) + return GetScreenResourcesCookie{cookie} +} + +// GetScreenResourcesReply represents the data returned from a GetScreenResources request. +type GetScreenResourcesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetScreenResources request. +func (cook GetScreenResourcesCookie) Reply() (*GetScreenResourcesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenResourcesReply(buf), nil +} + +// getScreenResourcesReply reads a byte slice into a GetScreenResourcesReply value. +func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { + v := new(GetScreenResourcesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumModes = xgb.Get16(buf[b:]) + b += 2 + + v.NamesLen = xgb.Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Modes = make([]ModeInfo, v.NumModes) + b += ModeInfoReadList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += xgb.Pad(int(v.NamesLen)) + + return v +} + +// Write request to wire for GetScreenResources +// getScreenResourcesRequest writes a GetScreenResources request to a byte slice. +func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetScreenResourcesCurrentCookie is a cookie used only for GetScreenResourcesCurrent requests. +type GetScreenResourcesCurrentCookie struct { + *xgb.Cookie +} + +// GetScreenResourcesCurrent sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCurrentCookie.Reply() +func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) + return GetScreenResourcesCurrentCookie{cookie} +} + +// GetScreenResourcesCurrentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) + return GetScreenResourcesCurrentCookie{cookie} +} + +// GetScreenResourcesCurrentReply represents the data returned from a GetScreenResourcesCurrent request. +type GetScreenResourcesCurrentReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Timestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + NumCrtcs uint16 + NumOutputs uint16 + NumModes uint16 + NamesLen uint16 + // padding: 8 bytes + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetScreenResourcesCurrent request. +func (cook GetScreenResourcesCurrentCookie) Reply() (*GetScreenResourcesCurrentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenResourcesCurrentReply(buf), nil +} + +// getScreenResourcesCurrentReply reads a byte slice into a GetScreenResourcesCurrentReply value. +func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply { + v := new(GetScreenResourcesCurrentReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumModes = xgb.Get16(buf[b:]) + b += 2 + + v.NamesLen = xgb.Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Modes = make([]ModeInfo, v.NumModes) + b += ModeInfoReadList(buf[b:], v.Modes) + + v.Names = make([]byte, v.NamesLen) + copy(v.Names[:v.NamesLen], buf[b:]) + b += xgb.Pad(int(v.NamesLen)) + + return v +} + +// Write request to wire for GetScreenResourcesCurrent +// getScreenResourcesCurrentRequest writes a GetScreenResourcesCurrent request to a byte slice. +func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetScreenSizeRangeCookie is a cookie used only for GetScreenSizeRange requests. +type GetScreenSizeRangeCookie struct { + *xgb.Cookie +} + +// GetScreenSizeRange sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSizeRangeCookie.Reply() +func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) + return GetScreenSizeRangeCookie{cookie} +} + +// GetScreenSizeRangeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenSizeRangeRequest(c, Window), cookie) + return GetScreenSizeRangeCookie{cookie} +} + +// GetScreenSizeRangeReply represents the data returned from a GetScreenSizeRange request. +type GetScreenSizeRangeReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MinWidth uint16 + MinHeight uint16 + MaxWidth uint16 + MaxHeight uint16 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a GetScreenSizeRange request. +func (cook GetScreenSizeRangeCookie) Reply() (*GetScreenSizeRangeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenSizeRangeReply(buf), nil +} + +// getScreenSizeRangeReply reads a byte slice into a GetScreenSizeRangeReply value. +func getScreenSizeRangeReply(buf []byte) *GetScreenSizeRangeReply { + v := new(GetScreenSizeRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinWidth = xgb.Get16(buf[b:]) + b += 2 + + v.MinHeight = xgb.Get16(buf[b:]) + b += 2 + + v.MaxWidth = xgb.Get16(buf[b:]) + b += 2 + + v.MaxHeight = xgb.Get16(buf[b:]) + b += 2 + + b += 16 // padding + + return v +} + +// Write request to wire for GetScreenSizeRange +// getScreenSizeRangeRequest writes a GetScreenSizeRange request to a byte slice. +func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + // ListOutputPropertiesCookie is a cookie used only for ListOutputProperties requests. type ListOutputPropertiesCookie struct { *xgb.Cookie @@ -2308,390 +3444,45 @@ func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom return buf } -// ConfigureOutputPropertyCookie is a cookie used only for ConfigureOutputProperty requests. -type ConfigureOutputPropertyCookie struct { +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { *xgb.Cookie } -// ConfigureOutputProperty sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) - return ConfigureOutputPropertyCookie{cookie} -} - -// ConfigureOutputPropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using ConfigureOutputPropertyCookie.Check() -func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(configureOutputPropertyRequest(c, Output, Property, Pending, Range, Values), cookie) - return ConfigureOutputPropertyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ConfigureOutputPropertyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ConfigureOutputProperty -// configureOutputPropertyRequest writes a ConfigureOutputProperty request to a byte slice. -func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - if Pending { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Range { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - for i := 0; i < int(len(Values)); i++ { - xgb.Put32(buf[b:], uint32(Values[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeOutputPropertyCookie is a cookie used only for ChangeOutputProperty requests. -type ChangeOutputPropertyCookie struct { - *xgb.Cookie -} - -// ChangeOutputProperty sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) - return ChangeOutputPropertyCookie{cookie} -} - -// ChangeOutputPropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeOutputPropertyCookie.Check() -func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeOutputPropertyRequest(c, Output, Property, Type, Format, Mode, NumUnits, Data), cookie) - return ChangeOutputPropertyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeOutputPropertyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeOutputProperty -// changeOutputPropertyRequest writes a ChangeOutputProperty request to a byte slice. -func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) []byte { - size := xgb.Pad((24 + xgb.Pad((((int(NumUnits) * int(Format)) / 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - xgb.Put32(buf[b:], uint32(Type)) - b += 4 - - buf[b] = Format - b += 1 - - buf[b] = Mode - b += 1 - - b += 2 // padding - - xgb.Put32(buf[b:], NumUnits) - b += 4 - - copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) - b += xgb.Pad(int(((int(NumUnits) * int(Format)) / 8))) - - return buf -} - -// DeleteOutputPropertyCookie is a cookie used only for DeleteOutputProperty requests. -type DeleteOutputPropertyCookie struct { - *xgb.Cookie -} - -// DeleteOutputProperty sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) - return DeleteOutputPropertyCookie{cookie} -} - -// DeleteOutputPropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using DeleteOutputPropertyCookie.Check() -func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deleteOutputPropertyRequest(c, Output, Property), cookie) - return DeleteOutputPropertyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeleteOutputPropertyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeleteOutputProperty -// deleteOutputPropertyRequest writes a DeleteOutputProperty request to a byte slice. -func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// GetOutputPropertyCookie is a cookie used only for GetOutputProperty requests. -type GetOutputPropertyCookie struct { - *xgb.Cookie -} - -// GetOutputProperty sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetOutputPropertyCookie.Reply() -func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) - return GetOutputPropertyCookie{cookie} + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} } -// GetOutputPropertyUnchecked sends an unchecked request. +// QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { +func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getOutputPropertyRequest(c, Output, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) - return GetOutputPropertyCookie{cookie} + c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie) + return QueryVersionCookie{cookie} } -// GetOutputPropertyReply represents the data returned from a GetOutputProperty request. -type GetOutputPropertyReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Format byte - Type xproto.Atom - BytesAfter uint32 - NumItems uint32 - // padding: 12 bytes - Data []byte // size: xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)) -} - -// Reply blocks and returns the reply data for a GetOutputProperty request. -func (cook GetOutputPropertyCookie) Reply() (*GetOutputPropertyReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getOutputPropertyReply(buf), nil -} - -// getOutputPropertyReply reads a byte slice into a GetOutputPropertyReply value. -func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { - v := new(GetOutputPropertyReply) - b := 1 // skip reply determinant - - v.Format = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Type = xproto.Atom(xgb.Get32(buf[b:])) - b += 4 - - v.BytesAfter = xgb.Get32(buf[b:]) - b += 4 - - v.NumItems = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) - copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) - b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) - - return v -} - -// Write request to wire for GetOutputProperty -// getOutputPropertyRequest writes a GetOutputProperty request to a byte slice. -func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - xgb.Put32(buf[b:], uint32(Type)) - b += 4 - - xgb.Put32(buf[b:], LongOffset) - b += 4 - - xgb.Put32(buf[b:], LongLength) - b += 4 - - if Delete { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if Pending { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - return buf -} - -// CreateModeCookie is a cookie used only for CreateMode requests. -type CreateModeCookie struct { - *xgb.Cookie -} - -// CreateMode sends a checked request. -// If an error occurs, it will be returned with the reply by calling CreateModeCookie.Reply() -func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) - return CreateModeCookie{cookie} -} - -// CreateModeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(createModeRequest(c, Window, ModeInfo, Name), cookie) - return CreateModeCookie{cookie} -} - -// CreateModeReply represents the data returned from a CreateMode request. -type CreateModeReply struct { +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Mode Mode - // padding: 20 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes } -// Reply blocks and returns the reply data for a CreateMode request. -func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -2699,12 +3490,12 @@ func (cook CreateModeCookie) Reply() (*CreateModeReply, error) { if buf == nil { return nil, nil } - return createModeReply(buf), nil + return queryVersionReply(buf), nil } -// createModeReply reads a byte slice into a CreateModeReply value. -func createModeReply(buf []byte) *CreateModeReply { - v := new(CreateModeReply) +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) b := 1 // skip reply determinant b += 1 // padding @@ -2715,25 +3506,86 @@ func createModeReply(buf []byte) *CreateModeReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Mode = Mode(xgb.Get32(buf[b:])) + v.MajorVersion = xgb.Get32(buf[b:]) b += 4 - b += 20 // padding + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding return v } -// Write request to wire for CreateMode -// createModeRequest writes a CreateMode request to a byte slice. -func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) []byte { - size := xgb.Pad((40 + xgb.Pad((len(Name) * 1)))) +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RANDR"] b += 1 - buf[b] = 16 // request opcode + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], MajorVersion) + b += 4 + + xgb.Put32(buf[b:], MinorVersion) + b += 4 + + return buf +} + +// SelectInputCookie is a cookie used only for SelectInput requests. +type SelectInputCookie struct { + *xgb.Cookie +} + +// SelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectInputRequest(c, Window, Enable), cookie) + return SelectInputCookie{cookie} +} + +// SelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectInputCookie.Check() +func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectInputRequest(c, Window, Enable), cookie) + return SelectInputCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. +func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 4 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2742,329 +3594,10 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam xgb.Put32(buf[b:], uint32(Window)) b += 4 - { - structBytes := ModeInfo.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - copy(buf[b:], Name[:len(Name)]) - b += xgb.Pad(int(len(Name))) - - return buf -} - -// DestroyModeCookie is a cookie used only for DestroyMode requests. -type DestroyModeCookie struct { - *xgb.Cookie -} - -// DestroyMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyModeRequest(c, Mode), cookie) - return DestroyModeCookie{cookie} -} - -// DestroyModeChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyModeCookie.Check() -func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyModeRequest(c, Mode), cookie) - return DestroyModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyMode -// destroyModeRequest writes a DestroyMode request to a byte slice. -func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], Enable) b += 2 - xgb.Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// AddOutputModeCookie is a cookie used only for AddOutputMode requests. -type AddOutputModeCookie struct { - *xgb.Cookie -} - -// AddOutputMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) - return AddOutputModeCookie{cookie} -} - -// AddOutputModeChecked sends a checked request. -// If an error occurs, it can be retrieved using AddOutputModeCookie.Check() -func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(addOutputModeRequest(c, Output, Mode), cookie) - return AddOutputModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AddOutputModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AddOutputMode -// addOutputModeRequest writes a AddOutputMode request to a byte slice. -func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// DeleteOutputModeCookie is a cookie used only for DeleteOutputMode requests. -type DeleteOutputModeCookie struct { - *xgb.Cookie -} - -// DeleteOutputMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) - return DeleteOutputModeCookie{cookie} -} - -// DeleteOutputModeChecked sends a checked request. -// If an error occurs, it can be retrieved using DeleteOutputModeCookie.Check() -func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deleteOutputModeRequest(c, Output, Mode), cookie) - return DeleteOutputModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeleteOutputModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeleteOutputMode -// deleteOutputModeRequest writes a DeleteOutputMode request to a byte slice. -func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - xgb.Put32(buf[b:], uint32(Mode)) - b += 4 - - return buf -} - -// GetCrtcInfoCookie is a cookie used only for GetCrtcInfo requests. -type GetCrtcInfoCookie struct { - *xgb.Cookie -} - -// GetCrtcInfo sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCrtcInfoCookie.Reply() -func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) - return GetCrtcInfoCookie{cookie} -} - -// GetCrtcInfoUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getCrtcInfoRequest(c, Crtc, ConfigTimestamp), cookie) - return GetCrtcInfoCookie{cookie} -} - -// GetCrtcInfoReply represents the data returned from a GetCrtcInfo request. -type GetCrtcInfoReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte - Timestamp xproto.Timestamp - X int16 - Y int16 - Width uint16 - Height uint16 - Mode Mode - Rotation uint16 - Rotations uint16 - NumOutputs uint16 - NumPossibleOutputs uint16 - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) -} - -// Reply blocks and returns the reply data for a GetCrtcInfo request. -func (cook GetCrtcInfoCookie) Reply() (*GetCrtcInfoReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCrtcInfoReply(buf), nil -} - -// getCrtcInfoReply reads a byte slice into a GetCrtcInfoReply value. -func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { - v := new(GetCrtcInfoReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.Mode = Mode(xgb.Get32(buf[b:])) - b += 4 - - v.Rotation = xgb.Get16(buf[b:]) - b += 2 - - v.Rotations = xgb.Get16(buf[b:]) - b += 2 - - v.NumOutputs = xgb.Get16(buf[b:]) - b += 2 - - v.NumPossibleOutputs = xgb.Get16(buf[b:]) - b += 2 - - v.Outputs = make([]Output, v.NumOutputs) - for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = Output(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.Possible = make([]Output, v.NumPossibleOutputs) - for i := 0; i < int(v.NumPossibleOutputs); i++ { - v.Possible[i] = Output(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetCrtcInfo -// getCrtcInfoRequest writes a GetCrtcInfo request to a byte slice. -func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Crtc)) - b += 4 - - xgb.Put32(buf[b:], uint32(ConfigTimestamp)) - b += 4 + b += 2 // padding return buf } @@ -3187,212 +3720,6 @@ func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Co return buf } -// GetCrtcGammaSizeCookie is a cookie used only for GetCrtcGammaSize requests. -type GetCrtcGammaSizeCookie struct { - *xgb.Cookie -} - -// GetCrtcGammaSize sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCrtcGammaSizeCookie.Reply() -func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) - return GetCrtcGammaSizeCookie{cookie} -} - -// GetCrtcGammaSizeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getCrtcGammaSizeRequest(c, Crtc), cookie) - return GetCrtcGammaSizeCookie{cookie} -} - -// GetCrtcGammaSizeReply represents the data returned from a GetCrtcGammaSize request. -type GetCrtcGammaSizeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Size uint16 - // padding: 22 bytes -} - -// Reply blocks and returns the reply data for a GetCrtcGammaSize request. -func (cook GetCrtcGammaSizeCookie) Reply() (*GetCrtcGammaSizeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCrtcGammaSizeReply(buf), nil -} - -// getCrtcGammaSizeReply reads a byte slice into a GetCrtcGammaSizeReply value. -func getCrtcGammaSizeReply(buf []byte) *GetCrtcGammaSizeReply { - v := new(GetCrtcGammaSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -// Write request to wire for GetCrtcGammaSize -// getCrtcGammaSizeRequest writes a GetCrtcGammaSize request to a byte slice. -func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - -// GetCrtcGammaCookie is a cookie used only for GetCrtcGamma requests. -type GetCrtcGammaCookie struct { - *xgb.Cookie -} - -// GetCrtcGamma sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCrtcGammaCookie.Reply() -func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) - return GetCrtcGammaCookie{cookie} -} - -// GetCrtcGammaUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getCrtcGammaRequest(c, Crtc), cookie) - return GetCrtcGammaCookie{cookie} -} - -// GetCrtcGammaReply represents the data returned from a GetCrtcGamma request. -type GetCrtcGammaReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Size uint16 - // padding: 22 bytes - Red []uint16 // size: xgb.Pad((int(Size) * 2)) - Green []uint16 // size: xgb.Pad((int(Size) * 2)) - Blue []uint16 // size: xgb.Pad((int(Size) * 2)) -} - -// Reply blocks and returns the reply data for a GetCrtcGamma request. -func (cook GetCrtcGammaCookie) Reply() (*GetCrtcGammaReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCrtcGammaReply(buf), nil -} - -// getCrtcGammaReply reads a byte slice into a GetCrtcGammaReply value. -func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { - v := new(GetCrtcGammaReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Size = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Red = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Red[i] = xgb.Get16(buf[b:]) - b += 2 - } - b = xgb.Pad(b) - - v.Green = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Green[i] = xgb.Get16(buf[b:]) - b += 2 - } - b = xgb.Pad(b) - - v.Blue = make([]uint16, v.Size) - for i := 0; i < int(v.Size); i++ { - v.Blue[i] = xgb.Get16(buf[b:]) - b += 2 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetCrtcGamma -// getCrtcGammaRequest writes a GetCrtcGamma request to a byte slice. -func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Crtc)) - b += 4 - - return buf -} - // SetCrtcGammaCookie is a cookie used only for SetCrtcGamma requests. type SetCrtcGammaCookie struct { *xgb.Cookie @@ -3471,142 +3798,6 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree return buf } -// GetScreenResourcesCurrentCookie is a cookie used only for GetScreenResourcesCurrent requests. -type GetScreenResourcesCurrentCookie struct { - *xgb.Cookie -} - -// GetScreenResourcesCurrent sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenResourcesCurrentCookie.Reply() -func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) - return GetScreenResourcesCurrentCookie{cookie} -} - -// GetScreenResourcesCurrentUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getScreenResourcesCurrentRequest(c, Window), cookie) - return GetScreenResourcesCurrentCookie{cookie} -} - -// GetScreenResourcesCurrentReply represents the data returned from a GetScreenResourcesCurrent request. -type GetScreenResourcesCurrentReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Timestamp xproto.Timestamp - ConfigTimestamp xproto.Timestamp - NumCrtcs uint16 - NumOutputs uint16 - NumModes uint16 - NamesLen uint16 - // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetScreenResourcesCurrent request. -func (cook GetScreenResourcesCurrentCookie) Reply() (*GetScreenResourcesCurrentReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getScreenResourcesCurrentReply(buf), nil -} - -// getScreenResourcesCurrentReply reads a byte slice into a GetScreenResourcesCurrentReply value. -func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply { - v := new(GetScreenResourcesCurrentReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.NumCrtcs = xgb.Get16(buf[b:]) - b += 2 - - v.NumOutputs = xgb.Get16(buf[b:]) - b += 2 - - v.NumModes = xgb.Get16(buf[b:]) - b += 2 - - v.NamesLen = xgb.Get16(buf[b:]) - b += 2 - - b += 8 // padding - - v.Crtcs = make([]Crtc, v.NumCrtcs) - for i := 0; i < int(v.NumCrtcs); i++ { - v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.Outputs = make([]Output, v.NumOutputs) - for i := 0; i < int(v.NumOutputs); i++ { - v.Outputs[i] = Output(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.Modes = make([]ModeInfo, v.NumModes) - b += ModeInfoReadList(buf[b:], v.Modes) - - v.Names = make([]byte, v.NamesLen) - copy(v.Names[:v.NamesLen], buf[b:]) - b += xgb.Pad(int(v.NamesLen)) - - return v -} - -// Write request to wire for GetScreenResourcesCurrent -// getScreenResourcesCurrentRequest writes a GetScreenResourcesCurrent request to a byte slice. -func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - // SetCrtcTransformCookie is a cookie used only for SetCrtcTransform requests. type SetCrtcTransformCookie struct { *xgb.Cookie @@ -3682,292 +3873,59 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, return buf } -// GetCrtcTransformCookie is a cookie used only for GetCrtcTransform requests. -type GetCrtcTransformCookie struct { +// SetOutputPrimaryCookie is a cookie used only for SetOutputPrimary requests. +type SetOutputPrimaryCookie struct { *xgb.Cookie } -// GetCrtcTransform sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCrtcTransformCookie.Reply() -func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) - return GetCrtcTransformCookie{cookie} -} - -// GetCrtcTransformUnchecked sends an unchecked request. +// SetOutputPrimary sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { +func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(getCrtcTransformRequest(c, Crtc), cookie) - return GetCrtcTransformCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) + return SetOutputPrimaryCookie{cookie} } -// GetCrtcTransformReply represents the data returned from a GetCrtcTransform request. -type GetCrtcTransformReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - PendingTransform render.Transform - HasTransforms bool - // padding: 3 bytes - CurrentTransform render.Transform - // padding: 4 bytes - PendingLen uint16 - PendingNparams uint16 - CurrentLen uint16 - CurrentNparams uint16 - PendingFilterName string // size: xgb.Pad((int(PendingLen) * 1)) - PendingParams []render.Fixed // size: xgb.Pad((int(PendingNparams) * 4)) - CurrentFilterName string // size: xgb.Pad((int(CurrentLen) * 1)) - CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) +// SetOutputPrimaryChecked sends a checked request. +// If an error occurs, it can be retrieved using SetOutputPrimaryCookie.Check() +func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) + return SetOutputPrimaryCookie{cookie} } -// Reply blocks and returns the reply data for a GetCrtcTransform request. -func (cook GetCrtcTransformCookie) Reply() (*GetCrtcTransformReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCrtcTransformReply(buf), nil +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetOutputPrimaryCookie) Check() error { + return cook.Cookie.Check() } -// getCrtcTransformReply reads a byte slice into a GetCrtcTransformReply value. -func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { - v := new(GetCrtcTransformReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.PendingTransform = render.Transform{} - b += render.TransformRead(buf[b:], &v.PendingTransform) - - if buf[b] == 1 { - v.HasTransforms = true - } else { - v.HasTransforms = false - } - b += 1 - - b += 3 // padding - - v.CurrentTransform = render.Transform{} - b += render.TransformRead(buf[b:], &v.CurrentTransform) - - b += 4 // padding - - v.PendingLen = xgb.Get16(buf[b:]) - b += 2 - - v.PendingNparams = xgb.Get16(buf[b:]) - b += 2 - - v.CurrentLen = xgb.Get16(buf[b:]) - b += 2 - - v.CurrentNparams = xgb.Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, v.PendingLen) - copy(byteString[:v.PendingLen], buf[b:]) - v.PendingFilterName = string(byteString) - b += xgb.Pad(int(v.PendingLen)) - } - - v.PendingParams = make([]render.Fixed, v.PendingNparams) - for i := 0; i < int(v.PendingNparams); i++ { - v.PendingParams[i] = render.Fixed(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - { - byteString := make([]byte, v.CurrentLen) - copy(byteString[:v.CurrentLen], buf[b:]) - v.CurrentFilterName = string(byteString) - b += xgb.Pad(int(v.CurrentLen)) - } - - v.CurrentParams = make([]render.Fixed, v.CurrentNparams) - for i := 0; i < int(v.CurrentNparams); i++ { - v.CurrentParams[i] = render.Fixed(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetCrtcTransform -// getCrtcTransformRequest writes a GetCrtcTransform request to a byte slice. -func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { - size := 8 +// Write request to wire for SetOutputPrimary +// setOutputPrimaryRequest writes a SetOutputPrimary request to a byte slice. +func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RANDR"] b += 1 - buf[b] = 27 // request opcode + buf[b] = 30 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Crtc)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - return buf -} - -// GetPanningCookie is a cookie used only for GetPanning requests. -type GetPanningCookie struct { - *xgb.Cookie -} - -// GetPanning sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPanningCookie.Reply() -func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getPanningRequest(c, Crtc), cookie) - return GetPanningCookie{cookie} -} - -// GetPanningUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getPanningRequest(c, Crtc), cookie) - return GetPanningCookie{cookie} -} - -// GetPanningReply represents the data returned from a GetPanning request. -type GetPanningReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte - Timestamp xproto.Timestamp - Left uint16 - Top uint16 - Width uint16 - Height uint16 - TrackLeft uint16 - TrackTop uint16 - TrackWidth uint16 - TrackHeight uint16 - BorderLeft int16 - BorderTop int16 - BorderRight int16 - BorderBottom int16 -} - -// Reply blocks and returns the reply data for a GetPanning request. -func (cook GetPanningCookie) Reply() (*GetPanningReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPanningReply(buf), nil -} - -// getPanningReply reads a byte slice into a GetPanningReply value. -func getPanningReply(buf []byte) *GetPanningReply { - v := new(GetPanningReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Left = xgb.Get16(buf[b:]) - b += 2 - - v.Top = xgb.Get16(buf[b:]) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.TrackLeft = xgb.Get16(buf[b:]) - b += 2 - - v.TrackTop = xgb.Get16(buf[b:]) - b += 2 - - v.TrackWidth = xgb.Get16(buf[b:]) - b += 2 - - v.TrackHeight = xgb.Get16(buf[b:]) - b += 2 - - v.BorderLeft = int16(xgb.Get16(buf[b:])) - b += 2 - - v.BorderTop = int16(xgb.Get16(buf[b:])) - b += 2 - - v.BorderRight = int16(xgb.Get16(buf[b:])) - b += 2 - - v.BorderBottom = int16(xgb.Get16(buf[b:])) - b += 2 - - return v -} - -// Write request to wire for GetPanning -// getPanningRequest writes a GetPanning request to a byte slice. -func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Crtc)) + xgb.Put32(buf[b:], uint32(Output)) b += 4 return buf @@ -4101,101 +4059,47 @@ func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left return buf } -// SetOutputPrimaryCookie is a cookie used only for SetOutputPrimary requests. -type SetOutputPrimaryCookie struct { +// SetScreenConfigCookie is a cookie used only for SetScreenConfig requests. +type SetScreenConfigCookie struct { *xgb.Cookie } -// SetOutputPrimary sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { +// SetScreenConfig sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetScreenConfigCookie.Reply() +func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) - return SetOutputPrimaryCookie{cookie} -} - -// SetOutputPrimaryChecked sends a checked request. -// If an error occurs, it can be retrieved using SetOutputPrimaryCookie.Check() -func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setOutputPrimaryRequest(c, Window, Output), cookie) - return SetOutputPrimaryCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetOutputPrimaryCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetOutputPrimary -// setOutputPrimaryRequest writes a SetOutputPrimary request to a byte slice. -func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RANDR"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Output)) - b += 4 - - return buf -} - -// GetOutputPrimaryCookie is a cookie used only for GetOutputPrimary requests. -type GetOutputPrimaryCookie struct { - *xgb.Cookie -} - -// GetOutputPrimary sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetOutputPrimaryCookie.Reply() -func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { - if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) - return GetOutputPrimaryCookie{cookie} + c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return SetScreenConfigCookie{cookie} } -// GetOutputPrimaryUnchecked sends an unchecked request. +// SetScreenConfigUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { +func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { if _, ok := c.Extensions["RANDR"]; !ok { - panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getOutputPrimaryRequest(c, Window), cookie) - return GetOutputPrimaryCookie{cookie} + c.NewRequest(setScreenConfigRequest(c, Window, Timestamp, ConfigTimestamp, SizeID, Rotation, Rate), cookie) + return SetScreenConfigCookie{cookie} } -// GetOutputPrimaryReply represents the data returned from a GetOutputPrimary request. -type GetOutputPrimaryReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Output Output +// SetScreenConfigReply represents the data returned from a SetScreenConfig request. +type SetScreenConfigReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte + NewTimestamp xproto.Timestamp + ConfigTimestamp xproto.Timestamp + Root xproto.Window + SubpixelOrder uint16 + // padding: 10 bytes } -// Reply blocks and returns the reply data for a GetOutputPrimary request. -func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { +// Reply blocks and returns the reply data for a SetScreenConfig request. +func (cook SetScreenConfigCookie) Reply() (*SetScreenConfigReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -4203,15 +4107,16 @@ func (cook GetOutputPrimaryCookie) Reply() (*GetOutputPrimaryReply, error) { if buf == nil { return nil, nil } - return getOutputPrimaryReply(buf), nil + return setScreenConfigReply(buf), nil } -// getOutputPrimaryReply reads a byte slice into a GetOutputPrimaryReply value. -func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { - v := new(GetOutputPrimaryReply) +// setScreenConfigReply reads a byte slice into a SetScreenConfigReply value. +func setScreenConfigReply(buf []byte) *SetScreenConfigReply { + v := new(SetScreenConfigReply) b := 1 // skip reply determinant - b += 1 // padding + v.Status = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 @@ -4219,23 +4124,34 @@ func getOutputPrimaryReply(buf []byte) *GetOutputPrimaryReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Output = Output(xgb.Get32(buf[b:])) + v.NewTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) b += 4 + v.ConfigTimestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.SubpixelOrder = xgb.Get16(buf[b:]) + b += 2 + + b += 10 // padding + return v } -// Write request to wire for GetOutputPrimary -// getOutputPrimaryRequest writes a GetOutputPrimary request to a byte slice. -func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 +// Write request to wire for SetScreenConfig +// setScreenConfigRequest writes a SetScreenConfig request to a byte slice. +func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) []byte { + size := 24 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RANDR"] b += 1 - buf[b] = 31 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -4244,5 +4160,89 @@ func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { xgb.Put32(buf[b:], uint32(Window)) b += 4 + xgb.Put32(buf[b:], uint32(Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + xgb.Put16(buf[b:], SizeID) + b += 2 + + xgb.Put16(buf[b:], Rotation) + b += 2 + + xgb.Put16(buf[b:], Rate) + b += 2 + + b += 2 // padding + + return buf +} + +// SetScreenSizeCookie is a cookie used only for SetScreenSize requests. +type SetScreenSizeCookie struct { + *xgb.Cookie +} + +// SetScreenSize sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) + return SetScreenSizeCookie{cookie} +} + +// SetScreenSizeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetScreenSizeCookie.Check() +func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setScreenSizeRequest(c, Window, Width, Height, MmWidth, MmHeight), cookie) + return SetScreenSizeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetScreenSizeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetScreenSize +// setScreenSizeRequest writes a SetScreenSize request to a byte slice. +func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], MmWidth) + b += 4 + + xgb.Put32(buf[b:], MmHeight) + b += 4 + return buf } diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 4bed730..2bbfe1c 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -2,7 +2,7 @@ package record /* - This file was generated by record.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by record.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,41 +40,127 @@ func init() { xgb.NewExtErrorFuncs["RECORD"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' +// BadBadContext is the error number for a BadBadContext. +const BadBadContext = 0 -// Skipping definition for base type 'Card8' +type BadContextError struct { + Sequence uint16 + NiceName string + InvalidRecord uint32 +} -// Skipping definition for base type 'Int16' +// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. +func BadContextErrorNew(buf []byte) xgb.Error { + v := BadContextError{} + v.NiceName = "BadContext" -// Skipping definition for base type 'Int32' + b := 1 // skip error determinant + b += 1 // don't read error number -// Skipping definition for base type 'Void' + v.Sequence = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Byte' + v.InvalidRecord = xgb.Get32(buf[b:]) + b += 4 -// Skipping definition for base type 'Int8' + return v +} -// Skipping definition for base type 'Card16' +// SequenceId returns the sequence id attached to the BadBadContext error. +// This is mostly used internally. +func (err BadContextError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Char' +// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. +func (err BadContextError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Card32' +// Error returns a rudimentary string representation of the BadBadContext error. -// Skipping definition for base type 'Double' +func (err BadContextError) Error() string { + fieldVals := make([]string, 0, 1) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("InvalidRecord: %d", err.InvalidRecord)) + return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Bool' +func init() { + xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew +} -const ( - HTypeFromServerTime = 1 - HTypeFromClientTime = 2 - HTypeFromClientSequence = 4 -) +type ClientInfo struct { + ClientResource ClientSpec + NumRanges uint32 + Ranges []Range // size: xgb.Pad((int(NumRanges) * 24)) +} -const ( - CsCurrentClients = 1 - CsFutureClients = 2 - CsAllClients = 3 -) +// ClientInfoRead reads a byte slice into a ClientInfo value. +func ClientInfoRead(buf []byte, v *ClientInfo) int { + b := 0 + + v.ClientResource = ClientSpec(xgb.Get32(buf[b:])) + b += 4 + + v.NumRanges = xgb.Get32(buf[b:]) + b += 4 + + v.Ranges = make([]Range, v.NumRanges) + b += RangeReadList(buf[b:], v.Ranges) + + return b +} + +// ClientInfoReadList reads a byte slice into a list of ClientInfo values. +func ClientInfoReadList(buf []byte, dest []ClientInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ClientInfo{} + b += ClientInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ClientInfo value to a byte slice. +func (v ClientInfo) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.ClientResource)) + b += 4 + + xgb.Put32(buf[b:], v.NumRanges) + b += 4 + + b += RangeListBytes(buf[b:], v.Ranges) + + return buf +} + +// ClientInfoListBytes writes a list of ClientInfo values to a byte slice. +func ClientInfoListBytes(buf []byte, list []ClientInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// ClientInfoListSize computes the size (bytes) of a list of ClientInfo values. +func ClientInfoListSize(list []ClientInfo) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumRanges) * 24))) + } + return size +} + +type ClientSpec uint32 type Context uint32 @@ -86,118 +172,14 @@ func NewContextId(c *xgb.Conn) (Context, error) { return Context(id), nil } +const ( + CsCurrentClients = 1 + CsFutureClients = 2 + CsAllClients = 3 +) + type ElementHeader byte -type ClientSpec uint32 - -type Range8 struct { - First byte - Last byte -} - -// Range8Read reads a byte slice into a Range8 value. -func Range8Read(buf []byte, v *Range8) int { - b := 0 - - v.First = buf[b] - b += 1 - - v.Last = buf[b] - b += 1 - - return b -} - -// Range8ReadList reads a byte slice into a list of Range8 values. -func Range8ReadList(buf []byte, dest []Range8) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Range8{} - b += Range8Read(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Range8 value to a byte slice. -func (v Range8) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.First - b += 1 - - buf[b] = v.Last - b += 1 - - return buf -} - -// Range8ListBytes writes a list of Range8 values to a byte slice. -func Range8ListBytes(buf []byte, list []Range8) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Range16 struct { - First uint16 - Last uint16 -} - -// Range16Read reads a byte slice into a Range16 value. -func Range16Read(buf []byte, v *Range16) int { - b := 0 - - v.First = xgb.Get16(buf[b:]) - b += 2 - - v.Last = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// Range16ReadList reads a byte slice into a list of Range16 values. -func Range16ReadList(buf []byte, dest []Range16) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Range16{} - b += Range16Read(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Range16 value to a byte slice. -func (v Range16) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put16(buf[b:], v.First) - b += 2 - - xgb.Put16(buf[b:], v.Last) - b += 2 - - return buf -} - -// Range16ListBytes writes a list of Range16 values to a byte slice. -func Range16ListBytes(buf []byte, list []Range16) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type ExtRange struct { Major Range8 Minor Range16 @@ -258,6 +240,12 @@ func ExtRangeListBytes(buf []byte, list []ExtRange) int { return b } +const ( + HTypeFromServerTime = 1 + HTypeFromClientTime = 2 + HTypeFromClientSequence = 4 +) + type Range struct { CoreRequests Range8 CoreReplies Range8 @@ -398,56 +386,50 @@ func RangeListBytes(buf []byte, list []Range) int { return b } -type ClientInfo struct { - ClientResource ClientSpec - NumRanges uint32 - Ranges []Range // size: xgb.Pad((int(NumRanges) * 24)) +type Range16 struct { + First uint16 + Last uint16 } -// ClientInfoRead reads a byte slice into a ClientInfo value. -func ClientInfoRead(buf []byte, v *ClientInfo) int { +// Range16Read reads a byte slice into a Range16 value. +func Range16Read(buf []byte, v *Range16) int { b := 0 - v.ClientResource = ClientSpec(xgb.Get32(buf[b:])) - b += 4 + v.First = xgb.Get16(buf[b:]) + b += 2 - v.NumRanges = xgb.Get32(buf[b:]) - b += 4 - - v.Ranges = make([]Range, v.NumRanges) - b += RangeReadList(buf[b:], v.Ranges) + v.Last = xgb.Get16(buf[b:]) + b += 2 return b } -// ClientInfoReadList reads a byte slice into a list of ClientInfo values. -func ClientInfoReadList(buf []byte, dest []ClientInfo) int { +// Range16ReadList reads a byte slice into a list of Range16 values. +func Range16ReadList(buf []byte, dest []Range16) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = ClientInfo{} - b += ClientInfoRead(buf[b:], &dest[i]) + dest[i] = Range16{} + b += Range16Read(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a ClientInfo value to a byte slice. -func (v ClientInfo) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24)))) +// Bytes writes a Range16 value to a byte slice. +func (v Range16) Bytes() []byte { + buf := make([]byte, 4) b := 0 - xgb.Put32(buf[b:], uint32(v.ClientResource)) - b += 4 + xgb.Put16(buf[b:], v.First) + b += 2 - xgb.Put32(buf[b:], v.NumRanges) - b += 4 - - b += RangeListBytes(buf[b:], v.Ranges) + xgb.Put16(buf[b:], v.Last) + b += 2 return buf } -// ClientInfoListBytes writes a list of ClientInfo values to a byte slice. -func ClientInfoListBytes(buf []byte, list []ClientInfo) int { +// Range16ListBytes writes a list of Range16 values to a byte slice. +func Range16ListBytes(buf []byte, list []Range16) int { b := 0 var structBytes []byte for _, item := range list { @@ -458,64 +440,493 @@ func ClientInfoListBytes(buf []byte, list []ClientInfo) int { return b } -// ClientInfoListSize computes the size (bytes) of a list of ClientInfo values. -func ClientInfoListSize(list []ClientInfo) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumRanges) * 24))) +type Range8 struct { + First byte + Last byte +} + +// Range8Read reads a byte slice into a Range8 value. +func Range8Read(buf []byte, v *Range8) int { + b := 0 + + v.First = buf[b] + b += 1 + + v.Last = buf[b] + b += 1 + + return b +} + +// Range8ReadList reads a byte slice into a list of Range8 values. +func Range8ReadList(buf []byte, dest []Range8) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Range8{} + b += Range8Read(buf[b:], &dest[i]) } - return size + return xgb.Pad(b) } -// BadBadContext is the error number for a BadBadContext. -const BadBadContext = 0 +// Bytes writes a Range8 value to a byte slice. +func (v Range8) Bytes() []byte { + buf := make([]byte, 2) + b := 0 -type BadContextError struct { - Sequence uint16 - NiceName string - InvalidRecord uint32 + buf[b] = v.First + b += 1 + + buf[b] = v.Last + b += 1 + + return buf } -// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice. -func BadContextErrorNew(buf []byte) xgb.Error { - v := BadContextError{} - v.NiceName = "BadContext" +// Range8ListBytes writes a list of Range8 values to a byte slice. +func Range8ListBytes(buf []byte, list []Range8) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} - b := 1 // skip error determinant - b += 1 // don't read error number +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// CreateContextCookie is a cookie used only for CreateContext requests. +type CreateContextCookie struct { + *xgb.Cookie +} + +// CreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return CreateContextCookie{cookie} +} + +// CreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateContextCookie.Check() +func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) + return CreateContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. +func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { + size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = byte(ElementHeader) + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], NumClientSpecs) + b += 4 + + xgb.Put32(buf[b:], NumRanges) + b += 4 + + for i := 0; i < int(NumClientSpecs); i++ { + xgb.Put32(buf[b:], uint32(ClientSpecs[i])) + b += 4 + } + b = xgb.Pad(b) + + b += RangeListBytes(buf[b:], Ranges) + + return buf +} + +// DisableContextCookie is a cookie used only for DisableContext requests. +type DisableContextCookie struct { + *xgb.Cookie +} + +// DisableContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(disableContextRequest(c, Context), cookie) + return DisableContextCookie{cookie} +} + +// DisableContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DisableContextCookie.Check() +func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(disableContextRequest(c, Context), cookie) + return DisableContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DisableContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DisableContext +// disableContextRequest writes a DisableContext request to a byte slice. +func disableContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// EnableContextCookie is a cookie used only for EnableContext requests. +type EnableContextCookie struct { + *xgb.Cookie +} + +// EnableContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply() +func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(enableContextRequest(c, Context), cookie) + return EnableContextCookie{cookie} +} + +// EnableContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(enableContextRequest(c, Context), cookie) + return EnableContextCookie{cookie} +} + +// EnableContextReply represents the data returned from a EnableContext request. +type EnableContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Category byte + ElementHeader ElementHeader + ClientSwapped bool + // padding: 2 bytes + XidBase uint32 + ServerTime uint32 + RecSequenceNum uint32 + // padding: 8 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a EnableContext request. +func (cook EnableContextCookie) Reply() (*EnableContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return enableContextReply(buf), nil +} + +// enableContextReply reads a byte slice into a EnableContextReply value. +func enableContextReply(buf []byte) *EnableContextReply { + v := new(EnableContextReply) + b := 1 // skip reply determinant + + v.Category = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.InvalidRecord = xgb.Get32(buf[b:]) + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + v.ElementHeader = ElementHeader(buf[b]) + b += 1 + + if buf[b] == 1 { + v.ClientSwapped = true + } else { + v.ClientSwapped = false + } + b += 1 + + b += 2 // padding + + v.XidBase = xgb.Get32(buf[b:]) + b += 4 + + v.ServerTime = xgb.Get32(buf[b:]) + b += 4 + + v.RecSequenceNum = xgb.Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + return v } -// SequenceId returns the sequence id attached to the BadBadContext error. -// This is mostly used internally. -func (err BadContextError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for EnableContext +// enableContextRequest writes a EnableContext request to a byte slice. +func enableContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadBadContext error. If no bad value exists, 0 is returned. -func (err BadContextError) BadId() uint32 { - return 0 +// FreeContextCookie is a cookie used only for FreeContext requests. +type FreeContextCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadBadContext error. - -func (err BadContextError) Error() string { - fieldVals := make([]string, 0, 1) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("InvalidRecord: %d", err.InvalidRecord)) - return "BadBadContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// FreeContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(freeContextRequest(c, Context), cookie) + return FreeContextCookie{cookie} } -func init() { - xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew +// FreeContextChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeContextCookie.Check() +func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(freeContextRequest(c, Context), cookie) + return FreeContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeContext +// freeContextRequest writes a FreeContext request to a byte slice. +func freeContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// GetContextCookie is a cookie used only for GetContext requests. +type GetContextCookie struct { + *xgb.Cookie +} + +// GetContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply() +func GetContext(c *xgb.Conn, Context Context) GetContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getContextRequest(c, Context), cookie) + return GetContextCookie{cookie} +} + +// GetContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { + if _, ok := c.Extensions["RECORD"]; !ok { + panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getContextRequest(c, Context), cookie) + return GetContextCookie{cookie} +} + +// GetContextReply represents the data returned from a GetContext request. +type GetContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Enabled bool + ElementHeader ElementHeader + // padding: 3 bytes + NumInterceptedClients uint32 + // padding: 16 bytes + InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients) +} + +// Reply blocks and returns the reply data for a GetContext request. +func (cook GetContextCookie) Reply() (*GetContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getContextReply(buf), nil +} + +// getContextReply reads a byte slice into a GetContextReply value. +func getContextReply(buf []byte) *GetContextReply { + v := new(GetContextReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ElementHeader = ElementHeader(buf[b]) + b += 1 + + b += 3 // padding + + v.NumInterceptedClients = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.InterceptedClients = make([]ClientInfo, v.NumInterceptedClients) + b += ClientInfoReadList(buf[b:], v.InterceptedClients) + + return v +} + +// Write request to wire for GetContext +// getContextRequest writes a GetContext request to a byte slice. +func getContextRequest(c *xgb.Conn, Context Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RECORD"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf } // QueryVersionCookie is a cookie used only for QueryVersion requests. @@ -613,80 +1024,6 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) return buf } -// CreateContextCookie is a cookie used only for CreateContext requests. -type CreateContextCookie struct { - *xgb.Cookie -} - -// CreateContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return CreateContextCookie{cookie} -} - -// CreateContextChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateContextCookie.Check() -func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie) - return CreateContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateContext -// createContextRequest writes a CreateContext request to a byte slice. -func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { - size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RECORD"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - buf[b] = byte(ElementHeader) - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], NumClientSpecs) - b += 4 - - xgb.Put32(buf[b:], NumRanges) - b += 4 - - for i := 0; i < int(NumClientSpecs); i++ { - xgb.Put32(buf[b:], uint32(ClientSpecs[i])) - b += 4 - } - b = xgb.Pad(b) - - b += RangeListBytes(buf[b:], Ranges) - - return buf -} - // RegisterClientsCookie is a cookie used only for RegisterClients requests. type RegisterClientsCookie struct { *xgb.Cookie @@ -824,340 +1161,3 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3 return buf } - -// GetContextCookie is a cookie used only for GetContext requests. -type GetContextCookie struct { - *xgb.Cookie -} - -// GetContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply() -func GetContext(c *xgb.Conn, Context Context) GetContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getContextRequest(c, Context), cookie) - return GetContextCookie{cookie} -} - -// GetContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getContextRequest(c, Context), cookie) - return GetContextCookie{cookie} -} - -// GetContextReply represents the data returned from a GetContext request. -type GetContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Enabled bool - ElementHeader ElementHeader - // padding: 3 bytes - NumInterceptedClients uint32 - // padding: 16 bytes - InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients) -} - -// Reply blocks and returns the reply data for a GetContext request. -func (cook GetContextCookie) Reply() (*GetContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getContextReply(buf), nil -} - -// getContextReply reads a byte slice into a GetContextReply value. -func getContextReply(buf []byte) *GetContextReply { - v := new(GetContextReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Enabled = true - } else { - v.Enabled = false - } - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ElementHeader = ElementHeader(buf[b]) - b += 1 - - b += 3 // padding - - v.NumInterceptedClients = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.InterceptedClients = make([]ClientInfo, v.NumInterceptedClients) - b += ClientInfoReadList(buf[b:], v.InterceptedClients) - - return v -} - -// Write request to wire for GetContext -// getContextRequest writes a GetContext request to a byte slice. -func getContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RECORD"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// EnableContextCookie is a cookie used only for EnableContext requests. -type EnableContextCookie struct { - *xgb.Cookie -} - -// EnableContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply() -func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(enableContextRequest(c, Context), cookie) - return EnableContextCookie{cookie} -} - -// EnableContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(enableContextRequest(c, Context), cookie) - return EnableContextCookie{cookie} -} - -// EnableContextReply represents the data returned from a EnableContext request. -type EnableContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Category byte - ElementHeader ElementHeader - ClientSwapped bool - // padding: 2 bytes - XidBase uint32 - ServerTime uint32 - RecSequenceNum uint32 - // padding: 8 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a EnableContext request. -func (cook EnableContextCookie) Reply() (*EnableContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return enableContextReply(buf), nil -} - -// enableContextReply reads a byte slice into a EnableContextReply value. -func enableContextReply(buf []byte) *EnableContextReply { - v := new(EnableContextReply) - b := 1 // skip reply determinant - - v.Category = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ElementHeader = ElementHeader(buf[b]) - b += 1 - - if buf[b] == 1 { - v.ClientSwapped = true - } else { - v.ClientSwapped = false - } - b += 1 - - b += 2 // padding - - v.XidBase = xgb.Get32(buf[b:]) - b += 4 - - v.ServerTime = xgb.Get32(buf[b:]) - b += 4 - - v.RecSequenceNum = xgb.Get32(buf[b:]) - b += 4 - - b += 8 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for EnableContext -// enableContextRequest writes a EnableContext request to a byte slice. -func enableContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RECORD"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// DisableContextCookie is a cookie used only for DisableContext requests. -type DisableContextCookie struct { - *xgb.Cookie -} - -// DisableContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(disableContextRequest(c, Context), cookie) - return DisableContextCookie{cookie} -} - -// DisableContextChecked sends a checked request. -// If an error occurs, it can be retrieved using DisableContextCookie.Check() -func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(disableContextRequest(c, Context), cookie) - return DisableContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DisableContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DisableContext -// disableContextRequest writes a DisableContext request to a byte slice. -func disableContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RECORD"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} - -// FreeContextCookie is a cookie used only for FreeContext requests. -type FreeContextCookie struct { - *xgb.Cookie -} - -// FreeContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(freeContextRequest(c, Context), cookie) - return FreeContextCookie{cookie} -} - -// FreeContextChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeContextCookie.Check() -func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { - if _, ok := c.Extensions["RECORD"]; !ok { - panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(freeContextRequest(c, Context), cookie) - return FreeContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeContext -// freeContextRequest writes a FreeContext request to a byte slice. -func freeContextRequest(c *xgb.Conn, Context Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RECORD"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - return buf -} diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 2f1ae13..c6f5095 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -2,7 +2,7 @@ package render /* - This file was generated by render.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by render.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,104 +40,127 @@ func init() { xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' +type Animcursorelt struct { + Cursor xproto.Cursor + Delay uint32 +} -// Skipping definition for base type 'Card8' +// AnimcursoreltRead reads a byte slice into a Animcursorelt value. +func AnimcursoreltRead(buf []byte, v *Animcursorelt) int { + b := 0 -// Skipping definition for base type 'Int16' + v.Cursor = xproto.Cursor(xgb.Get32(buf[b:])) + b += 4 -// Skipping definition for base type 'Int32' + v.Delay = xgb.Get32(buf[b:]) + b += 4 -// Skipping definition for base type 'Void' + return b +} -// Skipping definition for base type 'Byte' +// AnimcursoreltReadList reads a byte slice into a list of Animcursorelt values. +func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Animcursorelt{} + b += AnimcursoreltRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} -// Skipping definition for base type 'Int8' +// Bytes writes a Animcursorelt value to a byte slice. +func (v Animcursorelt) Bytes() []byte { + buf := make([]byte, 8) + b := 0 -// Skipping definition for base type 'Card16' + xgb.Put32(buf[b:], uint32(v.Cursor)) + b += 4 -// Skipping definition for base type 'Char' + xgb.Put32(buf[b:], v.Delay) + b += 4 -// Skipping definition for base type 'Card32' + return buf +} -// Skipping definition for base type 'Double' +// AnimcursoreltListBytes writes a list of Animcursorelt values to a byte slice. +func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} -// Skipping definition for base type 'Bool' +type Color struct { + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} -const ( - PictTypeIndexed = 0 - PictTypeDirect = 1 -) +// ColorRead reads a byte slice into a Color value. +func ColorRead(buf []byte, v *Color) int { + b := 0 -const ( - PictureNone = 0 -) + v.Red = xgb.Get16(buf[b:]) + b += 2 -const ( - PictOpClear = 0 - PictOpSrc = 1 - PictOpDst = 2 - PictOpOver = 3 - PictOpOverReverse = 4 - PictOpIn = 5 - PictOpInReverse = 6 - PictOpOut = 7 - PictOpOutReverse = 8 - PictOpAtop = 9 - PictOpAtopReverse = 10 - PictOpXor = 11 - PictOpAdd = 12 - PictOpSaturate = 13 - PictOpDisjointClear = 16 - PictOpDisjointSrc = 17 - PictOpDisjointDst = 18 - PictOpDisjointOver = 19 - PictOpDisjointOverReverse = 20 - PictOpDisjointIn = 21 - PictOpDisjointInReverse = 22 - PictOpDisjointOut = 23 - PictOpDisjointOutReverse = 24 - PictOpDisjointAtop = 25 - PictOpDisjointAtopReverse = 26 - PictOpDisjointXor = 27 - PictOpConjointClear = 32 - PictOpConjointSrc = 33 - PictOpConjointDst = 34 - PictOpConjointOver = 35 - PictOpConjointOverReverse = 36 - PictOpConjointIn = 37 - PictOpConjointInReverse = 38 - PictOpConjointOut = 39 - PictOpConjointOutReverse = 40 - PictOpConjointAtop = 41 - PictOpConjointAtopReverse = 42 - PictOpConjointXor = 43 - PictOpMultiply = 48 - PictOpScreen = 49 - PictOpOverlay = 50 - PictOpDarken = 51 - PictOpLighten = 52 - PictOpColorDodge = 53 - PictOpColorBurn = 54 - PictOpHardLight = 55 - PictOpSoftLight = 56 - PictOpDifference = 57 - PictOpExclusion = 58 - PictOpHSLHue = 59 - PictOpHSLSaturation = 60 - PictOpHSLColor = 61 - PictOpHSLLuminosity = 62 -) + v.Green = xgb.Get16(buf[b:]) + b += 2 -const ( - PolyEdgeSharp = 0 - PolyEdgeSmooth = 1 -) + v.Blue = xgb.Get16(buf[b:]) + b += 2 -const ( - PolyModePrecise = 0 - PolyModeImprecise = 1 -) + v.Alpha = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// ColorReadList reads a byte slice into a list of Color values. +func ColorReadList(buf []byte, dest []Color) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Color{} + b += ColorRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Color value to a byte slice. +func (v Color) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.Red) + b += 2 + + xgb.Put16(buf[b:], v.Green) + b += 2 + + xgb.Put16(buf[b:], v.Blue) + b += 2 + + xgb.Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// ColorListBytes writes a list of Color values to a byte slice. +func ColorListBytes(buf []byte, list []Color) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} const ( CpRepeat = 1 @@ -155,56 +178,6 @@ const ( CpComponentAlpha = 4096 ) -const ( - SubPixelUnknown = 0 - SubPixelHorizontalRGB = 1 - SubPixelHorizontalBGR = 2 - SubPixelVerticalRGB = 3 - SubPixelVerticalBGR = 4 - SubPixelNone = 5 -) - -const ( - RepeatNone = 0 - RepeatNormal = 1 - RepeatPad = 2 - RepeatReflect = 3 -) - -type Glyphset uint32 - -func NewGlyphsetId(c *xgb.Conn) (Glyphset, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Glyphset(id), nil -} - -type Picture uint32 - -func NewPictureId(c *xgb.Conn) (Picture, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Picture(id), nil -} - -type Pictformat uint32 - -func NewPictformatId(c *xgb.Conn) (Pictformat, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Pictformat(id), nil -} - -type Glyph uint32 - -type Fixed int32 - type Directformat struct { RedShift uint16 RedMask uint16 @@ -301,690 +274,100 @@ func DirectformatListBytes(buf []byte, list []Directformat) int { return b } -type Pictforminfo struct { - Id Pictformat - Type byte - Depth byte - // padding: 2 bytes - Direct Directformat - Colormap xproto.Colormap +type Fixed int32 + +type Glyph uint32 + +// BadGlyph is the error number for a BadGlyph. +const BadGlyph = 4 + +type GlyphError struct { + Sequence uint16 + NiceName string } -// PictforminfoRead reads a byte slice into a Pictforminfo value. -func PictforminfoRead(buf []byte, v *Pictforminfo) int { - b := 0 +// GlyphErrorNew constructs a GlyphError value that implements xgb.Error from a byte slice. +func GlyphErrorNew(buf []byte) xgb.Error { + v := GlyphError{} + v.NiceName = "Glyph" - v.Id = Pictformat(xgb.Get32(buf[b:])) - b += 4 + b := 1 // skip error determinant + b += 1 // don't read error number - v.Type = buf[b] - b += 1 - - v.Depth = buf[b] - b += 1 - - b += 2 // padding - - v.Direct = Directformat{} - b += DirectformatRead(buf[b:], &v.Direct) - - v.Colormap = xproto.Colormap(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// PictforminfoReadList reads a byte slice into a list of Pictforminfo values. -func PictforminfoReadList(buf []byte, dest []Pictforminfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Pictforminfo{} - b += PictforminfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Pictforminfo value to a byte slice. -func (v Pictforminfo) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Id)) - b += 4 - - buf[b] = v.Type - b += 1 - - buf[b] = v.Depth - b += 1 - - b += 2 // padding - - { - structBytes := v.Direct.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(v.Colormap)) - b += 4 - - return buf -} - -// PictforminfoListBytes writes a list of Pictforminfo values to a byte slice. -func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Pictvisual struct { - Visual xproto.Visualid - Format Pictformat -} - -// PictvisualRead reads a byte slice into a Pictvisual value. -func PictvisualRead(buf []byte, v *Pictvisual) int { - b := 0 - - v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) - b += 4 - - v.Format = Pictformat(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// PictvisualReadList reads a byte slice into a list of Pictvisual values. -func PictvisualReadList(buf []byte, dest []Pictvisual) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Pictvisual{} - b += PictvisualRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Pictvisual value to a byte slice. -func (v Pictvisual) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Visual)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Format)) - b += 4 - - return buf -} - -// PictvisualListBytes writes a list of Pictvisual values to a byte slice. -func PictvisualListBytes(buf []byte, list []Pictvisual) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Pictdepth struct { - Depth byte - // padding: 1 bytes - NumVisuals uint16 - // padding: 4 bytes - Visuals []Pictvisual // size: xgb.Pad((int(NumVisuals) * 8)) -} - -// PictdepthRead reads a byte slice into a Pictdepth value. -func PictdepthRead(buf []byte, v *Pictdepth) int { - b := 0 - - v.Depth = buf[b] - b += 1 - - b += 1 // padding - - v.NumVisuals = xgb.Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - b += 4 // padding - - v.Visuals = make([]Pictvisual, v.NumVisuals) - b += PictvisualReadList(buf[b:], v.Visuals) - - return b + return v } -// PictdepthReadList reads a byte slice into a list of Pictdepth values. -func PictdepthReadList(buf []byte, dest []Pictdepth) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Pictdepth{} - b += PictdepthRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) +// SequenceId returns the sequence id attached to the BadGlyph error. +// This is mostly used internally. +func (err GlyphError) SequenceId() uint16 { + return err.Sequence } -// Bytes writes a Pictdepth value to a byte slice. -func (v Pictdepth) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumVisuals) * 8)))) - b := 0 +// BadId returns the 'BadValue' number if one exists for the BadGlyph error. If no bad value exists, 0 is returned. +func (err GlyphError) BadId() uint32 { + return 0 +} - buf[b] = v.Depth - b += 1 +// Error returns a rudimentary string representation of the BadGlyph error. - b += 1 // padding +func (err GlyphError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadGlyph {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} - xgb.Put16(buf[b:], v.NumVisuals) +func init() { + xgb.NewExtErrorFuncs["RENDER"][4] = GlyphErrorNew +} + +// BadGlyphSet is the error number for a BadGlyphSet. +const BadGlyphSet = 3 + +type GlyphSetError struct { + Sequence uint16 + NiceName string +} + +// GlyphSetErrorNew constructs a GlyphSetError value that implements xgb.Error from a byte slice. +func GlyphSetErrorNew(buf []byte) xgb.Error { + v := GlyphSetError{} + v.NiceName = "GlyphSet" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) b += 2 - b += 4 // padding - - b += PictvisualListBytes(buf[b:], v.Visuals) - - return buf + return v } -// PictdepthListBytes writes a list of Pictdepth values to a byte slice. -func PictdepthListBytes(buf []byte, list []Pictdepth) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b +// SequenceId returns the sequence id attached to the BadGlyphSet error. +// This is mostly used internally. +func (err GlyphSetError) SequenceId() uint16 { + return err.Sequence } -// PictdepthListSize computes the size (bytes) of a list of Pictdepth values. -func PictdepthListSize(list []Pictdepth) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumVisuals) * 8))) - } - return size +// BadId returns the 'BadValue' number if one exists for the BadGlyphSet error. If no bad value exists, 0 is returned. +func (err GlyphSetError) BadId() uint32 { + return 0 } -type Pictscreen struct { - NumDepths uint32 - Fallback Pictformat - Depths []Pictdepth // size: PictdepthListSize(Depths) +// Error returns a rudimentary string representation of the BadGlyphSet error. + +func (err GlyphSetError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadGlyphSet {" + xgb.StringsJoin(fieldVals, ", ") + "}" } -// PictscreenRead reads a byte slice into a Pictscreen value. -func PictscreenRead(buf []byte, v *Pictscreen) int { - b := 0 - - v.NumDepths = xgb.Get32(buf[b:]) - b += 4 - - v.Fallback = Pictformat(xgb.Get32(buf[b:])) - b += 4 - - v.Depths = make([]Pictdepth, v.NumDepths) - b += PictdepthReadList(buf[b:], v.Depths) - - return b -} - -// PictscreenReadList reads a byte slice into a list of Pictscreen values. -func PictscreenReadList(buf []byte, dest []Pictscreen) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Pictscreen{} - b += PictscreenRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Pictscreen value to a byte slice. -func (v Pictscreen) Bytes() []byte { - buf := make([]byte, (8 + PictdepthListSize(v.Depths))) - b := 0 - - xgb.Put32(buf[b:], v.NumDepths) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Fallback)) - b += 4 - - b += PictdepthListBytes(buf[b:], v.Depths) - - return buf -} - -// PictscreenListBytes writes a list of Pictscreen values to a byte slice. -func PictscreenListBytes(buf []byte, list []Pictscreen) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// PictscreenListSize computes the size (bytes) of a list of Pictscreen values. -func PictscreenListSize(list []Pictscreen) int { - size := 0 - for _, item := range list { - size += (8 + PictdepthListSize(item.Depths)) - } - return size -} - -type Indexvalue struct { - Pixel uint32 - Red uint16 - Green uint16 - Blue uint16 - Alpha uint16 -} - -// IndexvalueRead reads a byte slice into a Indexvalue value. -func IndexvalueRead(buf []byte, v *Indexvalue) int { - b := 0 - - v.Pixel = xgb.Get32(buf[b:]) - b += 4 - - v.Red = xgb.Get16(buf[b:]) - b += 2 - - v.Green = xgb.Get16(buf[b:]) - b += 2 - - v.Blue = xgb.Get16(buf[b:]) - b += 2 - - v.Alpha = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// IndexvalueReadList reads a byte slice into a list of Indexvalue values. -func IndexvalueReadList(buf []byte, dest []Indexvalue) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Indexvalue{} - b += IndexvalueRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Indexvalue value to a byte slice. -func (v Indexvalue) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - xgb.Put32(buf[b:], v.Pixel) - b += 4 - - xgb.Put16(buf[b:], v.Red) - b += 2 - - xgb.Put16(buf[b:], v.Green) - b += 2 - - xgb.Put16(buf[b:], v.Blue) - b += 2 - - xgb.Put16(buf[b:], v.Alpha) - b += 2 - - return buf -} - -// IndexvalueListBytes writes a list of Indexvalue values to a byte slice. -func IndexvalueListBytes(buf []byte, list []Indexvalue) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Color struct { - Red uint16 - Green uint16 - Blue uint16 - Alpha uint16 -} - -// ColorRead reads a byte slice into a Color value. -func ColorRead(buf []byte, v *Color) int { - b := 0 - - v.Red = xgb.Get16(buf[b:]) - b += 2 - - v.Green = xgb.Get16(buf[b:]) - b += 2 - - v.Blue = xgb.Get16(buf[b:]) - b += 2 - - v.Alpha = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// ColorReadList reads a byte slice into a list of Color values. -func ColorReadList(buf []byte, dest []Color) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Color{} - b += ColorRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Color value to a byte slice. -func (v Color) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.Red) - b += 2 - - xgb.Put16(buf[b:], v.Green) - b += 2 - - xgb.Put16(buf[b:], v.Blue) - b += 2 - - xgb.Put16(buf[b:], v.Alpha) - b += 2 - - return buf -} - -// ColorListBytes writes a list of Color values to a byte slice. -func ColorListBytes(buf []byte, list []Color) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Pointfix struct { - X Fixed - Y Fixed -} - -// PointfixRead reads a byte slice into a Pointfix value. -func PointfixRead(buf []byte, v *Pointfix) int { - b := 0 - - v.X = Fixed(xgb.Get32(buf[b:])) - b += 4 - - v.Y = Fixed(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// PointfixReadList reads a byte slice into a list of Pointfix values. -func PointfixReadList(buf []byte, dest []Pointfix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Pointfix{} - b += PointfixRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Pointfix value to a byte slice. -func (v Pointfix) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.X)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Y)) - b += 4 - - return buf -} - -// PointfixListBytes writes a list of Pointfix values to a byte slice. -func PointfixListBytes(buf []byte, list []Pointfix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Linefix struct { - P1 Pointfix - P2 Pointfix -} - -// LinefixRead reads a byte slice into a Linefix value. -func LinefixRead(buf []byte, v *Linefix) int { - b := 0 - - v.P1 = Pointfix{} - b += PointfixRead(buf[b:], &v.P1) - - v.P2 = Pointfix{} - b += PointfixRead(buf[b:], &v.P2) - - return b -} - -// LinefixReadList reads a byte slice into a list of Linefix values. -func LinefixReadList(buf []byte, dest []Linefix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Linefix{} - b += LinefixRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Linefix value to a byte slice. -func (v Linefix) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - { - structBytes := v.P1.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.P2.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// LinefixListBytes writes a list of Linefix values to a byte slice. -func LinefixListBytes(buf []byte, list []Linefix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Triangle struct { - P1 Pointfix - P2 Pointfix - P3 Pointfix -} - -// TriangleRead reads a byte slice into a Triangle value. -func TriangleRead(buf []byte, v *Triangle) int { - b := 0 - - v.P1 = Pointfix{} - b += PointfixRead(buf[b:], &v.P1) - - v.P2 = Pointfix{} - b += PointfixRead(buf[b:], &v.P2) - - v.P3 = Pointfix{} - b += PointfixRead(buf[b:], &v.P3) - - return b -} - -// TriangleReadList reads a byte slice into a list of Triangle values. -func TriangleReadList(buf []byte, dest []Triangle) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Triangle{} - b += TriangleRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Triangle value to a byte slice. -func (v Triangle) Bytes() []byte { - buf := make([]byte, 24) - b := 0 - - { - structBytes := v.P1.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.P2.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.P3.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// TriangleListBytes writes a list of Triangle values to a byte slice. -func TriangleListBytes(buf []byte, list []Triangle) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Trapezoid struct { - Top Fixed - Bottom Fixed - Left Linefix - Right Linefix -} - -// TrapezoidRead reads a byte slice into a Trapezoid value. -func TrapezoidRead(buf []byte, v *Trapezoid) int { - b := 0 - - v.Top = Fixed(xgb.Get32(buf[b:])) - b += 4 - - v.Bottom = Fixed(xgb.Get32(buf[b:])) - b += 4 - - v.Left = Linefix{} - b += LinefixRead(buf[b:], &v.Left) - - v.Right = Linefix{} - b += LinefixRead(buf[b:], &v.Right) - - return b -} - -// TrapezoidReadList reads a byte slice into a list of Trapezoid values. -func TrapezoidReadList(buf []byte, dest []Trapezoid) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Trapezoid{} - b += TrapezoidRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Trapezoid value to a byte slice. -func (v Trapezoid) Bytes() []byte { - buf := make([]byte, 40) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Top)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Bottom)) - b += 4 - - { - structBytes := v.Left.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.Right.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// TrapezoidListBytes writes a list of Trapezoid values to a byte slice. -func TrapezoidListBytes(buf []byte, list []Trapezoid) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b +func init() { + xgb.NewExtErrorFuncs["RENDER"][3] = GlyphSetErrorNew } type Glyphinfo struct { @@ -1069,6 +452,800 @@ func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { return b } +type Glyphset uint32 + +func NewGlyphsetId(c *xgb.Conn) (Glyphset, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Glyphset(id), nil +} + +type Indexvalue struct { + Pixel uint32 + Red uint16 + Green uint16 + Blue uint16 + Alpha uint16 +} + +// IndexvalueRead reads a byte slice into a Indexvalue value. +func IndexvalueRead(buf []byte, v *Indexvalue) int { + b := 0 + + v.Pixel = xgb.Get32(buf[b:]) + b += 4 + + v.Red = xgb.Get16(buf[b:]) + b += 2 + + v.Green = xgb.Get16(buf[b:]) + b += 2 + + v.Blue = xgb.Get16(buf[b:]) + b += 2 + + v.Alpha = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// IndexvalueReadList reads a byte slice into a list of Indexvalue values. +func IndexvalueReadList(buf []byte, dest []Indexvalue) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Indexvalue{} + b += IndexvalueRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Indexvalue value to a byte slice. +func (v Indexvalue) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put32(buf[b:], v.Pixel) + b += 4 + + xgb.Put16(buf[b:], v.Red) + b += 2 + + xgb.Put16(buf[b:], v.Green) + b += 2 + + xgb.Put16(buf[b:], v.Blue) + b += 2 + + xgb.Put16(buf[b:], v.Alpha) + b += 2 + + return buf +} + +// IndexvalueListBytes writes a list of Indexvalue values to a byte slice. +func IndexvalueListBytes(buf []byte, list []Indexvalue) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Linefix struct { + P1 Pointfix + P2 Pointfix +} + +// LinefixRead reads a byte slice into a Linefix value. +func LinefixRead(buf []byte, v *Linefix) int { + b := 0 + + v.P1 = Pointfix{} + b += PointfixRead(buf[b:], &v.P1) + + v.P2 = Pointfix{} + b += PointfixRead(buf[b:], &v.P2) + + return b +} + +// LinefixReadList reads a byte slice into a list of Linefix values. +func LinefixReadList(buf []byte, dest []Linefix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Linefix{} + b += LinefixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Linefix value to a byte slice. +func (v Linefix) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// LinefixListBytes writes a list of Linefix values to a byte slice. +func LinefixListBytes(buf []byte, list []Linefix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// BadPictFormat is the error number for a BadPictFormat. +const BadPictFormat = 0 + +type PictFormatError struct { + Sequence uint16 + NiceName string +} + +// PictFormatErrorNew constructs a PictFormatError value that implements xgb.Error from a byte slice. +func PictFormatErrorNew(buf []byte) xgb.Error { + v := PictFormatError{} + v.NiceName = "PictFormat" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadPictFormat error. +// This is mostly used internally. +func (err PictFormatError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadPictFormat error. If no bad value exists, 0 is returned. +func (err PictFormatError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadPictFormat error. + +func (err PictFormatError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPictFormat {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][0] = PictFormatErrorNew +} + +// BadPictOp is the error number for a BadPictOp. +const BadPictOp = 2 + +type PictOpError struct { + Sequence uint16 + NiceName string +} + +// PictOpErrorNew constructs a PictOpError value that implements xgb.Error from a byte slice. +func PictOpErrorNew(buf []byte) xgb.Error { + v := PictOpError{} + v.NiceName = "PictOp" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadPictOp error. +// This is mostly used internally. +func (err PictOpError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadPictOp error. If no bad value exists, 0 is returned. +func (err PictOpError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadPictOp error. + +func (err PictOpError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPictOp {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][2] = PictOpErrorNew +} + +const ( + PictOpClear = 0 + PictOpSrc = 1 + PictOpDst = 2 + PictOpOver = 3 + PictOpOverReverse = 4 + PictOpIn = 5 + PictOpInReverse = 6 + PictOpOut = 7 + PictOpOutReverse = 8 + PictOpAtop = 9 + PictOpAtopReverse = 10 + PictOpXor = 11 + PictOpAdd = 12 + PictOpSaturate = 13 + PictOpDisjointClear = 16 + PictOpDisjointSrc = 17 + PictOpDisjointDst = 18 + PictOpDisjointOver = 19 + PictOpDisjointOverReverse = 20 + PictOpDisjointIn = 21 + PictOpDisjointInReverse = 22 + PictOpDisjointOut = 23 + PictOpDisjointOutReverse = 24 + PictOpDisjointAtop = 25 + PictOpDisjointAtopReverse = 26 + PictOpDisjointXor = 27 + PictOpConjointClear = 32 + PictOpConjointSrc = 33 + PictOpConjointDst = 34 + PictOpConjointOver = 35 + PictOpConjointOverReverse = 36 + PictOpConjointIn = 37 + PictOpConjointInReverse = 38 + PictOpConjointOut = 39 + PictOpConjointOutReverse = 40 + PictOpConjointAtop = 41 + PictOpConjointAtopReverse = 42 + PictOpConjointXor = 43 + PictOpMultiply = 48 + PictOpScreen = 49 + PictOpOverlay = 50 + PictOpDarken = 51 + PictOpLighten = 52 + PictOpColorDodge = 53 + PictOpColorBurn = 54 + PictOpHardLight = 55 + PictOpSoftLight = 56 + PictOpDifference = 57 + PictOpExclusion = 58 + PictOpHSLHue = 59 + PictOpHSLSaturation = 60 + PictOpHSLColor = 61 + PictOpHSLLuminosity = 62 +) + +const ( + PictTypeIndexed = 0 + PictTypeDirect = 1 +) + +type Pictdepth struct { + Depth byte + // padding: 1 bytes + NumVisuals uint16 + // padding: 4 bytes + Visuals []Pictvisual // size: xgb.Pad((int(NumVisuals) * 8)) +} + +// PictdepthRead reads a byte slice into a Pictdepth value. +func PictdepthRead(buf []byte, v *Pictdepth) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + b += 1 // padding + + v.NumVisuals = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Visuals = make([]Pictvisual, v.NumVisuals) + b += PictvisualReadList(buf[b:], v.Visuals) + + return b +} + +// PictdepthReadList reads a byte slice into a list of Pictdepth values. +func PictdepthReadList(buf []byte, dest []Pictdepth) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictdepth{} + b += PictdepthRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Pictdepth value to a byte slice. +func (v Pictdepth) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumVisuals) * 8)))) + b := 0 + + buf[b] = v.Depth + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.NumVisuals) + b += 2 + + b += 4 // padding + + b += PictvisualListBytes(buf[b:], v.Visuals) + + return buf +} + +// PictdepthListBytes writes a list of Pictdepth values to a byte slice. +func PictdepthListBytes(buf []byte, list []Pictdepth) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// PictdepthListSize computes the size (bytes) of a list of Pictdepth values. +func PictdepthListSize(list []Pictdepth) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumVisuals) * 8))) + } + return size +} + +type Pictformat uint32 + +func NewPictformatId(c *xgb.Conn) (Pictformat, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pictformat(id), nil +} + +type Pictforminfo struct { + Id Pictformat + Type byte + Depth byte + // padding: 2 bytes + Direct Directformat + Colormap xproto.Colormap +} + +// PictforminfoRead reads a byte slice into a Pictforminfo value. +func PictforminfoRead(buf []byte, v *Pictforminfo) int { + b := 0 + + v.Id = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + v.Type = buf[b] + b += 1 + + v.Depth = buf[b] + b += 1 + + b += 2 // padding + + v.Direct = Directformat{} + b += DirectformatRead(buf[b:], &v.Direct) + + v.Colormap = xproto.Colormap(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// PictforminfoReadList reads a byte slice into a list of Pictforminfo values. +func PictforminfoReadList(buf []byte, dest []Pictforminfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictforminfo{} + b += PictforminfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Pictforminfo value to a byte slice. +func (v Pictforminfo) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Id)) + b += 4 + + buf[b] = v.Type + b += 1 + + buf[b] = v.Depth + b += 1 + + b += 2 // padding + + { + structBytes := v.Direct.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Colormap)) + b += 4 + + return buf +} + +// PictforminfoListBytes writes a list of Pictforminfo values to a byte slice. +func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Pictscreen struct { + NumDepths uint32 + Fallback Pictformat + Depths []Pictdepth // size: PictdepthListSize(Depths) +} + +// PictscreenRead reads a byte slice into a Pictscreen value. +func PictscreenRead(buf []byte, v *Pictscreen) int { + b := 0 + + v.NumDepths = xgb.Get32(buf[b:]) + b += 4 + + v.Fallback = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + v.Depths = make([]Pictdepth, v.NumDepths) + b += PictdepthReadList(buf[b:], v.Depths) + + return b +} + +// PictscreenReadList reads a byte slice into a list of Pictscreen values. +func PictscreenReadList(buf []byte, dest []Pictscreen) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictscreen{} + b += PictscreenRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Pictscreen value to a byte slice. +func (v Pictscreen) Bytes() []byte { + buf := make([]byte, (8 + PictdepthListSize(v.Depths))) + b := 0 + + xgb.Put32(buf[b:], v.NumDepths) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Fallback)) + b += 4 + + b += PictdepthListBytes(buf[b:], v.Depths) + + return buf +} + +// PictscreenListBytes writes a list of Pictscreen values to a byte slice. +func PictscreenListBytes(buf []byte, list []Pictscreen) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// PictscreenListSize computes the size (bytes) of a list of Pictscreen values. +func PictscreenListSize(list []Pictscreen) int { + size := 0 + for _, item := range list { + size += (8 + PictdepthListSize(item.Depths)) + } + return size +} + +type Picture uint32 + +func NewPictureId(c *xgb.Conn) (Picture, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Picture(id), nil +} + +// BadPicture is the error number for a BadPicture. +const BadPicture = 1 + +type PictureError struct { + Sequence uint16 + NiceName string +} + +// PictureErrorNew constructs a PictureError value that implements xgb.Error from a byte slice. +func PictureErrorNew(buf []byte) xgb.Error { + v := PictureError{} + v.NiceName = "Picture" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadPicture error. +// This is mostly used internally. +func (err PictureError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadPicture error. If no bad value exists, 0 is returned. +func (err PictureError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadPicture error. + +func (err PictureError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadPicture {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RENDER"][1] = PictureErrorNew +} + +const ( + PictureNone = 0 +) + +type Pictvisual struct { + Visual xproto.Visualid + Format Pictformat +} + +// PictvisualRead reads a byte slice into a Pictvisual value. +func PictvisualRead(buf []byte, v *Pictvisual) int { + b := 0 + + v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Format = Pictformat(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// PictvisualReadList reads a byte slice into a list of Pictvisual values. +func PictvisualReadList(buf []byte, dest []Pictvisual) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pictvisual{} + b += PictvisualRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Pictvisual value to a byte slice. +func (v Pictvisual) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Visual)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Format)) + b += 4 + + return buf +} + +// PictvisualListBytes writes a list of Pictvisual values to a byte slice. +func PictvisualListBytes(buf []byte, list []Pictvisual) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Pointfix struct { + X Fixed + Y Fixed +} + +// PointfixRead reads a byte slice into a Pointfix value. +func PointfixRead(buf []byte, v *Pointfix) int { + b := 0 + + v.X = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Y = Fixed(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// PointfixReadList reads a byte slice into a list of Pointfix values. +func PointfixReadList(buf []byte, dest []Pointfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Pointfix{} + b += PointfixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Pointfix value to a byte slice. +func (v Pointfix) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.X)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// PointfixListBytes writes a list of Pointfix values to a byte slice. +func PointfixListBytes(buf []byte, list []Pointfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + PolyEdgeSharp = 0 + PolyEdgeSmooth = 1 +) + +const ( + PolyModePrecise = 0 + PolyModeImprecise = 1 +) + +const ( + RepeatNone = 0 + RepeatNormal = 1 + RepeatPad = 2 + RepeatReflect = 3 +) + +type Spanfix struct { + L Fixed + R Fixed + Y Fixed +} + +// SpanfixRead reads a byte slice into a Spanfix value. +func SpanfixRead(buf []byte, v *Spanfix) int { + b := 0 + + v.L = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.R = Fixed(xgb.Get32(buf[b:])) + b += 4 + + v.Y = Fixed(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// SpanfixReadList reads a byte slice into a list of Spanfix values. +func SpanfixReadList(buf []byte, dest []Spanfix) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Spanfix{} + b += SpanfixRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Spanfix value to a byte slice. +func (v Spanfix) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + xgb.Put32(buf[b:], uint32(v.L)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.R)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Y)) + b += 4 + + return buf +} + +// SpanfixListBytes writes a list of Spanfix values to a byte slice. +func SpanfixListBytes(buf []byte, list []Spanfix) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + SubPixelUnknown = 0 + SubPixelHorizontalRGB = 1 + SubPixelHorizontalBGR = 2 + SubPixelVerticalRGB = 3 + SubPixelVerticalBGR = 4 + SubPixelNone = 5 +) + type Transform struct { Matrix11 Fixed Matrix12 Fixed @@ -1172,121 +1349,6 @@ func TransformListBytes(buf []byte, list []Transform) int { return b } -type Animcursorelt struct { - Cursor xproto.Cursor - Delay uint32 -} - -// AnimcursoreltRead reads a byte slice into a Animcursorelt value. -func AnimcursoreltRead(buf []byte, v *Animcursorelt) int { - b := 0 - - v.Cursor = xproto.Cursor(xgb.Get32(buf[b:])) - b += 4 - - v.Delay = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// AnimcursoreltReadList reads a byte slice into a list of Animcursorelt values. -func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Animcursorelt{} - b += AnimcursoreltRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Animcursorelt value to a byte slice. -func (v Animcursorelt) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Cursor)) - b += 4 - - xgb.Put32(buf[b:], v.Delay) - b += 4 - - return buf -} - -// AnimcursoreltListBytes writes a list of Animcursorelt values to a byte slice. -func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Spanfix struct { - L Fixed - R Fixed - Y Fixed -} - -// SpanfixRead reads a byte slice into a Spanfix value. -func SpanfixRead(buf []byte, v *Spanfix) int { - b := 0 - - v.L = Fixed(xgb.Get32(buf[b:])) - b += 4 - - v.R = Fixed(xgb.Get32(buf[b:])) - b += 4 - - v.Y = Fixed(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// SpanfixReadList reads a byte slice into a list of Spanfix values. -func SpanfixReadList(buf []byte, dest []Spanfix) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Spanfix{} - b += SpanfixRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Spanfix value to a byte slice. -func (v Spanfix) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - xgb.Put32(buf[b:], uint32(v.L)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.R)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Y)) - b += 4 - - return buf -} - -// SpanfixListBytes writes a list of Spanfix values to a byte slice. -func SpanfixListBytes(buf []byte, list []Spanfix) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type Trap struct { Top Spanfix Bot Spanfix @@ -1347,275 +1409,1519 @@ func TrapListBytes(buf []byte, list []Trap) int { return b } -// BadPictFormat is the error number for a BadPictFormat. -const BadPictFormat = 0 - -type PictFormatError struct { - Sequence uint16 - NiceName string +type Trapezoid struct { + Top Fixed + Bottom Fixed + Left Linefix + Right Linefix } -// PictFormatErrorNew constructs a PictFormatError value that implements xgb.Error from a byte slice. -func PictFormatErrorNew(buf []byte) xgb.Error { - v := PictFormatError{} - v.NiceName = "PictFormat" +// TrapezoidRead reads a byte slice into a Trapezoid value. +func TrapezoidRead(buf []byte, v *Trapezoid) int { + b := 0 - b := 1 // skip error determinant - b += 1 // don't read error number + v.Top = Fixed(xgb.Get32(buf[b:])) + b += 4 - v.Sequence = xgb.Get16(buf[b:]) - b += 2 + v.Bottom = Fixed(xgb.Get32(buf[b:])) + b += 4 - return v + v.Left = Linefix{} + b += LinefixRead(buf[b:], &v.Left) + + v.Right = Linefix{} + b += LinefixRead(buf[b:], &v.Right) + + return b } -// SequenceId returns the sequence id attached to the BadPictFormat error. -// This is mostly used internally. -func (err PictFormatError) SequenceId() uint16 { - return err.Sequence +// TrapezoidReadList reads a byte slice into a list of Trapezoid values. +func TrapezoidReadList(buf []byte, dest []Trapezoid) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Trapezoid{} + b += TrapezoidRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) } -// BadId returns the 'BadValue' number if one exists for the BadPictFormat error. If no bad value exists, 0 is returned. -func (err PictFormatError) BadId() uint32 { - return 0 +// Bytes writes a Trapezoid value to a byte slice. +func (v Trapezoid) Bytes() []byte { + buf := make([]byte, 40) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Top)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Bottom)) + b += 4 + + { + structBytes := v.Left.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.Right.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf } -// Error returns a rudimentary string representation of the BadPictFormat error. - -func (err PictFormatError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadPictFormat {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// TrapezoidListBytes writes a list of Trapezoid values to a byte slice. +func TrapezoidListBytes(buf []byte, list []Trapezoid) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -func init() { - xgb.NewExtErrorFuncs["RENDER"][0] = PictFormatErrorNew +type Triangle struct { + P1 Pointfix + P2 Pointfix + P3 Pointfix } -// BadPicture is the error number for a BadPicture. -const BadPicture = 1 +// TriangleRead reads a byte slice into a Triangle value. +func TriangleRead(buf []byte, v *Triangle) int { + b := 0 -type PictureError struct { - Sequence uint16 - NiceName string + v.P1 = Pointfix{} + b += PointfixRead(buf[b:], &v.P1) + + v.P2 = Pointfix{} + b += PointfixRead(buf[b:], &v.P2) + + v.P3 = Pointfix{} + b += PointfixRead(buf[b:], &v.P3) + + return b } -// PictureErrorNew constructs a PictureError value that implements xgb.Error from a byte slice. -func PictureErrorNew(buf []byte) xgb.Error { - v := PictureError{} - v.NiceName = "Picture" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v +// TriangleReadList reads a byte slice into a list of Triangle values. +func TriangleReadList(buf []byte, dest []Triangle) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Triangle{} + b += TriangleRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) } -// SequenceId returns the sequence id attached to the BadPicture error. -// This is mostly used internally. -func (err PictureError) SequenceId() uint16 { - return err.Sequence +// Bytes writes a Triangle value to a byte slice. +func (v Triangle) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + { + structBytes := v.P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.P3.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadPicture error. If no bad value exists, 0 is returned. -func (err PictureError) BadId() uint32 { - return 0 +// TriangleListBytes writes a list of Triangle values to a byte slice. +func TriangleListBytes(buf []byte, list []Triangle) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -// Error returns a rudimentary string representation of the BadPicture error. +// Skipping definition for base type 'Bool' -func (err PictureError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadPicture {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Byte' -func init() { - xgb.NewExtErrorFuncs["RENDER"][1] = PictureErrorNew -} +// Skipping definition for base type 'Card8' -// BadPictOp is the error number for a BadPictOp. -const BadPictOp = 2 +// Skipping definition for base type 'Char' -type PictOpError struct { - Sequence uint16 - NiceName string -} +// Skipping definition for base type 'Void' -// PictOpErrorNew constructs a PictOpError value that implements xgb.Error from a byte slice. -func PictOpErrorNew(buf []byte) xgb.Error { - v := PictOpError{} - v.NiceName = "PictOp" +// Skipping definition for base type 'Double' - b := 1 // skip error determinant - b += 1 // don't read error number +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - return v -} +// Skipping definition for base type 'Int32' -// SequenceId returns the sequence id attached to the BadPictOp error. -// This is mostly used internally. -func (err PictOpError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Int8' -// BadId returns the 'BadValue' number if one exists for the BadPictOp error. If no bad value exists, 0 is returned. -func (err PictOpError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Card16' -// Error returns a rudimentary string representation of the BadPictOp error. +// Skipping definition for base type 'Card32' -func (err PictOpError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadPictOp {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["RENDER"][2] = PictOpErrorNew -} - -// BadGlyphSet is the error number for a BadGlyphSet. -const BadGlyphSet = 3 - -type GlyphSetError struct { - Sequence uint16 - NiceName string -} - -// GlyphSetErrorNew constructs a GlyphSetError value that implements xgb.Error from a byte slice. -func GlyphSetErrorNew(buf []byte) xgb.Error { - v := GlyphSetError{} - v.NiceName = "GlyphSet" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadGlyphSet error. -// This is mostly used internally. -func (err GlyphSetError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadGlyphSet error. If no bad value exists, 0 is returned. -func (err GlyphSetError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadGlyphSet error. - -func (err GlyphSetError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadGlyphSet {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["RENDER"][3] = GlyphSetErrorNew -} - -// BadGlyph is the error number for a BadGlyph. -const BadGlyph = 4 - -type GlyphError struct { - Sequence uint16 - NiceName string -} - -// GlyphErrorNew constructs a GlyphError value that implements xgb.Error from a byte slice. -func GlyphErrorNew(buf []byte) xgb.Error { - v := GlyphError{} - v.NiceName = "Glyph" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadGlyph error. -// This is mostly used internally. -func (err GlyphError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadGlyph error. If no bad value exists, 0 is returned. -func (err GlyphError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadGlyph error. - -func (err GlyphError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadGlyph {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["RENDER"][4] = GlyphErrorNew -} - -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// AddGlyphsCookie is a cookie used only for AddGlyphs requests. +type AddGlyphsCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { +// AddGlyphs sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return AddGlyphsCookie{cookie} +} + +// AddGlyphsChecked sends a checked request. +// If an error occurs, it can be retrieved using AddGlyphsCookie.Check() +func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) + return AddGlyphsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AddGlyphsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddGlyphs +// addGlyphsRequest writes a AddGlyphs request to a byte slice. +func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { + size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put32(buf[b:], GlyphsLen) + b += 4 + + for i := 0; i < int(GlyphsLen); i++ { + xgb.Put32(buf[b:], Glyphids[i]) + b += 4 + } + b = xgb.Pad(b) + + b += GlyphinfoListBytes(buf[b:], Glyphs) + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// AddTrapsCookie is a cookie used only for AddTraps requests. +type AddTrapsCookie struct { + *xgb.Cookie +} + +// AddTraps sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) + return AddTrapsCookie{cookie} +} + +// AddTrapsChecked sends a checked request. +// If an error occurs, it can be retrieved using AddTrapsCookie.Check() +func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) + return AddTrapsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AddTrapsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AddTraps +// addTrapsRequest writes a AddTraps request to a byte slice. +func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOff)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOff)) + b += 2 + + b += TrapListBytes(buf[b:], Traps) + + return buf +} + +// ChangePictureCookie is a cookie used only for ChangePicture requests. +type ChangePictureCookie struct { + *xgb.Cookie +} + +// ChangePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) + return ChangePictureCookie{cookie} +} + +// ChangePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePictureCookie.Check() +func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) + return ChangePictureCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangePicture +// changePictureRequest writes a ChangePicture request to a byte slice. +func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CompositeCookie is a cookie used only for Composite requests. +type CompositeCookie struct { + *xgb.Cookie +} + +// Composite sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return CompositeCookie{cookie} +} + +// CompositeChecked sends a checked request. +// If an error occurs, it can be retrieved using CompositeCookie.Check() +func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) + return CompositeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CompositeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Composite +// compositeRequest writes a Composite request to a byte slice. +func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { + size := 36 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mask)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], uint16(MaskX)) + b += 2 + + xgb.Put16(buf[b:], uint16(MaskY)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// CompositeGlyphs16Cookie is a cookie used only for CompositeGlyphs16 requests. +type CompositeGlyphs16Cookie struct { + *xgb.Cookie +} + +// CompositeGlyphs16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs16Cookie{cookie} +} + +// CompositeGlyphs16Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs16Cookie.Check() +func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs16Cookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CompositeGlyphs16Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs16 +// compositeGlyphs16Request writes a CompositeGlyphs16 request to a byte slice. +func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// CompositeGlyphs32Cookie is a cookie used only for CompositeGlyphs32 requests. +type CompositeGlyphs32Cookie struct { + *xgb.Cookie +} + +// CompositeGlyphs32 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs32Cookie{cookie} +} + +// CompositeGlyphs32Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs32Cookie.Check() +func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs32Cookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CompositeGlyphs32Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs32 +// compositeGlyphs32Request writes a CompositeGlyphs32 request to a byte slice. +func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 25 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// CompositeGlyphs8Cookie is a cookie used only for CompositeGlyphs8 requests. +type CompositeGlyphs8Cookie struct { + *xgb.Cookie +} + +// CompositeGlyphs8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs8Cookie{cookie} +} + +// CompositeGlyphs8Checked sends a checked request. +// If an error occurs, it can be retrieved using CompositeGlyphs8Cookie.Check() +func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) + return CompositeGlyphs8Cookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CompositeGlyphs8Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CompositeGlyphs8 +// compositeGlyphs8Request writes a CompositeGlyphs8 request to a byte slice. +func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { + size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFormat)) + b += 4 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) + b += xgb.Pad(int(len(Glyphcmds))) + + return buf +} + +// CreateAnimCursorCookie is a cookie used only for CreateAnimCursor requests. +type CreateAnimCursorCookie struct { + *xgb.Cookie +} + +// CreateAnimCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) + return CreateAnimCursorCookie{cookie} +} + +// CreateAnimCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateAnimCursorCookie.Check() +func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) + return CreateAnimCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateAnimCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateAnimCursor +// createAnimCursorRequest writes a CreateAnimCursor request to a byte slice. +func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + b += AnimcursoreltListBytes(buf[b:], Cursors) + + return buf +} + +// CreateConicalGradientCookie is a cookie used only for CreateConicalGradient requests. +type CreateConicalGradientCookie struct { + *xgb.Cookie +} + +// CreateConicalGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return CreateConicalGradientCookie{cookie} +} + +// CreateConicalGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateConicalGradientCookie.Check() +func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) + return CreateConicalGradientCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateConicalGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateConicalGradient +// createConicalGradientRequest writes a CreateConicalGradient request to a byte slice. +func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 36 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Center.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(Angle)) + b += 4 + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} + +// CreateCursorCookie is a cookie used only for CreateCursor requests. +type CreateCursorCookie struct { + *xgb.Cookie +} + +// CreateCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +// CreateCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCursorCookie.Check() +func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateCursor +// createCursorRequest writes a CreateCursor request to a byte slice. +func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put16(buf[b:], X) + b += 2 + + xgb.Put16(buf[b:], Y) + b += 2 + + return buf +} + +// CreateGlyphSetCookie is a cookie used only for CreateGlyphSet requests. +type CreateGlyphSetCookie struct { + *xgb.Cookie +} + +// CreateGlyphSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) + return CreateGlyphSetCookie{cookie} +} + +// CreateGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGlyphSetCookie.Check() +func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) + return CreateGlyphSetCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateGlyphSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateGlyphSet +// createGlyphSetRequest writes a CreateGlyphSet request to a byte slice. +func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gsid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Format)) + b += 4 + + return buf +} + +// CreateLinearGradientCookie is a cookie used only for CreateLinearGradient requests. +type CreateLinearGradientCookie struct { + *xgb.Cookie +} + +// CreateLinearGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) + return CreateLinearGradientCookie{cookie} +} + +// CreateLinearGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateLinearGradientCookie.Check() +func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) + return CreateLinearGradientCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateLinearGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateLinearGradient +// createLinearGradientRequest writes a CreateLinearGradient request to a byte slice. +func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := P1.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := P2.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} + +// CreatePictureCookie is a cookie used only for CreatePicture requests. +type CreatePictureCookie struct { + *xgb.Cookie +} + +// CreatePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) + return CreatePictureCookie{cookie} +} + +// CreatePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePictureCookie.Check() +func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) + return CreatePictureCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreatePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePicture +// createPictureRequest writes a CreatePicture request to a byte slice. +func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Format)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CreateRadialGradientCookie is a cookie used only for CreateRadialGradient requests. +type CreateRadialGradientCookie struct { + *xgb.Cookie +} + +// CreateRadialGradient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return CreateRadialGradientCookie{cookie} +} + +// CreateRadialGradientChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRadialGradientCookie.Check() +func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) + return CreateRadialGradientCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRadialGradientCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRadialGradient +// createRadialGradientRequest writes a CreateRadialGradient request to a byte slice. +func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { + size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Inner.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := Outer.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(InnerRadius)) + b += 4 + + xgb.Put32(buf[b:], uint32(OuterRadius)) + b += 4 + + xgb.Put32(buf[b:], NumStops) + b += 4 + + for i := 0; i < int(NumStops); i++ { + xgb.Put32(buf[b:], uint32(Stops[i])) + b += 4 + } + b = xgb.Pad(b) + + b += ColorListBytes(buf[b:], Colors) + + return buf +} + +// CreateSolidFillCookie is a cookie used only for CreateSolidFill requests. +type CreateSolidFillCookie struct { + *xgb.Cookie +} + +// CreateSolidFill sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) + return CreateSolidFillCookie{cookie} +} + +// CreateSolidFillChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateSolidFillCookie.Check() +func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) + return CreateSolidFillCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateSolidFillCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateSolidFill +// createSolidFillRequest writes a CreateSolidFill request to a byte slice. +func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// FillRectanglesCookie is a cookie used only for FillRectangles requests. +type FillRectanglesCookie struct { + *xgb.Cookie +} + +// FillRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) + return FillRectanglesCookie{cookie} +} + +// FillRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using FillRectanglesCookie.Check() +func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) + return FillRectanglesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FillRectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FillRectangles +// fillRectanglesRequest writes a FillRectangles request to a byte slice. +func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) []byte { + size := xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Op + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Dst)) + b += 4 + + { + structBytes := Color.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + b += xproto.RectangleListBytes(buf[b:], Rects) + + return buf +} + +// FreeGlyphSetCookie is a cookie used only for FreeGlyphSet requests. +type FreeGlyphSetCookie struct { + *xgb.Cookie +} + +// FreeGlyphSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) + return FreeGlyphSetCookie{cookie} +} + +// FreeGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGlyphSetCookie.Check() +func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) + return FreeGlyphSetCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeGlyphSetCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeGlyphSet +// freeGlyphSetRequest writes a FreeGlyphSet request to a byte slice. +func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + return buf +} + +// FreeGlyphsCookie is a cookie used only for FreeGlyphs requests. +type FreeGlyphsCookie struct { + *xgb.Cookie +} + +// FreeGlyphs sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) + return FreeGlyphsCookie{cookie} +} + +// FreeGlyphsChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGlyphsCookie.Check() +func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) + return FreeGlyphsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeGlyphsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeGlyphs +// freeGlyphsRequest writes a FreeGlyphs request to a byte slice. +func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Glyphset)) + b += 4 + + for i := 0; i < int(len(Glyphs)); i++ { + xgb.Put32(buf[b:], uint32(Glyphs[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// FreePictureCookie is a cookie used only for FreePicture requests. +type FreePictureCookie struct { + *xgb.Cookie +} + +// FreePicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(freePictureRequest(c, Picture), cookie) + return FreePictureCookie{cookie} +} + +// FreePictureChecked sends a checked request. +// If an error occurs, it can be retrieved using FreePictureCookie.Check() +func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(freePictureRequest(c, Picture), cookie) + return FreePictureCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreePictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreePicture +// freePictureRequest writes a FreePicture request to a byte slice. +func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RENDER"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// QueryFiltersCookie is a cookie used only for QueryFilters requests. +type QueryFiltersCookie struct { + *xgb.Cookie +} + +// QueryFilters sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFiltersCookie.Reply() +func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(queryFiltersRequest(c, Drawable), cookie) + return QueryFiltersCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// QueryFiltersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { +func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(queryFiltersRequest(c, Drawable), cookie) + return QueryFiltersCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { +// QueryFiltersReply represents the data returned from a QueryFilters request. +type QueryFiltersReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 + NumAliases uint32 + NumFilters uint32 // padding: 16 bytes + Aliases []uint16 // size: xgb.Pad((int(NumAliases) * 2)) + Filters []xproto.Str // size: xproto.StrListSize(Filters) } -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { +// Reply blocks and returns the reply data for a QueryFilters request. +func (cook QueryFiltersCookie) Reply() (*QueryFiltersReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1623,12 +2929,12 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { if buf == nil { return nil, nil } - return queryVersionReply(buf), nil + return queryFiltersReply(buf), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) +// queryFiltersReply reads a byte slice into a QueryFiltersReply value. +func queryFiltersReply(buf []byte) *QueryFiltersReply { + v := new(QueryFiltersReply) b := 1 // skip reply determinant b += 1 // padding @@ -1639,37 +2945,44 @@ func queryVersionReply(buf []byte) *QueryVersionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.MajorVersion = xgb.Get32(buf[b:]) + v.NumAliases = xgb.Get32(buf[b:]) b += 4 - v.MinorVersion = xgb.Get32(buf[b:]) + v.NumFilters = xgb.Get32(buf[b:]) b += 4 b += 16 // padding + v.Aliases = make([]uint16, v.NumAliases) + for i := 0; i < int(v.NumAliases); i++ { + v.Aliases[i] = xgb.Get16(buf[b:]) + b += 2 + } + b = xgb.Pad(b) + + v.Filters = make([]xproto.Str, v.NumFilters) + b += xproto.StrReadList(buf[b:], v.Filters) + return v } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { - size := 12 +// Write request to wire for QueryFilters +// queryFiltersRequest writes a QueryFilters request to a byte slice. +func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 29 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], ClientMajorVersion) - b += 4 - - xgb.Put32(buf[b:], ClientMinorVersion) + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 return buf @@ -1890,134 +3203,158 @@ func queryPictIndexValuesRequest(c *xgb.Conn, Format Pictformat) []byte { return buf } -// CreatePictureCookie is a cookie used only for CreatePicture requests. -type CreatePictureCookie struct { +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { *xgb.Cookie } -// CreatePicture sends an unchecked request. +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["RENDER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) - return CreatePictureCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} } -// CreatePictureChecked sends a checked request. -// If an error occurs, it can be retrieved using CreatePictureCookie.Check() -func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(createPictureRequest(c, Pid, Drawable, Format, ValueMask, ValueList), cookie) - return CreatePictureCookie{cookie} + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreatePictureCookie) Check() error { - return cook.Cookie.Check() +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v } -// Write request to wire for CreatePicture -// createPictureRequest writes a CreatePicture request to a byte slice. -func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 4 // request opcode + buf[b] = 0 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Pid)) + xgb.Put32(buf[b:], ClientMajorVersion) b += 4 - xgb.Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], ClientMinorVersion) b += 4 - xgb.Put32(buf[b:], uint32(Format)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - return buf } -// ChangePictureCookie is a cookie used only for ChangePicture requests. -type ChangePictureCookie struct { +// ReferenceGlyphSetCookie is a cookie used only for ReferenceGlyphSet requests. +type ReferenceGlyphSetCookie struct { *xgb.Cookie } -// ChangePicture sends an unchecked request. +// ReferenceGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { +func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) - return ChangePictureCookie{cookie} + c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) + return ReferenceGlyphSetCookie{cookie} } -// ChangePictureChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangePictureCookie.Check() -func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { +// ReferenceGlyphSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ReferenceGlyphSetCookie.Check() +func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(changePictureRequest(c, Picture, ValueMask, ValueList), cookie) - return ChangePictureCookie{cookie} + c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) + return ReferenceGlyphSetCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangePictureCookie) Check() error { +func (cook ReferenceGlyphSetCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangePicture -// changePictureRequest writes a ChangePicture request to a byte slice. -func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// Write request to wire for ReferenceGlyphSet +// referenceGlyphSetRequest writes a ReferenceGlyphSet request to a byte slice. +func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 5 // request opcode + buf[b] = 18 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Picture)) + xgb.Put32(buf[b:], uint32(Gsid)) b += 4 - xgb.Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], uint32(Existing)) b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) return buf } @@ -2085,50 +3422,50 @@ func setPictureClipRectanglesRequest(c *xgb.Conn, Picture Picture, ClipXOrigin i return buf } -// FreePictureCookie is a cookie used only for FreePicture requests. -type FreePictureCookie struct { +// SetPictureFilterCookie is a cookie used only for SetPictureFilter requests. +type SetPictureFilterCookie struct { *xgb.Cookie } -// FreePicture sends an unchecked request. +// SetPictureFilter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { +func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(freePictureRequest(c, Picture), cookie) - return FreePictureCookie{cookie} + c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) + return SetPictureFilterCookie{cookie} } -// FreePictureChecked sends a checked request. -// If an error occurs, it can be retrieved using FreePictureCookie.Check() -func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { +// SetPictureFilterChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureFilterCookie.Check() +func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(freePictureRequest(c, Picture), cookie) - return FreePictureCookie{cookie} + c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) + return SetPictureFilterCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreePictureCookie) Check() error { +func (cook SetPictureFilterCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreePicture -// freePictureRequest writes a FreePicture request to a byte slice. -func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { - size := 8 +// Write request to wire for SetPictureFilter +// setPictureFilterRequest writes a SetPictureFilter request to a byte slice. +func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) []byte { + size := xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 7 // request opcode + buf[b] = 30 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2137,95 +3474,80 @@ func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { xgb.Put32(buf[b:], uint32(Picture)) b += 4 + xgb.Put16(buf[b:], FilterLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Filter[:FilterLen]) + b += xgb.Pad(int(FilterLen)) + + for i := 0; i < int(len(Values)); i++ { + xgb.Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = xgb.Pad(b) + return buf } -// CompositeCookie is a cookie used only for Composite requests. -type CompositeCookie struct { +// SetPictureTransformCookie is a cookie used only for SetPictureTransform requests. +type SetPictureTransformCookie struct { *xgb.Cookie } -// Composite sends an unchecked request. +// SetPictureTransform sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { +func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) - return CompositeCookie{cookie} + c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) + return SetPictureTransformCookie{cookie} } -// CompositeChecked sends a checked request. -// If an error occurs, it can be retrieved using CompositeCookie.Check() -func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { +// SetPictureTransformChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureTransformCookie.Check() +func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(compositeRequest(c, Op, Src, Mask, Dst, SrcX, SrcY, MaskX, MaskY, DstX, DstY, Width, Height), cookie) - return CompositeCookie{cookie} + c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) + return SetPictureTransformCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CompositeCookie) Check() error { +func (cook SetPictureTransformCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for Composite -// compositeRequest writes a Composite request to a byte slice. -func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { - size := 36 +// Write request to wire for SetPictureTransform +// setPictureTransformRequest writes a SetPictureTransform request to a byte slice. +func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transform) []byte { + size := 44 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 8 // request opcode + buf[b] = 28 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - buf[b] = Op - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], uint32(Src)) + xgb.Put32(buf[b:], uint32(Picture)) b += 4 - xgb.Put32(buf[b:], uint32(Mask)) - b += 4 - - xgb.Put32(buf[b:], uint32(Dst)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - xgb.Put16(buf[b:], uint16(MaskX)) - b += 2 - - xgb.Put16(buf[b:], uint16(MaskY)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 + { + structBytes := Transform.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } return buf } @@ -2304,50 +3626,50 @@ func trapezoidsRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma return buf } -// TrianglesCookie is a cookie used only for Triangles requests. -type TrianglesCookie struct { +// TriFanCookie is a cookie used only for TriFan requests. +type TriFanCookie struct { *xgb.Cookie } -// Triangles sends an unchecked request. +// TriFan sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { +func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) - return TrianglesCookie{cookie} + c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriFanCookie{cookie} } -// TrianglesChecked sends a checked request. -// If an error occurs, it can be retrieved using TrianglesCookie.Check() -func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { +// TriFanChecked sends a checked request. +// If an error occurs, it can be retrieved using TriFanCookie.Check() +func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) - return TrianglesCookie{cookie} + c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) + return TriFanCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook TrianglesCookie) Check() error { +func (cook TriFanCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for Triangles -// trianglesRequest writes a Triangles request to a byte slice. -func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) []byte { - size := xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) +// Write request to wire for TriFan +// triFanRequest writes a TriFan request to a byte slice. +func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 11 // request opcode + buf[b] = 13 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2373,7 +3695,7 @@ func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat xgb.Put16(buf[b:], uint16(SrcY)) b += 2 - b += TriangleListBytes(buf[b:], Triangles) + b += PointfixListBytes(buf[b:], Points) return buf } @@ -2452,50 +3774,50 @@ func triStripRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat return buf } -// TriFanCookie is a cookie used only for TriFan requests. -type TriFanCookie struct { +// TrianglesCookie is a cookie used only for Triangles requests. +type TrianglesCookie struct { *xgb.Cookie } -// TriFan sends an unchecked request. +// Triangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { +func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return TriFanCookie{cookie} + c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return TrianglesCookie{cookie} } -// TriFanChecked sends a checked request. -// If an error occurs, it can be retrieved using TriFanCookie.Check() -func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { +// TrianglesChecked sends a checked request. +// If an error occurs, it can be retrieved using TrianglesCookie.Check() +func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") + panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(triFanRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Points), cookie) - return TriFanCookie{cookie} + c.NewRequest(trianglesRequest(c, Op, Src, Dst, MaskFormat, SrcX, SrcY, Triangles), cookie) + return TrianglesCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook TriFanCookie) Check() error { +func (cook TrianglesCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for TriFan -// triFanRequest writes a TriFan request to a byte slice. -func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) []byte { - size := xgb.Pad((24 + xgb.Pad((len(Points) * 8)))) +// Write request to wire for Triangles +// trianglesRequest writes a Triangles request to a byte slice. +func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Triangles) * 24)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["RENDER"] b += 1 - buf[b] = 13 // request opcode + buf[b] = 11 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2521,1329 +3843,7 @@ func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pi xgb.Put16(buf[b:], uint16(SrcY)) b += 2 - b += PointfixListBytes(buf[b:], Points) - - return buf -} - -// CreateGlyphSetCookie is a cookie used only for CreateGlyphSet requests. -type CreateGlyphSetCookie struct { - *xgb.Cookie -} - -// CreateGlyphSet sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) - return CreateGlyphSetCookie{cookie} -} - -// CreateGlyphSetChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateGlyphSetCookie.Check() -func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createGlyphSetRequest(c, Gsid, Format), cookie) - return CreateGlyphSetCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateGlyphSetCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateGlyphSet -// createGlyphSetRequest writes a CreateGlyphSet request to a byte slice. -func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gsid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Format)) - b += 4 - - return buf -} - -// ReferenceGlyphSetCookie is a cookie used only for ReferenceGlyphSet requests. -type ReferenceGlyphSetCookie struct { - *xgb.Cookie -} - -// ReferenceGlyphSet sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) - return ReferenceGlyphSetCookie{cookie} -} - -// ReferenceGlyphSetChecked sends a checked request. -// If an error occurs, it can be retrieved using ReferenceGlyphSetCookie.Check() -func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(referenceGlyphSetRequest(c, Gsid, Existing), cookie) - return ReferenceGlyphSetCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ReferenceGlyphSetCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ReferenceGlyphSet -// referenceGlyphSetRequest writes a ReferenceGlyphSet request to a byte slice. -func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gsid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Existing)) - b += 4 - - return buf -} - -// FreeGlyphSetCookie is a cookie used only for FreeGlyphSet requests. -type FreeGlyphSetCookie struct { - *xgb.Cookie -} - -// FreeGlyphSet sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) - return FreeGlyphSetCookie{cookie} -} - -// FreeGlyphSetChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeGlyphSetCookie.Check() -func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(freeGlyphSetRequest(c, Glyphset), cookie) - return FreeGlyphSetCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeGlyphSetCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeGlyphSet -// freeGlyphSetRequest writes a FreeGlyphSet request to a byte slice. -func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - return buf -} - -// AddGlyphsCookie is a cookie used only for AddGlyphs requests. -type AddGlyphsCookie struct { - *xgb.Cookie -} - -// AddGlyphs sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) - return AddGlyphsCookie{cookie} -} - -// AddGlyphsChecked sends a checked request. -// If an error occurs, it can be retrieved using AddGlyphsCookie.Check() -func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(addGlyphsRequest(c, Glyphset, GlyphsLen, Glyphids, Glyphs, Data), cookie) - return AddGlyphsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AddGlyphsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AddGlyphs -// addGlyphsRequest writes a AddGlyphs request to a byte slice. -func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { - size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - xgb.Put32(buf[b:], GlyphsLen) - b += 4 - - for i := 0; i < int(GlyphsLen); i++ { - xgb.Put32(buf[b:], Glyphids[i]) - b += 4 - } - b = xgb.Pad(b) - - b += GlyphinfoListBytes(buf[b:], Glyphs) - - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) - - return buf -} - -// FreeGlyphsCookie is a cookie used only for FreeGlyphs requests. -type FreeGlyphsCookie struct { - *xgb.Cookie -} - -// FreeGlyphs sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) - return FreeGlyphsCookie{cookie} -} - -// FreeGlyphsChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeGlyphsCookie.Check() -func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(freeGlyphsRequest(c, Glyphset, Glyphs), cookie) - return FreeGlyphsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeGlyphsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeGlyphs -// freeGlyphsRequest writes a FreeGlyphs request to a byte slice. -func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Glyphs) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - for i := 0; i < int(len(Glyphs)); i++ { - xgb.Put32(buf[b:], uint32(Glyphs[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// CompositeGlyphs8Cookie is a cookie used only for CompositeGlyphs8 requests. -type CompositeGlyphs8Cookie struct { - *xgb.Cookie -} - -// CompositeGlyphs8 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs8Cookie{cookie} -} - -// CompositeGlyphs8Checked sends a checked request. -// If an error occurs, it can be retrieved using CompositeGlyphs8Cookie.Check() -func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(compositeGlyphs8Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs8Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CompositeGlyphs8Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CompositeGlyphs8 -// compositeGlyphs8Request writes a CompositeGlyphs8 request to a byte slice. -func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], uint32(Src)) - b += 4 - - xgb.Put32(buf[b:], uint32(Dst)) - b += 4 - - xgb.Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) - - return buf -} - -// CompositeGlyphs16Cookie is a cookie used only for CompositeGlyphs16 requests. -type CompositeGlyphs16Cookie struct { - *xgb.Cookie -} - -// CompositeGlyphs16 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs16Cookie{cookie} -} - -// CompositeGlyphs16Checked sends a checked request. -// If an error occurs, it can be retrieved using CompositeGlyphs16Cookie.Check() -func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(compositeGlyphs16Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs16Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CompositeGlyphs16Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CompositeGlyphs16 -// compositeGlyphs16Request writes a CompositeGlyphs16 request to a byte slice. -func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], uint32(Src)) - b += 4 - - xgb.Put32(buf[b:], uint32(Dst)) - b += 4 - - xgb.Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) - - return buf -} - -// CompositeGlyphs32Cookie is a cookie used only for CompositeGlyphs32 requests. -type CompositeGlyphs32Cookie struct { - *xgb.Cookie -} - -// CompositeGlyphs32 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs32Cookie{cookie} -} - -// CompositeGlyphs32Checked sends a checked request. -// If an error occurs, it can be retrieved using CompositeGlyphs32Cookie.Check() -func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(compositeGlyphs32Request(c, Op, Src, Dst, MaskFormat, Glyphset, SrcX, SrcY, Glyphcmds), cookie) - return CompositeGlyphs32Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CompositeGlyphs32Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CompositeGlyphs32 -// compositeGlyphs32Request writes a CompositeGlyphs32 request to a byte slice. -func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) []byte { - size := xgb.Pad((28 + xgb.Pad((len(Glyphcmds) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], uint32(Src)) - b += 4 - - xgb.Put32(buf[b:], uint32(Dst)) - b += 4 - - xgb.Put32(buf[b:], uint32(MaskFormat)) - b += 4 - - xgb.Put32(buf[b:], uint32(Glyphset)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) - - return buf -} - -// FillRectanglesCookie is a cookie used only for FillRectangles requests. -type FillRectanglesCookie struct { - *xgb.Cookie -} - -// FillRectangles sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) - return FillRectanglesCookie{cookie} -} - -// FillRectanglesChecked sends a checked request. -// If an error occurs, it can be retrieved using FillRectanglesCookie.Check() -func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(fillRectanglesRequest(c, Op, Dst, Color, Rects), cookie) - return FillRectanglesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FillRectanglesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FillRectangles -// fillRectanglesRequest writes a FillRectangles request to a byte slice. -func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) []byte { - size := xgb.Pad((20 + xgb.Pad((len(Rects) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Op - b += 1 - - b += 3 // padding - - xgb.Put32(buf[b:], uint32(Dst)) - b += 4 - - { - structBytes := Color.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - b += xproto.RectangleListBytes(buf[b:], Rects) - - return buf -} - -// CreateCursorCookie is a cookie used only for CreateCursor requests. -type CreateCursorCookie struct { - *xgb.Cookie -} - -// CreateCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) - return CreateCursorCookie{cookie} -} - -// CreateCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateCursorCookie.Check() -func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createCursorRequest(c, Cid, Source, X, Y), cookie) - return CreateCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateCursor -// createCursorRequest writes a CreateCursor request to a byte slice. -func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - xgb.Put16(buf[b:], X) - b += 2 - - xgb.Put16(buf[b:], Y) - b += 2 - - return buf -} - -// SetPictureTransformCookie is a cookie used only for SetPictureTransform requests. -type SetPictureTransformCookie struct { - *xgb.Cookie -} - -// SetPictureTransform sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) - return SetPictureTransformCookie{cookie} -} - -// SetPictureTransformChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPictureTransformCookie.Check() -func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPictureTransformRequest(c, Picture, Transform), cookie) - return SetPictureTransformCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPictureTransformCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPictureTransform -// setPictureTransformRequest writes a SetPictureTransform request to a byte slice. -func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transform) []byte { - size := 44 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Transform.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// QueryFiltersCookie is a cookie used only for QueryFilters requests. -type QueryFiltersCookie struct { - *xgb.Cookie -} - -// QueryFilters sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryFiltersCookie.Reply() -func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryFiltersRequest(c, Drawable), cookie) - return QueryFiltersCookie{cookie} -} - -// QueryFiltersUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryFiltersRequest(c, Drawable), cookie) - return QueryFiltersCookie{cookie} -} - -// QueryFiltersReply represents the data returned from a QueryFilters request. -type QueryFiltersReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumAliases uint32 - NumFilters uint32 - // padding: 16 bytes - Aliases []uint16 // size: xgb.Pad((int(NumAliases) * 2)) - Filters []xproto.Str // size: xproto.StrListSize(Filters) -} - -// Reply blocks and returns the reply data for a QueryFilters request. -func (cook QueryFiltersCookie) Reply() (*QueryFiltersReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryFiltersReply(buf), nil -} - -// queryFiltersReply reads a byte slice into a QueryFiltersReply value. -func queryFiltersReply(buf []byte) *QueryFiltersReply { - v := new(QueryFiltersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAliases = xgb.Get32(buf[b:]) - b += 4 - - v.NumFilters = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.Aliases = make([]uint16, v.NumAliases) - for i := 0; i < int(v.NumAliases); i++ { - v.Aliases[i] = xgb.Get16(buf[b:]) - b += 2 - } - b = xgb.Pad(b) - - v.Filters = make([]xproto.Str, v.NumFilters) - b += xproto.StrReadList(buf[b:], v.Filters) - - return v -} - -// Write request to wire for QueryFilters -// queryFiltersRequest writes a QueryFilters request to a byte slice. -func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// SetPictureFilterCookie is a cookie used only for SetPictureFilter requests. -type SetPictureFilterCookie struct { - *xgb.Cookie -} - -// SetPictureFilter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) - return SetPictureFilterCookie{cookie} -} - -// SetPictureFilterChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPictureFilterCookie.Check() -func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPictureFilterRequest(c, Picture, FilterLen, Filter, Values), cookie) - return SetPictureFilterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPictureFilterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPictureFilter -// setPictureFilterRequest writes a SetPictureFilter request to a byte slice. -func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) []byte { - size := xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - xgb.Put16(buf[b:], FilterLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Filter[:FilterLen]) - b += xgb.Pad(int(FilterLen)) - - for i := 0; i < int(len(Values)); i++ { - xgb.Put32(buf[b:], uint32(Values[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// CreateAnimCursorCookie is a cookie used only for CreateAnimCursor requests. -type CreateAnimCursorCookie struct { - *xgb.Cookie -} - -// CreateAnimCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) - return CreateAnimCursorCookie{cookie} -} - -// CreateAnimCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateAnimCursorCookie.Check() -func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createAnimCursorRequest(c, Cid, Cursors), cookie) - return CreateAnimCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateAnimCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateAnimCursor -// createAnimCursorRequest writes a CreateAnimCursor request to a byte slice. -func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Cursors) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cid)) - b += 4 - - b += AnimcursoreltListBytes(buf[b:], Cursors) - - return buf -} - -// AddTrapsCookie is a cookie used only for AddTraps requests. -type AddTrapsCookie struct { - *xgb.Cookie -} - -// AddTraps sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) - return AddTrapsCookie{cookie} -} - -// AddTrapsChecked sends a checked request. -// If an error occurs, it can be retrieved using AddTrapsCookie.Check() -func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(addTrapsRequest(c, Picture, XOff, YOff, Traps), cookie) - return AddTrapsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AddTrapsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AddTraps -// addTrapsRequest writes a AddTraps request to a byte slice. -func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Traps) * 24)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 32 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - xgb.Put16(buf[b:], uint16(XOff)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOff)) - b += 2 - - b += TrapListBytes(buf[b:], Traps) - - return buf -} - -// CreateSolidFillCookie is a cookie used only for CreateSolidFill requests. -type CreateSolidFillCookie struct { - *xgb.Cookie -} - -// CreateSolidFill sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) - return CreateSolidFillCookie{cookie} -} - -// CreateSolidFillChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateSolidFillCookie.Check() -func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createSolidFillRequest(c, Picture, Color), cookie) - return CreateSolidFillCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateSolidFillCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateSolidFill -// createSolidFillRequest writes a CreateSolidFill request to a byte slice. -func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 33 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Color.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// CreateLinearGradientCookie is a cookie used only for CreateLinearGradient requests. -type CreateLinearGradientCookie struct { - *xgb.Cookie -} - -// CreateLinearGradient sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) - return CreateLinearGradientCookie{cookie} -} - -// CreateLinearGradientChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateLinearGradientCookie.Check() -func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createLinearGradientRequest(c, Picture, P1, P2, NumStops, Stops, Colors), cookie) - return CreateLinearGradientCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateLinearGradientCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateLinearGradient -// createLinearGradientRequest writes a CreateLinearGradient request to a byte slice. -func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 34 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := P1.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := P2.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - xgb.Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = xgb.Pad(b) - - b += ColorListBytes(buf[b:], Colors) - - return buf -} - -// CreateRadialGradientCookie is a cookie used only for CreateRadialGradient requests. -type CreateRadialGradientCookie struct { - *xgb.Cookie -} - -// CreateRadialGradient sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) - return CreateRadialGradientCookie{cookie} -} - -// CreateRadialGradientChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRadialGradientCookie.Check() -func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRadialGradientRequest(c, Picture, Inner, Outer, InnerRadius, OuterRadius, NumStops, Stops, Colors), cookie) - return CreateRadialGradientCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRadialGradientCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRadialGradient -// createRadialGradientRequest writes a CreateRadialGradient request to a byte slice. -func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 35 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Inner.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := Outer.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(InnerRadius)) - b += 4 - - xgb.Put32(buf[b:], uint32(OuterRadius)) - b += 4 - - xgb.Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - xgb.Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = xgb.Pad(b) - - b += ColorListBytes(buf[b:], Colors) - - return buf -} - -// CreateConicalGradientCookie is a cookie used only for CreateConicalGradient requests. -type CreateConicalGradientCookie struct { - *xgb.Cookie -} - -// CreateConicalGradient sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) - return CreateConicalGradientCookie{cookie} -} - -// CreateConicalGradientChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateConicalGradientCookie.Check() -func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { - if _, ok := c.Extensions["RENDER"]; !ok { - panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createConicalGradientRequest(c, Picture, Center, Angle, NumStops, Stops, Colors), cookie) - return CreateConicalGradientCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateConicalGradientCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateConicalGradient -// createConicalGradientRequest writes a CreateConicalGradient request to a byte slice. -func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["RENDER"] - b += 1 - - buf[b] = 36 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - { - structBytes := Center.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(Angle)) - b += 4 - - xgb.Put32(buf[b:], NumStops) - b += 4 - - for i := 0; i < int(NumStops); i++ { - xgb.Put32(buf[b:], uint32(Stops[i])) - b += 4 - } - b = xgb.Pad(b) - - b += ColorListBytes(buf[b:], Colors) + b += TriangleListBytes(buf[b:], Triangles) return buf } diff --git a/nexgb/res/res.go b/nexgb/res/res.go index cbbd8cc..671f691 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -2,7 +2,7 @@ package res /* - This file was generated by res.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by res.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["X-Resource"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - type Client struct { ResourceBase uint32 ResourceMask uint32 @@ -172,44 +148,68 @@ func TypeListBytes(buf []byte, list []Type) int { return b } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests. +type QueryClientPixmapBytesCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { +// QueryClientPixmapBytes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() +func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) + return QueryClientPixmapBytesCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// QueryClientPixmapBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { +func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) + return QueryClientPixmapBytesCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { +// QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request. +type QueryClientPixmapBytesReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 + Bytes uint32 + BytesOverflow uint32 } -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { +// Reply blocks and returns the reply data for a QueryClientPixmapBytes request. +func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -217,12 +217,12 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { if buf == nil { return nil, nil } - return queryVersionReply(buf), nil + return queryClientPixmapBytesReply(buf), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) +// queryClientPixmapBytesReply reads a byte slice into a QueryClientPixmapBytesReply value. +func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { + v := new(QueryClientPixmapBytesReply) b := 1 // skip reply determinant b += 1 // padding @@ -233,18 +233,18 @@ func queryVersionReply(buf []byte) *QueryVersionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.ServerMajor = xgb.Get16(buf[b:]) - b += 2 + v.Bytes = xgb.Get32(buf[b:]) + b += 4 - v.ServerMinor = xgb.Get16(buf[b:]) - b += 2 + v.BytesOverflow = xgb.Get32(buf[b:]) + b += 4 return v } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { +// Write request to wire for QueryClientPixmapBytes +// queryClientPixmapBytesRequest writes a QueryClientPixmapBytes request to a byte slice. +func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -252,110 +252,15 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte buf[b] = c.Extensions["X-RESOURCE"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 3 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - buf[b] = ClientMajor - b += 1 - - buf[b] = ClientMinor - b += 1 - - return buf -} - -// QueryClientsCookie is a cookie used only for QueryClients requests. -type QueryClientsCookie struct { - *xgb.Cookie -} - -// QueryClients sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() -func QueryClients(c *xgb.Conn) QueryClientsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryClientsRequest(c), cookie) - return QueryClientsCookie{cookie} -} - -// QueryClientsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryClientsRequest(c), cookie) - return QueryClientsCookie{cookie} -} - -// QueryClientsReply represents the data returned from a QueryClients request. -type QueryClientsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClients uint32 - // padding: 20 bytes - Clients []Client // size: xgb.Pad((int(NumClients) * 8)) -} - -// Reply blocks and returns the reply data for a QueryClients request. -func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryClientsReply(buf), nil -} - -// queryClientsReply reads a byte slice into a QueryClientsReply value. -func queryClientsReply(buf []byte) *QueryClientsReply { - v := new(QueryClientsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], Xid) b += 4 - v.NumClients = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Clients = make([]Client, v.NumClients) - b += ClientReadList(buf[b:], v.Clients) - - return v -} - -// Write request to wire for QueryClients -// queryClientsRequest writes a QueryClients request to a byte slice. -func queryClientsRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["X-RESOURCE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - return buf } @@ -454,44 +359,45 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { return buf } -// QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests. -type QueryClientPixmapBytesCookie struct { +// QueryClientsCookie is a cookie used only for QueryClients requests. +type QueryClientsCookie struct { *xgb.Cookie } -// QueryClientPixmapBytes sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() -func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { +// QueryClients sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() +func QueryClients(c *xgb.Conn) QueryClientsCookie { if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) - return QueryClientPixmapBytesCookie{cookie} + c.NewRequest(queryClientsRequest(c), cookie) + return QueryClientsCookie{cookie} } -// QueryClientPixmapBytesUnchecked sends an unchecked request. +// QueryClientsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { +func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { if _, ok := c.Extensions["X-RESOURCE"]; !ok { - panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie) - return QueryClientPixmapBytesCookie{cookie} + c.NewRequest(queryClientsRequest(c), cookie) + return QueryClientsCookie{cookie} } -// QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request. -type QueryClientPixmapBytesReply struct { +// QueryClientsReply represents the data returned from a QueryClients request. +type QueryClientsReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Bytes uint32 - BytesOverflow uint32 + NumClients uint32 + // padding: 20 bytes + Clients []Client // size: xgb.Pad((int(NumClients) * 8)) } -// Reply blocks and returns the reply data for a QueryClientPixmapBytes request. -func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) { +// Reply blocks and returns the reply data for a QueryClients request. +func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -499,12 +405,12 @@ func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, if buf == nil { return nil, nil } - return queryClientPixmapBytesReply(buf), nil + return queryClientsReply(buf), nil } -// queryClientPixmapBytesReply reads a byte slice into a QueryClientPixmapBytesReply value. -func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { - v := new(QueryClientPixmapBytesReply) +// queryClientsReply reads a byte slice into a QueryClientsReply value. +func queryClientsReply(buf []byte) *QueryClientsReply { + v := new(QueryClientsReply) b := 1 // skip reply determinant b += 1 // padding @@ -515,18 +421,109 @@ func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Bytes = xgb.Get32(buf[b:]) + v.NumClients = xgb.Get32(buf[b:]) b += 4 - v.BytesOverflow = xgb.Get32(buf[b:]) - b += 4 + b += 20 // padding + + v.Clients = make([]Client, v.NumClients) + b += ClientReadList(buf[b:], v.Clients) return v } -// Write request to wire for QueryClientPixmapBytes -// queryClientPixmapBytesRequest writes a QueryClientPixmapBytes request to a byte slice. -func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { +// Write request to wire for QueryClients +// queryClientsRequest writes a QueryClients request to a byte slice. +func queryClientsRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -534,14 +531,17 @@ func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { buf[b] = c.Extensions["X-RESOURCE"] b += 1 - buf[b] = 3 // request opcode + buf[b] = 0 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], Xid) - b += 4 + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 return buf } diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index f336d0d..f693b52 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -2,7 +2,7 @@ package screensaver /* - This file was generated by screensaver.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by screensaver.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,46 +40,15 @@ func init() { xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -const ( - KindBlanked = 0 - KindInternal = 1 - KindExternal = 2 -) - const ( EventNotifyMask = 1 EventCycleMask = 2 ) const ( - StateOff = 0 - StateOn = 1 - StateCycle = 2 - StateDisabled = 3 + KindBlanked = 0 + KindInternal = 1 + KindExternal = 2 ) // Notify is the event number for a NotifyEvent. @@ -214,105 +183,36 @@ func init() { xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} +const ( + StateOff = 0 + StateOn = 1 + StateCycle = 2 + StateDisabled = 3 +) -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { - if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Bool' -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { - if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ServerMajorVersion uint16 - ServerMinorVersion uint16 - // padding: 20 bytes -} +// Skipping definition for base type 'Card8' -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} +// Skipping definition for base type 'Char' -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Void' - b += 1 // padding +// Skipping definition for base type 'Double' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Float' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int16' - v.ServerMajorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int32' - v.ServerMinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int8' - b += 20 // padding +// Skipping definition for base type 'Card16' - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = ClientMajorVersion - b += 1 - - buf[b] = ClientMinorVersion - b += 1 - - b += 2 // padding - - return buf -} +// Skipping definition for base type 'Card32' // QueryInfoCookie is a cookie used only for QueryInfo requests. type QueryInfoCookie struct { @@ -422,6 +322,106 @@ func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { return buf } +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ServerMajorVersion uint16 + ServerMinorVersion uint16 + // padding: 20 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = ClientMajorVersion + b += 1 + + buf[b] = ClientMinorVersion + b += 1 + + b += 2 // padding + + return buf +} + // SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie @@ -567,61 +567,6 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1 return buf } -// UnsetAttributesCookie is a cookie used only for UnsetAttributes requests. -type UnsetAttributesCookie struct { - *xgb.Cookie -} - -// UnsetAttributes sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { - if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { - panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) - return UnsetAttributesCookie{cookie} -} - -// UnsetAttributesChecked sends a checked request. -// If an error occurs, it can be retrieved using UnsetAttributesCookie.Check() -func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { - if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { - panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) - return UnsetAttributesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UnsetAttributesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UnsetAttributes -// unsetAttributesRequest writes a UnsetAttributes request to a byte slice. -func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["MIT-SCREEN-SAVER"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - // SuspendCookie is a cookie used only for Suspend requests. type SuspendCookie struct { *xgb.Cookie @@ -682,3 +627,58 @@ func suspendRequest(c *xgb.Conn, Suspend bool) []byte { return buf } + +// UnsetAttributesCookie is a cookie used only for UnsetAttributes requests. +type UnsetAttributesCookie struct { + *xgb.Cookie +} + +// UnsetAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) + return UnsetAttributesCookie{cookie} +} + +// UnsetAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using UnsetAttributesCookie.Check() +func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { + panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(unsetAttributesRequest(c, Drawable), cookie) + return UnsetAttributesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UnsetAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnsetAttributes +// unsetAttributesRequest writes a UnsetAttributes request to a byte slice. +func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index b98a001..d0d5b8c 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -2,7 +2,7 @@ package shape /* - This file was generated by shape.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by shape.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,46 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SHAPE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -const ( - SoSet = 0 - SoUnion = 1 - SoIntersect = 2 - SoSubtract = 3 - SoInvert = 4 -) - -const ( - SkBounding = 0 - SkClip = 1 - SkInput = 2 -) - -type Op byte - type Kind byte // Notify is the event number for a NotifyEvent. @@ -209,240 +169,45 @@ func init() { xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} +type Op byte -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +const ( + SkBounding = 0 + SkClip = 1 + SkInput = 2 +) -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +const ( + SoSet = 0 + SoUnion = 1 + SoIntersect = 2 + SoSubtract = 3 + SoInvert = 4 +) -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} +// Skipping definition for base type 'Bool' -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} +// Skipping definition for base type 'Byte' -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Card8' - b += 1 // padding +// Skipping definition for base type 'Char' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Void' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Double' - v.MajorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Float' - v.MinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - return v -} +// Skipping definition for base type 'Int32' -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) +// Skipping definition for base type 'Int8' - buf[b] = c.Extensions["SHAPE"] - b += 1 +// Skipping definition for base type 'Card16' - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// RectanglesCookie is a cookie used only for Rectangles requests. -type RectanglesCookie struct { - *xgb.Cookie -} - -// Rectangles sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) - return RectanglesCookie{cookie} -} - -// RectanglesChecked sends a checked request. -// If an error occurs, it can be retrieved using RectanglesCookie.Check() -func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) - return RectanglesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RectanglesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Rectangles -// rectanglesRequest writes a Rectangles request to a byte slice. -func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SHAPE"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(Operation) - b += 1 - - buf[b] = byte(DestinationKind) - b += 1 - - buf[b] = Ordering - b += 1 - - b += 1 // padding - - xgb.Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - xgb.Put16(buf[b:], uint16(XOffset)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOffset)) - b += 2 - - b += xproto.RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// MaskCookie is a cookie used only for Mask requests. -type MaskCookie struct { - *xgb.Cookie -} - -// Mask sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) - return MaskCookie{cookie} -} - -// MaskChecked sends a checked request. -// If an error occurs, it can be retrieved using MaskCookie.Check() -func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) - return MaskCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook MaskCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Mask -// maskRequest writes a Mask request to a byte slice. -func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SHAPE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(Operation) - b += 1 - - buf[b] = byte(DestinationKind) - b += 1 - - b += 2 // padding - - xgb.Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - xgb.Put16(buf[b:], uint16(XOffset)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOffset)) - b += 2 - - xgb.Put32(buf[b:], uint32(SourceBitmap)) - b += 4 - - return buf -} +// Skipping definition for base type 'Card32' // CombineCookie is a cookie used only for Combine requests. type CombineCookie struct { @@ -519,6 +284,268 @@ func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind return buf } +// GetRectanglesCookie is a cookie used only for GetRectangles requests. +type GetRectanglesCookie struct { + *xgb.Cookie +} + +// GetRectangles sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply() +func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) + return GetRectanglesCookie{cookie} +} + +// GetRectanglesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) + return GetRectanglesCookie{cookie} +} + +// GetRectanglesReply represents the data returned from a GetRectangles request. +type GetRectanglesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Ordering byte + RectanglesLen uint32 + // padding: 20 bytes + Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8)) +} + +// Reply blocks and returns the reply data for a GetRectangles request. +func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getRectanglesReply(buf), nil +} + +// getRectanglesReply reads a byte slice into a GetRectanglesReply value. +func getRectanglesReply(buf []byte) *GetRectanglesReply { + v := new(GetRectanglesReply) + b := 1 // skip reply determinant + + v.Ordering = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RectanglesLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Rectangles = make([]xproto.Rectangle, v.RectanglesLen) + b += xproto.RectangleReadList(buf[b:], v.Rectangles) + + return v +} + +// Write request to wire for GetRectangles +// getRectanglesRequest writes a GetRectangles request to a byte slice. +func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + buf[b] = byte(SourceKind) + b += 1 + + b += 3 // padding + + return buf +} + +// InputSelectedCookie is a cookie used only for InputSelected requests. +type InputSelectedCookie struct { + *xgb.Cookie +} + +// InputSelected sends a checked request. +// If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply() +func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) + return InputSelectedCookie{cookie} +} + +// InputSelectedUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) + return InputSelectedCookie{cookie} +} + +// InputSelectedReply represents the data returned from a InputSelected request. +type InputSelectedReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Enabled bool +} + +// Reply blocks and returns the reply data for a InputSelected request. +func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return inputSelectedReply(buf), nil +} + +// inputSelectedReply reads a byte slice into a InputSelectedReply value. +func inputSelectedReply(buf []byte) *InputSelectedReply { + v := new(InputSelectedReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.Enabled = true + } else { + v.Enabled = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for InputSelected +// inputSelectedRequest writes a InputSelected request to a byte slice. +func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + return buf +} + +// MaskCookie is a cookie used only for Mask requests. +type MaskCookie struct { + *xgb.Cookie +} + +// Mask sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return MaskCookie{cookie} +} + +// MaskChecked sends a checked request. +// If an error occurs, it can be retrieved using MaskCookie.Check() +func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie) + return MaskCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook MaskCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Mask +// maskRequest writes a Mask request to a byte slice. +func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + xgb.Put32(buf[b:], uint32(SourceBitmap)) + b += 4 + + return buf +} + // OffsetCookie is a cookie used only for Offset requests. type OffsetCookie struct { *xgb.Cookie @@ -720,6 +747,169 @@ func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { return buf } +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// RectanglesCookie is a cookie used only for Rectangles requests. +type RectanglesCookie struct { + *xgb.Cookie +} + +// Rectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return RectanglesCookie{cookie} +} + +// RectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using RectanglesCookie.Check() +func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + if _, ok := c.Extensions["SHAPE"]; !ok { + panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie) + return RectanglesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Rectangles +// rectanglesRequest writes a Rectangles request to a byte slice. +func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SHAPE"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(Operation) + b += 1 + + buf[b] = byte(DestinationKind) + b += 1 + + buf[b] = Ordering + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(DestinationWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + // SelectInputCookie is a cookie used only for SelectInput requests. type SelectInputCookie struct { *xgb.Cookie @@ -783,193 +973,3 @@ func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable boo return buf } - -// InputSelectedCookie is a cookie used only for InputSelected requests. -type InputSelectedCookie struct { - *xgb.Cookie -} - -// InputSelected sends a checked request. -// If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply() -func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) - return InputSelectedCookie{cookie} -} - -// InputSelectedUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie) - return InputSelectedCookie{cookie} -} - -// InputSelectedReply represents the data returned from a InputSelected request. -type InputSelectedReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Enabled bool -} - -// Reply blocks and returns the reply data for a InputSelected request. -func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return inputSelectedReply(buf), nil -} - -// inputSelectedReply reads a byte slice into a InputSelectedReply value. -func inputSelectedReply(buf []byte) *InputSelectedReply { - v := new(InputSelectedReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.Enabled = true - } else { - v.Enabled = false - } - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -// Write request to wire for InputSelected -// inputSelectedRequest writes a InputSelected request to a byte slice. -func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SHAPE"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(DestinationWindow)) - b += 4 - - return buf -} - -// GetRectanglesCookie is a cookie used only for GetRectangles requests. -type GetRectanglesCookie struct { - *xgb.Cookie -} - -// GetRectangles sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply() -func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) - return GetRectanglesCookie{cookie} -} - -// GetRectanglesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { - if _, ok := c.Extensions["SHAPE"]; !ok { - panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie) - return GetRectanglesCookie{cookie} -} - -// GetRectanglesReply represents the data returned from a GetRectangles request. -type GetRectanglesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Ordering byte - RectanglesLen uint32 - // padding: 20 bytes - Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8)) -} - -// Reply blocks and returns the reply data for a GetRectangles request. -func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getRectanglesReply(buf), nil -} - -// getRectanglesReply reads a byte slice into a GetRectanglesReply value. -func getRectanglesReply(buf []byte) *GetRectanglesReply { - v := new(GetRectanglesReply) - b := 1 // skip reply determinant - - v.Ordering = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.RectanglesLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Rectangles = make([]xproto.Rectangle, v.RectanglesLen) - b += xproto.RectangleReadList(buf[b:], v.Rectangles) - - return v -} - -// Write request to wire for GetRectangles -// getRectanglesRequest writes a GetRectangles request to a byte slice. -func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SHAPE"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = byte(SourceKind) - b += 1 - - b += 3 // padding - - return buf -} diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index 97ce9ff..bd5d638 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -2,7 +2,7 @@ package shm /* - This file was generated by shm.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by shm.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,38 +40,42 @@ func init() { xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Char' +// BadBadSeg is the error number for a BadBadSeg. +const BadBadSeg = 0 -// Skipping definition for base type 'Card32' +type BadSegError xproto.ValueError -// Skipping definition for base type 'Double' +// BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice. +func BadSegErrorNew(buf []byte) xgb.Error { + v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError)) + v.NiceName = "BadSeg" + return v +} -// Skipping definition for base type 'Bool' +// SequenceId returns the sequence id attached to the BadBadSeg error. +// This is mostly used internally. +func (err BadSegError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Float' +// BadId returns the 'BadValue' number if one exists for the BadBadSeg error. If no bad value exists, 0 is returned. +func (err BadSegError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Card8' +// Error returns a rudimentary string representation of the BadBadSeg error. +func (err BadSegError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadBadSeg {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -type Seg uint32 - -func NewSegId(c *xgb.Conn) (Seg, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Seg(id), nil +func init() { + xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew } // Completion is the event number for a CompletionEvent. @@ -174,152 +178,39 @@ func init() { xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew } -// BadBadSeg is the error number for a BadBadSeg. -const BadBadSeg = 0 +type Seg uint32 -type BadSegError xproto.ValueError - -// BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice. -func BadSegErrorNew(buf []byte) xgb.Error { - v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError)) - v.NiceName = "BadSeg" - return v -} - -// SequenceId returns the sequence id attached to the BadBadSeg error. -// This is mostly used internally. -func (err BadSegError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadSeg error. If no bad value exists, 0 is returned. -func (err BadSegError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadSeg error. -func (err BadSegError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadBadSeg {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew -} - -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} - -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - SharedPixmaps bool - MajorVersion uint16 - MinorVersion uint16 - Uid uint16 - Gid uint16 - PixmapFormat byte - // padding: 15 bytes -} - -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() +func NewSegId(c *xgb.Conn) (Seg, error) { + id, err := c.NewId() if err != nil { - return nil, err + return 0, err } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil + return Seg(id), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Bool' - if buf[b] == 1 { - v.SharedPixmaps = true - } else { - v.SharedPixmaps = false - } - b += 1 +// Skipping definition for base type 'Byte' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Card8' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Char' - v.MajorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Void' - v.MinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Double' - v.Uid = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Float' - v.Gid = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.PixmapFormat = buf[b] - b += 1 +// Skipping definition for base type 'Int32' - b += 15 // padding +// Skipping definition for base type 'Int8' - return v -} +// Skipping definition for base type 'Card16' -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["MIT-SHM"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} +// Skipping definition for base type 'Card32' // AttachCookie is a cookie used only for Attach requests. type AttachCookie struct { @@ -388,6 +279,81 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte return buf } +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. +type CreatePixmapCookie struct { + *xgb.Cookie +} + +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return CreatePixmapCookie{cookie} +} + +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() +func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) + return CreatePixmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreatePixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. +func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + buf[b] = Depth + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Offset) + b += 4 + + return buf +} + // DetachCookie is a cookie used only for Detach requests. type DetachCookie struct { *xgb.Cookie @@ -443,105 +409,6 @@ func detachRequest(c *xgb.Conn, Shmseg Seg) []byte { return buf } -// PutImageCookie is a cookie used only for PutImage requests. -type PutImageCookie struct { - *xgb.Cookie -} - -// PutImage sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { - if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) - return PutImageCookie{cookie} -} - -// PutImageChecked sends a checked request. -// If an error occurs, it can be retrieved using PutImageCookie.Check() -func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { - if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) - return PutImageCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PutImageCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PutImage -// putImageRequest writes a PutImage request to a byte slice. -func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) []byte { - size := 40 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["MIT-SHM"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], TotalWidth) - b += 2 - - xgb.Put16(buf[b:], TotalHeight) - b += 2 - - xgb.Put16(buf[b:], SrcX) - b += 2 - - xgb.Put16(buf[b:], SrcY) - b += 2 - - xgb.Put16(buf[b:], SrcWidth) - b += 2 - - xgb.Put16(buf[b:], SrcHeight) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - buf[b] = Depth - b += 1 - - buf[b] = Format - b += 1 - - buf[b] = SendEvent - b += 1 - - b += 1 // padding - - xgb.Put32(buf[b:], uint32(Shmseg)) - b += 4 - - xgb.Put32(buf[b:], Offset) - b += 4 - - return buf -} - // GetImageCookie is a cookie used only for GetImage requests. type GetImageCookie struct { *xgb.Cookie @@ -661,71 +528,95 @@ func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Wi return buf } -// CreatePixmapCookie is a cookie used only for CreatePixmap requests. -type CreatePixmapCookie struct { +// PutImageCookie is a cookie used only for PutImage requests. +type PutImageCookie struct { *xgb.Cookie } -// CreatePixmap sends an unchecked request. +// PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { +func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) - return CreatePixmapCookie{cookie} + c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return PutImageCookie{cookie} } -// CreatePixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() -func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() +func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { if _, ok := c.Extensions["MIT-SHM"]; !ok { - panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie) - return CreatePixmapCookie{cookie} + c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie) + return PutImageCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreatePixmapCookie) Check() error { +func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CreatePixmap -// createPixmapRequest writes a CreatePixmap request to a byte slice. -func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte { - size := 28 +// Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. +func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) []byte { + size := 40 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["MIT-SHM"] b += 1 - buf[b] = 5 // request opcode + buf[b] = 3 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Pid)) - b += 4 - xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - xgb.Put16(buf[b:], Width) + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], TotalWidth) b += 2 - xgb.Put16(buf[b:], Height) + xgb.Put16(buf[b:], TotalHeight) + b += 2 + + xgb.Put16(buf[b:], SrcX) + b += 2 + + xgb.Put16(buf[b:], SrcY) + b += 2 + + xgb.Put16(buf[b:], SrcWidth) + b += 2 + + xgb.Put16(buf[b:], SrcHeight) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) b += 2 buf[b] = Depth b += 1 - b += 3 // padding + buf[b] = Format + b += 1 + + buf[b] = SendEvent + b += 1 + + b += 1 // padding xgb.Put32(buf[b:], uint32(Shmseg)) b += 4 @@ -735,3 +626,112 @@ func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawabl return buf } + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + SharedPixmaps bool + MajorVersion uint16 + MinorVersion uint16 + Uid uint16 + Gid uint16 + PixmapFormat byte + // padding: 15 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SharedPixmaps = true + } else { + v.SharedPixmaps = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.Uid = xgb.Get16(buf[b:]) + b += 2 + + v.Gid = xgb.Get16(buf[b:]) + b += 2 + + v.PixmapFormat = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index a7046b7..ff83384 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -2,7 +2,7 @@ package sync /* - This file was generated by sync.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by sync.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,29 +40,183 @@ func init() { xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' +type Alarm uint32 -// Skipping definition for base type 'Card8' +func NewAlarmId(c *xgb.Conn) (Alarm, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Alarm(id), nil +} -// Skipping definition for base type 'Int16' +// BadAlarm is the error number for a BadAlarm. +const BadAlarm = 1 -// Skipping definition for base type 'Int32' +type AlarmError struct { + Sequence uint16 + NiceName string + BadAlarm uint32 + MinorOpcode uint16 + MajorOpcode byte +} -// Skipping definition for base type 'Void' +// AlarmErrorNew constructs a AlarmError value that implements xgb.Error from a byte slice. +func AlarmErrorNew(buf []byte) xgb.Error { + v := AlarmError{} + v.NiceName = "Alarm" -// Skipping definition for base type 'Byte' + b := 1 // skip error determinant + b += 1 // don't read error number -// Skipping definition for base type 'Int8' + v.Sequence = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Card16' + v.BadAlarm = xgb.Get32(buf[b:]) + b += 4 -// Skipping definition for base type 'Char' + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Card32' + v.MajorOpcode = buf[b] + b += 1 -// Skipping definition for base type 'Double' + return v +} -// Skipping definition for base type 'Bool' +// SequenceId returns the sequence id attached to the BadAlarm error. +// This is mostly used internally. +func (err AlarmError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadAlarm error. If no bad value exists, 0 is returned. +func (err AlarmError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadAlarm error. + +func (err AlarmError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadAlarm: %d", err.BadAlarm)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAlarm {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["SYNC"][1] = AlarmErrorNew +} + +// AlarmNotify is the event number for a AlarmNotifyEvent. +const AlarmNotify = 1 + +type AlarmNotifyEvent struct { + Sequence uint16 + Kind byte + Alarm Alarm + CounterValue Int64 + AlarmValue Int64 + Timestamp xproto.Timestamp + State byte + // padding: 3 bytes +} + +// AlarmNotifyEventNew constructs a AlarmNotifyEvent value that implements xgb.Event from a byte slice. +func AlarmNotifyEventNew(buf []byte) xgb.Event { + v := AlarmNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Alarm = Alarm(xgb.Get32(buf[b:])) + b += 4 + + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) + + v.AlarmValue = Int64{} + b += Int64Read(buf[b:], &v.AlarmValue) + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a AlarmNotifyEvent value to a byte slice. +func (v AlarmNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Alarm)) + b += 4 + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.AlarmValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the AlarmNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v AlarmNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of AlarmNotifyEvent. +func (v AlarmNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, xgb.Sprintf("Alarm: %d", v.Alarm)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "AlarmNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["SYNC"][1] = AlarmNotifyEventNew +} const ( AlarmstateActive = 0 @@ -70,18 +224,6 @@ const ( AlarmstateDestroyed = 2 ) -const ( - TesttypePositiveTransition = 0 - TesttypeNegativeTransition = 1 - TesttypePositiveComparison = 2 - TesttypeNegativeComparison = 3 -) - -const ( - ValuetypeAbsolute = 0 - ValuetypeRelative = 1 -) - const ( CaCounter = 1 CaValueType = 2 @@ -91,16 +233,6 @@ const ( CaEvents = 32 ) -type Alarm uint32 - -func NewAlarmId(c *xgb.Conn) (Alarm, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Alarm(id), nil -} - type Counter uint32 func NewCounterId(c *xgb.Conn) (Counter, error) { @@ -111,6 +243,190 @@ func NewCounterId(c *xgb.Conn) (Counter, error) { return Counter(id), nil } +// BadCounter is the error number for a BadCounter. +const BadCounter = 0 + +type CounterError struct { + Sequence uint16 + NiceName string + BadCounter uint32 + MinorOpcode uint16 + MajorOpcode byte +} + +// CounterErrorNew constructs a CounterError value that implements xgb.Error from a byte slice. +func CounterErrorNew(buf []byte) xgb.Error { + v := CounterError{} + v.NiceName = "Counter" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadCounter = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + return v +} + +// SequenceId returns the sequence id attached to the BadCounter error. +// This is mostly used internally. +func (err CounterError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadCounter error. If no bad value exists, 0 is returned. +func (err CounterError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadCounter error. + +func (err CounterError) Error() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadCounter: %d", err.BadCounter)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadCounter {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["SYNC"][0] = CounterErrorNew +} + +// CounterNotify is the event number for a CounterNotifyEvent. +const CounterNotify = 0 + +type CounterNotifyEvent struct { + Sequence uint16 + Kind byte + Counter Counter + WaitValue Int64 + CounterValue Int64 + Timestamp xproto.Timestamp + Count uint16 + Destroyed bool + // padding: 1 bytes +} + +// CounterNotifyEventNew constructs a CounterNotifyEvent value that implements xgb.Event from a byte slice. +func CounterNotifyEventNew(buf []byte) xgb.Event { + v := CounterNotifyEvent{} + b := 1 // don't read event number + + v.Kind = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Counter = Counter(xgb.Get32(buf[b:])) + b += 4 + + v.WaitValue = Int64{} + b += Int64Read(buf[b:], &v.WaitValue) + + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Count = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Destroyed = true + } else { + v.Destroyed = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a CounterNotifyEvent value to a byte slice. +func (v CounterNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Kind + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Counter)) + b += 4 + + { + structBytes := v.WaitValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + { + structBytes := v.CounterValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put16(buf[b:], v.Count) + b += 2 + + if v.Destroyed { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the CounterNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v CounterNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of CounterNotifyEvent. +func (v CounterNotifyEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) + fieldVals = append(fieldVals, xgb.Sprintf("Counter: %d", v.Counter)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("Destroyed: %t", v.Destroyed)) + return "CounterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["SYNC"][0] = CounterNotifyEventNew +} + type Fence uint32 func NewFenceId(c *xgb.Conn) (Fence, error) { @@ -259,6 +575,13 @@ func SystemcounterListSize(list []Systemcounter) int { return size } +const ( + TesttypePositiveTransition = 0 + TesttypeNegativeTransition = 1 + TesttypePositiveComparison = 2 + TesttypeNegativeComparison = 3 +) + type Trigger struct { Counter Counter WaitType uint32 @@ -330,6 +653,11 @@ func TriggerListBytes(buf []byte, list []Trigger) int { return b } +const ( + ValuetypeAbsolute = 0 + ValuetypeRelative = 1 +) + type Waitcondition struct { Trigger Trigger EventThreshold Int64 @@ -390,358 +718,708 @@ func WaitconditionListBytes(buf []byte, list []Waitcondition) int { return b } -// CounterNotify is the event number for a CounterNotifyEvent. -const CounterNotify = 0 +// Skipping definition for base type 'Bool' -type CounterNotifyEvent struct { - Sequence uint16 - Kind byte - Counter Counter - WaitValue Int64 - CounterValue Int64 - Timestamp xproto.Timestamp - Count uint16 - Destroyed bool - // padding: 1 bytes +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AwaitCookie is a cookie used only for Await requests. +type AwaitCookie struct { + *xgb.Cookie } -// CounterNotifyEventNew constructs a CounterNotifyEvent value that implements xgb.Event from a byte slice. -func CounterNotifyEventNew(buf []byte) xgb.Event { - v := CounterNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Counter = Counter(xgb.Get32(buf[b:])) - b += 4 - - v.WaitValue = Int64{} - b += Int64Read(buf[b:], &v.WaitValue) - - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Count = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Destroyed = true - } else { - v.Destroyed = false +// Await sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") } - b += 1 - - b += 1 // padding - - return v + cookie := c.NewCookie(false, false) + c.NewRequest(awaitRequest(c, WaitList), cookie) + return AwaitCookie{cookie} } -// Bytes writes a CounterNotifyEvent value to a byte slice. -func (v CounterNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) +// AwaitChecked sends a checked request. +// If an error occurs, it can be retrieved using AwaitCookie.Check() +func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(awaitRequest(c, WaitList), cookie) + return AwaitCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AwaitCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for Await +// awaitRequest writes a Await request to a byte slice. +func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { + size := xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) b := 0 + buf := make([]byte, size) - // write event number - buf[b] = 0 + buf[b] = c.Extensions["SYNC"] b += 1 - buf[b] = v.Kind + buf[b] = 7 // request opcode b += 1 - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Counter)) - b += 4 - - { - structBytes := v.WaitValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - xgb.Put16(buf[b:], v.Count) + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - if v.Destroyed { + b += WaitconditionListBytes(buf[b:], WaitList) + + return buf +} + +// AwaitFenceCookie is a cookie used only for AwaitFence requests. +type AwaitFenceCookie struct { + *xgb.Cookie +} + +// AwaitFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(awaitFenceRequest(c, FenceList), cookie) + return AwaitFenceCookie{cookie} +} + +// AwaitFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using AwaitFenceCookie.Check() +func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(awaitFenceRequest(c, FenceList), cookie) + return AwaitFenceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AwaitFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AwaitFence +// awaitFenceRequest writes a AwaitFence request to a byte slice. +func awaitFenceRequest(c *xgb.Conn, FenceList []Fence) []byte { + size := xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + for i := 0; i < int(len(FenceList)); i++ { + xgb.Put32(buf[b:], uint32(FenceList[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ChangeAlarmCookie is a cookie used only for ChangeAlarm requests. +type ChangeAlarmCookie struct { + *xgb.Cookie +} + +// ChangeAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return ChangeAlarmCookie{cookie} +} + +// ChangeAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeAlarmCookie.Check() +func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return ChangeAlarmCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeAlarm +// changeAlarmRequest writes a ChangeAlarm request to a byte slice. +func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ChangeCounterCookie is a cookie used only for ChangeCounter requests. +type ChangeCounterCookie struct { + *xgb.Cookie +} + +// ChangeCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) + return ChangeCounterCookie{cookie} +} + +// ChangeCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCounterCookie.Check() +func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) + return ChangeCounterCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeCounter +// changeCounterRequest writes a ChangeCounter request to a byte slice. +func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Amount.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// CreateAlarmCookie is a cookie used only for CreateAlarm requests. +type CreateAlarmCookie struct { + *xgb.Cookie +} + +// CreateAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return CreateAlarmCookie{cookie} +} + +// CreateAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateAlarmCookie.Check() +func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) + return CreateAlarmCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateAlarm +// createAlarmRequest writes a CreateAlarm request to a byte slice. +func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CreateCounterCookie is a cookie used only for CreateCounter requests. +type CreateCounterCookie struct { + *xgb.Cookie +} + +// CreateCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) + return CreateCounterCookie{cookie} +} + +// CreateCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCounterCookie.Check() +func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) + return CreateCounterCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateCounter +// createCounterRequest writes a CreateCounter request to a byte slice. +func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Id)) + b += 4 + + { + structBytes := InitialValue.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// CreateFenceCookie is a cookie used only for CreateFence requests. +type CreateFenceCookie struct { + *xgb.Cookie +} + +// CreateFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) + return CreateFenceCookie{cookie} +} + +// CreateFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateFenceCookie.Check() +func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) + return CreateFenceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateFence +// createFenceRequest writes a CreateFence request to a byte slice. +func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + if InitiallyTriggered { buf[b] = 1 } else { buf[b] = 0 } b += 1 + return buf +} + +// DestroyAlarmCookie is a cookie used only for DestroyAlarm requests. +type DestroyAlarmCookie struct { + *xgb.Cookie +} + +// DestroyAlarm sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) + return DestroyAlarmCookie{cookie} +} + +// DestroyAlarmChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyAlarmCookie.Check() +func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) + return DestroyAlarmCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyAlarmCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyAlarm +// destroyAlarmRequest writes a DestroyAlarm request to a byte slice. +func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Alarm)) + b += 4 + + return buf +} + +// DestroyCounterCookie is a cookie used only for DestroyCounter requests. +type DestroyCounterCookie struct { + *xgb.Cookie +} + +// DestroyCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyCounterRequest(c, Counter), cookie) + return DestroyCounterCookie{cookie} +} + +// DestroyCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyCounterCookie.Check() +func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyCounterRequest(c, Counter), cookie) + return DestroyCounterCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyCounter +// destroyCounterRequest writes a DestroyCounter request to a byte slice. +func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + return buf +} + +// DestroyFenceCookie is a cookie used only for DestroyFence requests. +type DestroyFenceCookie struct { + *xgb.Cookie +} + +// DestroyFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyFenceRequest(c, Fence), cookie) + return DestroyFenceCookie{cookie} +} + +// DestroyFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyFenceCookie.Check() +func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyFenceRequest(c, Fence), cookie) + return DestroyFenceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyFence +// destroyFenceRequest writes a DestroyFence request to a byte slice. +func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// GetPriorityCookie is a cookie used only for GetPriority requests. +type GetPriorityCookie struct { + *xgb.Cookie +} + +// GetPriority sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPriorityCookie.Reply() +func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getPriorityRequest(c, Id), cookie) + return GetPriorityCookie{cookie} +} + +// GetPriorityUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getPriorityRequest(c, Id), cookie) + return GetPriorityCookie{cookie} +} + +// GetPriorityReply represents the data returned from a GetPriority request. +type GetPriorityReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Priority int32 +} + +// Reply blocks and returns the reply data for a GetPriority request. +func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPriorityReply(buf), nil +} + +// getPriorityReply reads a byte slice into a GetPriorityReply value. +func getPriorityReply(buf []byte) *GetPriorityReply { + v := new(GetPriorityReply) + b := 1 // skip reply determinant + b += 1 // padding - return buf -} - -// SequenceId returns the sequence id attached to the CounterNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v CounterNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of CounterNotifyEvent. -func (v CounterNotifyEvent) String() string { - fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, xgb.Sprintf("Counter: %d", v.Counter)) - fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, xgb.Sprintf("Destroyed: %t", v.Destroyed)) - return "CounterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["SYNC"][0] = CounterNotifyEventNew -} - -// AlarmNotify is the event number for a AlarmNotifyEvent. -const AlarmNotify = 1 - -type AlarmNotifyEvent struct { - Sequence uint16 - Kind byte - Alarm Alarm - CounterValue Int64 - AlarmValue Int64 - Timestamp xproto.Timestamp - State byte - // padding: 3 bytes -} - -// AlarmNotifyEventNew constructs a AlarmNotifyEvent value that implements xgb.Event from a byte slice. -func AlarmNotifyEventNew(buf []byte) xgb.Event { - v := AlarmNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Alarm = Alarm(xgb.Get32(buf[b:])) + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - v.AlarmValue = Int64{} - b += Int64Read(buf[b:], &v.AlarmValue) - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + v.Priority = int32(xgb.Get32(buf[b:])) b += 4 - v.State = buf[b] - b += 1 - - b += 3 // padding - return v } -// Bytes writes a AlarmNotifyEvent value to a byte slice. -func (v AlarmNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) +// Write request to wire for GetPriority +// getPriorityRequest writes a GetPriority request to a byte slice. +func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { + size := 8 b := 0 + buf := make([]byte, size) - // write event number - buf[b] = 1 + buf[b] = c.Extensions["SYNC"] b += 1 - buf[b] = v.Kind + buf[b] = 13 // request opcode b += 1 - b += 2 // skip sequence number + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 - xgb.Put32(buf[b:], uint32(v.Alarm)) + xgb.Put32(buf[b:], Id) b += 4 - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.AlarmValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - buf[b] = v.State - b += 1 - - b += 3 // padding - return buf } -// SequenceId returns the sequence id attached to the AlarmNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v AlarmNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of AlarmNotifyEvent. -func (v AlarmNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, xgb.Sprintf("Alarm: %d", v.Alarm)) - fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - return "AlarmNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["SYNC"][1] = AlarmNotifyEventNew -} - -// BadCounter is the error number for a BadCounter. -const BadCounter = 0 - -type CounterError struct { - Sequence uint16 - NiceName string - BadCounter uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// CounterErrorNew constructs a CounterError value that implements xgb.Error from a byte slice. -func CounterErrorNew(buf []byte) xgb.Error { - v := CounterError{} - v.NiceName = "Counter" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadCounter = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -// SequenceId returns the sequence id attached to the BadCounter error. -// This is mostly used internally. -func (err CounterError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadCounter error. If no bad value exists, 0 is returned. -func (err CounterError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadCounter error. - -func (err CounterError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadCounter: %d", err.BadCounter)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadCounter {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["SYNC"][0] = CounterErrorNew -} - -// BadAlarm is the error number for a BadAlarm. -const BadAlarm = 1 - -type AlarmError struct { - Sequence uint16 - NiceName string - BadAlarm uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// AlarmErrorNew constructs a AlarmError value that implements xgb.Error from a byte slice. -func AlarmErrorNew(buf []byte) xgb.Error { - v := AlarmError{} - v.NiceName = "Alarm" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadAlarm = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -// SequenceId returns the sequence id attached to the BadAlarm error. -// This is mostly used internally. -func (err AlarmError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadAlarm error. If no bad value exists, 0 is returned. -func (err AlarmError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadAlarm error. - -func (err AlarmError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadAlarm: %d", err.BadAlarm)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAlarm {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["SYNC"][1] = AlarmErrorNew -} - // InitializeCookie is a cookie used only for Initialize requests. type InitializeCookie struct { *xgb.Cookie @@ -932,567 +1610,6 @@ func listSystemCountersRequest(c *xgb.Conn) []byte { return buf } -// CreateCounterCookie is a cookie used only for CreateCounter requests. -type CreateCounterCookie struct { - *xgb.Cookie -} - -// CreateCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) - return CreateCounterCookie{cookie} -} - -// CreateCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateCounterCookie.Check() -func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) - return CreateCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateCounter -// createCounterRequest writes a CreateCounter request to a byte slice. -func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - { - structBytes := InitialValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// DestroyCounterCookie is a cookie used only for DestroyCounter requests. -type DestroyCounterCookie struct { - *xgb.Cookie -} - -// DestroyCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyCounterRequest(c, Counter), cookie) - return DestroyCounterCookie{cookie} -} - -// DestroyCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyCounterCookie.Check() -func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyCounterRequest(c, Counter), cookie) - return DestroyCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyCounter -// destroyCounterRequest writes a DestroyCounter request to a byte slice. -func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// QueryCounterCookie is a cookie used only for QueryCounter requests. -type QueryCounterCookie struct { - *xgb.Cookie -} - -// QueryCounter sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryCounterCookie.Reply() -func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryCounterRequest(c, Counter), cookie) - return QueryCounterCookie{cookie} -} - -// QueryCounterUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryCounterRequest(c, Counter), cookie) - return QueryCounterCookie{cookie} -} - -// QueryCounterReply represents the data returned from a QueryCounter request. -type QueryCounterReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - CounterValue Int64 -} - -// Reply blocks and returns the reply data for a QueryCounter request. -func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryCounterReply(buf), nil -} - -// queryCounterReply reads a byte slice into a QueryCounterReply value. -func queryCounterReply(buf []byte) *QueryCounterReply { - v := new(QueryCounterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - return v -} - -// Write request to wire for QueryCounter -// queryCounterRequest writes a QueryCounter request to a byte slice. -func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// AwaitCookie is a cookie used only for Await requests. -type AwaitCookie struct { - *xgb.Cookie -} - -// Await sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(awaitRequest(c, WaitList), cookie) - return AwaitCookie{cookie} -} - -// AwaitChecked sends a checked request. -// If an error occurs, it can be retrieved using AwaitCookie.Check() -func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(awaitRequest(c, WaitList), cookie) - return AwaitCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AwaitCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Await -// awaitRequest writes a Await request to a byte slice. -func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { - size := xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - b += WaitconditionListBytes(buf[b:], WaitList) - - return buf -} - -// ChangeCounterCookie is a cookie used only for ChangeCounter requests. -type ChangeCounterCookie struct { - *xgb.Cookie -} - -// ChangeCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) - return ChangeCounterCookie{cookie} -} - -// ChangeCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeCounterCookie.Check() -func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) - return ChangeCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeCounter -// changeCounterRequest writes a ChangeCounter request to a byte slice. -func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Amount.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// SetCounterCookie is a cookie used only for SetCounter requests. -type SetCounterCookie struct { - *xgb.Cookie -} - -// SetCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setCounterRequest(c, Counter, Value), cookie) - return SetCounterCookie{cookie} -} - -// SetCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using SetCounterCookie.Check() -func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setCounterRequest(c, Counter, Value), cookie) - return SetCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetCounter -// setCounterRequest writes a SetCounter request to a byte slice. -func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Value.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// CreateAlarmCookie is a cookie used only for CreateAlarm requests. -type CreateAlarmCookie struct { - *xgb.Cookie -} - -// CreateAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return CreateAlarmCookie{cookie} -} - -// CreateAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateAlarmCookie.Check() -func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return CreateAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateAlarm -// createAlarmRequest writes a CreateAlarm request to a byte slice. -func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeAlarmCookie is a cookie used only for ChangeAlarm requests. -type ChangeAlarmCookie struct { - *xgb.Cookie -} - -// ChangeAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return ChangeAlarmCookie{cookie} -} - -// ChangeAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeAlarmCookie.Check() -func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return ChangeAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeAlarm -// changeAlarmRequest writes a ChangeAlarm request to a byte slice. -func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DestroyAlarmCookie is a cookie used only for DestroyAlarm requests. -type DestroyAlarmCookie struct { - *xgb.Cookie -} - -// DestroyAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) - return DestroyAlarmCookie{cookie} -} - -// DestroyAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyAlarmCookie.Check() -func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) - return DestroyAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyAlarm -// destroyAlarmRequest writes a DestroyAlarm request to a byte slice. -func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Alarm)) - b += 4 - - return buf -} - // QueryAlarmCookie is a cookie used only for QueryAlarm requests. type QueryAlarmCookie struct { *xgb.Cookie @@ -1600,101 +1717,43 @@ func queryAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { return buf } -// SetPriorityCookie is a cookie used only for SetPriority requests. -type SetPriorityCookie struct { +// QueryCounterCookie is a cookie used only for QueryCounter requests. +type QueryCounterCookie struct { *xgb.Cookie } -// SetPriority sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { +// QueryCounter sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryCounterCookie.Reply() +func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) - return SetPriorityCookie{cookie} -} - -// SetPriorityChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPriorityCookie.Check() -func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) - return SetPriorityCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPriorityCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPriority -// setPriorityRequest writes a SetPriority request to a byte slice. -func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Id) - b += 4 - - xgb.Put32(buf[b:], uint32(Priority)) - b += 4 - - return buf -} - -// GetPriorityCookie is a cookie used only for GetPriority requests. -type GetPriorityCookie struct { - *xgb.Cookie -} - -// GetPriority sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPriorityCookie.Reply() -func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getPriorityRequest(c, Id), cookie) - return GetPriorityCookie{cookie} + c.NewRequest(queryCounterRequest(c, Counter), cookie) + return QueryCounterCookie{cookie} } -// GetPriorityUnchecked sends an unchecked request. +// QueryCounterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { +func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getPriorityRequest(c, Id), cookie) - return GetPriorityCookie{cookie} + c.NewRequest(queryCounterRequest(c, Counter), cookie) + return QueryCounterCookie{cookie} } -// GetPriorityReply represents the data returned from a GetPriority request. -type GetPriorityReply struct { +// QueryCounterReply represents the data returned from a QueryCounter request. +type QueryCounterReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Priority int32 + CounterValue Int64 } -// Reply blocks and returns the reply data for a GetPriority request. -func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { +// Reply blocks and returns the reply data for a QueryCounter request. +func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1702,12 +1761,12 @@ func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { if buf == nil { return nil, nil } - return getPriorityReply(buf), nil + return queryCounterReply(buf), nil } -// getPriorityReply reads a byte slice into a GetPriorityReply value. -func getPriorityReply(buf []byte) *GetPriorityReply { - v := new(GetPriorityReply) +// queryCounterReply reads a byte slice into a QueryCounterReply value. +func queryCounterReply(buf []byte) *QueryCounterReply { + v := new(QueryCounterReply) b := 1 // skip reply determinant b += 1 // padding @@ -1718,15 +1777,15 @@ func getPriorityReply(buf []byte) *GetPriorityReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Priority = int32(xgb.Get32(buf[b:])) - b += 4 + v.CounterValue = Int64{} + b += Int64Read(buf[b:], &v.CounterValue) return v } -// Write request to wire for GetPriority -// getPriorityRequest writes a GetPriority request to a byte slice. -func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { +// Write request to wire for QueryCounter +// queryCounterRequest writes a QueryCounter request to a byte slice. +func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1734,243 +1793,13 @@ func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { buf[b] = c.Extensions["SYNC"] b += 1 - buf[b] = 13 // request opcode + buf[b] = 5 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], Id) - b += 4 - - return buf -} - -// CreateFenceCookie is a cookie used only for CreateFence requests. -type CreateFenceCookie struct { - *xgb.Cookie -} - -// CreateFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) - return CreateFenceCookie{cookie} -} - -// CreateFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateFenceCookie.Check() -func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) - return CreateFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateFence -// createFenceRequest writes a CreateFence request to a byte slice. -func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - if InitiallyTriggered { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// TriggerFenceCookie is a cookie used only for TriggerFence requests. -type TriggerFenceCookie struct { - *xgb.Cookie -} - -// TriggerFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(triggerFenceRequest(c, Fence), cookie) - return TriggerFenceCookie{cookie} -} - -// TriggerFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using TriggerFenceCookie.Check() -func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(triggerFenceRequest(c, Fence), cookie) - return TriggerFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook TriggerFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for TriggerFence -// triggerFenceRequest writes a TriggerFence request to a byte slice. -func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// ResetFenceCookie is a cookie used only for ResetFence requests. -type ResetFenceCookie struct { - *xgb.Cookie -} - -// ResetFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(resetFenceRequest(c, Fence), cookie) - return ResetFenceCookie{cookie} -} - -// ResetFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using ResetFenceCookie.Check() -func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(resetFenceRequest(c, Fence), cookie) - return ResetFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ResetFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ResetFence -// resetFenceRequest writes a ResetFence request to a byte slice. -func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// DestroyFenceCookie is a cookie used only for DestroyFence requests. -type DestroyFenceCookie struct { - *xgb.Cookie -} - -// DestroyFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyFenceRequest(c, Fence), cookie) - return DestroyFenceCookie{cookie} -} - -// DestroyFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyFenceCookie.Check() -func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyFenceRequest(c, Fence), cookie) - return DestroyFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyFence -// destroyFenceRequest writes a DestroyFence request to a byte slice. -func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) + xgb.Put32(buf[b:], uint32(Counter)) b += 4 return buf @@ -2071,60 +1900,231 @@ func queryFenceRequest(c *xgb.Conn, Fence Fence) []byte { return buf } -// AwaitFenceCookie is a cookie used only for AwaitFence requests. -type AwaitFenceCookie struct { +// ResetFenceCookie is a cookie used only for ResetFence requests. +type ResetFenceCookie struct { *xgb.Cookie } -// AwaitFence sends an unchecked request. +// ResetFence sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { +func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(awaitFenceRequest(c, FenceList), cookie) - return AwaitFenceCookie{cookie} + c.NewRequest(resetFenceRequest(c, Fence), cookie) + return ResetFenceCookie{cookie} } -// AwaitFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using AwaitFenceCookie.Check() -func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { +// ResetFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using ResetFenceCookie.Check() +func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(awaitFenceRequest(c, FenceList), cookie) - return AwaitFenceCookie{cookie} + c.NewRequest(resetFenceRequest(c, Fence), cookie) + return ResetFenceCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AwaitFenceCookie) Check() error { +func (cook ResetFenceCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for AwaitFence -// awaitFenceRequest writes a AwaitFence request to a byte slice. -func awaitFenceRequest(c *xgb.Conn, FenceList []Fence) []byte { - size := xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) +// Write request to wire for ResetFence +// resetFenceRequest writes a ResetFence request to a byte slice. +func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["SYNC"] b += 1 - buf[b] = 19 // request opcode + buf[b] = 16 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - for i := 0; i < int(len(FenceList)); i++ { - xgb.Put32(buf[b:], uint32(FenceList[i])) - b += 4 - } - b = xgb.Pad(b) + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 + + return buf +} + +// SetCounterCookie is a cookie used only for SetCounter requests. +type SetCounterCookie struct { + *xgb.Cookie +} + +// SetCounter sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setCounterRequest(c, Counter, Value), cookie) + return SetCounterCookie{cookie} +} + +// SetCounterChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCounterCookie.Check() +func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setCounterRequest(c, Counter, Value), cookie) + return SetCounterCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetCounterCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCounter +// setCounterRequest writes a SetCounter request to a byte slice. +func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Counter)) + b += 4 + + { + structBytes := Value.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + return buf +} + +// SetPriorityCookie is a cookie used only for SetPriority requests. +type SetPriorityCookie struct { + *xgb.Cookie +} + +// SetPriority sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) + return SetPriorityCookie{cookie} +} + +// SetPriorityChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPriorityCookie.Check() +func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) + return SetPriorityCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetPriorityCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPriority +// setPriorityRequest writes a SetPriority request to a byte slice. +func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put32(buf[b:], uint32(Priority)) + b += 4 + + return buf +} + +// TriggerFenceCookie is a cookie used only for TriggerFence requests. +type TriggerFenceCookie struct { + *xgb.Cookie +} + +// TriggerFence sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(triggerFenceRequest(c, Fence), cookie) + return TriggerFenceCookie{cookie} +} + +// TriggerFenceChecked sends a checked request. +// If an error occurs, it can be retrieved using TriggerFenceCookie.Check() +func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { + if _, ok := c.Extensions["SYNC"]; !ok { + panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(triggerFenceRequest(c, Fence), cookie) + return TriggerFenceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook TriggerFenceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TriggerFence +// triggerFenceRequest writes a TriggerFence request to a byte slice. +func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SYNC"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fence)) + b += 4 return buf } diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index dce0e9d..e32ae42 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by xc_misc.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,29 +40,29 @@ func init() { xgb.NewExtErrorFuncs["XC-MISC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int8' +// Skipping definition for base type 'Bool' -// Skipping definition for base type 'Card16' +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' // Skipping definition for base type 'Char' -// Skipping definition for base type 'Card32' +// Skipping definition for base type 'Void' // Skipping definition for base type 'Double' -// Skipping definition for base type 'Bool' - // Skipping definition for base type 'Float' -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' -// Skipping definition for base type 'Void' +// Skipping definition for base type 'Int8' -// Skipping definition for base type 'Byte' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' // GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { @@ -159,95 +159,6 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio return buf } -// GetXIDRangeCookie is a cookie used only for GetXIDRange requests. -type GetXIDRangeCookie struct { - *xgb.Cookie -} - -// GetXIDRange sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() -func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { - if _, ok := c.Extensions["XC-MISC"]; !ok { - panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getXIDRangeRequest(c), cookie) - return GetXIDRangeCookie{cookie} -} - -// GetXIDRangeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { - if _, ok := c.Extensions["XC-MISC"]; !ok { - panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getXIDRangeRequest(c), cookie) - return GetXIDRangeCookie{cookie} -} - -// GetXIDRangeReply represents the data returned from a GetXIDRange request. -type GetXIDRangeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - StartId uint32 - Count uint32 -} - -// Reply blocks and returns the reply data for a GetXIDRange request. -func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getXIDRangeReply(buf), nil -} - -// getXIDRangeReply reads a byte slice into a GetXIDRangeReply value. -func getXIDRangeReply(buf []byte) *GetXIDRangeReply { - v := new(GetXIDRangeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.StartId = xgb.Get32(buf[b:]) - b += 4 - - v.Count = xgb.Get32(buf[b:]) - b += 4 - - return v -} - -// Write request to wire for GetXIDRange -// getXIDRangeRequest writes a GetXIDRange request to a byte slice. -func getXIDRangeRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XC-MISC"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - // GetXIDListCookie is a cookie used only for GetXIDList requests. type GetXIDListCookie struct { *xgb.Cookie @@ -346,3 +257,92 @@ func getXIDListRequest(c *xgb.Conn, Count uint32) []byte { return buf } + +// GetXIDRangeCookie is a cookie used only for GetXIDRange requests. +type GetXIDRangeCookie struct { + *xgb.Cookie +} + +// GetXIDRange sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() +func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getXIDRangeRequest(c), cookie) + return GetXIDRangeCookie{cookie} +} + +// GetXIDRangeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getXIDRangeRequest(c), cookie) + return GetXIDRangeCookie{cookie} +} + +// GetXIDRangeReply represents the data returned from a GetXIDRange request. +type GetXIDRangeReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + StartId uint32 + Count uint32 +} + +// Reply blocks and returns the reply data for a GetXIDRange request. +func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getXIDRangeReply(buf), nil +} + +// getXIDRangeReply reads a byte slice into a GetXIDRangeReply value. +func getXIDRangeReply(buf []byte) *GetXIDRangeReply { + v := new(GetXIDRangeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StartId = xgb.Get32(buf[b:]) + b += 4 + + v.Count = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for GetXIDRange +// getXIDRangeRequest writes a GetXIDRange request to a byte slice. +func getXIDRangeRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XC-MISC"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 83dadef..0dd5aca 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -2,7 +2,7 @@ package xevie /* - This file was generated by xevie.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by xevie.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - const ( DatatypeUnmodified = 0 DatatypeModified = 1 @@ -114,6 +90,117 @@ func EventListBytes(buf []byte, list []Event) int { return b } +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// EndCookie is a cookie used only for End requests. +type EndCookie struct { + *xgb.Cookie +} + +// End sends a checked request. +// If an error occurs, it will be returned with the reply by calling EndCookie.Reply() +func End(c *xgb.Conn, Cmap uint32) EndCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(endRequest(c, Cmap), cookie) + return EndCookie{cookie} +} + +// EndUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { + if _, ok := c.Extensions["XEVIE"]; !ok { + panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(endRequest(c, Cmap), cookie) + return EndCookie{cookie} +} + +// EndReply represents the data returned from a End request. +type EndReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 24 bytes +} + +// Reply blocks and returns the reply data for a End request. +func (cook EndCookie) Reply() (*EndReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return endReply(buf), nil +} + +// endReply reads a byte slice into a EndReply value. +func endReply(buf []byte) *EndReply { + v := new(EndReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for End +// endRequest writes a End request to a byte slice. +func endRequest(c *xgb.Conn, Cmap uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XEVIE"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Cmap) + b += 4 + + return buf +} + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie @@ -212,43 +299,43 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers return buf } -// StartCookie is a cookie used only for Start requests. -type StartCookie struct { +// SelectInputCookie is a cookie used only for SelectInput requests. +type SelectInputCookie struct { *xgb.Cookie } -// Start sends a checked request. -// If an error occurs, it will be returned with the reply by calling StartCookie.Reply() -func Start(c *xgb.Conn, Screen uint32) StartCookie { +// SelectInput sends a checked request. +// If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply() +func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(startRequest(c, Screen), cookie) - return StartCookie{cookie} + c.NewRequest(selectInputRequest(c, EventMask), cookie) + return SelectInputCookie{cookie} } -// StartUnchecked sends an unchecked request. +// SelectInputUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { +func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(startRequest(c, Screen), cookie) - return StartCookie{cookie} + c.NewRequest(selectInputRequest(c, EventMask), cookie) + return SelectInputCookie{cookie} } -// StartReply represents the data returned from a Start request. -type StartReply struct { +// SelectInputReply represents the data returned from a SelectInput request. +type SelectInputReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Reply blocks and returns the reply data for a Start request. -func (cook StartCookie) Reply() (*StartReply, error) { +// Reply blocks and returns the reply data for a SelectInput request. +func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -256,12 +343,12 @@ func (cook StartCookie) Reply() (*StartReply, error) { if buf == nil { return nil, nil } - return startReply(buf), nil + return selectInputReply(buf), nil } -// startReply reads a byte slice into a StartReply value. -func startReply(buf []byte) *StartReply { - v := new(StartReply) +// selectInputReply reads a byte slice into a SelectInputReply value. +func selectInputReply(buf []byte) *SelectInputReply { + v := new(SelectInputReply) b := 1 // skip reply determinant b += 1 // padding @@ -277,9 +364,9 @@ func startReply(buf []byte) *StartReply { return v } -// Write request to wire for Start -// startRequest writes a Start request to a byte slice. -func startRequest(c *xgb.Conn, Screen uint32) []byte { +// Write request to wire for SelectInput +// selectInputRequest writes a SelectInput request to a byte slice. +func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -287,100 +374,13 @@ func startRequest(c *xgb.Conn, Screen uint32) []byte { buf[b] = c.Extensions["XEVIE"] b += 1 - buf[b] = 1 // request opcode + buf[b] = 4 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], Screen) - b += 4 - - return buf -} - -// EndCookie is a cookie used only for End requests. -type EndCookie struct { - *xgb.Cookie -} - -// End sends a checked request. -// If an error occurs, it will be returned with the reply by calling EndCookie.Reply() -func End(c *xgb.Conn, Cmap uint32) EndCookie { - if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(endRequest(c, Cmap), cookie) - return EndCookie{cookie} -} - -// EndUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { - if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(endRequest(c, Cmap), cookie) - return EndCookie{cookie} -} - -// EndReply represents the data returned from a End request. -type EndReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 24 bytes -} - -// Reply blocks and returns the reply data for a End request. -func (cook EndCookie) Reply() (*EndReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return endReply(buf), nil -} - -// endReply reads a byte slice into a EndReply value. -func endReply(buf []byte) *EndReply { - v := new(EndReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - return v -} - -// Write request to wire for End -// endRequest writes a End request to a byte slice. -func endRequest(c *xgb.Conn, Cmap uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XEVIE"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Cmap) + xgb.Put32(buf[b:], EventMask) b += 4 return buf @@ -481,43 +481,43 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { return buf } -// SelectInputCookie is a cookie used only for SelectInput requests. -type SelectInputCookie struct { +// StartCookie is a cookie used only for Start requests. +type StartCookie struct { *xgb.Cookie } -// SelectInput sends a checked request. -// If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply() -func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { +// Start sends a checked request. +// If an error occurs, it will be returned with the reply by calling StartCookie.Reply() +func Start(c *xgb.Conn, Screen uint32) StartCookie { if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(selectInputRequest(c, EventMask), cookie) - return SelectInputCookie{cookie} + c.NewRequest(startRequest(c, Screen), cookie) + return StartCookie{cookie} } -// SelectInputUnchecked sends an unchecked request. +// StartUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { +func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { if _, ok := c.Extensions["XEVIE"]; !ok { - panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") + panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(selectInputRequest(c, EventMask), cookie) - return SelectInputCookie{cookie} + c.NewRequest(startRequest(c, Screen), cookie) + return StartCookie{cookie} } -// SelectInputReply represents the data returned from a SelectInput request. -type SelectInputReply struct { +// StartReply represents the data returned from a Start request. +type StartReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes // padding: 24 bytes } -// Reply blocks and returns the reply data for a SelectInput request. -func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { +// Reply blocks and returns the reply data for a Start request. +func (cook StartCookie) Reply() (*StartReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -525,12 +525,12 @@ func (cook SelectInputCookie) Reply() (*SelectInputReply, error) { if buf == nil { return nil, nil } - return selectInputReply(buf), nil + return startReply(buf), nil } -// selectInputReply reads a byte slice into a SelectInputReply value. -func selectInputReply(buf []byte) *SelectInputReply { - v := new(SelectInputReply) +// startReply reads a byte slice into a StartReply value. +func startReply(buf []byte) *StartReply { + v := new(StartReply) b := 1 // skip reply determinant b += 1 // padding @@ -546,9 +546,9 @@ func selectInputReply(buf []byte) *SelectInputReply { return v } -// Write request to wire for SelectInput -// selectInputRequest writes a SelectInput request to a byte slice. -func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { +// Write request to wire for Start +// startRequest writes a Start request to a byte slice. +func startRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -556,13 +556,13 @@ func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { buf[b] = c.Extensions["XEVIE"] b += 1 - buf[b] = 4 // request opcode + buf[b] = 1 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], EventMask) + xgb.Put32(buf[b:], Screen) b += 4 return buf diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index d52654d..1a6fddf 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -2,7 +2,7 @@ package xf86dri /* - This file was generated by xf86dri.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by xf86dri.xml on Aug 11 2013 8:39:43pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - type DrmClipRect struct { X1 int16 Y1 int16 @@ -132,45 +108,67 @@ func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { return b } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AuthConnectionCookie is a cookie used only for AuthConnection requests. +type AuthConnectionCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn) QueryVersionCookie { +// AuthConnection sends a checked request. +// If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() +func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) + return AuthConnectionCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// AuthConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { +func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) + return AuthConnectionCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { +// AuthConnectionReply represents the data returned from a AuthConnection request. +type AuthConnectionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - DriMajorVersion uint16 - DriMinorVersion uint16 - DriMinorPatch uint32 + Authenticated uint32 } -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { +// Reply blocks and returns the reply data for a AuthConnection request. +func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -178,12 +176,12 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { if buf == nil { return nil, nil } - return queryVersionReply(buf), nil + return authConnectionReply(buf), nil } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) +// authConnectionReply reads a byte slice into a AuthConnectionReply value. +func authConnectionReply(buf []byte) *AuthConnectionReply { + v := new(AuthConnectionReply) b := 1 // skip reply determinant b += 1 // padding @@ -194,118 +192,23 @@ func queryVersionReply(buf []byte) *QueryVersionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.DriMajorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.DriMinorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.DriMinorPatch = xgb.Get32(buf[b:]) + v.Authenticated = xgb.Get32(buf[b:]) b += 4 return v } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn) []byte { - size := 4 +// Write request to wire for AuthConnection +// authConnectionRequest writes a AuthConnection request to a byte slice. +func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XFREE86-DRI"] b += 1 - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// QueryDirectRenderingCapableCookie is a cookie used only for QueryDirectRenderingCapable requests. -type QueryDirectRenderingCapableCookie struct { - *xgb.Cookie -} - -// QueryDirectRenderingCapable sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() -func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) - return QueryDirectRenderingCapableCookie{cookie} -} - -// QueryDirectRenderingCapableUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) - return QueryDirectRenderingCapableCookie{cookie} -} - -// QueryDirectRenderingCapableReply represents the data returned from a QueryDirectRenderingCapable request. -type QueryDirectRenderingCapableReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - IsCapable bool -} - -// Reply blocks and returns the reply data for a QueryDirectRenderingCapable request. -func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryDirectRenderingCapableReply(buf), nil -} - -// queryDirectRenderingCapableReply reads a byte slice into a QueryDirectRenderingCapableReply value. -func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply { - v := new(QueryDirectRenderingCapableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.IsCapable = true - } else { - v.IsCapable = false - } - b += 1 - - return v -} - -// Write request to wire for QueryDirectRenderingCapable -// queryDirectRenderingCapableRequest writes a QueryDirectRenderingCapable request to a byte slice. -func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 1 // request opcode + buf[b] = 11 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -314,111 +217,7 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { xgb.Put32(buf[b:], Screen) b += 4 - return buf -} - -// OpenConnectionCookie is a cookie used only for OpenConnection requests. -type OpenConnectionCookie struct { - *xgb.Cookie -} - -// OpenConnection sends a checked request. -// If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() -func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(openConnectionRequest(c, Screen), cookie) - return OpenConnectionCookie{cookie} -} - -// OpenConnectionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(openConnectionRequest(c, Screen), cookie) - return OpenConnectionCookie{cookie} -} - -// OpenConnectionReply represents the data returned from a OpenConnection request. -type OpenConnectionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - SareaHandleLow uint32 - SareaHandleHigh uint32 - BusIdLen uint32 - // padding: 12 bytes - BusId string // size: xgb.Pad((int(BusIdLen) * 1)) -} - -// Reply blocks and returns the reply data for a OpenConnection request. -func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return openConnectionReply(buf), nil -} - -// openConnectionReply reads a byte slice into a OpenConnectionReply value. -func openConnectionReply(buf []byte) *OpenConnectionReply { - v := new(OpenConnectionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.SareaHandleLow = xgb.Get32(buf[b:]) - b += 4 - - v.SareaHandleHigh = xgb.Get32(buf[b:]) - b += 4 - - v.BusIdLen = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - { - byteString := make([]byte, v.BusIdLen) - copy(byteString[:v.BusIdLen], buf[b:]) - v.BusId = string(byteString) - b += xgb.Pad(int(v.BusIdLen)) - } - - return v -} - -// Write request to wire for OpenConnection -// openConnectionRequest writes a OpenConnection request to a byte slice. -func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) + xgb.Put32(buf[b:], Magic) b += 4 return buf @@ -479,6 +278,307 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { return buf } +// CreateContextCookie is a cookie used only for CreateContext requests. +type CreateContextCookie struct { + *xgb.Cookie +} + +// CreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() +func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) + return CreateContextCookie{cookie} +} + +// CreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) + return CreateContextCookie{cookie} +} + +// CreateContextReply represents the data returned from a CreateContext request. +type CreateContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + HwContext uint32 +} + +// Reply blocks and returns the reply data for a CreateContext request. +func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createContextReply(buf), nil +} + +// createContextReply reads a byte slice into a CreateContextReply value. +func createContextReply(buf []byte) *CreateContextReply { + v := new(CreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwContext = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for CreateContext +// createContextRequest writes a CreateContext request to a byte slice. +func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Visual) + b += 4 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// CreateDrawableCookie is a cookie used only for CreateDrawable requests. +type CreateDrawableCookie struct { + *xgb.Cookie +} + +// CreateDrawable sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() +func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +// CreateDrawableUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) + return CreateDrawableCookie{cookie} +} + +// CreateDrawableReply represents the data returned from a CreateDrawable request. +type CreateDrawableReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + HwDrawableHandle uint32 +} + +// Reply blocks and returns the reply data for a CreateDrawable request. +func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createDrawableReply(buf), nil +} + +// createDrawableReply reads a byte slice into a CreateDrawableReply value. +func createDrawableReply(buf []byte) *CreateDrawableReply { + v := new(CreateDrawableReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.HwDrawableHandle = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for CreateDrawable +// createDrawableRequest writes a CreateDrawable request to a byte slice. +func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Drawable) + b += 4 + + return buf +} + +// DestroyContextCookie is a cookie used only for DestroyContext requests. +type DestroyContextCookie struct { + *xgb.Cookie +} + +// DestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) + return DestroyContextCookie{cookie} +} + +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() +func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) + return DestroyContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. +func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + +// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests. +type DestroyDrawableCookie struct { + *xgb.Cookie +} + +// DestroyDrawable sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +// DestroyDrawableChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() +func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) + return DestroyDrawableCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyDrawableCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyDrawable +// destroyDrawableRequest writes a DestroyDrawable request to a byte slice. +func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], Drawable) + b += 4 + + return buf +} + // GetClientDriverNameCookie is a cookie used only for GetClientDriverName requests. type GetClientDriverNameCookie struct { *xgb.Cookie @@ -590,43 +690,49 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// CreateContextCookie is a cookie used only for CreateContext requests. -type CreateContextCookie struct { +// GetDeviceInfoCookie is a cookie used only for GetDeviceInfo requests. +type GetDeviceInfoCookie struct { *xgb.Cookie } -// CreateContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() -func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { +// GetDeviceInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() +func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) - return CreateContextCookie{cookie} + c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) + return GetDeviceInfoCookie{cookie} } -// CreateContextUnchecked sends an unchecked request. +// GetDeviceInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { +func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie) - return CreateContextCookie{cookie} + c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) + return GetDeviceInfoCookie{cookie} } -// CreateContextReply represents the data returned from a CreateContext request. -type CreateContextReply struct { +// GetDeviceInfoReply represents the data returned from a GetDeviceInfo request. +type GetDeviceInfoReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - HwContext uint32 + FramebufferHandleLow uint32 + FramebufferHandleHigh uint32 + FramebufferOriginOffset uint32 + FramebufferSize uint32 + FramebufferStride uint32 + DevicePrivateSize uint32 + DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4)) } -// Reply blocks and returns the reply data for a CreateContext request. -func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { +// Reply blocks and returns the reply data for a GetDeviceInfo request. +func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -634,12 +740,12 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) { if buf == nil { return nil, nil } - return createContextReply(buf), nil + return getDeviceInfoReply(buf), nil } -// createContextReply reads a byte slice into a CreateContextReply value. -func createContextReply(buf []byte) *CreateContextReply { - v := new(CreateContextReply) +// getDeviceInfoReply reads a byte slice into a GetDeviceInfoReply value. +func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { + v := new(GetDeviceInfoReply) b := 1 // skip reply determinant b += 1 // padding @@ -650,23 +756,45 @@ func createContextReply(buf []byte) *CreateContextReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.HwContext = xgb.Get32(buf[b:]) + v.FramebufferHandleLow = xgb.Get32(buf[b:]) b += 4 + v.FramebufferHandleHigh = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferOriginOffset = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferSize = xgb.Get32(buf[b:]) + b += 4 + + v.FramebufferStride = xgb.Get32(buf[b:]) + b += 4 + + v.DevicePrivateSize = xgb.Get32(buf[b:]) + b += 4 + + v.DevicePrivate = make([]uint32, v.DevicePrivateSize) + for i := 0; i < int(v.DevicePrivateSize); i++ { + v.DevicePrivate[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + return v } -// Write request to wire for CreateContext -// createContextRequest writes a CreateContext request to a byte slice. -func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte { - size := 16 +// Write request to wire for GetDeviceInfo +// getDeviceInfoRequest writes a GetDeviceInfo request to a byte slice. +func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XFREE86-DRI"] b += 1 - buf[b] = 5 // request opcode + buf[b] = 10 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -675,219 +803,6 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin xgb.Put32(buf[b:], Screen) b += 4 - xgb.Put32(buf[b:], Visual) - b += 4 - - xgb.Put32(buf[b:], Context) - b += 4 - - return buf -} - -// DestroyContextCookie is a cookie used only for DestroyContext requests. -type DestroyContextCookie struct { - *xgb.Cookie -} - -// DestroyContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) - return DestroyContextCookie{cookie} -} - -// DestroyContextChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyContextCookie.Check() -func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyContextRequest(c, Screen, Context), cookie) - return DestroyContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyContext -// destroyContextRequest writes a DestroyContext request to a byte slice. -func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], Context) - b += 4 - - return buf -} - -// CreateDrawableCookie is a cookie used only for CreateDrawable requests. -type CreateDrawableCookie struct { - *xgb.Cookie -} - -// CreateDrawable sends a checked request. -// If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() -func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) - return CreateDrawableCookie{cookie} -} - -// CreateDrawableUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie) - return CreateDrawableCookie{cookie} -} - -// CreateDrawableReply represents the data returned from a CreateDrawable request. -type CreateDrawableReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - HwDrawableHandle uint32 -} - -// Reply blocks and returns the reply data for a CreateDrawable request. -func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return createDrawableReply(buf), nil -} - -// createDrawableReply reads a byte slice into a CreateDrawableReply value. -func createDrawableReply(buf []byte) *CreateDrawableReply { - v := new(CreateDrawableReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.HwDrawableHandle = xgb.Get32(buf[b:]) - b += 4 - - return v -} - -// Write request to wire for CreateDrawable -// createDrawableRequest writes a CreateDrawable request to a byte slice. -func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], Drawable) - b += 4 - - return buf -} - -// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests. -type DestroyDrawableCookie struct { - *xgb.Cookie -} - -// DestroyDrawable sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) - return DestroyDrawableCookie{cookie} -} - -// DestroyDrawableChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() -func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie) - return DestroyDrawableCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyDrawableCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyDrawable -// destroyDrawableRequest writes a DestroyDrawable request to a byte slice. -func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-DRI"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], Drawable) - b += 4 - return buf } @@ -1026,49 +941,47 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte return buf } -// GetDeviceInfoCookie is a cookie used only for GetDeviceInfo requests. -type GetDeviceInfoCookie struct { +// OpenConnectionCookie is a cookie used only for OpenConnection requests. +type OpenConnectionCookie struct { *xgb.Cookie } -// GetDeviceInfo sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() -func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { +// OpenConnection sends a checked request. +// If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() +func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) - return GetDeviceInfoCookie{cookie} + c.NewRequest(openConnectionRequest(c, Screen), cookie) + return OpenConnectionCookie{cookie} } -// GetDeviceInfoUnchecked sends an unchecked request. +// OpenConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { +func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceInfoRequest(c, Screen), cookie) - return GetDeviceInfoCookie{cookie} + c.NewRequest(openConnectionRequest(c, Screen), cookie) + return OpenConnectionCookie{cookie} } -// GetDeviceInfoReply represents the data returned from a GetDeviceInfo request. -type GetDeviceInfoReply struct { +// OpenConnectionReply represents the data returned from a OpenConnection request. +type OpenConnectionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - FramebufferHandleLow uint32 - FramebufferHandleHigh uint32 - FramebufferOriginOffset uint32 - FramebufferSize uint32 - FramebufferStride uint32 - DevicePrivateSize uint32 - DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4)) + SareaHandleLow uint32 + SareaHandleHigh uint32 + BusIdLen uint32 + // padding: 12 bytes + BusId string // size: xgb.Pad((int(BusIdLen) * 1)) } -// Reply blocks and returns the reply data for a GetDeviceInfo request. -func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { +// Reply blocks and returns the reply data for a OpenConnection request. +func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1076,12 +989,12 @@ func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) { if buf == nil { return nil, nil } - return getDeviceInfoReply(buf), nil + return openConnectionReply(buf), nil } -// getDeviceInfoReply reads a byte slice into a GetDeviceInfoReply value. -func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { - v := new(GetDeviceInfoReply) +// openConnectionReply reads a byte slice into a OpenConnectionReply value. +func openConnectionReply(buf []byte) *OpenConnectionReply { + v := new(OpenConnectionReply) b := 1 // skip reply determinant b += 1 // padding @@ -1092,37 +1005,30 @@ func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.FramebufferHandleLow = xgb.Get32(buf[b:]) + v.SareaHandleLow = xgb.Get32(buf[b:]) b += 4 - v.FramebufferHandleHigh = xgb.Get32(buf[b:]) + v.SareaHandleHigh = xgb.Get32(buf[b:]) b += 4 - v.FramebufferOriginOffset = xgb.Get32(buf[b:]) + v.BusIdLen = xgb.Get32(buf[b:]) b += 4 - v.FramebufferSize = xgb.Get32(buf[b:]) - b += 4 + b += 12 // padding - v.FramebufferStride = xgb.Get32(buf[b:]) - b += 4 - - v.DevicePrivateSize = xgb.Get32(buf[b:]) - b += 4 - - v.DevicePrivate = make([]uint32, v.DevicePrivateSize) - for i := 0; i < int(v.DevicePrivateSize); i++ { - v.DevicePrivate[i] = xgb.Get32(buf[b:]) - b += 4 + { + byteString := make([]byte, v.BusIdLen) + copy(byteString[:v.BusIdLen], buf[b:]) + v.BusId = string(byteString) + b += xgb.Pad(int(v.BusIdLen)) } - b = xgb.Pad(b) return v } -// Write request to wire for GetDeviceInfo -// getDeviceInfoRequest writes a GetDeviceInfo request to a byte slice. -func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { +// Write request to wire for OpenConnection +// openConnectionRequest writes a OpenConnection request to a byte slice. +func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1130,7 +1036,7 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { buf[b] = c.Extensions["XFREE86-DRI"] b += 1 - buf[b] = 10 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1142,43 +1048,43 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { return buf } -// AuthConnectionCookie is a cookie used only for AuthConnection requests. -type AuthConnectionCookie struct { +// QueryDirectRenderingCapableCookie is a cookie used only for QueryDirectRenderingCapable requests. +type QueryDirectRenderingCapableCookie struct { *xgb.Cookie } -// AuthConnection sends a checked request. -// If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() -func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { +// QueryDirectRenderingCapable sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() +func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) - return AuthConnectionCookie{cookie} + c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) + return QueryDirectRenderingCapableCookie{cookie} } -// AuthConnectionUnchecked sends an unchecked request. +// QueryDirectRenderingCapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { +func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { if _, ok := c.Extensions["XFREE86-DRI"]; !ok { - panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie) - return AuthConnectionCookie{cookie} + c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie) + return QueryDirectRenderingCapableCookie{cookie} } -// AuthConnectionReply represents the data returned from a AuthConnection request. -type AuthConnectionReply struct { +// QueryDirectRenderingCapableReply represents the data returned from a QueryDirectRenderingCapable request. +type QueryDirectRenderingCapableReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Authenticated uint32 + IsCapable bool } -// Reply blocks and returns the reply data for a AuthConnection request. -func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { +// Reply blocks and returns the reply data for a QueryDirectRenderingCapable request. +func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1186,12 +1092,12 @@ func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) { if buf == nil { return nil, nil } - return authConnectionReply(buf), nil + return queryDirectRenderingCapableReply(buf), nil } -// authConnectionReply reads a byte slice into a AuthConnectionReply value. -func authConnectionReply(buf []byte) *AuthConnectionReply { - v := new(AuthConnectionReply) +// queryDirectRenderingCapableReply reads a byte slice into a QueryDirectRenderingCapableReply value. +func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply { + v := new(QueryDirectRenderingCapableReply) b := 1 // skip reply determinant b += 1 // padding @@ -1202,23 +1108,27 @@ func authConnectionReply(buf []byte) *AuthConnectionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Authenticated = xgb.Get32(buf[b:]) - b += 4 + if buf[b] == 1 { + v.IsCapable = true + } else { + v.IsCapable = false + } + b += 1 return v } -// Write request to wire for AuthConnection -// authConnectionRequest writes a AuthConnection request to a byte slice. -func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { - size := 12 +// Write request to wire for QueryDirectRenderingCapable +// queryDirectRenderingCapableRequest writes a QueryDirectRenderingCapable request to a byte slice. +func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XFREE86-DRI"] b += 1 - buf[b] = 11 // request opcode + buf[b] = 1 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1227,8 +1137,98 @@ func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { xgb.Put32(buf[b:], Screen) b += 4 - xgb.Put32(buf[b:], Magic) + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + DriMajorVersion uint16 + DriMinorVersion uint16 + DriMinorPatch uint32 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + v.DriMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.DriMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.DriMinorPatch = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-DRI"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + return buf } diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 7665cbf..17c3f3c 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -2,7 +2,7 @@ package xf86vidmode /* - This file was generated by xf86vidmode.xml on Jun 5 2012 12:11:59am EDT. + This file was generated by xf86vidmode.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,193 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -const ( - ModeFlagPositiveHsync = 1 - ModeFlagNegativeHsync = 2 - ModeFlagPositiveVsync = 4 - ModeFlagNegativeVsync = 8 - ModeFlagInterlace = 16 - ModeFlagCompositeSync = 32 - ModeFlagPositiveCsync = 64 - ModeFlagNegativeCsync = 128 - ModeFlagHSkew = 256 - ModeFlagBroadcast = 512 - ModeFlagPixmux = 1024 - ModeFlagDoubleClock = 2048 - ModeFlagHalfClock = 4096 -) - -const ( - ClockFlagProgramable = 1 -) - -const ( - PermissionRead = 1 - PermissionWrite = 2 -) - -type Syncrange uint32 - -type Dotclock uint32 - -type ModeInfo struct { - Dotclock Dotclock - Hdisplay uint16 - Hsyncstart uint16 - Hsyncend uint16 - Htotal uint16 - Hskew uint32 - Vdisplay uint16 - Vsyncstart uint16 - Vsyncend uint16 - Vtotal uint16 - // padding: 4 bytes - Flags uint32 - // padding: 12 bytes - Privsize uint32 -} - -// ModeInfoRead reads a byte slice into a ModeInfo value. -func ModeInfoRead(buf []byte, v *ModeInfo) int { - b := 0 - - v.Dotclock = Dotclock(xgb.Get32(buf[b:])) - b += 4 - - v.Hdisplay = xgb.Get16(buf[b:]) - b += 2 - - v.Hsyncstart = xgb.Get16(buf[b:]) - b += 2 - - v.Hsyncend = xgb.Get16(buf[b:]) - b += 2 - - v.Htotal = xgb.Get16(buf[b:]) - b += 2 - - v.Hskew = xgb.Get32(buf[b:]) - b += 4 - - v.Vdisplay = xgb.Get16(buf[b:]) - b += 2 - - v.Vsyncstart = xgb.Get16(buf[b:]) - b += 2 - - v.Vsyncend = xgb.Get16(buf[b:]) - b += 2 - - v.Vtotal = xgb.Get16(buf[b:]) - b += 2 - - b += 4 // padding - - v.Flags = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Privsize = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// ModeInfoReadList reads a byte slice into a list of ModeInfo values. -func ModeInfoReadList(buf []byte, dest []ModeInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ModeInfo{} - b += ModeInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ModeInfo value to a byte slice. -func (v ModeInfo) Bytes() []byte { - buf := make([]byte, 48) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Dotclock)) - b += 4 - - xgb.Put16(buf[b:], v.Hdisplay) - b += 2 - - xgb.Put16(buf[b:], v.Hsyncstart) - b += 2 - - xgb.Put16(buf[b:], v.Hsyncend) - b += 2 - - xgb.Put16(buf[b:], v.Htotal) - b += 2 - - xgb.Put32(buf[b:], v.Hskew) - b += 4 - - xgb.Put16(buf[b:], v.Vdisplay) - b += 2 - - xgb.Put16(buf[b:], v.Vsyncstart) - b += 2 - - xgb.Put16(buf[b:], v.Vsyncend) - b += 2 - - xgb.Put16(buf[b:], v.Vtotal) - b += 2 - - b += 4 // padding - - xgb.Put32(buf[b:], v.Flags) - b += 4 - - b += 12 // padding - - xgb.Put32(buf[b:], v.Privsize) - b += 4 - - return buf -} - -// ModeInfoListBytes writes a list of ModeInfo values to a byte slice. -func ModeInfoListBytes(buf []byte, list []ModeInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - // BadBadClock is the error number for a BadBadClock. const BadBadClock = 0 @@ -365,18 +178,18 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][2] = BadVTimingsErrorNew } -// BadModeUnsuitable is the error number for a BadModeUnsuitable. -const BadModeUnsuitable = 3 +// BadClientNotLocal is the error number for a BadClientNotLocal. +const BadClientNotLocal = 5 -type ModeUnsuitableError struct { +type ClientNotLocalError struct { Sequence uint16 NiceName string } -// ModeUnsuitableErrorNew constructs a ModeUnsuitableError value that implements xgb.Error from a byte slice. -func ModeUnsuitableErrorNew(buf []byte) xgb.Error { - v := ModeUnsuitableError{} - v.NiceName = "ModeUnsuitable" +// ClientNotLocalErrorNew constructs a ClientNotLocalError value that implements xgb.Error from a byte slice. +func ClientNotLocalErrorNew(buf []byte) xgb.Error { + v := ClientNotLocalError{} + v.NiceName = "ClientNotLocal" b := 1 // skip error determinant b += 1 // don't read error number @@ -387,30 +200,36 @@ func ModeUnsuitableErrorNew(buf []byte) xgb.Error { return v } -// SequenceId returns the sequence id attached to the BadModeUnsuitable error. +// SequenceId returns the sequence id attached to the BadClientNotLocal error. // This is mostly used internally. -func (err ModeUnsuitableError) SequenceId() uint16 { +func (err ClientNotLocalError) SequenceId() uint16 { return err.Sequence } -// BadId returns the 'BadValue' number if one exists for the BadModeUnsuitable error. If no bad value exists, 0 is returned. -func (err ModeUnsuitableError) BadId() uint32 { +// BadId returns the 'BadValue' number if one exists for the BadClientNotLocal error. If no bad value exists, 0 is returned. +func (err ClientNotLocalError) BadId() uint32 { return 0 } -// Error returns a rudimentary string representation of the BadModeUnsuitable error. +// Error returns a rudimentary string representation of the BadClientNotLocal error. -func (err ModeUnsuitableError) Error() string { +func (err ClientNotLocalError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadModeUnsuitable {" + xgb.StringsJoin(fieldVals, ", ") + "}" + return "BadClientNotLocal {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][3] = ModeUnsuitableErrorNew + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][5] = ClientNotLocalErrorNew } +const ( + ClockFlagProgramable = 1 +) + +type Dotclock uint32 + // BadExtensionDisabled is the error number for a BadExtensionDisabled. const BadExtensionDisabled = 4 @@ -457,18 +276,168 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][4] = ExtensionDisabledErrorNew } -// BadClientNotLocal is the error number for a BadClientNotLocal. -const BadClientNotLocal = 5 +const ( + ModeFlagPositiveHsync = 1 + ModeFlagNegativeHsync = 2 + ModeFlagPositiveVsync = 4 + ModeFlagNegativeVsync = 8 + ModeFlagInterlace = 16 + ModeFlagCompositeSync = 32 + ModeFlagPositiveCsync = 64 + ModeFlagNegativeCsync = 128 + ModeFlagHSkew = 256 + ModeFlagBroadcast = 512 + ModeFlagPixmux = 1024 + ModeFlagDoubleClock = 2048 + ModeFlagHalfClock = 4096 +) -type ClientNotLocalError struct { +type ModeInfo struct { + Dotclock Dotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint32 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 4 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 +} + +// ModeInfoRead reads a byte slice into a ModeInfo value. +func ModeInfoRead(buf []byte, v *ModeInfo) int { + b := 0 + + v.Dotclock = Dotclock(xgb.Get32(buf[b:])) + b += 4 + + v.Hdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Htotal = xgb.Get16(buf[b:]) + b += 2 + + v.Hskew = xgb.Get32(buf[b:]) + b += 4 + + v.Vdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Vtotal = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// ModeInfoReadList reads a byte slice into a list of ModeInfo values. +func ModeInfoReadList(buf []byte, dest []ModeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ModeInfo{} + b += ModeInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ModeInfo value to a byte slice. +func (v ModeInfo) Bytes() []byte { + buf := make([]byte, 48) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Dotclock)) + b += 4 + + xgb.Put16(buf[b:], v.Hdisplay) + b += 2 + + xgb.Put16(buf[b:], v.Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], v.Hsyncend) + b += 2 + + xgb.Put16(buf[b:], v.Htotal) + b += 2 + + xgb.Put32(buf[b:], v.Hskew) + b += 4 + + xgb.Put16(buf[b:], v.Vdisplay) + b += 2 + + xgb.Put16(buf[b:], v.Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], v.Vsyncend) + b += 2 + + xgb.Put16(buf[b:], v.Vtotal) + b += 2 + + b += 4 // padding + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], v.Privsize) + b += 4 + + return buf +} + +// ModeInfoListBytes writes a list of ModeInfo values to a byte slice. +func ModeInfoListBytes(buf []byte, list []ModeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// BadModeUnsuitable is the error number for a BadModeUnsuitable. +const BadModeUnsuitable = 3 + +type ModeUnsuitableError struct { Sequence uint16 NiceName string } -// ClientNotLocalErrorNew constructs a ClientNotLocalError value that implements xgb.Error from a byte slice. -func ClientNotLocalErrorNew(buf []byte) xgb.Error { - v := ClientNotLocalError{} - v.NiceName = "ClientNotLocal" +// ModeUnsuitableErrorNew constructs a ModeUnsuitableError value that implements xgb.Error from a byte slice. +func ModeUnsuitableErrorNew(buf []byte) xgb.Error { + v := ModeUnsuitableError{} + v.NiceName = "ModeUnsuitable" b := 1 // skip error determinant b += 1 // don't read error number @@ -479,30 +448,37 @@ func ClientNotLocalErrorNew(buf []byte) xgb.Error { return v } -// SequenceId returns the sequence id attached to the BadClientNotLocal error. +// SequenceId returns the sequence id attached to the BadModeUnsuitable error. // This is mostly used internally. -func (err ClientNotLocalError) SequenceId() uint16 { +func (err ModeUnsuitableError) SequenceId() uint16 { return err.Sequence } -// BadId returns the 'BadValue' number if one exists for the BadClientNotLocal error. If no bad value exists, 0 is returned. -func (err ClientNotLocalError) BadId() uint32 { +// BadId returns the 'BadValue' number if one exists for the BadModeUnsuitable error. If no bad value exists, 0 is returned. +func (err ModeUnsuitableError) BadId() uint32 { return 0 } -// Error returns a rudimentary string representation of the BadClientNotLocal error. +// Error returns a rudimentary string representation of the BadModeUnsuitable error. -func (err ClientNotLocalError) Error() string { +func (err ModeUnsuitableError) Error() string { fieldVals := make([]string, 0, 0) fieldVals = append(fieldVals, "NiceName: "+err.NiceName) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadClientNotLocal {" + xgb.StringsJoin(fieldVals, ", ") + "}" + return "BadModeUnsuitable {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][5] = ClientNotLocalErrorNew + xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][3] = ModeUnsuitableErrorNew } +const ( + PermissionRead = 1 + PermissionWrite = 2 +) + +type Syncrange uint32 + // BadZoomLocked is the error number for a BadZoomLocked. const BadZoomLocked = 6 @@ -549,689 +525,29 @@ func init() { xgb.NewExtErrorFuncs["XFree86-VidModeExtension"][6] = ZoomLockedErrorNew } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} +// Skipping definition for base type 'Bool' -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Card8' -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} +// Skipping definition for base type 'Char' -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} +// Skipping definition for base type 'Void' -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Double' - b += 1 // padding +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int32' - v.MajorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int8' - v.MinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Card16' - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// GetModeLineCookie is a cookie used only for GetModeLine requests. -type GetModeLineCookie struct { - *xgb.Cookie -} - -// GetModeLine sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() -func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getModeLineRequest(c, Screen), cookie) - return GetModeLineCookie{cookie} -} - -// GetModeLineUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getModeLineRequest(c, Screen), cookie) - return GetModeLineCookie{cookie} -} - -// GetModeLineReply represents the data returned from a GetModeLine request. -type GetModeLineReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Dotclock Dotclock - Hdisplay uint16 - Hsyncstart uint16 - Hsyncend uint16 - Htotal uint16 - Hskew uint16 - Vdisplay uint16 - Vsyncstart uint16 - Vsyncend uint16 - Vtotal uint16 - // padding: 2 bytes - Flags uint32 - // padding: 12 bytes - Privsize uint32 - Private []byte // size: xgb.Pad((int(Privsize) * 1)) -} - -// Reply blocks and returns the reply data for a GetModeLine request. -func (cook GetModeLineCookie) Reply() (*GetModeLineReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getModeLineReply(buf), nil -} - -// getModeLineReply reads a byte slice into a GetModeLineReply value. -func getModeLineReply(buf []byte) *GetModeLineReply { - v := new(GetModeLineReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Dotclock = Dotclock(xgb.Get32(buf[b:])) - b += 4 - - v.Hdisplay = xgb.Get16(buf[b:]) - b += 2 - - v.Hsyncstart = xgb.Get16(buf[b:]) - b += 2 - - v.Hsyncend = xgb.Get16(buf[b:]) - b += 2 - - v.Htotal = xgb.Get16(buf[b:]) - b += 2 - - v.Hskew = xgb.Get16(buf[b:]) - b += 2 - - v.Vdisplay = xgb.Get16(buf[b:]) - b += 2 - - v.Vsyncstart = xgb.Get16(buf[b:]) - b += 2 - - v.Vsyncend = xgb.Get16(buf[b:]) - b += 2 - - v.Vtotal = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Flags = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Privsize = xgb.Get32(buf[b:]) - b += 4 - - v.Private = make([]byte, v.Privsize) - copy(v.Private[:v.Privsize], buf[b:]) - b += xgb.Pad(int(v.Privsize)) - - return v -} - -// Write request to wire for GetModeLine -// getModeLineRequest writes a GetModeLine request to a byte slice. -func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// ModModeLineCookie is a cookie used only for ModModeLine requests. -type ModModeLineCookie struct { - *xgb.Cookie -} - -// ModModeLine sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return ModModeLineCookie{cookie} -} - -// ModModeLineChecked sends a checked request. -// If an error occurs, it can be retrieved using ModModeLineCookie.Check() -func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return ModModeLineCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ModModeLineCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ModModeLine -// modModeLineRequest writes a ModModeLine request to a byte slice. -func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put16(buf[b:], Hdisplay) - b += 2 - - xgb.Put16(buf[b:], Hsyncstart) - b += 2 - - xgb.Put16(buf[b:], Hsyncend) - b += 2 - - xgb.Put16(buf[b:], Htotal) - b += 2 - - xgb.Put16(buf[b:], Hskew) - b += 2 - - xgb.Put16(buf[b:], Vdisplay) - b += 2 - - xgb.Put16(buf[b:], Vsyncstart) - b += 2 - - xgb.Put16(buf[b:], Vsyncend) - b += 2 - - xgb.Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - xgb.Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - xgb.Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) - - return buf -} - -// SwitchModeCookie is a cookie used only for SwitchMode requests. -type SwitchModeCookie struct { - *xgb.Cookie -} - -// SwitchMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) - return SwitchModeCookie{cookie} -} - -// SwitchModeChecked sends a checked request. -// If an error occurs, it can be retrieved using SwitchModeCookie.Check() -func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) - return SwitchModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SwitchModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SwitchMode -// switchModeRequest writes a SwitchMode request to a byte slice. -func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - xgb.Put16(buf[b:], Zoom) - b += 2 - - return buf -} - -// GetMonitorCookie is a cookie used only for GetMonitor requests. -type GetMonitorCookie struct { - *xgb.Cookie -} - -// GetMonitor sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() -func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getMonitorRequest(c, Screen), cookie) - return GetMonitorCookie{cookie} -} - -// GetMonitorUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getMonitorRequest(c, Screen), cookie) - return GetMonitorCookie{cookie} -} - -// GetMonitorReply represents the data returned from a GetMonitor request. -type GetMonitorReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - VendorLength byte - ModelLength byte - NumHsync byte - NumVsync byte - // padding: 20 bytes - Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) - Vsync []Syncrange // size: xgb.Pad((int(NumVsync) * 4)) - Vendor string // size: xgb.Pad((int(VendorLength) * 1)) - AlignmentPad []byte // size: xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) - Model string // size: xgb.Pad((int(ModelLength) * 1)) -} - -// Reply blocks and returns the reply data for a GetMonitor request. -func (cook GetMonitorCookie) Reply() (*GetMonitorReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getMonitorReply(buf), nil -} - -// getMonitorReply reads a byte slice into a GetMonitorReply value. -func getMonitorReply(buf []byte) *GetMonitorReply { - v := new(GetMonitorReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.VendorLength = buf[b] - b += 1 - - v.ModelLength = buf[b] - b += 1 - - v.NumHsync = buf[b] - b += 1 - - v.NumVsync = buf[b] - b += 1 - - b += 20 // padding - - v.Hsync = make([]Syncrange, v.NumHsync) - for i := 0; i < int(v.NumHsync); i++ { - v.Hsync[i] = Syncrange(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.Vsync = make([]Syncrange, v.NumVsync) - for i := 0; i < int(v.NumVsync); i++ { - v.Vsync[i] = Syncrange(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - { - byteString := make([]byte, v.VendorLength) - copy(byteString[:v.VendorLength], buf[b:]) - v.Vendor = string(byteString) - b += xgb.Pad(int(v.VendorLength)) - } - - v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) - copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) - b += xgb.Pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) - - { - byteString := make([]byte, v.ModelLength) - copy(byteString[:v.ModelLength], buf[b:]) - v.Model = string(byteString) - b += xgb.Pad(int(v.ModelLength)) - } - - return v -} - -// Write request to wire for GetMonitor -// getMonitorRequest writes a GetMonitor request to a byte slice. -func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} - -// LockModeSwitchCookie is a cookie used only for LockModeSwitch requests. -type LockModeSwitchCookie struct { - *xgb.Cookie -} - -// LockModeSwitch sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) - return LockModeSwitchCookie{cookie} -} - -// LockModeSwitchChecked sends a checked request. -// If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() -func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) - return LockModeSwitchCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook LockModeSwitchCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for LockModeSwitch -// lockModeSwitchRequest writes a LockModeSwitch request to a byte slice. -func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - xgb.Put16(buf[b:], Lock) - b += 2 - - return buf -} - -// GetAllModeLinesCookie is a cookie used only for GetAllModeLines requests. -type GetAllModeLinesCookie struct { - *xgb.Cookie -} - -// GetAllModeLines sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() -func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) - return GetAllModeLinesCookie{cookie} -} - -// GetAllModeLinesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) - return GetAllModeLinesCookie{cookie} -} - -// GetAllModeLinesReply represents the data returned from a GetAllModeLines request. -type GetAllModeLinesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Modecount uint32 - // padding: 20 bytes - Modeinfo []ModeInfo // size: xgb.Pad((int(Modecount) * 48)) -} - -// Reply blocks and returns the reply data for a GetAllModeLines request. -func (cook GetAllModeLinesCookie) Reply() (*GetAllModeLinesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getAllModeLinesReply(buf), nil -} - -// getAllModeLinesReply reads a byte slice into a GetAllModeLinesReply value. -func getAllModeLinesReply(buf []byte) *GetAllModeLinesReply { - v := new(GetAllModeLinesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Modecount = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Modeinfo = make([]ModeInfo, v.Modecount) - b += ModeInfoReadList(buf[b:], v.Modeinfo) - - return v -} - -// Write request to wire for GetAllModeLines -// getAllModeLinesRequest writes a GetAllModeLines request to a byte slice. -func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - return buf -} +// Skipping definition for base type 'Card32' // AddModeLineCookie is a cookie used only for AddModeLine requests. type AddModeLineCookie struct { @@ -1466,44 +782,45 @@ func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdispl return buf } -// ValidateModeLineCookie is a cookie used only for ValidateModeLine requests. -type ValidateModeLineCookie struct { +// GetAllModeLinesCookie is a cookie used only for GetAllModeLines requests. +type GetAllModeLinesCookie struct { *xgb.Cookie } -// ValidateModeLine sends a checked request. -// If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() -func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { +// GetAllModeLines sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() +func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return ValidateModeLineCookie{cookie} + c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) + return GetAllModeLinesCookie{cookie} } -// ValidateModeLineUnchecked sends an unchecked request. +// GetAllModeLinesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { +func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return ValidateModeLineCookie{cookie} + c.NewRequest(getAllModeLinesRequest(c, Screen), cookie) + return GetAllModeLinesCookie{cookie} } -// ValidateModeLineReply represents the data returned from a ValidateModeLine request. -type ValidateModeLineReply struct { +// GetAllModeLinesReply represents the data returned from a GetAllModeLines request. +type GetAllModeLinesReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Status uint32 + Modecount uint32 // padding: 20 bytes + Modeinfo []ModeInfo // size: xgb.Pad((int(Modecount) * 48)) } -// Reply blocks and returns the reply data for a ValidateModeLine request. -func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { +// Reply blocks and returns the reply data for a GetAllModeLines request. +func (cook GetAllModeLinesCookie) Reply() (*GetAllModeLinesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1511,12 +828,12 @@ func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { if buf == nil { return nil, nil } - return validateModeLineReply(buf), nil + return getAllModeLinesReply(buf), nil } -// validateModeLineReply reads a byte slice into a ValidateModeLineReply value. -func validateModeLineReply(buf []byte) *ValidateModeLineReply { - v := new(ValidateModeLineReply) +// getAllModeLinesReply reads a byte slice into a GetAllModeLinesReply value. +func getAllModeLinesReply(buf []byte) *GetAllModeLinesReply { + v := new(GetAllModeLinesReply) b := 1 // skip reply determinant b += 1 // padding @@ -1527,253 +844,20 @@ func validateModeLineReply(buf []byte) *ValidateModeLineReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Status = xgb.Get32(buf[b:]) + v.Modecount = xgb.Get32(buf[b:]) b += 4 b += 20 // padding - return v -} - -// Write request to wire for ValidateModeLine -// validateModeLineRequest writes a ValidateModeLine request to a byte slice. -func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], uint32(Dotclock)) - b += 4 - - xgb.Put16(buf[b:], Hdisplay) - b += 2 - - xgb.Put16(buf[b:], Hsyncstart) - b += 2 - - xgb.Put16(buf[b:], Hsyncend) - b += 2 - - xgb.Put16(buf[b:], Htotal) - b += 2 - - xgb.Put16(buf[b:], Hskew) - b += 2 - - xgb.Put16(buf[b:], Vdisplay) - b += 2 - - xgb.Put16(buf[b:], Vsyncstart) - b += 2 - - xgb.Put16(buf[b:], Vsyncend) - b += 2 - - xgb.Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - xgb.Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - xgb.Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) - - return buf -} - -// SwitchToModeCookie is a cookie used only for SwitchToMode requests. -type SwitchToModeCookie struct { - *xgb.Cookie -} - -// SwitchToMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return SwitchToModeCookie{cookie} -} - -// SwitchToModeChecked sends a checked request. -// If an error occurs, it can be retrieved using SwitchToModeCookie.Check() -func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) - return SwitchToModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SwitchToModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SwitchToMode -// switchToModeRequest writes a SwitchToMode request to a byte slice. -func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { - size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Screen) - b += 4 - - xgb.Put32(buf[b:], uint32(Dotclock)) - b += 4 - - xgb.Put16(buf[b:], Hdisplay) - b += 2 - - xgb.Put16(buf[b:], Hsyncstart) - b += 2 - - xgb.Put16(buf[b:], Hsyncend) - b += 2 - - xgb.Put16(buf[b:], Htotal) - b += 2 - - xgb.Put16(buf[b:], Hskew) - b += 2 - - xgb.Put16(buf[b:], Vdisplay) - b += 2 - - xgb.Put16(buf[b:], Vsyncstart) - b += 2 - - xgb.Put16(buf[b:], Vsyncend) - b += 2 - - xgb.Put16(buf[b:], Vtotal) - b += 2 - - b += 2 // padding - - xgb.Put32(buf[b:], Flags) - b += 4 - - b += 12 // padding - - xgb.Put32(buf[b:], Privsize) - b += 4 - - copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) - - return buf -} - -// GetViewPortCookie is a cookie used only for GetViewPort requests. -type GetViewPortCookie struct { - *xgb.Cookie -} - -// GetViewPort sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() -func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getViewPortRequest(c, Screen), cookie) - return GetViewPortCookie{cookie} -} - -// GetViewPortUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getViewPortRequest(c, Screen), cookie) - return GetViewPortCookie{cookie} -} - -// GetViewPortReply represents the data returned from a GetViewPort request. -type GetViewPortReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - X uint32 - Y uint32 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a GetViewPort request. -func (cook GetViewPortCookie) Reply() (*GetViewPortReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getViewPortReply(buf), nil -} - -// getViewPortReply reads a byte slice into a GetViewPortReply value. -func getViewPortReply(buf []byte) *GetViewPortReply { - v := new(GetViewPortReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.X = xgb.Get32(buf[b:]) - b += 4 - - v.Y = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding + v.Modeinfo = make([]ModeInfo, v.Modecount) + b += ModeInfoReadList(buf[b:], v.Modeinfo) return v } -// Write request to wire for GetViewPort -// getViewPortRequest writes a GetViewPort request to a byte slice. -func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { +// Write request to wire for GetAllModeLines +// getAllModeLinesRequest writes a GetAllModeLines request to a byte slice. +func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1781,7 +865,7 @@ func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] b += 1 - buf[b] = 11 // request opcode + buf[b] = 6 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1795,69 +879,6 @@ func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// SetViewPortCookie is a cookie used only for SetViewPort requests. -type SetViewPortCookie struct { - *xgb.Cookie -} - -// SetViewPort sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) - return SetViewPortCookie{cookie} -} - -// SetViewPortChecked sends a checked request. -// If an error occurs, it can be retrieved using SetViewPortCookie.Check() -func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) - return SetViewPortCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetViewPortCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetViewPort -// setViewPortRequest writes a SetViewPort request to a byte slice. -func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - xgb.Put32(buf[b:], X) - b += 4 - - xgb.Put32(buf[b:], Y) - b += 4 - - return buf -} - // GetDotClocksCookie is a cookie used only for GetDotClocks requests. type GetDotClocksCookie struct { *xgb.Cookie @@ -1967,132 +988,6 @@ func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { return buf } -// SetClientVersionCookie is a cookie used only for SetClientVersion requests. -type SetClientVersionCookie struct { - *xgb.Cookie -} - -// SetClientVersion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) - return SetClientVersionCookie{cookie} -} - -// SetClientVersionChecked sends a checked request. -// If an error occurs, it can be retrieved using SetClientVersionCookie.Check() -func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) - return SetClientVersionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetClientVersionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetClientVersion -// setClientVersionRequest writes a SetClientVersion request to a byte slice. -func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Major) - b += 2 - - xgb.Put16(buf[b:], Minor) - b += 2 - - return buf -} - -// SetGammaCookie is a cookie used only for SetGamma requests. -type SetGammaCookie struct { - *xgb.Cookie -} - -// SetGamma sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) - return SetGammaCookie{cookie} -} - -// SetGammaChecked sends a checked request. -// If an error occurs, it can be retrieved using SetGammaCookie.Check() -func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) - return SetGammaCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetGammaCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetGamma -// setGammaRequest writes a SetGamma request to a byte slice. -func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - b += 2 // padding - - xgb.Put32(buf[b:], Red) - b += 4 - - xgb.Put32(buf[b:], Green) - b += 4 - - xgb.Put32(buf[b:], Blue) - b += 4 - - b += 12 // padding - - return buf -} - // GetGammaCookie is a cookie used only for GetGamma requests. type GetGammaCookie struct { *xgb.Cookie @@ -2312,82 +1207,6 @@ func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { return buf } -// SetGammaRampCookie is a cookie used only for SetGammaRamp requests. -type SetGammaRampCookie struct { - *xgb.Cookie -} - -// SetGammaRamp sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) - return SetGammaRampCookie{cookie} -} - -// SetGammaRampChecked sends a checked request. -// If an error occurs, it can be retrieved using SetGammaRampCookie.Check() -func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { - panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) - return SetGammaRampCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetGammaRampCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetGammaRamp -// setGammaRampRequest writes a SetGammaRamp request to a byte slice. -func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], Screen) - b += 2 - - xgb.Put16(buf[b:], Size) - b += 2 - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - xgb.Put16(buf[b:], Red[i]) - b += 2 - } - b = xgb.Pad(b) - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - xgb.Put16(buf[b:], Green[i]) - b += 2 - } - b = xgb.Pad(b) - - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { - xgb.Put16(buf[b:], Blue[i]) - b += 2 - } - b = xgb.Pad(b) - - return buf -} - // GetGammaRampSizeCookie is a cookie used only for GetGammaRampSize requests. type GetGammaRampSizeCookie struct { *xgb.Cookie @@ -2481,6 +1300,293 @@ func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { return buf } +// GetModeLineCookie is a cookie used only for GetModeLine requests. +type GetModeLineCookie struct { + *xgb.Cookie +} + +// GetModeLine sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() +func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getModeLineRequest(c, Screen), cookie) + return GetModeLineCookie{cookie} +} + +// GetModeLineUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getModeLineRequest(c, Screen), cookie) + return GetModeLineCookie{cookie} +} + +// GetModeLineReply represents the data returned from a GetModeLine request. +type GetModeLineReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Dotclock Dotclock + Hdisplay uint16 + Hsyncstart uint16 + Hsyncend uint16 + Htotal uint16 + Hskew uint16 + Vdisplay uint16 + Vsyncstart uint16 + Vsyncend uint16 + Vtotal uint16 + // padding: 2 bytes + Flags uint32 + // padding: 12 bytes + Privsize uint32 + Private []byte // size: xgb.Pad((int(Privsize) * 1)) +} + +// Reply blocks and returns the reply data for a GetModeLine request. +func (cook GetModeLineCookie) Reply() (*GetModeLineReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getModeLineReply(buf), nil +} + +// getModeLineReply reads a byte slice into a GetModeLineReply value. +func getModeLineReply(buf []byte) *GetModeLineReply { + v := new(GetModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Dotclock = Dotclock(xgb.Get32(buf[b:])) + b += 4 + + v.Hdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Hsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Htotal = xgb.Get16(buf[b:]) + b += 2 + + v.Hskew = xgb.Get16(buf[b:]) + b += 2 + + v.Vdisplay = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncstart = xgb.Get16(buf[b:]) + b += 2 + + v.Vsyncend = xgb.Get16(buf[b:]) + b += 2 + + v.Vtotal = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Privsize = xgb.Get32(buf[b:]) + b += 4 + + v.Private = make([]byte, v.Privsize) + copy(v.Private[:v.Privsize], buf[b:]) + b += xgb.Pad(int(v.Privsize)) + + return v +} + +// Write request to wire for GetModeLine +// getModeLineRequest writes a GetModeLine request to a byte slice. +func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// GetMonitorCookie is a cookie used only for GetMonitor requests. +type GetMonitorCookie struct { + *xgb.Cookie +} + +// GetMonitor sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() +func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMonitorRequest(c, Screen), cookie) + return GetMonitorCookie{cookie} +} + +// GetMonitorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMonitorRequest(c, Screen), cookie) + return GetMonitorCookie{cookie} +} + +// GetMonitorReply represents the data returned from a GetMonitor request. +type GetMonitorReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + VendorLength byte + ModelLength byte + NumHsync byte + NumVsync byte + // padding: 20 bytes + Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) + Vsync []Syncrange // size: xgb.Pad((int(NumVsync) * 4)) + Vendor string // size: xgb.Pad((int(VendorLength) * 1)) + AlignmentPad []byte // size: xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) + Model string // size: xgb.Pad((int(ModelLength) * 1)) +} + +// Reply blocks and returns the reply data for a GetMonitor request. +func (cook GetMonitorCookie) Reply() (*GetMonitorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMonitorReply(buf), nil +} + +// getMonitorReply reads a byte slice into a GetMonitorReply value. +func getMonitorReply(buf []byte) *GetMonitorReply { + v := new(GetMonitorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.VendorLength = buf[b] + b += 1 + + v.ModelLength = buf[b] + b += 1 + + v.NumHsync = buf[b] + b += 1 + + v.NumVsync = buf[b] + b += 1 + + b += 20 // padding + + v.Hsync = make([]Syncrange, v.NumHsync) + for i := 0; i < int(v.NumHsync); i++ { + v.Hsync[i] = Syncrange(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Vsync = make([]Syncrange, v.NumVsync) + for i := 0; i < int(v.NumVsync); i++ { + v.Vsync[i] = Syncrange(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + { + byteString := make([]byte, v.VendorLength) + copy(byteString[:v.VendorLength], buf[b:]) + v.Vendor = string(byteString) + b += xgb.Pad(int(v.VendorLength)) + } + + v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) + copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) + b += xgb.Pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) + + { + byteString := make([]byte, v.ModelLength) + copy(byteString[:v.ModelLength], buf[b:]) + v.Model = string(byteString) + b += xgb.Pad(int(v.ModelLength)) + } + + return v +} + +// Write request to wire for GetMonitor +// getMonitorRequest writes a GetMonitor request to a byte slice. +func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + // GetPermissionsCookie is a cookie used only for GetPermissions requests. type GetPermissionsCookie struct { *xgb.Cookie @@ -2573,3 +1679,897 @@ func getPermissionsRequest(c *xgb.Conn, Screen uint16) []byte { return buf } + +// GetViewPortCookie is a cookie used only for GetViewPort requests. +type GetViewPortCookie struct { + *xgb.Cookie +} + +// GetViewPort sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() +func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getViewPortRequest(c, Screen), cookie) + return GetViewPortCookie{cookie} +} + +// GetViewPortUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getViewPortRequest(c, Screen), cookie) + return GetViewPortCookie{cookie} +} + +// GetViewPortReply represents the data returned from a GetViewPort request. +type GetViewPortReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + X uint32 + Y uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a GetViewPort request. +func (cook GetViewPortCookie) Reply() (*GetViewPortReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getViewPortReply(buf), nil +} + +// getViewPortReply reads a byte slice into a GetViewPortReply value. +func getViewPortReply(buf []byte) *GetViewPortReply { + v := new(GetViewPortReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.X = xgb.Get32(buf[b:]) + b += 4 + + v.Y = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for GetViewPort +// getViewPortRequest writes a GetViewPort request to a byte slice. +func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + return buf +} + +// LockModeSwitchCookie is a cookie used only for LockModeSwitch requests. +type LockModeSwitchCookie struct { + *xgb.Cookie +} + +// LockModeSwitch sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) + return LockModeSwitchCookie{cookie} +} + +// LockModeSwitchChecked sends a checked request. +// If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() +func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(lockModeSwitchRequest(c, Screen, Lock), cookie) + return LockModeSwitchCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook LockModeSwitchCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for LockModeSwitch +// lockModeSwitchRequest writes a LockModeSwitch request to a byte slice. +func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Lock) + b += 2 + + return buf +} + +// ModModeLineCookie is a cookie used only for ModModeLine requests. +type ModModeLineCookie struct { + *xgb.Cookie +} + +// ModModeLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ModModeLineCookie{cookie} +} + +// ModModeLineChecked sends a checked request. +// If an error occurs, it can be retrieved using ModModeLineCookie.Check() +func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(modModeLineRequest(c, Screen, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ModModeLineCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ModModeLineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ModModeLine +// modModeLineRequest writes a ModModeLine request to a byte slice. +func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((48 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// SetClientVersionCookie is a cookie used only for SetClientVersion requests. +type SetClientVersionCookie struct { + *xgb.Cookie +} + +// SetClientVersion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) + return SetClientVersionCookie{cookie} +} + +// SetClientVersionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClientVersionCookie.Check() +func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setClientVersionRequest(c, Major, Minor), cookie) + return SetClientVersionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetClientVersionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClientVersion +// setClientVersionRequest writes a SetClientVersion request to a byte slice. +func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Major) + b += 2 + + xgb.Put16(buf[b:], Minor) + b += 2 + + return buf +} + +// SetGammaCookie is a cookie used only for SetGamma requests. +type SetGammaCookie struct { + *xgb.Cookie +} + +// SetGamma sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) + return SetGammaCookie{cookie} +} + +// SetGammaChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGammaCookie.Check() +func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setGammaRequest(c, Screen, Red, Green, Blue), cookie) + return SetGammaCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetGammaCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGamma +// setGammaRequest writes a SetGamma request to a byte slice. +func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Red) + b += 4 + + xgb.Put32(buf[b:], Green) + b += 4 + + xgb.Put32(buf[b:], Blue) + b += 4 + + b += 12 // padding + + return buf +} + +// SetGammaRampCookie is a cookie used only for SetGammaRamp requests. +type SetGammaRampCookie struct { + *xgb.Cookie +} + +// SetGammaRamp sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) + return SetGammaRampCookie{cookie} +} + +// SetGammaRampChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGammaRampCookie.Check() +func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setGammaRampRequest(c, Screen, Size, Red, Green, Blue), cookie) + return SetGammaRampCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetGammaRampCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGammaRamp +// setGammaRampRequest writes a SetGammaRamp request to a byte slice. +func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { + size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Size) + b += 2 + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Red[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Green[i]) + b += 2 + } + b = xgb.Pad(b) + + for i := 0; i < int(((int(Size) + 1) & -2)); i++ { + xgb.Put16(buf[b:], Blue[i]) + b += 2 + } + b = xgb.Pad(b) + + return buf +} + +// SetViewPortCookie is a cookie used only for SetViewPort requests. +type SetViewPortCookie struct { + *xgb.Cookie +} + +// SetViewPort sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) + return SetViewPortCookie{cookie} +} + +// SetViewPortChecked sends a checked request. +// If an error occurs, it can be retrieved using SetViewPortCookie.Check() +func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setViewPortRequest(c, Screen, X, Y), cookie) + return SetViewPortCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetViewPortCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetViewPort +// setViewPortRequest writes a SetViewPort request to a byte slice. +func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 12 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], X) + b += 4 + + xgb.Put32(buf[b:], Y) + b += 4 + + return buf +} + +// SwitchModeCookie is a cookie used only for SwitchMode requests. +type SwitchModeCookie struct { + *xgb.Cookie +} + +// SwitchMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) + return SwitchModeCookie{cookie} +} + +// SwitchModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SwitchModeCookie.Check() +func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(switchModeRequest(c, Screen, Zoom), cookie) + return SwitchModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SwitchModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwitchMode +// switchModeRequest writes a SwitchMode request to a byte slice. +func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], Screen) + b += 2 + + xgb.Put16(buf[b:], Zoom) + b += 2 + + return buf +} + +// SwitchToModeCookie is a cookie used only for SwitchToMode requests. +type SwitchToModeCookie struct { + *xgb.Cookie +} + +// SwitchToMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return SwitchToModeCookie{cookie} +} + +// SwitchToModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SwitchToModeCookie.Check() +func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(switchToModeRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return SwitchToModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SwitchToModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SwitchToMode +// switchToModeRequest writes a SwitchToMode request to a byte slice. +func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} + +// ValidateModeLineCookie is a cookie used only for ValidateModeLine requests. +type ValidateModeLineCookie struct { + *xgb.Cookie +} + +// ValidateModeLine sends a checked request. +// If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() +func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ValidateModeLineCookie{cookie} +} + +// ValidateModeLineUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(validateModeLineRequest(c, Screen, Dotclock, Hdisplay, Hsyncstart, Hsyncend, Htotal, Hskew, Vdisplay, Vsyncstart, Vsyncend, Vtotal, Flags, Privsize, Private), cookie) + return ValidateModeLineCookie{cookie} +} + +// ValidateModeLineReply represents the data returned from a ValidateModeLine request. +type ValidateModeLineReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Status uint32 + // padding: 20 bytes +} + +// Reply blocks and returns the reply data for a ValidateModeLine request. +func (cook ValidateModeLineCookie) Reply() (*ValidateModeLineReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return validateModeLineReply(buf), nil +} + +// validateModeLineReply reads a byte slice into a ValidateModeLineReply value. +func validateModeLineReply(buf []byte) *ValidateModeLineReply { + v := new(ValidateModeLineReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + return v +} + +// Write request to wire for ValidateModeLine +// validateModeLineRequest writes a ValidateModeLine request to a byte slice. +func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) []byte { + size := xgb.Pad((52 + xgb.Pad((int(Privsize) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Screen) + b += 4 + + xgb.Put32(buf[b:], uint32(Dotclock)) + b += 4 + + xgb.Put16(buf[b:], Hdisplay) + b += 2 + + xgb.Put16(buf[b:], Hsyncstart) + b += 2 + + xgb.Put16(buf[b:], Hsyncend) + b += 2 + + xgb.Put16(buf[b:], Htotal) + b += 2 + + xgb.Put16(buf[b:], Hskew) + b += 2 + + xgb.Put16(buf[b:], Vdisplay) + b += 2 + + xgb.Put16(buf[b:], Vsyncstart) + b += 2 + + xgb.Put16(buf[b:], Vsyncend) + b += 2 + + xgb.Put16(buf[b:], Vtotal) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], Flags) + b += 4 + + b += 12 // padding + + xgb.Put32(buf[b:], Privsize) + b += 4 + + copy(buf[b:], Private[:Privsize]) + b += xgb.Pad(int(Privsize)) + + return buf +} diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 42e9e99..76ffddf 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -2,7 +2,7 @@ package xfixes /* - This file was generated by xfixes.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xfixes.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -42,29 +42,173 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Int16' +// BadBadRegion is the error number for a BadBadRegion. +const BadBadRegion = 0 -// Skipping definition for base type 'Int32' +type BadRegionError struct { + Sequence uint16 + NiceName string +} -// Skipping definition for base type 'Void' +// BadRegionErrorNew constructs a BadRegionError value that implements xgb.Error from a byte slice. +func BadRegionErrorNew(buf []byte) xgb.Error { + v := BadRegionError{} + v.NiceName = "BadRegion" -// Skipping definition for base type 'Byte' + b := 1 // skip error determinant + b += 1 // don't read error number -// Skipping definition for base type 'Int8' + v.Sequence = xgb.Get16(buf[b:]) + b += 2 -// Skipping definition for base type 'Card16' + return v +} -// Skipping definition for base type 'Char' +// SequenceId returns the sequence id attached to the BadBadRegion error. +// This is mostly used internally. +func (err BadRegionError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Card32' +// BadId returns the 'BadValue' number if one exists for the BadBadRegion error. If no bad value exists, 0 is returned. +func (err BadRegionError) BadId() uint32 { + return 0 +} -// Skipping definition for base type 'Double' +// Error returns a rudimentary string representation of the BadBadRegion error. -// Skipping definition for base type 'Bool' +func (err BadRegionError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadRegion {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Float' +func init() { + xgb.NewExtErrorFuncs["XFIXES"][0] = BadRegionErrorNew +} -// Skipping definition for base type 'Card8' +// CursorNotify is the event number for a CursorNotifyEvent. +const CursorNotify = 1 + +type CursorNotifyEvent struct { + Sequence uint16 + Subtype byte + Window xproto.Window + CursorSerial uint32 + Timestamp xproto.Timestamp + Name xproto.Atom + // padding: 12 bytes +} + +// CursorNotifyEventNew constructs a CursorNotifyEvent value that implements xgb.Event from a byte slice. +func CursorNotifyEventNew(buf []byte) xgb.Event { + v := CursorNotifyEvent{} + b := 1 // don't read event number + + v.Subtype = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.CursorSerial = xgb.Get32(buf[b:]) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Name = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + b += 12 // padding + + return v +} + +// Bytes writes a CursorNotifyEvent value to a byte slice. +func (v CursorNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + buf[b] = v.Subtype + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], v.CursorSerial) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Name)) + b += 4 + + b += 12 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the CursorNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v CursorNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of CursorNotifyEvent. +func (v CursorNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Subtype: %d", v.Subtype)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("CursorSerial: %d", v.CursorSerial)) + fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) + fieldVals = append(fieldVals, xgb.Sprintf("Name: %d", v.Name)) + return "CursorNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew +} + +const ( + CursorNotifyDisplayCursor = 0 +) + +const ( + CursorNotifyMaskDisplayCursor = 1 +) + +type Region uint32 + +func NewRegionId(c *xgb.Conn) (Region, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Region(id), nil +} + +const ( + RegionNone = 0 +) + +const ( + SaveSetMappingMap = 0 + SaveSetMappingUnmap = 1 +) const ( SaveSetModeInsert = 0 @@ -76,11 +220,6 @@ const ( SaveSetTargetRoot = 1 ) -const ( - SaveSetMappingMap = 0 - SaveSetMappingUnmap = 1 -) - const ( SelectionEventSetSelectionOwner = 0 SelectionEventSelectionWindowDestroy = 1 @@ -93,28 +232,6 @@ const ( SelectionEventMaskSelectionClientClose = 4 ) -const ( - CursorNotifyDisplayCursor = 0 -) - -const ( - CursorNotifyMaskDisplayCursor = 1 -) - -const ( - RegionNone = 0 -) - -type Region uint32 - -func NewRegionId(c *xgb.Conn) (Region, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Region(id), nil -} - // SelectionNotify is the event number for a SelectionNotifyEvent. const SelectionNotify = 0 @@ -218,223 +335,66 @@ func init() { xgb.NewExtEventFuncs["XFIXES"][0] = SelectionNotifyEventNew } -// CursorNotify is the event number for a CursorNotifyEvent. -const CursorNotify = 1 +// Skipping definition for base type 'Bool' -type CursorNotifyEvent struct { - Sequence uint16 - Subtype byte - Window xproto.Window - CursorSerial uint32 - Timestamp xproto.Timestamp - Name xproto.Atom - // padding: 12 bytes -} +// Skipping definition for base type 'Byte' -// CursorNotifyEventNew constructs a CursorNotifyEvent value that implements xgb.Event from a byte slice. -func CursorNotifyEventNew(buf []byte) xgb.Event { - v := CursorNotifyEvent{} - b := 1 // don't read event number +// Skipping definition for base type 'Card8' - v.Subtype = buf[b] - b += 1 +// Skipping definition for base type 'Char' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Void' - v.Window = xproto.Window(xgb.Get32(buf[b:])) - b += 4 +// Skipping definition for base type 'Double' - v.CursorSerial = xgb.Get32(buf[b:]) - b += 4 +// Skipping definition for base type 'Float' - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 +// Skipping definition for base type 'Int16' - v.Name = xproto.Atom(xgb.Get32(buf[b:])) - b += 4 +// Skipping definition for base type 'Int32' - b += 12 // padding +// Skipping definition for base type 'Int8' - return v -} +// Skipping definition for base type 'Card16' -// Bytes writes a CursorNotifyEvent value to a byte slice. -func (v CursorNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 +// Skipping definition for base type 'Card32' - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Subtype - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put32(buf[b:], v.CursorSerial) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Name)) - b += 4 - - b += 12 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the CursorNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v CursorNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of CursorNotifyEvent. -func (v CursorNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Subtype: %d", v.Subtype)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("CursorSerial: %d", v.CursorSerial)) - fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, xgb.Sprintf("Name: %d", v.Name)) - return "CursorNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew -} - -// BadBadRegion is the error number for a BadBadRegion. -const BadBadRegion = 0 - -type BadRegionError struct { - Sequence uint16 - NiceName string -} - -// BadRegionErrorNew constructs a BadRegionError value that implements xgb.Error from a byte slice. -func BadRegionErrorNew(buf []byte) xgb.Error { - v := BadRegionError{} - v.NiceName = "BadRegion" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadBadRegion error. -// This is mostly used internally. -func (err BadRegionError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadBadRegion error. If no bad value exists, 0 is returned. -func (err BadRegionError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadRegion error. - -func (err BadRegionError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadRegion {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XFIXES"][0] = BadRegionErrorNew -} - -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// ChangeCursorCookie is a cookie used only for ChangeCursor requests. +type ChangeCursorCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} -} - -// QueryVersionUnchecked sends an unchecked request. +// ChangeCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { +func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) - return QueryVersionCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) + return ChangeCursorCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint32 - MinorVersion uint32 - // padding: 16 bytes -} - -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err +// ChangeCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCursorCookie.Check() +func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil + cookie := c.NewCookie(true, false) + c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) + return ChangeCursorCookie{cookie} } -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = xgb.Get32(buf[b:]) - b += 4 - - v.MinorVersion = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeCursorCookie) Check() error { + return cook.Cookie.Check() } -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { +// Write request to wire for ChangeCursor +// changeCursorRequest writes a ChangeCursor request to a byte slice. +func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -442,21 +402,84 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers buf[b] = c.Extensions["XFIXES"] b += 1 - buf[b] = 0 // request opcode + buf[b] = 26 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], ClientMajorVersion) + xgb.Put32(buf[b:], uint32(Source)) b += 4 - xgb.Put32(buf[b:], ClientMinorVersion) + xgb.Put32(buf[b:], uint32(Destination)) b += 4 return buf } +// ChangeCursorByNameCookie is a cookie used only for ChangeCursorByName requests. +type ChangeCursorByNameCookie struct { + *xgb.Cookie +} + +// ChangeCursorByName sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) + return ChangeCursorByNameCookie{cookie} +} + +// ChangeCursorByNameChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeCursorByNameCookie.Check() +func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) + return ChangeCursorByNameCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeCursorByNameCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeCursorByName +// changeCursorByNameRequest writes a ChangeCursorByName request to a byte slice. +func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 27 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Src)) + b += 4 + + xgb.Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += xgb.Pad(int(Nbytes)) + + return buf +} + // ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. type ChangeSaveSetCookie struct { *xgb.Cookie @@ -523,103 +546,42 @@ func changeSaveSetRequest(c *xgb.Conn, Mode byte, Target byte, Map byte, Window return buf } -// SelectSelectionInputCookie is a cookie used only for SelectSelectionInput requests. -type SelectSelectionInputCookie struct { +// CopyRegionCookie is a cookie used only for CopyRegion requests. +type CopyRegionCookie struct { *xgb.Cookie } -// SelectSelectionInput sends an unchecked request. +// CopyRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { +func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) - return SelectSelectionInputCookie{cookie} + c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) + return CopyRegionCookie{cookie} } -// SelectSelectionInputChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectSelectionInputCookie.Check() -func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { +// CopyRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyRegionCookie.Check() +func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) - return SelectSelectionInputCookie{cookie} + c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) + return CopyRegionCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectSelectionInputCookie) Check() error { +func (cook CopyRegionCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SelectSelectionInput -// selectSelectionInputRequest writes a SelectSelectionInput request to a byte slice. -func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Selection)) - b += 4 - - xgb.Put32(buf[b:], EventMask) - b += 4 - - return buf -} - -// SelectCursorInputCookie is a cookie used only for SelectCursorInput requests. -type SelectCursorInputCookie struct { - *xgb.Cookie -} - -// SelectCursorInput sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) - return SelectCursorInputCookie{cookie} -} - -// SelectCursorInputChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectCursorInputCookie.Check() -func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) - return SelectCursorInputCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectCursorInputCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectCursorInput -// selectCursorInputRequest writes a SelectCursorInput request to a byte slice. -func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint32) []byte { +// Write request to wire for CopyRegion +// copyRegionRequest writes a CopyRegion request to a byte slice. +func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -627,16 +589,530 @@ func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint3 buf[b] = c.Extensions["XFIXES"] b += 1 - buf[b] = 3 // request opcode + buf[b] = 12 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// CreateRegionCookie is a cookie used only for CreateRegion requests. +type CreateRegionCookie struct { + *xgb.Cookie +} + +// CreateRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) + return CreateRegionCookie{cookie} +} + +// CreateRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionCookie.Check() +func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) + return CreateRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegion +// createRegionRequest writes a CreateRegion request to a byte slice. +func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// CreateRegionFromBitmapCookie is a cookie used only for CreateRegionFromBitmap requests. +type CreateRegionFromBitmapCookie struct { + *xgb.Cookie +} + +// CreateRegionFromBitmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) + return CreateRegionFromBitmapCookie{cookie} +} + +// CreateRegionFromBitmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromBitmapCookie.Check() +func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) + return CreateRegionFromBitmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionFromBitmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromBitmap +// createRegionFromBitmapRequest writes a CreateRegionFromBitmap request to a byte slice. +func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Bitmap)) + b += 4 + + return buf +} + +// CreateRegionFromGCCookie is a cookie used only for CreateRegionFromGC requests. +type CreateRegionFromGCCookie struct { + *xgb.Cookie +} + +// CreateRegionFromGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) + return CreateRegionFromGCCookie{cookie} +} + +// CreateRegionFromGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromGCCookie.Check() +func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) + return CreateRegionFromGCCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionFromGCCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromGC +// createRegionFromGCRequest writes a CreateRegionFromGC request to a byte slice. +func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + return buf +} + +// CreateRegionFromPictureCookie is a cookie used only for CreateRegionFromPicture requests. +type CreateRegionFromPictureCookie struct { + *xgb.Cookie +} + +// CreateRegionFromPicture sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) + return CreateRegionFromPictureCookie{cookie} +} + +// CreateRegionFromPictureChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromPictureCookie.Check() +func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) + return CreateRegionFromPictureCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionFromPictureCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromPicture +// createRegionFromPictureRequest writes a CreateRegionFromPicture request to a byte slice. +func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.Picture) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + return buf +} + +// CreateRegionFromWindowCookie is a cookie used only for CreateRegionFromWindow requests. +type CreateRegionFromWindowCookie struct { + *xgb.Cookie +} + +// CreateRegionFromWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) + return CreateRegionFromWindowCookie{cookie} +} + +// CreateRegionFromWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateRegionFromWindowCookie.Check() +func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) + return CreateRegionFromWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateRegionFromWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateRegionFromWindow +// createRegionFromWindowRequest writes a CreateRegionFromWindow request to a byte slice. +func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + xgb.Put32(buf[b:], uint32(Window)) b += 4 - xgb.Put32(buf[b:], EventMask) + buf[b] = byte(Kind) + b += 1 + + b += 3 // padding + + return buf +} + +// DestroyRegionCookie is a cookie used only for DestroyRegion requests. +type DestroyRegionCookie struct { + *xgb.Cookie +} + +// DestroyRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyRegionRequest(c, Region), cookie) + return DestroyRegionCookie{cookie} +} + +// DestroyRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyRegionCookie.Check() +func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyRegionRequest(c, Region), cookie) + return DestroyRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyRegion +// destroyRegionRequest writes a DestroyRegion request to a byte slice. +func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + +// ExpandRegionCookie is a cookie used only for ExpandRegion requests. +type ExpandRegionCookie struct { + *xgb.Cookie +} + +// ExpandRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) + return ExpandRegionCookie{cookie} +} + +// ExpandRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using ExpandRegionCookie.Check() +func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) + return ExpandRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ExpandRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ExpandRegion +// expandRegionRequest writes a ExpandRegion request to a byte slice. +func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + xgb.Put16(buf[b:], Left) + b += 2 + + xgb.Put16(buf[b:], Right) + b += 2 + + xgb.Put16(buf[b:], Top) + b += 2 + + xgb.Put16(buf[b:], Bottom) + b += 2 + + return buf +} + +// FetchRegionCookie is a cookie used only for FetchRegion requests. +type FetchRegionCookie struct { + *xgb.Cookie +} + +// FetchRegion sends a checked request. +// If an error occurs, it will be returned with the reply by calling FetchRegionCookie.Reply() +func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(fetchRegionRequest(c, Region), cookie) + return FetchRegionCookie{cookie} +} + +// FetchRegionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(fetchRegionRequest(c, Region), cookie) + return FetchRegionCookie{cookie} +} + +// FetchRegionReply represents the data returned from a FetchRegion request. +type FetchRegionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Extents xproto.Rectangle + // padding: 16 bytes + Rectangles []xproto.Rectangle // size: xgb.Pad(((int(Length) / 2) * 8)) +} + +// Reply blocks and returns the reply data for a FetchRegion request. +func (cook FetchRegionCookie) Reply() (*FetchRegionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return fetchRegionReply(buf), nil +} + +// fetchRegionReply reads a byte slice into a FetchRegionReply value. +func fetchRegionReply(buf []byte) *FetchRegionReply { + v := new(FetchRegionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Extents = xproto.Rectangle{} + b += xproto.RectangleRead(buf[b:], &v.Extents) + + b += 16 // padding + + v.Rectangles = make([]xproto.Rectangle, (int(v.Length) / 2)) + b += xproto.RectangleReadList(buf[b:], v.Rectangles) + + return v +} + +// Write request to wire for FetchRegion +// fetchRegionRequest writes a FetchRegion request to a byte slice. +func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 19 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) b += 4 return buf @@ -762,1294 +1238,6 @@ func getCursorImageRequest(c *xgb.Conn) []byte { return buf } -// CreateRegionCookie is a cookie used only for CreateRegion requests. -type CreateRegionCookie struct { - *xgb.Cookie -} - -// CreateRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) - return CreateRegionCookie{cookie} -} - -// CreateRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionCookie.Check() -func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionRequest(c, Region, Rectangles), cookie) - return CreateRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegion -// createRegionRequest writes a CreateRegion request to a byte slice. -func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - b += xproto.RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// CreateRegionFromBitmapCookie is a cookie used only for CreateRegionFromBitmap requests. -type CreateRegionFromBitmapCookie struct { - *xgb.Cookie -} - -// CreateRegionFromBitmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) - return CreateRegionFromBitmapCookie{cookie} -} - -// CreateRegionFromBitmapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionFromBitmapCookie.Check() -func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionFromBitmapRequest(c, Region, Bitmap), cookie) - return CreateRegionFromBitmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionFromBitmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegionFromBitmap -// createRegionFromBitmapRequest writes a CreateRegionFromBitmap request to a byte slice. -func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put32(buf[b:], uint32(Bitmap)) - b += 4 - - return buf -} - -// CreateRegionFromWindowCookie is a cookie used only for CreateRegionFromWindow requests. -type CreateRegionFromWindowCookie struct { - *xgb.Cookie -} - -// CreateRegionFromWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) - return CreateRegionFromWindowCookie{cookie} -} - -// CreateRegionFromWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionFromWindowCookie.Check() -func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionFromWindowRequest(c, Region, Window, Kind), cookie) - return CreateRegionFromWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionFromWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegionFromWindow -// createRegionFromWindowRequest writes a CreateRegionFromWindow request to a byte slice. -func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - buf[b] = byte(Kind) - b += 1 - - b += 3 // padding - - return buf -} - -// CreateRegionFromGCCookie is a cookie used only for CreateRegionFromGC requests. -type CreateRegionFromGCCookie struct { - *xgb.Cookie -} - -// CreateRegionFromGC sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) - return CreateRegionFromGCCookie{cookie} -} - -// CreateRegionFromGCChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionFromGCCookie.Check() -func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionFromGCRequest(c, Region, Gc), cookie) - return CreateRegionFromGCCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionFromGCCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegionFromGC -// createRegionFromGCRequest writes a CreateRegionFromGC request to a byte slice. -func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - return buf -} - -// CreateRegionFromPictureCookie is a cookie used only for CreateRegionFromPicture requests. -type CreateRegionFromPictureCookie struct { - *xgb.Cookie -} - -// CreateRegionFromPicture sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) - return CreateRegionFromPictureCookie{cookie} -} - -// CreateRegionFromPictureChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateRegionFromPictureCookie.Check() -func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createRegionFromPictureRequest(c, Region, Picture), cookie) - return CreateRegionFromPictureCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateRegionFromPictureCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateRegionFromPicture -// createRegionFromPictureRequest writes a CreateRegionFromPicture request to a byte slice. -func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.Picture) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - return buf -} - -// DestroyRegionCookie is a cookie used only for DestroyRegion requests. -type DestroyRegionCookie struct { - *xgb.Cookie -} - -// DestroyRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyRegionRequest(c, Region), cookie) - return DestroyRegionCookie{cookie} -} - -// DestroyRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyRegionCookie.Check() -func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyRegionRequest(c, Region), cookie) - return DestroyRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyRegion -// destroyRegionRequest writes a DestroyRegion request to a byte slice. -func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// SetRegionCookie is a cookie used only for SetRegion requests. -type SetRegionCookie struct { - *xgb.Cookie -} - -// SetRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) - return SetRegionCookie{cookie} -} - -// SetRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using SetRegionCookie.Check() -func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) - return SetRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetRegion -// setRegionRequest writes a SetRegion request to a byte slice. -func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - b += xproto.RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// CopyRegionCookie is a cookie used only for CopyRegion requests. -type CopyRegionCookie struct { - *xgb.Cookie -} - -// CopyRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) - return CopyRegionCookie{cookie} -} - -// CopyRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyRegionCookie.Check() -func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(copyRegionRequest(c, Source, Destination), cookie) - return CopyRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyRegion -// copyRegionRequest writes a CopyRegion request to a byte slice. -func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// UnionRegionCookie is a cookie used only for UnionRegion requests. -type UnionRegionCookie struct { - *xgb.Cookie -} - -// UnionRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) - return UnionRegionCookie{cookie} -} - -// UnionRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using UnionRegionCookie.Check() -func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) - return UnionRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UnionRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UnionRegion -// unionRegionRequest writes a UnionRegion request to a byte slice. -func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source1)) - b += 4 - - xgb.Put32(buf[b:], uint32(Source2)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// IntersectRegionCookie is a cookie used only for IntersectRegion requests. -type IntersectRegionCookie struct { - *xgb.Cookie -} - -// IntersectRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) - return IntersectRegionCookie{cookie} -} - -// IntersectRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using IntersectRegionCookie.Check() -func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) - return IntersectRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook IntersectRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for IntersectRegion -// intersectRegionRequest writes a IntersectRegion request to a byte slice. -func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source1)) - b += 4 - - xgb.Put32(buf[b:], uint32(Source2)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// SubtractRegionCookie is a cookie used only for SubtractRegion requests. -type SubtractRegionCookie struct { - *xgb.Cookie -} - -// SubtractRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) - return SubtractRegionCookie{cookie} -} - -// SubtractRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using SubtractRegionCookie.Check() -func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) - return SubtractRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SubtractRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SubtractRegion -// subtractRegionRequest writes a SubtractRegion request to a byte slice. -func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source1)) - b += 4 - - xgb.Put32(buf[b:], uint32(Source2)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// InvertRegionCookie is a cookie used only for InvertRegion requests. -type InvertRegionCookie struct { - *xgb.Cookie -} - -// InvertRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) - return InvertRegionCookie{cookie} -} - -// InvertRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using InvertRegionCookie.Check() -func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) - return InvertRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook InvertRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for InvertRegion -// invertRegionRequest writes a InvertRegion request to a byte slice. -func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - { - structBytes := Bounds.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// TranslateRegionCookie is a cookie used only for TranslateRegion requests. -type TranslateRegionCookie struct { - *xgb.Cookie -} - -// TranslateRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) - return TranslateRegionCookie{cookie} -} - -// TranslateRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using TranslateRegionCookie.Check() -func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) - return TranslateRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook TranslateRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for TranslateRegion -// translateRegionRequest writes a TranslateRegion request to a byte slice. -func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put16(buf[b:], uint16(Dx)) - b += 2 - - xgb.Put16(buf[b:], uint16(Dy)) - b += 2 - - return buf -} - -// RegionExtentsCookie is a cookie used only for RegionExtents requests. -type RegionExtentsCookie struct { - *xgb.Cookie -} - -// RegionExtents sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) - return RegionExtentsCookie{cookie} -} - -// RegionExtentsChecked sends a checked request. -// If an error occurs, it can be retrieved using RegionExtentsCookie.Check() -func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) - return RegionExtentsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RegionExtentsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for RegionExtents -// regionExtentsRequest writes a RegionExtents request to a byte slice. -func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// FetchRegionCookie is a cookie used only for FetchRegion requests. -type FetchRegionCookie struct { - *xgb.Cookie -} - -// FetchRegion sends a checked request. -// If an error occurs, it will be returned with the reply by calling FetchRegionCookie.Reply() -func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(fetchRegionRequest(c, Region), cookie) - return FetchRegionCookie{cookie} -} - -// FetchRegionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(fetchRegionRequest(c, Region), cookie) - return FetchRegionCookie{cookie} -} - -// FetchRegionReply represents the data returned from a FetchRegion request. -type FetchRegionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Extents xproto.Rectangle - // padding: 16 bytes - Rectangles []xproto.Rectangle // size: xgb.Pad(((int(Length) / 2) * 8)) -} - -// Reply blocks and returns the reply data for a FetchRegion request. -func (cook FetchRegionCookie) Reply() (*FetchRegionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return fetchRegionReply(buf), nil -} - -// fetchRegionReply reads a byte slice into a FetchRegionReply value. -func fetchRegionReply(buf []byte) *FetchRegionReply { - v := new(FetchRegionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Extents = xproto.Rectangle{} - b += xproto.RectangleRead(buf[b:], &v.Extents) - - b += 16 // padding - - v.Rectangles = make([]xproto.Rectangle, (int(v.Length) / 2)) - b += xproto.RectangleReadList(buf[b:], v.Rectangles) - - return v -} - -// Write request to wire for FetchRegion -// fetchRegionRequest writes a FetchRegion request to a byte slice. -func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// SetGCClipRegionCookie is a cookie used only for SetGCClipRegion requests. -type SetGCClipRegionCookie struct { - *xgb.Cookie -} - -// SetGCClipRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) - return SetGCClipRegionCookie{cookie} -} - -// SetGCClipRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using SetGCClipRegionCookie.Check() -func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) - return SetGCClipRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetGCClipRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetGCClipRegion -// setGCClipRegionRequest writes a SetGCClipRegion request to a byte slice. -func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put16(buf[b:], uint16(XOrigin)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOrigin)) - b += 2 - - return buf -} - -// SetWindowShapeRegionCookie is a cookie used only for SetWindowShapeRegion requests. -type SetWindowShapeRegionCookie struct { - *xgb.Cookie -} - -// SetWindowShapeRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) - return SetWindowShapeRegionCookie{cookie} -} - -// SetWindowShapeRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using SetWindowShapeRegionCookie.Check() -func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) - return SetWindowShapeRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetWindowShapeRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetWindowShapeRegion -// setWindowShapeRegionRequest writes a SetWindowShapeRegion request to a byte slice. -func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Dest)) - b += 4 - - buf[b] = byte(DestKind) - b += 1 - - b += 3 // padding - - xgb.Put16(buf[b:], uint16(XOffset)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOffset)) - b += 2 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - return buf -} - -// SetPictureClipRegionCookie is a cookie used only for SetPictureClipRegion requests. -type SetPictureClipRegionCookie struct { - *xgb.Cookie -} - -// SetPictureClipRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) - return SetPictureClipRegionCookie{cookie} -} - -// SetPictureClipRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPictureClipRegionCookie.Check() -func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) - return SetPictureClipRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPictureClipRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPictureClipRegion -// setPictureClipRegionRequest writes a SetPictureClipRegion request to a byte slice. -func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Picture)) - b += 4 - - xgb.Put32(buf[b:], uint32(Region)) - b += 4 - - xgb.Put16(buf[b:], uint16(XOrigin)) - b += 2 - - xgb.Put16(buf[b:], uint16(YOrigin)) - b += 2 - - return buf -} - -// SetCursorNameCookie is a cookie used only for SetCursorName requests. -type SetCursorNameCookie struct { - *xgb.Cookie -} - -// SetCursorName sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) - return SetCursorNameCookie{cookie} -} - -// SetCursorNameChecked sends a checked request. -// If an error occurs, it can be retrieved using SetCursorNameCookie.Check() -func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) - return SetCursorNameCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetCursorNameCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetCursorName -// setCursorNameRequest writes a SetCursorName request to a byte slice. -func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) []byte { - size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 23 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - xgb.Put16(buf[b:], Nbytes) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:Nbytes]) - b += xgb.Pad(int(Nbytes)) - - return buf -} - -// GetCursorNameCookie is a cookie used only for GetCursorName requests. -type GetCursorNameCookie struct { - *xgb.Cookie -} - -// GetCursorName sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetCursorNameCookie.Reply() -func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getCursorNameRequest(c, Cursor), cookie) - return GetCursorNameCookie{cookie} -} - -// GetCursorNameUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getCursorNameRequest(c, Cursor), cookie) - return GetCursorNameCookie{cookie} -} - -// GetCursorNameReply represents the data returned from a GetCursorName request. -type GetCursorNameReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Atom xproto.Atom - Nbytes uint16 - // padding: 18 bytes - Name string // size: xgb.Pad((int(Nbytes) * 1)) -} - -// Reply blocks and returns the reply data for a GetCursorName request. -func (cook GetCursorNameCookie) Reply() (*GetCursorNameReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getCursorNameReply(buf), nil -} - -// getCursorNameReply reads a byte slice into a GetCursorNameReply value. -func getCursorNameReply(buf []byte) *GetCursorNameReply { - v := new(GetCursorNameReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Atom = xproto.Atom(xgb.Get32(buf[b:])) - b += 4 - - v.Nbytes = xgb.Get16(buf[b:]) - b += 2 - - b += 18 // padding - - { - byteString := make([]byte, v.Nbytes) - copy(byteString[:v.Nbytes], buf[b:]) - v.Name = string(byteString) - b += xgb.Pad(int(v.Nbytes)) - } - - return v -} - -// Write request to wire for GetCursorName -// getCursorNameRequest writes a GetCursorName request to a byte slice. -func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - return buf -} - // GetCursorImageAndNameCookie is a cookie used only for GetCursorImageAndName requests. type GetCursorImageAndNameCookie struct { *xgb.Cookie @@ -2186,194 +1374,106 @@ func getCursorImageAndNameRequest(c *xgb.Conn) []byte { return buf } -// ChangeCursorCookie is a cookie used only for ChangeCursor requests. -type ChangeCursorCookie struct { +// GetCursorNameCookie is a cookie used only for GetCursorName requests. +type GetCursorNameCookie struct { *xgb.Cookie } -// ChangeCursor sends an unchecked request. +// GetCursorName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetCursorNameCookie.Reply() +func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getCursorNameRequest(c, Cursor), cookie) + return GetCursorNameCookie{cookie} +} + +// GetCursorNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { +func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) - return ChangeCursorCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(getCursorNameRequest(c, Cursor), cookie) + return GetCursorNameCookie{cookie} } -// ChangeCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeCursorCookie.Check() -func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") +// GetCursorNameReply represents the data returned from a GetCursorName request. +type GetCursorNameReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Atom xproto.Atom + Nbytes uint16 + // padding: 18 bytes + Name string // size: xgb.Pad((int(Nbytes) * 1)) +} + +// Reply blocks and returns the reply data for a GetCursorName request. +func (cook GetCursorNameCookie) Reply() (*GetCursorNameReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(changeCursorRequest(c, Source, Destination), cookie) - return ChangeCursorCookie{cookie} + if buf == nil { + return nil, nil + } + return getCursorNameReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeCursorCookie) Check() error { - return cook.Cookie.Check() +// getCursorNameReply reads a byte slice into a GetCursorNameReply value. +func getCursorNameReply(buf []byte) *GetCursorNameReply { + v := new(GetCursorNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Atom = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Nbytes = xgb.Get16(buf[b:]) + b += 2 + + b += 18 // padding + + { + byteString := make([]byte, v.Nbytes) + copy(byteString[:v.Nbytes], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.Nbytes)) + } + + return v } -// Write request to wire for ChangeCursor -// changeCursorRequest writes a ChangeCursor request to a byte slice. -func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) []byte { - size := 12 +// Write request to wire for GetCursorName +// getCursorNameRequest writes a GetCursorName request to a byte slice. +func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XFIXES"] b += 1 - buf[b] = 26 // request opcode + buf[b] = 24 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Source)) + xgb.Put32(buf[b:], uint32(Cursor)) b += 4 - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - return buf -} - -// ChangeCursorByNameCookie is a cookie used only for ChangeCursorByName requests. -type ChangeCursorByNameCookie struct { - *xgb.Cookie -} - -// ChangeCursorByName sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) - return ChangeCursorByNameCookie{cookie} -} - -// ChangeCursorByNameChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeCursorByNameCookie.Check() -func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeCursorByNameRequest(c, Src, Nbytes, Name), cookie) - return ChangeCursorByNameCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeCursorByNameCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeCursorByName -// changeCursorByNameRequest writes a ChangeCursorByName request to a byte slice. -func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) []byte { - size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Src)) - b += 4 - - xgb.Put16(buf[b:], Nbytes) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:Nbytes]) - b += xgb.Pad(int(Nbytes)) - - return buf -} - -// ExpandRegionCookie is a cookie used only for ExpandRegion requests. -type ExpandRegionCookie struct { - *xgb.Cookie -} - -// ExpandRegion sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) - return ExpandRegionCookie{cookie} -} - -// ExpandRegionChecked sends a checked request. -// If an error occurs, it can be retrieved using ExpandRegionCookie.Check() -func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { - if _, ok := c.Extensions["XFIXES"]; !ok { - panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(expandRegionRequest(c, Source, Destination, Left, Right, Top, Bottom), cookie) - return ExpandRegionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ExpandRegionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ExpandRegion -// expandRegionRequest writes a ExpandRegion request to a byte slice. -func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XFIXES"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - xgb.Put16(buf[b:], Left) - b += 2 - - xgb.Put16(buf[b:], Right) - b += 2 - - xgb.Put16(buf[b:], Top) - b += 2 - - xgb.Put16(buf[b:], Bottom) - b += 2 - return buf } @@ -2432,6 +1532,723 @@ func hideCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } +// IntersectRegionCookie is a cookie used only for IntersectRegion requests. +type IntersectRegionCookie struct { + *xgb.Cookie +} + +// IntersectRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) + return IntersectRegionCookie{cookie} +} + +// IntersectRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using IntersectRegionCookie.Check() +func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(intersectRegionRequest(c, Source1, Source2, Destination), cookie) + return IntersectRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook IntersectRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for IntersectRegion +// intersectRegionRequest writes a IntersectRegion request to a byte slice. +func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// InvertRegionCookie is a cookie used only for InvertRegion requests. +type InvertRegionCookie struct { + *xgb.Cookie +} + +// InvertRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) + return InvertRegionCookie{cookie} +} + +// InvertRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using InvertRegionCookie.Check() +func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(invertRegionRequest(c, Source, Bounds, Destination), cookie) + return InvertRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook InvertRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for InvertRegion +// invertRegionRequest writes a InvertRegion request to a byte slice. +func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + { + structBytes := Bounds.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint32 + MinorVersion uint32 + // padding: 16 bytes +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get32(buf[b:]) + b += 4 + + v.MinorVersion = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ClientMajorVersion) + b += 4 + + xgb.Put32(buf[b:], ClientMinorVersion) + b += 4 + + return buf +} + +// RegionExtentsCookie is a cookie used only for RegionExtents requests. +type RegionExtentsCookie struct { + *xgb.Cookie +} + +// RegionExtents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) + return RegionExtentsCookie{cookie} +} + +// RegionExtentsChecked sends a checked request. +// If an error occurs, it can be retrieved using RegionExtentsCookie.Check() +func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(regionExtentsRequest(c, Source, Destination), cookie) + return RegionExtentsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RegionExtentsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RegionExtents +// regionExtentsRequest writes a RegionExtents request to a byte slice. +func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// SelectCursorInputCookie is a cookie used only for SelectCursorInput requests. +type SelectCursorInputCookie struct { + *xgb.Cookie +} + +// SelectCursorInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) + return SelectCursorInputCookie{cookie} +} + +// SelectCursorInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectCursorInputCookie.Check() +func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectCursorInputRequest(c, Window, EventMask), cookie) + return SelectCursorInputCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectCursorInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectCursorInput +// selectCursorInputRequest writes a SelectCursorInput request to a byte slice. +func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// SelectSelectionInputCookie is a cookie used only for SelectSelectionInput requests. +type SelectSelectionInputCookie struct { + *xgb.Cookie +} + +// SelectSelectionInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) + return SelectSelectionInputCookie{cookie} +} + +// SelectSelectionInputChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectSelectionInputCookie.Check() +func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectSelectionInputRequest(c, Window, Selection, EventMask), cookie) + return SelectSelectionInputCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectSelectionInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectSelectionInput +// selectSelectionInputRequest writes a SelectSelectionInput request to a byte slice. +func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 2 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + return buf +} + +// SetCursorNameCookie is a cookie used only for SetCursorName requests. +type SetCursorNameCookie struct { + *xgb.Cookie +} + +// SetCursorName sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) + return SetCursorNameCookie{cookie} +} + +// SetCursorNameChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCursorNameCookie.Check() +func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setCursorNameRequest(c, Cursor, Nbytes, Name), cookie) + return SetCursorNameCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetCursorNameCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCursorName +// setCursorNameRequest writes a SetCursorName request to a byte slice. +func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(Nbytes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 23 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + xgb.Put16(buf[b:], Nbytes) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:Nbytes]) + b += xgb.Pad(int(Nbytes)) + + return buf +} + +// SetGCClipRegionCookie is a cookie used only for SetGCClipRegion requests. +type SetGCClipRegionCookie struct { + *xgb.Cookie +} + +// SetGCClipRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) + return SetGCClipRegionCookie{cookie} +} + +// SetGCClipRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetGCClipRegionCookie.Check() +func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setGCClipRegionRequest(c, Gc, Region, XOrigin, YOrigin), cookie) + return SetGCClipRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetGCClipRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetGCClipRegion +// setGCClipRegionRequest writes a SetGCClipRegion request to a byte slice. +func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// SetPictureClipRegionCookie is a cookie used only for SetPictureClipRegion requests. +type SetPictureClipRegionCookie struct { + *xgb.Cookie +} + +// SetPictureClipRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) + return SetPictureClipRegionCookie{cookie} +} + +// SetPictureClipRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPictureClipRegionCookie.Check() +func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setPictureClipRegionRequest(c, Picture, Region, XOrigin, YOrigin), cookie) + return SetPictureClipRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetPictureClipRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPictureClipRegion +// setPictureClipRegionRequest writes a SetPictureClipRegion request to a byte slice. +func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Picture)) + b += 4 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(XOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOrigin)) + b += 2 + + return buf +} + +// SetRegionCookie is a cookie used only for SetRegion requests. +type SetRegionCookie struct { + *xgb.Cookie +} + +// SetRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) + return SetRegionCookie{cookie} +} + +// SetRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetRegionCookie.Check() +func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setRegionRequest(c, Region, Rectangles), cookie) + return SetRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetRegion +// setRegionRequest writes a SetRegion request to a byte slice. +func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + b += xproto.RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// SetWindowShapeRegionCookie is a cookie used only for SetWindowShapeRegion requests. +type SetWindowShapeRegionCookie struct { + *xgb.Cookie +} + +// SetWindowShapeRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) + return SetWindowShapeRegionCookie{cookie} +} + +// SetWindowShapeRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SetWindowShapeRegionCookie.Check() +func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setWindowShapeRegionRequest(c, Dest, DestKind, XOffset, YOffset, Region), cookie) + return SetWindowShapeRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetWindowShapeRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetWindowShapeRegion +// setWindowShapeRegionRequest writes a SetWindowShapeRegion request to a byte slice. +func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Dest)) + b += 4 + + buf[b] = byte(DestKind) + b += 1 + + b += 3 // padding + + xgb.Put16(buf[b:], uint16(XOffset)) + b += 2 + + xgb.Put16(buf[b:], uint16(YOffset)) + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + return buf +} + // ShowCursorCookie is a cookie used only for ShowCursor requests. type ShowCursorCookie struct { *xgb.Cookie @@ -2486,3 +2303,186 @@ func showCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } + +// SubtractRegionCookie is a cookie used only for SubtractRegion requests. +type SubtractRegionCookie struct { + *xgb.Cookie +} + +// SubtractRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) + return SubtractRegionCookie{cookie} +} + +// SubtractRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using SubtractRegionCookie.Check() +func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(subtractRegionRequest(c, Source1, Source2, Destination), cookie) + return SubtractRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SubtractRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SubtractRegion +// subtractRegionRequest writes a SubtractRegion request to a byte slice. +func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} + +// TranslateRegionCookie is a cookie used only for TranslateRegion requests. +type TranslateRegionCookie struct { + *xgb.Cookie +} + +// TranslateRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) + return TranslateRegionCookie{cookie} +} + +// TranslateRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using TranslateRegionCookie.Check() +func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(translateRegionRequest(c, Region, Dx, Dy), cookie) + return TranslateRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook TranslateRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for TranslateRegion +// translateRegionRequest writes a TranslateRegion request to a byte slice. +func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Region)) + b += 4 + + xgb.Put16(buf[b:], uint16(Dx)) + b += 2 + + xgb.Put16(buf[b:], uint16(Dy)) + b += 2 + + return buf +} + +// UnionRegionCookie is a cookie used only for UnionRegion requests. +type UnionRegionCookie struct { + *xgb.Cookie +} + +// UnionRegion sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) + return UnionRegionCookie{cookie} +} + +// UnionRegionChecked sends a checked request. +// If an error occurs, it can be retrieved using UnionRegionCookie.Check() +func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(unionRegionRequest(c, Source1, Source2, Destination), cookie) + return UnionRegionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UnionRegionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnionRegion +// unionRegionRequest writes a UnionRegion request to a byte slice. +func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Source1)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source2)) + b += 4 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + return buf +} diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 927ab82..dd3732f 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -2,7 +2,7 @@ package xinerama /* - This file was generated by xinerama.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xinerama.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XINERAMA"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - type ScreenInfo struct { XOrg int16 YOrg int16 @@ -132,189 +108,29 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { return b } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} +// Skipping definition for base type 'Bool' -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { - if _, ok := c.Extensions["XINERAMA"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { - if _, ok := c.Extensions["XINERAMA"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Card8' -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Major uint16 - Minor uint16 -} +// Skipping definition for base type 'Char' -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} +// Skipping definition for base type 'Void' -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Double' - b += 1 // padding +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int32' - v.Major = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int8' - v.Minor = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Card16' - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINERAMA"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Major - b += 1 - - buf[b] = Minor - b += 1 - - return buf -} - -// GetStateCookie is a cookie used only for GetState requests. -type GetStateCookie struct { - *xgb.Cookie -} - -// GetState sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply() -func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { - if _, ok := c.Extensions["XINERAMA"]; !ok { - panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getStateRequest(c, Window), cookie) - return GetStateCookie{cookie} -} - -// GetStateUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { - if _, ok := c.Extensions["XINERAMA"]; !ok { - panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getStateRequest(c, Window), cookie) - return GetStateCookie{cookie} -} - -// GetStateReply represents the data returned from a GetState request. -type GetStateReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - State byte - Window xproto.Window -} - -// Reply blocks and returns the reply data for a GetState request. -func (cook GetStateCookie) Reply() (*GetStateReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getStateReply(buf), nil -} - -// getStateReply reads a byte slice into a GetStateReply value. -func getStateReply(buf []byte) *GetStateReply { - v := new(GetStateReply) - b := 1 // skip reply determinant - - v.State = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Window = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for GetState -// getStateRequest writes a GetState request to a byte slice. -func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINERAMA"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} +// Skipping definition for base type 'Card32' // GetScreenCountCookie is a cookie used only for GetScreenCount requests. type GetScreenCountCookie struct { @@ -508,6 +324,95 @@ func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []by return buf } +// GetStateCookie is a cookie used only for GetState requests. +type GetStateCookie struct { + *xgb.Cookie +} + +// GetState sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply() +func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getStateRequest(c, Window), cookie) + return GetStateCookie{cookie} +} + +// GetStateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getStateRequest(c, Window), cookie) + return GetStateCookie{cookie} +} + +// GetStateReply represents the data returned from a GetState request. +type GetStateReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + State byte + Window xproto.Window +} + +// Reply blocks and returns the reply data for a GetState request. +func (cook GetStateCookie) Reply() (*GetStateReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getStateReply(buf), nil +} + +// getStateReply reads a byte slice into a GetStateReply value. +func getStateReply(buf []byte) *GetStateReply { + v := new(GetStateReply) + b := 1 // skip reply determinant + + v.State = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetState +// getStateRequest writes a GetState request to a byte slice. +func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + // IsActiveCookie is a cookie used only for IsActive requests. type IsActiveCookie struct { *xgb.Cookie @@ -684,3 +589,98 @@ func queryScreensRequest(c *xgb.Conn) []byte { return buf } + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + if _, ok := c.Extensions["XINERAMA"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c, Major, Minor), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Major uint16 + Minor uint16 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = xgb.Get16(buf[b:]) + b += 2 + + v.Minor = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINERAMA"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Major + b += 1 + + buf[b] = Minor + b += 1 + + return buf +} diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 0637653..c5a799d 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xinput.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,348 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -const ( - ValuatorModeRelative = 0 - ValuatorModeAbsolute = 1 -) - -const ( - PropagateModeAddToList = 0 - PropagateModeDeleteFromList = 1 -) - -const ( - DeviceUseIsXPointer = 0 - DeviceUseIsXKeyboard = 1 - DeviceUseIsXExtensionDevice = 2 - DeviceUseIsXExtensionKeyboard = 3 - DeviceUseIsXExtensionPointer = 4 -) - -const ( - InputClassKey = 0 - InputClassButton = 1 - InputClassValuator = 2 - InputClassFeedback = 3 - InputClassProximity = 4 - InputClassFocus = 5 - InputClassOther = 6 -) - -const ( - DeviceInputModeAsyncThisDevice = 0 - DeviceInputModeSyncThisDevice = 1 - DeviceInputModeReplayThisDevice = 2 - DeviceInputModeAsyncOtherDevices = 3 - DeviceInputModeAsyncAll = 4 - DeviceInputModeSyncAll = 5 -) - -const ( - FeedbackClassKeyboard = 0 - FeedbackClassPointer = 1 - FeedbackClassString = 2 - FeedbackClassInteger = 3 - FeedbackClassLed = 4 - FeedbackClassBell = 5 -) - -type KeyCode byte - -type EventClass uint32 - -type DeviceInfo struct { - DeviceType xproto.Atom - DeviceId byte - NumClassInfo byte - DeviceUse byte - // padding: 1 bytes -} - -// DeviceInfoRead reads a byte slice into a DeviceInfo value. -func DeviceInfoRead(buf []byte, v *DeviceInfo) int { - b := 0 - - v.DeviceType = xproto.Atom(xgb.Get32(buf[b:])) - b += 4 - - v.DeviceId = buf[b] - b += 1 - - v.NumClassInfo = buf[b] - b += 1 - - v.DeviceUse = buf[b] - b += 1 - - b += 1 // padding - - return b -} - -// DeviceInfoReadList reads a byte slice into a list of DeviceInfo values. -func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceInfo{} - b += DeviceInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceInfo value to a byte slice. -func (v DeviceInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.DeviceType)) - b += 4 - - buf[b] = v.DeviceId - b += 1 - - buf[b] = v.NumClassInfo - b += 1 - - buf[b] = v.DeviceUse - b += 1 - - b += 1 // padding - - return buf -} - -// DeviceInfoListBytes writes a list of DeviceInfo values to a byte slice. -func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type InputInfo struct { - ClassId byte - Len byte -} - -// InputInfoRead reads a byte slice into a InputInfo value. -func InputInfoRead(buf []byte, v *InputInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - return b -} - -// InputInfoReadList reads a byte slice into a list of InputInfo values. -func InputInfoReadList(buf []byte, dest []InputInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = InputInfo{} - b += InputInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a InputInfo value to a byte slice. -func (v InputInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - return buf -} - -// InputInfoListBytes writes a list of InputInfo values to a byte slice. -func InputInfoListBytes(buf []byte, list []InputInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type KeyInfo struct { - ClassId byte - Len byte - MinKeycode KeyCode - MaxKeycode KeyCode - NumKeys uint16 - // padding: 2 bytes -} - -// KeyInfoRead reads a byte slice into a KeyInfo value. -func KeyInfoRead(buf []byte, v *KeyInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.MinKeycode = KeyCode(buf[b]) - b += 1 - - v.MaxKeycode = KeyCode(buf[b]) - b += 1 - - v.NumKeys = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return b -} - -// KeyInfoReadList reads a byte slice into a list of KeyInfo values. -func KeyInfoReadList(buf []byte, dest []KeyInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KeyInfo{} - b += KeyInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KeyInfo value to a byte slice. -func (v KeyInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = byte(v.MinKeycode) - b += 1 - - buf[b] = byte(v.MaxKeycode) - b += 1 - - xgb.Put16(buf[b:], v.NumKeys) - b += 2 - - b += 2 // padding - - return buf -} - -// KeyInfoListBytes writes a list of KeyInfo values to a byte slice. -func KeyInfoListBytes(buf []byte, list []KeyInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type ButtonInfo struct { - ClassId byte - Len byte - NumButtons uint16 -} - -// ButtonInfoRead reads a byte slice into a ButtonInfo value. -func ButtonInfoRead(buf []byte, v *ButtonInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumButtons = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// ButtonInfoReadList reads a byte slice into a list of ButtonInfo values. -func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ButtonInfo{} - b += ButtonInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ButtonInfo value to a byte slice. -func (v ButtonInfo) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - xgb.Put16(buf[b:], v.NumButtons) - b += 2 - - return buf -} - -// ButtonInfoListBytes writes a list of ButtonInfo values to a byte slice. -func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type AxisInfo struct { Resolution uint32 Minimum int32 @@ -443,1256 +101,6 @@ func AxisInfoListBytes(buf []byte, list []AxisInfo) int { return b } -type ValuatorInfo struct { - ClassId byte - Len byte - AxesLen byte - Mode byte - MotionSize uint32 - Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) -} - -// ValuatorInfoRead reads a byte slice into a ValuatorInfo value. -func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.AxesLen = buf[b] - b += 1 - - v.Mode = buf[b] - b += 1 - - v.MotionSize = xgb.Get32(buf[b:]) - b += 4 - - v.Axes = make([]AxisInfo, v.AxesLen) - b += AxisInfoReadList(buf[b:], v.Axes) - - return b -} - -// ValuatorInfoReadList reads a byte slice into a list of ValuatorInfo values. -func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ValuatorInfo{} - b += ValuatorInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ValuatorInfo value to a byte slice. -func (v ValuatorInfo) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.AxesLen - b += 1 - - buf[b] = v.Mode - b += 1 - - xgb.Put32(buf[b:], v.MotionSize) - b += 4 - - b += AxisInfoListBytes(buf[b:], v.Axes) - - return buf -} - -// ValuatorInfoListBytes writes a list of ValuatorInfo values to a byte slice. -func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. -func ValuatorInfoListSize(list []ValuatorInfo) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.AxesLen) * 12))) - } - return size -} - -type InputClassInfo struct { - ClassId byte - EventTypeBase byte -} - -// InputClassInfoRead reads a byte slice into a InputClassInfo value. -func InputClassInfoRead(buf []byte, v *InputClassInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.EventTypeBase = buf[b] - b += 1 - - return b -} - -// InputClassInfoReadList reads a byte slice into a list of InputClassInfo values. -func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = InputClassInfo{} - b += InputClassInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a InputClassInfo value to a byte slice. -func (v InputClassInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.EventTypeBase - b += 1 - - return buf -} - -// InputClassInfoListBytes writes a list of InputClassInfo values to a byte slice. -func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DeviceTimeCoord struct { - Time xproto.Timestamp -} - -// DeviceTimeCoordRead reads a byte slice into a DeviceTimeCoord value. -func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { - b := 0 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// DeviceTimeCoordReadList reads a byte slice into a list of DeviceTimeCoord values. -func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceTimeCoord{} - b += DeviceTimeCoordRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceTimeCoord value to a byte slice. -func (v DeviceTimeCoord) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - return buf -} - -// DeviceTimeCoordListBytes writes a list of DeviceTimeCoord values to a byte slice. -func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type FeedbackState struct { - ClassId byte - Id byte - Len uint16 -} - -// FeedbackStateRead reads a byte slice into a FeedbackState value. -func FeedbackStateRead(buf []byte, v *FeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// FeedbackStateReadList reads a byte slice into a list of FeedbackState values. -func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = FeedbackState{} - b += FeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a FeedbackState value to a byte slice. -func (v FeedbackState) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// FeedbackStateListBytes writes a list of FeedbackState values to a byte slice. -func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type KbdFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Pitch uint16 - Duration uint16 - LedMask uint32 - LedValues uint32 - GlobalAutoRepeat bool - Click byte - Percent byte - // padding: 1 bytes - AutoRepeats []byte // size: 32 -} - -// KbdFeedbackStateRead reads a byte slice into a KbdFeedbackState value. -func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Pitch = xgb.Get16(buf[b:]) - b += 2 - - v.Duration = xgb.Get16(buf[b:]) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - if buf[b] == 1 { - v.GlobalAutoRepeat = true - } else { - v.GlobalAutoRepeat = false - } - b += 1 - - v.Click = buf[b] - b += 1 - - v.Percent = buf[b] - b += 1 - - b += 1 // padding - - v.AutoRepeats = make([]byte, 32) - copy(v.AutoRepeats[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return b -} - -// KbdFeedbackStateReadList reads a byte slice into a list of KbdFeedbackState values. -func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KbdFeedbackState{} - b += KbdFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KbdFeedbackState value to a byte slice. -func (v KbdFeedbackState) Bytes() []byte { - buf := make([]byte, 52) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put16(buf[b:], v.Pitch) - b += 2 - - xgb.Put16(buf[b:], v.Duration) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - if v.GlobalAutoRepeat { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = v.Click - b += 1 - - buf[b] = v.Percent - b += 1 - - b += 1 // padding - - copy(buf[b:], v.AutoRepeats[:32]) - b += xgb.Pad(int(32)) - - return buf -} - -// KbdFeedbackStateListBytes writes a list of KbdFeedbackState values to a byte slice. -func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. -func KbdFeedbackStateListSize(list []KbdFeedbackState) int { - size := 0 - for _ = range list { - size += 52 - } - return size -} - -type PtrFeedbackState struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - AccelNum uint16 - AccelDenom uint16 - Threshold uint16 -} - -// PtrFeedbackStateRead reads a byte slice into a PtrFeedbackState value. -func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.AccelNum = xgb.Get16(buf[b:]) - b += 2 - - v.AccelDenom = xgb.Get16(buf[b:]) - b += 2 - - v.Threshold = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// PtrFeedbackStateReadList reads a byte slice into a list of PtrFeedbackState values. -func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = PtrFeedbackState{} - b += PtrFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a PtrFeedbackState value to a byte slice. -func (v PtrFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], v.AccelNum) - b += 2 - - xgb.Put16(buf[b:], v.AccelDenom) - b += 2 - - xgb.Put16(buf[b:], v.Threshold) - b += 2 - - return buf -} - -// PtrFeedbackStateListBytes writes a list of PtrFeedbackState values to a byte slice. -func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type IntegerFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Resolution uint32 - MinValue int32 - MaxValue int32 -} - -// IntegerFeedbackStateRead reads a byte slice into a IntegerFeedbackState value. -func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Resolution = xgb.Get32(buf[b:]) - b += 4 - - v.MinValue = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxValue = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// IntegerFeedbackStateReadList reads a byte slice into a list of IntegerFeedbackState values. -func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = IntegerFeedbackState{} - b += IntegerFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a IntegerFeedbackState value to a byte slice. -func (v IntegerFeedbackState) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.Resolution) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MinValue)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxValue)) - b += 4 - - return buf -} - -// IntegerFeedbackStateListBytes writes a list of IntegerFeedbackState values to a byte slice. -func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type StringFeedbackState struct { - ClassId byte - Id byte - Len uint16 - MaxSymbols uint16 - NumKeysyms uint16 - Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) -} - -// StringFeedbackStateRead reads a byte slice into a StringFeedbackState value. -func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.MaxSymbols = xgb.Get16(buf[b:]) - b += 2 - - v.NumKeysyms = xgb.Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// StringFeedbackStateReadList reads a byte slice into a list of StringFeedbackState values. -func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = StringFeedbackState{} - b += StringFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a StringFeedbackState value to a byte slice. -func (v StringFeedbackState) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put16(buf[b:], v.MaxSymbols) - b += 2 - - xgb.Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - xgb.Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// StringFeedbackStateListBytes writes a list of StringFeedbackState values to a byte slice. -func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. -func StringFeedbackStateListSize(list []StringFeedbackState) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) - } - return size -} - -type BellFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Percent byte - // padding: 3 bytes - Pitch uint16 - Duration uint16 -} - -// BellFeedbackStateRead reads a byte slice into a BellFeedbackState value. -func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Percent = buf[b] - b += 1 - - b += 3 // padding - - v.Pitch = xgb.Get16(buf[b:]) - b += 2 - - v.Duration = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// BellFeedbackStateReadList reads a byte slice into a list of BellFeedbackState values. -func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = BellFeedbackState{} - b += BellFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a BellFeedbackState value to a byte slice. -func (v BellFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Percent - b += 1 - - b += 3 // padding - - xgb.Put16(buf[b:], v.Pitch) - b += 2 - - xgb.Put16(buf[b:], v.Duration) - b += 2 - - return buf -} - -// BellFeedbackStateListBytes writes a list of BellFeedbackState values to a byte slice. -func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type LedFeedbackState struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 -} - -// LedFeedbackStateRead reads a byte slice into a LedFeedbackState value. -func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// LedFeedbackStateReadList reads a byte slice into a list of LedFeedbackState values. -func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = LedFeedbackState{} - b += LedFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a LedFeedbackState value to a byte slice. -func (v LedFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// LedFeedbackStateListBytes writes a list of LedFeedbackState values to a byte slice. -func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type FeedbackCtl struct { - ClassId byte - Id byte - Len uint16 -} - -// FeedbackCtlRead reads a byte slice into a FeedbackCtl value. -func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// FeedbackCtlReadList reads a byte slice into a list of FeedbackCtl values. -func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = FeedbackCtl{} - b += FeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a FeedbackCtl value to a byte slice. -func (v FeedbackCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// FeedbackCtlListBytes writes a list of FeedbackCtl values to a byte slice. -func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type KbdFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - Key KeyCode - AutoRepeatMode byte - KeyClickPercent int8 - BellPercent int8 - BellPitch int16 - BellDuration int16 - LedMask uint32 - LedValues uint32 -} - -// KbdFeedbackCtlRead reads a byte slice into a KbdFeedbackCtl value. -func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Key = KeyCode(buf[b]) - b += 1 - - v.AutoRepeatMode = buf[b] - b += 1 - - v.KeyClickPercent = int8(buf[b]) - b += 1 - - v.BellPercent = int8(buf[b]) - b += 1 - - v.BellPitch = int16(xgb.Get16(buf[b:])) - b += 2 - - v.BellDuration = int16(xgb.Get16(buf[b:])) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// KbdFeedbackCtlReadList reads a byte slice into a list of KbdFeedbackCtl values. -func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KbdFeedbackCtl{} - b += KbdFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KbdFeedbackCtl value to a byte slice. -func (v KbdFeedbackCtl) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = byte(v.Key) - b += 1 - - buf[b] = v.AutoRepeatMode - b += 1 - - buf[b] = byte(v.KeyClickPercent) - b += 1 - - buf[b] = byte(v.BellPercent) - b += 1 - - xgb.Put16(buf[b:], uint16(v.BellPitch)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.BellDuration)) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// KbdFeedbackCtlListBytes writes a list of KbdFeedbackCtl values to a byte slice. -func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type PtrFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - Num int16 - Denom int16 - Threshold int16 -} - -// PtrFeedbackCtlRead reads a byte slice into a PtrFeedbackCtl value. -func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Num = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Denom = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Threshold = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// PtrFeedbackCtlReadList reads a byte slice into a list of PtrFeedbackCtl values. -func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = PtrFeedbackCtl{} - b += PtrFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a PtrFeedbackCtl value to a byte slice. -func (v PtrFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], uint16(v.Num)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Denom)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Threshold)) - b += 2 - - return buf -} - -// PtrFeedbackCtlListBytes writes a list of PtrFeedbackCtl values to a byte slice. -func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type IntegerFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - IntToDisplay int32 -} - -// IntegerFeedbackCtlRead reads a byte slice into a IntegerFeedbackCtl value. -func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.IntToDisplay = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// IntegerFeedbackCtlReadList reads a byte slice into a list of IntegerFeedbackCtl values. -func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = IntegerFeedbackCtl{} - b += IntegerFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a IntegerFeedbackCtl value to a byte slice. -func (v IntegerFeedbackCtl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], uint32(v.IntToDisplay)) - b += 4 - - return buf -} - -// IntegerFeedbackCtlListBytes writes a list of IntegerFeedbackCtl values to a byte slice. -func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type StringFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - NumKeysyms uint16 - Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) -} - -// StringFeedbackCtlRead reads a byte slice into a StringFeedbackCtl value. -func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.NumKeysyms = xgb.Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// StringFeedbackCtlReadList reads a byte slice into a list of StringFeedbackCtl values. -func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = StringFeedbackCtl{} - b += StringFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a StringFeedbackCtl value to a byte slice. -func (v StringFeedbackCtl) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - xgb.Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// StringFeedbackCtlListBytes writes a list of StringFeedbackCtl values to a byte slice. -func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. -func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) - } - return size -} - type BellFeedbackCtl struct { ClassId byte Id byte @@ -1780,16 +188,18 @@ func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { return b } -type LedFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 +type BellFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Percent byte + // padding: 3 bytes + Pitch uint16 + Duration uint16 } -// LedFeedbackCtlRead reads a byte slice into a LedFeedbackCtl value. -func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { +// BellFeedbackStateRead reads a byte slice into a BellFeedbackState value. +func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { b := 0 v.ClassId = buf[b] @@ -1801,27 +211,32 @@ func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { v.Len = xgb.Get16(buf[b:]) b += 2 - v.LedMask = xgb.Get32(buf[b:]) - b += 4 + v.Percent = buf[b] + b += 1 - v.LedValues = xgb.Get32(buf[b:]) - b += 4 + b += 3 // padding + + v.Pitch = xgb.Get16(buf[b:]) + b += 2 + + v.Duration = xgb.Get16(buf[b:]) + b += 2 return b } -// LedFeedbackCtlReadList reads a byte slice into a list of LedFeedbackCtl values. -func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { +// BellFeedbackStateReadList reads a byte slice into a list of BellFeedbackState values. +func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = LedFeedbackCtl{} - b += LedFeedbackCtlRead(buf[b:], &dest[i]) + dest[i] = BellFeedbackState{} + b += BellFeedbackStateRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a LedFeedbackCtl value to a byte slice. -func (v LedFeedbackCtl) Bytes() []byte { +// Bytes writes a BellFeedbackState value to a byte slice. +func (v BellFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1834,17 +249,22 @@ func (v LedFeedbackCtl) Bytes() []byte { xgb.Put16(buf[b:], v.Len) b += 2 - xgb.Put32(buf[b:], v.LedMask) - b += 4 + buf[b] = v.Percent + b += 1 - xgb.Put32(buf[b:], v.LedValues) - b += 4 + b += 3 // padding + + xgb.Put16(buf[b:], v.Pitch) + b += 2 + + xgb.Put16(buf[b:], v.Duration) + b += 2 return buf } -// LedFeedbackCtlListBytes writes a list of LedFeedbackCtl values to a byte slice. -func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { +// BellFeedbackStateListBytes writes a list of BellFeedbackState values to a byte slice. +func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { b := 0 var structBytes []byte for _, item := range list { @@ -1855,14 +275,14 @@ func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { return b } -type InputState struct { - ClassId byte - Len byte - NumItems byte +type ButtonInfo struct { + ClassId byte + Len byte + NumButtons uint16 } -// InputStateRead reads a byte slice into a InputState value. -func InputStateRead(buf []byte, v *InputState) int { +// ButtonInfoRead reads a byte slice into a ButtonInfo value. +func ButtonInfoRead(buf []byte, v *ButtonInfo) int { b := 0 v.ClassId = buf[b] @@ -1871,25 +291,25 @@ func InputStateRead(buf []byte, v *InputState) int { v.Len = buf[b] b += 1 - v.NumItems = buf[b] - b += 1 + v.NumButtons = xgb.Get16(buf[b:]) + b += 2 return b } -// InputStateReadList reads a byte slice into a list of InputState values. -func InputStateReadList(buf []byte, dest []InputState) int { +// ButtonInfoReadList reads a byte slice into a list of ButtonInfo values. +func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = InputState{} - b += InputStateRead(buf[b:], &dest[i]) + dest[i] = ButtonInfo{} + b += ButtonInfoRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a InputState value to a byte slice. -func (v InputState) Bytes() []byte { - buf := make([]byte, 3) +// Bytes writes a ButtonInfo value to a byte slice. +func (v ButtonInfo) Bytes() []byte { + buf := make([]byte, 4) b := 0 buf[b] = v.ClassId @@ -1898,14 +318,14 @@ func (v InputState) Bytes() []byte { buf[b] = v.Len b += 1 - buf[b] = v.NumItems - b += 1 + xgb.Put16(buf[b:], v.NumButtons) + b += 2 return buf } -// InputStateListBytes writes a list of InputState values to a byte slice. -func InputStateListBytes(buf []byte, list []InputState) int { +// ButtonInfoListBytes writes a list of ButtonInfo values to a byte slice. +func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { b := 0 var structBytes []byte for _, item := range list { @@ -1916,89 +336,6 @@ func InputStateListBytes(buf []byte, list []InputState) int { return b } -type KeyState struct { - ClassId byte - Len byte - NumKeys byte - // padding: 1 bytes - Keys []byte // size: 32 -} - -// KeyStateRead reads a byte slice into a KeyState value. -func KeyStateRead(buf []byte, v *KeyState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumKeys = buf[b] - b += 1 - - b += 1 // padding - - v.Keys = make([]byte, 32) - copy(v.Keys[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return b -} - -// KeyStateReadList reads a byte slice into a list of KeyState values. -func KeyStateReadList(buf []byte, dest []KeyState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KeyState{} - b += KeyStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KeyState value to a byte slice. -func (v KeyState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumKeys - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Keys[:32]) - b += xgb.Pad(int(32)) - - return buf -} - -// KeyStateListBytes writes a list of KeyState values to a byte slice. -func KeyStateListBytes(buf []byte, list []KeyState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// KeyStateListSize computes the size (bytes) of a list of KeyState values. -func KeyStateListSize(list []KeyState) int { - size := 0 - for _ = range list { - size += 36 - } - return size -} - type ButtonState struct { ClassId byte Len byte @@ -2082,104 +419,190 @@ func ButtonStateListSize(list []ButtonState) int { return size } -type ValuatorState struct { - ClassId byte - Len byte - NumValuators byte - Mode byte - Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +// ChangeDeviceNotify is the event number for a ChangeDeviceNotifyEvent. +const ChangeDeviceNotify = 12 + +type ChangeDeviceNotifyEvent struct { + Sequence uint16 + DeviceId byte + Time xproto.Timestamp + Request byte + // padding: 23 bytes } -// ValuatorStateRead reads a byte slice into a ValuatorState value. -func ValuatorStateRead(buf []byte, v *ValuatorState) int { - b := 0 +// ChangeDeviceNotifyEventNew constructs a ChangeDeviceNotifyEvent value that implements xgb.Event from a byte slice. +func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { + v := ChangeDeviceNotifyEvent{} + b := 1 // don't read event number - v.ClassId = buf[b] + v.DeviceId = buf[b] b += 1 - v.Len = buf[b] + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Request = buf[b] b += 1 - v.NumValuators = buf[b] - b += 1 + b += 23 // padding - v.Mode = buf[b] - b += 1 - - v.Valuators = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.Valuators[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b + return v } -// ValuatorStateReadList reads a byte slice into a list of ValuatorState values. -func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ValuatorState{} - b += ValuatorStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ValuatorState value to a byte slice. -func (v ValuatorState) Bytes() []byte { - buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) +// Bytes writes a ChangeDeviceNotifyEvent value to a byte slice. +func (v ChangeDeviceNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) b := 0 - buf[b] = v.ClassId + // write event number + buf[b] = 12 b += 1 - buf[b] = v.Len + buf[b] = v.DeviceId b += 1 - buf[b] = v.NumValuators + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + buf[b] = v.Request b += 1 - buf[b] = v.Mode - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.Valuators[i]) - b += 4 - } - b = xgb.Pad(b) + b += 23 // padding return buf } -// ValuatorStateListBytes writes a list of ValuatorState values to a byte slice. -func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b +// SequenceId returns the sequence id attached to the ChangeDeviceNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { + return v.Sequence } -// ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. -func ValuatorStateListSize(list []ValuatorState) int { - size := 0 - for _, item := range list { - size += (4 + xgb.Pad((int(item.NumValuators) * 4))) - } - return size +// String is a rudimentary string representation of ChangeDeviceNotifyEvent. +func (v ChangeDeviceNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + return "ChangeDeviceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } -type DeviceState struct { +func init() { + xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew +} + +// BadClass is the error number for a BadClass. +const BadClass = 4 + +type ClassError struct { + Sequence uint16 + NiceName string +} + +// ClassErrorNew constructs a ClassError value that implements xgb.Error from a byte slice. +func ClassErrorNew(buf []byte) xgb.Error { + v := ClassError{} + v.NiceName = "Class" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadClass error. +// This is mostly used internally. +func (err ClassError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadClass error. If no bad value exists, 0 is returned. +func (err ClassError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadClass error. + +func (err ClassError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadClass {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew +} + +// BadDevice is the error number for a BadDevice. +const BadDevice = 0 + +type DeviceError struct { + Sequence uint16 + NiceName string +} + +// DeviceErrorNew constructs a DeviceError value that implements xgb.Error from a byte slice. +func DeviceErrorNew(buf []byte) xgb.Error { + v := DeviceError{} + v.NiceName = "Device" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadDevice error. +// This is mostly used internally. +func (err DeviceError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadDevice error. If no bad value exists, 0 is returned. +func (err DeviceError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadDevice error. + +func (err DeviceError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadDevice {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew +} + +type DeviceAbsAreaCtrl struct { ControlId uint16 Len uint16 + OffsetX uint32 + OffsetY uint32 + Width int32 + Height int32 + Screen int32 + Following uint32 } -// DeviceStateRead reads a byte slice into a DeviceState value. -func DeviceStateRead(buf []byte, v *DeviceState) int { +// DeviceAbsAreaCtrlRead reads a byte slice into a DeviceAbsAreaCtrl value. +func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { b := 0 v.ControlId = xgb.Get16(buf[b:]) @@ -2188,22 +611,40 @@ func DeviceStateRead(buf []byte, v *DeviceState) int { v.Len = xgb.Get16(buf[b:]) b += 2 + v.OffsetX = xgb.Get32(buf[b:]) + b += 4 + + v.OffsetY = xgb.Get32(buf[b:]) + b += 4 + + v.Width = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Height = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Screen = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Following = xgb.Get32(buf[b:]) + b += 4 + return b } -// DeviceStateReadList reads a byte slice into a list of DeviceState values. -func DeviceStateReadList(buf []byte, dest []DeviceState) int { +// DeviceAbsAreaCtrlReadList reads a byte slice into a list of DeviceAbsAreaCtrl values. +func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = DeviceState{} - b += DeviceStateRead(buf[b:], &dest[i]) + dest[i] = DeviceAbsAreaCtrl{} + b += DeviceAbsAreaCtrlRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a DeviceState value to a byte slice. -func (v DeviceState) Bytes() []byte { - buf := make([]byte, 4) +// Bytes writes a DeviceAbsAreaCtrl value to a byte slice. +func (v DeviceAbsAreaCtrl) Bytes() []byte { + buf := make([]byte, 28) b := 0 xgb.Put16(buf[b:], v.ControlId) @@ -2212,233 +653,29 @@ func (v DeviceState) Bytes() []byte { xgb.Put16(buf[b:], v.Len) b += 2 - return buf -} - -// DeviceStateListBytes writes a list of DeviceState values to a byte slice. -func DeviceStateListBytes(buf []byte, list []DeviceState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DeviceResolutionState struct { - ControlId uint16 - Len uint16 - NumValuators uint32 - ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) - ResolutionMin []uint32 // size: xgb.Pad((int(NumValuators) * 4)) - ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) -} - -// DeviceResolutionStateRead reads a byte slice into a DeviceResolutionState value. -func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.NumValuators = xgb.Get32(buf[b:]) + xgb.Put32(buf[b:], v.OffsetX) b += 4 - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.ResolutionMin = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMin[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.ResolutionMax = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMax[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// DeviceResolutionStateReadList reads a byte slice into a list of DeviceResolutionState values. -func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceResolutionState{} - b += DeviceResolutionStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceResolutionState value to a byte slice. -func (v DeviceResolutionState) Bytes() []byte { - buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.NumValuators) + xgb.Put32(buf[b:], v.OffsetY) b += 4 - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = xgb.Pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionMin[i]) - b += 4 - } - b = xgb.Pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionMax[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DeviceResolutionStateListBytes writes a list of DeviceResolutionState values to a byte slice. -func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. -func DeviceResolutionStateListSize(list []DeviceResolutionState) int { - size := 0 - for _, item := range list { - size += (((8 + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) - } - return size -} - -type DeviceAbsCalibState struct { - ControlId uint16 - Len uint16 - MinX int32 - MaxX int32 - MinY int32 - MaxY int32 - FlipX uint32 - FlipY uint32 - Rotation uint32 - ButtonThreshold uint32 -} - -// DeviceAbsCalibStateRead reads a byte slice into a DeviceAbsCalibState value. -func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.MinX = int32(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], uint32(v.Width)) b += 4 - v.MaxX = int32(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], uint32(v.Height)) b += 4 - v.MinY = int32(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], uint32(v.Screen)) b += 4 - v.MaxY = int32(xgb.Get32(buf[b:])) - b += 4 - - v.FlipX = xgb.Get32(buf[b:]) - b += 4 - - v.FlipY = xgb.Get32(buf[b:]) - b += 4 - - v.Rotation = xgb.Get32(buf[b:]) - b += 4 - - v.ButtonThreshold = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DeviceAbsCalibStateReadList reads a byte slice into a list of DeviceAbsCalibState values. -func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsCalibState{} - b += DeviceAbsCalibStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceAbsCalibState value to a byte slice. -func (v DeviceAbsCalibState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], uint32(v.MinX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MinY)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxY)) - b += 4 - - xgb.Put32(buf[b:], v.FlipX) - b += 4 - - xgb.Put32(buf[b:], v.FlipY) - b += 4 - - xgb.Put32(buf[b:], v.Rotation) - b += 4 - - xgb.Put32(buf[b:], v.ButtonThreshold) + xgb.Put32(buf[b:], v.Following) b += 4 return buf } -// DeviceAbsCalibStateListBytes writes a list of DeviceAbsCalibState values to a byte slice. -func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { +// DeviceAbsAreaCtrlListBytes writes a list of DeviceAbsAreaCtrl values to a byte slice. +func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { b := 0 var structBytes []byte for _, item := range list { @@ -2545,290 +782,6 @@ func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { return b } -type DeviceCoreState struct { - ControlId uint16 - Len uint16 - Status byte - Iscore byte - // padding: 2 bytes -} - -// DeviceCoreStateRead reads a byte slice into a DeviceCoreState value. -func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Status = buf[b] - b += 1 - - v.Iscore = buf[b] - b += 1 - - b += 2 // padding - - return b -} - -// DeviceCoreStateReadList reads a byte slice into a list of DeviceCoreState values. -func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceCoreState{} - b += DeviceCoreStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceCoreState value to a byte slice. -func (v DeviceCoreState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Status - b += 1 - - buf[b] = v.Iscore - b += 1 - - b += 2 // padding - - return buf -} - -// DeviceCoreStateListBytes writes a list of DeviceCoreState values to a byte slice. -func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DeviceEnableState struct { - ControlId uint16 - Len uint16 - Enable byte - // padding: 3 bytes -} - -// DeviceEnableStateRead reads a byte slice into a DeviceEnableState value. -func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Enable = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// DeviceEnableStateReadList reads a byte slice into a list of DeviceEnableState values. -func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceEnableState{} - b += DeviceEnableStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceEnableState value to a byte slice. -func (v DeviceEnableState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Enable - b += 1 - - b += 3 // padding - - return buf -} - -// DeviceEnableStateListBytes writes a list of DeviceEnableState values to a byte slice. -func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DeviceCtl struct { - ControlId uint16 - Len uint16 -} - -// DeviceCtlRead reads a byte slice into a DeviceCtl value. -func DeviceCtlRead(buf []byte, v *DeviceCtl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// DeviceCtlReadList reads a byte slice into a list of DeviceCtl values. -func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceCtl{} - b += DeviceCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceCtl value to a byte slice. -func (v DeviceCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// DeviceCtlListBytes writes a list of DeviceCtl values to a byte slice. -func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DeviceResolutionCtl struct { - ControlId uint16 - Len uint16 - FirstValuator byte - NumValuators byte - ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) -} - -// DeviceResolutionCtlRead reads a byte slice into a DeviceResolutionCtl value. -func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.FirstValuator = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// DeviceResolutionCtlReadList reads a byte slice into a list of DeviceResolutionCtl values. -func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceResolutionCtl{} - b += DeviceResolutionCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceResolutionCtl value to a byte slice. -func (v DeviceResolutionCtl) Bytes() []byte { - buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.FirstValuator - b += 1 - - buf[b] = v.NumValuators - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DeviceResolutionCtlListBytes writes a list of DeviceResolutionCtl values to a byte slice. -func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. -func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { - size := 0 - for _, item := range list { - size += (6 + xgb.Pad((int(item.NumValuators) * 4))) - } - return size -} - type DeviceAbsCalibCtl struct { ControlId uint16 Len uint16 @@ -2939,19 +892,21 @@ func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { return b } -type DeviceAbsAreaCtrl struct { - ControlId uint16 - Len uint16 - OffsetX uint32 - OffsetY uint32 - Width int32 - Height int32 - Screen int32 - Following uint32 +type DeviceAbsCalibState struct { + ControlId uint16 + Len uint16 + MinX int32 + MaxX int32 + MinY int32 + MaxY int32 + FlipX uint32 + FlipY uint32 + Rotation uint32 + ButtonThreshold uint32 } -// DeviceAbsAreaCtrlRead reads a byte slice into a DeviceAbsAreaCtrl value. -func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { +// DeviceAbsCalibStateRead reads a byte slice into a DeviceAbsCalibState value. +func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { b := 0 v.ControlId = xgb.Get16(buf[b:]) @@ -2960,40 +915,46 @@ func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { v.Len = xgb.Get16(buf[b:]) b += 2 - v.OffsetX = xgb.Get32(buf[b:]) + v.MinX = int32(xgb.Get32(buf[b:])) b += 4 - v.OffsetY = xgb.Get32(buf[b:]) + v.MaxX = int32(xgb.Get32(buf[b:])) b += 4 - v.Width = int32(xgb.Get32(buf[b:])) + v.MinY = int32(xgb.Get32(buf[b:])) b += 4 - v.Height = int32(xgb.Get32(buf[b:])) + v.MaxY = int32(xgb.Get32(buf[b:])) b += 4 - v.Screen = int32(xgb.Get32(buf[b:])) + v.FlipX = xgb.Get32(buf[b:]) b += 4 - v.Following = xgb.Get32(buf[b:]) + v.FlipY = xgb.Get32(buf[b:]) + b += 4 + + v.Rotation = xgb.Get32(buf[b:]) + b += 4 + + v.ButtonThreshold = xgb.Get32(buf[b:]) b += 4 return b } -// DeviceAbsAreaCtrlReadList reads a byte slice into a list of DeviceAbsAreaCtrl values. -func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { +// DeviceAbsCalibStateReadList reads a byte slice into a list of DeviceAbsCalibState values. +func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsAreaCtrl{} - b += DeviceAbsAreaCtrlRead(buf[b:], &dest[i]) + dest[i] = DeviceAbsCalibState{} + b += DeviceAbsCalibStateRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a DeviceAbsAreaCtrl value to a byte slice. -func (v DeviceAbsAreaCtrl) Bytes() []byte { - buf := make([]byte, 28) +// Bytes writes a DeviceAbsCalibState value to a byte slice. +func (v DeviceAbsCalibState) Bytes() []byte { + buf := make([]byte, 36) b := 0 xgb.Put16(buf[b:], v.ControlId) @@ -3002,29 +963,35 @@ func (v DeviceAbsAreaCtrl) Bytes() []byte { xgb.Put16(buf[b:], v.Len) b += 2 - xgb.Put32(buf[b:], v.OffsetX) + xgb.Put32(buf[b:], uint32(v.MinX)) b += 4 - xgb.Put32(buf[b:], v.OffsetY) + xgb.Put32(buf[b:], uint32(v.MaxX)) b += 4 - xgb.Put32(buf[b:], uint32(v.Width)) + xgb.Put32(buf[b:], uint32(v.MinY)) b += 4 - xgb.Put32(buf[b:], uint32(v.Height)) + xgb.Put32(buf[b:], uint32(v.MaxY)) b += 4 - xgb.Put32(buf[b:], uint32(v.Screen)) + xgb.Put32(buf[b:], v.FlipX) b += 4 - xgb.Put32(buf[b:], v.Following) + xgb.Put32(buf[b:], v.FlipY) + b += 4 + + xgb.Put32(buf[b:], v.Rotation) + b += 4 + + xgb.Put32(buf[b:], v.ButtonThreshold) b += 4 return buf } -// DeviceAbsAreaCtrlListBytes writes a list of DeviceAbsAreaCtrl values to a byte slice. -func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { +// DeviceAbsCalibStateListBytes writes a list of DeviceAbsCalibState values to a byte slice. +func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { b := 0 var structBytes []byte for _, item := range list { @@ -3035,6 +1002,206 @@ func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { return b } +// BadDeviceBusy is the error number for a BadDeviceBusy. +const BadDeviceBusy = 3 + +type DeviceBusyError struct { + Sequence uint16 + NiceName string +} + +// DeviceBusyErrorNew constructs a DeviceBusyError value that implements xgb.Error from a byte slice. +func DeviceBusyErrorNew(buf []byte) xgb.Error { + v := DeviceBusyError{} + v.NiceName = "DeviceBusy" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadDeviceBusy error. +// This is mostly used internally. +func (err DeviceBusyError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadDeviceBusy error. If no bad value exists, 0 is returned. +func (err DeviceBusyError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadDeviceBusy error. + +func (err DeviceBusyError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadDeviceBusy {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew +} + +// DeviceButtonPress is the event number for a DeviceButtonPressEvent. +const DeviceButtonPress = 3 + +type DeviceButtonPressEvent DeviceKeyPressEvent + +// DeviceButtonPressEventNew constructs a DeviceButtonPressEvent value that implements xgb.Event from a byte slice. +func DeviceButtonPressEventNew(buf []byte) xgb.Event { + return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +// Bytes writes a DeviceButtonPressEvent value to a byte slice. +func (v DeviceButtonPressEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the DeviceButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceButtonPressEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceButtonPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew +} + +// DeviceButtonRelease is the event number for a DeviceButtonReleaseEvent. +const DeviceButtonRelease = 4 + +type DeviceButtonReleaseEvent DeviceKeyPressEvent + +// DeviceButtonReleaseEventNew constructs a DeviceButtonReleaseEvent value that implements xgb.Event from a byte slice. +func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { + return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +// Bytes writes a DeviceButtonReleaseEvent value to a byte slice. +func (v DeviceButtonReleaseEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the DeviceButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceButtonReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceButtonReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew +} + +// DeviceButtonStateNotify is the event number for a DeviceButtonStateNotifyEvent. +const DeviceButtonStateNotify = 14 + +type DeviceButtonStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Buttons []byte // size: 28 +} + +// DeviceButtonStateNotifyEventNew constructs a DeviceButtonStateNotifyEvent value that implements xgb.Event from a byte slice. +func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { + v := DeviceButtonStateNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Buttons = make([]byte, 28) + copy(v.Buttons[:28], buf[b:]) + b += xgb.Pad(int(28)) + + return v +} + +// Bytes writes a DeviceButtonStateNotifyEvent value to a byte slice. +func (v DeviceButtonStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 14 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Buttons[:28]) + b += xgb.Pad(int(28)) + + return buf +} + +// SequenceId returns the sequence id attached to the DeviceButtonStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of DeviceButtonStateNotifyEvent. +func (v DeviceButtonStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceButtonStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew +} + type DeviceCoreCtrl struct { ControlId uint16 Len uint16 @@ -3101,6 +1268,133 @@ func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { return b } +type DeviceCoreState struct { + ControlId uint16 + Len uint16 + Status byte + Iscore byte + // padding: 2 bytes +} + +// DeviceCoreStateRead reads a byte slice into a DeviceCoreState value. +func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Status = buf[b] + b += 1 + + v.Iscore = buf[b] + b += 1 + + b += 2 // padding + + return b +} + +// DeviceCoreStateReadList reads a byte slice into a list of DeviceCoreState values. +func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceCoreState{} + b += DeviceCoreStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceCoreState value to a byte slice. +func (v DeviceCoreState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Status + b += 1 + + buf[b] = v.Iscore + b += 1 + + b += 2 // padding + + return buf +} + +// DeviceCoreStateListBytes writes a list of DeviceCoreState values to a byte slice. +func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type DeviceCtl struct { + ControlId uint16 + Len uint16 +} + +// DeviceCtlRead reads a byte slice into a DeviceCtl value. +func DeviceCtlRead(buf []byte, v *DeviceCtl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// DeviceCtlReadList reads a byte slice into a list of DeviceCtl values. +func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceCtl{} + b += DeviceCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceCtl value to a byte slice. +func (v DeviceCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// DeviceCtlListBytes writes a list of DeviceCtl values to a byte slice. +func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + type DeviceEnableCtrl struct { ControlId uint16 Len uint16 @@ -3167,102 +1461,154 @@ func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { return b } -// DeviceValuator is the event number for a DeviceValuatorEvent. -const DeviceValuator = 0 - -type DeviceValuatorEvent struct { - Sequence uint16 - DeviceId byte - DeviceState uint16 - NumValuators byte - FirstValuator byte - Valuators []int32 // size: 24 +type DeviceEnableState struct { + ControlId uint16 + Len uint16 + Enable byte + // padding: 3 bytes } -// DeviceValuatorEventNew constructs a DeviceValuatorEvent value that implements xgb.Event from a byte slice. -func DeviceValuatorEventNew(buf []byte) xgb.Event { - v := DeviceValuatorEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.DeviceState = xgb.Get16(buf[b:]) - b += 2 - - v.NumValuators = buf[b] - b += 1 - - v.FirstValuator = buf[b] - b += 1 - - v.Valuators = make([]int32, 6) - for i := 0; i < int(6); i++ { - v.Valuators[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Bytes writes a DeviceValuatorEvent value to a byte slice. -func (v DeviceValuatorEvent) Bytes() []byte { - buf := make([]byte, 32) +// DeviceEnableStateRead reads a byte slice into a DeviceEnableState value. +func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { b := 0 - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - xgb.Put16(buf[b:], v.DeviceState) + v.ControlId = xgb.Get16(buf[b:]) b += 2 - buf[b] = v.NumValuators + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Enable = buf[b] b += 1 - buf[b] = v.FirstValuator - b += 1 + b += 3 // padding - for i := 0; i < int(6); i++ { - xgb.Put32(buf[b:], uint32(v.Valuators[i])) - b += 4 + return b +} + +// DeviceEnableStateReadList reads a byte slice into a list of DeviceEnableState values. +func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceEnableState{} + b += DeviceEnableStateRead(buf[b:], &dest[i]) } - b = xgb.Pad(b) + return xgb.Pad(b) +} + +// Bytes writes a DeviceEnableState value to a byte slice. +func (v DeviceEnableState) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.Enable + b += 1 + + b += 3 // padding return buf } -// SequenceId returns the sequence id attached to the DeviceValuator event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceValuatorEvent) SequenceId() uint16 { - return v.Sequence +// DeviceEnableStateListBytes writes a list of DeviceEnableState values to a byte slice. +func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -// String is a rudimentary string representation of DeviceValuatorEvent. -func (v DeviceValuatorEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceState: %d", v.DeviceState)) - fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) - fieldVals = append(fieldVals, xgb.Sprintf("FirstValuator: %d", v.FirstValuator)) - return "DeviceValuator {" + xgb.StringsJoin(fieldVals, ", ") + "}" +type DeviceInfo struct { + DeviceType xproto.Atom + DeviceId byte + NumClassInfo byte + DeviceUse byte + // padding: 1 bytes } -func init() { - xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew +// DeviceInfoRead reads a byte slice into a DeviceInfo value. +func DeviceInfoRead(buf []byte, v *DeviceInfo) int { + b := 0 + + v.DeviceType = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.DeviceId = buf[b] + b += 1 + + v.NumClassInfo = buf[b] + b += 1 + + v.DeviceUse = buf[b] + b += 1 + + b += 1 // padding + + return b } +// DeviceInfoReadList reads a byte slice into a list of DeviceInfo values. +func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceInfo{} + b += DeviceInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceInfo value to a byte slice. +func (v DeviceInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.DeviceType)) + b += 4 + + buf[b] = v.DeviceId + b += 1 + + buf[b] = v.NumClassInfo + b += 1 + + buf[b] = v.DeviceUse + b += 1 + + b += 1 // padding + + return buf +} + +// DeviceInfoListBytes writes a list of DeviceInfo values to a byte slice. +func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + DeviceInputModeAsyncThisDevice = 0 + DeviceInputModeSyncThisDevice = 1 + DeviceInputModeReplayThisDevice = 2 + DeviceInputModeAsyncOtherDevices = 3 + DeviceInputModeAsyncAll = 4 + DeviceInputModeSyncAll = 5 +) + // DeviceKeyPress is the event number for a DeviceKeyPressEvent. const DeviceKeyPress = 1 @@ -3417,99 +1763,607 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][1] = DeviceKeyPressEventNew } -// FocusIn is the event number for a FocusInEvent. -const FocusIn = 6 +// DeviceKeyRelease is the event number for a DeviceKeyReleaseEvent. +const DeviceKeyRelease = 2 -type FocusInEvent struct { - Sequence uint16 - Detail byte - Time xproto.Timestamp - Window xproto.Window - Mode byte - DeviceId byte - // padding: 18 bytes +type DeviceKeyReleaseEvent DeviceKeyPressEvent + +// DeviceKeyReleaseEventNew constructs a DeviceKeyReleaseEvent value that implements xgb.Event from a byte slice. +func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { + return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } -// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. -func FocusInEventNew(buf []byte) xgb.Event { - v := FocusInEvent{} +// Bytes writes a DeviceKeyReleaseEvent value to a byte slice. +func (v DeviceKeyReleaseEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the DeviceKeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceKeyReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceKeyReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceKeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew +} + +// DeviceKeyStateNotify is the event number for a DeviceKeyStateNotifyEvent. +const DeviceKeyStateNotify = 13 + +type DeviceKeyStateNotifyEvent struct { + Sequence uint16 + DeviceId byte + Keys []byte // size: 28 +} + +// DeviceKeyStateNotifyEventNew constructs a DeviceKeyStateNotifyEvent value that implements xgb.Event from a byte slice. +func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { + v := DeviceKeyStateNotifyEvent{} b := 1 // don't read event number - v.Detail = buf[b] + v.DeviceId = buf[b] b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 + v.Keys = make([]byte, 28) + copy(v.Keys[:28], buf[b:]) + b += xgb.Pad(int(28)) + + return v +} + +// Bytes writes a DeviceKeyStateNotifyEvent value to a byte slice. +func (v DeviceKeyStateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 13 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + copy(buf[b:], v.Keys[:28]) + b += xgb.Pad(int(28)) + + return buf +} + +// SequenceId returns the sequence id attached to the DeviceKeyStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of DeviceKeyStateNotifyEvent. +func (v DeviceKeyStateNotifyEvent) String() string { + fieldVals := make([]string, 0, 2) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceKeyStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew +} + +// DeviceMappingNotify is the event number for a DeviceMappingNotifyEvent. +const DeviceMappingNotify = 11 + +type DeviceMappingNotifyEvent struct { + Sequence uint16 + DeviceId byte + Request byte + FirstKeycode KeyCode + Count byte + // padding: 1 bytes + Time xproto.Timestamp + // padding: 20 bytes +} + +// DeviceMappingNotifyEventNew constructs a DeviceMappingNotifyEvent value that implements xgb.Event from a byte slice. +func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { + v := DeviceMappingNotifyEvent{} + b := 1 // don't read event number + + v.DeviceId = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Request = buf[b] + b += 1 + + v.FirstKeycode = KeyCode(buf[b]) + b += 1 + + v.Count = buf[b] + b += 1 + + b += 1 // padding + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return v +} + +// Bytes writes a DeviceMappingNotifyEvent value to a byte slice. +func (v DeviceMappingNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 11 + b += 1 + + buf[b] = v.DeviceId + b += 1 + + b += 2 // skip sequence number + + buf[b] = v.Request + b += 1 + + buf[b] = byte(v.FirstKeycode) + b += 1 + + buf[b] = v.Count + b += 1 + + b += 1 // padding + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + b += 20 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the DeviceMappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceMappingNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of DeviceMappingNotifyEvent. +func (v DeviceMappingNotifyEvent) String() string { + fieldVals := make([]string, 0, 7) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + return "DeviceMappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew +} + +// DeviceMotionNotify is the event number for a DeviceMotionNotifyEvent. +const DeviceMotionNotify = 5 + +type DeviceMotionNotifyEvent DeviceKeyPressEvent + +// DeviceMotionNotifyEventNew constructs a DeviceMotionNotifyEvent value that implements xgb.Event from a byte slice. +func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { + return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +} + +// Bytes writes a DeviceMotionNotifyEvent value to a byte slice. +func (v DeviceMotionNotifyEvent) Bytes() []byte { + return DeviceKeyPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the DeviceMotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DeviceMotionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v DeviceMotionNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) + return "DeviceMotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew +} + +// DevicePresenceNotify is the event number for a DevicePresenceNotifyEvent. +const DevicePresenceNotify = 15 + +type DevicePresenceNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time xproto.Timestamp + Devchange byte + DeviceId byte + Control uint16 + // padding: 20 bytes +} + +// DevicePresenceNotifyEventNew constructs a DevicePresenceNotifyEvent value that implements xgb.Event from a byte slice. +func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { + v := DevicePresenceNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Window = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Mode = buf[b] + v.Devchange = buf[b] b += 1 v.DeviceId = buf[b] b += 1 - b += 18 // padding + v.Control = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding return v } -// Bytes writes a FocusInEvent value to a byte slice. -func (v FocusInEvent) Bytes() []byte { +// Bytes writes a DevicePresenceNotifyEvent value to a byte slice. +func (v DevicePresenceNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 6 + buf[b] = 15 b += 1 - buf[b] = v.Detail - b += 1 + b += 1 // padding b += 2 // skip sequence number xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - buf[b] = v.Mode + buf[b] = v.Devchange b += 1 buf[b] = v.DeviceId b += 1 - b += 18 // padding + xgb.Put16(buf[b:], v.Control) + b += 2 + + b += 20 // padding return buf } -// SequenceId returns the sequence id attached to the FocusIn event. +// SequenceId returns the sequence id attached to the DevicePresenceNotify event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v FocusInEvent) SequenceId() uint16 { +func (v DevicePresenceNotifyEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of FocusInEvent. -func (v FocusInEvent) String() string { +// String is a rudimentary string representation of DevicePresenceNotifyEvent. +func (v DevicePresenceNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("Devchange: %d", v.Devchange)) fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("Control: %d", v.Control)) + return "DevicePresenceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew + xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew +} + +type DeviceResolutionCtl struct { + ControlId uint16 + Len uint16 + FirstValuator byte + NumValuators byte + ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// DeviceResolutionCtlRead reads a byte slice into a DeviceResolutionCtl value. +func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.FirstValuator = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// DeviceResolutionCtlReadList reads a byte slice into a list of DeviceResolutionCtl values. +func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceResolutionCtl{} + b += DeviceResolutionCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceResolutionCtl value to a byte slice. +func (v DeviceResolutionCtl) Bytes() []byte { + buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = v.FirstValuator + b += 1 + + buf[b] = v.NumValuators + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// DeviceResolutionCtlListBytes writes a list of DeviceResolutionCtl values to a byte slice. +func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. +func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { + size := 0 + for _, item := range list { + size += (6 + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +type DeviceResolutionState struct { + ControlId uint16 + Len uint16 + NumValuators uint32 + ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) + ResolutionMin []uint32 // size: xgb.Pad((int(NumValuators) * 4)) + ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// DeviceResolutionStateRead reads a byte slice into a DeviceResolutionState value. +func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.NumValuators = xgb.Get32(buf[b:]) + b += 4 + + v.ResolutionValues = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionValues[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.ResolutionMin = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMin[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.ResolutionMax = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.ResolutionMax[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// DeviceResolutionStateReadList reads a byte slice into a list of DeviceResolutionState values. +func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceResolutionState{} + b += DeviceResolutionStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceResolutionState value to a byte slice. +func (v DeviceResolutionState) Bytes() []byte { + buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.NumValuators) + b += 4 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionValues[i]) + b += 4 + } + b = xgb.Pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionMin[i]) + b += 4 + } + b = xgb.Pad(b) + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.ResolutionMax[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// DeviceResolutionStateListBytes writes a list of DeviceResolutionState values to a byte slice. +func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. +func DeviceResolutionStateListSize(list []DeviceResolutionState) int { + size := 0 + for _, item := range list { + size += (((8 + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +type DeviceState struct { + ControlId uint16 + Len uint16 +} + +// DeviceStateRead reads a byte slice into a DeviceState value. +func DeviceStateRead(buf []byte, v *DeviceState) int { + b := 0 + + v.ControlId = xgb.Get16(buf[b:]) + b += 2 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// DeviceStateReadList reads a byte slice into a list of DeviceState values. +func DeviceStateReadList(buf []byte, dest []DeviceState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceState{} + b += DeviceStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceState value to a byte slice. +func (v DeviceState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], v.ControlId) + b += 2 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// DeviceStateListBytes writes a list of DeviceState values to a byte slice. +func DeviceStateListBytes(buf []byte, list []DeviceState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } // DeviceStateNotify is the event number for a DeviceStateNotifyEvent. @@ -3640,23 +2494,76 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][10] = DeviceStateNotifyEventNew } -// DeviceMappingNotify is the event number for a DeviceMappingNotifyEvent. -const DeviceMappingNotify = 11 - -type DeviceMappingNotifyEvent struct { - Sequence uint16 - DeviceId byte - Request byte - FirstKeycode KeyCode - Count byte - // padding: 1 bytes +type DeviceTimeCoord struct { Time xproto.Timestamp - // padding: 20 bytes } -// DeviceMappingNotifyEventNew constructs a DeviceMappingNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { - v := DeviceMappingNotifyEvent{} +// DeviceTimeCoordRead reads a byte slice into a DeviceTimeCoord value. +func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { + b := 0 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// DeviceTimeCoordReadList reads a byte slice into a list of DeviceTimeCoord values. +func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DeviceTimeCoord{} + b += DeviceTimeCoordRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DeviceTimeCoord value to a byte slice. +func (v DeviceTimeCoord) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + return buf +} + +// DeviceTimeCoordListBytes writes a list of DeviceTimeCoord values to a byte slice. +func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + DeviceUseIsXPointer = 0 + DeviceUseIsXKeyboard = 1 + DeviceUseIsXExtensionDevice = 2 + DeviceUseIsXExtensionKeyboard = 3 + DeviceUseIsXExtensionPointer = 4 +) + +// DeviceValuator is the event number for a DeviceValuatorEvent. +const DeviceValuator = 0 + +type DeviceValuatorEvent struct { + Sequence uint16 + DeviceId byte + DeviceState uint16 + NumValuators byte + FirstValuator byte + Valuators []int32 // size: 24 +} + +// DeviceValuatorEventNew constructs a DeviceValuatorEvent value that implements xgb.Event from a byte slice. +func DeviceValuatorEventNew(buf []byte) xgb.Event { + v := DeviceValuatorEvent{} b := 1 // don't read event number v.DeviceId = buf[b] @@ -3665,32 +2572,32 @@ func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Request = buf[b] + v.DeviceState = xgb.Get16(buf[b:]) + b += 2 + + v.NumValuators = buf[b] b += 1 - v.FirstKeycode = KeyCode(buf[b]) + v.FirstValuator = buf[b] b += 1 - v.Count = buf[b] - b += 1 - - b += 1 // padding - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding + v.Valuators = make([]int32, 6) + for i := 0; i < int(6); i++ { + v.Valuators[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) return v } -// Bytes writes a DeviceMappingNotifyEvent value to a byte slice. -func (v DeviceMappingNotifyEvent) Bytes() []byte { +// Bytes writes a DeviceValuatorEvent value to a byte slice. +func (v DeviceValuatorEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 11 + buf[b] = 0 b += 1 buf[b] = v.DeviceId @@ -3698,65 +2605,244 @@ func (v DeviceMappingNotifyEvent) Bytes() []byte { b += 2 // skip sequence number - buf[b] = v.Request + xgb.Put16(buf[b:], v.DeviceState) + b += 2 + + buf[b] = v.NumValuators b += 1 - buf[b] = byte(v.FirstKeycode) + buf[b] = v.FirstValuator b += 1 - buf[b] = v.Count - b += 1 - - b += 1 // padding - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - b += 20 // padding + for i := 0; i < int(6); i++ { + xgb.Put32(buf[b:], uint32(v.Valuators[i])) + b += 4 + } + b = xgb.Pad(b) return buf } -// SequenceId returns the sequence id attached to the DeviceMappingNotify event. +// SequenceId returns the sequence id attached to the DeviceValuator event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v DeviceMappingNotifyEvent) SequenceId() uint16 { +func (v DeviceValuatorEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of DeviceMappingNotifyEvent. -func (v DeviceMappingNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) +// String is a rudimentary string representation of DeviceValuatorEvent. +func (v DeviceValuatorEvent) String() string { + fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) - fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - return "DeviceMappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("DeviceState: %d", v.DeviceState)) + fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstValuator: %d", v.FirstValuator)) + return "DeviceValuator {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew + xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew } -// ChangeDeviceNotify is the event number for a ChangeDeviceNotifyEvent. -const ChangeDeviceNotify = 12 +// BadEvent is the error number for a BadEvent. +const BadEvent = 1 -type ChangeDeviceNotifyEvent struct { +type EventError struct { Sequence uint16 - DeviceId byte + NiceName string +} + +// EventErrorNew constructs a EventError value that implements xgb.Error from a byte slice. +func EventErrorNew(buf []byte) xgb.Error { + v := EventError{} + v.NiceName = "Event" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadEvent error. +// This is mostly used internally. +func (err EventError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadEvent error. If no bad value exists, 0 is returned. +func (err EventError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadEvent error. + +func (err EventError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadEvent {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew +} + +type EventClass uint32 + +const ( + FeedbackClassKeyboard = 0 + FeedbackClassPointer = 1 + FeedbackClassString = 2 + FeedbackClassInteger = 3 + FeedbackClassLed = 4 + FeedbackClassBell = 5 +) + +type FeedbackCtl struct { + ClassId byte + Id byte + Len uint16 +} + +// FeedbackCtlRead reads a byte slice into a FeedbackCtl value. +func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// FeedbackCtlReadList reads a byte slice into a list of FeedbackCtl values. +func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = FeedbackCtl{} + b += FeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a FeedbackCtl value to a byte slice. +func (v FeedbackCtl) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// FeedbackCtlListBytes writes a list of FeedbackCtl values to a byte slice. +func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type FeedbackState struct { + ClassId byte + Id byte + Len uint16 +} + +// FeedbackStateRead reads a byte slice into a FeedbackState value. +func FeedbackStateRead(buf []byte, v *FeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// FeedbackStateReadList reads a byte slice into a list of FeedbackState values. +func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = FeedbackState{} + b += FeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a FeedbackState value to a byte slice. +func (v FeedbackState) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + return buf +} + +// FeedbackStateListBytes writes a list of FeedbackState values to a byte slice. +func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// FocusIn is the event number for a FocusInEvent. +const FocusIn = 6 + +type FocusInEvent struct { + Sequence uint16 + Detail byte Time xproto.Timestamp - Request byte - // padding: 23 bytes + Window xproto.Window + Mode byte + DeviceId byte + // padding: 18 bytes } -// ChangeDeviceNotifyEventNew constructs a ChangeDeviceNotifyEvent value that implements xgb.Event from a byte slice. -func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { - v := ChangeDeviceNotifyEvent{} +// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. +func FocusInEventNew(buf []byte) xgb.Event { + v := FocusInEvent{} b := 1 // don't read event number - v.DeviceId = buf[b] + v.Detail = buf[b] b += 1 v.Sequence = xgb.Get16(buf[b:]) @@ -3765,24 +2851,30 @@ func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) b += 4 - v.Request = buf[b] + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = buf[b] b += 1 - b += 23 // padding + v.DeviceId = buf[b] + b += 1 + + b += 18 // padding return v } -// Bytes writes a ChangeDeviceNotifyEvent value to a byte slice. -func (v ChangeDeviceNotifyEvent) Bytes() []byte { +// Bytes writes a FocusInEvent value to a byte slice. +func (v FocusInEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 12 + buf[b] = 6 b += 1 - buf[b] = v.DeviceId + buf[b] = v.Detail b += 1 b += 2 // skip sequence number @@ -3790,434 +2882,1031 @@ func (v ChangeDeviceNotifyEvent) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Time)) b += 4 - buf[b] = v.Request - b += 1 - - b += 23 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the ChangeDeviceNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of ChangeDeviceNotifyEvent. -func (v ChangeDeviceNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) - return "ChangeDeviceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew -} - -// DeviceKeyStateNotify is the event number for a DeviceKeyStateNotifyEvent. -const DeviceKeyStateNotify = 13 - -type DeviceKeyStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Keys []byte // size: 28 -} - -// DeviceKeyStateNotifyEventNew constructs a DeviceKeyStateNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { - v := DeviceKeyStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Keys = make([]byte, 28) - copy(v.Keys[:28], buf[b:]) - b += xgb.Pad(int(28)) - - return v -} - -// Bytes writes a DeviceKeyStateNotifyEvent value to a byte slice. -func (v DeviceKeyStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 13 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Keys[:28]) - b += xgb.Pad(int(28)) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceKeyStateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceKeyStateNotifyEvent. -func (v DeviceKeyStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceKeyStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew -} - -// DeviceButtonStateNotify is the event number for a DeviceButtonStateNotifyEvent. -const DeviceButtonStateNotify = 14 - -type DeviceButtonStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Buttons []byte // size: 28 -} - -// DeviceButtonStateNotifyEventNew constructs a DeviceButtonStateNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { - v := DeviceButtonStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Buttons = make([]byte, 28) - copy(v.Buttons[:28], buf[b:]) - b += xgb.Pad(int(28)) - - return v -} - -// Bytes writes a DeviceButtonStateNotifyEvent value to a byte slice. -func (v DeviceButtonStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 14 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Buttons[:28]) - b += xgb.Pad(int(28)) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceButtonStateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceButtonStateNotifyEvent. -func (v DeviceButtonStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew -} - -// DevicePresenceNotify is the event number for a DevicePresenceNotifyEvent. -const DevicePresenceNotify = 15 - -type DevicePresenceNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Time xproto.Timestamp - Devchange byte - DeviceId byte - Control uint16 - // padding: 20 bytes -} - -// DevicePresenceNotifyEventNew constructs a DevicePresenceNotifyEvent value that implements xgb.Event from a byte slice. -func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { - v := DevicePresenceNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - v.Devchange = buf[b] - b += 1 - - v.DeviceId = buf[b] - b += 1 - - v.Control = xgb.Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -// Bytes writes a DevicePresenceNotifyEvent value to a byte slice. -func (v DevicePresenceNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 15 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.Devchange + buf[b] = v.Mode b += 1 buf[b] = v.DeviceId b += 1 - xgb.Put16(buf[b:], v.Control) - b += 2 - - b += 20 // padding + b += 18 // padding return buf } -// SequenceId returns the sequence id attached to the DevicePresenceNotify event. +// SequenceId returns the sequence id attached to the FocusIn event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v DevicePresenceNotifyEvent) SequenceId() uint16 { +func (v FocusInEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of DevicePresenceNotifyEvent. -func (v DevicePresenceNotifyEvent) String() string { +// String is a rudimentary string representation of FocusInEvent. +func (v FocusInEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Devchange: %d", v.Devchange)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Control: %d", v.Control)) - return "DevicePresenceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" + return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew + xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew } -// DeviceKeyRelease is the event number for a DeviceKeyReleaseEvent. -const DeviceKeyRelease = 2 +// FocusOut is the event number for a FocusOutEvent. +const FocusOut = 7 -type DeviceKeyReleaseEvent DeviceKeyPressEvent +type FocusOutEvent FocusInEvent -// DeviceKeyReleaseEventNew constructs a DeviceKeyReleaseEvent value that implements xgb.Event from a byte slice. -func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { - return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. +func FocusOutEventNew(buf []byte) xgb.Event { + return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) } -// Bytes writes a DeviceKeyReleaseEvent value to a byte slice. -func (v DeviceKeyReleaseEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() +// Bytes writes a FocusOutEvent value to a byte slice. +func (v FocusOutEvent) Bytes() []byte { + return FocusInEvent(v).Bytes() } -// SequenceId returns the sequence id attached to the DeviceKeyRelease event. +// SequenceId returns the sequence id attached to the FocusOut event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v DeviceKeyReleaseEvent) SequenceId() uint16 { +func (v FocusOutEvent) SequenceId() uint16 { return v.Sequence } -func (v DeviceKeyReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) +func (v FocusOutEvent) String() string { + fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceKeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" + return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew + xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew } -// DeviceButtonPress is the event number for a DeviceButtonPressEvent. -const DeviceButtonPress = 3 +const ( + InputClassKey = 0 + InputClassButton = 1 + InputClassValuator = 2 + InputClassFeedback = 3 + InputClassProximity = 4 + InputClassFocus = 5 + InputClassOther = 6 +) -type DeviceButtonPressEvent DeviceKeyPressEvent - -// DeviceButtonPressEventNew constructs a DeviceButtonPressEvent value that implements xgb.Event from a byte slice. -func DeviceButtonPressEventNew(buf []byte) xgb.Event { - return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) +type InputClassInfo struct { + ClassId byte + EventTypeBase byte } -// Bytes writes a DeviceButtonPressEvent value to a byte slice. -func (v DeviceButtonPressEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() +// InputClassInfoRead reads a byte slice into a InputClassInfo value. +func InputClassInfoRead(buf []byte, v *InputClassInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.EventTypeBase = buf[b] + b += 1 + + return b } -// SequenceId returns the sequence id attached to the DeviceButtonPress event. -// Events without a sequence number (KeymapNotify) return 0. +// InputClassInfoReadList reads a byte slice into a list of InputClassInfo values. +func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputClassInfo{} + b += InputClassInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a InputClassInfo value to a byte slice. +func (v InputClassInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.EventTypeBase + b += 1 + + return buf +} + +// InputClassInfoListBytes writes a list of InputClassInfo values to a byte slice. +func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type InputInfo struct { + ClassId byte + Len byte +} + +// InputInfoRead reads a byte slice into a InputInfo value. +func InputInfoRead(buf []byte, v *InputInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + return b +} + +// InputInfoReadList reads a byte slice into a list of InputInfo values. +func InputInfoReadList(buf []byte, dest []InputInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputInfo{} + b += InputInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a InputInfo value to a byte slice. +func (v InputInfo) Bytes() []byte { + buf := make([]byte, 2) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + return buf +} + +// InputInfoListBytes writes a list of InputInfo values to a byte slice. +func InputInfoListBytes(buf []byte, list []InputInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type InputState struct { + ClassId byte + Len byte + NumItems byte +} + +// InputStateRead reads a byte slice into a InputState value. +func InputStateRead(buf []byte, v *InputState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumItems = buf[b] + b += 1 + + return b +} + +// InputStateReadList reads a byte slice into a list of InputState values. +func InputStateReadList(buf []byte, dest []InputState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = InputState{} + b += InputStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a InputState value to a byte slice. +func (v InputState) Bytes() []byte { + buf := make([]byte, 3) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumItems + b += 1 + + return buf +} + +// InputStateListBytes writes a list of InputState values to a byte slice. +func InputStateListBytes(buf []byte, list []InputState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type IntegerFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + IntToDisplay int32 +} + +// IntegerFeedbackCtlRead reads a byte slice into a IntegerFeedbackCtl value. +func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.IntToDisplay = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// IntegerFeedbackCtlReadList reads a byte slice into a list of IntegerFeedbackCtl values. +func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = IntegerFeedbackCtl{} + b += IntegerFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a IntegerFeedbackCtl value to a byte slice. +func (v IntegerFeedbackCtl) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], uint32(v.IntToDisplay)) + b += 4 + + return buf +} + +// IntegerFeedbackCtlListBytes writes a list of IntegerFeedbackCtl values to a byte slice. +func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type IntegerFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Resolution uint32 + MinValue int32 + MaxValue int32 +} + +// IntegerFeedbackStateRead reads a byte slice into a IntegerFeedbackState value. +func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Resolution = xgb.Get32(buf[b:]) + b += 4 + + v.MinValue = int32(xgb.Get32(buf[b:])) + b += 4 + + v.MaxValue = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// IntegerFeedbackStateReadList reads a byte slice into a list of IntegerFeedbackState values. +func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = IntegerFeedbackState{} + b += IntegerFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a IntegerFeedbackState value to a byte slice. +func (v IntegerFeedbackState) Bytes() []byte { + buf := make([]byte, 16) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.Resolution) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MinValue)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.MaxValue)) + b += 4 + + return buf +} + +// IntegerFeedbackStateListBytes writes a list of IntegerFeedbackState values to a byte slice. +func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type KbdFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + Key KeyCode + AutoRepeatMode byte + KeyClickPercent int8 + BellPercent int8 + BellPitch int16 + BellDuration int16 + LedMask uint32 + LedValues uint32 +} + +// KbdFeedbackCtlRead reads a byte slice into a KbdFeedbackCtl value. +func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Key = KeyCode(buf[b]) + b += 1 + + v.AutoRepeatMode = buf[b] + b += 1 + + v.KeyClickPercent = int8(buf[b]) + b += 1 + + v.BellPercent = int8(buf[b]) + b += 1 + + v.BellPitch = int16(xgb.Get16(buf[b:])) + b += 2 + + v.BellDuration = int16(xgb.Get16(buf[b:])) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// KbdFeedbackCtlReadList reads a byte slice into a list of KbdFeedbackCtl values. +func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KbdFeedbackCtl{} + b += KbdFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a KbdFeedbackCtl value to a byte slice. +func (v KbdFeedbackCtl) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + buf[b] = byte(v.Key) + b += 1 + + buf[b] = v.AutoRepeatMode + b += 1 + + buf[b] = byte(v.KeyClickPercent) + b += 1 + + buf[b] = byte(v.BellPercent) + b += 1 + + xgb.Put16(buf[b:], uint16(v.BellPitch)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.BellDuration)) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// KbdFeedbackCtlListBytes writes a list of KbdFeedbackCtl values to a byte slice. +func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type KbdFeedbackState struct { + ClassId byte + Id byte + Len uint16 + Pitch uint16 + Duration uint16 + LedMask uint32 + LedValues uint32 + GlobalAutoRepeat bool + Click byte + Percent byte + // padding: 1 bytes + AutoRepeats []byte // size: 32 +} + +// KbdFeedbackStateRead reads a byte slice into a KbdFeedbackState value. +func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.Pitch = xgb.Get16(buf[b:]) + b += 2 + + v.Duration = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + if buf[b] == 1 { + v.GlobalAutoRepeat = true + } else { + v.GlobalAutoRepeat = false + } + b += 1 + + v.Click = buf[b] + b += 1 + + v.Percent = buf[b] + b += 1 + + b += 1 // padding + + v.AutoRepeats = make([]byte, 32) + copy(v.AutoRepeats[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return b +} + +// KbdFeedbackStateReadList reads a byte slice into a list of KbdFeedbackState values. +func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KbdFeedbackState{} + b += KbdFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a KbdFeedbackState value to a byte slice. +func (v KbdFeedbackState) Bytes() []byte { + buf := make([]byte, 52) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put16(buf[b:], v.Pitch) + b += 2 + + xgb.Put16(buf[b:], v.Duration) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + if v.GlobalAutoRepeat { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.Click + b += 1 + + buf[b] = v.Percent + b += 1 + + b += 1 // padding + + copy(buf[b:], v.AutoRepeats[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// KbdFeedbackStateListBytes writes a list of KbdFeedbackState values to a byte slice. +func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. +func KbdFeedbackStateListSize(list []KbdFeedbackState) int { + size := 0 + for _ = range list { + size += 52 + } + return size +} + +type KeyCode byte + +type KeyInfo struct { + ClassId byte + Len byte + MinKeycode KeyCode + MaxKeycode KeyCode + NumKeys uint16 + // padding: 2 bytes +} + +// KeyInfoRead reads a byte slice into a KeyInfo value. +func KeyInfoRead(buf []byte, v *KeyInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.MinKeycode = KeyCode(buf[b]) + b += 1 + + v.MaxKeycode = KeyCode(buf[b]) + b += 1 + + v.NumKeys = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return b +} + +// KeyInfoReadList reads a byte slice into a list of KeyInfo values. +func KeyInfoReadList(buf []byte, dest []KeyInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KeyInfo{} + b += KeyInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a KeyInfo value to a byte slice. +func (v KeyInfo) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = byte(v.MinKeycode) + b += 1 + + buf[b] = byte(v.MaxKeycode) + b += 1 + + xgb.Put16(buf[b:], v.NumKeys) + b += 2 + + b += 2 // padding + + return buf +} + +// KeyInfoListBytes writes a list of KeyInfo values to a byte slice. +func KeyInfoListBytes(buf []byte, list []KeyInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type KeyState struct { + ClassId byte + Len byte + NumKeys byte + // padding: 1 bytes + Keys []byte // size: 32 +} + +// KeyStateRead reads a byte slice into a KeyState value. +func KeyStateRead(buf []byte, v *KeyState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumKeys = buf[b] + b += 1 + + b += 1 // padding + + v.Keys = make([]byte, 32) + copy(v.Keys[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return b +} + +// KeyStateReadList reads a byte slice into a list of KeyState values. +func KeyStateReadList(buf []byte, dest []KeyState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = KeyState{} + b += KeyStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a KeyState value to a byte slice. +func (v KeyState) Bytes() []byte { + buf := make([]byte, 36) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumKeys + b += 1 + + b += 1 // padding + + copy(buf[b:], v.Keys[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// KeyStateListBytes writes a list of KeyState values to a byte slice. +func KeyStateListBytes(buf []byte, list []KeyState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// KeyStateListSize computes the size (bytes) of a list of KeyState values. +func KeyStateListSize(list []KeyState) int { + size := 0 + for _ = range list { + size += 36 + } + return size +} + +type LedFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// LedFeedbackCtlRead reads a byte slice into a LedFeedbackCtl value. +func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// LedFeedbackCtlReadList reads a byte slice into a list of LedFeedbackCtl values. +func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = LedFeedbackCtl{} + b += LedFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a LedFeedbackCtl value to a byte slice. +func (v LedFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// LedFeedbackCtlListBytes writes a list of LedFeedbackCtl values to a byte slice. +func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type LedFeedbackState struct { + ClassId byte + Id byte + Len uint16 + LedMask uint32 + LedValues uint32 +} + +// LedFeedbackStateRead reads a byte slice into a LedFeedbackState value. +func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.LedValues = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// LedFeedbackStateReadList reads a byte slice into a list of LedFeedbackState values. +func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = LedFeedbackState{} + b += LedFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a LedFeedbackState value to a byte slice. +func (v LedFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put32(buf[b:], v.LedMask) + b += 4 + + xgb.Put32(buf[b:], v.LedValues) + b += 4 + + return buf +} + +// LedFeedbackStateListBytes writes a list of LedFeedbackState values to a byte slice. +func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// BadMode is the error number for a BadMode. +const BadMode = 2 + +type ModeError struct { + Sequence uint16 + NiceName string +} + +// ModeErrorNew constructs a ModeError value that implements xgb.Error from a byte slice. +func ModeErrorNew(buf []byte) xgb.Error { + v := ModeError{} + v.NiceName = "Mode" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadMode error. // This is mostly used internally. -func (v DeviceButtonPressEvent) SequenceId() uint16 { - return v.Sequence +func (err ModeError) SequenceId() uint16 { + return err.Sequence } -func (v DeviceButtonPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// BadId returns the 'BadValue' number if one exists for the BadMode error. If no bad value exists, 0 is returned. +func (err ModeError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadMode error. + +func (err ModeError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew + xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew } -// DeviceButtonRelease is the event number for a DeviceButtonReleaseEvent. -const DeviceButtonRelease = 4 - -type DeviceButtonReleaseEvent DeviceKeyPressEvent - -// DeviceButtonReleaseEventNew constructs a DeviceButtonReleaseEvent value that implements xgb.Event from a byte slice. -func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { - return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceButtonReleaseEvent value to a byte slice. -func (v DeviceButtonReleaseEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceButtonRelease event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceButtonReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceButtonReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew -} - -// DeviceMotionNotify is the event number for a DeviceMotionNotifyEvent. -const DeviceMotionNotify = 5 - -type DeviceMotionNotifyEvent DeviceKeyPressEvent - -// DeviceMotionNotifyEventNew constructs a DeviceMotionNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { - return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceMotionNotifyEvent value to a byte slice. -func (v DeviceMotionNotifyEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceMotionNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceMotionNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceMotionNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceMotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew -} +const ( + PropagateModeAddToList = 0 + PropagateModeDeleteFromList = 1 +) // ProximityIn is the event number for a ProximityInEvent. const ProximityIn = 8 @@ -4307,897 +3996,642 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][9] = ProximityOutEventNew } -// FocusOut is the event number for a FocusOutEvent. -const FocusOut = 7 - -type FocusOutEvent FocusInEvent - -// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. -func FocusOutEventNew(buf []byte) xgb.Event { - return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) +type PtrFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + Num int16 + Denom int16 + Threshold int16 } -// Bytes writes a FocusOutEvent value to a byte slice. -func (v FocusOutEvent) Bytes() []byte { - return FocusInEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the FocusOut event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v FocusOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v FocusOutEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew -} - -// BadDevice is the error number for a BadDevice. -const BadDevice = 0 - -type DeviceError struct { - Sequence uint16 - NiceName string -} - -// DeviceErrorNew constructs a DeviceError value that implements xgb.Error from a byte slice. -func DeviceErrorNew(buf []byte) xgb.Error { - v := DeviceError{} - v.NiceName = "Device" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadDevice error. -// This is mostly used internally. -func (err DeviceError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadDevice error. If no bad value exists, 0 is returned. -func (err DeviceError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadDevice error. - -func (err DeviceError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadDevice {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew -} - -// BadEvent is the error number for a BadEvent. -const BadEvent = 1 - -type EventError struct { - Sequence uint16 - NiceName string -} - -// EventErrorNew constructs a EventError value that implements xgb.Error from a byte slice. -func EventErrorNew(buf []byte) xgb.Error { - v := EventError{} - v.NiceName = "Event" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadEvent error. -// This is mostly used internally. -func (err EventError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadEvent error. If no bad value exists, 0 is returned. -func (err EventError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadEvent error. - -func (err EventError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadEvent {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew -} - -// BadMode is the error number for a BadMode. -const BadMode = 2 - -type ModeError struct { - Sequence uint16 - NiceName string -} - -// ModeErrorNew constructs a ModeError value that implements xgb.Error from a byte slice. -func ModeErrorNew(buf []byte) xgb.Error { - v := ModeError{} - v.NiceName = "Mode" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadMode error. -// This is mostly used internally. -func (err ModeError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadMode error. If no bad value exists, 0 is returned. -func (err ModeError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadMode error. - -func (err ModeError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew -} - -// BadDeviceBusy is the error number for a BadDeviceBusy. -const BadDeviceBusy = 3 - -type DeviceBusyError struct { - Sequence uint16 - NiceName string -} - -// DeviceBusyErrorNew constructs a DeviceBusyError value that implements xgb.Error from a byte slice. -func DeviceBusyErrorNew(buf []byte) xgb.Error { - v := DeviceBusyError{} - v.NiceName = "DeviceBusy" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadDeviceBusy error. -// This is mostly used internally. -func (err DeviceBusyError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadDeviceBusy error. If no bad value exists, 0 is returned. -func (err DeviceBusyError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadDeviceBusy error. - -func (err DeviceBusyError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadDeviceBusy {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew -} - -// BadClass is the error number for a BadClass. -const BadClass = 4 - -type ClassError struct { - Sequence uint16 - NiceName string -} - -// ClassErrorNew constructs a ClassError value that implements xgb.Error from a byte slice. -func ClassErrorNew(buf []byte) xgb.Error { - v := ClassError{} - v.NiceName = "Class" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadClass error. -// This is mostly used internally. -func (err ClassError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadClass error. If no bad value exists, 0 is returned. -func (err ClassError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadClass error. - -func (err ClassError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadClass {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew -} - -// GetExtensionVersionCookie is a cookie used only for GetExtensionVersion requests. -type GetExtensionVersionCookie struct { - *xgb.Cookie -} - -// GetExtensionVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() -func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) - return GetExtensionVersionCookie{cookie} -} - -// GetExtensionVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) - return GetExtensionVersionCookie{cookie} -} - -// GetExtensionVersionReply represents the data returned from a GetExtensionVersion request. -type GetExtensionVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 - Present bool - // padding: 19 bytes -} - -// Reply blocks and returns the reply data for a GetExtensionVersion request. -func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getExtensionVersionReply(buf), nil -} - -// getExtensionVersionReply reads a byte slice into a GetExtensionVersionReply value. -func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { - v := new(GetExtensionVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = xgb.Get16(buf[b:]) - b += 2 - - v.ServerMinor = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Present = true - } else { - v.Present = false - } - b += 1 - - b += 19 // padding - - return v -} - -// Write request to wire for GetExtensionVersion -// getExtensionVersionRequest writes a GetExtensionVersion request to a byte slice. -func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// PtrFeedbackCtlRead reads a byte slice into a PtrFeedbackCtl value. +func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { b := 0 - buf := make([]byte, size) - buf[b] = c.Extensions["XINPUTEXTENSION"] + v.ClassId = buf[b] b += 1 - buf[b] = 1 // request opcode + v.Id = buf[b] b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], NameLen) + v.Len = xgb.Get16(buf[b:]) b += 2 b += 2 // padding - copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + v.Num = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Denom = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Threshold = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// PtrFeedbackCtlReadList reads a byte slice into a list of PtrFeedbackCtl values. +func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = PtrFeedbackCtl{} + b += PtrFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a PtrFeedbackCtl value to a byte slice. +func (v PtrFeedbackCtl) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], uint16(v.Num)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Denom)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Threshold)) + b += 2 return buf } -// ListInputDevicesCookie is a cookie used only for ListInputDevices requests. -type ListInputDevicesCookie struct { - *xgb.Cookie -} - -// ListInputDevices sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() -func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") +// PtrFeedbackCtlListBytes writes a list of PtrFeedbackCtl values to a byte slice. +func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) } - cookie := c.NewCookie(true, true) - c.NewRequest(listInputDevicesRequest(c), cookie) - return ListInputDevicesCookie{cookie} + return b } -// ListInputDevicesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(listInputDevicesRequest(c), cookie) - return ListInputDevicesCookie{cookie} +type PtrFeedbackState struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + AccelNum uint16 + AccelDenom uint16 + Threshold uint16 } -// ListInputDevicesReply represents the data returned from a ListInputDevices request. -type ListInputDevicesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - DevicesLen byte - // padding: 23 bytes - Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) -} +// PtrFeedbackStateRead reads a byte slice into a PtrFeedbackState value. +func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { + b := 0 -// Reply blocks and returns the reply data for a ListInputDevices request. -func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listInputDevicesReply(buf), nil -} + v.ClassId = buf[b] + b += 1 -// listInputDevicesReply reads a byte slice into a ListInputDevicesReply value. -func listInputDevicesReply(buf []byte) *ListInputDevicesReply { - v := new(ListInputDevicesReply) - b := 1 // skip reply determinant + v.Id = buf[b] + b += 1 - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) + v.Len = xgb.Get16(buf[b:]) b += 2 - v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 2 // padding + + v.AccelNum = xgb.Get16(buf[b:]) + b += 2 + + v.AccelDenom = xgb.Get16(buf[b:]) + b += 2 + + v.Threshold = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// PtrFeedbackStateReadList reads a byte slice into a list of PtrFeedbackState values. +func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = PtrFeedbackState{} + b += PtrFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a PtrFeedbackState value to a byte slice. +func (v PtrFeedbackState) Bytes() []byte { + buf := make([]byte, 12) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], v.AccelNum) + b += 2 + + xgb.Put16(buf[b:], v.AccelDenom) + b += 2 + + xgb.Put16(buf[b:], v.Threshold) + b += 2 + + return buf +} + +// PtrFeedbackStateListBytes writes a list of PtrFeedbackState values to a byte slice. +func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type StringFeedbackCtl struct { + ClassId byte + Id byte + Len uint16 + // padding: 2 bytes + NumKeysyms uint16 + Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) +} + +// StringFeedbackCtlRead reads a byte slice into a StringFeedbackCtl value. +func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.NumKeysyms = xgb.Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// StringFeedbackCtlReadList reads a byte slice into a list of StringFeedbackCtl values. +func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = StringFeedbackCtl{} + b += StringFeedbackCtlRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a StringFeedbackCtl value to a byte slice. +func (v StringFeedbackCtl) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + b += 2 // padding + + xgb.Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + xgb.Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// StringFeedbackCtlListBytes writes a list of StringFeedbackCtl values to a byte slice. +func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. +func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) + } + return size +} + +type StringFeedbackState struct { + ClassId byte + Id byte + Len uint16 + MaxSymbols uint16 + NumKeysyms uint16 + Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) +} + +// StringFeedbackStateRead reads a byte slice into a StringFeedbackState value. +func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Id = buf[b] + b += 1 + + v.Len = xgb.Get16(buf[b:]) + b += 2 + + v.MaxSymbols = xgb.Get16(buf[b:]) + b += 2 + + v.NumKeysyms = xgb.Get16(buf[b:]) + b += 2 + + v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) + for i := 0; i < int(v.NumKeysyms); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// StringFeedbackStateReadList reads a byte slice into a list of StringFeedbackState values. +func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = StringFeedbackState{} + b += StringFeedbackStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a StringFeedbackState value to a byte slice. +func (v StringFeedbackState) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Id + b += 1 + + xgb.Put16(buf[b:], v.Len) + b += 2 + + xgb.Put16(buf[b:], v.MaxSymbols) + b += 2 + + xgb.Put16(buf[b:], v.NumKeysyms) + b += 2 + + for i := 0; i < int(v.NumKeysyms); i++ { + xgb.Put32(buf[b:], uint32(v.Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// StringFeedbackStateListBytes writes a list of StringFeedbackState values to a byte slice. +func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. +func StringFeedbackStateListSize(list []StringFeedbackState) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) + } + return size +} + +type ValuatorInfo struct { + ClassId byte + Len byte + AxesLen byte + Mode byte + MotionSize uint32 + Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) +} + +// ValuatorInfoRead reads a byte slice into a ValuatorInfo value. +func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.AxesLen = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.MotionSize = xgb.Get32(buf[b:]) b += 4 - v.DevicesLen = buf[b] - b += 1 + v.Axes = make([]AxisInfo, v.AxesLen) + b += AxisInfoReadList(buf[b:], v.Axes) - b += 23 // padding - - v.Devices = make([]DeviceInfo, v.DevicesLen) - b += DeviceInfoReadList(buf[b:], v.Devices) - - return v + return b } -// Write request to wire for ListInputDevices -// listInputDevicesRequest writes a ListInputDevices request to a byte slice. -func listInputDevicesRequest(c *xgb.Conn) []byte { - size := 4 +// ValuatorInfoReadList reads a byte slice into a list of ValuatorInfo values. +func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { b := 0 - buf := make([]byte, size) + for i := 0; i < len(dest); i++ { + dest[i] = ValuatorInfo{} + b += ValuatorInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} - buf[b] = c.Extensions["XINPUTEXTENSION"] +// Bytes writes a ValuatorInfo value to a byte slice. +func (v ValuatorInfo) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) + b := 0 + + buf[b] = v.ClassId b += 1 - buf[b] = 2 // request opcode + buf[b] = v.Len b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 + buf[b] = v.AxesLen + b += 1 - return buf -} + buf[b] = v.Mode + b += 1 -// OpenDeviceCookie is a cookie used only for OpenDevice requests. -type OpenDeviceCookie struct { - *xgb.Cookie -} - -// OpenDevice sends a checked request. -// If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() -func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(openDeviceRequest(c, DeviceId), cookie) - return OpenDeviceCookie{cookie} -} - -// OpenDeviceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(openDeviceRequest(c, DeviceId), cookie) - return OpenDeviceCookie{cookie} -} - -// OpenDeviceReply represents the data returned from a OpenDevice request. -type OpenDeviceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClasses byte - // padding: 23 bytes - ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) -} - -// Reply blocks and returns the reply data for a OpenDevice request. -func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return openDeviceReply(buf), nil -} - -// openDeviceReply reads a byte slice into a OpenDeviceReply value. -func openDeviceReply(buf []byte) *OpenDeviceReply { - v := new(OpenDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], v.MotionSize) b += 4 - v.NumClasses = buf[b] - b += 1 - - b += 23 // padding - - v.ClassInfo = make([]InputClassInfo, v.NumClasses) - b += InputClassInfoReadList(buf[b:], v.ClassInfo) - - return v -} - -// Write request to wire for OpenDevice -// openDeviceRequest writes a OpenDevice request to a byte slice. -func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding + b += AxisInfoListBytes(buf[b:], v.Axes) return buf } -// CloseDeviceCookie is a cookie used only for CloseDevice requests. -type CloseDeviceCookie struct { +// ValuatorInfoListBytes writes a list of ValuatorInfo values to a byte slice. +func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. +func ValuatorInfoListSize(list []ValuatorInfo) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.AxesLen) * 12))) + } + return size +} + +const ( + ValuatorModeRelative = 0 + ValuatorModeAbsolute = 1 +) + +type ValuatorState struct { + ClassId byte + Len byte + NumValuators byte + Mode byte + Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) +} + +// ValuatorStateRead reads a byte slice into a ValuatorState value. +func ValuatorStateRead(buf []byte, v *ValuatorState) int { + b := 0 + + v.ClassId = buf[b] + b += 1 + + v.Len = buf[b] + b += 1 + + v.NumValuators = buf[b] + b += 1 + + v.Mode = buf[b] + b += 1 + + v.Valuators = make([]uint32, v.NumValuators) + for i := 0; i < int(v.NumValuators); i++ { + v.Valuators[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// ValuatorStateReadList reads a byte slice into a list of ValuatorState values. +func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ValuatorState{} + b += ValuatorStateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ValuatorState value to a byte slice. +func (v ValuatorState) Bytes() []byte { + buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) + b := 0 + + buf[b] = v.ClassId + b += 1 + + buf[b] = v.Len + b += 1 + + buf[b] = v.NumValuators + b += 1 + + buf[b] = v.Mode + b += 1 + + for i := 0; i < int(v.NumValuators); i++ { + xgb.Put32(buf[b:], v.Valuators[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ValuatorStateListBytes writes a list of ValuatorState values to a byte slice. +func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. +func ValuatorStateListSize(list []ValuatorState) int { + size := 0 + for _, item := range list { + size += (4 + xgb.Pad((int(item.NumValuators) * 4))) + } + return size +} + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AllowDeviceEventsCookie is a cookie used only for AllowDeviceEvents requests. +type AllowDeviceEventsCookie struct { *xgb.Cookie } -// CloseDevice sends an unchecked request. +// AllowDeviceEvents sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { +func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) - return CloseDeviceCookie{cookie} + c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) + return AllowDeviceEventsCookie{cookie} } -// CloseDeviceChecked sends a checked request. -// If an error occurs, it can be retrieved using CloseDeviceCookie.Check() -func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { +// AllowDeviceEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() +func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) - return CloseDeviceCookie{cookie} + c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) + return AllowDeviceEventsCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CloseDeviceCookie) Check() error { +func (cook AllowDeviceEventsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CloseDevice -// closeDeviceRequest writes a CloseDevice request to a byte slice. -func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 +// Write request to wire for AllowDeviceEvents +// allowDeviceEventsRequest writes a AllowDeviceEvents request to a byte slice. +func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 4 // request opcode + buf[b] = 19 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// SetDeviceModeCookie is a cookie used only for SetDeviceMode requests. -type SetDeviceModeCookie struct { - *xgb.Cookie -} - -// SetDeviceMode sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() -func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) - return SetDeviceModeCookie{cookie} -} - -// SetDeviceModeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) - return SetDeviceModeCookie{cookie} -} - -// SetDeviceModeReply represents the data returned from a SetDeviceMode request. -type SetDeviceModeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceMode request. -func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceModeReply(buf), nil -} - -// setDeviceModeReply reads a byte slice into a SetDeviceModeReply value. -func setDeviceModeReply(buf []byte) *SetDeviceModeReply { - v := new(SetDeviceModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(Time)) b += 4 - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceMode -// setDeviceModeRequest writes a SetDeviceMode request to a byte slice. -func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - buf[b] = Mode b += 1 - b += 2 // padding - - return buf -} - -// SelectExtensionEventCookie is a cookie used only for SelectExtensionEvent requests. -type SelectExtensionEventCookie struct { - *xgb.Cookie -} - -// SelectExtensionEvent sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) - return SelectExtensionEventCookie{cookie} -} - -// SelectExtensionEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() -func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) - return SelectExtensionEventCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectExtensionEventCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectExtensionEvent -// selectExtensionEventRequest writes a SelectExtensionEvent request to a byte slice. -func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { - size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] + buf[b] = DeviceId b += 1 - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GetSelectedExtensionEventsCookie is a cookie used only for GetSelectedExtensionEvents requests. -type GetSelectedExtensionEventsCookie struct { - *xgb.Cookie -} - -// GetSelectedExtensionEvents sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() -func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) - return GetSelectedExtensionEventsCookie{cookie} -} - -// GetSelectedExtensionEventsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) - return GetSelectedExtensionEventsCookie{cookie} -} - -// GetSelectedExtensionEventsReply represents the data returned from a GetSelectedExtensionEvents request. -type GetSelectedExtensionEventsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumThisClasses uint16 - NumAllClasses uint16 - // padding: 20 bytes - ThisClasses []EventClass // size: xgb.Pad((int(NumThisClasses) * 4)) - AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) -} - -// Reply blocks and returns the reply data for a GetSelectedExtensionEvents request. -func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getSelectedExtensionEventsReply(buf), nil -} - -// getSelectedExtensionEventsReply reads a byte slice into a GetSelectedExtensionEventsReply value. -func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { - v := new(GetSelectedExtensionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumThisClasses = xgb.Get16(buf[b:]) - b += 2 - - v.NumAllClasses = xgb.Get16(buf[b:]) - b += 2 - - b += 20 // padding - - v.ThisClasses = make([]EventClass, v.NumThisClasses) - for i := 0; i < int(v.NumThisClasses); i++ { - v.ThisClasses[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.AllClasses = make([]EventClass, v.NumAllClasses) - for i := 0; i < int(v.NumAllClasses); i++ { - v.AllClasses[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetSelectedExtensionEvents -// getSelectedExtensionEventsRequest writes a GetSelectedExtensionEvents request to a byte slice. -func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - return buf } @@ -5270,207 +4704,73 @@ func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, Num return buf } -// GetDeviceDontPropagateListCookie is a cookie used only for GetDeviceDontPropagateList requests. -type GetDeviceDontPropagateListCookie struct { +// ChangeDeviceKeyMappingCookie is a cookie used only for ChangeDeviceKeyMapping requests. +type ChangeDeviceKeyMappingCookie struct { *xgb.Cookie } -// GetDeviceDontPropagateList sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() -func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) - return GetDeviceDontPropagateListCookie{cookie} -} - -// GetDeviceDontPropagateListUnchecked sends an unchecked request. +// ChangeDeviceKeyMapping sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { +func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) - return GetDeviceDontPropagateListCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return ChangeDeviceKeyMappingCookie{cookie} } -// GetDeviceDontPropagateListReply represents the data returned from a GetDeviceDontPropagateList request. -type GetDeviceDontPropagateListReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClasses uint16 - // padding: 22 bytes - Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) +// ChangeDeviceKeyMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() +func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) + return ChangeDeviceKeyMappingCookie{cookie} } -// Reply blocks and returns the reply data for a GetDeviceDontPropagateList request. -func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceDontPropagateListReply(buf), nil +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeDeviceKeyMappingCookie) Check() error { + return cook.Cookie.Check() } -// getDeviceDontPropagateListReply reads a byte slice into a GetDeviceDontPropagateListReply value. -func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { - v := new(GetDeviceDontPropagateListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Classes = make([]EventClass, v.NumClasses) - for i := 0; i < int(v.NumClasses); i++ { - v.Classes[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetDeviceDontPropagateList -// getDeviceDontPropagateListRequest writes a GetDeviceDontPropagateList request to a byte slice. -func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 +// Write request to wire for ChangeDeviceKeyMapping +// changeDeviceKeyMappingRequest writes a ChangeDeviceKeyMapping request to a byte slice. +func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { + size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 9 // request opcode + buf[b] = 25 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// GetDeviceMotionEventsCookie is a cookie used only for GetDeviceMotionEvents requests. -type GetDeviceMotionEventsCookie struct { - *xgb.Cookie -} - -// GetDeviceMotionEvents sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() -func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) - return GetDeviceMotionEventsCookie{cookie} -} - -// GetDeviceMotionEventsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) - return GetDeviceMotionEventsCookie{cookie} -} - -// GetDeviceMotionEventsReply represents the data returned from a GetDeviceMotionEvents request. -type GetDeviceMotionEventsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumCoords uint32 - NumAxes byte - DeviceMode byte - // padding: 18 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceMotionEvents request. -func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceMotionEventsReply(buf), nil -} - -// getDeviceMotionEventsReply reads a byte slice into a GetDeviceMotionEventsReply value. -func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { - v := new(GetDeviceMotionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumCoords = xgb.Get32(buf[b:]) - b += 4 - - v.NumAxes = buf[b] - b += 1 - - v.DeviceMode = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -// Write request to wire for GetDeviceMotionEvents -// getDeviceMotionEventsRequest writes a GetDeviceMotionEvents request to a byte slice. -func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Start)) - b += 4 - - xgb.Put32(buf[b:], uint32(Stop)) - b += 4 - buf[b] = DeviceId b += 1 + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = KeysymsPerKeycode + b += 1 + + buf[b] = KeycodeCount + b += 1 + + for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { + xgb.Put32(buf[b:], uint32(Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + return buf } @@ -5666,6 +4966,1141 @@ func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId by return buf } +// CloseDeviceCookie is a cookie used only for CloseDevice requests. +type CloseDeviceCookie struct { + *xgb.Cookie +} + +// CloseDevice sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) + return CloseDeviceCookie{cookie} +} + +// CloseDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseDeviceCookie.Check() +func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) + return CloseDeviceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CloseDeviceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CloseDevice +// closeDeviceRequest writes a CloseDevice request to a byte slice. +func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// DeviceBellCookie is a cookie used only for DeviceBell requests. +type DeviceBellCookie struct { + *xgb.Cookie +} + +// DeviceBell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return DeviceBellCookie{cookie} +} + +// DeviceBellChecked sends a checked request. +// If an error occurs, it can be retrieved using DeviceBellCookie.Check() +func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) + return DeviceBellCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeviceBellCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeviceBell +// deviceBellRequest writes a DeviceBell request to a byte slice. +func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = FeedbackId + b += 1 + + buf[b] = FeedbackClass + b += 1 + + buf[b] = byte(Percent) + b += 1 + + return buf +} + +// GetDeviceButtonMappingCookie is a cookie used only for GetDeviceButtonMapping requests. +type GetDeviceButtonMappingCookie struct { + *xgb.Cookie +} + +// GetDeviceButtonMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() +func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) + return GetDeviceButtonMappingCookie{cookie} +} + +// GetDeviceButtonMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) + return GetDeviceButtonMappingCookie{cookie} +} + +// GetDeviceButtonMappingReply represents the data returned from a GetDeviceButtonMapping request. +type GetDeviceButtonMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MapSize byte + // padding: 23 bytes + Map []byte // size: xgb.Pad((int(MapSize) * 1)) +} + +// Reply blocks and returns the reply data for a GetDeviceButtonMapping request. +func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceButtonMappingReply(buf), nil +} + +// getDeviceButtonMappingReply reads a byte slice into a GetDeviceButtonMappingReply value. +func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { + v := new(GetDeviceButtonMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MapSize = buf[b] + b += 1 + + b += 23 // padding + + v.Map = make([]byte, v.MapSize) + copy(v.Map[:v.MapSize], buf[b:]) + b += xgb.Pad(int(v.MapSize)) + + return v +} + +// Write request to wire for GetDeviceButtonMapping +// getDeviceButtonMappingRequest writes a GetDeviceButtonMapping request to a byte slice. +func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 28 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// GetDeviceControlCookie is a cookie used only for GetDeviceControl requests. +type GetDeviceControlCookie struct { + *xgb.Cookie +} + +// GetDeviceControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() +func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) + return GetDeviceControlCookie{cookie} +} + +// GetDeviceControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) + return GetDeviceControlCookie{cookie} +} + +// GetDeviceControlReply represents the data returned from a GetDeviceControl request. +type GetDeviceControlReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Reply blocks and returns the reply data for a GetDeviceControl request. +func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceControlReply(buf), nil +} + +// getDeviceControlReply reads a byte slice into a GetDeviceControlReply value. +func getDeviceControlReply(buf []byte) *GetDeviceControlReply { + v := new(GetDeviceControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Status = buf[b] + b += 1 + + b += 23 // padding + + return v +} + +// Write request to wire for GetDeviceControl +// getDeviceControlRequest writes a GetDeviceControl request to a byte slice. +func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], ControlId) + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 1 // padding + + return buf +} + +// GetDeviceDontPropagateListCookie is a cookie used only for GetDeviceDontPropagateList requests. +type GetDeviceDontPropagateListCookie struct { + *xgb.Cookie +} + +// GetDeviceDontPropagateList sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() +func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) + return GetDeviceDontPropagateListCookie{cookie} +} + +// GetDeviceDontPropagateListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) + return GetDeviceDontPropagateListCookie{cookie} +} + +// GetDeviceDontPropagateListReply represents the data returned from a GetDeviceDontPropagateList request. +type GetDeviceDontPropagateListReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumClasses uint16 + // padding: 22 bytes + Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) +} + +// Reply blocks and returns the reply data for a GetDeviceDontPropagateList request. +func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceDontPropagateListReply(buf), nil +} + +// getDeviceDontPropagateListReply reads a byte slice into a GetDeviceDontPropagateListReply value. +func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { + v := new(GetDeviceDontPropagateListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Classes = make([]EventClass, v.NumClasses) + for i := 0; i < int(v.NumClasses); i++ { + v.Classes[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDeviceDontPropagateList +// getDeviceDontPropagateListRequest writes a GetDeviceDontPropagateList request to a byte slice. +func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetDeviceFocusCookie is a cookie used only for GetDeviceFocus requests. +type GetDeviceFocusCookie struct { + *xgb.Cookie +} + +// GetDeviceFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() +func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) + return GetDeviceFocusCookie{cookie} +} + +// GetDeviceFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) + return GetDeviceFocusCookie{cookie} +} + +// GetDeviceFocusReply represents the data returned from a GetDeviceFocus request. +type GetDeviceFocusReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Focus xproto.Window + Time xproto.Timestamp + RevertTo byte + // padding: 15 bytes +} + +// Reply blocks and returns the reply data for a GetDeviceFocus request. +func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceFocusReply(buf), nil +} + +// getDeviceFocusReply reads a byte slice into a GetDeviceFocusReply value. +func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { + v := new(GetDeviceFocusReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Focus = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.RevertTo = buf[b] + b += 1 + + b += 15 // padding + + return v +} + +// Write request to wire for GetDeviceFocus +// getDeviceFocusRequest writes a GetDeviceFocus request to a byte slice. +func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// GetDeviceKeyMappingCookie is a cookie used only for GetDeviceKeyMapping requests. +type GetDeviceKeyMappingCookie struct { + *xgb.Cookie +} + +// GetDeviceKeyMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() +func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) + return GetDeviceKeyMappingCookie{cookie} +} + +// GetDeviceKeyMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) + return GetDeviceKeyMappingCookie{cookie} +} + +// GetDeviceKeyMappingReply represents the data returned from a GetDeviceKeyMapping request. +type GetDeviceKeyMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + KeysymsPerKeycode byte + // padding: 23 bytes + Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a GetDeviceKeyMapping request. +func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceKeyMappingReply(buf), nil +} + +// getDeviceKeyMappingReply reads a byte slice into a GetDeviceKeyMappingReply value. +func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { + v := new(GetDeviceKeyMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeysymsPerKeycode = buf[b] + b += 1 + + b += 23 // padding + + v.Keysyms = make([]xproto.Keysym, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetDeviceKeyMapping +// getDeviceKeyMappingRequest writes a GetDeviceKeyMapping request to a byte slice. +func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 24 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return buf +} + +// GetDeviceModifierMappingCookie is a cookie used only for GetDeviceModifierMapping requests. +type GetDeviceModifierMappingCookie struct { + *xgb.Cookie +} + +// GetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() +func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) + return GetDeviceModifierMappingCookie{cookie} +} + +// GetDeviceModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) + return GetDeviceModifierMappingCookie{cookie} +} + +// GetDeviceModifierMappingReply represents the data returned from a GetDeviceModifierMapping request. +type GetDeviceModifierMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + KeycodesPerModifier byte + // padding: 23 bytes + Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) +} + +// Reply blocks and returns the reply data for a GetDeviceModifierMapping request. +func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceModifierMappingReply(buf), nil +} + +// getDeviceModifierMappingReply reads a byte slice into a GetDeviceModifierMappingReply value. +func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { + v := new(GetDeviceModifierMappingReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.KeycodesPerModifier = buf[b] + b += 1 + + b += 23 // padding + + v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) + copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) + b += xgb.Pad(int((int(v.KeycodesPerModifier) * 8))) + + return v +} + +// Write request to wire for GetDeviceModifierMapping +// getDeviceModifierMappingRequest writes a GetDeviceModifierMapping request to a byte slice. +func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 26 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// GetDeviceMotionEventsCookie is a cookie used only for GetDeviceMotionEvents requests. +type GetDeviceMotionEventsCookie struct { + *xgb.Cookie +} + +// GetDeviceMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() +func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) + return GetDeviceMotionEventsCookie{cookie} +} + +// GetDeviceMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) + return GetDeviceMotionEventsCookie{cookie} +} + +// GetDeviceMotionEventsReply represents the data returned from a GetDeviceMotionEvents request. +type GetDeviceMotionEventsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumCoords uint32 + NumAxes byte + DeviceMode byte + // padding: 18 bytes +} + +// Reply blocks and returns the reply data for a GetDeviceMotionEvents request. +func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getDeviceMotionEventsReply(buf), nil +} + +// getDeviceMotionEventsReply reads a byte slice into a GetDeviceMotionEventsReply value. +func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { + v := new(GetDeviceMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumCoords = xgb.Get32(buf[b:]) + b += 4 + + v.NumAxes = buf[b] + b += 1 + + v.DeviceMode = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +// Write request to wire for GetDeviceMotionEvents +// getDeviceMotionEventsRequest writes a GetDeviceMotionEvents request to a byte slice. +func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Start)) + b += 4 + + xgb.Put32(buf[b:], uint32(Stop)) + b += 4 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// GetExtensionVersionCookie is a cookie used only for GetExtensionVersion requests. +type GetExtensionVersionCookie struct { + *xgb.Cookie +} + +// GetExtensionVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() +func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) + return GetExtensionVersionCookie{cookie} +} + +// GetExtensionVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) + return GetExtensionVersionCookie{cookie} +} + +// GetExtensionVersionReply represents the data returned from a GetExtensionVersion request. +type GetExtensionVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ServerMajor uint16 + ServerMinor uint16 + Present bool + // padding: 19 bytes +} + +// Reply blocks and returns the reply data for a GetExtensionVersion request. +func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getExtensionVersionReply(buf), nil +} + +// getExtensionVersionReply reads a byte slice into a GetExtensionVersionReply value. +func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { + v := new(GetExtensionVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 + + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.Present = true + } else { + v.Present = false + } + b += 1 + + b += 19 // padding + + return v +} + +// Write request to wire for GetExtensionVersion +// getExtensionVersionRequest writes a GetExtensionVersion request to a byte slice. +func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += xgb.Pad(int(NameLen)) + + return buf +} + +// GetFeedbackControlCookie is a cookie used only for GetFeedbackControl requests. +type GetFeedbackControlCookie struct { + *xgb.Cookie +} + +// GetFeedbackControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() +func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) + return GetFeedbackControlCookie{cookie} +} + +// GetFeedbackControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) + return GetFeedbackControlCookie{cookie} +} + +// GetFeedbackControlReply represents the data returned from a GetFeedbackControl request. +type GetFeedbackControlReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumFeedback uint16 + // padding: 22 bytes +} + +// Reply blocks and returns the reply data for a GetFeedbackControl request. +func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFeedbackControlReply(buf), nil +} + +// getFeedbackControlReply reads a byte slice into a GetFeedbackControlReply value. +func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { + v := new(GetFeedbackControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFeedback = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + return v +} + +// Write request to wire for GetFeedbackControl +// getFeedbackControlRequest writes a GetFeedbackControl request to a byte slice. +func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 22 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// GetSelectedExtensionEventsCookie is a cookie used only for GetSelectedExtensionEvents requests. +type GetSelectedExtensionEventsCookie struct { + *xgb.Cookie +} + +// GetSelectedExtensionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() +func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) + return GetSelectedExtensionEventsCookie{cookie} +} + +// GetSelectedExtensionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) + return GetSelectedExtensionEventsCookie{cookie} +} + +// GetSelectedExtensionEventsReply represents the data returned from a GetSelectedExtensionEvents request. +type GetSelectedExtensionEventsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumThisClasses uint16 + NumAllClasses uint16 + // padding: 20 bytes + ThisClasses []EventClass // size: xgb.Pad((int(NumThisClasses) * 4)) + AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) +} + +// Reply blocks and returns the reply data for a GetSelectedExtensionEvents request. +func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectedExtensionEventsReply(buf), nil +} + +// getSelectedExtensionEventsReply reads a byte slice into a GetSelectedExtensionEventsReply value. +func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { + v := new(GetSelectedExtensionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumThisClasses = xgb.Get16(buf[b:]) + b += 2 + + v.NumAllClasses = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + v.ThisClasses = make([]EventClass, v.NumThisClasses) + for i := 0; i < int(v.NumThisClasses); i++ { + v.ThisClasses[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.AllClasses = make([]EventClass, v.NumAllClasses) + for i := 0; i < int(v.NumAllClasses); i++ { + v.AllClasses[i] = EventClass(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetSelectedExtensionEvents +// getSelectedExtensionEventsRequest writes a GetSelectedExtensionEvents request to a byte slice. +func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + // GrabDeviceCookie is a cookie used only for GrabDevice requests. type GrabDeviceCookie struct { *xgb.Cookie @@ -5787,61 +6222,90 @@ func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timest return buf } -// UngrabDeviceCookie is a cookie used only for UngrabDevice requests. -type UngrabDeviceCookie struct { +// GrabDeviceButtonCookie is a cookie used only for GrabDeviceButton requests. +type GrabDeviceButtonCookie struct { *xgb.Cookie } -// UngrabDevice sends an unchecked request. +// GrabDeviceButton sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { +func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) - return UngrabDeviceCookie{cookie} + c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return GrabDeviceButtonCookie{cookie} } -// UngrabDeviceChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() -func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { +// GrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() +func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) - return UngrabDeviceCookie{cookie} + c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) + return GrabDeviceButtonCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceCookie) Check() error { +func (cook GrabDeviceButtonCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabDevice -// ungrabDeviceRequest writes a UngrabDevice request to a byte slice. -func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { - size := 12 +// Write request to wire for GrabDeviceButton +// grabDeviceButtonRequest writes a GrabDeviceButton request to a byte slice. +func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { + size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 14 // request opcode + buf[b] = 17 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - buf[b] = DeviceId + buf[b] = GrabbedDevice b += 1 + buf[b] = ModifierDevice + b += 1 + + xgb.Put16(buf[b:], NumClasses) + b += 2 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ThisDeviceMode + b += 1 + + buf[b] = OtherDeviceMode + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = OwnerEvents + b += 1 + + b += 2 // padding + + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) + b += 4 + } + b = xgb.Pad(b) + return buf } @@ -5936,149 +6400,343 @@ func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint return buf } -// UngrabDeviceKeyCookie is a cookie used only for UngrabDeviceKey requests. -type UngrabDeviceKeyCookie struct { +// ListInputDevicesCookie is a cookie used only for ListInputDevices requests. +type ListInputDevicesCookie struct { *xgb.Cookie } -// UngrabDeviceKey sends an unchecked request. +// ListInputDevices sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() +func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(listInputDevicesRequest(c), cookie) + return ListInputDevicesCookie{cookie} +} + +// ListInputDevicesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { +func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return UngrabDeviceKeyCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(listInputDevicesRequest(c), cookie) + return ListInputDevicesCookie{cookie} } -// UngrabDeviceKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() -func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") +// ListInputDevicesReply represents the data returned from a ListInputDevices request. +type ListInputDevicesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + DevicesLen byte + // padding: 23 bytes + Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) +} + +// Reply blocks and returns the reply data for a ListInputDevices request. +func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return UngrabDeviceKeyCookie{cookie} + if buf == nil { + return nil, nil + } + return listInputDevicesReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceKeyCookie) Check() error { - return cook.Cookie.Check() +// listInputDevicesReply reads a byte slice into a ListInputDevicesReply value. +func listInputDevicesReply(buf []byte) *ListInputDevicesReply { + v := new(ListInputDevicesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.DevicesLen = buf[b] + b += 1 + + b += 23 // padding + + v.Devices = make([]DeviceInfo, v.DevicesLen) + b += DeviceInfoReadList(buf[b:], v.Devices) + + return v } -// Write request to wire for UngrabDeviceKey -// ungrabDeviceKeyRequest writes a UngrabDeviceKey request to a byte slice. -func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { - size := 16 +// Write request to wire for ListInputDevices +// listInputDevicesRequest writes a ListInputDevices request to a byte slice. +func listInputDevicesRequest(c *xgb.Conn) []byte { + size := 4 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 16 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Key - b += 1 - - buf[b] = GrabbedDevice - b += 1 - return buf } -// GrabDeviceButtonCookie is a cookie used only for GrabDeviceButton requests. -type GrabDeviceButtonCookie struct { +// OpenDeviceCookie is a cookie used only for OpenDevice requests. +type OpenDeviceCookie struct { *xgb.Cookie } -// GrabDeviceButton sends an unchecked request. +// OpenDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() +func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(openDeviceRequest(c, DeviceId), cookie) + return OpenDeviceCookie{cookie} +} + +// OpenDeviceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { +func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return GrabDeviceButtonCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(openDeviceRequest(c, DeviceId), cookie) + return OpenDeviceCookie{cookie} } -// GrabDeviceButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() -func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") +// OpenDeviceReply represents the data returned from a OpenDevice request. +type OpenDeviceReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes + ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) +} + +// Reply blocks and returns the reply data for a OpenDevice request. +func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return GrabDeviceButtonCookie{cookie} + if buf == nil { + return nil, nil + } + return openDeviceReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GrabDeviceButtonCookie) Check() error { - return cook.Cookie.Check() +// openDeviceReply reads a byte slice into a OpenDeviceReply value. +func openDeviceReply(buf []byte) *OpenDeviceReply { + v := new(OpenDeviceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumClasses = buf[b] + b += 1 + + b += 23 // padding + + v.ClassInfo = make([]InputClassInfo, v.NumClasses) + b += InputClassInfoReadList(buf[b:], v.ClassInfo) + + return v } -// Write request to wire for GrabDeviceButton -// grabDeviceButtonRequest writes a GrabDeviceButton request to a byte slice. -func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { - size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// Write request to wire for OpenDevice +// openDeviceRequest writes a OpenDevice request to a byte slice. +func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 17 // request opcode + buf[b] = 3 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(GrabWindow)) + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// QueryDeviceStateCookie is a cookie used only for QueryDeviceState requests. +type QueryDeviceStateCookie struct { + *xgb.Cookie +} + +// QueryDeviceState sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() +func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) + return QueryDeviceStateCookie{cookie} +} + +// QueryDeviceStateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) + return QueryDeviceStateCookie{cookie} +} + +// QueryDeviceStateReply represents the data returned from a QueryDeviceState request. +type QueryDeviceStateReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumClasses byte + // padding: 23 bytes +} + +// Reply blocks and returns the reply data for a QueryDeviceState request. +func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryDeviceStateReply(buf), nil +} + +// queryDeviceStateReply reads a byte slice into a QueryDeviceStateReply value. +func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { + v := new(QueryDeviceStateReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - buf[b] = GrabbedDevice + v.NumClasses = buf[b] b += 1 - buf[b] = ModifierDevice + b += 23 // padding + + return v +} + +// Write request to wire for QueryDeviceState +// queryDeviceStateRequest writes a QueryDeviceState request to a byte slice. +func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 + buf[b] = 30 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = DeviceId + b += 1 + + b += 3 // padding + + return buf +} + +// SelectExtensionEventCookie is a cookie used only for SelectExtensionEvent requests. +type SelectExtensionEventCookie struct { + *xgb.Cookie +} + +// SelectExtensionEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) + return SelectExtensionEventCookie{cookie} +} + +// SelectExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() +func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) + return SelectExtensionEventCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectExtensionEventCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectExtensionEvent +// selectExtensionEventRequest writes a SelectExtensionEvent request to a byte slice. +func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + xgb.Put16(buf[b:], NumClasses) b += 2 - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = OwnerEvents - b += 1 - b += 2 // padding for i := 0; i < int(NumClasses); i++ { @@ -6090,859 +6748,85 @@ func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevic return buf } -// UngrabDeviceButtonCookie is a cookie used only for UngrabDeviceButton requests. -type UngrabDeviceButtonCookie struct { +// SendExtensionEventCookie is a cookie used only for SendExtensionEvent requests. +type SendExtensionEventCookie struct { *xgb.Cookie } -// UngrabDeviceButton sends an unchecked request. +// SendExtensionEvent sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { +func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return UngrabDeviceButtonCookie{cookie} + c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return SendExtensionEventCookie{cookie} } -// UngrabDeviceButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() -func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { +// SendExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() +func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return UngrabDeviceButtonCookie{cookie} + c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) + return SendExtensionEventCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceButtonCookie) Check() error { +func (cook SendExtensionEventCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabDeviceButton -// ungrabDeviceButtonRequest writes a UngrabDeviceButton request to a byte slice. -func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { - size := 16 +// Write request to wire for SendExtensionEvent +// sendExtensionEventRequest writes a SendExtensionEvent request to a byte slice. +func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { + size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 18 // request opcode + buf[b] = 31 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(GrabWindow)) + xgb.Put32(buf[b:], uint32(Destination)) b += 4 - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - return buf -} - -// AllowDeviceEventsCookie is a cookie used only for AllowDeviceEvents requests. -type AllowDeviceEventsCookie struct { - *xgb.Cookie -} - -// AllowDeviceEvents sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) - return AllowDeviceEventsCookie{cookie} -} - -// AllowDeviceEventsChecked sends a checked request. -// If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() -func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) - return AllowDeviceEventsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AllowDeviceEventsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AllowDeviceEvents -// allowDeviceEventsRequest writes a AllowDeviceEvents request to a byte slice. -func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = Mode - b += 1 - buf[b] = DeviceId b += 1 - return buf -} - -// GetDeviceFocusCookie is a cookie used only for GetDeviceFocus requests. -type GetDeviceFocusCookie struct { - *xgb.Cookie -} - -// GetDeviceFocus sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() -func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + if Propagate { + buf[b] = 1 + } else { + buf[b] = 0 } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) - return GetDeviceFocusCookie{cookie} -} + b += 1 -// GetDeviceFocusUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) - return GetDeviceFocusCookie{cookie} -} - -// GetDeviceFocusReply represents the data returned from a GetDeviceFocus request. -type GetDeviceFocusReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Focus xproto.Window - Time xproto.Timestamp - RevertTo byte - // padding: 15 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceFocus request. -func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceFocusReply(buf), nil -} - -// getDeviceFocusReply reads a byte slice into a GetDeviceFocusReply value. -func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { - v := new(GetDeviceFocusReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) + xgb.Put16(buf[b:], NumClasses) b += 2 - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Focus = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.RevertTo = buf[b] - b += 1 - - b += 15 // padding - - return v -} - -// Write request to wire for GetDeviceFocus -// getDeviceFocusRequest writes a GetDeviceFocus request to a byte slice. -func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId + buf[b] = NumEvents b += 1 b += 3 // padding - return buf -} + copy(buf[b:], Events[:(int(NumEvents)*32)]) + b += xgb.Pad(int((int(NumEvents) * 32))) -// SetDeviceFocusCookie is a cookie used only for SetDeviceFocus requests. -type SetDeviceFocusCookie struct { - *xgb.Cookie -} - -// SetDeviceFocus sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) - return SetDeviceFocusCookie{cookie} -} - -// SetDeviceFocusChecked sends a checked request. -// If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() -func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) - return SetDeviceFocusCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetDeviceFocusCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetDeviceFocus -// setDeviceFocusRequest writes a SetDeviceFocus request to a byte slice. -func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Focus)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = RevertTo - b += 1 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// GetFeedbackControlCookie is a cookie used only for GetFeedbackControl requests. -type GetFeedbackControlCookie struct { - *xgb.Cookie -} - -// GetFeedbackControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() -func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) - return GetFeedbackControlCookie{cookie} -} - -// GetFeedbackControlUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) - return GetFeedbackControlCookie{cookie} -} - -// GetFeedbackControlReply represents the data returned from a GetFeedbackControl request. -type GetFeedbackControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumFeedback uint16 - // padding: 22 bytes -} - -// Reply blocks and returns the reply data for a GetFeedbackControl request. -func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getFeedbackControlReply(buf), nil -} - -// getFeedbackControlReply reads a byte slice into a GetFeedbackControlReply value. -func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { - v := new(GetFeedbackControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFeedback = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -// Write request to wire for GetFeedbackControl -// getFeedbackControlRequest writes a GetFeedbackControl request to a byte slice. -func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// GetDeviceKeyMappingCookie is a cookie used only for GetDeviceKeyMapping requests. -type GetDeviceKeyMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceKeyMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() -func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) - return GetDeviceKeyMappingCookie{cookie} -} - -// GetDeviceKeyMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) - return GetDeviceKeyMappingCookie{cookie} -} - -// GetDeviceKeyMappingReply represents the data returned from a GetDeviceKeyMapping request. -type GetDeviceKeyMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - KeysymsPerKeycode byte - // padding: 23 bytes - Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GetDeviceKeyMapping request. -func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceKeyMappingReply(buf), nil -} - -// getDeviceKeyMappingReply reads a byte slice into a GetDeviceKeyMappingReply value. -func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { - v := new(GetDeviceKeyMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeysymsPerKeycode = buf[b] - b += 1 - - b += 23 // padding - - v.Keysyms = make([]xproto.Keysym, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) + for i := 0; i < int(NumClasses); i++ { + xgb.Put32(buf[b:], uint32(Classes[i])) b += 4 } b = xgb.Pad(b) - return v -} - -// Write request to wire for GetDeviceKeyMapping -// getDeviceKeyMappingRequest writes a GetDeviceKeyMapping request to a byte slice. -func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = Count - b += 1 - - return buf -} - -// ChangeDeviceKeyMappingCookie is a cookie used only for ChangeDeviceKeyMapping requests. -type ChangeDeviceKeyMappingCookie struct { - *xgb.Cookie -} - -// ChangeDeviceKeyMapping sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return ChangeDeviceKeyMappingCookie{cookie} -} - -// ChangeDeviceKeyMappingChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() -func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return ChangeDeviceKeyMappingCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeDeviceKeyMappingCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeDeviceKeyMapping -// changeDeviceKeyMappingRequest writes a ChangeDeviceKeyMapping request to a byte slice. -func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { - size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = KeysymsPerKeycode - b += 1 - - buf[b] = KeycodeCount - b += 1 - - for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { - xgb.Put32(buf[b:], uint32(Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GetDeviceModifierMappingCookie is a cookie used only for GetDeviceModifierMapping requests. -type GetDeviceModifierMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() -func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) - return GetDeviceModifierMappingCookie{cookie} -} - -// GetDeviceModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) - return GetDeviceModifierMappingCookie{cookie} -} - -// GetDeviceModifierMappingReply represents the data returned from a GetDeviceModifierMapping request. -type GetDeviceModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - KeycodesPerModifier byte - // padding: 23 bytes - Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) -} - -// Reply blocks and returns the reply data for a GetDeviceModifierMapping request. -func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceModifierMappingReply(buf), nil -} - -// getDeviceModifierMappingReply reads a byte slice into a GetDeviceModifierMappingReply value. -func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { - v := new(GetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeycodesPerModifier = buf[b] - b += 1 - - b += 23 // padding - - v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) - copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) - b += xgb.Pad(int((int(v.KeycodesPerModifier) * 8))) - - return v -} - -// Write request to wire for GetDeviceModifierMapping -// getDeviceModifierMappingRequest writes a GetDeviceModifierMapping request to a byte slice. -func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// SetDeviceModifierMappingCookie is a cookie used only for SetDeviceModifierMapping requests. -type SetDeviceModifierMappingCookie struct { - *xgb.Cookie -} - -// SetDeviceModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() -func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) - return SetDeviceModifierMappingCookie{cookie} -} - -// SetDeviceModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) - return SetDeviceModifierMappingCookie{cookie} -} - -// SetDeviceModifierMappingReply represents the data returned from a SetDeviceModifierMapping request. -type SetDeviceModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceModifierMapping request. -func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceModifierMappingReply(buf), nil -} - -// setDeviceModifierMappingReply reads a byte slice into a SetDeviceModifierMappingReply value. -func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { - v := new(SetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceModifierMapping -// setDeviceModifierMappingRequest writes a SetDeviceModifierMapping request to a byte slice. -func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { - size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = KeycodesPerModifier - b += 1 - - b += 1 // padding - - copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) - b += xgb.Pad(int((int(KeycodesPerModifier) * 8))) - - return buf -} - -// GetDeviceButtonMappingCookie is a cookie used only for GetDeviceButtonMapping requests. -type GetDeviceButtonMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceButtonMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() -func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) - return GetDeviceButtonMappingCookie{cookie} -} - -// GetDeviceButtonMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) - return GetDeviceButtonMappingCookie{cookie} -} - -// GetDeviceButtonMappingReply represents the data returned from a GetDeviceButtonMapping request. -type GetDeviceButtonMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MapSize byte - // padding: 23 bytes - Map []byte // size: xgb.Pad((int(MapSize) * 1)) -} - -// Reply blocks and returns the reply data for a GetDeviceButtonMapping request. -func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceButtonMappingReply(buf), nil -} - -// getDeviceButtonMappingReply reads a byte slice into a GetDeviceButtonMappingReply value. -func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { - v := new(GetDeviceButtonMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MapSize = buf[b] - b += 1 - - b += 23 // padding - - v.Map = make([]byte, v.MapSize) - copy(v.Map[:v.MapSize], buf[b:]) - b += xgb.Pad(int(v.MapSize)) - - return v -} - -// Write request to wire for GetDeviceButtonMapping -// getDeviceButtonMappingRequest writes a GetDeviceButtonMapping request to a byte slice. -func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - return buf } @@ -7045,44 +6929,108 @@ func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map return buf } -// QueryDeviceStateCookie is a cookie used only for QueryDeviceState requests. -type QueryDeviceStateCookie struct { +// SetDeviceFocusCookie is a cookie used only for SetDeviceFocus requests. +type SetDeviceFocusCookie struct { *xgb.Cookie } -// QueryDeviceState sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() -func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { +// SetDeviceFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) + return SetDeviceFocusCookie{cookie} +} + +// SetDeviceFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() +func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) + return SetDeviceFocusCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetDeviceFocusCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceFocus +// setDeviceFocusRequest writes a SetDeviceFocus request to a byte slice. +func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 21 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Focus)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + buf[b] = RevertTo + b += 1 + + buf[b] = DeviceId + b += 1 + + return buf +} + +// SetDeviceModeCookie is a cookie used only for SetDeviceMode requests. +type SetDeviceModeCookie struct { + *xgb.Cookie +} + +// SetDeviceMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() +func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) - return QueryDeviceStateCookie{cookie} + c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) + return SetDeviceModeCookie{cookie} } -// QueryDeviceStateUnchecked sends an unchecked request. +// SetDeviceModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { +func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) - return QueryDeviceStateCookie{cookie} + c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) + return SetDeviceModeCookie{cookie} } -// QueryDeviceStateReply represents the data returned from a QueryDeviceState request. -type QueryDeviceStateReply struct { +// SetDeviceModeReply represents the data returned from a SetDeviceMode request. +type SetDeviceModeReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - NumClasses byte + Status byte // padding: 23 bytes } -// Reply blocks and returns the reply data for a QueryDeviceState request. -func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { +// Reply blocks and returns the reply data for a SetDeviceMode request. +func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -7090,12 +7038,12 @@ func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { if buf == nil { return nil, nil } - return queryDeviceStateReply(buf), nil + return setDeviceModeReply(buf), nil } -// queryDeviceStateReply reads a byte slice into a QueryDeviceStateReply value. -func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { - v := new(QueryDeviceStateReply) +// setDeviceModeReply reads a byte slice into a SetDeviceModeReply value. +func setDeviceModeReply(buf []byte) *SetDeviceModeReply { + v := new(SetDeviceModeReply) b := 1 // skip reply determinant b += 1 // padding @@ -7106,7 +7054,7 @@ func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.NumClasses = buf[b] + v.Status = buf[b] b += 1 b += 23 // padding @@ -7114,9 +7062,9 @@ func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { return v } -// Write request to wire for QueryDeviceState -// queryDeviceStateRequest writes a QueryDeviceState request to a byte slice. -func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { +// Write request to wire for SetDeviceMode +// setDeviceModeRequest writes a SetDeviceMode request to a byte slice. +func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -7124,7 +7072,7 @@ func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 30 // request opcode + buf[b] = 5 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -7133,137 +7081,94 @@ func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { buf[b] = DeviceId b += 1 - b += 3 // padding + buf[b] = Mode + b += 1 + + b += 2 // padding return buf } -// SendExtensionEventCookie is a cookie used only for SendExtensionEvent requests. -type SendExtensionEventCookie struct { +// SetDeviceModifierMappingCookie is a cookie used only for SetDeviceModifierMapping requests. +type SetDeviceModifierMappingCookie struct { *xgb.Cookie } -// SendExtensionEvent sends an unchecked request. +// SetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() +func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) + return SetDeviceModifierMappingCookie{cookie} +} + +// SetDeviceModifierMappingUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { +func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return SendExtensionEventCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) + return SetDeviceModifierMappingCookie{cookie} } -// SendExtensionEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() -func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") +// SetDeviceModifierMappingReply represents the data returned from a SetDeviceModifierMapping request. +type SetDeviceModifierMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Status byte + // padding: 23 bytes +} + +// Reply blocks and returns the reply data for a SetDeviceModifierMapping request. +func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return SendExtensionEventCookie{cookie} + if buf == nil { + return nil, nil + } + return setDeviceModifierMappingReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SendExtensionEventCookie) Check() error { - return cook.Cookie.Check() -} +// setDeviceModifierMappingReply reads a byte slice into a SetDeviceModifierMappingReply value. +func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { + v := new(SetDeviceModifierMappingReply) + b := 1 // skip reply determinant -// Write request to wire for SendExtensionEvent -// sendExtensionEventRequest writes a SendExtensionEvent request to a byte slice. -func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { - size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) + b += 1 // padding - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + v.Sequence = xgb.Get16(buf[b:]) b += 2 - xgb.Put32(buf[b:], uint32(Destination)) + v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - buf[b] = DeviceId + v.Status = buf[b] b += 1 - if Propagate { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 + b += 23 // padding - xgb.Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = NumEvents - b += 1 - - b += 3 // padding - - copy(buf[b:], Events[:(int(NumEvents)*32)]) - b += xgb.Pad(int((int(NumEvents) * 32))) - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf + return v } -// DeviceBellCookie is a cookie used only for DeviceBell requests. -type DeviceBellCookie struct { - *xgb.Cookie -} - -// DeviceBell sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return DeviceBellCookie{cookie} -} - -// DeviceBellChecked sends a checked request. -// If an error occurs, it can be retrieved using DeviceBellCookie.Check() -func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return DeviceBellCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeviceBellCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeviceBell -// deviceBellRequest writes a DeviceBell request to a byte slice. -func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { - size := 8 +// Write request to wire for SetDeviceModifierMapping +// setDeviceModifierMappingRequest writes a SetDeviceModifierMapping request to a byte slice. +func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { + size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 32 // request opcode + buf[b] = 27 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -7272,14 +7177,13 @@ func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClas buf[b] = DeviceId b += 1 - buf[b] = FeedbackId + buf[b] = KeycodesPerModifier b += 1 - buf[b] = FeedbackClass - b += 1 + b += 1 // padding - buf[b] = byte(Percent) - b += 1 + copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) + b += xgb.Pad(int((int(KeycodesPerModifier) * 8))) return buf } @@ -7389,98 +7293,194 @@ func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, N return buf } -// GetDeviceControlCookie is a cookie used only for GetDeviceControl requests. -type GetDeviceControlCookie struct { +// UngrabDeviceCookie is a cookie used only for UngrabDevice requests. +type UngrabDeviceCookie struct { *xgb.Cookie } -// GetDeviceControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() -func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) - return GetDeviceControlCookie{cookie} -} - -// GetDeviceControlUnchecked sends an unchecked request. +// UngrabDevice sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { +func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) - return GetDeviceControlCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) + return UngrabDeviceCookie{cookie} } -// GetDeviceControlReply represents the data returned from a GetDeviceControl request. -type GetDeviceControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceControl request. -func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err +// UngrabDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() +func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") } - if buf == nil { - return nil, nil - } - return getDeviceControlReply(buf), nil + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) + return UngrabDeviceCookie{cookie} } -// getDeviceControlReply reads a byte slice into a GetDeviceControlReply value. -func getDeviceControlReply(buf []byte) *GetDeviceControlReply { - v := new(GetDeviceControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UngrabDeviceCookie) Check() error { + return cook.Cookie.Check() } -// Write request to wire for GetDeviceControl -// getDeviceControlRequest writes a GetDeviceControl request to a byte slice. -func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { - size := 8 +// Write request to wire for UngrabDevice +// ungrabDeviceRequest writes a UngrabDevice request to a byte slice. +func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { + size := 12 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XINPUTEXTENSION"] b += 1 - buf[b] = 34 // request opcode + buf[b] = 14 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put16(buf[b:], ControlId) - b += 2 + xgb.Put32(buf[b:], uint32(Time)) + b += 4 buf[b] = DeviceId b += 1 - b += 1 // padding + return buf +} + +// UngrabDeviceButtonCookie is a cookie used only for UngrabDeviceButton requests. +type UngrabDeviceButtonCookie struct { + *xgb.Cookie +} + +// UngrabDeviceButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return UngrabDeviceButtonCookie{cookie} +} + +// UngrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() +func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) + return UngrabDeviceButtonCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UngrabDeviceButtonCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabDeviceButton +// ungrabDeviceButtonRequest writes a UngrabDeviceButton request to a byte slice. +func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Button + b += 1 + + buf[b] = GrabbedDevice + b += 1 + + return buf +} + +// UngrabDeviceKeyCookie is a cookie used only for UngrabDeviceKey requests. +type UngrabDeviceKeyCookie struct { + *xgb.Cookie +} + +// UngrabDeviceKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return UngrabDeviceKeyCookie{cookie} +} + +// UngrabDeviceKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() +func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) + return UngrabDeviceKeyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UngrabDeviceKeyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabDeviceKey +// ungrabDeviceKeyRequest writes a UngrabDeviceKey request to a byte slice. +func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XINPUTEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(GrabWindow)) + b += 4 + + xgb.Put16(buf[b:], Modifiers) + b += 2 + + buf[b] = ModifierDevice + b += 1 + + buf[b] = Key + b += 1 + + buf[b] = GrabbedDevice + b += 1 return buf } diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 54fb065..8dfc660 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -2,7 +2,7 @@ package xprint /* - This file was generated by xprint.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xprint.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,50 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -const ( - GetDocFinished = 0 - GetDocSecondConsumer = 1 -) - -const ( - EvMaskNoEventMask = 0 - EvMaskPrintMask = 1 - EvMaskAttributeMask = 2 -) - -const ( - DetailStartJobNotify = 1 - DetailEndJobNotify = 2 - DetailStartDocNotify = 3 - DetailEndDocNotify = 4 - DetailStartPageNotify = 5 - DetailEndPageNotify = 6 -) - const ( AttrJobAttr = 1 AttrDocAttr = 2 @@ -94,191 +50,6 @@ const ( AttrSpoolerAttr = 7 ) -type Pcontext uint32 - -func NewPcontextId(c *xgb.Conn) (Pcontext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Pcontext(id), nil -} - -type String8 byte - -type Printer struct { - NameLen uint32 - Name []String8 // size: xgb.Pad((int(NameLen) * 1)) - DescLen uint32 - Description []String8 // size: xgb.Pad((int(DescLen) * 1)) -} - -// PrinterRead reads a byte slice into a Printer value. -func PrinterRead(buf []byte, v *Printer) int { - b := 0 - - v.NameLen = xgb.Get32(buf[b:]) - b += 4 - - v.Name = make([]String8, v.NameLen) - for i := 0; i < int(v.NameLen); i++ { - v.Name[i] = String8(buf[b]) - b += 1 - } - b = xgb.Pad(b) - - v.DescLen = xgb.Get32(buf[b:]) - b += 4 - - v.Description = make([]String8, v.DescLen) - for i := 0; i < int(v.DescLen); i++ { - v.Description[i] = String8(buf[b]) - b += 1 - } - b = xgb.Pad(b) - - return b -} - -// PrinterReadList reads a byte slice into a list of Printer values. -func PrinterReadList(buf []byte, dest []Printer) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Printer{} - b += PrinterRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Printer value to a byte slice. -func (v Printer) Bytes() []byte { - buf := make([]byte, (((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + xgb.Pad((int(v.DescLen) * 1)))) - b := 0 - - xgb.Put32(buf[b:], v.NameLen) - b += 4 - - for i := 0; i < int(v.NameLen); i++ { - buf[b] = byte(v.Name[i]) - b += 1 - } - b = xgb.Pad(b) - - xgb.Put32(buf[b:], v.DescLen) - b += 4 - - for i := 0; i < int(v.DescLen); i++ { - buf[b] = byte(v.Description[i]) - b += 1 - } - b = xgb.Pad(b) - - return buf -} - -// PrinterListBytes writes a list of Printer values to a byte slice. -func PrinterListBytes(buf []byte, list []Printer) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// PrinterListSize computes the size (bytes) of a list of Printer values. -func PrinterListSize(list []Printer) int { - size := 0 - for _, item := range list { - size += (((4 + xgb.Pad((int(item.NameLen) * 1))) + 4) + xgb.Pad((int(item.DescLen) * 1))) - } - return size -} - -// Notify is the event number for a NotifyEvent. -const Notify = 0 - -type NotifyEvent struct { - Sequence uint16 - Detail byte - Context Pcontext - Cancel bool -} - -// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. -func NotifyEventNew(buf []byte) xgb.Event { - v := NotifyEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Context = Pcontext(xgb.Get32(buf[b:])) - b += 4 - - if buf[b] == 1 { - v.Cancel = true - } else { - v.Cancel = false - } - b += 1 - - return v -} - -// Bytes writes a NotifyEvent value to a byte slice. -func (v NotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Context)) - b += 4 - - if v.Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// SequenceId returns the sequence id attached to the Notify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v NotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of NotifyEvent. -func (v NotifyEvent) String() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Context: %d", v.Context)) - fieldVals = append(fieldVals, xgb.Sprintf("Cancel: %t", v.Cancel)) - return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XpExtension"][0] = NotifyEventNew -} - // AttributNotify is the event number for a AttributNotifyEvent. const AttributNotify = 1 @@ -437,198 +208,181 @@ func init() { xgb.NewExtErrorFuncs["XpExtension"][1] = BadSequenceErrorNew } -// PrintQueryVersionCookie is a cookie used only for PrintQueryVersion requests. -type PrintQueryVersionCookie struct { - *xgb.Cookie +const ( + DetailStartJobNotify = 1 + DetailEndJobNotify = 2 + DetailStartDocNotify = 3 + DetailEndDocNotify = 4 + DetailStartPageNotify = 5 + DetailEndPageNotify = 6 +) + +const ( + EvMaskNoEventMask = 0 + EvMaskPrintMask = 1 + EvMaskAttributeMask = 2 +) + +const ( + GetDocFinished = 0 + GetDocSecondConsumer = 1 +) + +// Notify is the event number for a NotifyEvent. +const Notify = 0 + +type NotifyEvent struct { + Sequence uint16 + Detail byte + Context Pcontext + Cancel bool } -// PrintQueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() -func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(printQueryVersionRequest(c), cookie) - return PrintQueryVersionCookie{cookie} -} +// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice. +func NotifyEventNew(buf []byte) xgb.Event { + v := NotifyEvent{} + b := 1 // don't read event number -// PrintQueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(printQueryVersionRequest(c), cookie) - return PrintQueryVersionCookie{cookie} -} - -// PrintQueryVersionReply represents the data returned from a PrintQueryVersion request. -type PrintQueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion uint16 - MinorVersion uint16 -} - -// Reply blocks and returns the reply data for a PrintQueryVersion request. -func (cook PrintQueryVersionCookie) Reply() (*PrintQueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return printQueryVersionReply(buf), nil -} - -// printQueryVersionReply reads a byte slice into a PrintQueryVersionReply value. -func printQueryVersionReply(buf []byte) *PrintQueryVersionReply { - v := new(PrintQueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding + v.Detail = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 - v.Length = xgb.Get32(buf[b:]) // 4-byte units + v.Context = Pcontext(xgb.Get32(buf[b:])) b += 4 - v.MajorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.MinorVersion = xgb.Get16(buf[b:]) - b += 2 + if buf[b] == 1 { + v.Cancel = true + } else { + v.Cancel = false + } + b += 1 return v } -// Write request to wire for PrintQueryVersion -// printQueryVersionRequest writes a PrintQueryVersion request to a byte slice. -func printQueryVersionRequest(c *xgb.Conn) []byte { - size := 4 +// Bytes writes a NotifyEvent value to a byte slice. +func (v NotifyEvent) Bytes() []byte { + buf := make([]byte, 32) b := 0 - buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + // write event number + buf[b] = 0 b += 1 - buf[b] = 0 // request opcode + buf[b] = v.Detail b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Context)) + b += 4 + + if v.Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 return buf } -// PrintGetPrinterListCookie is a cookie used only for PrintGetPrinterList requests. -type PrintGetPrinterListCookie struct { - *xgb.Cookie +// SequenceId returns the sequence id attached to the Notify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v NotifyEvent) SequenceId() uint16 { + return v.Sequence } -// PrintGetPrinterList sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() -func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return PrintGetPrinterListCookie{cookie} +// String is a rudimentary string representation of NotifyEvent. +func (v NotifyEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Context: %d", v.Context)) + fieldVals = append(fieldVals, xgb.Sprintf("Cancel: %t", v.Cancel)) + return "Notify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } -// PrintGetPrinterListUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) - return PrintGetPrinterListCookie{cookie} +func init() { + xgb.NewExtEventFuncs["XpExtension"][0] = NotifyEventNew } -// PrintGetPrinterListReply represents the data returned from a PrintGetPrinterList request. -type PrintGetPrinterListReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ListCount uint32 - // padding: 20 bytes - Printers []Printer // size: PrinterListSize(Printers) -} +type Pcontext uint32 -// Reply blocks and returns the reply data for a PrintGetPrinterList request. -func (cook PrintGetPrinterListCookie) Reply() (*PrintGetPrinterListReply, error) { - buf, err := cook.Cookie.Reply() +func NewPcontextId(c *xgb.Conn) (Pcontext, error) { + id, err := c.NewId() if err != nil { - return nil, err + return 0, err } - if buf == nil { - return nil, nil - } - return printGetPrinterListReply(buf), nil + return Pcontext(id), nil } -// printGetPrinterListReply reads a byte slice into a PrintGetPrinterListReply value. -func printGetPrinterListReply(buf []byte) *PrintGetPrinterListReply { - v := new(PrintGetPrinterListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ListCount = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Printers = make([]Printer, v.ListCount) - b += PrinterReadList(buf[b:], v.Printers) - - return v +type Printer struct { + NameLen uint32 + Name []String8 // size: xgb.Pad((int(NameLen) * 1)) + DescLen uint32 + Description []String8 // size: xgb.Pad((int(DescLen) * 1)) } -// Write request to wire for PrintGetPrinterList -// printGetPrinterListRequest writes a PrintGetPrinterList request to a byte slice. -func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { - size := xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) +// PrinterRead reads a byte slice into a Printer value. +func PrinterRead(buf []byte, v *Printer) int { b := 0 - buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], PrinterNameLen) + v.NameLen = xgb.Get32(buf[b:]) b += 4 - xgb.Put32(buf[b:], LocaleLen) - b += 4 - - for i := 0; i < int(PrinterNameLen); i++ { - buf[b] = byte(PrinterName[i]) + v.Name = make([]String8, v.NameLen) + for i := 0; i < int(v.NameLen); i++ { + v.Name[i] = String8(buf[b]) b += 1 } b = xgb.Pad(b) - for i := 0; i < int(LocaleLen); i++ { - buf[b] = byte(Locale[i]) + v.DescLen = xgb.Get32(buf[b:]) + b += 4 + + v.Description = make([]String8, v.DescLen) + for i := 0; i < int(v.DescLen); i++ { + v.Description[i] = String8(buf[b]) + b += 1 + } + b = xgb.Pad(b) + + return b +} + +// PrinterReadList reads a byte slice into a list of Printer values. +func PrinterReadList(buf []byte, dest []Printer) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Printer{} + b += PrinterRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Printer value to a byte slice. +func (v Printer) Bytes() []byte { + buf := make([]byte, (((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + xgb.Pad((int(v.DescLen) * 1)))) + b := 0 + + xgb.Put32(buf[b:], v.NameLen) + b += 4 + + for i := 0; i < int(v.NameLen); i++ { + buf[b] = byte(v.Name[i]) + b += 1 + } + b = xgb.Pad(b) + + xgb.Put32(buf[b:], v.DescLen) + b += 4 + + for i := 0; i < int(v.DescLen); i++ { + buf[b] = byte(v.Description[i]) b += 1 } b = xgb.Pad(b) @@ -636,58 +390,53 @@ func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen ui return buf } -// PrintRehashPrinterListCookie is a cookie used only for PrintRehashPrinterList requests. -type PrintRehashPrinterListCookie struct { - *xgb.Cookie -} - -// PrintRehashPrinterList sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printRehashPrinterListRequest(c), cookie) - return PrintRehashPrinterListCookie{cookie} -} - -// PrintRehashPrinterListChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() -func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printRehashPrinterListRequest(c), cookie) - return PrintRehashPrinterListCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintRehashPrinterListCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintRehashPrinterList -// printRehashPrinterListRequest writes a PrintRehashPrinterList request to a byte slice. -func printRehashPrinterListRequest(c *xgb.Conn) []byte { - size := 4 +// PrinterListBytes writes a list of Printer values to a byte slice. +func PrinterListBytes(buf []byte, list []Printer) int { b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } +// PrinterListSize computes the size (bytes) of a list of Printer values. +func PrinterListSize(list []Printer) int { + size := 0 + for _, item := range list { + size += (((4 + xgb.Pad((int(item.NameLen) * 1))) + 4) + xgb.Pad((int(item.DescLen) * 1))) + } + return size +} + +type String8 byte + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + // CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { *xgb.Cookie @@ -761,42 +510,42 @@ func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, return buf } -// PrintSetContextCookie is a cookie used only for PrintSetContext requests. -type PrintSetContextCookie struct { +// PrintDestroyContextCookie is a cookie used only for PrintDestroyContext requests. +type PrintDestroyContextCookie struct { *xgb.Cookie } -// PrintSetContext sends an unchecked request. +// PrintDestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { +func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(printSetContextRequest(c, Context), cookie) - return PrintSetContextCookie{cookie} + c.NewRequest(printDestroyContextRequest(c, Context), cookie) + return PrintDestroyContextCookie{cookie} } -// PrintSetContextChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintSetContextCookie.Check() -func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { +// PrintDestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() +func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(printSetContextRequest(c, Context), cookie) - return PrintSetContextCookie{cookie} + c.NewRequest(printDestroyContextRequest(c, Context), cookie) + return PrintDestroyContextCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintSetContextCookie) Check() error { +func (cook PrintDestroyContextCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for PrintSetContext -// printSetContextRequest writes a PrintSetContext request to a byte slice. -func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { +// Write request to wire for PrintDestroyContext +// printDestroyContextRequest writes a PrintDestroyContext request to a byte slice. +func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -804,7 +553,7 @@ func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { buf[b] = c.Extensions["XPEXTENSION"] b += 1 - buf[b] = 3 // request opcode + buf[b] = 5 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -816,6 +565,285 @@ func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { return buf } +// PrintEndDocCookie is a cookie used only for PrintEndDoc requests. +type PrintEndDocCookie struct { + *xgb.Cookie +} + +// PrintEndDoc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printEndDocRequest(c, Cancel), cookie) + return PrintEndDocCookie{cookie} +} + +// PrintEndDocChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndDocCookie.Check() +func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printEndDocRequest(c, Cancel), cookie) + return PrintEndDocCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintEndDocCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndDoc +// printEndDocRequest writes a PrintEndDoc request to a byte slice. +func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// PrintEndJobCookie is a cookie used only for PrintEndJob requests. +type PrintEndJobCookie struct { + *xgb.Cookie +} + +// PrintEndJob sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printEndJobRequest(c, Cancel), cookie) + return PrintEndJobCookie{cookie} +} + +// PrintEndJobChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndJobCookie.Check() +func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printEndJobRequest(c, Cancel), cookie) + return PrintEndJobCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintEndJobCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndJob +// printEndJobRequest writes a PrintEndJob request to a byte slice. +func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + +// PrintEndPageCookie is a cookie used only for PrintEndPage requests. +type PrintEndPageCookie struct { + *xgb.Cookie +} + +// PrintEndPage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printEndPageRequest(c, Cancel), cookie) + return PrintEndPageCookie{cookie} +} + +// PrintEndPageChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintEndPageCookie.Check() +func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printEndPageRequest(c, Cancel), cookie) + return PrintEndPageCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintEndPageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintEndPage +// printEndPageRequest writes a PrintEndPage request to a byte slice. +func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + if Cancel { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// PrintGetAttributesCookie is a cookie used only for PrintGetAttributes requests. +type PrintGetAttributesCookie struct { + *xgb.Cookie +} + +// PrintGetAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() +func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) + return PrintGetAttributesCookie{cookie} +} + +// PrintGetAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) + return PrintGetAttributesCookie{cookie} +} + +// PrintGetAttributesReply represents the data returned from a PrintGetAttributes request. +type PrintGetAttributesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + StringLen uint32 + // padding: 20 bytes + Attributes String8 +} + +// Reply blocks and returns the reply data for a PrintGetAttributes request. +func (cook PrintGetAttributesCookie) Reply() (*PrintGetAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetAttributesReply(buf), nil +} + +// printGetAttributesReply reads a byte slice into a PrintGetAttributesReply value. +func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { + v := new(PrintGetAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.StringLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Attributes = String8(buf[b]) + b += 1 + + return v +} + +// Write request to wire for PrintGetAttributes +// printGetAttributesRequest writes a PrintGetAttributes request to a byte slice. +func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + buf[b] = Pool + b += 1 + + b += 3 // padding + + return buf +} + // PrintGetContextCookie is a cookie used only for PrintGetContext requests. type PrintGetContextCookie struct { *xgb.Cookie @@ -901,453 +929,6 @@ func printGetContextRequest(c *xgb.Conn) []byte { return buf } -// PrintDestroyContextCookie is a cookie used only for PrintDestroyContext requests. -type PrintDestroyContextCookie struct { - *xgb.Cookie -} - -// PrintDestroyContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printDestroyContextRequest(c, Context), cookie) - return PrintDestroyContextCookie{cookie} -} - -// PrintDestroyContextChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() -func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printDestroyContextRequest(c, Context), cookie) - return PrintDestroyContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintDestroyContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintDestroyContext -// printDestroyContextRequest writes a PrintDestroyContext request to a byte slice. -func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Context) - b += 4 - - return buf -} - -// PrintGetScreenOfContextCookie is a cookie used only for PrintGetScreenOfContext requests. -type PrintGetScreenOfContextCookie struct { - *xgb.Cookie -} - -// PrintGetScreenOfContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() -func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(printGetScreenOfContextRequest(c), cookie) - return PrintGetScreenOfContextCookie{cookie} -} - -// PrintGetScreenOfContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(printGetScreenOfContextRequest(c), cookie) - return PrintGetScreenOfContextCookie{cookie} -} - -// PrintGetScreenOfContextReply represents the data returned from a PrintGetScreenOfContext request. -type PrintGetScreenOfContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Root xproto.Window -} - -// Reply blocks and returns the reply data for a PrintGetScreenOfContext request. -func (cook PrintGetScreenOfContextCookie) Reply() (*PrintGetScreenOfContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return printGetScreenOfContextReply(buf), nil -} - -// printGetScreenOfContextReply reads a byte slice into a PrintGetScreenOfContextReply value. -func printGetScreenOfContextReply(buf []byte) *PrintGetScreenOfContextReply { - v := new(PrintGetScreenOfContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for PrintGetScreenOfContext -// printGetScreenOfContextRequest writes a PrintGetScreenOfContext request to a byte slice. -func printGetScreenOfContextRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// PrintStartJobCookie is a cookie used only for PrintStartJob requests. -type PrintStartJobCookie struct { - *xgb.Cookie -} - -// PrintStartJob sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printStartJobRequest(c, OutputMode), cookie) - return PrintStartJobCookie{cookie} -} - -// PrintStartJobChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintStartJobCookie.Check() -func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printStartJobRequest(c, OutputMode), cookie) - return PrintStartJobCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintStartJobCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintStartJob -// printStartJobRequest writes a PrintStartJob request to a byte slice. -func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = OutputMode - b += 1 - - return buf -} - -// PrintEndJobCookie is a cookie used only for PrintEndJob requests. -type PrintEndJobCookie struct { - *xgb.Cookie -} - -// PrintEndJob sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printEndJobRequest(c, Cancel), cookie) - return PrintEndJobCookie{cookie} -} - -// PrintEndJobChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintEndJobCookie.Check() -func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printEndJobRequest(c, Cancel), cookie) - return PrintEndJobCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintEndJobCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintEndJob -// printEndJobRequest writes a PrintEndJob request to a byte slice. -func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// PrintStartDocCookie is a cookie used only for PrintStartDoc requests. -type PrintStartDocCookie struct { - *xgb.Cookie -} - -// PrintStartDoc sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printStartDocRequest(c, DriverMode), cookie) - return PrintStartDocCookie{cookie} -} - -// PrintStartDocChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintStartDocCookie.Check() -func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printStartDocRequest(c, DriverMode), cookie) - return PrintStartDocCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintStartDocCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintStartDoc -// printStartDocRequest writes a PrintStartDoc request to a byte slice. -func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DriverMode - b += 1 - - return buf -} - -// PrintEndDocCookie is a cookie used only for PrintEndDoc requests. -type PrintEndDocCookie struct { - *xgb.Cookie -} - -// PrintEndDoc sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printEndDocRequest(c, Cancel), cookie) - return PrintEndDocCookie{cookie} -} - -// PrintEndDocChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintEndDocCookie.Check() -func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printEndDocRequest(c, Cancel), cookie) - return PrintEndDocCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintEndDocCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintEndDoc -// printEndDocRequest writes a PrintEndDoc request to a byte slice. -func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// PrintPutDocumentDataCookie is a cookie used only for PrintPutDocumentData requests. -type PrintPutDocumentDataCookie struct { - *xgb.Cookie -} - -// PrintPutDocumentData sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) - return PrintPutDocumentDataCookie{cookie} -} - -// PrintPutDocumentDataChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() -func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) - return PrintPutDocumentDataCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintPutDocumentDataCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintPutDocumentData -// printPutDocumentDataRequest writes a PrintPutDocumentData request to a byte slice. -func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) []byte { - size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], LenData) - b += 4 - - xgb.Put16(buf[b:], LenFmt) - b += 2 - - xgb.Put16(buf[b:], LenOptions) - b += 2 - - copy(buf[b:], Data[:LenData]) - b += xgb.Pad(int(LenData)) - - for i := 0; i < int(len(DocFormat)); i++ { - buf[b] = byte(DocFormat[i]) - b += 1 - } - b = xgb.Pad(b) - - for i := 0; i < int(len(Options)); i++ { - buf[b] = byte(Options[i]) - b += 1 - } - b = xgb.Pad(b) - - return buf -} - // PrintGetDocumentDataCookie is a cookie used only for PrintGetDocumentData requests. type PrintGetDocumentDataCookie struct { *xgb.Cookie @@ -1455,225 +1036,43 @@ func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) return buf } -// PrintStartPageCookie is a cookie used only for PrintStartPage requests. -type PrintStartPageCookie struct { +// PrintGetImageResolutionCookie is a cookie used only for PrintGetImageResolution requests. +type PrintGetImageResolutionCookie struct { *xgb.Cookie } -// PrintStartPage sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { +// PrintGetImageResolution sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() +func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printStartPageRequest(c, Window), cookie) - return PrintStartPageCookie{cookie} -} - -// PrintStartPageChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintStartPageCookie.Check() -func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printStartPageRequest(c, Window), cookie) - return PrintStartPageCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintStartPageCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintStartPage -// printStartPageRequest writes a PrintStartPage request to a byte slice. -func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// PrintEndPageCookie is a cookie used only for PrintEndPage requests. -type PrintEndPageCookie struct { - *xgb.Cookie -} - -// PrintEndPage sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printEndPageRequest(c, Cancel), cookie) - return PrintEndPageCookie{cookie} -} - -// PrintEndPageChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintEndPageCookie.Check() -func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printEndPageRequest(c, Cancel), cookie) - return PrintEndPageCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintEndPageCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintEndPage -// printEndPageRequest writes a PrintEndPage request to a byte slice. -func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - if Cancel { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// PrintSelectInputCookie is a cookie used only for PrintSelectInput requests. -type PrintSelectInputCookie struct { - *xgb.Cookie -} - -// PrintSelectInput sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) - return PrintSelectInputCookie{cookie} -} - -// PrintSelectInputChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() -func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) - return PrintSelectInputCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintSelectInputCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintSelectInput -// printSelectInputRequest writes a PrintSelectInput request to a byte slice. -func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - xgb.Put32(buf[b:], EventMask) - b += 4 - for i := 0; i < xgb.PopCount(int(EventMask)); i++ { - xgb.Put32(buf[b:], EventList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// PrintInputSelectedCookie is a cookie used only for PrintInputSelected requests. -type PrintInputSelectedCookie struct { - *xgb.Cookie -} - -// PrintInputSelected sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() -func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(printInputSelectedRequest(c, Context), cookie) - return PrintInputSelectedCookie{cookie} + c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) + return PrintGetImageResolutionCookie{cookie} } -// PrintInputSelectedUnchecked sends an unchecked request. +// PrintGetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { +func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(printInputSelectedRequest(c, Context), cookie) - return PrintInputSelectedCookie{cookie} + c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) + return PrintGetImageResolutionCookie{cookie} } -// PrintInputSelectedReply represents the data returned from a PrintInputSelected request. -type PrintInputSelectedReply struct { +// PrintGetImageResolutionReply represents the data returned from a PrintGetImageResolution request. +type PrintGetImageResolutionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - EventMask uint32 - EventList []uint32 - AllEventsMask uint32 - AllEventsList []uint32 + ImageResolution uint16 } -// Reply blocks and returns the reply data for a PrintInputSelected request. -func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { +// Reply blocks and returns the reply data for a PrintGetImageResolution request. +func (cook PrintGetImageResolutionCookie) Reply() (*PrintGetImageResolutionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1681,12 +1080,12 @@ func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { if buf == nil { return nil, nil } - return printInputSelectedReply(buf), nil + return printGetImageResolutionReply(buf), nil } -// printInputSelectedReply reads a byte slice into a PrintInputSelectedReply value. -func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { - v := new(PrintInputSelectedReply) +// printGetImageResolutionReply reads a byte slice into a PrintGetImageResolutionReply value. +func printGetImageResolutionReply(buf []byte) *PrintGetImageResolutionReply { + v := new(PrintGetImageResolutionReply) b := 1 // skip reply determinant b += 1 // padding @@ -1697,32 +1096,15 @@ func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.EventMask = xgb.Get32(buf[b:]) - b += 4 - - v.EventList = make([]uint32, xgb.PopCount(int(v.EventMask))) - for i := 0; i < xgb.PopCount(int(v.EventMask)); i++ { - v.EventList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.AllEventsMask = xgb.Get32(buf[b:]) - b += 4 - - v.AllEventsList = make([]uint32, xgb.PopCount(int(v.AllEventsMask))) - for i := 0; i < xgb.PopCount(int(v.AllEventsMask)); i++ { - v.AllEventsList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) + v.ImageResolution = xgb.Get16(buf[b:]) + b += 2 return v } -// Write request to wire for PrintInputSelected -// printInputSelectedRequest writes a PrintInputSelected request to a byte slice. -func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { +// Write request to wire for PrintGetImageResolution +// printGetImageResolutionRequest writes a PrintGetImageResolution request to a byte slice. +func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -1730,7 +1112,7 @@ func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { buf[b] = c.Extensions["XPEXTENSION"] b += 1 - buf[b] = 16 // request opcode + buf[b] = 24 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1742,106 +1124,6 @@ func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { return buf } -// PrintGetAttributesCookie is a cookie used only for PrintGetAttributes requests. -type PrintGetAttributesCookie struct { - *xgb.Cookie -} - -// PrintGetAttributes sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() -func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) - return PrintGetAttributesCookie{cookie} -} - -// PrintGetAttributesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(printGetAttributesRequest(c, Context, Pool), cookie) - return PrintGetAttributesCookie{cookie} -} - -// PrintGetAttributesReply represents the data returned from a PrintGetAttributes request. -type PrintGetAttributesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - StringLen uint32 - // padding: 20 bytes - Attributes String8 -} - -// Reply blocks and returns the reply data for a PrintGetAttributes request. -func (cook PrintGetAttributesCookie) Reply() (*PrintGetAttributesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return printGetAttributesReply(buf), nil -} - -// printGetAttributesReply reads a byte slice into a PrintGetAttributesReply value. -func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { - v := new(PrintGetAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.StringLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Attributes = String8(buf[b]) - b += 1 - - return v -} - -// Write request to wire for PrintGetAttributes -// printGetAttributesRequest writes a PrintGetAttributes request to a byte slice. -func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - buf[b] = Pool - b += 1 - - b += 3 // padding - - return buf -} - // PrintGetOneAttributesCookie is a cookie used only for PrintGetOneAttributes requests. type PrintGetOneAttributesCookie struct { *xgb.Cookie @@ -1955,78 +1237,6 @@ func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, return buf } -// PrintSetAttributesCookie is a cookie used only for PrintSetAttributes requests. -type PrintSetAttributesCookie struct { - *xgb.Cookie -} - -// PrintSetAttributes sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) - return PrintSetAttributesCookie{cookie} -} - -// PrintSetAttributesChecked sends a checked request. -// If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() -func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) - return PrintSetAttributesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PrintSetAttributesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PrintSetAttributes -// printSetAttributesRequest writes a PrintSetAttributes request to a byte slice. -func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XPEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Context)) - b += 4 - - xgb.Put32(buf[b:], StringLen) - b += 4 - - buf[b] = Pool - b += 1 - - buf[b] = Rule - b += 1 - - b += 2 // padding - - for i := 0; i < int(len(Attributes)); i++ { - buf[b] = byte(Attributes[i]) - b += 1 - } - b = xgb.Pad(b) - - return buf -} - // PrintGetPageDimensionsCookie is a cookie used only for PrintGetPageDimensions requests. type PrintGetPageDimensionsCookie struct { *xgb.Cookie @@ -2135,6 +1345,388 @@ func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { return buf } +// PrintGetPrinterListCookie is a cookie used only for PrintGetPrinterList requests. +type PrintGetPrinterListCookie struct { + *xgb.Cookie +} + +// PrintGetPrinterList sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() +func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return PrintGetPrinterListCookie{cookie} +} + +// PrintGetPrinterListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(printGetPrinterListRequest(c, PrinterNameLen, LocaleLen, PrinterName, Locale), cookie) + return PrintGetPrinterListCookie{cookie} +} + +// PrintGetPrinterListReply represents the data returned from a PrintGetPrinterList request. +type PrintGetPrinterListReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ListCount uint32 + // padding: 20 bytes + Printers []Printer // size: PrinterListSize(Printers) +} + +// Reply blocks and returns the reply data for a PrintGetPrinterList request. +func (cook PrintGetPrinterListCookie) Reply() (*PrintGetPrinterListReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetPrinterListReply(buf), nil +} + +// printGetPrinterListReply reads a byte slice into a PrintGetPrinterListReply value. +func printGetPrinterListReply(buf []byte) *PrintGetPrinterListReply { + v := new(PrintGetPrinterListReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ListCount = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Printers = make([]Printer, v.ListCount) + b += PrinterReadList(buf[b:], v.Printers) + + return v +} + +// Write request to wire for PrintGetPrinterList +// printGetPrinterListRequest writes a PrintGetPrinterList request to a byte slice. +func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) []byte { + size := xgb.Pad(((12 + xgb.Pad((int(PrinterNameLen) * 1))) + xgb.Pad((int(LocaleLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], PrinterNameLen) + b += 4 + + xgb.Put32(buf[b:], LocaleLen) + b += 4 + + for i := 0; i < int(PrinterNameLen); i++ { + buf[b] = byte(PrinterName[i]) + b += 1 + } + b = xgb.Pad(b) + + for i := 0; i < int(LocaleLen); i++ { + buf[b] = byte(Locale[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// PrintGetScreenOfContextCookie is a cookie used only for PrintGetScreenOfContext requests. +type PrintGetScreenOfContextCookie struct { + *xgb.Cookie +} + +// PrintGetScreenOfContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() +func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(printGetScreenOfContextRequest(c), cookie) + return PrintGetScreenOfContextCookie{cookie} +} + +// PrintGetScreenOfContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(printGetScreenOfContextRequest(c), cookie) + return PrintGetScreenOfContextCookie{cookie} +} + +// PrintGetScreenOfContextReply represents the data returned from a PrintGetScreenOfContext request. +type PrintGetScreenOfContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Root xproto.Window +} + +// Reply blocks and returns the reply data for a PrintGetScreenOfContext request. +func (cook PrintGetScreenOfContextCookie) Reply() (*PrintGetScreenOfContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printGetScreenOfContextReply(buf), nil +} + +// printGetScreenOfContextReply reads a byte slice into a PrintGetScreenOfContextReply value. +func printGetScreenOfContextReply(buf []byte) *PrintGetScreenOfContextReply { + v := new(PrintGetScreenOfContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for PrintGetScreenOfContext +// printGetScreenOfContextRequest writes a PrintGetScreenOfContext request to a byte slice. +func printGetScreenOfContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// PrintInputSelectedCookie is a cookie used only for PrintInputSelected requests. +type PrintInputSelectedCookie struct { + *xgb.Cookie +} + +// PrintInputSelected sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() +func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(printInputSelectedRequest(c, Context), cookie) + return PrintInputSelectedCookie{cookie} +} + +// PrintInputSelectedUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(printInputSelectedRequest(c, Context), cookie) + return PrintInputSelectedCookie{cookie} +} + +// PrintInputSelectedReply represents the data returned from a PrintInputSelected request. +type PrintInputSelectedReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + EventMask uint32 + EventList []uint32 + AllEventsMask uint32 + AllEventsList []uint32 +} + +// Reply blocks and returns the reply data for a PrintInputSelected request. +func (cook PrintInputSelectedCookie) Reply() (*PrintInputSelectedReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printInputSelectedReply(buf), nil +} + +// printInputSelectedReply reads a byte slice into a PrintInputSelectedReply value. +func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { + v := new(PrintInputSelectedReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventMask = xgb.Get32(buf[b:]) + b += 4 + + v.EventList = make([]uint32, xgb.PopCount(int(v.EventMask))) + for i := 0; i < xgb.PopCount(int(v.EventMask)); i++ { + v.EventList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.AllEventsMask = xgb.Get32(buf[b:]) + b += 4 + + v.AllEventsList = make([]uint32, xgb.PopCount(int(v.AllEventsMask))) + for i := 0; i < xgb.PopCount(int(v.AllEventsMask)); i++ { + v.AllEventsList[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for PrintInputSelected +// printInputSelectedRequest writes a PrintInputSelected request to a byte slice. +func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + return buf +} + +// PrintPutDocumentDataCookie is a cookie used only for PrintPutDocumentData requests. +type PrintPutDocumentDataCookie struct { + *xgb.Cookie +} + +// PrintPutDocumentData sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return PrintPutDocumentDataCookie{cookie} +} + +// PrintPutDocumentDataChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() +func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printPutDocumentDataRequest(c, Drawable, LenData, LenFmt, LenOptions, Data, DocFormat, Options), cookie) + return PrintPutDocumentDataCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintPutDocumentDataCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintPutDocumentData +// printPutDocumentDataRequest writes a PrintPutDocumentData request to a byte slice. +func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) []byte { + size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], LenData) + b += 4 + + xgb.Put16(buf[b:], LenFmt) + b += 2 + + xgb.Put16(buf[b:], LenOptions) + b += 2 + + copy(buf[b:], Data[:LenData]) + b += xgb.Pad(int(LenData)) + + for i := 0; i < int(len(DocFormat)); i++ { + buf[b] = byte(DocFormat[i]) + b += 1 + } + b = xgb.Pad(b) + + for i := 0; i < int(len(Options)); i++ { + buf[b] = byte(Options[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + // PrintQueryScreensCookie is a cookie used only for PrintQueryScreens requests. type PrintQueryScreensCookie struct { *xgb.Cookie @@ -2231,6 +1823,337 @@ func printQueryScreensRequest(c *xgb.Conn) []byte { return buf } +// PrintQueryVersionCookie is a cookie used only for PrintQueryVersion requests. +type PrintQueryVersionCookie struct { + *xgb.Cookie +} + +// PrintQueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() +func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(printQueryVersionRequest(c), cookie) + return PrintQueryVersionCookie{cookie} +} + +// PrintQueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(printQueryVersionRequest(c), cookie) + return PrintQueryVersionCookie{cookie} +} + +// PrintQueryVersionReply represents the data returned from a PrintQueryVersion request. +type PrintQueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MajorVersion uint16 + MinorVersion uint16 +} + +// Reply blocks and returns the reply data for a PrintQueryVersion request. +func (cook PrintQueryVersionCookie) Reply() (*PrintQueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return printQueryVersionReply(buf), nil +} + +// printQueryVersionReply reads a byte slice into a PrintQueryVersionReply value. +func printQueryVersionReply(buf []byte) *PrintQueryVersionReply { + v := new(PrintQueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for PrintQueryVersion +// printQueryVersionRequest writes a PrintQueryVersion request to a byte slice. +func printQueryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// PrintRehashPrinterListCookie is a cookie used only for PrintRehashPrinterList requests. +type PrintRehashPrinterListCookie struct { + *xgb.Cookie +} + +// PrintRehashPrinterList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printRehashPrinterListRequest(c), cookie) + return PrintRehashPrinterListCookie{cookie} +} + +// PrintRehashPrinterListChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() +func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printRehashPrinterListRequest(c), cookie) + return PrintRehashPrinterListCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintRehashPrinterListCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintRehashPrinterList +// printRehashPrinterListRequest writes a PrintRehashPrinterList request to a byte slice. +func printRehashPrinterListRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 20 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// PrintSelectInputCookie is a cookie used only for PrintSelectInput requests. +type PrintSelectInputCookie struct { + *xgb.Cookie +} + +// PrintSelectInput sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + return PrintSelectInputCookie{cookie} +} + +// PrintSelectInputChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() +func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + return PrintSelectInputCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintSelectInputCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSelectInput +// printSelectInputRequest writes a PrintSelectInput request to a byte slice. +func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + for i := 0; i < xgb.PopCount(int(EventMask)); i++ { + xgb.Put32(buf[b:], EventList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// PrintSetAttributesCookie is a cookie used only for PrintSetAttributes requests. +type PrintSetAttributesCookie struct { + *xgb.Cookie +} + +// PrintSetAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) + return PrintSetAttributesCookie{cookie} +} + +// PrintSetAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() +func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printSetAttributesRequest(c, Context, StringLen, Pool, Rule, Attributes), cookie) + return PrintSetAttributesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintSetAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSetAttributes +// printSetAttributesRequest writes a PrintSetAttributes request to a byte slice. +func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Attributes) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Context)) + b += 4 + + xgb.Put32(buf[b:], StringLen) + b += 4 + + buf[b] = Pool + b += 1 + + buf[b] = Rule + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Attributes)); i++ { + buf[b] = byte(Attributes[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// PrintSetContextCookie is a cookie used only for PrintSetContext requests. +type PrintSetContextCookie struct { + *xgb.Cookie +} + +// PrintSetContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printSetContextRequest(c, Context), cookie) + return PrintSetContextCookie{cookie} +} + +// PrintSetContextChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintSetContextCookie.Check() +func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printSetContextRequest(c, Context), cookie) + return PrintSetContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintSetContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintSetContext +// printSetContextRequest writes a PrintSetContext request to a byte slice. +func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Context) + b += 4 + + return buf +} + // PrintSetImageResolutionCookie is a cookie used only for PrintSetImageResolution requests. type PrintSetImageResolutionCookie struct { *xgb.Cookie @@ -2327,75 +2250,42 @@ func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResoluti return buf } -// PrintGetImageResolutionCookie is a cookie used only for PrintGetImageResolution requests. -type PrintGetImageResolutionCookie struct { +// PrintStartDocCookie is a cookie used only for PrintStartDoc requests. +type PrintStartDocCookie struct { *xgb.Cookie } -// PrintGetImageResolution sends a checked request. -// If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() -func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) - return PrintGetImageResolutionCookie{cookie} -} - -// PrintGetImageResolutionUnchecked sends an unchecked request. +// PrintStartDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { +func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { if _, ok := c.Extensions["XPEXTENSION"]; !ok { - panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, true) - c.NewRequest(printGetImageResolutionRequest(c, Context), cookie) - return PrintGetImageResolutionCookie{cookie} + cookie := c.NewCookie(false, false) + c.NewRequest(printStartDocRequest(c, DriverMode), cookie) + return PrintStartDocCookie{cookie} } -// PrintGetImageResolutionReply represents the data returned from a PrintGetImageResolution request. -type PrintGetImageResolutionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ImageResolution uint16 -} - -// Reply blocks and returns the reply data for a PrintGetImageResolution request. -func (cook PrintGetImageResolutionCookie) Reply() (*PrintGetImageResolutionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err +// PrintStartDocChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartDocCookie.Check() +func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } - if buf == nil { - return nil, nil - } - return printGetImageResolutionReply(buf), nil + cookie := c.NewCookie(true, false) + c.NewRequest(printStartDocRequest(c, DriverMode), cookie) + return PrintStartDocCookie{cookie} } -// printGetImageResolutionReply reads a byte slice into a PrintGetImageResolutionReply value. -func printGetImageResolutionReply(buf []byte) *PrintGetImageResolutionReply { - v := new(PrintGetImageResolutionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ImageResolution = xgb.Get16(buf[b:]) - b += 2 - - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintStartDocCookie) Check() error { + return cook.Cookie.Check() } -// Write request to wire for PrintGetImageResolution -// printGetImageResolutionRequest writes a PrintGetImageResolution request to a byte slice. -func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { +// Write request to wire for PrintStartDoc +// printStartDocRequest writes a PrintStartDoc request to a byte slice. +func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2403,13 +2293,123 @@ func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { buf[b] = c.Extensions["XPEXTENSION"] b += 1 - buf[b] = 24 // request opcode + buf[b] = 9 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Context)) + buf[b] = DriverMode + b += 1 + + return buf +} + +// PrintStartJobCookie is a cookie used only for PrintStartJob requests. +type PrintStartJobCookie struct { + *xgb.Cookie +} + +// PrintStartJob sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printStartJobRequest(c, OutputMode), cookie) + return PrintStartJobCookie{cookie} +} + +// PrintStartJobChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartJobCookie.Check() +func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printStartJobRequest(c, OutputMode), cookie) + return PrintStartJobCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintStartJobCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintStartJob +// printStartJobRequest writes a PrintStartJob request to a byte slice. +func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = OutputMode + b += 1 + + return buf +} + +// PrintStartPageCookie is a cookie used only for PrintStartPage requests. +type PrintStartPageCookie struct { + *xgb.Cookie +} + +// PrintStartPage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(printStartPageRequest(c, Window), cookie) + return PrintStartPageCookie{cookie} +} + +// PrintStartPageChecked sends a checked request. +// If an error occurs, it can be retrieved using PrintStartPageCookie.Check() +func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + if _, ok := c.Extensions["XPEXTENSION"]; !ok { + panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(printStartPageRequest(c, Window), cookie) + return PrintStartPageCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PrintStartPageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PrintStartPage +// printStartPageRequest writes a PrintStartPage request to a byte slice. +func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XPEXTENSION"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) b += 4 return buf diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 7527db5..f162b19 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xproto.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -23,373 +23,86 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Byte' +// BadAccess is the error number for a BadAccess. +const BadAccess = 10 -// Skipping definition for base type 'Int8' +type AccessError RequestError -// Skipping definition for base type 'Card16' +// AccessErrorNew constructs a AccessError value that implements xgb.Error from a byte slice. +func AccessErrorNew(buf []byte) xgb.Error { + v := AccessError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Access" + return v +} -// Skipping definition for base type 'Char' +// SequenceId returns the sequence id attached to the BadAccess error. +// This is mostly used internally. +func (err AccessError) SequenceId() uint16 { + return err.Sequence +} -// Skipping definition for base type 'Card32' +// BadId returns the 'BadValue' number if one exists for the BadAccess error. If no bad value exists, 0 is returned. +func (err AccessError) BadId() uint32 { + return err.BadValue +} -// Skipping definition for base type 'Double' +// Error returns a rudimentary string representation of the BadAccess error. +func (err AccessError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAccess {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' +func init() { + xgb.NewErrorFuncs[10] = AccessErrorNew +} const ( - VisualClassStaticGray = 0 - VisualClassGrayScale = 1 - VisualClassStaticColor = 2 - VisualClassPseudoColor = 3 - VisualClassTrueColor = 4 - VisualClassDirectColor = 5 + AccessControlDisable = 0 + AccessControlEnable = 1 ) -const ( - EventMaskNoEvent = 0 - EventMaskKeyPress = 1 - EventMaskKeyRelease = 2 - EventMaskButtonPress = 4 - EventMaskButtonRelease = 8 - EventMaskEnterWindow = 16 - EventMaskLeaveWindow = 32 - EventMaskPointerMotion = 64 - EventMaskPointerMotionHint = 128 - EventMaskButton1Motion = 256 - EventMaskButton2Motion = 512 - EventMaskButton3Motion = 1024 - EventMaskButton4Motion = 2048 - EventMaskButton5Motion = 4096 - EventMaskButtonMotion = 8192 - EventMaskKeymapState = 16384 - EventMaskExposure = 32768 - EventMaskVisibilityChange = 65536 - EventMaskStructureNotify = 131072 - EventMaskResizeRedirect = 262144 - EventMaskSubstructureNotify = 524288 - EventMaskSubstructureRedirect = 1048576 - EventMaskFocusChange = 2097152 - EventMaskPropertyChange = 4194304 - EventMaskColorMapChange = 8388608 - EventMaskOwnerGrabButton = 16777216 -) +// BadAlloc is the error number for a BadAlloc. +const BadAlloc = 11 -const ( - BackingStoreNotUseful = 0 - BackingStoreWhenMapped = 1 - BackingStoreAlways = 2 -) +type AllocError RequestError -const ( - ImageOrderLSBFirst = 0 - ImageOrderMSBFirst = 1 -) +// AllocErrorNew constructs a AllocError value that implements xgb.Error from a byte slice. +func AllocErrorNew(buf []byte) xgb.Error { + v := AllocError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Alloc" + return v +} -const ( - ModMaskShift = 1 - ModMaskLock = 2 - ModMaskControl = 4 - ModMask1 = 8 - ModMask2 = 16 - ModMask3 = 32 - ModMask4 = 64 - ModMask5 = 128 - ModMaskAny = 32768 -) +// SequenceId returns the sequence id attached to the BadAlloc error. +// This is mostly used internally. +func (err AllocError) SequenceId() uint16 { + return err.Sequence +} -const ( - KeyButMaskShift = 1 - KeyButMaskLock = 2 - KeyButMaskControl = 4 - KeyButMaskMod1 = 8 - KeyButMaskMod2 = 16 - KeyButMaskMod3 = 32 - KeyButMaskMod4 = 64 - KeyButMaskMod5 = 128 - KeyButMaskButton1 = 256 - KeyButMaskButton2 = 512 - KeyButMaskButton3 = 1024 - KeyButMaskButton4 = 2048 - KeyButMaskButton5 = 4096 -) +// BadId returns the 'BadValue' number if one exists for the BadAlloc error. If no bad value exists, 0 is returned. +func (err AllocError) BadId() uint32 { + return err.BadValue +} -const ( - WindowNone = 0 -) +// Error returns a rudimentary string representation of the BadAlloc error. +func (err AllocError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAlloc {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} -const ( - ButtonMask1 = 256 - ButtonMask2 = 512 - ButtonMask3 = 1024 - ButtonMask4 = 2048 - ButtonMask5 = 4096 - ButtonMaskAny = 32768 -) - -const ( - MotionNormal = 0 - MotionHint = 1 -) - -const ( - NotifyDetailAncestor = 0 - NotifyDetailVirtual = 1 - NotifyDetailInferior = 2 - NotifyDetailNonlinear = 3 - NotifyDetailNonlinearVirtual = 4 - NotifyDetailPointer = 5 - NotifyDetailPointerRoot = 6 - NotifyDetailNone = 7 -) - -const ( - NotifyModeNormal = 0 - NotifyModeGrab = 1 - NotifyModeUngrab = 2 - NotifyModeWhileGrabbed = 3 -) - -const ( - VisibilityUnobscured = 0 - VisibilityPartiallyObscured = 1 - VisibilityFullyObscured = 2 -) - -const ( - PlaceOnTop = 0 - PlaceOnBottom = 1 -) - -const ( - PropertyNewValue = 0 - PropertyDelete = 1 -) - -const ( - TimeCurrentTime = 0 -) - -const ( - AtomNone = 0 - AtomAny = 0 - AtomPrimary = 1 - AtomSecondary = 2 - AtomArc = 3 - AtomAtom = 4 - AtomBitmap = 5 - AtomCardinal = 6 - AtomColormap = 7 - AtomCursor = 8 - AtomCutBuffer0 = 9 - AtomCutBuffer1 = 10 - AtomCutBuffer2 = 11 - AtomCutBuffer3 = 12 - AtomCutBuffer4 = 13 - AtomCutBuffer5 = 14 - AtomCutBuffer6 = 15 - AtomCutBuffer7 = 16 - AtomDrawable = 17 - AtomFont = 18 - AtomInteger = 19 - AtomPixmap = 20 - AtomPoint = 21 - AtomRectangle = 22 - AtomResourceManager = 23 - AtomRgbColorMap = 24 - AtomRgbBestMap = 25 - AtomRgbBlueMap = 26 - AtomRgbDefaultMap = 27 - AtomRgbGrayMap = 28 - AtomRgbGreenMap = 29 - AtomRgbRedMap = 30 - AtomString = 31 - AtomVisualid = 32 - AtomWindow = 33 - AtomWmCommand = 34 - AtomWmHints = 35 - AtomWmClientMachine = 36 - AtomWmIconName = 37 - AtomWmIconSize = 38 - AtomWmName = 39 - AtomWmNormalHints = 40 - AtomWmSizeHints = 41 - AtomWmZoomHints = 42 - AtomMinSpace = 43 - AtomNormSpace = 44 - AtomMaxSpace = 45 - AtomEndSpace = 46 - AtomSuperscriptX = 47 - AtomSuperscriptY = 48 - AtomSubscriptX = 49 - AtomSubscriptY = 50 - AtomUnderlinePosition = 51 - AtomUnderlineThickness = 52 - AtomStrikeoutAscent = 53 - AtomStrikeoutDescent = 54 - AtomItalicAngle = 55 - AtomXHeight = 56 - AtomQuadWidth = 57 - AtomWeight = 58 - AtomPointSize = 59 - AtomResolution = 60 - AtomCopyright = 61 - AtomNotice = 62 - AtomFontName = 63 - AtomFamilyName = 64 - AtomFullName = 65 - AtomCapHeight = 66 - AtomWmClass = 67 - AtomWmTransientFor = 68 -) - -const ( - ColormapStateUninstalled = 0 - ColormapStateInstalled = 1 -) - -const ( - ColormapNone = 0 -) - -const ( - MappingModifier = 0 - MappingKeyboard = 1 - MappingPointer = 2 -) - -const ( - WindowClassCopyFromParent = 0 - WindowClassInputOutput = 1 - WindowClassInputOnly = 2 -) - -const ( - CwBackPixmap = 1 - CwBackPixel = 2 - CwBorderPixmap = 4 - CwBorderPixel = 8 - CwBitGravity = 16 - CwWinGravity = 32 - CwBackingStore = 64 - CwBackingPlanes = 128 - CwBackingPixel = 256 - CwOverrideRedirect = 512 - CwSaveUnder = 1024 - CwEventMask = 2048 - CwDontPropagate = 4096 - CwColormap = 8192 - CwCursor = 16384 -) - -const ( - BackPixmapNone = 0 - BackPixmapParentRelative = 1 -) - -const ( - GravityBitForget = 0 - GravityWinUnmap = 0 - GravityNorthWest = 1 - GravityNorth = 2 - GravityNorthEast = 3 - GravityWest = 4 - GravityCenter = 5 - GravityEast = 6 - GravitySouthWest = 7 - GravitySouth = 8 - GravitySouthEast = 9 - GravityStatic = 10 -) - -const ( - MapStateUnmapped = 0 - MapStateUnviewable = 1 - MapStateViewable = 2 -) - -const ( - SetModeInsert = 0 - SetModeDelete = 1 -) - -const ( - ConfigWindowX = 1 - ConfigWindowY = 2 - ConfigWindowWidth = 4 - ConfigWindowHeight = 8 - ConfigWindowBorderWidth = 16 - ConfigWindowSibling = 32 - ConfigWindowStackMode = 64 -) - -const ( - StackModeAbove = 0 - StackModeBelow = 1 - StackModeTopIf = 2 - StackModeBottomIf = 3 - StackModeOpposite = 4 -) - -const ( - CirculateRaiseLowest = 0 - CirculateLowerHighest = 1 -) - -const ( - PropModeReplace = 0 - PropModePrepend = 1 - PropModeAppend = 2 -) - -const ( - GetPropertyTypeAny = 0 -) - -const ( - SendEventDestPointerWindow = 0 - SendEventDestItemFocus = 1 -) - -const ( - GrabModeSync = 0 - GrabModeAsync = 1 -) - -const ( - GrabStatusSuccess = 0 - GrabStatusAlreadyGrabbed = 1 - GrabStatusInvalidTime = 2 - GrabStatusNotViewable = 3 - GrabStatusFrozen = 4 -) - -const ( - CursorNone = 0 -) - -const ( - ButtonIndexAny = 0 - ButtonIndex1 = 1 - ButtonIndex2 = 2 - ButtonIndex3 = 3 - ButtonIndex4 = 4 - ButtonIndex5 = 5 -) - -const ( - GrabAny = 0 -) +func init() { + xgb.NewErrorFuncs[11] = AllocErrorNew +} const ( AllowAsyncPointer = 0 @@ -402,513 +115,6 @@ const ( AllowSyncBoth = 7 ) -const ( - InputFocusNone = 0 - InputFocusPointerRoot = 1 - InputFocusParent = 2 - InputFocusFollowKeyboard = 3 -) - -const ( - FontDrawLeftToRight = 0 - FontDrawRightToLeft = 1 -) - -const ( - GcFunction = 1 - GcPlaneMask = 2 - GcForeground = 4 - GcBackground = 8 - GcLineWidth = 16 - GcLineStyle = 32 - GcCapStyle = 64 - GcJoinStyle = 128 - GcFillStyle = 256 - GcFillRule = 512 - GcTile = 1024 - GcStipple = 2048 - GcTileStippleOriginX = 4096 - GcTileStippleOriginY = 8192 - GcFont = 16384 - GcSubwindowMode = 32768 - GcGraphicsExposures = 65536 - GcClipOriginX = 131072 - GcClipOriginY = 262144 - GcClipMask = 524288 - GcDashOffset = 1048576 - GcDashList = 2097152 - GcArcMode = 4194304 -) - -const ( - GxClear = 0 - GxAnd = 1 - GxAndReverse = 2 - GxCopy = 3 - GxAndInverted = 4 - GxNoop = 5 - GxXor = 6 - GxOr = 7 - GxNor = 8 - GxEquiv = 9 - GxInvert = 10 - GxOrReverse = 11 - GxCopyInverted = 12 - GxOrInverted = 13 - GxNand = 14 - GxSet = 15 -) - -const ( - LineStyleSolid = 0 - LineStyleOnOffDash = 1 - LineStyleDoubleDash = 2 -) - -const ( - CapStyleNotLast = 0 - CapStyleButt = 1 - CapStyleRound = 2 - CapStyleProjecting = 3 -) - -const ( - JoinStyleMiter = 0 - JoinStyleRound = 1 - JoinStyleBevel = 2 -) - -const ( - FillStyleSolid = 0 - FillStyleTiled = 1 - FillStyleStippled = 2 - FillStyleOpaqueStippled = 3 -) - -const ( - FillRuleEvenOdd = 0 - FillRuleWinding = 1 -) - -const ( - SubwindowModeClipByChildren = 0 - SubwindowModeIncludeInferiors = 1 -) - -const ( - ArcModeChord = 0 - ArcModePieSlice = 1 -) - -const ( - ClipOrderingUnsorted = 0 - ClipOrderingYSorted = 1 - ClipOrderingYXSorted = 2 - ClipOrderingYXBanded = 3 -) - -const ( - CoordModeOrigin = 0 - CoordModePrevious = 1 -) - -const ( - PolyShapeComplex = 0 - PolyShapeNonconvex = 1 - PolyShapeConvex = 2 -) - -const ( - ImageFormatXYBitmap = 0 - ImageFormatXYPixmap = 1 - ImageFormatZPixmap = 2 -) - -const ( - ColormapAllocNone = 0 - ColormapAllocAll = 1 -) - -const ( - ColorFlagRed = 1 - ColorFlagGreen = 2 - ColorFlagBlue = 4 -) - -const ( - PixmapNone = 0 -) - -const ( - FontNone = 0 -) - -const ( - QueryShapeOfLargestCursor = 0 - QueryShapeOfFastestTile = 1 - QueryShapeOfFastestStipple = 2 -) - -const ( - KbKeyClickPercent = 1 - KbBellPercent = 2 - KbBellPitch = 4 - KbBellDuration = 8 - KbLed = 16 - KbLedMode = 32 - KbKey = 64 - KbAutoRepeatMode = 128 -) - -const ( - LedModeOff = 0 - LedModeOn = 1 -) - -const ( - AutoRepeatModeOff = 0 - AutoRepeatModeOn = 1 - AutoRepeatModeDefault = 2 -) - -const ( - BlankingNotPreferred = 0 - BlankingPreferred = 1 - BlankingDefault = 2 -) - -const ( - ExposuresNotAllowed = 0 - ExposuresAllowed = 1 - ExposuresDefault = 2 -) - -const ( - HostModeInsert = 0 - HostModeDelete = 1 -) - -const ( - FamilyInternet = 0 - FamilyDECnet = 1 - FamilyChaos = 2 - FamilyServerInterpreted = 5 - FamilyInternet6 = 6 -) - -const ( - AccessControlDisable = 0 - AccessControlEnable = 1 -) - -const ( - CloseDownDestroyAll = 0 - CloseDownRetainPermanent = 1 - CloseDownRetainTemporary = 2 -) - -const ( - KillAllTemporary = 0 -) - -const ( - ScreenSaverReset = 0 - ScreenSaverActive = 1 -) - -const ( - MappingStatusSuccess = 0 - MappingStatusBusy = 1 - MappingStatusFailure = 2 -) - -const ( - MapIndexShift = 0 - MapIndexLock = 1 - MapIndexControl = 2 - MapIndex1 = 3 - MapIndex2 = 4 - MapIndex3 = 5 - MapIndex4 = 6 - MapIndex5 = 7 -) - -type Window uint32 - -func NewWindowId(c *xgb.Conn) (Window, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Window(id), nil -} - -type Pixmap uint32 - -func NewPixmapId(c *xgb.Conn) (Pixmap, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Pixmap(id), nil -} - -type Cursor uint32 - -func NewCursorId(c *xgb.Conn) (Cursor, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Cursor(id), nil -} - -type Font uint32 - -func NewFontId(c *xgb.Conn) (Font, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Font(id), nil -} - -type Gcontext uint32 - -func NewGcontextId(c *xgb.Conn) (Gcontext, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Gcontext(id), nil -} - -type Colormap uint32 - -func NewColormapId(c *xgb.Conn) (Colormap, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Colormap(id), nil -} - -type Atom uint32 - -func NewAtomId(c *xgb.Conn) (Atom, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Atom(id), nil -} - -type Drawable uint32 - -func NewDrawableId(c *xgb.Conn) (Drawable, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Drawable(id), nil -} - -type Fontable uint32 - -func NewFontableId(c *xgb.Conn) (Fontable, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Fontable(id), nil -} - -type Visualid uint32 - -type Timestamp uint32 - -type Keysym uint32 - -type Keycode byte - -type Button byte - -type Char2b struct { - Byte1 byte - Byte2 byte -} - -// Char2bRead reads a byte slice into a Char2b value. -func Char2bRead(buf []byte, v *Char2b) int { - b := 0 - - v.Byte1 = buf[b] - b += 1 - - v.Byte2 = buf[b] - b += 1 - - return b -} - -// Char2bReadList reads a byte slice into a list of Char2b values. -func Char2bReadList(buf []byte, dest []Char2b) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Char2b{} - b += Char2bRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Char2b value to a byte slice. -func (v Char2b) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.Byte1 - b += 1 - - buf[b] = v.Byte2 - b += 1 - - return buf -} - -// Char2bListBytes writes a list of Char2b values to a byte slice. -func Char2bListBytes(buf []byte, list []Char2b) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Point struct { - X int16 - Y int16 -} - -// PointRead reads a byte slice into a Point value. -func PointRead(buf []byte, v *Point) int { - b := 0 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// PointReadList reads a byte slice into a list of Point values. -func PointReadList(buf []byte, dest []Point) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Point{} - b += PointRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Point value to a byte slice. -func (v Point) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - return buf -} - -// PointListBytes writes a list of Point values to a byte slice. -func PointListBytes(buf []byte, list []Point) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Rectangle struct { - X int16 - Y int16 - Width uint16 - Height uint16 -} - -// RectangleRead reads a byte slice into a Rectangle value. -func RectangleRead(buf []byte, v *Rectangle) int { - b := 0 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// RectangleReadList reads a byte slice into a list of Rectangle values. -func RectangleReadList(buf []byte, dest []Rectangle) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Rectangle{} - b += RectangleRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Rectangle value to a byte slice. -func (v Rectangle) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 - - return buf -} - -// RectangleListBytes writes a list of Rectangle values to a byte slice. -func RectangleListBytes(buf []byte, list []Rectangle) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type Arc struct { X int16 Y int16 @@ -991,1023 +197,420 @@ func ArcListBytes(buf []byte, list []Arc) int { return b } -type Format struct { - Depth byte - BitsPerPixel byte - ScanlinePad byte - // padding: 5 bytes -} +const ( + ArcModeChord = 0 + ArcModePieSlice = 1 +) -// FormatRead reads a byte slice into a Format value. -func FormatRead(buf []byte, v *Format) int { - b := 0 +type Atom uint32 - v.Depth = buf[b] - b += 1 - - v.BitsPerPixel = buf[b] - b += 1 - - v.ScanlinePad = buf[b] - b += 1 - - b += 5 // padding - - return b -} - -// FormatReadList reads a byte slice into a list of Format values. -func FormatReadList(buf []byte, dest []Format) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Format{} - b += FormatRead(buf[b:], &dest[i]) +func NewAtomId(c *xgb.Conn) (Atom, error) { + id, err := c.NewId() + if err != nil { + return 0, err } - return xgb.Pad(b) + return Atom(id), nil } -// Bytes writes a Format value to a byte slice. -func (v Format) Bytes() []byte { - buf := make([]byte, 8) - b := 0 +const ( + AtomNone = 0 + AtomAny = 0 + AtomPrimary = 1 + AtomSecondary = 2 + AtomArc = 3 + AtomAtom = 4 + AtomBitmap = 5 + AtomCardinal = 6 + AtomColormap = 7 + AtomCursor = 8 + AtomCutBuffer0 = 9 + AtomCutBuffer1 = 10 + AtomCutBuffer2 = 11 + AtomCutBuffer3 = 12 + AtomCutBuffer4 = 13 + AtomCutBuffer5 = 14 + AtomCutBuffer6 = 15 + AtomCutBuffer7 = 16 + AtomDrawable = 17 + AtomFont = 18 + AtomInteger = 19 + AtomPixmap = 20 + AtomPoint = 21 + AtomRectangle = 22 + AtomResourceManager = 23 + AtomRgbColorMap = 24 + AtomRgbBestMap = 25 + AtomRgbBlueMap = 26 + AtomRgbDefaultMap = 27 + AtomRgbGrayMap = 28 + AtomRgbGreenMap = 29 + AtomRgbRedMap = 30 + AtomString = 31 + AtomVisualid = 32 + AtomWindow = 33 + AtomWmCommand = 34 + AtomWmHints = 35 + AtomWmClientMachine = 36 + AtomWmIconName = 37 + AtomWmIconSize = 38 + AtomWmName = 39 + AtomWmNormalHints = 40 + AtomWmSizeHints = 41 + AtomWmZoomHints = 42 + AtomMinSpace = 43 + AtomNormSpace = 44 + AtomMaxSpace = 45 + AtomEndSpace = 46 + AtomSuperscriptX = 47 + AtomSuperscriptY = 48 + AtomSubscriptX = 49 + AtomSubscriptY = 50 + AtomUnderlinePosition = 51 + AtomUnderlineThickness = 52 + AtomStrikeoutAscent = 53 + AtomStrikeoutDescent = 54 + AtomItalicAngle = 55 + AtomXHeight = 56 + AtomQuadWidth = 57 + AtomWeight = 58 + AtomPointSize = 59 + AtomResolution = 60 + AtomCopyright = 61 + AtomNotice = 62 + AtomFontName = 63 + AtomFamilyName = 64 + AtomFullName = 65 + AtomCapHeight = 66 + AtomWmClass = 67 + AtomWmTransientFor = 68 +) - buf[b] = v.Depth - b += 1 +// BadAtom is the error number for a BadAtom. +const BadAtom = 5 - buf[b] = v.BitsPerPixel - b += 1 +type AtomError ValueError - buf[b] = v.ScanlinePad - b += 1 - - b += 5 // padding - - return buf +// AtomErrorNew constructs a AtomError value that implements xgb.Error from a byte slice. +func AtomErrorNew(buf []byte) xgb.Error { + v := AtomError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Atom" + return v } -// FormatListBytes writes a list of Format values to a byte slice. -func FormatListBytes(buf []byte, list []Format) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b +// SequenceId returns the sequence id attached to the BadAtom error. +// This is mostly used internally. +func (err AtomError) SequenceId() uint16 { + return err.Sequence } -type VisualInfo struct { - VisualId Visualid - Class byte - BitsPerRgbValue byte - ColormapEntries uint16 - RedMask uint32 - GreenMask uint32 - BlueMask uint32 - // padding: 4 bytes +// BadId returns the 'BadValue' number if one exists for the BadAtom error. If no bad value exists, 0 is returned. +func (err AtomError) BadId() uint32 { + return err.BadValue } -// VisualInfoRead reads a byte slice into a VisualInfo value. -func VisualInfoRead(buf []byte, v *VisualInfo) int { - b := 0 - - v.VisualId = Visualid(xgb.Get32(buf[b:])) - b += 4 - - v.Class = buf[b] - b += 1 - - v.BitsPerRgbValue = buf[b] - b += 1 - - v.ColormapEntries = xgb.Get16(buf[b:]) - b += 2 - - v.RedMask = xgb.Get32(buf[b:]) - b += 4 - - v.GreenMask = xgb.Get32(buf[b:]) - b += 4 - - v.BlueMask = xgb.Get32(buf[b:]) - b += 4 - - b += 4 // padding - - return b +// Error returns a rudimentary string representation of the BadAtom error. +func (err AtomError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadAtom {" + xgb.StringsJoin(fieldVals, ", ") + "}" } -// VisualInfoReadList reads a byte slice into a list of VisualInfo values. -func VisualInfoReadList(buf []byte, dest []VisualInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = VisualInfo{} - b += VisualInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) +func init() { + xgb.NewErrorFuncs[5] = AtomErrorNew } -// Bytes writes a VisualInfo value to a byte slice. -func (v VisualInfo) Bytes() []byte { - buf := make([]byte, 24) - b := 0 +const ( + AutoRepeatModeOff = 0 + AutoRepeatModeOn = 1 + AutoRepeatModeDefault = 2 +) - xgb.Put32(buf[b:], uint32(v.VisualId)) - b += 4 +const ( + BackPixmapNone = 0 + BackPixmapParentRelative = 1 +) - buf[b] = v.Class - b += 1 +const ( + BackingStoreNotUseful = 0 + BackingStoreWhenMapped = 1 + BackingStoreAlways = 2 +) - buf[b] = v.BitsPerRgbValue - b += 1 +const ( + BlankingNotPreferred = 0 + BlankingPreferred = 1 + BlankingDefault = 2 +) - xgb.Put16(buf[b:], v.ColormapEntries) - b += 2 +type Button byte - xgb.Put32(buf[b:], v.RedMask) - b += 4 +const ( + ButtonIndexAny = 0 + ButtonIndex1 = 1 + ButtonIndex2 = 2 + ButtonIndex3 = 3 + ButtonIndex4 = 4 + ButtonIndex5 = 5 +) - xgb.Put32(buf[b:], v.GreenMask) - b += 4 +const ( + ButtonMask1 = 256 + ButtonMask2 = 512 + ButtonMask3 = 1024 + ButtonMask4 = 2048 + ButtonMask5 = 4096 + ButtonMaskAny = 32768 +) - xgb.Put32(buf[b:], v.BlueMask) - b += 4 +// ButtonPress is the event number for a ButtonPressEvent. +const ButtonPress = 4 - b += 4 // padding - - return buf -} - -// VisualInfoListBytes writes a list of VisualInfo values to a byte slice. -func VisualInfoListBytes(buf []byte, list []VisualInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type DepthInfo struct { - Depth byte +type ButtonPressEvent struct { + Sequence uint16 + Detail Button + Time Timestamp + Root Window + Event Window + Child Window + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool // padding: 1 bytes - VisualsLen uint16 - // padding: 4 bytes - Visuals []VisualInfo // size: xgb.Pad((int(VisualsLen) * 24)) } -// DepthInfoRead reads a byte slice into a DepthInfo value. -func DepthInfoRead(buf []byte, v *DepthInfo) int { - b := 0 +// ButtonPressEventNew constructs a ButtonPressEvent value that implements xgb.Event from a byte slice. +func ButtonPressEventNew(buf []byte) xgb.Event { + v := ButtonPressEvent{} + b := 1 // don't read event number - v.Depth = buf[b] + v.Detail = Button(buf[b]) b += 1 - b += 1 // padding - - v.VisualsLen = xgb.Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 - b += 4 // padding - - v.Visuals = make([]VisualInfo, v.VisualsLen) - b += VisualInfoReadList(buf[b:], v.Visuals) - - return b -} - -// DepthInfoReadList reads a byte slice into a list of DepthInfo values. -func DepthInfoReadList(buf []byte, dest []DepthInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DepthInfo{} - b += DepthInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DepthInfo value to a byte slice. -func (v DepthInfo) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.VisualsLen) * 24)))) - b := 0 - - buf[b] = v.Depth - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], v.VisualsLen) - b += 2 - - b += 4 // padding - - b += VisualInfoListBytes(buf[b:], v.Visuals) - - return buf -} - -// DepthInfoListBytes writes a list of DepthInfo values to a byte slice. -func DepthInfoListBytes(buf []byte, list []DepthInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// DepthInfoListSize computes the size (bytes) of a list of DepthInfo values. -func DepthInfoListSize(list []DepthInfo) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.VisualsLen) * 24))) - } - return size -} - -type ScreenInfo struct { - Root Window - DefaultColormap Colormap - WhitePixel uint32 - BlackPixel uint32 - CurrentInputMasks uint32 - WidthInPixels uint16 - HeightInPixels uint16 - WidthInMillimeters uint16 - HeightInMillimeters uint16 - MinInstalledMaps uint16 - MaxInstalledMaps uint16 - RootVisual Visualid - BackingStores byte - SaveUnders bool - RootDepth byte - AllowedDepthsLen byte - AllowedDepths []DepthInfo // size: DepthInfoListSize(AllowedDepths) -} - -// ScreenInfoRead reads a byte slice into a ScreenInfo value. -func ScreenInfoRead(buf []byte, v *ScreenInfo) int { - b := 0 + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 v.Root = Window(xgb.Get32(buf[b:])) b += 4 - v.DefaultColormap = Colormap(xgb.Get32(buf[b:])) + v.Event = Window(xgb.Get32(buf[b:])) b += 4 - v.WhitePixel = xgb.Get32(buf[b:]) + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - v.BlackPixel = xgb.Get32(buf[b:]) - b += 4 - - v.CurrentInputMasks = xgb.Get32(buf[b:]) - b += 4 - - v.WidthInPixels = xgb.Get16(buf[b:]) + v.RootX = int16(xgb.Get16(buf[b:])) b += 2 - v.HeightInPixels = xgb.Get16(buf[b:]) + v.RootY = int16(xgb.Get16(buf[b:])) b += 2 - v.WidthInMillimeters = xgb.Get16(buf[b:]) + v.EventX = int16(xgb.Get16(buf[b:])) b += 2 - v.HeightInMillimeters = xgb.Get16(buf[b:]) + v.EventY = int16(xgb.Get16(buf[b:])) b += 2 - v.MinInstalledMaps = xgb.Get16(buf[b:]) + v.State = xgb.Get16(buf[b:]) b += 2 - v.MaxInstalledMaps = xgb.Get16(buf[b:]) - b += 2 - - v.RootVisual = Visualid(xgb.Get32(buf[b:])) - b += 4 - - v.BackingStores = buf[b] - b += 1 - if buf[b] == 1 { - v.SaveUnders = true + v.SameScreen = true } else { - v.SaveUnders = false + v.SameScreen = false } b += 1 - v.RootDepth = buf[b] - b += 1 + b += 1 // padding - v.AllowedDepthsLen = buf[b] - b += 1 - - v.AllowedDepths = make([]DepthInfo, v.AllowedDepthsLen) - b += DepthInfoReadList(buf[b:], v.AllowedDepths) - - return b + return v } -// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values. -func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { +// Bytes writes a ButtonPressEvent value to a byte slice. +func (v ButtonPressEvent) Bytes() []byte { + buf := make([]byte, 32) b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ScreenInfo{} - b += ScreenInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} -// Bytes writes a ScreenInfo value to a byte slice. -func (v ScreenInfo) Bytes() []byte { - buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) - b := 0 + // write event number + buf[b] = 4 + b += 1 + + buf[b] = byte(v.Detail) + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 xgb.Put32(buf[b:], uint32(v.Root)) b += 4 - xgb.Put32(buf[b:], uint32(v.DefaultColormap)) + xgb.Put32(buf[b:], uint32(v.Event)) b += 4 - xgb.Put32(buf[b:], v.WhitePixel) + xgb.Put32(buf[b:], uint32(v.Child)) b += 4 - xgb.Put32(buf[b:], v.BlackPixel) - b += 4 - - xgb.Put32(buf[b:], v.CurrentInputMasks) - b += 4 - - xgb.Put16(buf[b:], v.WidthInPixels) + xgb.Put16(buf[b:], uint16(v.RootX)) b += 2 - xgb.Put16(buf[b:], v.HeightInPixels) + xgb.Put16(buf[b:], uint16(v.RootY)) b += 2 - xgb.Put16(buf[b:], v.WidthInMillimeters) + xgb.Put16(buf[b:], uint16(v.EventX)) b += 2 - xgb.Put16(buf[b:], v.HeightInMillimeters) + xgb.Put16(buf[b:], uint16(v.EventY)) b += 2 - xgb.Put16(buf[b:], v.MinInstalledMaps) + xgb.Put16(buf[b:], v.State) b += 2 - xgb.Put16(buf[b:], v.MaxInstalledMaps) - b += 2 - - xgb.Put32(buf[b:], uint32(v.RootVisual)) - b += 4 - - buf[b] = v.BackingStores - b += 1 - - if v.SaveUnders { + if v.SameScreen { buf[b] = 1 } else { buf[b] = 0 } b += 1 - buf[b] = v.RootDepth - b += 1 - - buf[b] = v.AllowedDepthsLen - b += 1 - - b += DepthInfoListBytes(buf[b:], v.AllowedDepths) - - return buf -} - -// ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. -func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// ScreenInfoListSize computes the size (bytes) of a list of ScreenInfo values. -func ScreenInfoListSize(list []ScreenInfo) int { - size := 0 - for _, item := range list { - size += (40 + DepthInfoListSize(item.AllowedDepths)) - } - return size -} - -type SetupRequest struct { - ByteOrder byte - // padding: 1 bytes - ProtocolMajorVersion uint16 - ProtocolMinorVersion uint16 - AuthorizationProtocolNameLen uint16 - AuthorizationProtocolDataLen uint16 - // padding: 2 bytes - AuthorizationProtocolName string // size: xgb.Pad((int(AuthorizationProtocolNameLen) * 1)) - AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) -} - -// SetupRequestRead reads a byte slice into a SetupRequest value. -func SetupRequestRead(buf []byte, v *SetupRequest) int { - b := 0 - - v.ByteOrder = buf[b] - b += 1 - b += 1 // padding - v.ProtocolMajorVersion = xgb.Get16(buf[b:]) - b += 2 + return buf +} - v.ProtocolMinorVersion = xgb.Get16(buf[b:]) - b += 2 +// SequenceId returns the sequence id attached to the ButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ButtonPressEvent) SequenceId() uint16 { + return v.Sequence +} - v.AuthorizationProtocolNameLen = xgb.Get16(buf[b:]) - b += 2 +// String is a rudimentary string representation of ButtonPressEvent. +func (v ButtonPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} - v.AuthorizationProtocolDataLen = xgb.Get16(buf[b:]) - b += 2 +func init() { + xgb.NewEventFuncs[4] = ButtonPressEventNew +} - b += 2 // padding +// ButtonRelease is the event number for a ButtonReleaseEvent. +const ButtonRelease = 5 - { - byteString := make([]byte, v.AuthorizationProtocolNameLen) - copy(byteString[:v.AuthorizationProtocolNameLen], buf[b:]) - v.AuthorizationProtocolName = string(byteString) - b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) - } +type ButtonReleaseEvent ButtonPressEvent - { - byteString := make([]byte, v.AuthorizationProtocolDataLen) - copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) - v.AuthorizationProtocolData = string(byteString) - b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) - } +// ButtonReleaseEventNew constructs a ButtonReleaseEvent value that implements xgb.Event from a byte slice. +func ButtonReleaseEventNew(buf []byte) xgb.Event { + return ButtonReleaseEvent(ButtonPressEventNew(buf).(ButtonPressEvent)) +} + +// Bytes writes a ButtonReleaseEvent value to a byte slice. +func (v ButtonReleaseEvent) Bytes() []byte { + return ButtonPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the ButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ButtonReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v ButtonReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "ButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[5] = ButtonReleaseEventNew +} + +const ( + CapStyleNotLast = 0 + CapStyleButt = 1 + CapStyleRound = 2 + CapStyleProjecting = 3 +) + +type Char2b struct { + Byte1 byte + Byte2 byte +} + +// Char2bRead reads a byte slice into a Char2b value. +func Char2bRead(buf []byte, v *Char2b) int { + b := 0 + + v.Byte1 = buf[b] + b += 1 + + v.Byte2 = buf[b] + b += 1 return b } -// SetupRequestReadList reads a byte slice into a list of SetupRequest values. -func SetupRequestReadList(buf []byte, dest []SetupRequest) int { +// Char2bReadList reads a byte slice into a list of Char2b values. +func Char2bReadList(buf []byte, dest []Char2b) int { b := 0 for i := 0; i < len(dest); i++ { - dest[i] = SetupRequest{} - b += SetupRequestRead(buf[b:], &dest[i]) + dest[i] = Char2b{} + b += Char2bRead(buf[b:], &dest[i]) } return xgb.Pad(b) } -// Bytes writes a SetupRequest value to a byte slice. -func (v SetupRequest) Bytes() []byte { - buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) +// Bytes writes a Char2b value to a byte slice. +func (v Char2b) Bytes() []byte { + buf := make([]byte, 2) b := 0 - buf[b] = v.ByteOrder + buf[b] = v.Byte1 b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], v.ProtocolMajorVersion) - b += 2 - - xgb.Put16(buf[b:], v.ProtocolMinorVersion) - b += 2 - - xgb.Put16(buf[b:], v.AuthorizationProtocolNameLen) - b += 2 - - xgb.Put16(buf[b:], v.AuthorizationProtocolDataLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) - b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) - - copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) - b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) + buf[b] = v.Byte2 + b += 1 return buf } -// SetupRequestListBytes writes a list of SetupRequest values to a byte slice. -func SetupRequestListBytes(buf []byte, list []SetupRequest) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// SetupRequestListSize computes the size (bytes) of a list of SetupRequest values. -func SetupRequestListSize(list []SetupRequest) int { - size := 0 - for _, item := range list { - size += ((12 + xgb.Pad((int(item.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(item.AuthorizationProtocolDataLen) * 1))) - } - return size -} - -type SetupFailed struct { - Status byte - ReasonLen byte - ProtocolMajorVersion uint16 - ProtocolMinorVersion uint16 - Length uint16 - Reason string // size: xgb.Pad((int(ReasonLen) * 1)) -} - -// SetupFailedRead reads a byte slice into a SetupFailed value. -func SetupFailedRead(buf []byte, v *SetupFailed) int { - b := 0 - - v.Status = buf[b] - b += 1 - - v.ReasonLen = buf[b] - b += 1 - - v.ProtocolMajorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.ProtocolMinorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, v.ReasonLen) - copy(byteString[:v.ReasonLen], buf[b:]) - v.Reason = string(byteString) - b += xgb.Pad(int(v.ReasonLen)) - } - - return b -} - -// SetupFailedReadList reads a byte slice into a list of SetupFailed values. -func SetupFailedReadList(buf []byte, dest []SetupFailed) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SetupFailed{} - b += SetupFailedRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a SetupFailed value to a byte slice. -func (v SetupFailed) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.ReasonLen) * 1)))) - b := 0 - - buf[b] = v.Status - b += 1 - - buf[b] = v.ReasonLen - b += 1 - - xgb.Put16(buf[b:], v.ProtocolMajorVersion) - b += 2 - - xgb.Put16(buf[b:], v.ProtocolMinorVersion) - b += 2 - - xgb.Put16(buf[b:], v.Length) - b += 2 - - copy(buf[b:], v.Reason[:v.ReasonLen]) - b += xgb.Pad(int(v.ReasonLen)) - - return buf -} - -// SetupFailedListBytes writes a list of SetupFailed values to a byte slice. -func SetupFailedListBytes(buf []byte, list []SetupFailed) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// SetupFailedListSize computes the size (bytes) of a list of SetupFailed values. -func SetupFailedListSize(list []SetupFailed) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.ReasonLen) * 1))) - } - return size -} - -type SetupAuthenticate struct { - Status byte - // padding: 5 bytes - Length uint16 - Reason string // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// SetupAuthenticateRead reads a byte slice into a SetupAuthenticate value. -func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { - b := 0 - - v.Status = buf[b] - b += 1 - - b += 5 // padding - - v.Length = xgb.Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, (int(v.Length) * 4)) - copy(byteString[:(int(v.Length)*4)], buf[b:]) - v.Reason = string(byteString) - b += xgb.Pad(int((int(v.Length) * 4))) - } - - return b -} - -// SetupAuthenticateReadList reads a byte slice into a list of SetupAuthenticate values. -func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SetupAuthenticate{} - b += SetupAuthenticateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a SetupAuthenticate value to a byte slice. -func (v SetupAuthenticate) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad(((int(v.Length) * 4) * 1)))) - b := 0 - - buf[b] = v.Status - b += 1 - - b += 5 // padding - - xgb.Put16(buf[b:], v.Length) - b += 2 - - copy(buf[b:], v.Reason[:(int(v.Length)*4)]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return buf -} - -// SetupAuthenticateListBytes writes a list of SetupAuthenticate values to a byte slice. -func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// SetupAuthenticateListSize computes the size (bytes) of a list of SetupAuthenticate values. -func SetupAuthenticateListSize(list []SetupAuthenticate) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad(((int(item.Length) * 4) * 1))) - } - return size -} - -type SetupInfo struct { - Status byte - // padding: 1 bytes - ProtocolMajorVersion uint16 - ProtocolMinorVersion uint16 - Length uint16 - ReleaseNumber uint32 - ResourceIdBase uint32 - ResourceIdMask uint32 - MotionBufferSize uint32 - VendorLen uint16 - MaximumRequestLength uint16 - RootsLen byte - PixmapFormatsLen byte - ImageByteOrder byte - BitmapFormatBitOrder byte - BitmapFormatScanlineUnit byte - BitmapFormatScanlinePad byte - MinKeycode Keycode - MaxKeycode Keycode - // padding: 4 bytes - Vendor string // size: xgb.Pad((int(VendorLen) * 1)) - PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) - Roots []ScreenInfo // size: ScreenInfoListSize(Roots) -} - -// SetupInfoRead reads a byte slice into a SetupInfo value. -func SetupInfoRead(buf []byte, v *SetupInfo) int { - b := 0 - - v.Status = buf[b] - b += 1 - - b += 1 // padding - - v.ProtocolMajorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.ProtocolMinorVersion = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get16(buf[b:]) - b += 2 - - v.ReleaseNumber = xgb.Get32(buf[b:]) - b += 4 - - v.ResourceIdBase = xgb.Get32(buf[b:]) - b += 4 - - v.ResourceIdMask = xgb.Get32(buf[b:]) - b += 4 - - v.MotionBufferSize = xgb.Get32(buf[b:]) - b += 4 - - v.VendorLen = xgb.Get16(buf[b:]) - b += 2 - - v.MaximumRequestLength = xgb.Get16(buf[b:]) - b += 2 - - v.RootsLen = buf[b] - b += 1 - - v.PixmapFormatsLen = buf[b] - b += 1 - - v.ImageByteOrder = buf[b] - b += 1 - - v.BitmapFormatBitOrder = buf[b] - b += 1 - - v.BitmapFormatScanlineUnit = buf[b] - b += 1 - - v.BitmapFormatScanlinePad = buf[b] - b += 1 - - v.MinKeycode = Keycode(buf[b]) - b += 1 - - v.MaxKeycode = Keycode(buf[b]) - b += 1 - - b += 4 // padding - - { - byteString := make([]byte, v.VendorLen) - copy(byteString[:v.VendorLen], buf[b:]) - v.Vendor = string(byteString) - b += xgb.Pad(int(v.VendorLen)) - } - - v.PixmapFormats = make([]Format, v.PixmapFormatsLen) - b += FormatReadList(buf[b:], v.PixmapFormats) - - v.Roots = make([]ScreenInfo, v.RootsLen) - b += ScreenInfoReadList(buf[b:], v.Roots) - - return b -} - -// SetupInfoReadList reads a byte slice into a list of SetupInfo values. -func SetupInfoReadList(buf []byte, dest []SetupInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = SetupInfo{} - b += SetupInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a SetupInfo value to a byte slice. -func (v SetupInfo) Bytes() []byte { - buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) - b := 0 - - buf[b] = v.Status - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], v.ProtocolMajorVersion) - b += 2 - - xgb.Put16(buf[b:], v.ProtocolMinorVersion) - b += 2 - - xgb.Put16(buf[b:], v.Length) - b += 2 - - xgb.Put32(buf[b:], v.ReleaseNumber) - b += 4 - - xgb.Put32(buf[b:], v.ResourceIdBase) - b += 4 - - xgb.Put32(buf[b:], v.ResourceIdMask) - b += 4 - - xgb.Put32(buf[b:], v.MotionBufferSize) - b += 4 - - xgb.Put16(buf[b:], v.VendorLen) - b += 2 - - xgb.Put16(buf[b:], v.MaximumRequestLength) - b += 2 - - buf[b] = v.RootsLen - b += 1 - - buf[b] = v.PixmapFormatsLen - b += 1 - - buf[b] = v.ImageByteOrder - b += 1 - - buf[b] = v.BitmapFormatBitOrder - b += 1 - - buf[b] = v.BitmapFormatScanlineUnit - b += 1 - - buf[b] = v.BitmapFormatScanlinePad - b += 1 - - buf[b] = byte(v.MinKeycode) - b += 1 - - buf[b] = byte(v.MaxKeycode) - b += 1 - - b += 4 // padding - - copy(buf[b:], v.Vendor[:v.VendorLen]) - b += xgb.Pad(int(v.VendorLen)) - - b += FormatListBytes(buf[b:], v.PixmapFormats) - - b += ScreenInfoListBytes(buf[b:], v.Roots) - - return buf -} - -// SetupInfoListBytes writes a list of SetupInfo values to a byte slice. -func SetupInfoListBytes(buf []byte, list []SetupInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// SetupInfoListSize computes the size (bytes) of a list of SetupInfo values. -func SetupInfoListSize(list []SetupInfo) int { - size := 0 - for _, item := range list { - size += (((40 + xgb.Pad((int(item.VendorLen) * 1))) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) - } - return size -} - -type Timecoord struct { - Time Timestamp - X int16 - Y int16 -} - -// TimecoordRead reads a byte slice into a Timecoord value. -func TimecoordRead(buf []byte, v *Timecoord) int { - b := 0 - - v.Time = Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// TimecoordReadList reads a byte slice into a list of Timecoord values. -func TimecoordReadList(buf []byte, dest []Timecoord) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Timecoord{} - b += TimecoordRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Timecoord value to a byte slice. -func (v Timecoord) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - return buf -} - -// TimecoordListBytes writes a list of Timecoord values to a byte slice. -func TimecoordListBytes(buf []byte, list []Timecoord) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Fontprop struct { - Name Atom - Value uint32 -} - -// FontpropRead reads a byte slice into a Fontprop value. -func FontpropRead(buf []byte, v *Fontprop) int { - b := 0 - - v.Name = Atom(xgb.Get32(buf[b:])) - b += 4 - - v.Value = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// FontpropReadList reads a byte slice into a list of Fontprop values. -func FontpropReadList(buf []byte, dest []Fontprop) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Fontprop{} - b += FontpropRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Fontprop value to a byte slice. -func (v Fontprop) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Name)) - b += 4 - - xgb.Put32(buf[b:], v.Value) - b += 4 - - return buf -} - -// FontpropListBytes writes a list of Fontprop values to a byte slice. -func FontpropListBytes(buf []byte, list []Fontprop) int { +// Char2bListBytes writes a list of Char2b values to a byte slice. +func Char2bListBytes(buf []byte, list []Char2b) int { b := 0 var structBytes []byte for _, item := range list { @@ -2100,361 +703,217 @@ func CharinfoListBytes(buf []byte, list []Charinfo) int { return b } -type Str struct { - NameLen byte - Name string // size: xgb.Pad((int(NameLen) * 1)) +const ( + CirculateRaiseLowest = 0 + CirculateLowerHighest = 1 +) + +// CirculateNotify is the event number for a CirculateNotifyEvent. +const CirculateNotify = 26 + +type CirculateNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Window + Window Window + // padding: 4 bytes + Place byte + // padding: 3 bytes } -// StrRead reads a byte slice into a Str value. -func StrRead(buf []byte, v *Str) int { +// CirculateNotifyEventNew constructs a CirculateNotifyEvent value that implements xgb.Event from a byte slice. +func CirculateNotifyEventNew(buf []byte) xgb.Event { + v := CirculateNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + b += 4 // padding + + v.Place = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a CirculateNotifyEvent value to a byte slice. +func (v CirculateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) b := 0 - v.NameLen = buf[b] + // write event number + buf[b] = 26 b += 1 + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + b += 4 // padding + + buf[b] = v.Place + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the CirculateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v CirculateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of CirculateNotifyEvent. +func (v CirculateNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) + return "CirculateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[26] = CirculateNotifyEventNew +} + +// CirculateRequest is the event number for a CirculateRequestEvent. +const CirculateRequest = 27 + +type CirculateRequestEvent CirculateNotifyEvent + +// CirculateRequestEventNew constructs a CirculateRequestEvent value that implements xgb.Event from a byte slice. +func CirculateRequestEventNew(buf []byte) xgb.Event { + return CirculateRequestEvent(CirculateNotifyEventNew(buf).(CirculateNotifyEvent)) +} + +// Bytes writes a CirculateRequestEvent value to a byte slice. +func (v CirculateRequestEvent) Bytes() []byte { + return CirculateNotifyEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the CirculateRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v CirculateRequestEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v CirculateRequestEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) + return "CirculateRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[27] = CirculateRequestEventNew +} + +// ClientMessage is the event number for a ClientMessageEvent. +const ClientMessage = 33 + +type ClientMessageEvent struct { + Sequence uint16 + Format byte + Window Window + Type Atom + Data ClientMessageDataUnion +} + +// ClientMessageEventNew constructs a ClientMessageEvent value that implements xgb.Event from a byte slice. +func ClientMessageEventNew(buf []byte) xgb.Event { + v := ClientMessageEvent{} + b := 1 // don't read event number + + v.Format = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Type = Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Data = ClientMessageDataUnion{} + b += ClientMessageDataUnionRead(buf[b:], &v.Data) + + return v +} + +// Bytes writes a ClientMessageEvent value to a byte slice. +func (v ClientMessageEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 33 + b += 1 + + buf[b] = v.Format + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Type)) + b += 4 + { - byteString := make([]byte, v.NameLen) - copy(byteString[:v.NameLen], buf[b:]) - v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) + unionBytes := v.Data.Bytes() + copy(buf[b:], unionBytes) + b += xgb.Pad(len(unionBytes)) } - return b -} - -// StrReadList reads a byte slice into a list of Str values. -func StrReadList(buf []byte, dest []Str) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Str{} - b += StrRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Str value to a byte slice. -func (v Str) Bytes() []byte { - buf := make([]byte, (1 + xgb.Pad((int(v.NameLen) * 1)))) - b := 0 - - buf[b] = v.NameLen - b += 1 - - copy(buf[b:], v.Name[:v.NameLen]) - b += xgb.Pad(int(v.NameLen)) - return buf } -// StrListBytes writes a list of Str values to a byte slice. -func StrListBytes(buf []byte, list []Str) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b +// SequenceId returns the sequence id attached to the ClientMessage event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ClientMessageEvent) SequenceId() uint16 { + return v.Sequence } -// StrListSize computes the size (bytes) of a list of Str values. -func StrListSize(list []Str) int { - size := 0 - for _, item := range list { - size += (1 + xgb.Pad((int(item.NameLen) * 1))) - } - return size +// String is a rudimentary string representation of ClientMessageEvent. +func (v ClientMessageEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Format: %d", v.Format)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Type: %d", v.Type)) + return "ClientMessage {" + xgb.StringsJoin(fieldVals, ", ") + "}" } -type Segment struct { - X1 int16 - Y1 int16 - X2 int16 - Y2 int16 -} - -// SegmentRead reads a byte slice into a Segment value. -func SegmentRead(buf []byte, v *Segment) int { - b := 0 - - v.X1 = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y1 = int16(xgb.Get16(buf[b:])) - b += 2 - - v.X2 = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y2 = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// SegmentReadList reads a byte slice into a list of Segment values. -func SegmentReadList(buf []byte, dest []Segment) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Segment{} - b += SegmentRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Segment value to a byte slice. -func (v Segment) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], uint16(v.X1)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y1)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.X2)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y2)) - b += 2 - - return buf -} - -// SegmentListBytes writes a list of Segment values to a byte slice. -func SegmentListBytes(buf []byte, list []Segment) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Coloritem struct { - Pixel uint32 - Red uint16 - Green uint16 - Blue uint16 - Flags byte - // padding: 1 bytes -} - -// ColoritemRead reads a byte slice into a Coloritem value. -func ColoritemRead(buf []byte, v *Coloritem) int { - b := 0 - - v.Pixel = xgb.Get32(buf[b:]) - b += 4 - - v.Red = xgb.Get16(buf[b:]) - b += 2 - - v.Green = xgb.Get16(buf[b:]) - b += 2 - - v.Blue = xgb.Get16(buf[b:]) - b += 2 - - v.Flags = buf[b] - b += 1 - - b += 1 // padding - - return b -} - -// ColoritemReadList reads a byte slice into a list of Coloritem values. -func ColoritemReadList(buf []byte, dest []Coloritem) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Coloritem{} - b += ColoritemRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Coloritem value to a byte slice. -func (v Coloritem) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - xgb.Put32(buf[b:], v.Pixel) - b += 4 - - xgb.Put16(buf[b:], v.Red) - b += 2 - - xgb.Put16(buf[b:], v.Green) - b += 2 - - xgb.Put16(buf[b:], v.Blue) - b += 2 - - buf[b] = v.Flags - b += 1 - - b += 1 // padding - - return buf -} - -// ColoritemListBytes writes a list of Coloritem values to a byte slice. -func ColoritemListBytes(buf []byte, list []Coloritem) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Rgb struct { - Red uint16 - Green uint16 - Blue uint16 - // padding: 2 bytes -} - -// RgbRead reads a byte slice into a Rgb value. -func RgbRead(buf []byte, v *Rgb) int { - b := 0 - - v.Red = xgb.Get16(buf[b:]) - b += 2 - - v.Green = xgb.Get16(buf[b:]) - b += 2 - - v.Blue = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return b -} - -// RgbReadList reads a byte slice into a list of Rgb values. -func RgbReadList(buf []byte, dest []Rgb) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Rgb{} - b += RgbRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Rgb value to a byte slice. -func (v Rgb) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.Red) - b += 2 - - xgb.Put16(buf[b:], v.Green) - b += 2 - - xgb.Put16(buf[b:], v.Blue) - b += 2 - - b += 2 // padding - - return buf -} - -// RgbListBytes writes a list of Rgb values to a byte slice. -func RgbListBytes(buf []byte, list []Rgb) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Host struct { - Family byte - // padding: 1 bytes - AddressLen uint16 - Address []byte // size: xgb.Pad((int(AddressLen) * 1)) -} - -// HostRead reads a byte slice into a Host value. -func HostRead(buf []byte, v *Host) int { - b := 0 - - v.Family = buf[b] - b += 1 - - b += 1 // padding - - v.AddressLen = xgb.Get16(buf[b:]) - b += 2 - - v.Address = make([]byte, v.AddressLen) - copy(v.Address[:v.AddressLen], buf[b:]) - b += xgb.Pad(int(v.AddressLen)) - - return b -} - -// HostReadList reads a byte slice into a list of Host values. -func HostReadList(buf []byte, dest []Host) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Host{} - b += HostRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Host value to a byte slice. -func (v Host) Bytes() []byte { - buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) - b := 0 - - buf[b] = v.Family - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], v.AddressLen) - b += 2 - - copy(buf[b:], v.Address[:v.AddressLen]) - b += xgb.Pad(int(v.AddressLen)) - - return buf -} - -// HostListBytes writes a list of Host values to a byte slice. -func HostListBytes(buf []byte, list []Host) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// HostListSize computes the size (bytes) of a list of Host values. -func HostListSize(list []Host) int { - size := 0 - for _, item := range list { - size += (4 + xgb.Pad((int(item.AddressLen) * 1))) - } - return size +func init() { + xgb.NewEventFuncs[33] = ClientMessageEventNew } // ClientMessageDataUnion is a represention of the ClientMessageDataUnion union type. @@ -2649,121 +1108,86 @@ func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) return b } -// KeyPress is the event number for a KeyPressEvent. -const KeyPress = 2 +const ( + ClipOrderingUnsorted = 0 + ClipOrderingYSorted = 1 + ClipOrderingYXSorted = 2 + ClipOrderingYXBanded = 3 +) -type KeyPressEvent struct { - Sequence uint16 - Detail Keycode - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - SameScreen bool +const ( + CloseDownDestroyAll = 0 + CloseDownRetainPermanent = 1 + CloseDownRetainTemporary = 2 +) + +const ( + ColorFlagRed = 1 + ColorFlagGreen = 2 + ColorFlagBlue = 4 +) + +type Coloritem struct { + Pixel uint32 + Red uint16 + Green uint16 + Blue uint16 + Flags byte // padding: 1 bytes } -// KeyPressEventNew constructs a KeyPressEvent value that implements xgb.Event from a byte slice. -func KeyPressEventNew(buf []byte) xgb.Event { - v := KeyPressEvent{} - b := 1 // don't read event number +// ColoritemRead reads a byte slice into a Coloritem value. +func ColoritemRead(buf []byte, v *Coloritem) int { + b := 0 - v.Detail = Keycode(buf[b]) - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(xgb.Get32(buf[b:])) + v.Pixel = xgb.Get32(buf[b:]) b += 4 - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) + v.Red = xgb.Get16(buf[b:]) b += 2 - v.RootY = int16(xgb.Get16(buf[b:])) + v.Green = xgb.Get16(buf[b:]) b += 2 - v.EventX = int16(xgb.Get16(buf[b:])) + v.Blue = xgb.Get16(buf[b:]) b += 2 - v.EventY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.State = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false - } + v.Flags = buf[b] b += 1 b += 1 // padding - return v + return b } -// Bytes writes a KeyPressEvent value to a byte slice. -func (v KeyPressEvent) Bytes() []byte { - buf := make([]byte, 32) +// ColoritemReadList reads a byte slice into a list of Coloritem values. +func ColoritemReadList(buf []byte, dest []Coloritem) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Coloritem{} + b += ColoritemRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Coloritem value to a byte slice. +func (v Coloritem) Bytes() []byte { + buf := make([]byte, 12) b := 0 - // write event number - buf[b] = 2 - b += 1 - - buf[b] = byte(v.Detail) - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) + xgb.Put32(buf[b:], v.Pixel) b += 4 - xgb.Put32(buf[b:], uint32(v.Root)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Child)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.RootX)) + xgb.Put16(buf[b:], v.Red) b += 2 - xgb.Put16(buf[b:], uint16(v.RootY)) + xgb.Put16(buf[b:], v.Green) b += 2 - xgb.Put16(buf[b:], uint16(v.EventX)) + xgb.Put16(buf[b:], v.Blue) b += 2 - xgb.Put16(buf[b:], uint16(v.EventY)) - b += 2 - - xgb.Put16(buf[b:], v.State) - b += 2 - - if v.SameScreen { - buf[b] = 1 - } else { - buf[b] = 0 - } + buf[b] = v.Flags b += 1 b += 1 // padding @@ -2771,631 +1195,91 @@ func (v KeyPressEvent) Bytes() []byte { return buf } -// SequenceId returns the sequence id attached to the KeyPress event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v KeyPressEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of KeyPressEvent. -func (v KeyPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - return "KeyPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[2] = KeyPressEventNew -} - -// ButtonPress is the event number for a ButtonPressEvent. -const ButtonPress = 4 - -type ButtonPressEvent struct { - Sequence uint16 - Detail Button - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - SameScreen bool - // padding: 1 bytes -} - -// ButtonPressEventNew constructs a ButtonPressEvent value that implements xgb.Event from a byte slice. -func ButtonPressEventNew(buf []byte) xgb.Event { - v := ButtonPressEvent{} - b := 1 // don't read event number - - v.Detail = Button(buf[b]) - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.RootY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.State = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false +// ColoritemListBytes writes a list of Coloritem values to a byte slice. +func ColoritemListBytes(buf []byte, list []Coloritem) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) } - b += 1 + return b +} - b += 1 // padding +type Colormap uint32 +func NewColormapId(c *xgb.Conn) (Colormap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Colormap(id), nil +} + +// BadColormap is the error number for a BadColormap. +const BadColormap = 12 + +type ColormapError ValueError + +// ColormapErrorNew constructs a ColormapError value that implements xgb.Error from a byte slice. +func ColormapErrorNew(buf []byte) xgb.Error { + v := ColormapError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Colormap" return v } -// Bytes writes a ButtonPressEvent value to a byte slice. -func (v ButtonPressEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 4 - b += 1 - - buf[b] = byte(v.Detail) - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Root)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Child)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.RootX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.RootY)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventY)) - b += 2 - - xgb.Put16(buf[b:], v.State) - b += 2 - - if v.SameScreen { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the ButtonPress event. -// Events without a sequence number (KeymapNotify) return 0. +// SequenceId returns the sequence id attached to the BadColormap error. // This is mostly used internally. -func (v ButtonPressEvent) SequenceId() uint16 { - return v.Sequence +func (err ColormapError) SequenceId() uint16 { + return err.Sequence } -// String is a rudimentary string representation of ButtonPressEvent. -func (v ButtonPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - return "ButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// BadId returns the 'BadValue' number if one exists for the BadColormap error. If no bad value exists, 0 is returned. +func (err ColormapError) BadId() uint32 { + return err.BadValue } -func init() { - xgb.NewEventFuncs[4] = ButtonPressEventNew -} - -// MotionNotify is the event number for a MotionNotifyEvent. -const MotionNotify = 6 - -type MotionNotifyEvent struct { - Sequence uint16 - Detail byte - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - SameScreen bool - // padding: 1 bytes -} - -// MotionNotifyEventNew constructs a MotionNotifyEvent value that implements xgb.Event from a byte slice. -func MotionNotifyEventNew(buf []byte) xgb.Event { - v := MotionNotifyEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.RootY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.State = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false - } - b += 1 - - b += 1 // padding - - return v -} - -// Bytes writes a MotionNotifyEvent value to a byte slice. -func (v MotionNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 6 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Root)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Child)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.RootX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.RootY)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventY)) - b += 2 - - xgb.Put16(buf[b:], v.State) - b += 2 - - if v.SameScreen { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the MotionNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v MotionNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of MotionNotifyEvent. -func (v MotionNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - return "MotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[6] = MotionNotifyEventNew -} - -// EnterNotify is the event number for a EnterNotifyEvent. -const EnterNotify = 7 - -type EnterNotifyEvent struct { - Sequence uint16 - Detail byte - Time Timestamp - Root Window - Event Window - Child Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - Mode byte - SameScreenFocus byte -} - -// EnterNotifyEventNew constructs a EnterNotifyEvent value that implements xgb.Event from a byte slice. -func EnterNotifyEventNew(buf []byte) xgb.Event { - v := EnterNotifyEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.RootY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.State = xgb.Get16(buf[b:]) - b += 2 - - v.Mode = buf[b] - b += 1 - - v.SameScreenFocus = buf[b] - b += 1 - - return v -} - -// Bytes writes a EnterNotifyEvent value to a byte slice. -func (v EnterNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 7 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Root)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Child)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.RootX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.RootY)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventY)) - b += 2 - - xgb.Put16(buf[b:], v.State) - b += 2 - - buf[b] = v.Mode - b += 1 - - buf[b] = v.SameScreenFocus - b += 1 - - return buf -} - -// SequenceId returns the sequence id attached to the EnterNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v EnterNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of EnterNotifyEvent. -func (v EnterNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) - return "EnterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[7] = EnterNotifyEventNew -} - -// FocusIn is the event number for a FocusInEvent. -const FocusIn = 9 - -type FocusInEvent struct { - Sequence uint16 - Detail byte - Event Window - Mode byte - // padding: 3 bytes -} - -// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. -func FocusInEventNew(buf []byte) xgb.Event { - v := FocusInEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Mode = buf[b] - b += 1 - - b += 3 // padding - - return v -} - -// Bytes writes a FocusInEvent value to a byte slice. -func (v FocusInEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 9 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - buf[b] = v.Mode - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the FocusIn event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v FocusInEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of FocusInEvent. -func (v FocusInEvent) String() string { +// Error returns a rudimentary string representation of the BadColormap error. +func (err ColormapError) Error() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadColormap {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewEventFuncs[9] = FocusInEventNew + xgb.NewErrorFuncs[12] = ColormapErrorNew } -// KeymapNotify is the event number for a KeymapNotifyEvent. -const KeymapNotify = 11 +const ( + ColormapNone = 0 +) -type KeymapNotifyEvent struct { - Keys []byte // size: 32 -} +const ( + ColormapAllocNone = 0 + ColormapAllocAll = 1 +) -// KeymapNotifyEventNew constructs a KeymapNotifyEvent value that implements xgb.Event from a byte slice. -func KeymapNotifyEventNew(buf []byte) xgb.Event { - v := KeymapNotifyEvent{} - b := 1 // don't read event number +// ColormapNotify is the event number for a ColormapNotifyEvent. +const ColormapNotify = 32 - v.Keys = make([]byte, 31) - copy(v.Keys[:31], buf[b:]) - b += xgb.Pad(int(31)) - - return v -} - -// Bytes writes a KeymapNotifyEvent value to a byte slice. -func (v KeymapNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 11 - b += 1 - - copy(buf[b:], v.Keys[:31]) - b += xgb.Pad(int(31)) - - return buf -} - -// SequenceId returns the sequence id attached to the KeymapNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v KeymapNotifyEvent) SequenceId() uint16 { - return uint16(0) -} - -// String is a rudimentary string representation of KeymapNotifyEvent. -func (v KeymapNotifyEvent) String() string { - fieldVals := make([]string, 0, 1) - return "KeymapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[11] = KeymapNotifyEventNew -} - -// Expose is the event number for a ExposeEvent. -const Expose = 12 - -type ExposeEvent struct { +type ColormapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Window - X uint16 - Y uint16 - Width uint16 - Height uint16 - Count uint16 + Window Window + Colormap Colormap + New bool + State byte // padding: 2 bytes } -// ExposeEventNew constructs a ExposeEvent value that implements xgb.Event from a byte slice. -func ExposeEventNew(buf []byte) xgb.Event { - v := ExposeEvent{} +// ColormapNotifyEventNew constructs a ColormapNotifyEvent value that implements xgb.Event from a byte slice. +func ColormapNotifyEventNew(buf []byte) xgb.Event { + v := ColormapNotifyEvent{} b := 1 // don't read event number b += 1 // padding @@ -3406,333 +1290,31 @@ func ExposeEventNew(buf []byte) xgb.Event { v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.X = xgb.Get16(buf[b:]) - b += 2 - - v.Y = xgb.Get16(buf[b:]) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.Count = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return v -} - -// Bytes writes a ExposeEvent value to a byte slice. -func (v ExposeEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 12 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Window)) + v.Colormap = Colormap(xgb.Get32(buf[b:])) b += 4 - xgb.Put16(buf[b:], v.X) - b += 2 - - xgb.Put16(buf[b:], v.Y) - b += 2 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 - - xgb.Put16(buf[b:], v.Count) - b += 2 - - b += 2 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the Expose event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ExposeEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of ExposeEvent. -func (v ExposeEvent) String() string { - fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - return "Expose {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[12] = ExposeEventNew -} - -// GraphicsExposure is the event number for a GraphicsExposureEvent. -const GraphicsExposure = 13 - -type GraphicsExposureEvent struct { - Sequence uint16 - // padding: 1 bytes - Drawable Drawable - X uint16 - Y uint16 - Width uint16 - Height uint16 - MinorOpcode uint16 - Count uint16 - MajorOpcode byte - // padding: 3 bytes -} - -// GraphicsExposureEventNew constructs a GraphicsExposureEvent value that implements xgb.Event from a byte slice. -func GraphicsExposureEventNew(buf []byte) xgb.Event { - v := GraphicsExposureEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Drawable = Drawable(xgb.Get32(buf[b:])) - b += 4 - - v.X = xgb.Get16(buf[b:]) - b += 2 - - v.Y = xgb.Get16(buf[b:]) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.Count = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] + if buf[b] == 1 { + v.New = true + } else { + v.New = false + } b += 1 - b += 3 // padding - - return v -} - -// Bytes writes a GraphicsExposureEvent value to a byte slice. -func (v GraphicsExposureEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 13 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - xgb.Put16(buf[b:], v.X) - b += 2 - - xgb.Put16(buf[b:], v.Y) - b += 2 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 - - xgb.Put16(buf[b:], v.MinorOpcode) - b += 2 - - xgb.Put16(buf[b:], v.Count) - b += 2 - - buf[b] = v.MajorOpcode - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the GraphicsExposure event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v GraphicsExposureEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of GraphicsExposureEvent. -func (v GraphicsExposureEvent) String() string { - fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) - return "GraphicsExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[13] = GraphicsExposureEventNew -} - -// NoExposure is the event number for a NoExposureEvent. -const NoExposure = 14 - -type NoExposureEvent struct { - Sequence uint16 - // padding: 1 bytes - Drawable Drawable - MinorOpcode uint16 - MajorOpcode byte - // padding: 1 bytes -} - -// NoExposureEventNew constructs a NoExposureEvent value that implements xgb.Event from a byte slice. -func NoExposureEventNew(buf []byte) xgb.Event { - v := NoExposureEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Drawable = Drawable(xgb.Get32(buf[b:])) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - b += 1 // padding - - return v -} - -// Bytes writes a NoExposureEvent value to a byte slice. -func (v NoExposureEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 14 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - xgb.Put16(buf[b:], v.MinorOpcode) - b += 2 - - buf[b] = v.MajorOpcode - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the NoExposure event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v NoExposureEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of NoExposureEvent. -func (v NoExposureEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) - return "NoExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[14] = NoExposureEventNew -} - -// VisibilityNotify is the event number for a VisibilityNotifyEvent. -const VisibilityNotify = 15 - -type VisibilityNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Window Window - State byte - // padding: 3 bytes -} - -// VisibilityNotifyEventNew constructs a VisibilityNotifyEvent value that implements xgb.Event from a byte slice. -func VisibilityNotifyEventNew(buf []byte) xgb.Event { - v := VisibilityNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - v.State = buf[b] b += 1 - b += 3 // padding + b += 2 // padding return v } -// Bytes writes a VisibilityNotifyEvent value to a byte slice. -func (v VisibilityNotifyEvent) Bytes() []byte { +// Bytes writes a ColormapNotifyEvent value to a byte slice. +func (v ColormapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 15 + buf[b] = 32 b += 1 b += 1 // padding @@ -3742,607 +1324,60 @@ func (v VisibilityNotifyEvent) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Window)) b += 4 + xgb.Put32(buf[b:], uint32(v.Colormap)) + b += 4 + + if v.New { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + buf[b] = v.State b += 1 - b += 3 // padding + b += 2 // padding return buf } -// SequenceId returns the sequence id attached to the VisibilityNotify event. +// SequenceId returns the sequence id attached to the ColormapNotify event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v VisibilityNotifyEvent) SequenceId() uint16 { +func (v ColormapNotifyEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of VisibilityNotifyEvent. -func (v VisibilityNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) +// String is a rudimentary string representation of ColormapNotifyEvent. +func (v ColormapNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Colormap: %d", v.Colormap)) + fieldVals = append(fieldVals, xgb.Sprintf("New: %t", v.New)) fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - return "VisibilityNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" + return "ColormapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewEventFuncs[15] = VisibilityNotifyEventNew + xgb.NewEventFuncs[32] = ColormapNotifyEventNew } -// CreateNotify is the event number for a CreateNotifyEvent. -const CreateNotify = 16 - -type CreateNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Parent Window - Window Window - X int16 - Y int16 - Width uint16 - Height uint16 - BorderWidth uint16 - OverrideRedirect bool - // padding: 1 bytes -} - -// CreateNotifyEventNew constructs a CreateNotifyEvent value that implements xgb.Event from a byte slice. -func CreateNotifyEventNew(buf []byte) xgb.Event { - v := CreateNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Parent = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.BorderWidth = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.OverrideRedirect = true - } else { - v.OverrideRedirect = false - } - b += 1 - - b += 1 // padding - - return v -} - -// Bytes writes a CreateNotifyEvent value to a byte slice. -func (v CreateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 16 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Parent)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - xgb.Put16(buf[b:], v.Width) - b += 2 - - xgb.Put16(buf[b:], v.Height) - b += 2 - - xgb.Put16(buf[b:], v.BorderWidth) - b += 2 - - if v.OverrideRedirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the CreateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v CreateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of CreateNotifyEvent. -func (v CreateNotifyEvent) String() string { - fieldVals := make([]string, 0, 10) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) - fieldVals = append(fieldVals, xgb.Sprintf("BorderWidth: %d", v.BorderWidth)) - fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "CreateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[16] = CreateNotifyEventNew -} - -// DestroyNotify is the event number for a DestroyNotifyEvent. -const DestroyNotify = 17 - -type DestroyNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Event Window - Window Window -} - -// DestroyNotifyEventNew constructs a DestroyNotifyEvent value that implements xgb.Event from a byte slice. -func DestroyNotifyEventNew(buf []byte) xgb.Event { - v := DestroyNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Bytes writes a DestroyNotifyEvent value to a byte slice. -func (v DestroyNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 17 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - return buf -} - -// SequenceId returns the sequence id attached to the DestroyNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DestroyNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DestroyNotifyEvent. -func (v DestroyNotifyEvent) String() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - return "DestroyNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[17] = DestroyNotifyEventNew -} - -// UnmapNotify is the event number for a UnmapNotifyEvent. -const UnmapNotify = 18 - -type UnmapNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Event Window - Window Window - FromConfigure bool - // padding: 3 bytes -} - -// UnmapNotifyEventNew constructs a UnmapNotifyEvent value that implements xgb.Event from a byte slice. -func UnmapNotifyEventNew(buf []byte) xgb.Event { - v := UnmapNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - if buf[b] == 1 { - v.FromConfigure = true - } else { - v.FromConfigure = false - } - b += 1 - - b += 3 // padding - - return v -} - -// Bytes writes a UnmapNotifyEvent value to a byte slice. -func (v UnmapNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 18 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - if v.FromConfigure { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the UnmapNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v UnmapNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of UnmapNotifyEvent. -func (v UnmapNotifyEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("FromConfigure: %t", v.FromConfigure)) - return "UnmapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[18] = UnmapNotifyEventNew -} - -// MapNotify is the event number for a MapNotifyEvent. -const MapNotify = 19 - -type MapNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Event Window - Window Window - OverrideRedirect bool - // padding: 3 bytes -} - -// MapNotifyEventNew constructs a MapNotifyEvent value that implements xgb.Event from a byte slice. -func MapNotifyEventNew(buf []byte) xgb.Event { - v := MapNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - if buf[b] == 1 { - v.OverrideRedirect = true - } else { - v.OverrideRedirect = false - } - b += 1 - - b += 3 // padding - - return v -} - -// Bytes writes a MapNotifyEvent value to a byte slice. -func (v MapNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 19 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - if v.OverrideRedirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the MapNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v MapNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of MapNotifyEvent. -func (v MapNotifyEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "MapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[19] = MapNotifyEventNew -} - -// MapRequest is the event number for a MapRequestEvent. -const MapRequest = 20 - -type MapRequestEvent struct { - Sequence uint16 - // padding: 1 bytes - Parent Window - Window Window -} - -// MapRequestEventNew constructs a MapRequestEvent value that implements xgb.Event from a byte slice. -func MapRequestEventNew(buf []byte) xgb.Event { - v := MapRequestEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Parent = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Bytes writes a MapRequestEvent value to a byte slice. -func (v MapRequestEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 20 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Parent)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - return buf -} - -// SequenceId returns the sequence id attached to the MapRequest event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v MapRequestEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of MapRequestEvent. -func (v MapRequestEvent) String() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - return "MapRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[20] = MapRequestEventNew -} - -// ReparentNotify is the event number for a ReparentNotifyEvent. -const ReparentNotify = 21 - -type ReparentNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Event Window - Window Window - Parent Window - X int16 - Y int16 - OverrideRedirect bool - // padding: 3 bytes -} - -// ReparentNotifyEventNew constructs a ReparentNotifyEvent value that implements xgb.Event from a byte slice. -func ReparentNotifyEventNew(buf []byte) xgb.Event { - v := ReparentNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Event = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Parent = Window(xgb.Get32(buf[b:])) - b += 4 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - if buf[b] == 1 { - v.OverrideRedirect = true - } else { - v.OverrideRedirect = false - } - b += 1 - - b += 3 // padding - - return v -} - -// Bytes writes a ReparentNotifyEvent value to a byte slice. -func (v ReparentNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 21 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Parent)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.X)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Y)) - b += 2 - - if v.OverrideRedirect { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the ReparentNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ReparentNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of ReparentNotifyEvent. -func (v ReparentNotifyEvent) String() string { - fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) - fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) - fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) - fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) - return "ReparentNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[21] = ReparentNotifyEventNew -} +const ( + ColormapStateUninstalled = 0 + ColormapStateInstalled = 1 +) + +const ( + ConfigWindowX = 1 + ConfigWindowY = 2 + ConfigWindowWidth = 4 + ConfigWindowHeight = 8 + ConfigWindowBorderWidth = 16 + ConfigWindowSibling = 32 + ConfigWindowStackMode = 64 +) // ConfigureNotify is the event number for a ConfigureNotifyEvent. const ConfigureNotify = 22 @@ -4614,6 +1649,1255 @@ func init() { xgb.NewEventFuncs[23] = ConfigureRequestEventNew } +const ( + CoordModeOrigin = 0 + CoordModePrevious = 1 +) + +// CreateNotify is the event number for a CreateNotifyEvent. +const CreateNotify = 16 + +type CreateNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Parent Window + Window Window + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + OverrideRedirect bool + // padding: 1 bytes +} + +// CreateNotifyEventNew constructs a CreateNotifyEvent value that implements xgb.Event from a byte slice. +func CreateNotifyEventNew(buf []byte) xgb.Event { + v := CreateNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Parent = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.BorderWidth = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a CreateNotifyEvent value to a byte slice. +func (v CreateNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 16 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Parent)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.BorderWidth) + b += 2 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the CreateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v CreateNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of CreateNotifyEvent. +func (v CreateNotifyEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("BorderWidth: %d", v.BorderWidth)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "CreateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[16] = CreateNotifyEventNew +} + +type Cursor uint32 + +func NewCursorId(c *xgb.Conn) (Cursor, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Cursor(id), nil +} + +// BadCursor is the error number for a BadCursor. +const BadCursor = 6 + +type CursorError ValueError + +// CursorErrorNew constructs a CursorError value that implements xgb.Error from a byte slice. +func CursorErrorNew(buf []byte) xgb.Error { + v := CursorError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Cursor" + return v +} + +// SequenceId returns the sequence id attached to the BadCursor error. +// This is mostly used internally. +func (err CursorError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadCursor error. If no bad value exists, 0 is returned. +func (err CursorError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadCursor error. +func (err CursorError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadCursor {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[6] = CursorErrorNew +} + +const ( + CursorNone = 0 +) + +const ( + CwBackPixmap = 1 + CwBackPixel = 2 + CwBorderPixmap = 4 + CwBorderPixel = 8 + CwBitGravity = 16 + CwWinGravity = 32 + CwBackingStore = 64 + CwBackingPlanes = 128 + CwBackingPixel = 256 + CwOverrideRedirect = 512 + CwSaveUnder = 1024 + CwEventMask = 2048 + CwDontPropagate = 4096 + CwColormap = 8192 + CwCursor = 16384 +) + +type DepthInfo struct { + Depth byte + // padding: 1 bytes + VisualsLen uint16 + // padding: 4 bytes + Visuals []VisualInfo // size: xgb.Pad((int(VisualsLen) * 24)) +} + +// DepthInfoRead reads a byte slice into a DepthInfo value. +func DepthInfoRead(buf []byte, v *DepthInfo) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + b += 1 // padding + + v.VisualsLen = xgb.Get16(buf[b:]) + b += 2 + + b += 4 // padding + + v.Visuals = make([]VisualInfo, v.VisualsLen) + b += VisualInfoReadList(buf[b:], v.Visuals) + + return b +} + +// DepthInfoReadList reads a byte slice into a list of DepthInfo values. +func DepthInfoReadList(buf []byte, dest []DepthInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = DepthInfo{} + b += DepthInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a DepthInfo value to a byte slice. +func (v DepthInfo) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.VisualsLen) * 24)))) + b := 0 + + buf[b] = v.Depth + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.VisualsLen) + b += 2 + + b += 4 // padding + + b += VisualInfoListBytes(buf[b:], v.Visuals) + + return buf +} + +// DepthInfoListBytes writes a list of DepthInfo values to a byte slice. +func DepthInfoListBytes(buf []byte, list []DepthInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// DepthInfoListSize computes the size (bytes) of a list of DepthInfo values. +func DepthInfoListSize(list []DepthInfo) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.VisualsLen) * 24))) + } + return size +} + +// DestroyNotify is the event number for a DestroyNotifyEvent. +const DestroyNotify = 17 + +type DestroyNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Window + Window Window +} + +// DestroyNotifyEventNew constructs a DestroyNotifyEvent value that implements xgb.Event from a byte slice. +func DestroyNotifyEventNew(buf []byte) xgb.Event { + v := DestroyNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Bytes writes a DestroyNotifyEvent value to a byte slice. +func (v DestroyNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 17 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + return buf +} + +// SequenceId returns the sequence id attached to the DestroyNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v DestroyNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of DestroyNotifyEvent. +func (v DestroyNotifyEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + return "DestroyNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[17] = DestroyNotifyEventNew +} + +type Drawable uint32 + +func NewDrawableId(c *xgb.Conn) (Drawable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Drawable(id), nil +} + +// BadDrawable is the error number for a BadDrawable. +const BadDrawable = 9 + +type DrawableError ValueError + +// DrawableErrorNew constructs a DrawableError value that implements xgb.Error from a byte slice. +func DrawableErrorNew(buf []byte) xgb.Error { + v := DrawableError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Drawable" + return v +} + +// SequenceId returns the sequence id attached to the BadDrawable error. +// This is mostly used internally. +func (err DrawableError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadDrawable error. If no bad value exists, 0 is returned. +func (err DrawableError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadDrawable error. +func (err DrawableError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[9] = DrawableErrorNew +} + +// EnterNotify is the event number for a EnterNotifyEvent. +const EnterNotify = 7 + +type EnterNotifyEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Root Window + Event Window + Child Window + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + Mode byte + SameScreenFocus byte +} + +// EnterNotifyEventNew constructs a EnterNotifyEvent value that implements xgb.Event from a byte slice. +func EnterNotifyEventNew(buf []byte) xgb.Event { + v := EnterNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Child = Window(xgb.Get32(buf[b:])) + b += 4 + + v.RootX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.RootY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.State = xgb.Get16(buf[b:]) + b += 2 + + v.Mode = buf[b] + b += 1 + + v.SameScreenFocus = buf[b] + b += 1 + + return v +} + +// Bytes writes a EnterNotifyEvent value to a byte slice. +func (v EnterNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 7 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Child)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.RootX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.RootY)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventY)) + b += 2 + + xgb.Put16(buf[b:], v.State) + b += 2 + + buf[b] = v.Mode + b += 1 + + buf[b] = v.SameScreenFocus + b += 1 + + return buf +} + +// SequenceId returns the sequence id attached to the EnterNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v EnterNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of EnterNotifyEvent. +func (v EnterNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "EnterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[7] = EnterNotifyEventNew +} + +const ( + EventMaskNoEvent = 0 + EventMaskKeyPress = 1 + EventMaskKeyRelease = 2 + EventMaskButtonPress = 4 + EventMaskButtonRelease = 8 + EventMaskEnterWindow = 16 + EventMaskLeaveWindow = 32 + EventMaskPointerMotion = 64 + EventMaskPointerMotionHint = 128 + EventMaskButton1Motion = 256 + EventMaskButton2Motion = 512 + EventMaskButton3Motion = 1024 + EventMaskButton4Motion = 2048 + EventMaskButton5Motion = 4096 + EventMaskButtonMotion = 8192 + EventMaskKeymapState = 16384 + EventMaskExposure = 32768 + EventMaskVisibilityChange = 65536 + EventMaskStructureNotify = 131072 + EventMaskResizeRedirect = 262144 + EventMaskSubstructureNotify = 524288 + EventMaskSubstructureRedirect = 1048576 + EventMaskFocusChange = 2097152 + EventMaskPropertyChange = 4194304 + EventMaskColorMapChange = 8388608 + EventMaskOwnerGrabButton = 16777216 +) + +// Expose is the event number for a ExposeEvent. +const Expose = 12 + +type ExposeEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Window + X uint16 + Y uint16 + Width uint16 + Height uint16 + Count uint16 + // padding: 2 bytes +} + +// ExposeEventNew constructs a ExposeEvent value that implements xgb.Event from a byte slice. +func ExposeEventNew(buf []byte) xgb.Event { + v := ExposeEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.X = xgb.Get16(buf[b:]) + b += 2 + + v.Y = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.Count = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v +} + +// Bytes writes a ExposeEvent value to a byte slice. +func (v ExposeEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 12 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put16(buf[b:], v.X) + b += 2 + + xgb.Put16(buf[b:], v.Y) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.Count) + b += 2 + + b += 2 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the Expose event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ExposeEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of ExposeEvent. +func (v ExposeEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + return "Expose {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[12] = ExposeEventNew +} + +const ( + ExposuresNotAllowed = 0 + ExposuresAllowed = 1 + ExposuresDefault = 2 +) + +const ( + FamilyInternet = 0 + FamilyDECnet = 1 + FamilyChaos = 2 + FamilyServerInterpreted = 5 + FamilyInternet6 = 6 +) + +const ( + FillRuleEvenOdd = 0 + FillRuleWinding = 1 +) + +const ( + FillStyleSolid = 0 + FillStyleTiled = 1 + FillStyleStippled = 2 + FillStyleOpaqueStippled = 3 +) + +// FocusIn is the event number for a FocusInEvent. +const FocusIn = 9 + +type FocusInEvent struct { + Sequence uint16 + Detail byte + Event Window + Mode byte + // padding: 3 bytes +} + +// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. +func FocusInEventNew(buf []byte) xgb.Event { + v := FocusInEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Mode = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a FocusInEvent value to a byte slice. +func (v FocusInEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 9 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + buf[b] = v.Mode + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the FocusIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v FocusInEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of FocusInEvent. +func (v FocusInEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[9] = FocusInEventNew +} + +// FocusOut is the event number for a FocusOutEvent. +const FocusOut = 10 + +type FocusOutEvent FocusInEvent + +// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. +func FocusOutEventNew(buf []byte) xgb.Event { + return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) +} + +// Bytes writes a FocusOutEvent value to a byte slice. +func (v FocusOutEvent) Bytes() []byte { + return FocusInEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the FocusOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v FocusOutEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v FocusOutEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[10] = FocusOutEventNew +} + +type Font uint32 + +func NewFontId(c *xgb.Conn) (Font, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Font(id), nil +} + +const ( + FontNone = 0 +) + +// BadFont is the error number for a BadFont. +const BadFont = 7 + +type FontError ValueError + +// FontErrorNew constructs a FontError value that implements xgb.Error from a byte slice. +func FontErrorNew(buf []byte) xgb.Error { + v := FontError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Font" + return v +} + +// SequenceId returns the sequence id attached to the BadFont error. +// This is mostly used internally. +func (err FontError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadFont error. If no bad value exists, 0 is returned. +func (err FontError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadFont error. +func (err FontError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadFont {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[7] = FontErrorNew +} + +const ( + FontDrawLeftToRight = 0 + FontDrawRightToLeft = 1 +) + +type Fontable uint32 + +func NewFontableId(c *xgb.Conn) (Fontable, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Fontable(id), nil +} + +type Fontprop struct { + Name Atom + Value uint32 +} + +// FontpropRead reads a byte slice into a Fontprop value. +func FontpropRead(buf []byte, v *Fontprop) int { + b := 0 + + v.Name = Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Value = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// FontpropReadList reads a byte slice into a list of Fontprop values. +func FontpropReadList(buf []byte, dest []Fontprop) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Fontprop{} + b += FontpropRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Fontprop value to a byte slice. +func (v Fontprop) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Name)) + b += 4 + + xgb.Put32(buf[b:], v.Value) + b += 4 + + return buf +} + +// FontpropListBytes writes a list of Fontprop values to a byte slice. +func FontpropListBytes(buf []byte, list []Fontprop) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Format struct { + Depth byte + BitsPerPixel byte + ScanlinePad byte + // padding: 5 bytes +} + +// FormatRead reads a byte slice into a Format value. +func FormatRead(buf []byte, v *Format) int { + b := 0 + + v.Depth = buf[b] + b += 1 + + v.BitsPerPixel = buf[b] + b += 1 + + v.ScanlinePad = buf[b] + b += 1 + + b += 5 // padding + + return b +} + +// FormatReadList reads a byte slice into a list of Format values. +func FormatReadList(buf []byte, dest []Format) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Format{} + b += FormatRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Format value to a byte slice. +func (v Format) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + buf[b] = v.Depth + b += 1 + + buf[b] = v.BitsPerPixel + b += 1 + + buf[b] = v.ScanlinePad + b += 1 + + b += 5 // padding + + return buf +} + +// FormatListBytes writes a list of Format values to a byte slice. +func FormatListBytes(buf []byte, list []Format) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// BadGContext is the error number for a BadGContext. +const BadGContext = 13 + +type GContextError ValueError + +// GContextErrorNew constructs a GContextError value that implements xgb.Error from a byte slice. +func GContextErrorNew(buf []byte) xgb.Error { + v := GContextError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "GContext" + return v +} + +// SequenceId returns the sequence id attached to the BadGContext error. +// This is mostly used internally. +func (err GContextError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadGContext error. If no bad value exists, 0 is returned. +func (err GContextError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadGContext error. +func (err GContextError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadGContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[13] = GContextErrorNew +} + +const ( + GcFunction = 1 + GcPlaneMask = 2 + GcForeground = 4 + GcBackground = 8 + GcLineWidth = 16 + GcLineStyle = 32 + GcCapStyle = 64 + GcJoinStyle = 128 + GcFillStyle = 256 + GcFillRule = 512 + GcTile = 1024 + GcStipple = 2048 + GcTileStippleOriginX = 4096 + GcTileStippleOriginY = 8192 + GcFont = 16384 + GcSubwindowMode = 32768 + GcGraphicsExposures = 65536 + GcClipOriginX = 131072 + GcClipOriginY = 262144 + GcClipMask = 524288 + GcDashOffset = 1048576 + GcDashList = 2097152 + GcArcMode = 4194304 +) + +type Gcontext uint32 + +func NewGcontextId(c *xgb.Conn) (Gcontext, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Gcontext(id), nil +} + +const ( + GetPropertyTypeAny = 0 +) + +const ( + GrabAny = 0 +) + +const ( + GrabModeSync = 0 + GrabModeAsync = 1 +) + +const ( + GrabStatusSuccess = 0 + GrabStatusAlreadyGrabbed = 1 + GrabStatusInvalidTime = 2 + GrabStatusNotViewable = 3 + GrabStatusFrozen = 4 +) + +// GraphicsExposure is the event number for a GraphicsExposureEvent. +const GraphicsExposure = 13 + +type GraphicsExposureEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Drawable + X uint16 + Y uint16 + Width uint16 + Height uint16 + MinorOpcode uint16 + Count uint16 + MajorOpcode byte + // padding: 3 bytes +} + +// GraphicsExposureEventNew constructs a GraphicsExposureEvent value that implements xgb.Event from a byte slice. +func GraphicsExposureEventNew(buf []byte) xgb.Event { + v := GraphicsExposureEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.X = xgb.Get16(buf[b:]) + b += 2 + + v.Y = xgb.Get16(buf[b:]) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.Count = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a GraphicsExposureEvent value to a byte slice. +func (v GraphicsExposureEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 13 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put16(buf[b:], v.X) + b += 2 + + xgb.Put16(buf[b:], v.Y) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put16(buf[b:], v.MinorOpcode) + b += 2 + + xgb.Put16(buf[b:], v.Count) + b += 2 + + buf[b] = v.MajorOpcode + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the GraphicsExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v GraphicsExposureEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of GraphicsExposureEvent. +func (v GraphicsExposureEvent) String() string { + fieldVals := make([]string, 0, 10) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "GraphicsExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[13] = GraphicsExposureEventNew +} + +const ( + GravityBitForget = 0 + GravityWinUnmap = 0 + GravityNorthWest = 1 + GravityNorth = 2 + GravityNorthEast = 3 + GravityWest = 4 + GravityCenter = 5 + GravityEast = 6 + GravitySouthWest = 7 + GravitySouth = 8 + GravitySouthEast = 9 + GravityStatic = 10 +) + // GravityNotify is the event number for a GravityNotifyEvent. const GravityNotify = 24 @@ -4701,101 +2985,605 @@ func init() { xgb.NewEventFuncs[24] = GravityNotifyEventNew } -// ResizeRequest is the event number for a ResizeRequestEvent. -const ResizeRequest = 25 +const ( + GxClear = 0 + GxAnd = 1 + GxAndReverse = 2 + GxCopy = 3 + GxAndInverted = 4 + GxNoop = 5 + GxXor = 6 + GxOr = 7 + GxNor = 8 + GxEquiv = 9 + GxInvert = 10 + GxOrReverse = 11 + GxCopyInverted = 12 + GxOrInverted = 13 + GxNand = 14 + GxSet = 15 +) -type ResizeRequestEvent struct { - Sequence uint16 +type Host struct { + Family byte // padding: 1 bytes - Window Window - Width uint16 - Height uint16 + AddressLen uint16 + Address []byte // size: xgb.Pad((int(AddressLen) * 1)) } -// ResizeRequestEventNew constructs a ResizeRequestEvent value that implements xgb.Event from a byte slice. -func ResizeRequestEventNew(buf []byte) xgb.Event { - v := ResizeRequestEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// Bytes writes a ResizeRequestEvent value to a byte slice. -func (v ResizeRequestEvent) Bytes() []byte { - buf := make([]byte, 32) +// HostRead reads a byte slice into a Host value. +func HostRead(buf []byte, v *Host) int { b := 0 - // write event number - buf[b] = 25 + v.Family = buf[b] b += 1 b += 1 // padding - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put16(buf[b:], v.Width) + v.AddressLen = xgb.Get16(buf[b:]) b += 2 - xgb.Put16(buf[b:], v.Height) + v.Address = make([]byte, v.AddressLen) + copy(v.Address[:v.AddressLen], buf[b:]) + b += xgb.Pad(int(v.AddressLen)) + + return b +} + +// HostReadList reads a byte slice into a list of Host values. +func HostReadList(buf []byte, dest []Host) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Host{} + b += HostRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Host value to a byte slice. +func (v Host) Bytes() []byte { + buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) + b := 0 + + buf[b] = v.Family + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.AddressLen) b += 2 + copy(buf[b:], v.Address[:v.AddressLen]) + b += xgb.Pad(int(v.AddressLen)) + return buf } -// SequenceId returns the sequence id attached to the ResizeRequest event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ResizeRequestEvent) SequenceId() uint16 { - return v.Sequence +// HostListBytes writes a list of Host values to a byte slice. +func HostListBytes(buf []byte, list []Host) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -// String is a rudimentary string representation of ResizeRequestEvent. -func (v ResizeRequestEvent) String() string { +// HostListSize computes the size (bytes) of a list of Host values. +func HostListSize(list []Host) int { + size := 0 + for _, item := range list { + size += (4 + xgb.Pad((int(item.AddressLen) * 1))) + } + return size +} + +const ( + HostModeInsert = 0 + HostModeDelete = 1 +) + +// BadIDChoice is the error number for a BadIDChoice. +const BadIDChoice = 14 + +type IDChoiceError ValueError + +// IDChoiceErrorNew constructs a IDChoiceError value that implements xgb.Error from a byte slice. +func IDChoiceErrorNew(buf []byte) xgb.Error { + v := IDChoiceError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "IDChoice" + return v +} + +// SequenceId returns the sequence id attached to the BadIDChoice error. +// This is mostly used internally. +func (err IDChoiceError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadIDChoice error. If no bad value exists, 0 is returned. +func (err IDChoiceError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadIDChoice error. +func (err IDChoiceError) Error() string { fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) - fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) - return "ResizeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadIDChoice {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewEventFuncs[25] = ResizeRequestEventNew + xgb.NewErrorFuncs[14] = IDChoiceErrorNew } -// CirculateNotify is the event number for a CirculateNotifyEvent. -const CirculateNotify = 26 +const ( + ImageFormatXYBitmap = 0 + ImageFormatXYPixmap = 1 + ImageFormatZPixmap = 2 +) -type CirculateNotifyEvent struct { +const ( + ImageOrderLSBFirst = 0 + ImageOrderMSBFirst = 1 +) + +// BadImplementation is the error number for a BadImplementation. +const BadImplementation = 17 + +type ImplementationError RequestError + +// ImplementationErrorNew constructs a ImplementationError value that implements xgb.Error from a byte slice. +func ImplementationErrorNew(buf []byte) xgb.Error { + v := ImplementationError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Implementation" + return v +} + +// SequenceId returns the sequence id attached to the BadImplementation error. +// This is mostly used internally. +func (err ImplementationError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadImplementation error. If no bad value exists, 0 is returned. +func (err ImplementationError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadImplementation error. +func (err ImplementationError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadImplementation {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[17] = ImplementationErrorNew +} + +const ( + InputFocusNone = 0 + InputFocusPointerRoot = 1 + InputFocusParent = 2 + InputFocusFollowKeyboard = 3 +) + +const ( + JoinStyleMiter = 0 + JoinStyleRound = 1 + JoinStyleBevel = 2 +) + +const ( + KbKeyClickPercent = 1 + KbBellPercent = 2 + KbBellPitch = 4 + KbBellDuration = 8 + KbLed = 16 + KbLedMode = 32 + KbKey = 64 + KbAutoRepeatMode = 128 +) + +const ( + KeyButMaskShift = 1 + KeyButMaskLock = 2 + KeyButMaskControl = 4 + KeyButMaskMod1 = 8 + KeyButMaskMod2 = 16 + KeyButMaskMod3 = 32 + KeyButMaskMod4 = 64 + KeyButMaskMod5 = 128 + KeyButMaskButton1 = 256 + KeyButMaskButton2 = 512 + KeyButMaskButton3 = 1024 + KeyButMaskButton4 = 2048 + KeyButMaskButton5 = 4096 +) + +// KeyPress is the event number for a KeyPressEvent. +const KeyPress = 2 + +type KeyPressEvent struct { + Sequence uint16 + Detail Keycode + Time Timestamp + Root Window + Event Window + Child Window + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + // padding: 1 bytes +} + +// KeyPressEventNew constructs a KeyPressEvent value that implements xgb.Event from a byte slice. +func KeyPressEventNew(buf []byte) xgb.Event { + v := KeyPressEvent{} + b := 1 // don't read event number + + v.Detail = Keycode(buf[b]) + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Child = Window(xgb.Get32(buf[b:])) + b += 4 + + v.RootX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.RootY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.State = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a KeyPressEvent value to a byte slice. +func (v KeyPressEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 2 + b += 1 + + buf[b] = byte(v.Detail) + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Child)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.RootX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.RootY)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventY)) + b += 2 + + xgb.Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the KeyPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v KeyPressEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of KeyPressEvent. +func (v KeyPressEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "KeyPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[2] = KeyPressEventNew +} + +// KeyRelease is the event number for a KeyReleaseEvent. +const KeyRelease = 3 + +type KeyReleaseEvent KeyPressEvent + +// KeyReleaseEventNew constructs a KeyReleaseEvent value that implements xgb.Event from a byte slice. +func KeyReleaseEventNew(buf []byte) xgb.Event { + return KeyReleaseEvent(KeyPressEventNew(buf).(KeyPressEvent)) +} + +// Bytes writes a KeyReleaseEvent value to a byte slice. +func (v KeyReleaseEvent) Bytes() []byte { + return KeyPressEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the KeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v KeyReleaseEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v KeyReleaseEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "KeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[3] = KeyReleaseEventNew +} + +type Keycode byte + +// KeymapNotify is the event number for a KeymapNotifyEvent. +const KeymapNotify = 11 + +type KeymapNotifyEvent struct { + Keys []byte // size: 32 +} + +// KeymapNotifyEventNew constructs a KeymapNotifyEvent value that implements xgb.Event from a byte slice. +func KeymapNotifyEventNew(buf []byte) xgb.Event { + v := KeymapNotifyEvent{} + b := 1 // don't read event number + + v.Keys = make([]byte, 31) + copy(v.Keys[:31], buf[b:]) + b += xgb.Pad(int(31)) + + return v +} + +// Bytes writes a KeymapNotifyEvent value to a byte slice. +func (v KeymapNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 11 + b += 1 + + copy(buf[b:], v.Keys[:31]) + b += xgb.Pad(int(31)) + + return buf +} + +// SequenceId returns the sequence id attached to the KeymapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v KeymapNotifyEvent) SequenceId() uint16 { + return uint16(0) +} + +// String is a rudimentary string representation of KeymapNotifyEvent. +func (v KeymapNotifyEvent) String() string { + fieldVals := make([]string, 0, 1) + return "KeymapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[11] = KeymapNotifyEventNew +} + +type Keysym uint32 + +const ( + KillAllTemporary = 0 +) + +// LeaveNotify is the event number for a LeaveNotifyEvent. +const LeaveNotify = 8 + +type LeaveNotifyEvent EnterNotifyEvent + +// LeaveNotifyEventNew constructs a LeaveNotifyEvent value that implements xgb.Event from a byte slice. +func LeaveNotifyEventNew(buf []byte) xgb.Event { + return LeaveNotifyEvent(EnterNotifyEventNew(buf).(EnterNotifyEvent)) +} + +// Bytes writes a LeaveNotifyEvent value to a byte slice. +func (v LeaveNotifyEvent) Bytes() []byte { + return EnterNotifyEvent(v).Bytes() +} + +// SequenceId returns the sequence id attached to the LeaveNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v LeaveNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +func (v LeaveNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) + return "LeaveNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[8] = LeaveNotifyEventNew +} + +const ( + LedModeOff = 0 + LedModeOn = 1 +) + +// BadLength is the error number for a BadLength. +const BadLength = 16 + +type LengthError RequestError + +// LengthErrorNew constructs a LengthError value that implements xgb.Error from a byte slice. +func LengthErrorNew(buf []byte) xgb.Error { + v := LengthError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Length" + return v +} + +// SequenceId returns the sequence id attached to the BadLength error. +// This is mostly used internally. +func (err LengthError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadLength error. If no bad value exists, 0 is returned. +func (err LengthError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadLength error. +func (err LengthError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadLength {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[16] = LengthErrorNew +} + +const ( + LineStyleSolid = 0 + LineStyleOnOffDash = 1 + LineStyleDoubleDash = 2 +) + +const ( + MapIndexShift = 0 + MapIndexLock = 1 + MapIndexControl = 2 + MapIndex1 = 3 + MapIndex2 = 4 + MapIndex3 = 5 + MapIndex4 = 6 + MapIndex5 = 7 +) + +// MapNotify is the event number for a MapNotifyEvent. +const MapNotify = 19 + +type MapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Event Window - Window Window - // padding: 4 bytes - Place byte + Event Window + Window Window + OverrideRedirect bool // padding: 3 bytes } -// CirculateNotifyEventNew constructs a CirculateNotifyEvent value that implements xgb.Event from a byte slice. -func CirculateNotifyEventNew(buf []byte) xgb.Event { - v := CirculateNotifyEvent{} +// MapNotifyEventNew constructs a MapNotifyEvent value that implements xgb.Event from a byte slice. +func MapNotifyEventNew(buf []byte) xgb.Event { + v := MapNotifyEvent{} b := 1 // don't read event number b += 1 // padding @@ -4809,9 +3597,11 @@ func CirculateNotifyEventNew(buf []byte) xgb.Event { v.Window = Window(xgb.Get32(buf[b:])) b += 4 - b += 4 // padding - - v.Place = buf[b] + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } b += 1 b += 3 // padding @@ -4819,13 +3609,13 @@ func CirculateNotifyEventNew(buf []byte) xgb.Event { return v } -// Bytes writes a CirculateNotifyEvent value to a byte slice. -func (v CirculateNotifyEvent) Bytes() []byte { +// Bytes writes a MapNotifyEvent value to a byte slice. +func (v MapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 26 + buf[b] = 19 b += 1 b += 1 // padding @@ -4838,9 +3628,11 @@ func (v CirculateNotifyEvent) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - b += 4 // padding - - buf[b] = v.Place + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } b += 1 b += 3 // padding @@ -4848,27 +3640,674 @@ func (v CirculateNotifyEvent) Bytes() []byte { return buf } -// SequenceId returns the sequence id attached to the CirculateNotify event. +// SequenceId returns the sequence id attached to the MapNotify event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v CirculateNotifyEvent) SequenceId() uint16 { +func (v MapNotifyEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of CirculateNotifyEvent. -func (v CirculateNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) +// String is a rudimentary string representation of MapNotifyEvent. +func (v MapNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) - return "CirculateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "MapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewEventFuncs[26] = CirculateNotifyEventNew + xgb.NewEventFuncs[19] = MapNotifyEventNew } +// MapRequest is the event number for a MapRequestEvent. +const MapRequest = 20 + +type MapRequestEvent struct { + Sequence uint16 + // padding: 1 bytes + Parent Window + Window Window +} + +// MapRequestEventNew constructs a MapRequestEvent value that implements xgb.Event from a byte slice. +func MapRequestEventNew(buf []byte) xgb.Event { + v := MapRequestEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Parent = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Bytes writes a MapRequestEvent value to a byte slice. +func (v MapRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 20 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Parent)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + return buf +} + +// SequenceId returns the sequence id attached to the MapRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v MapRequestEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of MapRequestEvent. +func (v MapRequestEvent) String() string { + fieldVals := make([]string, 0, 3) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + return "MapRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[20] = MapRequestEventNew +} + +const ( + MapStateUnmapped = 0 + MapStateUnviewable = 1 + MapStateViewable = 2 +) + +const ( + MappingModifier = 0 + MappingKeyboard = 1 + MappingPointer = 2 +) + +// MappingNotify is the event number for a MappingNotifyEvent. +const MappingNotify = 34 + +type MappingNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Request byte + FirstKeycode Keycode + Count byte + // padding: 1 bytes +} + +// MappingNotifyEventNew constructs a MappingNotifyEvent value that implements xgb.Event from a byte slice. +func MappingNotifyEventNew(buf []byte) xgb.Event { + v := MappingNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Request = buf[b] + b += 1 + + v.FirstKeycode = Keycode(buf[b]) + b += 1 + + v.Count = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a MappingNotifyEvent value to a byte slice. +func (v MappingNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 34 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + buf[b] = v.Request + b += 1 + + buf[b] = byte(v.FirstKeycode) + b += 1 + + buf[b] = v.Count + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the MappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v MappingNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of MappingNotifyEvent. +func (v MappingNotifyEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) + fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) + fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) + return "MappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[34] = MappingNotifyEventNew +} + +const ( + MappingStatusSuccess = 0 + MappingStatusBusy = 1 + MappingStatusFailure = 2 +) + +// BadMatch is the error number for a BadMatch. +const BadMatch = 8 + +type MatchError RequestError + +// MatchErrorNew constructs a MatchError value that implements xgb.Error from a byte slice. +func MatchErrorNew(buf []byte) xgb.Error { + v := MatchError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Match" + return v +} + +// SequenceId returns the sequence id attached to the BadMatch error. +// This is mostly used internally. +func (err MatchError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadMatch error. If no bad value exists, 0 is returned. +func (err MatchError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadMatch error. +func (err MatchError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadMatch {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[8] = MatchErrorNew +} + +const ( + ModMaskShift = 1 + ModMaskLock = 2 + ModMaskControl = 4 + ModMask1 = 8 + ModMask2 = 16 + ModMask3 = 32 + ModMask4 = 64 + ModMask5 = 128 + ModMaskAny = 32768 +) + +const ( + MotionNormal = 0 + MotionHint = 1 +) + +// MotionNotify is the event number for a MotionNotifyEvent. +const MotionNotify = 6 + +type MotionNotifyEvent struct { + Sequence uint16 + Detail byte + Time Timestamp + Root Window + Event Window + Child Window + RootX int16 + RootY int16 + EventX int16 + EventY int16 + State uint16 + SameScreen bool + // padding: 1 bytes +} + +// MotionNotifyEventNew constructs a MotionNotifyEvent value that implements xgb.Event from a byte slice. +func MotionNotifyEventNew(buf []byte) xgb.Event { + v := MotionNotifyEvent{} + b := 1 // don't read event number + + v.Detail = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Child = Window(xgb.Get32(buf[b:])) + b += 4 + + v.RootX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.RootY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.EventY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.State = xgb.Get16(buf[b:]) + b += 2 + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a MotionNotifyEvent value to a byte slice. +func (v MotionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 6 + b += 1 + + buf[b] = v.Detail + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Child)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.RootX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.RootY)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventX)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.EventY)) + b += 2 + + xgb.Put16(buf[b:], v.State) + b += 2 + + if v.SameScreen { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the MotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v MotionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of MotionNotifyEvent. +func (v MotionNotifyEvent) String() string { + fieldVals := make([]string, 0, 12) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) + fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) + fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) + fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) + fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) + return "MotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[6] = MotionNotifyEventNew +} + +// BadName is the error number for a BadName. +const BadName = 15 + +type NameError RequestError + +// NameErrorNew constructs a NameError value that implements xgb.Error from a byte slice. +func NameErrorNew(buf []byte) xgb.Error { + v := NameError(RequestErrorNew(buf).(RequestError)) + v.NiceName = "Name" + return v +} + +// SequenceId returns the sequence id attached to the BadName error. +// This is mostly used internally. +func (err NameError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadName error. If no bad value exists, 0 is returned. +func (err NameError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadName error. +func (err NameError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadName {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[15] = NameErrorNew +} + +// NoExposure is the event number for a NoExposureEvent. +const NoExposure = 14 + +type NoExposureEvent struct { + Sequence uint16 + // padding: 1 bytes + Drawable Drawable + MinorOpcode uint16 + MajorOpcode byte + // padding: 1 bytes +} + +// NoExposureEventNew constructs a NoExposureEvent value that implements xgb.Event from a byte slice. +func NoExposureEventNew(buf []byte) xgb.Event { + v := NoExposureEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Drawable = Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +// Bytes writes a NoExposureEvent value to a byte slice. +func (v NoExposureEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 14 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put16(buf[b:], v.MinorOpcode) + b += 2 + + buf[b] = v.MajorOpcode + b += 1 + + b += 1 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the NoExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v NoExposureEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of NoExposureEvent. +func (v NoExposureEvent) String() string { + fieldVals := make([]string, 0, 5) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", v.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", v.MajorOpcode)) + return "NoExposure {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[14] = NoExposureEventNew +} + +const ( + NotifyDetailAncestor = 0 + NotifyDetailVirtual = 1 + NotifyDetailInferior = 2 + NotifyDetailNonlinear = 3 + NotifyDetailNonlinearVirtual = 4 + NotifyDetailPointer = 5 + NotifyDetailPointerRoot = 6 + NotifyDetailNone = 7 +) + +const ( + NotifyModeNormal = 0 + NotifyModeGrab = 1 + NotifyModeUngrab = 2 + NotifyModeWhileGrabbed = 3 +) + +type Pixmap uint32 + +func NewPixmapId(c *xgb.Conn) (Pixmap, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Pixmap(id), nil +} + +// BadPixmap is the error number for a BadPixmap. +const BadPixmap = 4 + +type PixmapError ValueError + +// PixmapErrorNew constructs a PixmapError value that implements xgb.Error from a byte slice. +func PixmapErrorNew(buf []byte) xgb.Error { + v := PixmapError(ValueErrorNew(buf).(ValueError)) + v.NiceName = "Pixmap" + return v +} + +// SequenceId returns the sequence id attached to the BadPixmap error. +// This is mostly used internally. +func (err PixmapError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadPixmap error. If no bad value exists, 0 is returned. +func (err PixmapError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadPixmap error. +func (err PixmapError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[4] = PixmapErrorNew +} + +const ( + PixmapNone = 0 +) + +const ( + PlaceOnTop = 0 + PlaceOnBottom = 1 +) + +type Point struct { + X int16 + Y int16 +} + +// PointRead reads a byte slice into a Point value. +func PointRead(buf []byte, v *Point) int { + b := 0 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// PointReadList reads a byte slice into a list of Point values. +func PointReadList(buf []byte, dest []Point) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Point{} + b += PointRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Point value to a byte slice. +func (v Point) Bytes() []byte { + buf := make([]byte, 4) + b := 0 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + return buf +} + +// PointListBytes writes a list of Point values to a byte slice. +func PointListBytes(buf []byte, list []Point) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + PolyShapeComplex = 0 + PolyShapeNonconvex = 1 + PolyShapeConvex = 2 +) + +const ( + PropModeReplace = 0 + PropModePrepend = 1 + PropModeAppend = 2 +) + +const ( + PropertyNewValue = 0 + PropertyDelete = 1 +) + // PropertyNotify is the event number for a PropertyNotifyEvent. const PropertyNotify = 28 @@ -4961,6 +4400,653 @@ func init() { xgb.NewEventFuncs[28] = PropertyNotifyEventNew } +const ( + QueryShapeOfLargestCursor = 0 + QueryShapeOfFastestTile = 1 + QueryShapeOfFastestStipple = 2 +) + +type Rectangle struct { + X int16 + Y int16 + Width uint16 + Height uint16 +} + +// RectangleRead reads a byte slice into a Rectangle value. +func RectangleRead(buf []byte, v *Rectangle) int { + b := 0 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return b +} + +// RectangleReadList reads a byte slice into a list of Rectangle values. +func RectangleReadList(buf []byte, dest []Rectangle) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rectangle{} + b += RectangleRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Rectangle value to a byte slice. +func (v Rectangle) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// RectangleListBytes writes a list of Rectangle values to a byte slice. +func RectangleListBytes(buf []byte, list []Rectangle) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// ReparentNotify is the event number for a ReparentNotifyEvent. +const ReparentNotify = 21 + +type ReparentNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Event Window + Window Window + Parent Window + X int16 + Y int16 + OverrideRedirect bool + // padding: 3 bytes +} + +// ReparentNotifyEventNew constructs a ReparentNotifyEvent value that implements xgb.Event from a byte slice. +func ReparentNotifyEventNew(buf []byte) xgb.Event { + v := ReparentNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Parent = Window(xgb.Get32(buf[b:])) + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + if buf[b] == 1 { + v.OverrideRedirect = true + } else { + v.OverrideRedirect = false + } + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a ReparentNotifyEvent value to a byte slice. +func (v ReparentNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 21 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Parent)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + if v.OverrideRedirect { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the ReparentNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ReparentNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of ReparentNotifyEvent. +func (v ReparentNotifyEvent) String() string { + fieldVals := make([]string, 0, 8) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Parent: %d", v.Parent)) + fieldVals = append(fieldVals, xgb.Sprintf("X: %d", v.X)) + fieldVals = append(fieldVals, xgb.Sprintf("Y: %d", v.Y)) + fieldVals = append(fieldVals, xgb.Sprintf("OverrideRedirect: %t", v.OverrideRedirect)) + return "ReparentNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[21] = ReparentNotifyEventNew +} + +// BadRequest is the error number for a BadRequest. +const BadRequest = 1 + +type RequestError struct { + Sequence uint16 + NiceName string + BadValue uint32 + MinorOpcode uint16 + MajorOpcode byte + // padding: 1 bytes +} + +// RequestErrorNew constructs a RequestError value that implements xgb.Error from a byte slice. +func RequestErrorNew(buf []byte) xgb.Error { + v := RequestError{} + v.NiceName = "Request" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.BadValue = xgb.Get32(buf[b:]) + b += 4 + + v.MinorOpcode = xgb.Get16(buf[b:]) + b += 2 + + v.MajorOpcode = buf[b] + b += 1 + + b += 1 // padding + + return v +} + +// SequenceId returns the sequence id attached to the BadRequest error. +// This is mostly used internally. +func (err RequestError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadRequest error. If no bad value exists, 0 is returned. +func (err RequestError) BadId() uint32 { + return err.BadValue +} + +// Error returns a rudimentary string representation of the BadRequest error. + +func (err RequestError) Error() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) + fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) + fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) + return "BadRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewErrorFuncs[1] = RequestErrorNew +} + +// ResizeRequest is the event number for a ResizeRequestEvent. +const ResizeRequest = 25 + +type ResizeRequestEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Window + Width uint16 + Height uint16 +} + +// ResizeRequestEventNew constructs a ResizeRequestEvent value that implements xgb.Event from a byte slice. +func ResizeRequestEventNew(buf []byte) xgb.Event { + v := ResizeRequestEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Bytes writes a ResizeRequestEvent value to a byte slice. +func (v ResizeRequestEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 25 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + return buf +} + +// SequenceId returns the sequence id attached to the ResizeRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v ResizeRequestEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of ResizeRequestEvent. +func (v ResizeRequestEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("Width: %d", v.Width)) + fieldVals = append(fieldVals, xgb.Sprintf("Height: %d", v.Height)) + return "ResizeRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[25] = ResizeRequestEventNew +} + +type Rgb struct { + Red uint16 + Green uint16 + Blue uint16 + // padding: 2 bytes +} + +// RgbRead reads a byte slice into a Rgb value. +func RgbRead(buf []byte, v *Rgb) int { + b := 0 + + v.Red = xgb.Get16(buf[b:]) + b += 2 + + v.Green = xgb.Get16(buf[b:]) + b += 2 + + v.Blue = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return b +} + +// RgbReadList reads a byte slice into a list of Rgb values. +func RgbReadList(buf []byte, dest []Rgb) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rgb{} + b += RgbRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Rgb value to a byte slice. +func (v Rgb) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], v.Red) + b += 2 + + xgb.Put16(buf[b:], v.Green) + b += 2 + + xgb.Put16(buf[b:], v.Blue) + b += 2 + + b += 2 // padding + + return buf +} + +// RgbListBytes writes a list of Rgb values to a byte slice. +func RgbListBytes(buf []byte, list []Rgb) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type ScreenInfo struct { + Root Window + DefaultColormap Colormap + WhitePixel uint32 + BlackPixel uint32 + CurrentInputMasks uint32 + WidthInPixels uint16 + HeightInPixels uint16 + WidthInMillimeters uint16 + HeightInMillimeters uint16 + MinInstalledMaps uint16 + MaxInstalledMaps uint16 + RootVisual Visualid + BackingStores byte + SaveUnders bool + RootDepth byte + AllowedDepthsLen byte + AllowedDepths []DepthInfo // size: DepthInfoListSize(AllowedDepths) +} + +// ScreenInfoRead reads a byte slice into a ScreenInfo value. +func ScreenInfoRead(buf []byte, v *ScreenInfo) int { + b := 0 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.DefaultColormap = Colormap(xgb.Get32(buf[b:])) + b += 4 + + v.WhitePixel = xgb.Get32(buf[b:]) + b += 4 + + v.BlackPixel = xgb.Get32(buf[b:]) + b += 4 + + v.CurrentInputMasks = xgb.Get32(buf[b:]) + b += 4 + + v.WidthInPixels = xgb.Get16(buf[b:]) + b += 2 + + v.HeightInPixels = xgb.Get16(buf[b:]) + b += 2 + + v.WidthInMillimeters = xgb.Get16(buf[b:]) + b += 2 + + v.HeightInMillimeters = xgb.Get16(buf[b:]) + b += 2 + + v.MinInstalledMaps = xgb.Get16(buf[b:]) + b += 2 + + v.MaxInstalledMaps = xgb.Get16(buf[b:]) + b += 2 + + v.RootVisual = Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.BackingStores = buf[b] + b += 1 + + if buf[b] == 1 { + v.SaveUnders = true + } else { + v.SaveUnders = false + } + b += 1 + + v.RootDepth = buf[b] + b += 1 + + v.AllowedDepthsLen = buf[b] + b += 1 + + v.AllowedDepths = make([]DepthInfo, v.AllowedDepthsLen) + b += DepthInfoReadList(buf[b:], v.AllowedDepths) + + return b +} + +// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values. +func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ScreenInfo{} + b += ScreenInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ScreenInfo value to a byte slice. +func (v ScreenInfo) Bytes() []byte { + buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Root)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.DefaultColormap)) + b += 4 + + xgb.Put32(buf[b:], v.WhitePixel) + b += 4 + + xgb.Put32(buf[b:], v.BlackPixel) + b += 4 + + xgb.Put32(buf[b:], v.CurrentInputMasks) + b += 4 + + xgb.Put16(buf[b:], v.WidthInPixels) + b += 2 + + xgb.Put16(buf[b:], v.HeightInPixels) + b += 2 + + xgb.Put16(buf[b:], v.WidthInMillimeters) + b += 2 + + xgb.Put16(buf[b:], v.HeightInMillimeters) + b += 2 + + xgb.Put16(buf[b:], v.MinInstalledMaps) + b += 2 + + xgb.Put16(buf[b:], v.MaxInstalledMaps) + b += 2 + + xgb.Put32(buf[b:], uint32(v.RootVisual)) + b += 4 + + buf[b] = v.BackingStores + b += 1 + + if v.SaveUnders { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + buf[b] = v.RootDepth + b += 1 + + buf[b] = v.AllowedDepthsLen + b += 1 + + b += DepthInfoListBytes(buf[b:], v.AllowedDepths) + + return buf +} + +// ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. +func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// ScreenInfoListSize computes the size (bytes) of a list of ScreenInfo values. +func ScreenInfoListSize(list []ScreenInfo) int { + size := 0 + for _, item := range list { + size += (40 + DepthInfoListSize(item.AllowedDepths)) + } + return size +} + +const ( + ScreenSaverReset = 0 + ScreenSaverActive = 1 +) + +type Segment struct { + X1 int16 + Y1 int16 + X2 int16 + Y2 int16 +} + +// SegmentRead reads a byte slice into a Segment value. +func SegmentRead(buf []byte, v *Segment) int { + b := 0 + + v.X1 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y1 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.X2 = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y2 = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// SegmentReadList reads a byte slice into a list of Segment values. +func SegmentReadList(buf []byte, dest []Segment) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Segment{} + b += SegmentRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Segment value to a byte slice. +func (v Segment) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put16(buf[b:], uint16(v.X1)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y1)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.X2)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y2)) + b += 2 + + return buf +} + +// SegmentListBytes writes a list of Segment values to a byte slice. +func SegmentListBytes(buf []byte, list []Segment) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + // SelectionClear is the event number for a SelectionClearEvent. const SelectionClear = 29 @@ -5040,6 +5126,101 @@ func init() { xgb.NewEventFuncs[29] = SelectionClearEventNew } +// SelectionNotify is the event number for a SelectionNotifyEvent. +const SelectionNotify = 31 + +type SelectionNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Time Timestamp + Requestor Window + Selection Atom + Target Atom + Property Atom +} + +// SelectionNotifyEventNew constructs a SelectionNotifyEvent value that implements xgb.Event from a byte slice. +func SelectionNotifyEventNew(buf []byte) xgb.Event { + v := SelectionNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Requestor = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Selection = Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Target = Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Property = Atom(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Bytes writes a SelectionNotifyEvent value to a byte slice. +func (v SelectionNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 31 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Requestor)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Selection)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Target)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Property)) + b += 4 + + return buf +} + +// SequenceId returns the sequence id attached to the SelectionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v SelectionNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of SelectionNotifyEvent. +func (v SelectionNotifyEvent) String() string { + fieldVals := make([]string, 0, 6) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Requestor: %d", v.Requestor)) + fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) + fieldVals = append(fieldVals, xgb.Sprintf("Target: %d", v.Target)) + fieldVals = append(fieldVals, xgb.Sprintf("Property: %d", v.Property)) + return "SelectionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[31] = SelectionNotifyEventNew +} + // SelectionRequest is the event number for a SelectionRequestEvent. const SelectionRequest = 30 @@ -5143,117 +5324,676 @@ func init() { xgb.NewEventFuncs[30] = SelectionRequestEventNew } -// SelectionNotify is the event number for a SelectionNotifyEvent. -const SelectionNotify = 31 +const ( + SendEventDestPointerWindow = 0 + SendEventDestItemFocus = 1 +) -type SelectionNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Time Timestamp - Requestor Window - Selection Atom - Target Atom - Property Atom +const ( + SetModeInsert = 0 + SetModeDelete = 1 +) + +type SetupAuthenticate struct { + Status byte + // padding: 5 bytes + Length uint16 + Reason string // size: xgb.Pad(((int(Length) * 4) * 1)) } -// SelectionNotifyEventNew constructs a SelectionNotifyEvent value that implements xgb.Event from a byte slice. -func SelectionNotifyEventNew(buf []byte) xgb.Event { - v := SelectionNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Requestor = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Selection = Atom(xgb.Get32(buf[b:])) - b += 4 - - v.Target = Atom(xgb.Get32(buf[b:])) - b += 4 - - v.Property = Atom(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Bytes writes a SelectionNotifyEvent value to a byte slice. -func (v SelectionNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) +// SetupAuthenticateRead reads a byte slice into a SetupAuthenticate value. +func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { b := 0 - // write event number - buf[b] = 31 + v.Status = buf[b] b += 1 - b += 1 // padding + b += 5 // padding - b += 2 // skip sequence number + v.Length = xgb.Get16(buf[b:]) + b += 2 - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 + { + byteString := make([]byte, (int(v.Length) * 4)) + copy(byteString[:(int(v.Length)*4)], buf[b:]) + v.Reason = string(byteString) + b += xgb.Pad(int((int(v.Length) * 4))) + } - xgb.Put32(buf[b:], uint32(v.Requestor)) - b += 4 + return b +} - xgb.Put32(buf[b:], uint32(v.Selection)) - b += 4 +// SetupAuthenticateReadList reads a byte slice into a list of SetupAuthenticate values. +func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupAuthenticate{} + b += SetupAuthenticateRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} - xgb.Put32(buf[b:], uint32(v.Target)) - b += 4 +// Bytes writes a SetupAuthenticate value to a byte slice. +func (v SetupAuthenticate) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad(((int(v.Length) * 4) * 1)))) + b := 0 - xgb.Put32(buf[b:], uint32(v.Property)) - b += 4 + buf[b] = v.Status + b += 1 + + b += 5 // padding + + xgb.Put16(buf[b:], v.Length) + b += 2 + + copy(buf[b:], v.Reason[:(int(v.Length)*4)]) + b += xgb.Pad(int((int(v.Length) * 4))) return buf } -// SequenceId returns the sequence id attached to the SelectionNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v SelectionNotifyEvent) SequenceId() uint16 { - return v.Sequence +// SetupAuthenticateListBytes writes a list of SetupAuthenticate values to a byte slice. +func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b } -// String is a rudimentary string representation of SelectionNotifyEvent. -func (v SelectionNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Requestor: %d", v.Requestor)) - fieldVals = append(fieldVals, xgb.Sprintf("Selection: %d", v.Selection)) - fieldVals = append(fieldVals, xgb.Sprintf("Target: %d", v.Target)) - fieldVals = append(fieldVals, xgb.Sprintf("Property: %d", v.Property)) - return "SelectionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// SetupAuthenticateListSize computes the size (bytes) of a list of SetupAuthenticate values. +func SetupAuthenticateListSize(list []SetupAuthenticate) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad(((int(item.Length) * 4) * 1))) + } + return size } -func init() { - xgb.NewEventFuncs[31] = SelectionNotifyEventNew +type SetupFailed struct { + Status byte + ReasonLen byte + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + Length uint16 + Reason string // size: xgb.Pad((int(ReasonLen) * 1)) } -// ColormapNotify is the event number for a ColormapNotifyEvent. -const ColormapNotify = 32 +// SetupFailedRead reads a byte slice into a SetupFailed value. +func SetupFailedRead(buf []byte, v *SetupFailed) int { + b := 0 -type ColormapNotifyEvent struct { + v.Status = buf[b] + b += 1 + + v.ReasonLen = buf[b] + b += 1 + + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get16(buf[b:]) + b += 2 + + { + byteString := make([]byte, v.ReasonLen) + copy(byteString[:v.ReasonLen], buf[b:]) + v.Reason = string(byteString) + b += xgb.Pad(int(v.ReasonLen)) + } + + return b +} + +// SetupFailedReadList reads a byte slice into a list of SetupFailed values. +func SetupFailedReadList(buf []byte, dest []SetupFailed) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupFailed{} + b += SetupFailedRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a SetupFailed value to a byte slice. +func (v SetupFailed) Bytes() []byte { + buf := make([]byte, (8 + xgb.Pad((int(v.ReasonLen) * 1)))) + b := 0 + + buf[b] = v.Status + b += 1 + + buf[b] = v.ReasonLen + b += 1 + + xgb.Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + xgb.Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + xgb.Put16(buf[b:], v.Length) + b += 2 + + copy(buf[b:], v.Reason[:v.ReasonLen]) + b += xgb.Pad(int(v.ReasonLen)) + + return buf +} + +// SetupFailedListBytes writes a list of SetupFailed values to a byte slice. +func SetupFailedListBytes(buf []byte, list []SetupFailed) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// SetupFailedListSize computes the size (bytes) of a list of SetupFailed values. +func SetupFailedListSize(list []SetupFailed) int { + size := 0 + for _, item := range list { + size += (8 + xgb.Pad((int(item.ReasonLen) * 1))) + } + return size +} + +type SetupInfo struct { + Status byte + // padding: 1 bytes + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + Length uint16 + ReleaseNumber uint32 + ResourceIdBase uint32 + ResourceIdMask uint32 + MotionBufferSize uint32 + VendorLen uint16 + MaximumRequestLength uint16 + RootsLen byte + PixmapFormatsLen byte + ImageByteOrder byte + BitmapFormatBitOrder byte + BitmapFormatScanlineUnit byte + BitmapFormatScanlinePad byte + MinKeycode Keycode + MaxKeycode Keycode + // padding: 4 bytes + Vendor string // size: xgb.Pad((int(VendorLen) * 1)) + PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) + Roots []ScreenInfo // size: ScreenInfoListSize(Roots) +} + +// SetupInfoRead reads a byte slice into a SetupInfo value. +func SetupInfoRead(buf []byte, v *SetupInfo) int { + b := 0 + + v.Status = buf[b] + b += 1 + + b += 1 // padding + + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get16(buf[b:]) + b += 2 + + v.ReleaseNumber = xgb.Get32(buf[b:]) + b += 4 + + v.ResourceIdBase = xgb.Get32(buf[b:]) + b += 4 + + v.ResourceIdMask = xgb.Get32(buf[b:]) + b += 4 + + v.MotionBufferSize = xgb.Get32(buf[b:]) + b += 4 + + v.VendorLen = xgb.Get16(buf[b:]) + b += 2 + + v.MaximumRequestLength = xgb.Get16(buf[b:]) + b += 2 + + v.RootsLen = buf[b] + b += 1 + + v.PixmapFormatsLen = buf[b] + b += 1 + + v.ImageByteOrder = buf[b] + b += 1 + + v.BitmapFormatBitOrder = buf[b] + b += 1 + + v.BitmapFormatScanlineUnit = buf[b] + b += 1 + + v.BitmapFormatScanlinePad = buf[b] + b += 1 + + v.MinKeycode = Keycode(buf[b]) + b += 1 + + v.MaxKeycode = Keycode(buf[b]) + b += 1 + + b += 4 // padding + + { + byteString := make([]byte, v.VendorLen) + copy(byteString[:v.VendorLen], buf[b:]) + v.Vendor = string(byteString) + b += xgb.Pad(int(v.VendorLen)) + } + + v.PixmapFormats = make([]Format, v.PixmapFormatsLen) + b += FormatReadList(buf[b:], v.PixmapFormats) + + v.Roots = make([]ScreenInfo, v.RootsLen) + b += ScreenInfoReadList(buf[b:], v.Roots) + + return b +} + +// SetupInfoReadList reads a byte slice into a list of SetupInfo values. +func SetupInfoReadList(buf []byte, dest []SetupInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupInfo{} + b += SetupInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a SetupInfo value to a byte slice. +func (v SetupInfo) Bytes() []byte { + buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) + b := 0 + + buf[b] = v.Status + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + xgb.Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + xgb.Put16(buf[b:], v.Length) + b += 2 + + xgb.Put32(buf[b:], v.ReleaseNumber) + b += 4 + + xgb.Put32(buf[b:], v.ResourceIdBase) + b += 4 + + xgb.Put32(buf[b:], v.ResourceIdMask) + b += 4 + + xgb.Put32(buf[b:], v.MotionBufferSize) + b += 4 + + xgb.Put16(buf[b:], v.VendorLen) + b += 2 + + xgb.Put16(buf[b:], v.MaximumRequestLength) + b += 2 + + buf[b] = v.RootsLen + b += 1 + + buf[b] = v.PixmapFormatsLen + b += 1 + + buf[b] = v.ImageByteOrder + b += 1 + + buf[b] = v.BitmapFormatBitOrder + b += 1 + + buf[b] = v.BitmapFormatScanlineUnit + b += 1 + + buf[b] = v.BitmapFormatScanlinePad + b += 1 + + buf[b] = byte(v.MinKeycode) + b += 1 + + buf[b] = byte(v.MaxKeycode) + b += 1 + + b += 4 // padding + + copy(buf[b:], v.Vendor[:v.VendorLen]) + b += xgb.Pad(int(v.VendorLen)) + + b += FormatListBytes(buf[b:], v.PixmapFormats) + + b += ScreenInfoListBytes(buf[b:], v.Roots) + + return buf +} + +// SetupInfoListBytes writes a list of SetupInfo values to a byte slice. +func SetupInfoListBytes(buf []byte, list []SetupInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// SetupInfoListSize computes the size (bytes) of a list of SetupInfo values. +func SetupInfoListSize(list []SetupInfo) int { + size := 0 + for _, item := range list { + size += (((40 + xgb.Pad((int(item.VendorLen) * 1))) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) + } + return size +} + +type SetupRequest struct { + ByteOrder byte + // padding: 1 bytes + ProtocolMajorVersion uint16 + ProtocolMinorVersion uint16 + AuthorizationProtocolNameLen uint16 + AuthorizationProtocolDataLen uint16 + // padding: 2 bytes + AuthorizationProtocolName string // size: xgb.Pad((int(AuthorizationProtocolNameLen) * 1)) + AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) +} + +// SetupRequestRead reads a byte slice into a SetupRequest value. +func SetupRequestRead(buf []byte, v *SetupRequest) int { + b := 0 + + v.ByteOrder = buf[b] + b += 1 + + b += 1 // padding + + v.ProtocolMajorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.ProtocolMinorVersion = xgb.Get16(buf[b:]) + b += 2 + + v.AuthorizationProtocolNameLen = xgb.Get16(buf[b:]) + b += 2 + + v.AuthorizationProtocolDataLen = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + { + byteString := make([]byte, v.AuthorizationProtocolNameLen) + copy(byteString[:v.AuthorizationProtocolNameLen], buf[b:]) + v.AuthorizationProtocolName = string(byteString) + b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) + } + + { + byteString := make([]byte, v.AuthorizationProtocolDataLen) + copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) + v.AuthorizationProtocolData = string(byteString) + b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) + } + + return b +} + +// SetupRequestReadList reads a byte slice into a list of SetupRequest values. +func SetupRequestReadList(buf []byte, dest []SetupRequest) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = SetupRequest{} + b += SetupRequestRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a SetupRequest value to a byte slice. +func (v SetupRequest) Bytes() []byte { + buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) + b := 0 + + buf[b] = v.ByteOrder + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], v.ProtocolMajorVersion) + b += 2 + + xgb.Put16(buf[b:], v.ProtocolMinorVersion) + b += 2 + + xgb.Put16(buf[b:], v.AuthorizationProtocolNameLen) + b += 2 + + xgb.Put16(buf[b:], v.AuthorizationProtocolDataLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) + b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) + + copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) + b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) + + return buf +} + +// SetupRequestListBytes writes a list of SetupRequest values to a byte slice. +func SetupRequestListBytes(buf []byte, list []SetupRequest) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// SetupRequestListSize computes the size (bytes) of a list of SetupRequest values. +func SetupRequestListSize(list []SetupRequest) int { + size := 0 + for _, item := range list { + size += ((12 + xgb.Pad((int(item.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(item.AuthorizationProtocolDataLen) * 1))) + } + return size +} + +const ( + StackModeAbove = 0 + StackModeBelow = 1 + StackModeTopIf = 2 + StackModeBottomIf = 3 + StackModeOpposite = 4 +) + +type Str struct { + NameLen byte + Name string // size: xgb.Pad((int(NameLen) * 1)) +} + +// StrRead reads a byte slice into a Str value. +func StrRead(buf []byte, v *Str) int { + b := 0 + + v.NameLen = buf[b] + b += 1 + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameLen)) + } + + return b +} + +// StrReadList reads a byte slice into a list of Str values. +func StrReadList(buf []byte, dest []Str) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Str{} + b += StrRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Str value to a byte slice. +func (v Str) Bytes() []byte { + buf := make([]byte, (1 + xgb.Pad((int(v.NameLen) * 1)))) + b := 0 + + buf[b] = v.NameLen + b += 1 + + copy(buf[b:], v.Name[:v.NameLen]) + b += xgb.Pad(int(v.NameLen)) + + return buf +} + +// StrListBytes writes a list of Str values to a byte slice. +func StrListBytes(buf []byte, list []Str) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// StrListSize computes the size (bytes) of a list of Str values. +func StrListSize(list []Str) int { + size := 0 + for _, item := range list { + size += (1 + xgb.Pad((int(item.NameLen) * 1))) + } + return size +} + +const ( + SubwindowModeClipByChildren = 0 + SubwindowModeIncludeInferiors = 1 +) + +const ( + TimeCurrentTime = 0 +) + +type Timecoord struct { + Time Timestamp + X int16 + Y int16 +} + +// TimecoordRead reads a byte slice into a Timecoord value. +func TimecoordRead(buf []byte, v *Timecoord) int { + b := 0 + + v.Time = Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + return b +} + +// TimecoordReadList reads a byte slice into a list of Timecoord values. +func TimecoordReadList(buf []byte, dest []Timecoord) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Timecoord{} + b += TimecoordRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Timecoord value to a byte slice. +func (v Timecoord) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + return buf +} + +// TimecoordListBytes writes a list of Timecoord values to a byte slice. +func TimecoordListBytes(buf []byte, list []Timecoord) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Timestamp uint32 + +// UnmapNotify is the event number for a UnmapNotifyEvent. +const UnmapNotify = 18 + +type UnmapNotifyEvent struct { Sequence uint16 // padding: 1 bytes - Window Window - Colormap Colormap - New bool - State byte - // padding: 2 bytes + Event Window + Window Window + FromConfigure bool + // padding: 3 bytes } -// ColormapNotifyEventNew constructs a ColormapNotifyEvent value that implements xgb.Event from a byte slice. -func ColormapNotifyEventNew(buf []byte) xgb.Event { - v := ColormapNotifyEvent{} +// UnmapNotifyEventNew constructs a UnmapNotifyEvent value that implements xgb.Event from a byte slice. +func UnmapNotifyEventNew(buf []byte) xgb.Event { + v := UnmapNotifyEvent{} b := 1 // don't read event number b += 1 // padding @@ -5261,513 +6001,74 @@ func ColormapNotifyEventNew(buf []byte) xgb.Event { v.Sequence = xgb.Get16(buf[b:]) b += 2 + v.Event = Window(xgb.Get32(buf[b:])) + b += 4 + v.Window = Window(xgb.Get32(buf[b:])) b += 4 - v.Colormap = Colormap(xgb.Get32(buf[b:])) - b += 4 - if buf[b] == 1 { - v.New = true + v.FromConfigure = true } else { - v.New = false + v.FromConfigure = false } b += 1 - v.State = buf[b] - b += 1 - - b += 2 // padding + b += 3 // padding return v } -// Bytes writes a ColormapNotifyEvent value to a byte slice. -func (v ColormapNotifyEvent) Bytes() []byte { +// Bytes writes a UnmapNotifyEvent value to a byte slice. +func (v UnmapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 // write event number - buf[b] = 32 + buf[b] = 18 b += 1 b += 1 // padding b += 2 // skip sequence number + xgb.Put32(buf[b:], uint32(v.Event)) + b += 4 + xgb.Put32(buf[b:], uint32(v.Window)) b += 4 - xgb.Put32(buf[b:], uint32(v.Colormap)) - b += 4 - - if v.New { + if v.FromConfigure { buf[b] = 1 } else { buf[b] = 0 } b += 1 - buf[b] = v.State - b += 1 - - b += 2 // padding + b += 3 // padding return buf } -// SequenceId returns the sequence id attached to the ColormapNotify event. +// SequenceId returns the sequence id attached to the UnmapNotify event. // Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (v ColormapNotifyEvent) SequenceId() uint16 { +func (v UnmapNotifyEvent) SequenceId() uint16 { return v.Sequence } -// String is a rudimentary string representation of ColormapNotifyEvent. -func (v ColormapNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Colormap: %d", v.Colormap)) - fieldVals = append(fieldVals, xgb.Sprintf("New: %t", v.New)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - return "ColormapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[32] = ColormapNotifyEventNew -} - -// ClientMessage is the event number for a ClientMessageEvent. -const ClientMessage = 33 - -type ClientMessageEvent struct { - Sequence uint16 - Format byte - Window Window - Type Atom - Data ClientMessageDataUnion -} - -// ClientMessageEventNew constructs a ClientMessageEvent value that implements xgb.Event from a byte slice. -func ClientMessageEventNew(buf []byte) xgb.Event { - v := ClientMessageEvent{} - b := 1 // don't read event number - - v.Format = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Window = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Type = Atom(xgb.Get32(buf[b:])) - b += 4 - - v.Data = ClientMessageDataUnion{} - b += ClientMessageDataUnionRead(buf[b:], &v.Data) - - return v -} - -// Bytes writes a ClientMessageEvent value to a byte slice. -func (v ClientMessageEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 33 - b += 1 - - buf[b] = v.Format - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Type)) - b += 4 - - { - unionBytes := v.Data.Bytes() - copy(buf[b:], unionBytes) - b += xgb.Pad(len(unionBytes)) - } - - return buf -} - -// SequenceId returns the sequence id attached to the ClientMessage event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ClientMessageEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of ClientMessageEvent. -func (v ClientMessageEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Format: %d", v.Format)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Type: %d", v.Type)) - return "ClientMessage {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[33] = ClientMessageEventNew -} - -// MappingNotify is the event number for a MappingNotifyEvent. -const MappingNotify = 34 - -type MappingNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Request byte - FirstKeycode Keycode - Count byte - // padding: 1 bytes -} - -// MappingNotifyEventNew constructs a MappingNotifyEvent value that implements xgb.Event from a byte slice. -func MappingNotifyEventNew(buf []byte) xgb.Event { - v := MappingNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Request = buf[b] - b += 1 - - v.FirstKeycode = Keycode(buf[b]) - b += 1 - - v.Count = buf[b] - b += 1 - - b += 1 // padding - - return v -} - -// Bytes writes a MappingNotifyEvent value to a byte slice. -func (v MappingNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 34 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - buf[b] = v.Request - b += 1 - - buf[b] = byte(v.FirstKeycode) - b += 1 - - buf[b] = v.Count - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the MappingNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v MappingNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of MappingNotifyEvent. -func (v MappingNotifyEvent) String() string { +// String is a rudimentary string representation of UnmapNotifyEvent. +func (v UnmapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) - fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - return "MappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[34] = MappingNotifyEventNew -} - -// KeyRelease is the event number for a KeyReleaseEvent. -const KeyRelease = 3 - -type KeyReleaseEvent KeyPressEvent - -// KeyReleaseEventNew constructs a KeyReleaseEvent value that implements xgb.Event from a byte slice. -func KeyReleaseEventNew(buf []byte) xgb.Event { - return KeyReleaseEvent(KeyPressEventNew(buf).(KeyPressEvent)) -} - -// Bytes writes a KeyReleaseEvent value to a byte slice. -func (v KeyReleaseEvent) Bytes() []byte { - return KeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the KeyRelease event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v KeyReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v KeyReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - return "KeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[3] = KeyReleaseEventNew -} - -// ButtonRelease is the event number for a ButtonReleaseEvent. -const ButtonRelease = 5 - -type ButtonReleaseEvent ButtonPressEvent - -// ButtonReleaseEventNew constructs a ButtonReleaseEvent value that implements xgb.Event from a byte slice. -func ButtonReleaseEventNew(buf []byte) xgb.Event { - return ButtonReleaseEvent(ButtonPressEventNew(buf).(ButtonPressEvent)) -} - -// Bytes writes a ButtonReleaseEvent value to a byte slice. -func (v ButtonReleaseEvent) Bytes() []byte { - return ButtonPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the ButtonRelease event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ButtonReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ButtonReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - return "ButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[5] = ButtonReleaseEventNew -} - -// LeaveNotify is the event number for a LeaveNotifyEvent. -const LeaveNotify = 8 - -type LeaveNotifyEvent EnterNotifyEvent - -// LeaveNotifyEventNew constructs a LeaveNotifyEvent value that implements xgb.Event from a byte slice. -func LeaveNotifyEventNew(buf []byte) xgb.Event { - return LeaveNotifyEvent(EnterNotifyEventNew(buf).(EnterNotifyEvent)) -} - -// Bytes writes a LeaveNotifyEvent value to a byte slice. -func (v LeaveNotifyEvent) Bytes() []byte { - return EnterNotifyEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the LeaveNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v LeaveNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v LeaveNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreenFocus: %d", v.SameScreenFocus)) - return "LeaveNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[8] = LeaveNotifyEventNew -} - -// FocusOut is the event number for a FocusOutEvent. -const FocusOut = 10 - -type FocusOutEvent FocusInEvent - -// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. -func FocusOutEventNew(buf []byte) xgb.Event { - return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) -} - -// Bytes writes a FocusOutEvent value to a byte slice. -func (v FocusOutEvent) Bytes() []byte { - return FocusInEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the FocusOut event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v FocusOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v FocusOutEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewEventFuncs[10] = FocusOutEventNew -} - -// CirculateRequest is the event number for a CirculateRequestEvent. -const CirculateRequest = 27 - -type CirculateRequestEvent CirculateNotifyEvent - -// CirculateRequestEventNew constructs a CirculateRequestEvent value that implements xgb.Event from a byte slice. -func CirculateRequestEventNew(buf []byte) xgb.Event { - return CirculateRequestEvent(CirculateNotifyEventNew(buf).(CirculateNotifyEvent)) -} - -// Bytes writes a CirculateRequestEvent value to a byte slice. -func (v CirculateRequestEvent) Bytes() []byte { - return CirculateNotifyEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the CirculateRequest event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v CirculateRequestEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v CirculateRequestEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Place: %d", v.Place)) - return "CirculateRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" + fieldVals = append(fieldVals, xgb.Sprintf("FromConfigure: %t", v.FromConfigure)) + return "UnmapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewEventFuncs[27] = CirculateRequestEventNew -} - -// BadRequest is the error number for a BadRequest. -const BadRequest = 1 - -type RequestError struct { - Sequence uint16 - NiceName string - BadValue uint32 - MinorOpcode uint16 - MajorOpcode byte - // padding: 1 bytes -} - -// RequestErrorNew constructs a RequestError value that implements xgb.Error from a byte slice. -func RequestErrorNew(buf []byte) xgb.Error { - v := RequestError{} - v.NiceName = "Request" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadValue = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - b += 1 // padding - - return v -} - -// SequenceId returns the sequence id attached to the BadRequest error. -// This is mostly used internally. -func (err RequestError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadRequest error. If no bad value exists, 0 is returned. -func (err RequestError) BadId() uint32 { - return err.BadValue -} - -// Error returns a rudimentary string representation of the BadRequest error. - -func (err RequestError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadRequest {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewErrorFuncs[1] = RequestErrorNew + xgb.NewEventFuncs[18] = UnmapNotifyEventNew } // BadValue is the error number for a BadValue. @@ -5834,6 +6135,207 @@ func init() { xgb.NewErrorFuncs[2] = ValueErrorNew } +const ( + VisibilityUnobscured = 0 + VisibilityPartiallyObscured = 1 + VisibilityFullyObscured = 2 +) + +// VisibilityNotify is the event number for a VisibilityNotifyEvent. +const VisibilityNotify = 15 + +type VisibilityNotifyEvent struct { + Sequence uint16 + // padding: 1 bytes + Window Window + State byte + // padding: 3 bytes +} + +// VisibilityNotifyEventNew constructs a VisibilityNotifyEvent value that implements xgb.Event from a byte slice. +func VisibilityNotifyEventNew(buf []byte) xgb.Event { + v := VisibilityNotifyEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Window = Window(xgb.Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 3 // padding + + return v +} + +// Bytes writes a VisibilityNotifyEvent value to a byte slice. +func (v VisibilityNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 15 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 3 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the VisibilityNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v VisibilityNotifyEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of VisibilityNotifyEvent. +func (v VisibilityNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) + fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) + return "VisibilityNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[15] = VisibilityNotifyEventNew +} + +const ( + VisualClassStaticGray = 0 + VisualClassGrayScale = 1 + VisualClassStaticColor = 2 + VisualClassPseudoColor = 3 + VisualClassTrueColor = 4 + VisualClassDirectColor = 5 +) + +type VisualInfo struct { + VisualId Visualid + Class byte + BitsPerRgbValue byte + ColormapEntries uint16 + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + // padding: 4 bytes +} + +// VisualInfoRead reads a byte slice into a VisualInfo value. +func VisualInfoRead(buf []byte, v *VisualInfo) int { + b := 0 + + v.VisualId = Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Class = buf[b] + b += 1 + + v.BitsPerRgbValue = buf[b] + b += 1 + + v.ColormapEntries = xgb.Get16(buf[b:]) + b += 2 + + v.RedMask = xgb.Get32(buf[b:]) + b += 4 + + v.GreenMask = xgb.Get32(buf[b:]) + b += 4 + + v.BlueMask = xgb.Get32(buf[b:]) + b += 4 + + b += 4 // padding + + return b +} + +// VisualInfoReadList reads a byte slice into a list of VisualInfo values. +func VisualInfoReadList(buf []byte, dest []VisualInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = VisualInfo{} + b += VisualInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a VisualInfo value to a byte slice. +func (v VisualInfo) Bytes() []byte { + buf := make([]byte, 24) + b := 0 + + xgb.Put32(buf[b:], uint32(v.VisualId)) + b += 4 + + buf[b] = v.Class + b += 1 + + buf[b] = v.BitsPerRgbValue + b += 1 + + xgb.Put16(buf[b:], v.ColormapEntries) + b += 2 + + xgb.Put32(buf[b:], v.RedMask) + b += 4 + + xgb.Put32(buf[b:], v.GreenMask) + b += 4 + + xgb.Put32(buf[b:], v.BlueMask) + b += 4 + + b += 4 // padding + + return buf +} + +// VisualInfoListBytes writes a list of VisualInfo values to a byte slice. +func VisualInfoListBytes(buf []byte, list []VisualInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +type Visualid uint32 + +type Window uint32 + +func NewWindowId(c *xgb.Conn) (Window, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Window(id), nil +} + +const ( + WindowNone = 0 +) + // BadWindow is the error number for a BadWindow. const BadWindow = 3 @@ -5872,536 +6374,1970 @@ func init() { xgb.NewErrorFuncs[3] = WindowErrorNew } -// BadPixmap is the error number for a BadPixmap. -const BadPixmap = 4 +const ( + WindowClassCopyFromParent = 0 + WindowClassInputOutput = 1 + WindowClassInputOnly = 2 +) -type PixmapError ValueError +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// AllocColorCookie is a cookie used only for AllocColor requests. +type AllocColorCookie struct { + *xgb.Cookie +} + +// AllocColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCookie.Reply() +func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) + return AllocColorCookie{cookie} +} + +// AllocColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) + return AllocColorCookie{cookie} +} + +// AllocColorReply represents the data returned from a AllocColor request. +type AllocColorReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Red uint16 + Green uint16 + Blue uint16 + // padding: 2 bytes + Pixel uint32 +} + +// Reply blocks and returns the reply data for a AllocColor request. +func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return allocColorReply(buf), nil +} + +// allocColorReply reads a byte slice into a AllocColorReply value. +func allocColorReply(buf []byte) *AllocColorReply { + v := new(AllocColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Red = xgb.Get16(buf[b:]) + b += 2 + + v.Green = xgb.Get16(buf[b:]) + b += 2 + + v.Blue = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Pixel = xgb.Get32(buf[b:]) + b += 4 -// PixmapErrorNew constructs a PixmapError value that implements xgb.Error from a byte slice. -func PixmapErrorNew(buf []byte) xgb.Error { - v := PixmapError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Pixmap" return v } -// SequenceId returns the sequence id attached to the BadPixmap error. -// This is mostly used internally. -func (err PixmapError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for AllocColor +// allocColorRequest writes a AllocColor request to a byte slice. +func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 84 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + xgb.Put16(buf[b:], Red) + b += 2 + + xgb.Put16(buf[b:], Green) + b += 2 + + xgb.Put16(buf[b:], Blue) + b += 2 + + b += 2 // padding + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadPixmap error. If no bad value exists, 0 is returned. -func (err PixmapError) BadId() uint32 { - return err.BadValue +// AllocColorCellsCookie is a cookie used only for AllocColorCells requests. +type AllocColorCellsCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadPixmap error. -func (err PixmapError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadPixmap {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// AllocColorCells sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCellsCookie.Reply() +func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie{cookie} } -func init() { - xgb.NewErrorFuncs[4] = PixmapErrorNew +// AllocColorCellsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) + return AllocColorCellsCookie{cookie} } -// BadAtom is the error number for a BadAtom. -const BadAtom = 5 +// AllocColorCellsReply represents the data returned from a AllocColorCells request. +type AllocColorCellsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + PixelsLen uint16 + MasksLen uint16 + // padding: 20 bytes + Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) + Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) +} -type AtomError ValueError +// Reply blocks and returns the reply data for a AllocColorCells request. +func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return allocColorCellsReply(buf), nil +} + +// allocColorCellsReply reads a byte slice into a AllocColorCellsReply value. +func allocColorCellsReply(buf []byte) *AllocColorCellsReply { + v := new(AllocColorCellsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PixelsLen = xgb.Get16(buf[b:]) + b += 2 + + v.MasksLen = xgb.Get16(buf[b:]) + b += 2 + + b += 20 // padding + + v.Pixels = make([]uint32, v.PixelsLen) + for i := 0; i < int(v.PixelsLen); i++ { + v.Pixels[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + v.Masks = make([]uint32, v.MasksLen) + for i := 0; i < int(v.MasksLen); i++ { + v.Masks[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) -// AtomErrorNew constructs a AtomError value that implements xgb.Error from a byte slice. -func AtomErrorNew(buf []byte) xgb.Error { - v := AtomError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Atom" return v } -// SequenceId returns the sequence id attached to the BadAtom error. -// This is mostly used internally. -func (err AtomError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for AllocColorCells +// allocColorCellsRequest writes a AllocColorCells request to a byte slice. +func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 86 // request opcode + b += 1 + + if Contiguous { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + xgb.Put16(buf[b:], Colors) + b += 2 + + xgb.Put16(buf[b:], Planes) + b += 2 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadAtom error. If no bad value exists, 0 is returned. -func (err AtomError) BadId() uint32 { - return err.BadValue +// AllocColorPlanesCookie is a cookie used only for AllocColorPlanes requests. +type AllocColorPlanesCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadAtom error. -func (err AtomError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAtom {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// AllocColorPlanes sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorPlanesCookie.Reply() +func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie{cookie} } -func init() { - xgb.NewErrorFuncs[5] = AtomErrorNew +// AllocColorPlanesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) + return AllocColorPlanesCookie{cookie} } -// BadCursor is the error number for a BadCursor. -const BadCursor = 6 +// AllocColorPlanesReply represents the data returned from a AllocColorPlanes request. +type AllocColorPlanesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + PixelsLen uint16 + // padding: 2 bytes + RedMask uint32 + GreenMask uint32 + BlueMask uint32 + // padding: 8 bytes + Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) +} -type CursorError ValueError +// Reply blocks and returns the reply data for a AllocColorPlanes request. +func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return allocColorPlanesReply(buf), nil +} + +// allocColorPlanesReply reads a byte slice into a AllocColorPlanesReply value. +func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { + v := new(AllocColorPlanesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PixelsLen = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.RedMask = xgb.Get32(buf[b:]) + b += 4 + + v.GreenMask = xgb.Get32(buf[b:]) + b += 4 + + v.BlueMask = xgb.Get32(buf[b:]) + b += 4 + + b += 8 // padding + + v.Pixels = make([]uint32, v.PixelsLen) + for i := 0; i < int(v.PixelsLen); i++ { + v.Pixels[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) -// CursorErrorNew constructs a CursorError value that implements xgb.Error from a byte slice. -func CursorErrorNew(buf []byte) xgb.Error { - v := CursorError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Cursor" return v } -// SequenceId returns the sequence id attached to the BadCursor error. -// This is mostly used internally. -func (err CursorError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for AllocColorPlanes +// allocColorPlanesRequest writes a AllocColorPlanes request to a byte slice. +func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 87 // request opcode + b += 1 + + if Contiguous { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + xgb.Put16(buf[b:], Colors) + b += 2 + + xgb.Put16(buf[b:], Reds) + b += 2 + + xgb.Put16(buf[b:], Greens) + b += 2 + + xgb.Put16(buf[b:], Blues) + b += 2 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadCursor error. If no bad value exists, 0 is returned. -func (err CursorError) BadId() uint32 { - return err.BadValue +// AllocNamedColorCookie is a cookie used only for AllocNamedColor requests. +type AllocNamedColorCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadCursor error. -func (err CursorError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadCursor {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// AllocNamedColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocNamedColorCookie.Reply() +func AllocNamedColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie{cookie} } -func init() { - xgb.NewErrorFuncs[6] = CursorErrorNew +// AllocNamedColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AllocNamedColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) + return AllocNamedColorCookie{cookie} } -// BadFont is the error number for a BadFont. -const BadFont = 7 +// AllocNamedColorReply represents the data returned from a AllocNamedColor request. +type AllocNamedColorReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Pixel uint32 + ExactRed uint16 + ExactGreen uint16 + ExactBlue uint16 + VisualRed uint16 + VisualGreen uint16 + VisualBlue uint16 +} -type FontError ValueError +// Reply blocks and returns the reply data for a AllocNamedColor request. +func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return allocNamedColorReply(buf), nil +} + +// allocNamedColorReply reads a byte slice into a AllocNamedColorReply value. +func allocNamedColorReply(buf []byte) *AllocNamedColorReply { + v := new(AllocNamedColorReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Pixel = xgb.Get32(buf[b:]) + b += 4 + + v.ExactRed = xgb.Get16(buf[b:]) + b += 2 + + v.ExactGreen = xgb.Get16(buf[b:]) + b += 2 + + v.ExactBlue = xgb.Get16(buf[b:]) + b += 2 + + v.VisualRed = xgb.Get16(buf[b:]) + b += 2 + + v.VisualGreen = xgb.Get16(buf[b:]) + b += 2 + + v.VisualBlue = xgb.Get16(buf[b:]) + b += 2 -// FontErrorNew constructs a FontError value that implements xgb.Error from a byte slice. -func FontErrorNew(buf []byte) xgb.Error { - v := FontError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Font" return v } -// SequenceId returns the sequence id attached to the BadFont error. -// This is mostly used internally. -func (err FontError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for AllocNamedColor +// allocNamedColorRequest writes a AllocNamedColor request to a byte slice. +func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 85 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + xgb.Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += xgb.Pad(int(NameLen)) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadFont error. If no bad value exists, 0 is returned. -func (err FontError) BadId() uint32 { - return err.BadValue +// AllowEventsCookie is a cookie used only for AllowEvents requests. +type AllowEventsCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadFont error. -func (err FontError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadFont {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// AllowEvents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) + return AllowEventsCookie{cookie} } -func init() { - xgb.NewErrorFuncs[7] = FontErrorNew +// AllowEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowEventsCookie.Check() +func AllowEventsChecked(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) + return AllowEventsCookie{cookie} } -// BadMatch is the error number for a BadMatch. -const BadMatch = 8 - -type MatchError RequestError - -// MatchErrorNew constructs a MatchError value that implements xgb.Error from a byte slice. -func MatchErrorNew(buf []byte) xgb.Error { - v := MatchError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Match" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AllowEventsCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadMatch error. -// This is mostly used internally. -func (err MatchError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for AllowEvents +// allowEventsRequest writes a AllowEvents request to a byte slice. +func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 35 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadMatch error. If no bad value exists, 0 is returned. -func (err MatchError) BadId() uint32 { - return err.BadValue +// BellCookie is a cookie used only for Bell requests. +type BellCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadMatch error. -func (err MatchError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadMatch {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// Bell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func Bell(c *xgb.Conn, Percent int8) BellCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(bellRequest(c, Percent), cookie) + return BellCookie{cookie} } -func init() { - xgb.NewErrorFuncs[8] = MatchErrorNew +// BellChecked sends a checked request. +// If an error occurs, it can be retrieved using BellCookie.Check() +func BellChecked(c *xgb.Conn, Percent int8) BellCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(bellRequest(c, Percent), cookie) + return BellCookie{cookie} } -// BadDrawable is the error number for a BadDrawable. -const BadDrawable = 9 - -type DrawableError ValueError - -// DrawableErrorNew constructs a DrawableError value that implements xgb.Error from a byte slice. -func DrawableErrorNew(buf []byte) xgb.Error { - v := DrawableError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Drawable" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook BellCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadDrawable error. -// This is mostly used internally. -func (err DrawableError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for Bell +// bellRequest writes a Bell request to a byte slice. +func bellRequest(c *xgb.Conn, Percent int8) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 104 // request opcode + b += 1 + + buf[b] = byte(Percent) + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadDrawable error. If no bad value exists, 0 is returned. -func (err DrawableError) BadId() uint32 { - return err.BadValue +// ChangeActivePointerGrabCookie is a cookie used only for ChangeActivePointerGrab requests. +type ChangeActivePointerGrabCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadDrawable error. -func (err DrawableError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadDrawable {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeActivePointerGrab sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie{cookie} } -func init() { - xgb.NewErrorFuncs[9] = DrawableErrorNew +// ChangeActivePointerGrabChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeActivePointerGrabCookie.Check() +func ChangeActivePointerGrabChecked(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) + return ChangeActivePointerGrabCookie{cookie} } -// BadAccess is the error number for a BadAccess. -const BadAccess = 10 - -type AccessError RequestError - -// AccessErrorNew constructs a AccessError value that implements xgb.Error from a byte slice. -func AccessErrorNew(buf []byte) xgb.Error { - v := AccessError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Access" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeActivePointerGrabCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadAccess error. -// This is mostly used internally. -func (err AccessError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeActivePointerGrab +// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice. +func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 30 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + xgb.Put16(buf[b:], EventMask) + b += 2 + + b += 2 // padding + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadAccess error. If no bad value exists, 0 is returned. -func (err AccessError) BadId() uint32 { - return err.BadValue +// ChangeGCCookie is a cookie used only for ChangeGC requests. +type ChangeGCCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadAccess error. -func (err AccessError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAccess {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie{cookie} } -func init() { - xgb.NewErrorFuncs[10] = AccessErrorNew +// ChangeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeGCCookie.Check() +func ChangeGCChecked(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) + return ChangeGCCookie{cookie} } -// BadAlloc is the error number for a BadAlloc. -const BadAlloc = 11 - -type AllocError RequestError - -// AllocErrorNew constructs a AllocError value that implements xgb.Error from a byte slice. -func AllocErrorNew(buf []byte) xgb.Error { - v := AllocError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Alloc" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeGCCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadAlloc error. -// This is mostly used internally. -func (err AllocError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeGC +// changeGCRequest writes a ChangeGC request to a byte slice. +func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 56 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadAlloc error. If no bad value exists, 0 is returned. -func (err AllocError) BadId() uint32 { - return err.BadValue +// ChangeHostsCookie is a cookie used only for ChangeHosts requests. +type ChangeHostsCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadAlloc error. -func (err AllocError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAlloc {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeHosts sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeHosts(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie{cookie} } -func init() { - xgb.NewErrorFuncs[11] = AllocErrorNew +// ChangeHostsChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeHostsCookie.Check() +func ChangeHostsChecked(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) + return ChangeHostsCookie{cookie} } -// BadColormap is the error number for a BadColormap. -const BadColormap = 12 - -type ColormapError ValueError - -// ColormapErrorNew constructs a ColormapError value that implements xgb.Error from a byte slice. -func ColormapErrorNew(buf []byte) xgb.Error { - v := ColormapError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "Colormap" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeHostsCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadColormap error. -// This is mostly used internally. -func (err ColormapError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeHosts +// changeHostsRequest writes a ChangeHosts request to a byte slice. +func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { + size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 109 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = Family + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], AddressLen) + b += 2 + + copy(buf[b:], Address[:AddressLen]) + b += xgb.Pad(int(AddressLen)) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadColormap error. If no bad value exists, 0 is returned. -func (err ColormapError) BadId() uint32 { - return err.BadValue +// ChangeKeyboardControlCookie is a cookie used only for ChangeKeyboardControl requests. +type ChangeKeyboardControlCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadColormap error. -func (err ColormapError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadColormap {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeKeyboardControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie{cookie} } -func init() { - xgb.NewErrorFuncs[12] = ColormapErrorNew +// ChangeKeyboardControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardControlCookie.Check() +func ChangeKeyboardControlChecked(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) + return ChangeKeyboardControlCookie{cookie} } -// BadGContext is the error number for a BadGContext. -const BadGContext = 13 - -type GContextError ValueError - -// GContextErrorNew constructs a GContextError value that implements xgb.Error from a byte slice. -func GContextErrorNew(buf []byte) xgb.Error { - v := GContextError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "GContext" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeKeyboardControlCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadGContext error. -// This is mostly used internally. -func (err GContextError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeKeyboardControl +// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. +func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 102 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadGContext error. If no bad value exists, 0 is returned. -func (err GContextError) BadId() uint32 { - return err.BadValue +// ChangeKeyboardMappingCookie is a cookie used only for ChangeKeyboardMapping requests. +type ChangeKeyboardMappingCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadGContext error. -func (err GContextError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadGContext {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeKeyboardMapping sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie{cookie} } -func init() { - xgb.NewErrorFuncs[13] = GContextErrorNew +// ChangeKeyboardMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardMappingCookie.Check() +func ChangeKeyboardMappingChecked(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) + return ChangeKeyboardMappingCookie{cookie} } -// BadIDChoice is the error number for a BadIDChoice. -const BadIDChoice = 14 - -type IDChoiceError ValueError - -// IDChoiceErrorNew constructs a IDChoiceError value that implements xgb.Error from a byte slice. -func IDChoiceErrorNew(buf []byte) xgb.Error { - v := IDChoiceError(ValueErrorNew(buf).(ValueError)) - v.NiceName = "IDChoice" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeKeyboardMappingCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadIDChoice error. -// This is mostly used internally. -func (err IDChoiceError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeKeyboardMapping +// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice. +func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { + size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 100 // request opcode + b += 1 + + buf[b] = KeycodeCount + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = KeysymsPerKeycode + b += 1 + + b += 2 // padding + + for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { + xgb.Put32(buf[b:], uint32(Keysyms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadIDChoice error. If no bad value exists, 0 is returned. -func (err IDChoiceError) BadId() uint32 { - return err.BadValue +// ChangePointerControlCookie is a cookie used only for ChangePointerControl requests. +type ChangePointerControlCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadIDChoice error. -func (err IDChoiceError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadIDChoice {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangePointerControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangePointerControl(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie{cookie} } -func init() { - xgb.NewErrorFuncs[14] = IDChoiceErrorNew +// ChangePointerControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePointerControlCookie.Check() +func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) + return ChangePointerControlCookie{cookie} } -// BadName is the error number for a BadName. -const BadName = 15 - -type NameError RequestError - -// NameErrorNew constructs a NameError value that implements xgb.Error from a byte slice. -func NameErrorNew(buf []byte) xgb.Error { - v := NameError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Name" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangePointerControlCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadName error. -// This is mostly used internally. -func (err NameError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangePointerControl +// changePointerControlRequest writes a ChangePointerControl request to a byte slice. +func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 105 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], uint16(AccelerationNumerator)) + b += 2 + + xgb.Put16(buf[b:], uint16(AccelerationDenominator)) + b += 2 + + xgb.Put16(buf[b:], uint16(Threshold)) + b += 2 + + if DoAcceleration { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if DoThreshold { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadName error. If no bad value exists, 0 is returned. -func (err NameError) BadId() uint32 { - return err.BadValue +// ChangePropertyCookie is a cookie used only for ChangeProperty requests. +type ChangePropertyCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadName error. -func (err NameError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadName {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie{cookie} } -func init() { - xgb.NewErrorFuncs[15] = NameErrorNew +// ChangePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePropertyCookie.Check() +func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) + return ChangePropertyCookie{cookie} } -// BadLength is the error number for a BadLength. -const BadLength = 16 - -type LengthError RequestError - -// LengthErrorNew constructs a LengthError value that implements xgb.Error from a byte slice. -func LengthErrorNew(buf []byte) xgb.Error { - v := LengthError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Length" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangePropertyCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadLength error. -// This is mostly used internally. -func (err LengthError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeProperty +// changePropertyRequest writes a ChangeProperty request to a byte slice. +func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 18 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + b += 3 // padding + + xgb.Put32(buf[b:], DataLen) + b += 4 + + copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) + b += xgb.Pad(int(((int(DataLen) * int(Format)) / 8))) + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadLength error. If no bad value exists, 0 is returned. -func (err LengthError) BadId() uint32 { - return err.BadValue +// ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. +type ChangeSaveSetCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadLength error. -func (err LengthError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadLength {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeSaveSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) + return ChangeSaveSetCookie{cookie} } -func init() { - xgb.NewErrorFuncs[16] = LengthErrorNew +// ChangeSaveSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() +func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) + return ChangeSaveSetCookie{cookie} } -// BadImplementation is the error number for a BadImplementation. -const BadImplementation = 17 - -type ImplementationError RequestError - -// ImplementationErrorNew constructs a ImplementationError value that implements xgb.Error from a byte slice. -func ImplementationErrorNew(buf []byte) xgb.Error { - v := ImplementationError(RequestErrorNew(buf).(RequestError)) - v.NiceName = "Implementation" - return v +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeSaveSetCookie) Check() error { + return cook.Cookie.Check() } -// SequenceId returns the sequence id attached to the BadImplementation error. -// This is mostly used internally. -func (err ImplementationError) SequenceId() uint16 { - return err.Sequence +// Write request to wire for ChangeSaveSet +// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. +func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 6 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf } -// BadId returns the 'BadValue' number if one exists for the BadImplementation error. If no bad value exists, 0 is returned. -func (err ImplementationError) BadId() uint32 { - return err.BadValue +// ChangeWindowAttributesCookie is a cookie used only for ChangeWindowAttributes requests. +type ChangeWindowAttributesCookie struct { + *xgb.Cookie } -// Error returns a rudimentary string representation of the BadImplementation error. -func (err ImplementationError) Error() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadValue: %d", err.BadValue)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadImplementation {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// ChangeWindowAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie{cookie} } -func init() { - xgb.NewErrorFuncs[17] = ImplementationErrorNew +// ChangeWindowAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeWindowAttributesCookie.Check() +func ChangeWindowAttributesChecked(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) + return ChangeWindowAttributesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeWindowAttributesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeWindowAttributes +// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. +func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 2 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CirculateWindowCookie is a cookie used only for CirculateWindow requests. +type CirculateWindowCookie struct { + *xgb.Cookie +} + +// CirculateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) + return CirculateWindowCookie{cookie} +} + +// CirculateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CirculateWindowCookie.Check() +func CirculateWindowChecked(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) + return CirculateWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CirculateWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CirculateWindow +// circulateWindowRequest writes a CirculateWindow request to a byte slice. +func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 13 // request opcode + b += 1 + + buf[b] = Direction + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// ClearAreaCookie is a cookie used only for ClearArea requests. +type ClearAreaCookie struct { + *xgb.Cookie +} + +// ClearArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie{cookie} +} + +// ClearAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using ClearAreaCookie.Check() +func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) + return ClearAreaCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ClearAreaCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ClearArea +// clearAreaRequest writes a ClearArea request to a byte slice. +func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 61 // request opcode + b += 1 + + if Exposures { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// CloseFontCookie is a cookie used only for CloseFont requests. +type CloseFontCookie struct { + *xgb.Cookie +} + +// CloseFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(closeFontRequest(c, Font), cookie) + return CloseFontCookie{cookie} +} + +// CloseFontChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseFontCookie.Check() +func CloseFontChecked(c *xgb.Conn, Font Font) CloseFontCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(closeFontRequest(c, Font), cookie) + return CloseFontCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CloseFontCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CloseFont +// closeFontRequest writes a CloseFont request to a byte slice. +func closeFontRequest(c *xgb.Conn, Font Font) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 46 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Font)) + b += 4 + + return buf +} + +// ConfigureWindowCookie is a cookie used only for ConfigureWindow requests. +type ConfigureWindowCookie struct { + *xgb.Cookie +} + +// ConfigureWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie{cookie} +} + +// ConfigureWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureWindowCookie.Check() +func ConfigureWindowChecked(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) + return ConfigureWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ConfigureWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ConfigureWindow +// configureWindowRequest writes a ConfigureWindow request to a byte slice. +func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { + size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 12 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], ValueMask) + b += 2 + + b += 2 // padding + + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ConvertSelectionCookie is a cookie used only for ConvertSelection requests. +type ConvertSelectionCookie struct { + *xgb.Cookie +} + +// ConvertSelection sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ConvertSelection(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie{cookie} +} + +// ConvertSelectionChecked sends a checked request. +// If an error occurs, it can be retrieved using ConvertSelectionCookie.Check() +func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) + return ConvertSelectionCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ConvertSelectionCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ConvertSelection +// convertSelectionRequest writes a ConvertSelection request to a byte slice. +func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 24 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Requestor)) + b += 4 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + xgb.Put32(buf[b:], uint32(Target)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// CopyAreaCookie is a cookie used only for CopyArea requests. +type CopyAreaCookie struct { + *xgb.Cookie +} + +// CopyArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CopyArea(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie{cookie} +} + +// CopyAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyAreaCookie.Check() +func CopyAreaChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) + return CopyAreaCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CopyAreaCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyArea +// copyAreaRequest writes a CopyArea request to a byte slice. +func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = 62 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SrcDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(DstDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// CopyColormapAndFreeCookie is a cookie used only for CopyColormapAndFree requests. +type CopyColormapAndFreeCookie struct { + *xgb.Cookie +} + +// CopyColormapAndFree sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CopyColormapAndFree(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie{cookie} +} + +// CopyColormapAndFreeChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyColormapAndFreeCookie.Check() +func CopyColormapAndFreeChecked(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) + return CopyColormapAndFreeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CopyColormapAndFreeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyColormapAndFree +// copyColormapAndFreeRequest writes a CopyColormapAndFree request to a byte slice. +func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 80 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Mid)) + b += 4 + + xgb.Put32(buf[b:], uint32(SrcCmap)) + b += 4 + + return buf +} + +// CopyGCCookie is a cookie used only for CopyGC requests. +type CopyGCCookie struct { + *xgb.Cookie +} + +// CopyGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CopyGC(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie{cookie} +} + +// CopyGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyGCCookie.Check() +func CopyGCChecked(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) + return CopyGCCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CopyGCCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyGC +// copyGCRequest writes a CopyGC request to a byte slice. +func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 57 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SrcGc)) + b += 4 + + xgb.Put32(buf[b:], uint32(DstGc)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + + return buf +} + +// CopyPlaneCookie is a cookie used only for CopyPlane requests. +type CopyPlaneCookie struct { + *xgb.Cookie +} + +// CopyPlane sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CopyPlane(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie{cookie} +} + +// CopyPlaneChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyPlaneCookie.Check() +func CopyPlaneChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) + return CopyPlaneCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CopyPlaneCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CopyPlane +// copyPlaneRequest writes a CopyPlane request to a byte slice. +func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 63 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SrcDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(DstDrawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], BitPlane) + b += 4 + + return buf +} + +// CreateColormapCookie is a cookie used only for CreateColormap requests. +type CreateColormapCookie struct { + *xgb.Cookie +} + +// CreateColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie{cookie} +} + +// CreateColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateColormapCookie.Check() +func CreateColormapChecked(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) + return CreateColormapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateColormapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateColormap +// createColormapRequest writes a CreateColormap request to a byte slice. +func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 78 // request opcode + b += 1 + + buf[b] = Alloc + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Mid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Visual)) + b += 4 + + return buf +} + +// CreateCursorCookie is a cookie used only for CreateCursor requests. +type CreateCursorCookie struct { + *xgb.Cookie +} + +// CreateCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateCursor(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +// CreateCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCursorCookie.Check() +func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) + return CreateCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateCursor +// createCursorRequest writes a CreateCursor request to a byte slice. +func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 93 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Source)) + b += 4 + + xgb.Put32(buf[b:], uint32(Mask)) + b += 4 + + xgb.Put16(buf[b:], ForeRed) + b += 2 + + xgb.Put16(buf[b:], ForeGreen) + b += 2 + + xgb.Put16(buf[b:], ForeBlue) + b += 2 + + xgb.Put16(buf[b:], BackRed) + b += 2 + + xgb.Put16(buf[b:], BackGreen) + b += 2 + + xgb.Put16(buf[b:], BackBlue) + b += 2 + + xgb.Put16(buf[b:], X) + b += 2 + + xgb.Put16(buf[b:], Y) + b += 2 + + return buf +} + +// CreateGCCookie is a cookie used only for CreateGC requests. +type CreateGCCookie struct { + *xgb.Cookie +} + +// CreateGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie{cookie} +} + +// CreateGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGCCookie.Check() +func CreateGCChecked(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) + return CreateGCCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateGCCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateGC +// createGCRequest writes a CreateGC request to a byte slice. +func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { + size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + b := 0 + buf := make([]byte, size) + + buf[b] = 55 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], ValueMask) + b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { + xgb.Put32(buf[b:], ValueList[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// CreateGlyphCursorCookie is a cookie used only for CreateGlyphCursor requests. +type CreateGlyphCursorCookie struct { + *xgb.Cookie +} + +// CreateGlyphCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie{cookie} +} + +// CreateGlyphCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGlyphCursorCookie.Check() +func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return CreateGlyphCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreateGlyphCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreateGlyphCursor +// createGlyphCursorRequest writes a CreateGlyphCursor request to a byte slice. +func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { + size := 32 + b := 0 + buf := make([]byte, size) + + buf[b] = 94 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cid)) + b += 4 + + xgb.Put32(buf[b:], uint32(SourceFont)) + b += 4 + + xgb.Put32(buf[b:], uint32(MaskFont)) + b += 4 + + xgb.Put16(buf[b:], SourceChar) + b += 2 + + xgb.Put16(buf[b:], MaskChar) + b += 2 + + xgb.Put16(buf[b:], ForeRed) + b += 2 + + xgb.Put16(buf[b:], ForeGreen) + b += 2 + + xgb.Put16(buf[b:], ForeBlue) + b += 2 + + xgb.Put16(buf[b:], BackRed) + b += 2 + + xgb.Put16(buf[b:], BackGreen) + b += 2 + + xgb.Put16(buf[b:], BackBlue) + b += 2 + + return buf +} + +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. +type CreatePixmapCookie struct { + *xgb.Cookie +} + +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie{cookie} +} + +// CreatePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() +func CreatePixmapChecked(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) + return CreatePixmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreatePixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. +func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 53 // request opcode + b += 1 + + buf[b] = Depth + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pid)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf } // CreateWindowCookie is a cookie used only for CreateWindow requests. @@ -6485,41 +8421,41 @@ func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X i return buf } -// ChangeWindowAttributesCookie is a cookie used only for ChangeWindowAttributes requests. -type ChangeWindowAttributesCookie struct { +// DeletePropertyCookie is a cookie used only for DeleteProperty requests. +type DeletePropertyCookie struct { *xgb.Cookie } -// ChangeWindowAttributes sends an unchecked request. +// DeleteProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { +func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(false, false) - c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) - return ChangeWindowAttributesCookie{cookie} + c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) + return DeletePropertyCookie{cookie} } -// ChangeWindowAttributesChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeWindowAttributesCookie.Check() -func ChangeWindowAttributesChecked(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { +// DeletePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeletePropertyCookie.Check() +func DeletePropertyChecked(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(true, false) - c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) - return ChangeWindowAttributesCookie{cookie} + c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) + return DeletePropertyCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeWindowAttributesCookie) Check() error { +func (cook DeletePropertyCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeWindowAttributes -// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. -func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// Write request to wire for DeleteProperty +// deletePropertyRequest writes a DeleteProperty request to a byte slice. +func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { + size := 12 b := 0 buf := make([]byte, size) - buf[b] = 2 // request opcode + buf[b] = 19 // request opcode b += 1 b += 1 // padding @@ -6530,10 +8466,313 @@ func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, xgb.Put32(buf[b:], uint32(Window)) b += 4 - xgb.Put32(buf[b:], ValueMask) + xgb.Put32(buf[b:], uint32(Property)) b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) + + return buf +} + +// DestroySubwindowsCookie is a cookie used only for DestroySubwindows requests. +type DestroySubwindowsCookie struct { + *xgb.Cookie +} + +// DestroySubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroySubwindowsRequest(c, Window), cookie) + return DestroySubwindowsCookie{cookie} +} + +// DestroySubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySubwindowsCookie.Check() +func DestroySubwindowsChecked(c *xgb.Conn, Window Window) DestroySubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroySubwindowsRequest(c, Window), cookie) + return DestroySubwindowsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroySubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroySubwindows +// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice. +func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 5 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// DestroyWindowCookie is a cookie used only for DestroyWindow requests. +type DestroyWindowCookie struct { + *xgb.Cookie +} + +// DestroyWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(destroyWindowRequest(c, Window), cookie) + return DestroyWindowCookie{cookie} +} + +// DestroyWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyWindowCookie.Check() +func DestroyWindowChecked(c *xgb.Conn, Window Window) DestroyWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(destroyWindowRequest(c, Window), cookie) + return DestroyWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyWindow +// destroyWindowRequest writes a DestroyWindow request to a byte slice. +func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 4 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// FillPolyCookie is a cookie used only for FillPoly requests. +type FillPolyCookie struct { + *xgb.Cookie +} + +// FillPoly sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie{cookie} +} + +// FillPolyChecked sends a checked request. +// If an error occurs, it can be retrieved using FillPolyCookie.Check() +func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) + return FillPolyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FillPolyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FillPoly +// fillPolyRequest writes a FillPoly request to a byte slice. +func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 69 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + buf[b] = Shape + b += 1 + + buf[b] = CoordinateMode + b += 1 + + b += 2 // padding + + b += PointListBytes(buf[b:], Points) + + return buf +} + +// ForceScreenSaverCookie is a cookie used only for ForceScreenSaver requests. +type ForceScreenSaverCookie struct { + *xgb.Cookie +} + +// ForceScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) + return ForceScreenSaverCookie{cookie} +} + +// ForceScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using ForceScreenSaverCookie.Check() +func ForceScreenSaverChecked(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) + return ForceScreenSaverCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ForceScreenSaverCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ForceScreenSaver +// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice. +func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 115 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// FreeColormapCookie is a cookie used only for FreeColormap requests. +type FreeColormapCookie struct { + *xgb.Cookie +} + +// FreeColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeColormapRequest(c, Cmap), cookie) + return FreeColormapCookie{cookie} +} + +// FreeColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColormapCookie.Check() +func FreeColormapChecked(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeColormapRequest(c, Cmap), cookie) + return FreeColormapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeColormapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeColormap +// freeColormapRequest writes a FreeColormap request to a byte slice. +func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 79 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + return buf +} + +// FreeColorsCookie is a cookie used only for FreeColors requests. +type FreeColorsCookie struct { + *xgb.Cookie +} + +// FreeColors sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie{cookie} +} + +// FreeColorsChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColorsCookie.Check() +func FreeColorsChecked(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) + return FreeColorsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeColorsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeColors +// freeColorsRequest writes a FreeColors request to a byte slice. +func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 88 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + xgb.Put32(buf[b:], PlaneMask) + b += 4 + + for i := 0; i < int(len(Pixels)); i++ { + xgb.Put32(buf[b:], Pixels[i]) b += 4 } b = xgb.Pad(b) @@ -6541,6 +8780,1446 @@ func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, return buf } +// FreeCursorCookie is a cookie used only for FreeCursor requests. +type FreeCursorCookie struct { + *xgb.Cookie +} + +// FreeCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeCursorRequest(c, Cursor), cookie) + return FreeCursorCookie{cookie} +} + +// FreeCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeCursorCookie.Check() +func FreeCursorChecked(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeCursorRequest(c, Cursor), cookie) + return FreeCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeCursor +// freeCursorRequest writes a FreeCursor request to a byte slice. +func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 95 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + return buf +} + +// FreeGCCookie is a cookie used only for FreeGC requests. +type FreeGCCookie struct { + *xgb.Cookie +} + +// FreeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freeGCRequest(c, Gc), cookie) + return FreeGCCookie{cookie} +} + +// FreeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGCCookie.Check() +func FreeGCChecked(c *xgb.Conn, Gc Gcontext) FreeGCCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freeGCRequest(c, Gc), cookie) + return FreeGCCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreeGCCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreeGC +// freeGCRequest writes a FreeGC request to a byte slice. +func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 60 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + return buf +} + +// FreePixmapCookie is a cookie used only for FreePixmap requests. +type FreePixmapCookie struct { + *xgb.Cookie +} + +// FreePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(freePixmapRequest(c, Pixmap), cookie) + return FreePixmapCookie{cookie} +} + +// FreePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreePixmapCookie.Check() +func FreePixmapChecked(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(freePixmapRequest(c, Pixmap), cookie) + return FreePixmapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook FreePixmapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for FreePixmap +// freePixmapRequest writes a FreePixmap request to a byte slice. +func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 54 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Pixmap)) + b += 4 + + return buf +} + +// GetAtomNameCookie is a cookie used only for GetAtomName requests. +type GetAtomNameCookie struct { + *xgb.Cookie +} + +// GetAtomName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetAtomNameCookie.Reply() +func GetAtomName(c *xgb.Conn, Atom Atom) GetAtomNameCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getAtomNameRequest(c, Atom), cookie) + return GetAtomNameCookie{cookie} +} + +// GetAtomNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetAtomNameUnchecked(c *xgb.Conn, Atom Atom) GetAtomNameCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getAtomNameRequest(c, Atom), cookie) + return GetAtomNameCookie{cookie} +} + +// GetAtomNameReply represents the data returned from a GetAtomName request. +type GetAtomNameReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NameLen uint16 + // padding: 22 bytes + Name string // size: xgb.Pad((int(NameLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetAtomName request. +func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getAtomNameReply(buf), nil +} + +// getAtomNameReply reads a byte slice into a GetAtomNameReply value. +func getAtomNameReply(buf []byte) *GetAtomNameReply { + v := new(GetAtomNameReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NameLen = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameLen)) + } + + return v +} + +// Write request to wire for GetAtomName +// getAtomNameRequest writes a GetAtomName request to a byte slice. +func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 17 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Atom)) + b += 4 + + return buf +} + +// GetFontPathCookie is a cookie used only for GetFontPath requests. +type GetFontPathCookie struct { + *xgb.Cookie +} + +// GetFontPath sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFontPathCookie.Reply() +func GetFontPath(c *xgb.Conn) GetFontPathCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getFontPathRequest(c), cookie) + return GetFontPathCookie{cookie} +} + +// GetFontPathUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetFontPathUnchecked(c *xgb.Conn) GetFontPathCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getFontPathRequest(c), cookie) + return GetFontPathCookie{cookie} +} + +// GetFontPathReply represents the data returned from a GetFontPath request. +type GetFontPathReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + PathLen uint16 + // padding: 22 bytes + Path []Str // size: StrListSize(Path) +} + +// Reply blocks and returns the reply data for a GetFontPath request. +func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getFontPathReply(buf), nil +} + +// getFontPathReply reads a byte slice into a GetFontPathReply value. +func getFontPathReply(buf []byte) *GetFontPathReply { + v := new(GetFontPathReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PathLen = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Path = make([]Str, v.PathLen) + b += StrReadList(buf[b:], v.Path) + + return v +} + +// Write request to wire for GetFontPath +// getFontPathRequest writes a GetFontPath request to a byte slice. +func getFontPathRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 52 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetGeometryCookie is a cookie used only for GetGeometry requests. +type GetGeometryCookie struct { + *xgb.Cookie +} + +// GetGeometry sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGeometryCookie.Reply() +func GetGeometry(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getGeometryRequest(c, Drawable), cookie) + return GetGeometryCookie{cookie} +} + +// GetGeometryUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getGeometryRequest(c, Drawable), cookie) + return GetGeometryCookie{cookie} +} + +// GetGeometryReply represents the data returned from a GetGeometry request. +type GetGeometryReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Depth byte + Root Window + X int16 + Y int16 + Width uint16 + Height uint16 + BorderWidth uint16 + // padding: 2 bytes +} + +// Reply blocks and returns the reply data for a GetGeometry request. +func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getGeometryReply(buf), nil +} + +// getGeometryReply reads a byte slice into a GetGeometryReply value. +func getGeometryReply(buf []byte) *GetGeometryReply { + v := new(GetGeometryReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.BorderWidth = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v +} + +// Write request to wire for GetGeometry +// getGeometryRequest writes a GetGeometry request to a byte slice. +func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 14 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// GetImageCookie is a cookie used only for GetImage requests. +type GetImageCookie struct { + *xgb.Cookie +} + +// GetImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() +func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie{cookie} +} + +// GetImageUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetImageUnchecked(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) + return GetImageCookie{cookie} +} + +// GetImageReply represents the data returned from a GetImage request. +type GetImageReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Depth byte + Visual Visualid + // padding: 20 bytes + Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) +} + +// Reply blocks and returns the reply data for a GetImage request. +func (cook GetImageCookie) Reply() (*GetImageReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getImageReply(buf), nil +} + +// getImageReply reads a byte slice into a GetImageReply value. +func getImageReply(buf []byte) *GetImageReply { + v := new(GetImageReply) + b := 1 // skip reply determinant + + v.Depth = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Visual = Visualid(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + v.Data = make([]byte, (int(v.Length) * 4)) + copy(v.Data[:(int(v.Length)*4)], buf[b:]) + b += xgb.Pad(int((int(v.Length) * 4))) + + return v +} + +// Write request to wire for GetImage +// getImageRequest writes a GetImage request to a byte slice. +func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = 73 // request opcode + b += 1 + + buf[b] = Format + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put32(buf[b:], PlaneMask) + b += 4 + + return buf +} + +// GetInputFocusCookie is a cookie used only for GetInputFocus requests. +type GetInputFocusCookie struct { + *xgb.Cookie +} + +// GetInputFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetInputFocusCookie.Reply() +func GetInputFocus(c *xgb.Conn) GetInputFocusCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getInputFocusRequest(c), cookie) + return GetInputFocusCookie{cookie} +} + +// GetInputFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetInputFocusUnchecked(c *xgb.Conn) GetInputFocusCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getInputFocusRequest(c), cookie) + return GetInputFocusCookie{cookie} +} + +// GetInputFocusReply represents the data returned from a GetInputFocus request. +type GetInputFocusReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + RevertTo byte + Focus Window +} + +// Reply blocks and returns the reply data for a GetInputFocus request. +func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getInputFocusReply(buf), nil +} + +// getInputFocusReply reads a byte slice into a GetInputFocusReply value. +func getInputFocusReply(buf []byte) *GetInputFocusReply { + v := new(GetInputFocusReply) + b := 1 // skip reply determinant + + v.RevertTo = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Focus = Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetInputFocus +// getInputFocusRequest writes a GetInputFocus request to a byte slice. +func getInputFocusRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 43 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetKeyboardControlCookie is a cookie used only for GetKeyboardControl requests. +type GetKeyboardControlCookie struct { + *xgb.Cookie +} + +// GetKeyboardControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardControlCookie.Reply() +func GetKeyboardControl(c *xgb.Conn) GetKeyboardControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getKeyboardControlRequest(c), cookie) + return GetKeyboardControlCookie{cookie} +} + +// GetKeyboardControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetKeyboardControlUnchecked(c *xgb.Conn) GetKeyboardControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getKeyboardControlRequest(c), cookie) + return GetKeyboardControlCookie{cookie} +} + +// GetKeyboardControlReply represents the data returned from a GetKeyboardControl request. +type GetKeyboardControlReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + GlobalAutoRepeat byte + LedMask uint32 + KeyClickPercent byte + BellPercent byte + BellPitch uint16 + BellDuration uint16 + // padding: 2 bytes + AutoRepeats []byte // size: 32 +} + +// Reply blocks and returns the reply data for a GetKeyboardControl request. +func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getKeyboardControlReply(buf), nil +} + +// getKeyboardControlReply reads a byte slice into a GetKeyboardControlReply value. +func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { + v := new(GetKeyboardControlReply) + b := 1 // skip reply determinant + + v.GlobalAutoRepeat = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.LedMask = xgb.Get32(buf[b:]) + b += 4 + + v.KeyClickPercent = buf[b] + b += 1 + + v.BellPercent = buf[b] + b += 1 + + v.BellPitch = xgb.Get16(buf[b:]) + b += 2 + + v.BellDuration = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.AutoRepeats = make([]byte, 32) + copy(v.AutoRepeats[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return v +} + +// Write request to wire for GetKeyboardControl +// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice. +func getKeyboardControlRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 103 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetKeyboardMappingCookie is a cookie used only for GetKeyboardMapping requests. +type GetKeyboardMappingCookie struct { + *xgb.Cookie +} + +// GetKeyboardMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardMappingCookie.Reply() +func GetKeyboardMapping(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie{cookie} +} + +// GetKeyboardMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetKeyboardMappingUnchecked(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) + return GetKeyboardMappingCookie{cookie} +} + +// GetKeyboardMappingReply represents the data returned from a GetKeyboardMapping request. +type GetKeyboardMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + KeysymsPerKeycode byte + // padding: 24 bytes + Keysyms []Keysym // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a GetKeyboardMapping request. +func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getKeyboardMappingReply(buf), nil +} + +// getKeyboardMappingReply reads a byte slice into a GetKeyboardMappingReply value. +func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { + v := new(GetKeyboardMappingReply) + b := 1 // skip reply determinant + + v.KeysymsPerKeycode = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Keysyms = make([]Keysym, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Keysyms[i] = Keysym(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetKeyboardMapping +// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice. +func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 101 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = byte(FirstKeycode) + b += 1 + + buf[b] = Count + b += 1 + + return buf +} + +// GetModifierMappingCookie is a cookie used only for GetModifierMapping requests. +type GetModifierMappingCookie struct { + *xgb.Cookie +} + +// GetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetModifierMappingCookie.Reply() +func GetModifierMapping(c *xgb.Conn) GetModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getModifierMappingRequest(c), cookie) + return GetModifierMappingCookie{cookie} +} + +// GetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetModifierMappingUnchecked(c *xgb.Conn) GetModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getModifierMappingRequest(c), cookie) + return GetModifierMappingCookie{cookie} +} + +// GetModifierMappingReply represents the data returned from a GetModifierMapping request. +type GetModifierMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + KeycodesPerModifier byte + // padding: 24 bytes + Keycodes []Keycode // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) +} + +// Reply blocks and returns the reply data for a GetModifierMapping request. +func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getModifierMappingReply(buf), nil +} + +// getModifierMappingReply reads a byte slice into a GetModifierMappingReply value. +func getModifierMappingReply(buf []byte) *GetModifierMappingReply { + v := new(GetModifierMappingReply) + b := 1 // skip reply determinant + + v.KeycodesPerModifier = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Keycodes = make([]Keycode, (int(v.KeycodesPerModifier) * 8)) + for i := 0; i < int((int(v.KeycodesPerModifier) * 8)); i++ { + v.Keycodes[i] = Keycode(buf[b]) + b += 1 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetModifierMapping +// getModifierMappingRequest writes a GetModifierMapping request to a byte slice. +func getModifierMappingRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 119 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetMotionEventsCookie is a cookie used only for GetMotionEvents requests. +type GetMotionEventsCookie struct { + *xgb.Cookie +} + +// GetMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMotionEventsCookie.Reply() +func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) + return GetMotionEventsCookie{cookie} +} + +// GetMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) + return GetMotionEventsCookie{cookie} +} + +// GetMotionEventsReply represents the data returned from a GetMotionEvents request. +type GetMotionEventsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + EventsLen uint32 + // padding: 20 bytes + Events []Timecoord // size: xgb.Pad((int(EventsLen) * 8)) +} + +// Reply blocks and returns the reply data for a GetMotionEvents request. +func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMotionEventsReply(buf), nil +} + +// getMotionEventsReply reads a byte slice into a GetMotionEventsReply value. +func getMotionEventsReply(buf []byte) *GetMotionEventsReply { + v := new(GetMotionEventsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.EventsLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Events = make([]Timecoord, v.EventsLen) + b += TimecoordReadList(buf[b:], v.Events) + + return v +} + +// Write request to wire for GetMotionEvents +// getMotionEventsRequest writes a GetMotionEvents request to a byte slice. +func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 39 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Start)) + b += 4 + + xgb.Put32(buf[b:], uint32(Stop)) + b += 4 + + return buf +} + +// GetPointerControlCookie is a cookie used only for GetPointerControl requests. +type GetPointerControlCookie struct { + *xgb.Cookie +} + +// GetPointerControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerControlCookie.Reply() +func GetPointerControl(c *xgb.Conn) GetPointerControlCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPointerControlRequest(c), cookie) + return GetPointerControlCookie{cookie} +} + +// GetPointerControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPointerControlUnchecked(c *xgb.Conn) GetPointerControlCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPointerControlRequest(c), cookie) + return GetPointerControlCookie{cookie} +} + +// GetPointerControlReply represents the data returned from a GetPointerControl request. +type GetPointerControlReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + AccelerationNumerator uint16 + AccelerationDenominator uint16 + Threshold uint16 + // padding: 18 bytes +} + +// Reply blocks and returns the reply data for a GetPointerControl request. +func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPointerControlReply(buf), nil +} + +// getPointerControlReply reads a byte slice into a GetPointerControlReply value. +func getPointerControlReply(buf []byte) *GetPointerControlReply { + v := new(GetPointerControlReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.AccelerationNumerator = xgb.Get16(buf[b:]) + b += 2 + + v.AccelerationDenominator = xgb.Get16(buf[b:]) + b += 2 + + v.Threshold = xgb.Get16(buf[b:]) + b += 2 + + b += 18 // padding + + return v +} + +// Write request to wire for GetPointerControl +// getPointerControlRequest writes a GetPointerControl request to a byte slice. +func getPointerControlRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 106 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetPointerMappingCookie is a cookie used only for GetPointerMapping requests. +type GetPointerMappingCookie struct { + *xgb.Cookie +} + +// GetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerMappingCookie.Reply() +func GetPointerMapping(c *xgb.Conn) GetPointerMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPointerMappingRequest(c), cookie) + return GetPointerMappingCookie{cookie} +} + +// GetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPointerMappingUnchecked(c *xgb.Conn) GetPointerMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPointerMappingRequest(c), cookie) + return GetPointerMappingCookie{cookie} +} + +// GetPointerMappingReply represents the data returned from a GetPointerMapping request. +type GetPointerMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + MapLen byte + // padding: 24 bytes + Map []byte // size: xgb.Pad((int(MapLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetPointerMapping request. +func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPointerMappingReply(buf), nil +} + +// getPointerMappingReply reads a byte slice into a GetPointerMappingReply value. +func getPointerMappingReply(buf []byte) *GetPointerMappingReply { + v := new(GetPointerMappingReply) + b := 1 // skip reply determinant + + v.MapLen = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.Map = make([]byte, v.MapLen) + copy(v.Map[:v.MapLen], buf[b:]) + b += xgb.Pad(int(v.MapLen)) + + return v +} + +// Write request to wire for GetPointerMapping +// getPointerMappingRequest writes a GetPointerMapping request to a byte slice. +func getPointerMappingRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 117 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetPropertyCookie is a cookie used only for GetProperty requests. +type GetPropertyCookie struct { + *xgb.Cookie +} + +// GetProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCookie.Reply() +func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie{cookie} +} + +// GetPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) + return GetPropertyCookie{cookie} +} + +// GetPropertyReply represents the data returned from a GetProperty request. +type GetPropertyReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Format byte + Type Atom + BytesAfter uint32 + ValueLen uint32 + // padding: 12 bytes + Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) +} + +// Reply blocks and returns the reply data for a GetProperty request. +func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyReply(buf), nil +} + +// getPropertyReply reads a byte slice into a GetPropertyReply value. +func getPropertyReply(buf []byte) *GetPropertyReply { + v := new(GetPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = Atom(xgb.Get32(buf[b:])) + b += 4 + + v.BytesAfter = xgb.Get32(buf[b:]) + b += 4 + + v.ValueLen = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) + copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) + b += xgb.Pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) + + return v +} + +// Write request to wire for GetProperty +// getPropertyRequest writes a GetProperty request to a byte slice. +func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { + size := 24 + b := 0 + buf := make([]byte, size) + + buf[b] = 20 // request opcode + b += 1 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + xgb.Put32(buf[b:], LongOffset) + b += 4 + + xgb.Put32(buf[b:], LongLength) + b += 4 + + return buf +} + +// GetScreenSaverCookie is a cookie used only for GetScreenSaver requests. +type GetScreenSaverCookie struct { + *xgb.Cookie +} + +// GetScreenSaver sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSaverCookie.Reply() +func GetScreenSaver(c *xgb.Conn) GetScreenSaverCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getScreenSaverRequest(c), cookie) + return GetScreenSaverCookie{cookie} +} + +// GetScreenSaverUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetScreenSaverUnchecked(c *xgb.Conn) GetScreenSaverCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getScreenSaverRequest(c), cookie) + return GetScreenSaverCookie{cookie} +} + +// GetScreenSaverReply represents the data returned from a GetScreenSaver request. +type GetScreenSaverReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Timeout uint16 + Interval uint16 + PreferBlanking byte + AllowExposures byte + // padding: 18 bytes +} + +// Reply blocks and returns the reply data for a GetScreenSaver request. +func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getScreenSaverReply(buf), nil +} + +// getScreenSaverReply reads a byte slice into a GetScreenSaverReply value. +func getScreenSaverReply(buf []byte) *GetScreenSaverReply { + v := new(GetScreenSaverReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timeout = xgb.Get16(buf[b:]) + b += 2 + + v.Interval = xgb.Get16(buf[b:]) + b += 2 + + v.PreferBlanking = buf[b] + b += 1 + + v.AllowExposures = buf[b] + b += 1 + + b += 18 // padding + + return v +} + +// Write request to wire for GetScreenSaver +// getScreenSaverRequest writes a GetScreenSaver request to a byte slice. +func getScreenSaverRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 108 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetSelectionOwnerCookie is a cookie used only for GetSelectionOwner requests. +type GetSelectionOwnerCookie struct { + *xgb.Cookie +} + +// GetSelectionOwner sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionOwnerCookie.Reply() +func GetSelectionOwner(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) + return GetSelectionOwnerCookie{cookie} +} + +// GetSelectionOwnerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetSelectionOwnerUnchecked(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) + return GetSelectionOwnerCookie{cookie} +} + +// GetSelectionOwnerReply represents the data returned from a GetSelectionOwner request. +type GetSelectionOwnerReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Owner Window +} + +// Reply blocks and returns the reply data for a GetSelectionOwner request. +func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionOwnerReply(buf), nil +} + +// getSelectionOwnerReply reads a byte slice into a GetSelectionOwnerReply value. +func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { + v := new(GetSelectionOwnerReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Owner = Window(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for GetSelectionOwner +// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice. +func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 23 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + return buf +} + // GetWindowAttributesCookie is a cookie used only for GetWindowAttributes requests. type GetWindowAttributesCookie struct { *xgb.Cookie @@ -6690,784 +10369,44 @@ func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { return buf } -// DestroyWindowCookie is a cookie used only for DestroyWindow requests. -type DestroyWindowCookie struct { +// GrabButtonCookie is a cookie used only for GrabButton requests. +type GrabButtonCookie struct { *xgb.Cookie } -// DestroyWindow sends an unchecked request. +// GrabButton sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { +func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(false, false) - c.NewRequest(destroyWindowRequest(c, Window), cookie) - return DestroyWindowCookie{cookie} + c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie{cookie} } -// DestroyWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyWindowCookie.Check() -func DestroyWindowChecked(c *xgb.Conn, Window Window) DestroyWindowCookie { +// GrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabButtonCookie.Check() +func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(true, false) - c.NewRequest(destroyWindowRequest(c, Window), cookie) - return DestroyWindowCookie{cookie} + c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) + return GrabButtonCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyWindowCookie) Check() error { +func (cook GrabButtonCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for DestroyWindow -// destroyWindowRequest writes a DestroyWindow request to a byte slice. -func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { - size := 8 +// Write request to wire for GrabButton +// grabButtonRequest writes a GrabButton request to a byte slice. +func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { + size := 24 b := 0 buf := make([]byte, size) - buf[b] = 4 // request opcode + buf[b] = 28 // request opcode b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// DestroySubwindowsCookie is a cookie used only for DestroySubwindows requests. -type DestroySubwindowsCookie struct { - *xgb.Cookie -} - -// DestroySubwindows sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(destroySubwindowsRequest(c, Window), cookie) - return DestroySubwindowsCookie{cookie} -} - -// DestroySubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroySubwindowsCookie.Check() -func DestroySubwindowsChecked(c *xgb.Conn, Window Window) DestroySubwindowsCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(destroySubwindowsRequest(c, Window), cookie) - return DestroySubwindowsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroySubwindowsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroySubwindows -// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice. -func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 5 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. -type ChangeSaveSetCookie struct { - *xgb.Cookie -} - -// ChangeSaveSet sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) - return ChangeSaveSetCookie{cookie} -} - -// ChangeSaveSetChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() -func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) - return ChangeSaveSetCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeSaveSetCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeSaveSet -// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. -func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 6 // request opcode - b += 1 - - buf[b] = Mode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// ReparentWindowCookie is a cookie used only for ReparentWindow requests. -type ReparentWindowCookie struct { - *xgb.Cookie -} - -// ReparentWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ReparentWindow(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) - return ReparentWindowCookie{cookie} -} - -// ReparentWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using ReparentWindowCookie.Check() -func ReparentWindowChecked(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) - return ReparentWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ReparentWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ReparentWindow -// reparentWindowRequest writes a ReparentWindow request to a byte slice. -func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 7 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Parent)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - return buf -} - -// MapWindowCookie is a cookie used only for MapWindow requests. -type MapWindowCookie struct { - *xgb.Cookie -} - -// MapWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(mapWindowRequest(c, Window), cookie) - return MapWindowCookie{cookie} -} - -// MapWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using MapWindowCookie.Check() -func MapWindowChecked(c *xgb.Conn, Window Window) MapWindowCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(mapWindowRequest(c, Window), cookie) - return MapWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook MapWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for MapWindow -// mapWindowRequest writes a MapWindow request to a byte slice. -func mapWindowRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 8 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// MapSubwindowsCookie is a cookie used only for MapSubwindows requests. -type MapSubwindowsCookie struct { - *xgb.Cookie -} - -// MapSubwindows sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(mapSubwindowsRequest(c, Window), cookie) - return MapSubwindowsCookie{cookie} -} - -// MapSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using MapSubwindowsCookie.Check() -func MapSubwindowsChecked(c *xgb.Conn, Window Window) MapSubwindowsCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(mapSubwindowsRequest(c, Window), cookie) - return MapSubwindowsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook MapSubwindowsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for MapSubwindows -// mapSubwindowsRequest writes a MapSubwindows request to a byte slice. -func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 9 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// UnmapWindowCookie is a cookie used only for UnmapWindow requests. -type UnmapWindowCookie struct { - *xgb.Cookie -} - -// UnmapWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(unmapWindowRequest(c, Window), cookie) - return UnmapWindowCookie{cookie} -} - -// UnmapWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using UnmapWindowCookie.Check() -func UnmapWindowChecked(c *xgb.Conn, Window Window) UnmapWindowCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(unmapWindowRequest(c, Window), cookie) - return UnmapWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UnmapWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UnmapWindow -// unmapWindowRequest writes a UnmapWindow request to a byte slice. -func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 10 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// UnmapSubwindowsCookie is a cookie used only for UnmapSubwindows requests. -type UnmapSubwindowsCookie struct { - *xgb.Cookie -} - -// UnmapSubwindows sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) - return UnmapSubwindowsCookie{cookie} -} - -// UnmapSubwindowsChecked sends a checked request. -// If an error occurs, it can be retrieved using UnmapSubwindowsCookie.Check() -func UnmapSubwindowsChecked(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) - return UnmapSubwindowsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UnmapSubwindowsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UnmapSubwindows -// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice. -func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 11 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// ConfigureWindowCookie is a cookie used only for ConfigureWindow requests. -type ConfigureWindowCookie struct { - *xgb.Cookie -} - -// ConfigureWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) - return ConfigureWindowCookie{cookie} -} - -// ConfigureWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using ConfigureWindowCookie.Check() -func ConfigureWindowChecked(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) - return ConfigureWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ConfigureWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ConfigureWindow -// configureWindowRequest writes a ConfigureWindow request to a byte slice. -func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { - size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = 12 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], ValueMask) - b += 2 - - b += 2 // padding - - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// CirculateWindowCookie is a cookie used only for CirculateWindow requests. -type CirculateWindowCookie struct { - *xgb.Cookie -} - -// CirculateWindow sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) - return CirculateWindowCookie{cookie} -} - -// CirculateWindowChecked sends a checked request. -// If an error occurs, it can be retrieved using CirculateWindowCookie.Check() -func CirculateWindowChecked(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) - return CirculateWindowCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CirculateWindowCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CirculateWindow -// circulateWindowRequest writes a CirculateWindow request to a byte slice. -func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 13 // request opcode - b += 1 - - buf[b] = Direction - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// GetGeometryCookie is a cookie used only for GetGeometry requests. -type GetGeometryCookie struct { - *xgb.Cookie -} - -// GetGeometry sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetGeometryCookie.Reply() -func GetGeometry(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getGeometryRequest(c, Drawable), cookie) - return GetGeometryCookie{cookie} -} - -// GetGeometryUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getGeometryRequest(c, Drawable), cookie) - return GetGeometryCookie{cookie} -} - -// GetGeometryReply represents the data returned from a GetGeometry request. -type GetGeometryReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Depth byte - Root Window - X int16 - Y int16 - Width uint16 - Height uint16 - BorderWidth uint16 - // padding: 2 bytes -} - -// Reply blocks and returns the reply data for a GetGeometry request. -func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getGeometryReply(buf), nil -} - -// getGeometryReply reads a byte slice into a GetGeometryReply value. -func getGeometryReply(buf []byte) *GetGeometryReply { - v := new(GetGeometryReply) - b := 1 // skip reply determinant - - v.Depth = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.X = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Y = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - v.BorderWidth = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return v -} - -// Write request to wire for GetGeometry -// getGeometryRequest writes a GetGeometry request to a byte slice. -func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 14 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - return buf -} - -// QueryTreeCookie is a cookie used only for QueryTree requests. -type QueryTreeCookie struct { - *xgb.Cookie -} - -// QueryTree sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryTreeCookie.Reply() -func QueryTree(c *xgb.Conn, Window Window) QueryTreeCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryTreeRequest(c, Window), cookie) - return QueryTreeCookie{cookie} -} - -// QueryTreeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryTreeUnchecked(c *xgb.Conn, Window Window) QueryTreeCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryTreeRequest(c, Window), cookie) - return QueryTreeCookie{cookie} -} - -// QueryTreeReply represents the data returned from a QueryTree request. -type QueryTreeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Root Window - Parent Window - ChildrenLen uint16 - // padding: 14 bytes - Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) -} - -// Reply blocks and returns the reply data for a QueryTree request. -func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryTreeReply(buf), nil -} - -// queryTreeReply reads a byte slice into a QueryTreeReply value. -func queryTreeReply(buf []byte) *QueryTreeReply { - v := new(QueryTreeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Root = Window(xgb.Get32(buf[b:])) - b += 4 - - v.Parent = Window(xgb.Get32(buf[b:])) - b += 4 - - v.ChildrenLen = xgb.Get16(buf[b:]) - b += 2 - - b += 14 // padding - - v.Children = make([]Window, v.ChildrenLen) - for i := 0; i < int(v.ChildrenLen); i++ { - v.Children[i] = Window(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for QueryTree -// queryTreeRequest writes a QueryTree request to a byte slice. -func queryTreeRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 15 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// InternAtomCookie is a cookie used only for InternAtom requests. -type InternAtomCookie struct { - *xgb.Cookie -} - -// InternAtom sends a checked request. -// If an error occurs, it will be returned with the reply by calling InternAtomCookie.Reply() -func InternAtom(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) - return InternAtomCookie{cookie} -} - -// InternAtomUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func InternAtomUnchecked(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) - return InternAtomCookie{cookie} -} - -// InternAtomReply represents the data returned from a InternAtom request. -type InternAtomReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Atom Atom -} - -// Reply blocks and returns the reply data for a InternAtom request. -func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return internAtomReply(buf), nil -} - -// internAtomReply reads a byte slice into a InternAtomReply value. -func internAtomReply(buf []byte) *InternAtomReply { - v := new(InternAtomReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Atom = Atom(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for InternAtom -// internAtomRequest writes a InternAtom request to a byte slice. -func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 16 // request opcode - b += 1 - - if OnlyIfExists { + if OwnerEvents { buf[b] = 1 } else { buf[b] = 0 @@ -7477,374 +10416,132 @@ func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name stri xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) - - return buf -} - -// GetAtomNameCookie is a cookie used only for GetAtomName requests. -type GetAtomNameCookie struct { - *xgb.Cookie -} - -// GetAtomName sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetAtomNameCookie.Reply() -func GetAtomName(c *xgb.Conn, Atom Atom) GetAtomNameCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getAtomNameRequest(c, Atom), cookie) - return GetAtomNameCookie{cookie} -} - -// GetAtomNameUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetAtomNameUnchecked(c *xgb.Conn, Atom Atom) GetAtomNameCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getAtomNameRequest(c, Atom), cookie) - return GetAtomNameCookie{cookie} -} - -// GetAtomNameReply represents the data returned from a GetAtomName request. -type GetAtomNameReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NameLen uint16 - // padding: 22 bytes - Name string // size: xgb.Pad((int(NameLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetAtomName request. -func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getAtomNameReply(buf), nil -} - -// getAtomNameReply reads a byte slice into a GetAtomNameReply value. -func getAtomNameReply(buf []byte) *GetAtomNameReply { - v := new(GetAtomNameReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - v.NameLen = xgb.Get16(buf[b:]) + xgb.Put16(buf[b:], EventMask) b += 2 - b += 22 // padding + buf[b] = PointerMode + b += 1 - { - byteString := make([]byte, v.NameLen) - copy(byteString[:v.NameLen], buf[b:]) - v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) - } + buf[b] = KeyboardMode + b += 1 - return v -} + xgb.Put32(buf[b:], uint32(ConfineTo)) + b += 4 -// Write request to wire for GetAtomName -// getAtomNameRequest writes a GetAtomName request to a byte slice. -func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { - size := 8 - b := 0 - buf := make([]byte, size) + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 - buf[b] = 17 // request opcode + buf[b] = Button b += 1 b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + xgb.Put16(buf[b:], Modifiers) b += 2 - xgb.Put32(buf[b:], uint32(Atom)) - b += 4 - return buf } -// ChangePropertyCookie is a cookie used only for ChangeProperty requests. -type ChangePropertyCookie struct { +// GrabKeyCookie is a cookie used only for GrabKey requests. +type GrabKeyCookie struct { *xgb.Cookie } -// ChangeProperty sends an unchecked request. +// GrabKey sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { +func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(false, false) - c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) - return ChangePropertyCookie{cookie} + c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie{cookie} } -// ChangePropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangePropertyCookie.Check() -func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { +// GrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabKeyCookie.Check() +func GrabKeyChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(true, false) - c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) - return ChangePropertyCookie{cookie} + c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) + return GrabKeyCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangePropertyCookie) Check() error { +func (cook GrabKeyCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeProperty -// changePropertyRequest writes a ChangeProperty request to a byte slice. -func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { - size := xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) +// Write request to wire for GrabKey +// grabKeyRequest writes a GrabKey request to a byte slice. +func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { + size := 16 b := 0 buf := make([]byte, size) - buf[b] = 18 // request opcode + buf[b] = 33 // request opcode b += 1 - buf[b] = Mode + if OwnerEvents { + buf[b] = 1 + } else { + buf[b] = 0 + } b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - xgb.Put32(buf[b:], uint32(Property)) - b += 4 + xgb.Put16(buf[b:], Modifiers) + b += 2 - xgb.Put32(buf[b:], uint32(Type)) - b += 4 + buf[b] = byte(Key) + b += 1 - buf[b] = Format + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode b += 1 b += 3 // padding - xgb.Put32(buf[b:], DataLen) - b += 4 - - copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) - b += xgb.Pad(int(((int(DataLen) * int(Format)) / 8))) - return buf } -// DeletePropertyCookie is a cookie used only for DeleteProperty requests. -type DeletePropertyCookie struct { +// GrabKeyboardCookie is a cookie used only for GrabKeyboard requests. +type GrabKeyboardCookie struct { *xgb.Cookie } -// DeleteProperty sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) - return DeletePropertyCookie{cookie} -} - -// DeletePropertyChecked sends a checked request. -// If an error occurs, it can be retrieved using DeletePropertyCookie.Check() -func DeletePropertyChecked(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) - return DeletePropertyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeletePropertyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeleteProperty -// deletePropertyRequest writes a DeleteProperty request to a byte slice. -func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 19 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - return buf -} - -// GetPropertyCookie is a cookie used only for GetProperty requests. -type GetPropertyCookie struct { - *xgb.Cookie -} - -// GetProperty sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPropertyCookie.Reply() -func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { +// GrabKeyboard sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabKeyboardCookie.Reply() +func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(true, true) - c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) - return GetPropertyCookie{cookie} + c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie{cookie} } -// GetPropertyUnchecked sends an unchecked request. +// GrabKeyboardUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { +func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(false, true) - c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) - return GetPropertyCookie{cookie} + c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) + return GrabKeyboardCookie{cookie} } -// GetPropertyReply represents the data returned from a GetProperty request. -type GetPropertyReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Format byte - Type Atom - BytesAfter uint32 - ValueLen uint32 - // padding: 12 bytes - Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) -} - -// Reply blocks and returns the reply data for a GetProperty request. -func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPropertyReply(buf), nil -} - -// getPropertyReply reads a byte slice into a GetPropertyReply value. -func getPropertyReply(buf []byte) *GetPropertyReply { - v := new(GetPropertyReply) - b := 1 // skip reply determinant - - v.Format = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Type = Atom(xgb.Get32(buf[b:])) - b += 4 - - v.BytesAfter = xgb.Get32(buf[b:]) - b += 4 - - v.ValueLen = xgb.Get32(buf[b:]) - b += 4 - - b += 12 // padding - - v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) - copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) - b += xgb.Pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) - - return v -} - -// Write request to wire for GetProperty -// getPropertyRequest writes a GetProperty request to a byte slice. -func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = 20 // request opcode - b += 1 - - if Delete { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - xgb.Put32(buf[b:], uint32(Type)) - b += 4 - - xgb.Put32(buf[b:], LongOffset) - b += 4 - - xgb.Put32(buf[b:], LongLength) - b += 4 - - return buf -} - -// ListPropertiesCookie is a cookie used only for ListProperties requests. -type ListPropertiesCookie struct { - *xgb.Cookie -} - -// ListProperties sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() -func ListProperties(c *xgb.Conn, Window Window) ListPropertiesCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(listPropertiesRequest(c, Window), cookie) - return ListPropertiesCookie{cookie} -} - -// ListPropertiesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListPropertiesUnchecked(c *xgb.Conn, Window Window) ListPropertiesCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(listPropertiesRequest(c, Window), cookie) - return ListPropertiesCookie{cookie} -} - -// ListPropertiesReply represents the data returned from a ListProperties request. -type ListPropertiesReply struct { +// GrabKeyboardReply represents the data returned from a GrabKeyboard request. +type GrabKeyboardReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply - // padding: 1 bytes - AtomsLen uint16 - // padding: 22 bytes - Atoms []Atom // size: xgb.Pad((int(AtomsLen) * 4)) + Status byte } -// Reply blocks and returns the reply data for a ListProperties request. -func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { +// Reply blocks and returns the reply data for a GrabKeyboard request. +func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -7852,15 +10549,16 @@ func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { if buf == nil { return nil, nil } - return listPropertiesReply(buf), nil + return grabKeyboardReply(buf), nil } -// listPropertiesReply reads a byte slice into a ListPropertiesReply value. -func listPropertiesReply(buf []byte) *ListPropertiesReply { - v := new(ListPropertiesReply) +// grabKeyboardReply reads a byte slice into a GrabKeyboardReply value. +func grabKeyboardReply(buf []byte) *GrabKeyboardReply { + v := new(GrabKeyboardReply) b := 1 // skip reply determinant - b += 1 // padding + v.Status = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 @@ -7868,275 +10566,20 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.AtomsLen = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Atoms = make([]Atom, v.AtomsLen) - for i := 0; i < int(v.AtomsLen); i++ { - v.Atoms[i] = Atom(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - return v } -// Write request to wire for ListProperties -// listPropertiesRequest writes a ListProperties request to a byte slice. -func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 21 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// SetSelectionOwnerCookie is a cookie used only for SetSelectionOwner requests. -type SetSelectionOwnerCookie struct { - *xgb.Cookie -} - -// SetSelectionOwner sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) - return SetSelectionOwnerCookie{cookie} -} - -// SetSelectionOwnerChecked sends a checked request. -// If an error occurs, it can be retrieved using SetSelectionOwnerCookie.Check() -func SetSelectionOwnerChecked(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) - return SetSelectionOwnerCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetSelectionOwnerCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetSelectionOwner -// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice. -func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { +// Write request to wire for GrabKeyboard +// grabKeyboardRequest writes a GrabKeyboard request to a byte slice. +func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 buf := make([]byte, size) - buf[b] = 22 // request opcode + buf[b] = 31 // request opcode b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Owner)) - b += 4 - - xgb.Put32(buf[b:], uint32(Selection)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// GetSelectionOwnerCookie is a cookie used only for GetSelectionOwner requests. -type GetSelectionOwnerCookie struct { - *xgb.Cookie -} - -// GetSelectionOwner sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectionOwnerCookie.Reply() -func GetSelectionOwner(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) - return GetSelectionOwnerCookie{cookie} -} - -// GetSelectionOwnerUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSelectionOwnerUnchecked(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) - return GetSelectionOwnerCookie{cookie} -} - -// GetSelectionOwnerReply represents the data returned from a GetSelectionOwner request. -type GetSelectionOwnerReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Owner Window -} - -// Reply blocks and returns the reply data for a GetSelectionOwner request. -func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getSelectionOwnerReply(buf), nil -} - -// getSelectionOwnerReply reads a byte slice into a GetSelectionOwnerReply value. -func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { - v := new(GetSelectionOwnerReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Owner = Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for GetSelectionOwner -// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice. -func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 23 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Selection)) - b += 4 - - return buf -} - -// ConvertSelectionCookie is a cookie used only for ConvertSelection requests. -type ConvertSelectionCookie struct { - *xgb.Cookie -} - -// ConvertSelection sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ConvertSelection(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) - return ConvertSelectionCookie{cookie} -} - -// ConvertSelectionChecked sends a checked request. -// If an error occurs, it can be retrieved using ConvertSelectionCookie.Check() -func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) - return ConvertSelectionCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ConvertSelectionCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ConvertSelection -// convertSelectionRequest writes a ConvertSelection request to a byte slice. -func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = 24 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Requestor)) - b += 4 - - xgb.Put32(buf[b:], uint32(Selection)) - b += 4 - - xgb.Put32(buf[b:], uint32(Target)) - b += 4 - - xgb.Put32(buf[b:], uint32(Property)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// SendEventCookie is a cookie used only for SendEvent requests. -type SendEventCookie struct { - *xgb.Cookie -} - -// SendEvent sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) - return SendEventCookie{cookie} -} - -// SendEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SendEventCookie.Check() -func SendEventChecked(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) - return SendEventCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SendEventCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SendEvent -// sendEventRequest writes a SendEvent request to a byte slice. -func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { - size := 44 - b := 0 - buf := make([]byte, size) - - buf[b] = 25 // request opcode - b += 1 - - if Propagate { + if OwnerEvents { buf[b] = 1 } else { buf[b] = 0 @@ -8146,14 +10589,19 @@ func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Destination)) + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - xgb.Put32(buf[b:], EventMask) + xgb.Put32(buf[b:], uint32(Time)) b += 4 - copy(buf[b:], Event[:32]) - b += xgb.Pad(int(32)) + buf[b] = PointerMode + b += 1 + + buf[b] = KeyboardMode + b += 1 + + b += 2 // padding return buf } @@ -8259,552 +10707,6 @@ func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventM return buf } -// UngrabPointerCookie is a cookie used only for UngrabPointer requests. -type UngrabPointerCookie struct { - *xgb.Cookie -} - -// UngrabPointer sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabPointerRequest(c, Time), cookie) - return UngrabPointerCookie{cookie} -} - -// UngrabPointerChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabPointerCookie.Check() -func UngrabPointerChecked(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabPointerRequest(c, Time), cookie) - return UngrabPointerCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabPointerCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabPointer -// ungrabPointerRequest writes a UngrabPointer request to a byte slice. -func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 27 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// GrabButtonCookie is a cookie used only for GrabButton requests. -type GrabButtonCookie struct { - *xgb.Cookie -} - -// GrabButton sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) - return GrabButtonCookie{cookie} -} - -// GrabButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabButtonCookie.Check() -func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) - return GrabButtonCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GrabButtonCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for GrabButton -// grabButtonRequest writes a GrabButton request to a byte slice. -func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = 28 // request opcode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], EventMask) - b += 2 - - buf[b] = PointerMode - b += 1 - - buf[b] = KeyboardMode - b += 1 - - xgb.Put32(buf[b:], uint32(ConfineTo)) - b += 4 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - buf[b] = Button - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - return buf -} - -// UngrabButtonCookie is a cookie used only for UngrabButton requests. -type UngrabButtonCookie struct { - *xgb.Cookie -} - -// UngrabButton sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) - return UngrabButtonCookie{cookie} -} - -// UngrabButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabButtonCookie.Check() -func UngrabButtonChecked(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) - return UngrabButtonCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabButtonCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabButton -// ungrabButtonRequest writes a UngrabButton request to a byte slice. -func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 29 // request opcode - b += 1 - - buf[b] = Button - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - b += 2 // padding - - return buf -} - -// ChangeActivePointerGrabCookie is a cookie used only for ChangeActivePointerGrab requests. -type ChangeActivePointerGrabCookie struct { - *xgb.Cookie -} - -// ChangeActivePointerGrab sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) - return ChangeActivePointerGrabCookie{cookie} -} - -// ChangeActivePointerGrabChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeActivePointerGrabCookie.Check() -func ChangeActivePointerGrabChecked(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) - return ChangeActivePointerGrabCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeActivePointerGrabCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeActivePointerGrab -// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice. -func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 30 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - xgb.Put16(buf[b:], EventMask) - b += 2 - - b += 2 // padding - - return buf -} - -// GrabKeyboardCookie is a cookie used only for GrabKeyboard requests. -type GrabKeyboardCookie struct { - *xgb.Cookie -} - -// GrabKeyboard sends a checked request. -// If an error occurs, it will be returned with the reply by calling GrabKeyboardCookie.Reply() -func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) - return GrabKeyboardCookie{cookie} -} - -// GrabKeyboardUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) - return GrabKeyboardCookie{cookie} -} - -// GrabKeyboardReply represents the data returned from a GrabKeyboard request. -type GrabKeyboardReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte -} - -// Reply blocks and returns the reply data for a GrabKeyboard request. -func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return grabKeyboardReply(buf), nil -} - -// grabKeyboardReply reads a byte slice into a GrabKeyboardReply value. -func grabKeyboardReply(buf []byte) *GrabKeyboardReply { - v := new(GrabKeyboardReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -// Write request to wire for GrabKeyboard -// grabKeyboardRequest writes a GrabKeyboard request to a byte slice. -func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 31 // request opcode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = PointerMode - b += 1 - - buf[b] = KeyboardMode - b += 1 - - b += 2 // padding - - return buf -} - -// UngrabKeyboardCookie is a cookie used only for UngrabKeyboard requests. -type UngrabKeyboardCookie struct { - *xgb.Cookie -} - -// UngrabKeyboard sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) - return UngrabKeyboardCookie{cookie} -} - -// UngrabKeyboardChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabKeyboardCookie.Check() -func UngrabKeyboardChecked(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) - return UngrabKeyboardCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabKeyboardCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabKeyboard -// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice. -func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 32 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// GrabKeyCookie is a cookie used only for GrabKey requests. -type GrabKeyCookie struct { - *xgb.Cookie -} - -// GrabKey sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) - return GrabKeyCookie{cookie} -} - -// GrabKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabKeyCookie.Check() -func GrabKeyChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) - return GrabKeyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GrabKeyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for GrabKey -// grabKeyRequest writes a GrabKey request to a byte slice. -func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 33 // request opcode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = byte(Key) - b += 1 - - buf[b] = PointerMode - b += 1 - - buf[b] = KeyboardMode - b += 1 - - b += 3 // padding - - return buf -} - -// UngrabKeyCookie is a cookie used only for UngrabKey requests. -type UngrabKeyCookie struct { - *xgb.Cookie -} - -// UngrabKey sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) - return UngrabKeyCookie{cookie} -} - -// UngrabKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabKeyCookie.Check() -func UngrabKeyChecked(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) - return UngrabKeyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabKeyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabKey -// ungrabKeyRequest writes a UngrabKey request to a byte slice. -func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 34 // request opcode - b += 1 - - buf[b] = byte(Key) - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - b += 2 // padding - - return buf -} - -// AllowEventsCookie is a cookie used only for AllowEvents requests. -type AllowEventsCookie struct { - *xgb.Cookie -} - -// AllowEvents sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) - return AllowEventsCookie{cookie} -} - -// AllowEventsChecked sends a checked request. -// If an error occurs, it can be retrieved using AllowEventsCookie.Check() -func AllowEventsChecked(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) - return AllowEventsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AllowEventsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AllowEvents -// allowEventsRequest writes a AllowEvents request to a byte slice. -func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 35 // request opcode - b += 1 - - buf[b] = Mode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - // GrabServerCookie is a cookie used only for GrabServer requests. type GrabServerCookie struct { *xgb.Cookie @@ -8849,150 +10751,162 @@ func grabServerRequest(c *xgb.Conn) []byte { return buf } -// UngrabServerCookie is a cookie used only for UngrabServer requests. -type UngrabServerCookie struct { +// ImageText16Cookie is a cookie used only for ImageText16 requests. +type ImageText16Cookie struct { *xgb.Cookie } -// UngrabServer sends an unchecked request. +// ImageText16 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabServer(c *xgb.Conn) UngrabServerCookie { +func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(false, false) - c.NewRequest(ungrabServerRequest(c), cookie) - return UngrabServerCookie{cookie} + c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie{cookie} } -// UngrabServerChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabServerCookie.Check() -func UngrabServerChecked(c *xgb.Conn) UngrabServerCookie { +// ImageText16Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText16Cookie.Check() +func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(true, false) - c.NewRequest(ungrabServerRequest(c), cookie) - return UngrabServerCookie{cookie} + c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText16Cookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabServerCookie) Check() error { +func (cook ImageText16Cookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabServer -// ungrabServerRequest writes a UngrabServer request to a byte slice. -func ungrabServerRequest(c *xgb.Conn) []byte { - size := 4 +// Write request to wire for ImageText16 +// imageText16Request writes a ImageText16 request to a byte slice. +func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) b := 0 buf := make([]byte, size) - buf[b] = 37 // request opcode + buf[b] = 77 // request opcode + b += 1 + + buf[b] = StringLen b += 1 - b += 1 // padding xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + b += Char2bListBytes(buf[b:], String) + return buf } -// QueryPointerCookie is a cookie used only for QueryPointer requests. -type QueryPointerCookie struct { +// ImageText8Cookie is a cookie used only for ImageText8 requests. +type ImageText8Cookie struct { *xgb.Cookie } -// QueryPointer sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryPointerCookie.Reply() -func QueryPointer(c *xgb.Conn, Window Window) QueryPointerCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryPointerRequest(c, Window), cookie) - return QueryPointerCookie{cookie} -} - -// QueryPointerUnchecked sends an unchecked request. +// ImageText8 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryPointerRequest(c, Window), cookie) - return QueryPointerCookie{cookie} +func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie{cookie} } -// QueryPointerReply represents the data returned from a QueryPointer request. -type QueryPointerReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - SameScreen bool - Root Window - Child Window - RootX int16 - RootY int16 - WinX int16 - WinY int16 - Mask uint16 - // padding: 2 bytes +// ImageText8Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText8Cookie.Check() +func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) + return ImageText8Cookie{cookie} } -// Reply blocks and returns the reply data for a QueryPointer request. -func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryPointerReply(buf), nil +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ImageText8Cookie) Check() error { + return cook.Cookie.Check() } -// queryPointerReply reads a byte slice into a QueryPointerReply value. -func queryPointerReply(buf []byte) *QueryPointerReply { - v := new(QueryPointerReply) - b := 1 // skip reply determinant +// Write request to wire for ImageText8 +// imageText8Request writes a ImageText8 request to a byte slice. +func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { + size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) + b := 0 + buf := make([]byte, size) - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false - } + buf[b] = 76 // request opcode b += 1 - v.Sequence = xgb.Get16(buf[b:]) + buf[b] = StringLen + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - v.Root = Window(xgb.Get32(buf[b:])) + xgb.Put32(buf[b:], uint32(Gc)) b += 4 - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) + xgb.Put16(buf[b:], uint16(X)) b += 2 - v.RootY = int16(xgb.Get16(buf[b:])) + xgb.Put16(buf[b:], uint16(Y)) b += 2 - v.WinX = int16(xgb.Get16(buf[b:])) - b += 2 + copy(buf[b:], String[:StringLen]) + b += xgb.Pad(int(StringLen)) - v.WinY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Mask = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return v + return buf } -// Write request to wire for QueryPointer -// queryPointerRequest writes a QueryPointer request to a byte slice. -func queryPointerRequest(c *xgb.Conn, Window Window) []byte { +// InstallColormapCookie is a cookie used only for InstallColormap requests. +type InstallColormapCookie struct { + *xgb.Cookie +} + +// InstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(installColormapRequest(c, Cmap), cookie) + return InstallColormapCookie{cookie} +} + +// InstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using InstallColormapCookie.Check() +func InstallColormapChecked(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(installColormapRequest(c, Cmap), cookie) + return InstallColormapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook InstallColormapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for InstallColormap +// installColormapRequest writes a InstallColormap request to a byte slice. +func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 buf := make([]byte, size) - buf[b] = 38 // request opcode + buf[b] = 81 // request opcode b += 1 b += 1 // padding @@ -9000,45 +10914,43 @@ func queryPointerRequest(c *xgb.Conn, Window Window) []byte { xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Window)) + xgb.Put32(buf[b:], uint32(Cmap)) b += 4 return buf } -// GetMotionEventsCookie is a cookie used only for GetMotionEvents requests. -type GetMotionEventsCookie struct { +// InternAtomCookie is a cookie used only for InternAtom requests. +type InternAtomCookie struct { *xgb.Cookie } -// GetMotionEvents sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetMotionEventsCookie.Reply() -func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { +// InternAtom sends a checked request. +// If an error occurs, it will be returned with the reply by calling InternAtomCookie.Reply() +func InternAtom(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(true, true) - c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) - return GetMotionEventsCookie{cookie} + c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie{cookie} } -// GetMotionEventsUnchecked sends an unchecked request. +// InternAtomUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { +func InternAtomUnchecked(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(false, true) - c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) - return GetMotionEventsCookie{cookie} + c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) + return InternAtomCookie{cookie} } -// GetMotionEventsReply represents the data returned from a GetMotionEvents request. -type GetMotionEventsReply struct { +// InternAtomReply represents the data returned from a InternAtom request. +type InternAtomReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - EventsLen uint32 - // padding: 20 bytes - Events []Timecoord // size: xgb.Pad((int(EventsLen) * 8)) + Atom Atom } -// Reply blocks and returns the reply data for a GetMotionEvents request. -func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { +// Reply blocks and returns the reply data for a InternAtom request. +func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -9046,12 +10958,12 @@ func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { if buf == nil { return nil, nil } - return getMotionEventsReply(buf), nil + return internAtomReply(buf), nil } -// getMotionEventsReply reads a byte slice into a GetMotionEventsReply value. -func getMotionEventsReply(buf []byte) *GetMotionEventsReply { - v := new(GetMotionEventsReply) +// internAtomReply reads a byte slice into a InternAtomReply value. +func internAtomReply(buf []byte) *InternAtomReply { + v := new(InternAtomReply) b := 1 // skip reply determinant b += 1 // padding @@ -9062,469 +10974,32 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.EventsLen = xgb.Get32(buf[b:]) + v.Atom = Atom(xgb.Get32(buf[b:])) b += 4 - b += 20 // padding - - v.Events = make([]Timecoord, v.EventsLen) - b += TimecoordReadList(buf[b:], v.Events) - return v } -// Write request to wire for GetMotionEvents -// getMotionEventsRequest writes a GetMotionEvents request to a byte slice. -func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) []byte { - size := 16 +// Write request to wire for InternAtom +// internAtomRequest writes a InternAtom request to a byte slice. +func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) - buf[b] = 39 // request opcode + buf[b] = 16 // request opcode b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Start)) - b += 4 - - xgb.Put32(buf[b:], uint32(Stop)) - b += 4 - - return buf -} - -// TranslateCoordinatesCookie is a cookie used only for TranslateCoordinates requests. -type TranslateCoordinatesCookie struct { - *xgb.Cookie -} - -// TranslateCoordinates sends a checked request. -// If an error occurs, it will be returned with the reply by calling TranslateCoordinatesCookie.Reply() -func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) - return TranslateCoordinatesCookie{cookie} -} - -// TranslateCoordinatesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) - return TranslateCoordinatesCookie{cookie} -} - -// TranslateCoordinatesReply represents the data returned from a TranslateCoordinates request. -type TranslateCoordinatesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - SameScreen bool - Child Window - DstX int16 - DstY int16 -} - -// Reply blocks and returns the reply data for a TranslateCoordinates request. -func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return translateCoordinatesReply(buf), nil -} - -// translateCoordinatesReply reads a byte slice into a TranslateCoordinatesReply value. -func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { - v := new(TranslateCoordinatesReply) - b := 1 // skip reply determinant - - if buf[b] == 1 { - v.SameScreen = true + if OnlyIfExists { + buf[b] = 1 } else { - v.SameScreen = false + buf[b] = 0 } b += 1 - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Child = Window(xgb.Get32(buf[b:])) - b += 4 - - v.DstX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.DstY = int16(xgb.Get16(buf[b:])) - b += 2 - - return v -} - -// Write request to wire for TranslateCoordinates -// translateCoordinatesRequest writes a TranslateCoordinates request to a byte slice. -func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 40 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(SrcWindow)) - b += 4 - - xgb.Put32(buf[b:], uint32(DstWindow)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - return buf -} - -// WarpPointerCookie is a cookie used only for WarpPointer requests. -type WarpPointerCookie struct { - *xgb.Cookie -} - -// WarpPointer sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func WarpPointer(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) - return WarpPointerCookie{cookie} -} - -// WarpPointerChecked sends a checked request. -// If an error occurs, it can be retrieved using WarpPointerCookie.Check() -func WarpPointerChecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) - return WarpPointerCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook WarpPointerCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for WarpPointer -// warpPointerRequest writes a WarpPointer request to a byte slice. -func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { - size := 24 - b := 0 - buf := make([]byte, size) - - buf[b] = 41 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SrcWindow)) - b += 4 - - xgb.Put32(buf[b:], uint32(DstWindow)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - xgb.Put16(buf[b:], SrcWidth) - b += 2 - - xgb.Put16(buf[b:], SrcHeight) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - return buf -} - -// SetInputFocusCookie is a cookie used only for SetInputFocus requests. -type SetInputFocusCookie struct { - *xgb.Cookie -} - -// SetInputFocus sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) - return SetInputFocusCookie{cookie} -} - -// SetInputFocusChecked sends a checked request. -// If an error occurs, it can be retrieved using SetInputFocusCookie.Check() -func SetInputFocusChecked(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) - return SetInputFocusCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetInputFocusCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetInputFocus -// setInputFocusRequest writes a SetInputFocus request to a byte slice. -func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 42 // request opcode - b += 1 - - buf[b] = RevertTo - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Focus)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// GetInputFocusCookie is a cookie used only for GetInputFocus requests. -type GetInputFocusCookie struct { - *xgb.Cookie -} - -// GetInputFocus sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetInputFocusCookie.Reply() -func GetInputFocus(c *xgb.Conn) GetInputFocusCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getInputFocusRequest(c), cookie) - return GetInputFocusCookie{cookie} -} - -// GetInputFocusUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetInputFocusUnchecked(c *xgb.Conn) GetInputFocusCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getInputFocusRequest(c), cookie) - return GetInputFocusCookie{cookie} -} - -// GetInputFocusReply represents the data returned from a GetInputFocus request. -type GetInputFocusReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - RevertTo byte - Focus Window -} - -// Reply blocks and returns the reply data for a GetInputFocus request. -func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getInputFocusReply(buf), nil -} - -// getInputFocusReply reads a byte slice into a GetInputFocusReply value. -func getInputFocusReply(buf []byte) *GetInputFocusReply { - v := new(GetInputFocusReply) - b := 1 // skip reply determinant - - v.RevertTo = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Focus = Window(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for GetInputFocus -// getInputFocusRequest writes a GetInputFocus request to a byte slice. -func getInputFocusRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 43 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// QueryKeymapCookie is a cookie used only for QueryKeymap requests. -type QueryKeymapCookie struct { - *xgb.Cookie -} - -// QueryKeymap sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryKeymapCookie.Reply() -func QueryKeymap(c *xgb.Conn) QueryKeymapCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryKeymapRequest(c), cookie) - return QueryKeymapCookie{cookie} -} - -// QueryKeymapUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryKeymapUnchecked(c *xgb.Conn) QueryKeymapCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryKeymapRequest(c), cookie) - return QueryKeymapCookie{cookie} -} - -// QueryKeymapReply represents the data returned from a QueryKeymap request. -type QueryKeymapReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Keys []byte // size: 32 -} - -// Reply blocks and returns the reply data for a QueryKeymap request. -func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryKeymapReply(buf), nil -} - -// queryKeymapReply reads a byte slice into a QueryKeymapReply value. -func queryKeymapReply(buf []byte) *QueryKeymapReply { - v := new(QueryKeymapReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Keys = make([]byte, 32) - copy(v.Keys[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return v -} - -// Write request to wire for QueryKeymap -// queryKeymapRequest writes a QueryKeymap request to a byte slice. -func queryKeymapRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 44 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// OpenFontCookie is a cookie used only for OpenFont requests. -type OpenFontCookie struct { - *xgb.Cookie -} - -// OpenFont sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) - return OpenFontCookie{cookie} -} - -// OpenFontChecked sends a checked request. -// If an error occurs, it can be retrieved using OpenFontCookie.Check() -func OpenFontChecked(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) - return OpenFontCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook OpenFontCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for OpenFont -// openFontRequest writes a OpenFont request to a byte slice. -func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { - size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 45 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fid)) - b += 4 - xgb.Put16(buf[b:], NameLen) b += 2 @@ -9536,41 +11011,41 @@ func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte return buf } -// CloseFontCookie is a cookie used only for CloseFont requests. -type CloseFontCookie struct { +// KillClientCookie is a cookie used only for KillClient requests. +type KillClientCookie struct { *xgb.Cookie } -// CloseFont sends an unchecked request. +// KillClient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { +func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(false, false) - c.NewRequest(closeFontRequest(c, Font), cookie) - return CloseFontCookie{cookie} + c.NewRequest(killClientRequest(c, Resource), cookie) + return KillClientCookie{cookie} } -// CloseFontChecked sends a checked request. -// If an error occurs, it can be retrieved using CloseFontCookie.Check() -func CloseFontChecked(c *xgb.Conn, Font Font) CloseFontCookie { +// KillClientChecked sends a checked request. +// If an error occurs, it can be retrieved using KillClientCookie.Check() +func KillClientChecked(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(true, false) - c.NewRequest(closeFontRequest(c, Font), cookie) - return CloseFontCookie{cookie} + c.NewRequest(killClientRequest(c, Resource), cookie) + return KillClientCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CloseFontCookie) Check() error { +func (cook KillClientCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for CloseFont -// closeFontRequest writes a CloseFont request to a byte slice. -func closeFontRequest(c *xgb.Conn, Font Font) []byte { +// Write request to wire for KillClient +// killClientRequest writes a KillClient request to a byte slice. +func killClientRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 buf := make([]byte, size) - buf[b] = 46 // request opcode + buf[b] = 113 // request opcode b += 1 b += 1 // padding @@ -9578,59 +11053,44 @@ func closeFontRequest(c *xgb.Conn, Font Font) []byte { xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Font)) + xgb.Put32(buf[b:], Resource) b += 4 return buf } -// QueryFontCookie is a cookie used only for QueryFont requests. -type QueryFontCookie struct { +// ListExtensionsCookie is a cookie used only for ListExtensions requests. +type ListExtensionsCookie struct { *xgb.Cookie } -// QueryFont sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryFontCookie.Reply() -func QueryFont(c *xgb.Conn, Font Fontable) QueryFontCookie { +// ListExtensions sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListExtensionsCookie.Reply() +func ListExtensions(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(true, true) - c.NewRequest(queryFontRequest(c, Font), cookie) - return QueryFontCookie{cookie} + c.NewRequest(listExtensionsRequest(c), cookie) + return ListExtensionsCookie{cookie} } -// QueryFontUnchecked sends an unchecked request. +// ListExtensionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryFontUnchecked(c *xgb.Conn, Font Fontable) QueryFontCookie { +func ListExtensionsUnchecked(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(false, true) - c.NewRequest(queryFontRequest(c, Font), cookie) - return QueryFontCookie{cookie} + c.NewRequest(listExtensionsRequest(c), cookie) + return ListExtensionsCookie{cookie} } -// QueryFontReply represents the data returned from a QueryFont request. -type QueryFontReply struct { +// ListExtensionsReply represents the data returned from a ListExtensions request. +type ListExtensionsReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply - // padding: 1 bytes - MinBounds Charinfo - // padding: 4 bytes - MaxBounds Charinfo - // padding: 4 bytes - MinCharOrByte2 uint16 - MaxCharOrByte2 uint16 - DefaultChar uint16 - PropertiesLen uint16 - DrawDirection byte - MinByte1 byte - MaxByte1 byte - AllCharsExist bool - FontAscent int16 - FontDescent int16 - CharInfosLen uint32 - Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) - CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) + NamesLen byte + // padding: 24 bytes + Names []Str // size: StrListSize(Names) } -// Reply blocks and returns the reply data for a QueryFont request. -func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { +// Reply blocks and returns the reply data for a ListExtensions request. +func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -9638,152 +11098,15 @@ func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { if buf == nil { return nil, nil } - return queryFontReply(buf), nil + return listExtensionsReply(buf), nil } -// queryFontReply reads a byte slice into a QueryFontReply value. -func queryFontReply(buf []byte) *QueryFontReply { - v := new(QueryFontReply) +// listExtensionsReply reads a byte slice into a ListExtensionsReply value. +func listExtensionsReply(buf []byte) *ListExtensionsReply { + v := new(ListExtensionsReply) b := 1 // skip reply determinant - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MinBounds = Charinfo{} - b += CharinfoRead(buf[b:], &v.MinBounds) - - b += 4 // padding - - v.MaxBounds = Charinfo{} - b += CharinfoRead(buf[b:], &v.MaxBounds) - - b += 4 // padding - - v.MinCharOrByte2 = xgb.Get16(buf[b:]) - b += 2 - - v.MaxCharOrByte2 = xgb.Get16(buf[b:]) - b += 2 - - v.DefaultChar = xgb.Get16(buf[b:]) - b += 2 - - v.PropertiesLen = xgb.Get16(buf[b:]) - b += 2 - - v.DrawDirection = buf[b] - b += 1 - - v.MinByte1 = buf[b] - b += 1 - - v.MaxByte1 = buf[b] - b += 1 - - if buf[b] == 1 { - v.AllCharsExist = true - } else { - v.AllCharsExist = false - } - b += 1 - - v.FontAscent = int16(xgb.Get16(buf[b:])) - b += 2 - - v.FontDescent = int16(xgb.Get16(buf[b:])) - b += 2 - - v.CharInfosLen = xgb.Get32(buf[b:]) - b += 4 - - v.Properties = make([]Fontprop, v.PropertiesLen) - b += FontpropReadList(buf[b:], v.Properties) - - v.CharInfos = make([]Charinfo, v.CharInfosLen) - b += CharinfoReadList(buf[b:], v.CharInfos) - - return v -} - -// Write request to wire for QueryFont -// queryFontRequest writes a QueryFont request to a byte slice. -func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 47 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Font)) - b += 4 - - return buf -} - -// QueryTextExtentsCookie is a cookie used only for QueryTextExtents requests. -type QueryTextExtentsCookie struct { - *xgb.Cookie -} - -// QueryTextExtents sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryTextExtentsCookie.Reply() -func QueryTextExtents(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) - return QueryTextExtentsCookie{cookie} -} - -// QueryTextExtentsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryTextExtentsUnchecked(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) - return QueryTextExtentsCookie{cookie} -} - -// QueryTextExtentsReply represents the data returned from a QueryTextExtents request. -type QueryTextExtentsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - DrawDirection byte - FontAscent int16 - FontDescent int16 - OverallAscent int16 - OverallDescent int16 - OverallWidth int32 - OverallLeft int32 - OverallRight int32 -} - -// Reply blocks and returns the reply data for a QueryTextExtents request. -func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryTextExtentsReply(buf), nil -} - -// queryTextExtentsReply reads a byte slice into a QueryTextExtentsReply value. -func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { - v := new(QueryTextExtentsReply) - b := 1 // skip reply determinant - - v.DrawDirection = buf[b] + v.NamesLen = buf[b] b += 1 v.Sequence = xgb.Get16(buf[b:]) @@ -9792,53 +11115,28 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.FontAscent = int16(xgb.Get16(buf[b:])) - b += 2 + b += 24 // padding - v.FontDescent = int16(xgb.Get16(buf[b:])) - b += 2 - - v.OverallAscent = int16(xgb.Get16(buf[b:])) - b += 2 - - v.OverallDescent = int16(xgb.Get16(buf[b:])) - b += 2 - - v.OverallWidth = int32(xgb.Get32(buf[b:])) - b += 4 - - v.OverallLeft = int32(xgb.Get32(buf[b:])) - b += 4 - - v.OverallRight = int32(xgb.Get32(buf[b:])) - b += 4 + v.Names = make([]Str, v.NamesLen) + b += StrReadList(buf[b:], v.Names) return v } -// Write request to wire for QueryTextExtents -// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice. -func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { - size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) +// Write request to wire for ListExtensions +// listExtensionsRequest writes a ListExtensions request to a byte slice. +func listExtensionsRequest(c *xgb.Conn) []byte { + size := 4 b := 0 buf := make([]byte, size) - buf[b] = 48 // request opcode - b += 1 - - buf[b] = byte((int(StringLen) & 1)) + buf[b] = 99 // request opcode b += 1 + b += 1 // padding xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Font)) - b += 4 - - b += Char2bListBytes(buf[b:], String) - - // skip writing local field: StringLen (2) :: uint16 - return buf } @@ -10094,91 +11392,39 @@ func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, P return buf } -// SetFontPathCookie is a cookie used only for SetFontPath requests. -type SetFontPathCookie struct { +// ListHostsCookie is a cookie used only for ListHosts requests. +type ListHostsCookie struct { *xgb.Cookie } -// SetFontPath sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) - return SetFontPathCookie{cookie} -} - -// SetFontPathChecked sends a checked request. -// If an error occurs, it can be retrieved using SetFontPathCookie.Check() -func SetFontPathChecked(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) - return SetFontPathCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetFontPathCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetFontPath -// setFontPathRequest writes a SetFontPath request to a byte slice. -func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { - size := xgb.Pad((8 + StrListSize(Font))) - b := 0 - buf := make([]byte, size) - - buf[b] = 51 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], FontQty) - b += 2 - - b += 2 // padding - - b += StrListBytes(buf[b:], Font) - - return buf -} - -// GetFontPathCookie is a cookie used only for GetFontPath requests. -type GetFontPathCookie struct { - *xgb.Cookie -} - -// GetFontPath sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetFontPathCookie.Reply() -func GetFontPath(c *xgb.Conn) GetFontPathCookie { +// ListHosts sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListHostsCookie.Reply() +func ListHosts(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(true, true) - c.NewRequest(getFontPathRequest(c), cookie) - return GetFontPathCookie{cookie} + c.NewRequest(listHostsRequest(c), cookie) + return ListHostsCookie{cookie} } -// GetFontPathUnchecked sends an unchecked request. +// ListHostsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetFontPathUnchecked(c *xgb.Conn) GetFontPathCookie { +func ListHostsUnchecked(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(false, true) - c.NewRequest(getFontPathRequest(c), cookie) - return GetFontPathCookie{cookie} + c.NewRequest(listHostsRequest(c), cookie) + return ListHostsCookie{cookie} } -// GetFontPathReply represents the data returned from a GetFontPath request. -type GetFontPathReply struct { +// ListHostsReply represents the data returned from a ListHosts request. +type ListHostsReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply - // padding: 1 bytes - PathLen uint16 + Mode byte + HostsLen uint16 // padding: 22 bytes - Path []Str // size: StrListSize(Path) + Hosts []Host // size: HostListSize(Hosts) } -// Reply blocks and returns the reply data for a GetFontPath request. -func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { +// Reply blocks and returns the reply data for a ListHosts request. +func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -10186,15 +11432,16 @@ func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { if buf == nil { return nil, nil } - return getFontPathReply(buf), nil + return listHostsReply(buf), nil } -// getFontPathReply reads a byte slice into a GetFontPathReply value. -func getFontPathReply(buf []byte) *GetFontPathReply { - v := new(GetFontPathReply) +// listHostsReply reads a byte slice into a ListHostsReply value. +func listHostsReply(buf []byte) *ListHostsReply { + v := new(ListHostsReply) b := 1 // skip reply determinant - b += 1 // padding + v.Mode = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 @@ -10202,25 +11449,25 @@ func getFontPathReply(buf []byte) *GetFontPathReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.PathLen = xgb.Get16(buf[b:]) + v.HostsLen = xgb.Get16(buf[b:]) b += 2 b += 22 // padding - v.Path = make([]Str, v.PathLen) - b += StrReadList(buf[b:], v.Path) + v.Hosts = make([]Host, v.HostsLen) + b += HostReadList(buf[b:], v.Hosts) return v } -// Write request to wire for GetFontPath -// getFontPathRequest writes a GetFontPath request to a byte slice. -func getFontPathRequest(c *xgb.Conn) []byte { +// Write request to wire for ListHosts +// listHostsRequest writes a ListHosts request to a byte slice. +func listHostsRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) - buf[b] = 52 // request opcode + buf[b] = 110 // request opcode b += 1 b += 1 // padding @@ -10230,1761 +11477,6 @@ func getFontPathRequest(c *xgb.Conn) []byte { return buf } -// CreatePixmapCookie is a cookie used only for CreatePixmap requests. -type CreatePixmapCookie struct { - *xgb.Cookie -} - -// CreatePixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) - return CreatePixmapCookie{cookie} -} - -// CreatePixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreatePixmapCookie.Check() -func CreatePixmapChecked(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) - return CreatePixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreatePixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreatePixmap -// createPixmapRequest writes a CreatePixmap request to a byte slice. -func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 53 // request opcode - b += 1 - - buf[b] = Depth - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Pid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - return buf -} - -// FreePixmapCookie is a cookie used only for FreePixmap requests. -type FreePixmapCookie struct { - *xgb.Cookie -} - -// FreePixmap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(freePixmapRequest(c, Pixmap), cookie) - return FreePixmapCookie{cookie} -} - -// FreePixmapChecked sends a checked request. -// If an error occurs, it can be retrieved using FreePixmapCookie.Check() -func FreePixmapChecked(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(freePixmapRequest(c, Pixmap), cookie) - return FreePixmapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreePixmapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreePixmap -// freePixmapRequest writes a FreePixmap request to a byte slice. -func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 54 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Pixmap)) - b += 4 - - return buf -} - -// CreateGCCookie is a cookie used only for CreateGC requests. -type CreateGCCookie struct { - *xgb.Cookie -} - -// CreateGC sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) - return CreateGCCookie{cookie} -} - -// CreateGCChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateGCCookie.Check() -func CreateGCChecked(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) - return CreateGCCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateGCCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateGC -// createGCRequest writes a CreateGC request to a byte slice. -func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = 55 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeGCCookie is a cookie used only for ChangeGC requests. -type ChangeGCCookie struct { - *xgb.Cookie -} - -// ChangeGC sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) - return ChangeGCCookie{cookie} -} - -// ChangeGCChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeGCCookie.Check() -func ChangeGCChecked(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) - return ChangeGCCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeGCCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeGC -// changeGCRequest writes a ChangeGC request to a byte slice. -func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = 56 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// CopyGCCookie is a cookie used only for CopyGC requests. -type CopyGCCookie struct { - *xgb.Cookie -} - -// CopyGC sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyGC(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) - return CopyGCCookie{cookie} -} - -// CopyGCChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyGCCookie.Check() -func CopyGCChecked(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) - return CopyGCCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyGCCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyGC -// copyGCRequest writes a CopyGC request to a byte slice. -func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 57 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SrcGc)) - b += 4 - - xgb.Put32(buf[b:], uint32(DstGc)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - - return buf -} - -// SetDashesCookie is a cookie used only for SetDashes requests. -type SetDashesCookie struct { - *xgb.Cookie -} - -// SetDashes sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) - return SetDashesCookie{cookie} -} - -// SetDashesChecked sends a checked request. -// If an error occurs, it can be retrieved using SetDashesCookie.Check() -func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) - return SetDashesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetDashesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetDashes -// setDashesRequest writes a SetDashes request to a byte slice. -func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { - size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 58 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], DashOffset) - b += 2 - - xgb.Put16(buf[b:], DashesLen) - b += 2 - - copy(buf[b:], Dashes[:DashesLen]) - b += xgb.Pad(int(DashesLen)) - - return buf -} - -// SetClipRectanglesCookie is a cookie used only for SetClipRectangles requests. -type SetClipRectanglesCookie struct { - *xgb.Cookie -} - -// SetClipRectangles sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return SetClipRectanglesCookie{cookie} -} - -// SetClipRectanglesChecked sends a checked request. -// If an error occurs, it can be retrieved using SetClipRectanglesCookie.Check() -func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) - return SetClipRectanglesCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetClipRectanglesCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetClipRectangles -// setClipRectanglesRequest writes a SetClipRectangles request to a byte slice. -func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 59 // request opcode - b += 1 - - buf[b] = Ordering - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(ClipXOrigin)) - b += 2 - - xgb.Put16(buf[b:], uint16(ClipYOrigin)) - b += 2 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// FreeGCCookie is a cookie used only for FreeGC requests. -type FreeGCCookie struct { - *xgb.Cookie -} - -// FreeGC sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(freeGCRequest(c, Gc), cookie) - return FreeGCCookie{cookie} -} - -// FreeGCChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeGCCookie.Check() -func FreeGCChecked(c *xgb.Conn, Gc Gcontext) FreeGCCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(freeGCRequest(c, Gc), cookie) - return FreeGCCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeGCCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeGC -// freeGCRequest writes a FreeGC request to a byte slice. -func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 60 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - return buf -} - -// ClearAreaCookie is a cookie used only for ClearArea requests. -type ClearAreaCookie struct { - *xgb.Cookie -} - -// ClearArea sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) - return ClearAreaCookie{cookie} -} - -// ClearAreaChecked sends a checked request. -// If an error occurs, it can be retrieved using ClearAreaCookie.Check() -func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) - return ClearAreaCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ClearAreaCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ClearArea -// clearAreaRequest writes a ClearArea request to a byte slice. -func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 61 // request opcode - b += 1 - - if Exposures { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - return buf -} - -// CopyAreaCookie is a cookie used only for CopyArea requests. -type CopyAreaCookie struct { - *xgb.Cookie -} - -// CopyArea sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyArea(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) - return CopyAreaCookie{cookie} -} - -// CopyAreaChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyAreaCookie.Check() -func CopyAreaChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) - return CopyAreaCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyAreaCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyArea -// copyAreaRequest writes a CopyArea request to a byte slice. -func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { - size := 28 - b := 0 - buf := make([]byte, size) - - buf[b] = 62 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SrcDrawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(DstDrawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - return buf -} - -// CopyPlaneCookie is a cookie used only for CopyPlane requests. -type CopyPlaneCookie struct { - *xgb.Cookie -} - -// CopyPlane sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyPlane(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) - return CopyPlaneCookie{cookie} -} - -// CopyPlaneChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyPlaneCookie.Check() -func CopyPlaneChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) - return CopyPlaneCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyPlaneCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyPlane -// copyPlaneRequest writes a CopyPlane request to a byte slice. -func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = 63 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SrcDrawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(DstDrawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - xgb.Put32(buf[b:], BitPlane) - b += 4 - - return buf -} - -// PolyPointCookie is a cookie used only for PolyPoint requests. -type PolyPointCookie struct { - *xgb.Cookie -} - -// PolyPoint sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) - return PolyPointCookie{cookie} -} - -// PolyPointChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyPointCookie.Check() -func PolyPointChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) - return PolyPointCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyPointCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyPoint -// polyPointRequest writes a PolyPoint request to a byte slice. -func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 64 // request opcode - b += 1 - - buf[b] = CoordinateMode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += PointListBytes(buf[b:], Points) - - return buf -} - -// PolyLineCookie is a cookie used only for PolyLine requests. -type PolyLineCookie struct { - *xgb.Cookie -} - -// PolyLine sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) - return PolyLineCookie{cookie} -} - -// PolyLineChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyLineCookie.Check() -func PolyLineChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) - return PolyLineCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyLineCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyLine -// polyLineRequest writes a PolyLine request to a byte slice. -func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 65 // request opcode - b += 1 - - buf[b] = CoordinateMode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += PointListBytes(buf[b:], Points) - - return buf -} - -// PolySegmentCookie is a cookie used only for PolySegment requests. -type PolySegmentCookie struct { - *xgb.Cookie -} - -// PolySegment sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) - return PolySegmentCookie{cookie} -} - -// PolySegmentChecked sends a checked request. -// If an error occurs, it can be retrieved using PolySegmentCookie.Check() -func PolySegmentChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) - return PolySegmentCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolySegmentCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolySegment -// polySegmentRequest writes a PolySegment request to a byte slice. -func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 66 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += SegmentListBytes(buf[b:], Segments) - - return buf -} - -// PolyRectangleCookie is a cookie used only for PolyRectangle requests. -type PolyRectangleCookie struct { - *xgb.Cookie -} - -// PolyRectangle sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) - return PolyRectangleCookie{cookie} -} - -// PolyRectangleChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyRectangleCookie.Check() -func PolyRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) - return PolyRectangleCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyRectangleCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyRectangle -// polyRectangleRequest writes a PolyRectangle request to a byte slice. -func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 67 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// PolyArcCookie is a cookie used only for PolyArc requests. -type PolyArcCookie struct { - *xgb.Cookie -} - -// PolyArc sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) - return PolyArcCookie{cookie} -} - -// PolyArcChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyArcCookie.Check() -func PolyArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) - return PolyArcCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyArcCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyArc -// polyArcRequest writes a PolyArc request to a byte slice. -func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 68 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += ArcListBytes(buf[b:], Arcs) - - return buf -} - -// FillPolyCookie is a cookie used only for FillPoly requests. -type FillPolyCookie struct { - *xgb.Cookie -} - -// FillPoly sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) - return FillPolyCookie{cookie} -} - -// FillPolyChecked sends a checked request. -// If an error occurs, it can be retrieved using FillPolyCookie.Check() -func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) - return FillPolyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FillPolyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FillPoly -// fillPolyRequest writes a FillPoly request to a byte slice. -func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 69 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - buf[b] = Shape - b += 1 - - buf[b] = CoordinateMode - b += 1 - - b += 2 // padding - - b += PointListBytes(buf[b:], Points) - - return buf -} - -// PolyFillRectangleCookie is a cookie used only for PolyFillRectangle requests. -type PolyFillRectangleCookie struct { - *xgb.Cookie -} - -// PolyFillRectangle sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) - return PolyFillRectangleCookie{cookie} -} - -// PolyFillRectangleChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyFillRectangleCookie.Check() -func PolyFillRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) - return PolyFillRectangleCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyFillRectangleCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyFillRectangle -// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice. -func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 70 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += RectangleListBytes(buf[b:], Rectangles) - - return buf -} - -// PolyFillArcCookie is a cookie used only for PolyFillArc requests. -type PolyFillArcCookie struct { - *xgb.Cookie -} - -// PolyFillArc sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) - return PolyFillArcCookie{cookie} -} - -// PolyFillArcChecked sends a checked request. -// If an error occurs, it can be retrieved using PolyFillArcCookie.Check() -func PolyFillArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) - return PolyFillArcCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyFillArcCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyFillArc -// polyFillArcRequest writes a PolyFillArc request to a byte slice. -func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 71 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - b += ArcListBytes(buf[b:], Arcs) - - return buf -} - -// PutImageCookie is a cookie used only for PutImage requests. -type PutImageCookie struct { - *xgb.Cookie -} - -// PutImage sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) - return PutImageCookie{cookie} -} - -// PutImageChecked sends a checked request. -// If an error occurs, it can be retrieved using PutImageCookie.Check() -func PutImageChecked(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) - return PutImageCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PutImageCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PutImage -// putImageRequest writes a PutImage request to a byte slice. -func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { - size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 72 // request opcode - b += 1 - - buf[b] = Format - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - xgb.Put16(buf[b:], uint16(DstX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DstY)) - b += 2 - - buf[b] = LeftPad - b += 1 - - buf[b] = Depth - b += 1 - - b += 2 // padding - - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) - - return buf -} - -// GetImageCookie is a cookie used only for GetImage requests. -type GetImageCookie struct { - *xgb.Cookie -} - -// GetImage sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() -func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) - return GetImageCookie{cookie} -} - -// GetImageUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetImageUnchecked(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) - return GetImageCookie{cookie} -} - -// GetImageReply represents the data returned from a GetImage request. -type GetImageReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Depth byte - Visual Visualid - // padding: 20 bytes - Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) -} - -// Reply blocks and returns the reply data for a GetImage request. -func (cook GetImageCookie) Reply() (*GetImageReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getImageReply(buf), nil -} - -// getImageReply reads a byte slice into a GetImageReply value. -func getImageReply(buf []byte) *GetImageReply { - v := new(GetImageReply) - b := 1 // skip reply determinant - - v.Depth = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Visual = Visualid(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding - - v.Data = make([]byte, (int(v.Length) * 4)) - copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) - - return v -} - -// Write request to wire for GetImage -// getImageRequest writes a GetImage request to a byte slice. -func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = 73 // request opcode - b += 1 - - buf[b] = Format - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - xgb.Put32(buf[b:], PlaneMask) - b += 4 - - return buf -} - -// PolyText8Cookie is a cookie used only for PolyText8 requests. -type PolyText8Cookie struct { - *xgb.Cookie -} - -// PolyText8 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) - return PolyText8Cookie{cookie} -} - -// PolyText8Checked sends a checked request. -// If an error occurs, it can be retrieved using PolyText8Cookie.Check() -func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) - return PolyText8Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyText8Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyText8 -// polyText8Request writes a PolyText8 request to a byte slice. -func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 74 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - copy(buf[b:], Items[:len(Items)]) - b += xgb.Pad(int(len(Items))) - - return buf -} - -// PolyText16Cookie is a cookie used only for PolyText16 requests. -type PolyText16Cookie struct { - *xgb.Cookie -} - -// PolyText16 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { - cookie := c.NewCookie(false, false) - c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) - return PolyText16Cookie{cookie} -} - -// PolyText16Checked sends a checked request. -// If an error occurs, it can be retrieved using PolyText16Cookie.Check() -func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { - cookie := c.NewCookie(true, false) - c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) - return PolyText16Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PolyText16Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PolyText16 -// polyText16Request writes a PolyText16 request to a byte slice. -func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { - size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 75 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - copy(buf[b:], Items[:len(Items)]) - b += xgb.Pad(int(len(Items))) - - return buf -} - -// ImageText8Cookie is a cookie used only for ImageText8 requests. -type ImageText8Cookie struct { - *xgb.Cookie -} - -// ImageText8 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { - cookie := c.NewCookie(false, false) - c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText8Cookie{cookie} -} - -// ImageText8Checked sends a checked request. -// If an error occurs, it can be retrieved using ImageText8Cookie.Check() -func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { - cookie := c.NewCookie(true, false) - c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText8Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ImageText8Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ImageText8 -// imageText8Request writes a ImageText8 request to a byte slice. -func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { - size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 76 // request opcode - b += 1 - - buf[b] = StringLen - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - copy(buf[b:], String[:StringLen]) - b += xgb.Pad(int(StringLen)) - - return buf -} - -// ImageText16Cookie is a cookie used only for ImageText16 requests. -type ImageText16Cookie struct { - *xgb.Cookie -} - -// ImageText16 sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { - cookie := c.NewCookie(false, false) - c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText16Cookie{cookie} -} - -// ImageText16Checked sends a checked request. -// If an error occurs, it can be retrieved using ImageText16Cookie.Check() -func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { - cookie := c.NewCookie(true, false) - c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) - return ImageText16Cookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ImageText16Cookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ImageText16 -// imageText16Request writes a ImageText16 request to a byte slice. -func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { - size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 77 // request opcode - b += 1 - - buf[b] = StringLen - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(X)) - b += 2 - - xgb.Put16(buf[b:], uint16(Y)) - b += 2 - - b += Char2bListBytes(buf[b:], String) - - return buf -} - -// CreateColormapCookie is a cookie used only for CreateColormap requests. -type CreateColormapCookie struct { - *xgb.Cookie -} - -// CreateColormap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) - return CreateColormapCookie{cookie} -} - -// CreateColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateColormapCookie.Check() -func CreateColormapChecked(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) - return CreateColormapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateColormapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateColormap -// createColormapRequest writes a CreateColormap request to a byte slice. -func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 78 // request opcode - b += 1 - - buf[b] = Alloc - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Mid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put32(buf[b:], uint32(Visual)) - b += 4 - - return buf -} - -// FreeColormapCookie is a cookie used only for FreeColormap requests. -type FreeColormapCookie struct { - *xgb.Cookie -} - -// FreeColormap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(freeColormapRequest(c, Cmap), cookie) - return FreeColormapCookie{cookie} -} - -// FreeColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeColormapCookie.Check() -func FreeColormapChecked(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(freeColormapRequest(c, Cmap), cookie) - return FreeColormapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeColormapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeColormap -// freeColormapRequest writes a FreeColormap request to a byte slice. -func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 79 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - return buf -} - -// CopyColormapAndFreeCookie is a cookie used only for CopyColormapAndFree requests. -type CopyColormapAndFreeCookie struct { - *xgb.Cookie -} - -// CopyColormapAndFree sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CopyColormapAndFree(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) - return CopyColormapAndFreeCookie{cookie} -} - -// CopyColormapAndFreeChecked sends a checked request. -// If an error occurs, it can be retrieved using CopyColormapAndFreeCookie.Check() -func CopyColormapAndFreeChecked(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) - return CopyColormapAndFreeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CopyColormapAndFreeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CopyColormapAndFree -// copyColormapAndFreeRequest writes a CopyColormapAndFree request to a byte slice. -func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 80 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Mid)) - b += 4 - - xgb.Put32(buf[b:], uint32(SrcCmap)) - b += 4 - - return buf -} - -// InstallColormapCookie is a cookie used only for InstallColormap requests. -type InstallColormapCookie struct { - *xgb.Cookie -} - -// InstallColormap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(installColormapRequest(c, Cmap), cookie) - return InstallColormapCookie{cookie} -} - -// InstallColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using InstallColormapCookie.Check() -func InstallColormapChecked(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(installColormapRequest(c, Cmap), cookie) - return InstallColormapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook InstallColormapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for InstallColormap -// installColormapRequest writes a InstallColormap request to a byte slice. -func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 81 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - return buf -} - -// UninstallColormapCookie is a cookie used only for UninstallColormap requests. -type UninstallColormapCookie struct { - *xgb.Cookie -} - -// UninstallColormap sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) - return UninstallColormapCookie{cookie} -} - -// UninstallColormapChecked sends a checked request. -// If an error occurs, it can be retrieved using UninstallColormapCookie.Check() -func UninstallColormapChecked(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) - return UninstallColormapCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UninstallColormapCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UninstallColormap -// uninstallColormapRequest writes a UninstallColormap request to a byte slice. -func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 82 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - return buf -} - // ListInstalledColormapsCookie is a cookie used only for ListInstalledColormaps requests. type ListInstalledColormapsCookie struct { *xgb.Cookie @@ -12077,41 +11569,39 @@ func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// AllocColorCookie is a cookie used only for AllocColor requests. -type AllocColorCookie struct { +// ListPropertiesCookie is a cookie used only for ListProperties requests. +type ListPropertiesCookie struct { *xgb.Cookie } -// AllocColor sends a checked request. -// If an error occurs, it will be returned with the reply by calling AllocColorCookie.Reply() -func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { +// ListProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() +func ListProperties(c *xgb.Conn, Window Window) ListPropertiesCookie { cookie := c.NewCookie(true, true) - c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) - return AllocColorCookie{cookie} + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} } -// AllocColorUnchecked sends an unchecked request. +// ListPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { +func ListPropertiesUnchecked(c *xgb.Conn, Window Window) ListPropertiesCookie { cookie := c.NewCookie(false, true) - c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) - return AllocColorCookie{cookie} + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} } -// AllocColorReply represents the data returned from a AllocColor request. -type AllocColorReply struct { +// ListPropertiesReply represents the data returned from a ListProperties request. +type ListPropertiesReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Red uint16 - Green uint16 - Blue uint16 - // padding: 2 bytes - Pixel uint32 + AtomsLen uint16 + // padding: 22 bytes + Atoms []Atom // size: xgb.Pad((int(AtomsLen) * 4)) } -// Reply blocks and returns the reply data for a AllocColor request. -func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { +// Reply blocks and returns the reply data for a ListProperties request. +func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -12119,12 +11609,12 @@ func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { if buf == nil { return nil, nil } - return allocColorReply(buf), nil + return listPropertiesReply(buf), nil } -// allocColorReply reads a byte slice into a AllocColorReply value. -func allocColorReply(buf []byte) *AllocColorReply { - v := new(AllocColorReply) +// listPropertiesReply reads a byte slice into a ListPropertiesReply value. +func listPropertiesReply(buf []byte) *ListPropertiesReply { + v := new(ListPropertiesReply) b := 1 // skip reply determinant b += 1 // padding @@ -12135,31 +11625,29 @@ func allocColorReply(buf []byte) *AllocColorReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Red = xgb.Get16(buf[b:]) + v.AtomsLen = xgb.Get16(buf[b:]) b += 2 - v.Green = xgb.Get16(buf[b:]) - b += 2 + b += 22 // padding - v.Blue = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Pixel = xgb.Get32(buf[b:]) - b += 4 + v.Atoms = make([]Atom, v.AtomsLen) + for i := 0; i < int(v.AtomsLen); i++ { + v.Atoms[i] = Atom(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) return v } -// Write request to wire for AllocColor -// allocColorRequest writes a AllocColor request to a byte slice. -func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { - size := 16 +// Write request to wire for ListProperties +// listPropertiesRequest writes a ListProperties request to a byte slice. +func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { + size := 8 b := 0 buf := make([]byte, size) - buf[b] = 84 // request opcode + buf[b] = 21 // request opcode b += 1 b += 1 // padding @@ -12167,50 +11655,38 @@ func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blu xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Cmap)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - xgb.Put16(buf[b:], Red) - b += 2 - - xgb.Put16(buf[b:], Green) - b += 2 - - xgb.Put16(buf[b:], Blue) - b += 2 - - b += 2 // padding - return buf } -// AllocNamedColorCookie is a cookie used only for AllocNamedColor requests. -type AllocNamedColorCookie struct { +// LookupColorCookie is a cookie used only for LookupColor requests. +type LookupColorCookie struct { *xgb.Cookie } -// AllocNamedColor sends a checked request. -// If an error occurs, it will be returned with the reply by calling AllocNamedColorCookie.Reply() -func AllocNamedColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { +// LookupColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling LookupColorCookie.Reply() +func LookupColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(true, true) - c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) - return AllocNamedColorCookie{cookie} + c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) + return LookupColorCookie{cookie} } -// AllocNamedColorUnchecked sends an unchecked request. +// LookupColorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllocNamedColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { +func LookupColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(false, true) - c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) - return AllocNamedColorCookie{cookie} + c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) + return LookupColorCookie{cookie} } -// AllocNamedColorReply represents the data returned from a AllocNamedColor request. -type AllocNamedColorReply struct { +// LookupColorReply represents the data returned from a LookupColor request. +type LookupColorReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Pixel uint32 ExactRed uint16 ExactGreen uint16 ExactBlue uint16 @@ -12219,8 +11695,8 @@ type AllocNamedColorReply struct { VisualBlue uint16 } -// Reply blocks and returns the reply data for a AllocNamedColor request. -func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { +// Reply blocks and returns the reply data for a LookupColor request. +func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -12228,12 +11704,12 @@ func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { if buf == nil { return nil, nil } - return allocNamedColorReply(buf), nil + return lookupColorReply(buf), nil } -// allocNamedColorReply reads a byte slice into a AllocNamedColorReply value. -func allocNamedColorReply(buf []byte) *AllocNamedColorReply { - v := new(AllocNamedColorReply) +// lookupColorReply reads a byte slice into a LookupColorReply value. +func lookupColorReply(buf []byte) *LookupColorReply { + v := new(LookupColorReply) b := 1 // skip reply determinant b += 1 // padding @@ -12244,9 +11720,6 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Pixel = xgb.Get32(buf[b:]) - b += 4 - v.ExactRed = xgb.Get16(buf[b:]) b += 2 @@ -12268,14 +11741,14 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { return v } -// Write request to wire for AllocNamedColor -// allocNamedColorRequest writes a AllocNamedColor request to a byte slice. -func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { +// Write request to wire for LookupColor +// lookupColorRequest writes a LookupColor request to a byte slice. +func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 buf := make([]byte, size) - buf[b] = 85 // request opcode + buf[b] = 92 // request opcode b += 1 b += 1 // padding @@ -12297,280 +11770,937 @@ func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name str return buf } -// AllocColorCellsCookie is a cookie used only for AllocColorCells requests. -type AllocColorCellsCookie struct { +// MapSubwindowsCookie is a cookie used only for MapSubwindows requests. +type MapSubwindowsCookie struct { *xgb.Cookie } -// AllocColorCells sends a checked request. -// If an error occurs, it will be returned with the reply by calling AllocColorCellsCookie.Reply() -func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) - return AllocColorCellsCookie{cookie} -} - -// AllocColorCellsUnchecked sends an unchecked request. +// MapSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) - return AllocColorCellsCookie{cookie} -} - -// AllocColorCellsReply represents the data returned from a AllocColorCells request. -type AllocColorCellsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - PixelsLen uint16 - MasksLen uint16 - // padding: 20 bytes - Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) - Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) -} - -// Reply blocks and returns the reply data for a AllocColorCells request. -func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return allocColorCellsReply(buf), nil -} - -// allocColorCellsReply reads a byte slice into a AllocColorCellsReply value. -func allocColorCellsReply(buf []byte) *AllocColorCellsReply { - v := new(AllocColorCellsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.PixelsLen = xgb.Get16(buf[b:]) - b += 2 - - v.MasksLen = xgb.Get16(buf[b:]) - b += 2 - - b += 20 // padding - - v.Pixels = make([]uint32, v.PixelsLen) - for i := 0; i < int(v.PixelsLen); i++ { - v.Pixels[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.Masks = make([]uint32, v.MasksLen) - for i := 0; i < int(v.MasksLen); i++ { - v.Masks[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for AllocColorCells -// allocColorCellsRequest writes a AllocColorCells request to a byte slice. -func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 86 // request opcode - b += 1 - - if Contiguous { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - xgb.Put16(buf[b:], Colors) - b += 2 - - xgb.Put16(buf[b:], Planes) - b += 2 - - return buf -} - -// AllocColorPlanesCookie is a cookie used only for AllocColorPlanes requests. -type AllocColorPlanesCookie struct { - *xgb.Cookie -} - -// AllocColorPlanes sends a checked request. -// If an error occurs, it will be returned with the reply by calling AllocColorPlanesCookie.Reply() -func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) - return AllocColorPlanesCookie{cookie} -} - -// AllocColorPlanesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) - return AllocColorPlanesCookie{cookie} -} - -// AllocColorPlanesReply represents the data returned from a AllocColorPlanes request. -type AllocColorPlanesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - PixelsLen uint16 - // padding: 2 bytes - RedMask uint32 - GreenMask uint32 - BlueMask uint32 - // padding: 8 bytes - Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) -} - -// Reply blocks and returns the reply data for a AllocColorPlanes request. -func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return allocColorPlanesReply(buf), nil -} - -// allocColorPlanesReply reads a byte slice into a AllocColorPlanesReply value. -func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { - v := new(AllocColorPlanesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.PixelsLen = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.RedMask = xgb.Get32(buf[b:]) - b += 4 - - v.GreenMask = xgb.Get32(buf[b:]) - b += 4 - - v.BlueMask = xgb.Get32(buf[b:]) - b += 4 - - b += 8 // padding - - v.Pixels = make([]uint32, v.PixelsLen) - for i := 0; i < int(v.PixelsLen); i++ { - v.Pixels[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for AllocColorPlanes -// allocColorPlanesRequest writes a AllocColorPlanes request to a byte slice. -func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = 87 // request opcode - b += 1 - - if Contiguous { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - xgb.Put16(buf[b:], Colors) - b += 2 - - xgb.Put16(buf[b:], Reds) - b += 2 - - xgb.Put16(buf[b:], Greens) - b += 2 - - xgb.Put16(buf[b:], Blues) - b += 2 - - return buf -} - -// FreeColorsCookie is a cookie used only for FreeColors requests. -type FreeColorsCookie struct { - *xgb.Cookie -} - -// FreeColors sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { +func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(false, false) - c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) - return FreeColorsCookie{cookie} + c.NewRequest(mapSubwindowsRequest(c, Window), cookie) + return MapSubwindowsCookie{cookie} } -// FreeColorsChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeColorsCookie.Check() -func FreeColorsChecked(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { +// MapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using MapSubwindowsCookie.Check() +func MapSubwindowsChecked(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(true, false) - c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) - return FreeColorsCookie{cookie} + c.NewRequest(mapSubwindowsRequest(c, Window), cookie) + return MapSubwindowsCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeColorsCookie) Check() error { +func (cook MapSubwindowsCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for FreeColors -// freeColorsRequest writes a FreeColors request to a byte slice. -func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { - size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) +// Write request to wire for MapSubwindows +// mapSubwindowsRequest writes a MapSubwindows request to a byte slice. +func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { + size := 8 b := 0 buf := make([]byte, size) - buf[b] = 88 // request opcode + buf[b] = 9 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// MapWindowCookie is a cookie used only for MapWindow requests. +type MapWindowCookie struct { + *xgb.Cookie +} + +// MapWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(mapWindowRequest(c, Window), cookie) + return MapWindowCookie{cookie} +} + +// MapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using MapWindowCookie.Check() +func MapWindowChecked(c *xgb.Conn, Window Window) MapWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(mapWindowRequest(c, Window), cookie) + return MapWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook MapWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for MapWindow +// mapWindowRequest writes a MapWindow request to a byte slice. +func mapWindowRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 8 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// NoOperationCookie is a cookie used only for NoOperation requests. +type NoOperationCookie struct { + *xgb.Cookie +} + +// NoOperation sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func NoOperation(c *xgb.Conn) NoOperationCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(noOperationRequest(c), cookie) + return NoOperationCookie{cookie} +} + +// NoOperationChecked sends a checked request. +// If an error occurs, it can be retrieved using NoOperationCookie.Check() +func NoOperationChecked(c *xgb.Conn) NoOperationCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(noOperationRequest(c), cookie) + return NoOperationCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook NoOperationCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for NoOperation +// noOperationRequest writes a NoOperation request to a byte slice. +func noOperationRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 127 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// OpenFontCookie is a cookie used only for OpenFont requests. +type OpenFontCookie struct { + *xgb.Cookie +} + +// OpenFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) + return OpenFontCookie{cookie} +} + +// OpenFontChecked sends a checked request. +// If an error occurs, it can be retrieved using OpenFontCookie.Check() +func OpenFontChecked(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) + return OpenFontCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook OpenFontCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for OpenFont +// openFontRequest writes a OpenFont request to a byte slice. +func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 45 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Fid)) + b += 4 + + xgb.Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += xgb.Pad(int(NameLen)) + + return buf +} + +// PolyArcCookie is a cookie used only for PolyArc requests. +type PolyArcCookie struct { + *xgb.Cookie +} + +// PolyArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) + return PolyArcCookie{cookie} +} + +// PolyArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyArcCookie.Check() +func PolyArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) + return PolyArcCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyArcCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyArc +// polyArcRequest writes a PolyArc request to a byte slice. +func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 68 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += ArcListBytes(buf[b:], Arcs) + + return buf +} + +// PolyFillArcCookie is a cookie used only for PolyFillArc requests. +type PolyFillArcCookie struct { + *xgb.Cookie +} + +// PolyFillArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie{cookie} +} + +// PolyFillArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillArcCookie.Check() +func PolyFillArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) + return PolyFillArcCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyFillArcCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyFillArc +// polyFillArcRequest writes a PolyFillArc request to a byte slice. +func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 71 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += ArcListBytes(buf[b:], Arcs) + + return buf +} + +// PolyFillRectangleCookie is a cookie used only for PolyFillRectangle requests. +type PolyFillRectangleCookie struct { + *xgb.Cookie +} + +// PolyFillRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie{cookie} +} + +// PolyFillRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillRectangleCookie.Check() +func PolyFillRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) + return PolyFillRectangleCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyFillRectangleCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyFillRectangle +// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice. +func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 70 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// PolyLineCookie is a cookie used only for PolyLine requests. +type PolyLineCookie struct { + *xgb.Cookie +} + +// PolyLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie{cookie} +} + +// PolyLineChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyLineCookie.Check() +func PolyLineChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) + return PolyLineCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyLineCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyLine +// polyLineRequest writes a PolyLine request to a byte slice. +func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 65 // request opcode + b += 1 + + buf[b] = CoordinateMode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += PointListBytes(buf[b:], Points) + + return buf +} + +// PolyPointCookie is a cookie used only for PolyPoint requests. +type PolyPointCookie struct { + *xgb.Cookie +} + +// PolyPoint sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie{cookie} +} + +// PolyPointChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyPointCookie.Check() +func PolyPointChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) + return PolyPointCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyPointCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyPoint +// polyPointRequest writes a PolyPoint request to a byte slice. +func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 64 // request opcode + b += 1 + + buf[b] = CoordinateMode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += PointListBytes(buf[b:], Points) + + return buf +} + +// PolyRectangleCookie is a cookie used only for PolyRectangle requests. +type PolyRectangleCookie struct { + *xgb.Cookie +} + +// PolyRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie{cookie} +} + +// PolyRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyRectangleCookie.Check() +func PolyRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) + return PolyRectangleCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyRectangleCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyRectangle +// polyRectangleRequest writes a PolyRectangle request to a byte slice. +func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 67 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// PolySegmentCookie is a cookie used only for PolySegment requests. +type PolySegmentCookie struct { + *xgb.Cookie +} + +// PolySegment sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) + return PolySegmentCookie{cookie} +} + +// PolySegmentChecked sends a checked request. +// If an error occurs, it can be retrieved using PolySegmentCookie.Check() +func PolySegmentChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) + return PolySegmentCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolySegmentCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolySegment +// polySegmentRequest writes a PolySegment request to a byte slice. +func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 66 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + b += SegmentListBytes(buf[b:], Segments) + + return buf +} + +// PolyText16Cookie is a cookie used only for PolyText16 requests. +type PolyText16Cookie struct { + *xgb.Cookie +} + +// PolyText16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie{cookie} +} + +// PolyText16Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText16Cookie.Check() +func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) + return PolyText16Cookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyText16Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyText16 +// polyText16Request writes a PolyText16 request to a byte slice. +func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 75 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + copy(buf[b:], Items[:len(Items)]) + b += xgb.Pad(int(len(Items))) + + return buf +} + +// PolyText8Cookie is a cookie used only for PolyText8 requests. +type PolyText8Cookie struct { + *xgb.Cookie +} + +// PolyText8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.NewCookie(false, false) + c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie{cookie} +} + +// PolyText8Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText8Cookie.Check() +func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { + cookie := c.NewCookie(true, false) + c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) + return PolyText8Cookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PolyText8Cookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PolyText8 +// polyText8Request writes a PolyText8 request to a byte slice. +func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 74 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + copy(buf[b:], Items[:len(Items)]) + b += xgb.Pad(int(len(Items))) + + return buf +} + +// PutImageCookie is a cookie used only for PutImage requests. +type PutImageCookie struct { + *xgb.Cookie +} + +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie{cookie} +} + +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() +func PutImageChecked(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) + return PutImageCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PutImageCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. +func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 72 // request opcode + b += 1 + + buf[b] = Format + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + + buf[b] = LeftPad + b += 1 + + buf[b] = Depth + b += 1 + + b += 2 // padding + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// QueryBestSizeCookie is a cookie used only for QueryBestSize requests. +type QueryBestSizeCookie struct { + *xgb.Cookie +} + +// QueryBestSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() +func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie{cookie} +} + +// QueryBestSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) + return QueryBestSizeCookie{cookie} +} + +// QueryBestSizeReply represents the data returned from a QueryBestSize request. +type QueryBestSizeReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Width uint16 + Height uint16 +} + +// Reply blocks and returns the reply data for a QueryBestSize request. +func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryBestSizeReply(buf), nil +} + +// queryBestSizeReply reads a byte slice into a QueryBestSizeReply value. +func queryBestSizeReply(buf []byte) *QueryBestSizeReply { + v := new(QueryBestSizeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for QueryBestSize +// queryBestSizeRequest writes a QueryBestSize request to a byte slice. +func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 97 // request opcode + b += 1 + + buf[b] = Class + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + return buf +} + +// QueryColorsCookie is a cookie used only for QueryColors requests. +type QueryColorsCookie struct { + *xgb.Cookie +} + +// QueryColors sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryColorsCookie.Reply() +func QueryColors(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) + return QueryColorsCookie{cookie} +} + +// QueryColorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryColorsUnchecked(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) + return QueryColorsCookie{cookie} +} + +// QueryColorsReply represents the data returned from a QueryColors request. +type QueryColorsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ColorsLen uint16 + // padding: 22 bytes + Colors []Rgb // size: xgb.Pad((int(ColorsLen) * 8)) +} + +// Reply blocks and returns the reply data for a QueryColors request. +func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryColorsReply(buf), nil +} + +// queryColorsReply reads a byte slice into a QueryColorsReply value. +func queryColorsReply(buf []byte) *QueryColorsReply { + v := new(QueryColorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ColorsLen = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Colors = make([]Rgb, v.ColorsLen) + b += RgbReadList(buf[b:], v.Colors) + + return v +} + +// Write request to wire for QueryColors +// queryColorsRequest writes a QueryColors request to a byte slice. +func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { + size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 91 // request opcode b += 1 b += 1 // padding @@ -12581,9 +12711,6 @@ func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []ui xgb.Put32(buf[b:], uint32(Cmap)) b += 4 - xgb.Put32(buf[b:], PlaneMask) - b += 4 - for i := 0; i < int(len(Pixels)); i++ { xgb.Put32(buf[b:], Pixels[i]) b += 4 @@ -12593,6 +12720,1481 @@ func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []ui return buf } +// QueryExtensionCookie is a cookie used only for QueryExtension requests. +type QueryExtensionCookie struct { + *xgb.Cookie +} + +// QueryExtension sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() +func QueryExtension(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) + return QueryExtensionCookie{cookie} +} + +// QueryExtensionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryExtensionUnchecked(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) + return QueryExtensionCookie{cookie} +} + +// QueryExtensionReply represents the data returned from a QueryExtension request. +type QueryExtensionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Present bool + MajorOpcode byte + FirstEvent byte + FirstError byte +} + +// Reply blocks and returns the reply data for a QueryExtension request. +func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryExtensionReply(buf), nil +} + +// queryExtensionReply reads a byte slice into a QueryExtensionReply value. +func queryExtensionReply(buf []byte) *QueryExtensionReply { + v := new(QueryExtensionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Present = true + } else { + v.Present = false + } + b += 1 + + v.MajorOpcode = buf[b] + b += 1 + + v.FirstEvent = buf[b] + b += 1 + + v.FirstError = buf[b] + b += 1 + + return v +} + +// Write request to wire for QueryExtension +// queryExtensionRequest writes a QueryExtension request to a byte slice. +func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 98 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], NameLen) + b += 2 + + b += 2 // padding + + copy(buf[b:], Name[:NameLen]) + b += xgb.Pad(int(NameLen)) + + return buf +} + +// QueryFontCookie is a cookie used only for QueryFont requests. +type QueryFontCookie struct { + *xgb.Cookie +} + +// QueryFont sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFontCookie.Reply() +func QueryFont(c *xgb.Conn, Font Fontable) QueryFontCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryFontRequest(c, Font), cookie) + return QueryFontCookie{cookie} +} + +// QueryFontUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryFontUnchecked(c *xgb.Conn, Font Fontable) QueryFontCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryFontRequest(c, Font), cookie) + return QueryFontCookie{cookie} +} + +// QueryFontReply represents the data returned from a QueryFont request. +type QueryFontReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + MinBounds Charinfo + // padding: 4 bytes + MaxBounds Charinfo + // padding: 4 bytes + MinCharOrByte2 uint16 + MaxCharOrByte2 uint16 + DefaultChar uint16 + PropertiesLen uint16 + DrawDirection byte + MinByte1 byte + MaxByte1 byte + AllCharsExist bool + FontAscent int16 + FontDescent int16 + CharInfosLen uint32 + Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) + CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) +} + +// Reply blocks and returns the reply data for a QueryFont request. +func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryFontReply(buf), nil +} + +// queryFontReply reads a byte slice into a QueryFontReply value. +func queryFontReply(buf []byte) *QueryFontReply { + v := new(QueryFontReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinBounds = Charinfo{} + b += CharinfoRead(buf[b:], &v.MinBounds) + + b += 4 // padding + + v.MaxBounds = Charinfo{} + b += CharinfoRead(buf[b:], &v.MaxBounds) + + b += 4 // padding + + v.MinCharOrByte2 = xgb.Get16(buf[b:]) + b += 2 + + v.MaxCharOrByte2 = xgb.Get16(buf[b:]) + b += 2 + + v.DefaultChar = xgb.Get16(buf[b:]) + b += 2 + + v.PropertiesLen = xgb.Get16(buf[b:]) + b += 2 + + v.DrawDirection = buf[b] + b += 1 + + v.MinByte1 = buf[b] + b += 1 + + v.MaxByte1 = buf[b] + b += 1 + + if buf[b] == 1 { + v.AllCharsExist = true + } else { + v.AllCharsExist = false + } + b += 1 + + v.FontAscent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.FontDescent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.CharInfosLen = xgb.Get32(buf[b:]) + b += 4 + + v.Properties = make([]Fontprop, v.PropertiesLen) + b += FontpropReadList(buf[b:], v.Properties) + + v.CharInfos = make([]Charinfo, v.CharInfosLen) + b += CharinfoReadList(buf[b:], v.CharInfos) + + return v +} + +// Write request to wire for QueryFont +// queryFontRequest writes a QueryFont request to a byte slice. +func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 47 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Font)) + b += 4 + + return buf +} + +// QueryKeymapCookie is a cookie used only for QueryKeymap requests. +type QueryKeymapCookie struct { + *xgb.Cookie +} + +// QueryKeymap sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryKeymapCookie.Reply() +func QueryKeymap(c *xgb.Conn) QueryKeymapCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryKeymapRequest(c), cookie) + return QueryKeymapCookie{cookie} +} + +// QueryKeymapUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryKeymapUnchecked(c *xgb.Conn) QueryKeymapCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryKeymapRequest(c), cookie) + return QueryKeymapCookie{cookie} +} + +// QueryKeymapReply represents the data returned from a QueryKeymap request. +type QueryKeymapReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Keys []byte // size: 32 +} + +// Reply blocks and returns the reply data for a QueryKeymap request. +func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryKeymapReply(buf), nil +} + +// queryKeymapReply reads a byte slice into a QueryKeymapReply value. +func queryKeymapReply(buf []byte) *QueryKeymapReply { + v := new(QueryKeymapReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Keys = make([]byte, 32) + copy(v.Keys[:32], buf[b:]) + b += xgb.Pad(int(32)) + + return v +} + +// Write request to wire for QueryKeymap +// queryKeymapRequest writes a QueryKeymap request to a byte slice. +func queryKeymapRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 44 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// QueryPointerCookie is a cookie used only for QueryPointer requests. +type QueryPointerCookie struct { + *xgb.Cookie +} + +// QueryPointer sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPointerCookie.Reply() +func QueryPointer(c *xgb.Conn, Window Window) QueryPointerCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryPointerRequest(c, Window), cookie) + return QueryPointerCookie{cookie} +} + +// QueryPointerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryPointerRequest(c, Window), cookie) + return QueryPointerCookie{cookie} +} + +// QueryPointerReply represents the data returned from a QueryPointer request. +type QueryPointerReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + SameScreen bool + Root Window + Child Window + RootX int16 + RootY int16 + WinX int16 + WinY int16 + Mask uint16 + // padding: 2 bytes +} + +// Reply blocks and returns the reply data for a QueryPointer request. +func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryPointerReply(buf), nil +} + +// queryPointerReply reads a byte slice into a QueryPointerReply value. +func queryPointerReply(buf []byte) *QueryPointerReply { + v := new(QueryPointerReply) + b := 1 // skip reply determinant + + if buf[b] == 1 { + v.SameScreen = true + } else { + v.SameScreen = false + } + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Child = Window(xgb.Get32(buf[b:])) + b += 4 + + v.RootX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.RootY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.WinX = int16(xgb.Get16(buf[b:])) + b += 2 + + v.WinY = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Mask = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + return v +} + +// Write request to wire for QueryPointer +// queryPointerRequest writes a QueryPointer request to a byte slice. +func queryPointerRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 38 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// QueryTextExtentsCookie is a cookie used only for QueryTextExtents requests. +type QueryTextExtentsCookie struct { + *xgb.Cookie +} + +// QueryTextExtents sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTextExtentsCookie.Reply() +func QueryTextExtents(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) + return QueryTextExtentsCookie{cookie} +} + +// QueryTextExtentsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryTextExtentsUnchecked(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) + return QueryTextExtentsCookie{cookie} +} + +// QueryTextExtentsReply represents the data returned from a QueryTextExtents request. +type QueryTextExtentsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + DrawDirection byte + FontAscent int16 + FontDescent int16 + OverallAscent int16 + OverallDescent int16 + OverallWidth int32 + OverallLeft int32 + OverallRight int32 +} + +// Reply blocks and returns the reply data for a QueryTextExtents request. +func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryTextExtentsReply(buf), nil +} + +// queryTextExtentsReply reads a byte slice into a QueryTextExtentsReply value. +func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { + v := new(QueryTextExtentsReply) + b := 1 // skip reply determinant + + v.DrawDirection = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.FontAscent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.FontDescent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.OverallAscent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.OverallDescent = int16(xgb.Get16(buf[b:])) + b += 2 + + v.OverallWidth = int32(xgb.Get32(buf[b:])) + b += 4 + + v.OverallLeft = int32(xgb.Get32(buf[b:])) + b += 4 + + v.OverallRight = int32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for QueryTextExtents +// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice. +func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { + size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 48 // request opcode + b += 1 + + buf[b] = byte((int(StringLen) & 1)) + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Font)) + b += 4 + + b += Char2bListBytes(buf[b:], String) + + // skip writing local field: StringLen (2) :: uint16 + + return buf +} + +// QueryTreeCookie is a cookie used only for QueryTree requests. +type QueryTreeCookie struct { + *xgb.Cookie +} + +// QueryTree sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTreeCookie.Reply() +func QueryTree(c *xgb.Conn, Window Window) QueryTreeCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(queryTreeRequest(c, Window), cookie) + return QueryTreeCookie{cookie} +} + +// QueryTreeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryTreeUnchecked(c *xgb.Conn, Window Window) QueryTreeCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(queryTreeRequest(c, Window), cookie) + return QueryTreeCookie{cookie} +} + +// QueryTreeReply represents the data returned from a QueryTree request. +type QueryTreeReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Root Window + Parent Window + ChildrenLen uint16 + // padding: 14 bytes + Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) +} + +// Reply blocks and returns the reply data for a QueryTree request. +func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryTreeReply(buf), nil +} + +// queryTreeReply reads a byte slice into a QueryTreeReply value. +func queryTreeReply(buf []byte) *QueryTreeReply { + v := new(QueryTreeReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Root = Window(xgb.Get32(buf[b:])) + b += 4 + + v.Parent = Window(xgb.Get32(buf[b:])) + b += 4 + + v.ChildrenLen = xgb.Get16(buf[b:]) + b += 2 + + b += 14 // padding + + v.Children = make([]Window, v.ChildrenLen) + for i := 0; i < int(v.ChildrenLen); i++ { + v.Children[i] = Window(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryTree +// queryTreeRequest writes a QueryTree request to a byte slice. +func queryTreeRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 15 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// RecolorCursorCookie is a cookie used only for RecolorCursor requests. +type RecolorCursorCookie struct { + *xgb.Cookie +} + +// RecolorCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie{cookie} +} + +// RecolorCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using RecolorCursorCookie.Check() +func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) + return RecolorCursorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RecolorCursorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RecolorCursor +// recolorCursorRequest writes a RecolorCursor request to a byte slice. +func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { + size := 20 + b := 0 + buf := make([]byte, size) + + buf[b] = 96 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cursor)) + b += 4 + + xgb.Put16(buf[b:], ForeRed) + b += 2 + + xgb.Put16(buf[b:], ForeGreen) + b += 2 + + xgb.Put16(buf[b:], ForeBlue) + b += 2 + + xgb.Put16(buf[b:], BackRed) + b += 2 + + xgb.Put16(buf[b:], BackGreen) + b += 2 + + xgb.Put16(buf[b:], BackBlue) + b += 2 + + return buf +} + +// ReparentWindowCookie is a cookie used only for ReparentWindow requests. +type ReparentWindowCookie struct { + *xgb.Cookie +} + +// ReparentWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ReparentWindow(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) + return ReparentWindowCookie{cookie} +} + +// ReparentWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ReparentWindowCookie.Check() +func ReparentWindowChecked(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) + return ReparentWindowCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ReparentWindowCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ReparentWindow +// reparentWindowRequest writes a ReparentWindow request to a byte slice. +func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 7 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Parent)) + b += 4 + + xgb.Put16(buf[b:], uint16(X)) + b += 2 + + xgb.Put16(buf[b:], uint16(Y)) + b += 2 + + return buf +} + +// RotatePropertiesCookie is a cookie used only for RotateProperties requests. +type RotatePropertiesCookie struct { + *xgb.Cookie +} + +// RotateProperties sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie{cookie} +} + +// RotatePropertiesChecked sends a checked request. +// If an error occurs, it can be retrieved using RotatePropertiesCookie.Check() +func RotatePropertiesChecked(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) + return RotatePropertiesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook RotatePropertiesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for RotateProperties +// rotatePropertiesRequest writes a RotateProperties request to a byte slice. +func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { + size := xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 114 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], AtomsLen) + b += 2 + + xgb.Put16(buf[b:], uint16(Delta)) + b += 2 + + for i := 0; i < int(AtomsLen); i++ { + xgb.Put32(buf[b:], uint32(Atoms[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// SendEventCookie is a cookie used only for SendEvent requests. +type SendEventCookie struct { + *xgb.Cookie +} + +// SendEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie{cookie} +} + +// SendEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendEventCookie.Check() +func SendEventChecked(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) + return SendEventCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SendEventCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SendEvent +// sendEventRequest writes a SendEvent request to a byte slice. +func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { + size := 44 + b := 0 + buf := make([]byte, size) + + buf[b] = 25 // request opcode + b += 1 + + if Propagate { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Destination)) + b += 4 + + xgb.Put32(buf[b:], EventMask) + b += 4 + + copy(buf[b:], Event[:32]) + b += xgb.Pad(int(32)) + + return buf +} + +// SetAccessControlCookie is a cookie used only for SetAccessControl requests. +type SetAccessControlCookie struct { + *xgb.Cookie +} + +// SetAccessControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setAccessControlRequest(c, Mode), cookie) + return SetAccessControlCookie{cookie} +} + +// SetAccessControlChecked sends a checked request. +// If an error occurs, it can be retrieved using SetAccessControlCookie.Check() +func SetAccessControlChecked(c *xgb.Conn, Mode byte) SetAccessControlCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setAccessControlRequest(c, Mode), cookie) + return SetAccessControlCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetAccessControlCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetAccessControl +// setAccessControlRequest writes a SetAccessControl request to a byte slice. +func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 111 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// SetClipRectanglesCookie is a cookie used only for SetClipRectangles requests. +type SetClipRectanglesCookie struct { + *xgb.Cookie +} + +// SetClipRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie{cookie} +} + +// SetClipRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClipRectanglesCookie.Check() +func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) + return SetClipRectanglesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetClipRectanglesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetClipRectangles +// setClipRectanglesRequest writes a SetClipRectangles request to a byte slice. +func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { + size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 59 // request opcode + b += 1 + + buf[b] = Ordering + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(ClipXOrigin)) + b += 2 + + xgb.Put16(buf[b:], uint16(ClipYOrigin)) + b += 2 + + b += RectangleListBytes(buf[b:], Rectangles) + + return buf +} + +// SetCloseDownModeCookie is a cookie used only for SetCloseDownMode requests. +type SetCloseDownModeCookie struct { + *xgb.Cookie +} + +// SetCloseDownMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) + return SetCloseDownModeCookie{cookie} +} + +// SetCloseDownModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCloseDownModeCookie.Check() +func SetCloseDownModeChecked(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) + return SetCloseDownModeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetCloseDownModeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetCloseDownMode +// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice. +func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 112 // request opcode + b += 1 + + buf[b] = Mode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// SetDashesCookie is a cookie used only for SetDashes requests. +type SetDashesCookie struct { + *xgb.Cookie +} + +// SetDashes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie{cookie} +} + +// SetDashesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDashesCookie.Check() +func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) + return SetDashesCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetDashesCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDashes +// setDashesRequest writes a SetDashes request to a byte slice. +func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { + size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 58 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], DashOffset) + b += 2 + + xgb.Put16(buf[b:], DashesLen) + b += 2 + + copy(buf[b:], Dashes[:DashesLen]) + b += xgb.Pad(int(DashesLen)) + + return buf +} + +// SetFontPathCookie is a cookie used only for SetFontPath requests. +type SetFontPathCookie struct { + *xgb.Cookie +} + +// SetFontPath sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) + return SetFontPathCookie{cookie} +} + +// SetFontPathChecked sends a checked request. +// If an error occurs, it can be retrieved using SetFontPathCookie.Check() +func SetFontPathChecked(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) + return SetFontPathCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetFontPathCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetFontPath +// setFontPathRequest writes a SetFontPath request to a byte slice. +func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { + size := xgb.Pad((8 + StrListSize(Font))) + b := 0 + buf := make([]byte, size) + + buf[b] = 51 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], FontQty) + b += 2 + + b += 2 // padding + + b += StrListBytes(buf[b:], Font) + + return buf +} + +// SetInputFocusCookie is a cookie used only for SetInputFocus requests. +type SetInputFocusCookie struct { + *xgb.Cookie +} + +// SetInputFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) + return SetInputFocusCookie{cookie} +} + +// SetInputFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetInputFocusCookie.Check() +func SetInputFocusChecked(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) + return SetInputFocusCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetInputFocusCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetInputFocus +// setInputFocusRequest writes a SetInputFocus request to a byte slice. +func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 42 // request opcode + b += 1 + + buf[b] = RevertTo + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Focus)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// SetModifierMappingCookie is a cookie used only for SetModifierMapping requests. +type SetModifierMappingCookie struct { + *xgb.Cookie +} + +// SetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetModifierMappingCookie.Reply() +func SetModifierMapping(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie{cookie} +} + +// SetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetModifierMappingUnchecked(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) + return SetModifierMappingCookie{cookie} +} + +// SetModifierMappingReply represents the data returned from a SetModifierMapping request. +type SetModifierMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte +} + +// Reply blocks and returns the reply data for a SetModifierMapping request. +func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setModifierMappingReply(buf), nil +} + +// setModifierMappingReply reads a byte slice into a SetModifierMappingReply value. +func setModifierMappingReply(buf []byte) *SetModifierMappingReply { + v := new(SetModifierMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for SetModifierMapping +// setModifierMappingRequest writes a SetModifierMapping request to a byte slice. +func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { + size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 118 // request opcode + b += 1 + + buf[b] = KeycodesPerModifier + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + for i := 0; i < int((int(KeycodesPerModifier) * 8)); i++ { + buf[b] = byte(Keycodes[i]) + b += 1 + } + b = xgb.Pad(b) + + return buf +} + +// SetPointerMappingCookie is a cookie used only for SetPointerMapping requests. +type SetPointerMappingCookie struct { + *xgb.Cookie +} + +// SetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetPointerMappingCookie.Reply() +func SetPointerMapping(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.NewCookie(true, true) + c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) + return SetPointerMappingCookie{cookie} +} + +// SetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPointerMappingUnchecked(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { + cookie := c.NewCookie(false, true) + c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) + return SetPointerMappingCookie{cookie} +} + +// SetPointerMappingReply represents the data returned from a SetPointerMapping request. +type SetPointerMappingReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte +} + +// Reply blocks and returns the reply data for a SetPointerMapping request. +func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return setPointerMappingReply(buf), nil +} + +// setPointerMappingReply reads a byte slice into a SetPointerMappingReply value. +func setPointerMappingReply(buf []byte) *SetPointerMappingReply { + v := new(SetPointerMappingReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for SetPointerMapping +// setPointerMappingRequest writes a SetPointerMapping request to a byte slice. +func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { + size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = 116 // request opcode + b += 1 + + buf[b] = MapLen + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + copy(buf[b:], Map[:MapLen]) + b += xgb.Pad(int(MapLen)) + + return buf +} + +// SetScreenSaverCookie is a cookie used only for SetScreenSaver requests. +type SetScreenSaverCookie struct { + *xgb.Cookie +} + +// SetScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetScreenSaver(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie{cookie} +} + +// SetScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using SetScreenSaverCookie.Check() +func SetScreenSaverChecked(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) + return SetScreenSaverCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetScreenSaverCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetScreenSaver +// setScreenSaverRequest writes a SetScreenSaver request to a byte slice. +func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = 107 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put16(buf[b:], uint16(Timeout)) + b += 2 + + xgb.Put16(buf[b:], uint16(Interval)) + b += 2 + + buf[b] = PreferBlanking + b += 1 + + buf[b] = AllowExposures + b += 1 + + return buf +} + +// SetSelectionOwnerCookie is a cookie used only for SetSelectionOwner requests. +type SetSelectionOwnerCookie struct { + *xgb.Cookie +} + +// SetSelectionOwner sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie{cookie} +} + +// SetSelectionOwnerChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionOwnerCookie.Check() +func SetSelectionOwnerChecked(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) + return SetSelectionOwnerCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetSelectionOwnerCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetSelectionOwner +// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice. +func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = 22 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Owner)) + b += 4 + + xgb.Put32(buf[b:], uint32(Selection)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + // StoreColorsCookie is a cookie used only for StoreColors requests. type StoreColorsCookie struct { *xgb.Cookie @@ -12703,39 +14305,39 @@ func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32 return buf } -// QueryColorsCookie is a cookie used only for QueryColors requests. -type QueryColorsCookie struct { +// TranslateCoordinatesCookie is a cookie used only for TranslateCoordinates requests. +type TranslateCoordinatesCookie struct { *xgb.Cookie } -// QueryColors sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryColorsCookie.Reply() -func QueryColors(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { +// TranslateCoordinates sends a checked request. +// If an error occurs, it will be returned with the reply by calling TranslateCoordinatesCookie.Reply() +func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(true, true) - c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) - return QueryColorsCookie{cookie} + c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie{cookie} } -// QueryColorsUnchecked sends an unchecked request. +// TranslateCoordinatesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryColorsUnchecked(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { +func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(false, true) - c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) - return QueryColorsCookie{cookie} + c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) + return TranslateCoordinatesCookie{cookie} } -// QueryColorsReply represents the data returned from a QueryColors request. -type QueryColorsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ColorsLen uint16 - // padding: 22 bytes - Colors []Rgb // size: xgb.Pad((int(ColorsLen) * 8)) +// TranslateCoordinatesReply represents the data returned from a TranslateCoordinates request. +type TranslateCoordinatesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + SameScreen bool + Child Window + DstX int16 + DstY int16 } -// Reply blocks and returns the reply data for a QueryColors request. -func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { +// Reply blocks and returns the reply data for a TranslateCoordinates request. +func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -12743,850 +14345,47 @@ func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { if buf == nil { return nil, nil } - return queryColorsReply(buf), nil + return translateCoordinatesReply(buf), nil } -// queryColorsReply reads a byte slice into a QueryColorsReply value. -func queryColorsReply(buf []byte) *QueryColorsReply { - v := new(QueryColorsReply) +// translateCoordinatesReply reads a byte slice into a TranslateCoordinatesReply value. +func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { + v := new(TranslateCoordinatesReply) b := 1 // skip reply determinant - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ColorsLen = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Colors = make([]Rgb, v.ColorsLen) - b += RgbReadList(buf[b:], v.Colors) - - return v -} - -// Write request to wire for QueryColors -// queryColorsRequest writes a QueryColors request to a byte slice. -func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { - size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 91 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - for i := 0; i < int(len(Pixels)); i++ { - xgb.Put32(buf[b:], Pixels[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// LookupColorCookie is a cookie used only for LookupColor requests. -type LookupColorCookie struct { - *xgb.Cookie -} - -// LookupColor sends a checked request. -// If an error occurs, it will be returned with the reply by calling LookupColorCookie.Reply() -func LookupColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) - return LookupColorCookie{cookie} -} - -// LookupColorUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func LookupColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) - return LookupColorCookie{cookie} -} - -// LookupColorReply represents the data returned from a LookupColor request. -type LookupColorReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ExactRed uint16 - ExactGreen uint16 - ExactBlue uint16 - VisualRed uint16 - VisualGreen uint16 - VisualBlue uint16 -} - -// Reply blocks and returns the reply data for a LookupColor request. -func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return lookupColorReply(buf), nil -} - -// lookupColorReply reads a byte slice into a LookupColorReply value. -func lookupColorReply(buf []byte) *LookupColorReply { - v := new(LookupColorReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ExactRed = xgb.Get16(buf[b:]) - b += 2 - - v.ExactGreen = xgb.Get16(buf[b:]) - b += 2 - - v.ExactBlue = xgb.Get16(buf[b:]) - b += 2 - - v.VisualRed = xgb.Get16(buf[b:]) - b += 2 - - v.VisualGreen = xgb.Get16(buf[b:]) - b += 2 - - v.VisualBlue = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// Write request to wire for LookupColor -// lookupColorRequest writes a LookupColor request to a byte slice. -func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { - size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 92 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cmap)) - b += 4 - - xgb.Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) - - return buf -} - -// CreateCursorCookie is a cookie used only for CreateCursor requests. -type CreateCursorCookie struct { - *xgb.Cookie -} - -// CreateCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateCursor(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) - return CreateCursorCookie{cookie} -} - -// CreateCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateCursorCookie.Check() -func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) - return CreateCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateCursor -// createCursorRequest writes a CreateCursor request to a byte slice. -func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = 93 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cid)) - b += 4 - - xgb.Put32(buf[b:], uint32(Source)) - b += 4 - - xgb.Put32(buf[b:], uint32(Mask)) - b += 4 - - xgb.Put16(buf[b:], ForeRed) - b += 2 - - xgb.Put16(buf[b:], ForeGreen) - b += 2 - - xgb.Put16(buf[b:], ForeBlue) - b += 2 - - xgb.Put16(buf[b:], BackRed) - b += 2 - - xgb.Put16(buf[b:], BackGreen) - b += 2 - - xgb.Put16(buf[b:], BackBlue) - b += 2 - - xgb.Put16(buf[b:], X) - b += 2 - - xgb.Put16(buf[b:], Y) - b += 2 - - return buf -} - -// CreateGlyphCursorCookie is a cookie used only for CreateGlyphCursor requests. -type CreateGlyphCursorCookie struct { - *xgb.Cookie -} - -// CreateGlyphCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return CreateGlyphCursorCookie{cookie} -} - -// CreateGlyphCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateGlyphCursorCookie.Check() -func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return CreateGlyphCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateGlyphCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateGlyphCursor -// createGlyphCursorRequest writes a CreateGlyphCursor request to a byte slice. -func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = 94 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cid)) - b += 4 - - xgb.Put32(buf[b:], uint32(SourceFont)) - b += 4 - - xgb.Put32(buf[b:], uint32(MaskFont)) - b += 4 - - xgb.Put16(buf[b:], SourceChar) - b += 2 - - xgb.Put16(buf[b:], MaskChar) - b += 2 - - xgb.Put16(buf[b:], ForeRed) - b += 2 - - xgb.Put16(buf[b:], ForeGreen) - b += 2 - - xgb.Put16(buf[b:], ForeBlue) - b += 2 - - xgb.Put16(buf[b:], BackRed) - b += 2 - - xgb.Put16(buf[b:], BackGreen) - b += 2 - - xgb.Put16(buf[b:], BackBlue) - b += 2 - - return buf -} - -// FreeCursorCookie is a cookie used only for FreeCursor requests. -type FreeCursorCookie struct { - *xgb.Cookie -} - -// FreeCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(freeCursorRequest(c, Cursor), cookie) - return FreeCursorCookie{cookie} -} - -// FreeCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using FreeCursorCookie.Check() -func FreeCursorChecked(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(freeCursorRequest(c, Cursor), cookie) - return FreeCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook FreeCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for FreeCursor -// freeCursorRequest writes a FreeCursor request to a byte slice. -func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = 95 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - return buf -} - -// RecolorCursorCookie is a cookie used only for RecolorCursor requests. -type RecolorCursorCookie struct { - *xgb.Cookie -} - -// RecolorCursor sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return RecolorCursorCookie{cookie} -} - -// RecolorCursorChecked sends a checked request. -// If an error occurs, it can be retrieved using RecolorCursorCookie.Check() -func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) - return RecolorCursorCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RecolorCursorCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for RecolorCursor -// recolorCursorRequest writes a RecolorCursor request to a byte slice. -func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { - size := 20 - b := 0 - buf := make([]byte, size) - - buf[b] = 96 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Cursor)) - b += 4 - - xgb.Put16(buf[b:], ForeRed) - b += 2 - - xgb.Put16(buf[b:], ForeGreen) - b += 2 - - xgb.Put16(buf[b:], ForeBlue) - b += 2 - - xgb.Put16(buf[b:], BackRed) - b += 2 - - xgb.Put16(buf[b:], BackGreen) - b += 2 - - xgb.Put16(buf[b:], BackBlue) - b += 2 - - return buf -} - -// QueryBestSizeCookie is a cookie used only for QueryBestSize requests. -type QueryBestSizeCookie struct { - *xgb.Cookie -} - -// QueryBestSize sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() -func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) - return QueryBestSizeCookie{cookie} -} - -// QueryBestSizeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) - return QueryBestSizeCookie{cookie} -} - -// QueryBestSizeReply represents the data returned from a QueryBestSize request. -type QueryBestSizeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Width uint16 - Height uint16 -} - -// Reply blocks and returns the reply data for a QueryBestSize request. -func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryBestSizeReply(buf), nil -} - -// queryBestSizeReply reads a byte slice into a QueryBestSizeReply value. -func queryBestSizeReply(buf []byte) *QueryBestSizeReply { - v := new(QueryBestSizeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Width = xgb.Get16(buf[b:]) - b += 2 - - v.Height = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// Write request to wire for QueryBestSize -// queryBestSizeRequest writes a QueryBestSize request to a byte slice. -func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = 97 // request opcode - b += 1 - - buf[b] = Class - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - return buf -} - -// QueryExtensionCookie is a cookie used only for QueryExtension requests. -type QueryExtensionCookie struct { - *xgb.Cookie -} - -// QueryExtension sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() -func QueryExtension(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) - return QueryExtensionCookie{cookie} -} - -// QueryExtensionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryExtensionUnchecked(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) - return QueryExtensionCookie{cookie} -} - -// QueryExtensionReply represents the data returned from a QueryExtension request. -type QueryExtensionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Present bool - MajorOpcode byte - FirstEvent byte - FirstError byte -} - -// Reply blocks and returns the reply data for a QueryExtension request. -func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryExtensionReply(buf), nil -} - -// queryExtensionReply reads a byte slice into a QueryExtensionReply value. -func queryExtensionReply(buf []byte) *QueryExtensionReply { - v := new(QueryExtensionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - if buf[b] == 1 { - v.Present = true + v.SameScreen = true } else { - v.Present = false + v.SameScreen = false } b += 1 - v.MajorOpcode = buf[b] - b += 1 - - v.FirstEvent = buf[b] - b += 1 - - v.FirstError = buf[b] - b += 1 - - return v -} - -// Write request to wire for QueryExtension -// queryExtensionRequest writes a QueryExtension request to a byte slice. -func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 98 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) - - return buf -} - -// ListExtensionsCookie is a cookie used only for ListExtensions requests. -type ListExtensionsCookie struct { - *xgb.Cookie -} - -// ListExtensions sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListExtensionsCookie.Reply() -func ListExtensions(c *xgb.Conn) ListExtensionsCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(listExtensionsRequest(c), cookie) - return ListExtensionsCookie{cookie} -} - -// ListExtensionsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListExtensionsUnchecked(c *xgb.Conn) ListExtensionsCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(listExtensionsRequest(c), cookie) - return ListExtensionsCookie{cookie} -} - -// ListExtensionsReply represents the data returned from a ListExtensions request. -type ListExtensionsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - NamesLen byte - // padding: 24 bytes - Names []Str // size: StrListSize(Names) -} - -// Reply blocks and returns the reply data for a ListExtensions request. -func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listExtensionsReply(buf), nil -} - -// listExtensionsReply reads a byte slice into a ListExtensionsReply value. -func listExtensionsReply(buf []byte) *ListExtensionsReply { - v := new(ListExtensionsReply) - b := 1 // skip reply determinant - - v.NamesLen = buf[b] - b += 1 - v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - b += 24 // padding - - v.Names = make([]Str, v.NamesLen) - b += StrReadList(buf[b:], v.Names) - - return v -} - -// Write request to wire for ListExtensions -// listExtensionsRequest writes a ListExtensions request to a byte slice. -func listExtensionsRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 99 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// ChangeKeyboardMappingCookie is a cookie used only for ChangeKeyboardMapping requests. -type ChangeKeyboardMappingCookie struct { - *xgb.Cookie -} - -// ChangeKeyboardMapping sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) - return ChangeKeyboardMappingCookie{cookie} -} - -// ChangeKeyboardMappingChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeKeyboardMappingCookie.Check() -func ChangeKeyboardMappingChecked(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) - return ChangeKeyboardMappingCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeKeyboardMappingCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeKeyboardMapping -// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice. -func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { - size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 100 // request opcode - b += 1 - - buf[b] = KeycodeCount - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = KeysymsPerKeycode - b += 1 - - b += 2 // padding - - for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { - xgb.Put32(buf[b:], uint32(Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GetKeyboardMappingCookie is a cookie used only for GetKeyboardMapping requests. -type GetKeyboardMappingCookie struct { - *xgb.Cookie -} - -// GetKeyboardMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetKeyboardMappingCookie.Reply() -func GetKeyboardMapping(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) - return GetKeyboardMappingCookie{cookie} -} - -// GetKeyboardMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetKeyboardMappingUnchecked(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) - return GetKeyboardMappingCookie{cookie} -} - -// GetKeyboardMappingReply represents the data returned from a GetKeyboardMapping request. -type GetKeyboardMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - KeysymsPerKeycode byte - // padding: 24 bytes - Keysyms []Keysym // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GetKeyboardMapping request. -func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getKeyboardMappingReply(buf), nil -} - -// getKeyboardMappingReply reads a byte slice into a GetKeyboardMappingReply value. -func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { - v := new(GetKeyboardMappingReply) - b := 1 // skip reply determinant - - v.KeysymsPerKeycode = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + v.Child = Window(xgb.Get32(buf[b:])) b += 4 - b += 24 // padding + v.DstX = int16(xgb.Get16(buf[b:])) + b += 2 - v.Keysyms = make([]Keysym, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Keysyms[i] = Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) + v.DstY = int16(xgb.Get16(buf[b:])) + b += 2 return v } -// Write request to wire for GetKeyboardMapping -// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice. -func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { - size := 8 +// Write request to wire for TranslateCoordinates +// translateCoordinatesRequest writes a TranslateCoordinates request to a byte slice. +func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { + size := 16 b := 0 buf := make([]byte, size) - buf[b] = 101 // request opcode + buf[b] = 40 // request opcode b += 1 b += 1 // padding @@ -13594,790 +14393,164 @@ func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) [] xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - buf[b] = byte(FirstKeycode) - b += 1 + xgb.Put32(buf[b:], uint32(SrcWindow)) + b += 4 - buf[b] = Count - b += 1 + xgb.Put32(buf[b:], uint32(DstWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 return buf } -// ChangeKeyboardControlCookie is a cookie used only for ChangeKeyboardControl requests. -type ChangeKeyboardControlCookie struct { +// UngrabButtonCookie is a cookie used only for UngrabButton requests. +type UngrabButtonCookie struct { *xgb.Cookie } -// ChangeKeyboardControl sends an unchecked request. +// UngrabButton sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { +func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(false, false) - c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) - return ChangeKeyboardControlCookie{cookie} + c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie{cookie} } -// ChangeKeyboardControlChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeKeyboardControlCookie.Check() -func ChangeKeyboardControlChecked(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { +// UngrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabButtonCookie.Check() +func UngrabButtonChecked(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(true, false) - c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) - return ChangeKeyboardControlCookie{cookie} + c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) + return UngrabButtonCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeKeyboardControlCookie) Check() error { +func (cook UngrabButtonCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeKeyboardControl -// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. -func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = 102 // request opcode - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GetKeyboardControlCookie is a cookie used only for GetKeyboardControl requests. -type GetKeyboardControlCookie struct { - *xgb.Cookie -} - -// GetKeyboardControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetKeyboardControlCookie.Reply() -func GetKeyboardControl(c *xgb.Conn) GetKeyboardControlCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getKeyboardControlRequest(c), cookie) - return GetKeyboardControlCookie{cookie} -} - -// GetKeyboardControlUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetKeyboardControlUnchecked(c *xgb.Conn) GetKeyboardControlCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getKeyboardControlRequest(c), cookie) - return GetKeyboardControlCookie{cookie} -} - -// GetKeyboardControlReply represents the data returned from a GetKeyboardControl request. -type GetKeyboardControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - GlobalAutoRepeat byte - LedMask uint32 - KeyClickPercent byte - BellPercent byte - BellPitch uint16 - BellDuration uint16 - // padding: 2 bytes - AutoRepeats []byte // size: 32 -} - -// Reply blocks and returns the reply data for a GetKeyboardControl request. -func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getKeyboardControlReply(buf), nil -} - -// getKeyboardControlReply reads a byte slice into a GetKeyboardControlReply value. -func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { - v := new(GetKeyboardControlReply) - b := 1 // skip reply determinant - - v.GlobalAutoRepeat = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.KeyClickPercent = buf[b] - b += 1 - - v.BellPercent = buf[b] - b += 1 - - v.BellPitch = xgb.Get16(buf[b:]) - b += 2 - - v.BellDuration = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.AutoRepeats = make([]byte, 32) - copy(v.AutoRepeats[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return v -} - -// Write request to wire for GetKeyboardControl -// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice. -func getKeyboardControlRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 103 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// BellCookie is a cookie used only for Bell requests. -type BellCookie struct { - *xgb.Cookie -} - -// Bell sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Bell(c *xgb.Conn, Percent int8) BellCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(bellRequest(c, Percent), cookie) - return BellCookie{cookie} -} - -// BellChecked sends a checked request. -// If an error occurs, it can be retrieved using BellCookie.Check() -func BellChecked(c *xgb.Conn, Percent int8) BellCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(bellRequest(c, Percent), cookie) - return BellCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook BellCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Bell -// bellRequest writes a Bell request to a byte slice. -func bellRequest(c *xgb.Conn, Percent int8) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 104 // request opcode - b += 1 - - buf[b] = byte(Percent) - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// ChangePointerControlCookie is a cookie used only for ChangePointerControl requests. -type ChangePointerControlCookie struct { - *xgb.Cookie -} - -// ChangePointerControl sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangePointerControl(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) - return ChangePointerControlCookie{cookie} -} - -// ChangePointerControlChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangePointerControlCookie.Check() -func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) - return ChangePointerControlCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangePointerControlCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangePointerControl -// changePointerControlRequest writes a ChangePointerControl request to a byte slice. -func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { +// Write request to wire for UngrabButton +// ungrabButtonRequest writes a UngrabButton request to a byte slice. +func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) - buf[b] = 105 // request opcode + buf[b] = 29 // request opcode b += 1 - b += 1 // padding + buf[b] = Button + b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put16(buf[b:], uint16(AccelerationNumerator)) - b += 2 - - xgb.Put16(buf[b:], uint16(AccelerationDenominator)) - b += 2 - - xgb.Put16(buf[b:], uint16(Threshold)) - b += 2 - - if DoAcceleration { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - if DoThreshold { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// GetPointerControlCookie is a cookie used only for GetPointerControl requests. -type GetPointerControlCookie struct { - *xgb.Cookie -} - -// GetPointerControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPointerControlCookie.Reply() -func GetPointerControl(c *xgb.Conn) GetPointerControlCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getPointerControlRequest(c), cookie) - return GetPointerControlCookie{cookie} -} - -// GetPointerControlUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPointerControlUnchecked(c *xgb.Conn) GetPointerControlCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getPointerControlRequest(c), cookie) - return GetPointerControlCookie{cookie} -} - -// GetPointerControlReply represents the data returned from a GetPointerControl request. -type GetPointerControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - AccelerationNumerator uint16 - AccelerationDenominator uint16 - Threshold uint16 - // padding: 18 bytes -} - -// Reply blocks and returns the reply data for a GetPointerControl request. -func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPointerControlReply(buf), nil -} - -// getPointerControlReply reads a byte slice into a GetPointerControlReply value. -func getPointerControlReply(buf []byte) *GetPointerControlReply { - v := new(GetPointerControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - v.AccelerationNumerator = xgb.Get16(buf[b:]) + xgb.Put16(buf[b:], Modifiers) b += 2 - v.AccelerationDenominator = xgb.Get16(buf[b:]) - b += 2 - - v.Threshold = xgb.Get16(buf[b:]) - b += 2 - - b += 18 // padding - - return v -} - -// Write request to wire for GetPointerControl -// getPointerControlRequest writes a GetPointerControl request to a byte slice. -func getPointerControlRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 106 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 + b += 2 // padding return buf } -// SetScreenSaverCookie is a cookie used only for SetScreenSaver requests. -type SetScreenSaverCookie struct { +// UngrabKeyCookie is a cookie used only for UngrabKey requests. +type UngrabKeyCookie struct { *xgb.Cookie } -// SetScreenSaver sends an unchecked request. +// UngrabKey sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetScreenSaver(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { +func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(false, false) - c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) - return SetScreenSaverCookie{cookie} + c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie{cookie} } -// SetScreenSaverChecked sends a checked request. -// If an error occurs, it can be retrieved using SetScreenSaverCookie.Check() -func SetScreenSaverChecked(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { +// UngrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyCookie.Check() +func UngrabKeyChecked(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(true, false) - c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) - return SetScreenSaverCookie{cookie} + c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) + return UngrabKeyCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetScreenSaverCookie) Check() error { +func (cook UngrabKeyCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for SetScreenSaver -// setScreenSaverRequest writes a SetScreenSaver request to a byte slice. -func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { +// Write request to wire for UngrabKey +// ungrabKeyRequest writes a UngrabKey request to a byte slice. +func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 buf := make([]byte, size) - buf[b] = 107 // request opcode + buf[b] = 34 // request opcode b += 1 - b += 1 // padding + buf[b] = byte(Key) + b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put16(buf[b:], uint16(Timeout)) - b += 2 - - xgb.Put16(buf[b:], uint16(Interval)) - b += 2 - - buf[b] = PreferBlanking - b += 1 - - buf[b] = AllowExposures - b += 1 - - return buf -} - -// GetScreenSaverCookie is a cookie used only for GetScreenSaver requests. -type GetScreenSaverCookie struct { - *xgb.Cookie -} - -// GetScreenSaver sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetScreenSaverCookie.Reply() -func GetScreenSaver(c *xgb.Conn) GetScreenSaverCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getScreenSaverRequest(c), cookie) - return GetScreenSaverCookie{cookie} -} - -// GetScreenSaverUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetScreenSaverUnchecked(c *xgb.Conn) GetScreenSaverCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getScreenSaverRequest(c), cookie) - return GetScreenSaverCookie{cookie} -} - -// GetScreenSaverReply represents the data returned from a GetScreenSaver request. -type GetScreenSaverReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Timeout uint16 - Interval uint16 - PreferBlanking byte - AllowExposures byte - // padding: 18 bytes -} - -// Reply blocks and returns the reply data for a GetScreenSaver request. -func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getScreenSaverReply(buf), nil -} - -// getScreenSaverReply reads a byte slice into a GetScreenSaverReply value. -func getScreenSaverReply(buf []byte) *GetScreenSaverReply { - v := new(GetScreenSaverReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(GrabWindow)) b += 4 - v.Timeout = xgb.Get16(buf[b:]) + xgb.Put16(buf[b:], Modifiers) b += 2 - v.Interval = xgb.Get16(buf[b:]) - b += 2 - - v.PreferBlanking = buf[b] - b += 1 - - v.AllowExposures = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -// Write request to wire for GetScreenSaver -// getScreenSaverRequest writes a GetScreenSaver request to a byte slice. -func getScreenSaverRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 108 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 + b += 2 // padding return buf } -// ChangeHostsCookie is a cookie used only for ChangeHosts requests. -type ChangeHostsCookie struct { +// UngrabKeyboardCookie is a cookie used only for UngrabKeyboard requests. +type UngrabKeyboardCookie struct { *xgb.Cookie } -// ChangeHosts sends an unchecked request. +// UngrabKeyboard sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeHosts(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { +func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(false, false) - c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) - return ChangeHostsCookie{cookie} + c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) + return UngrabKeyboardCookie{cookie} } -// ChangeHostsChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeHostsCookie.Check() -func ChangeHostsChecked(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { +// UngrabKeyboardChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyboardCookie.Check() +func UngrabKeyboardChecked(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(true, false) - c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) - return ChangeHostsCookie{cookie} + c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) + return UngrabKeyboardCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeHostsCookie) Check() error { +func (cook UngrabKeyboardCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ChangeHosts -// changeHostsRequest writes a ChangeHosts request to a byte slice. -func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { - size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 109 // request opcode - b += 1 - - buf[b] = Mode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = Family - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], AddressLen) - b += 2 - - copy(buf[b:], Address[:AddressLen]) - b += xgb.Pad(int(AddressLen)) - - return buf -} - -// ListHostsCookie is a cookie used only for ListHosts requests. -type ListHostsCookie struct { - *xgb.Cookie -} - -// ListHosts sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListHostsCookie.Reply() -func ListHosts(c *xgb.Conn) ListHostsCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(listHostsRequest(c), cookie) - return ListHostsCookie{cookie} -} - -// ListHostsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListHostsUnchecked(c *xgb.Conn) ListHostsCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(listHostsRequest(c), cookie) - return ListHostsCookie{cookie} -} - -// ListHostsReply represents the data returned from a ListHosts request. -type ListHostsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Mode byte - HostsLen uint16 - // padding: 22 bytes - Hosts []Host // size: HostListSize(Hosts) -} - -// Reply blocks and returns the reply data for a ListHosts request. -func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listHostsReply(buf), nil -} - -// listHostsReply reads a byte slice into a ListHostsReply value. -func listHostsReply(buf []byte) *ListHostsReply { - v := new(ListHostsReply) - b := 1 // skip reply determinant - - v.Mode = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.HostsLen = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Hosts = make([]Host, v.HostsLen) - b += HostReadList(buf[b:], v.Hosts) - - return v -} - -// Write request to wire for ListHosts -// listHostsRequest writes a ListHosts request to a byte slice. -func listHostsRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 110 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// SetAccessControlCookie is a cookie used only for SetAccessControl requests. -type SetAccessControlCookie struct { - *xgb.Cookie -} - -// SetAccessControl sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setAccessControlRequest(c, Mode), cookie) - return SetAccessControlCookie{cookie} -} - -// SetAccessControlChecked sends a checked request. -// If an error occurs, it can be retrieved using SetAccessControlCookie.Check() -func SetAccessControlChecked(c *xgb.Conn, Mode byte) SetAccessControlCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setAccessControlRequest(c, Mode), cookie) - return SetAccessControlCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetAccessControlCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetAccessControl -// setAccessControlRequest writes a SetAccessControl request to a byte slice. -func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 111 // request opcode - b += 1 - - buf[b] = Mode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// SetCloseDownModeCookie is a cookie used only for SetCloseDownMode requests. -type SetCloseDownModeCookie struct { - *xgb.Cookie -} - -// SetCloseDownMode sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) - return SetCloseDownModeCookie{cookie} -} - -// SetCloseDownModeChecked sends a checked request. -// If an error occurs, it can be retrieved using SetCloseDownModeCookie.Check() -func SetCloseDownModeChecked(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) - return SetCloseDownModeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetCloseDownModeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetCloseDownMode -// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice. -func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 112 // request opcode - b += 1 - - buf[b] = Mode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// KillClientCookie is a cookie used only for KillClient requests. -type KillClientCookie struct { - *xgb.Cookie -} - -// KillClient sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { - cookie := c.NewCookie(false, false) - c.NewRequest(killClientRequest(c, Resource), cookie) - return KillClientCookie{cookie} -} - -// KillClientChecked sends a checked request. -// If an error occurs, it can be retrieved using KillClientCookie.Check() -func KillClientChecked(c *xgb.Conn, Resource uint32) KillClientCookie { - cookie := c.NewCookie(true, false) - c.NewRequest(killClientRequest(c, Resource), cookie) - return KillClientCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook KillClientCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for KillClient -// killClientRequest writes a KillClient request to a byte slice. -func killClientRequest(c *xgb.Conn, Resource uint32) []byte { +// Write request to wire for UngrabKeyboard +// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice. +func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 buf := make([]byte, size) - buf[b] = 113 // request opcode + buf[b] = 32 // request opcode b += 1 b += 1 // padding @@ -14385,47 +14558,187 @@ func killClientRequest(c *xgb.Conn, Resource uint32) []byte { xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], Resource) + xgb.Put32(buf[b:], uint32(Time)) b += 4 return buf } -// RotatePropertiesCookie is a cookie used only for RotateProperties requests. -type RotatePropertiesCookie struct { +// UngrabPointerCookie is a cookie used only for UngrabPointer requests. +type UngrabPointerCookie struct { *xgb.Cookie } -// RotateProperties sends an unchecked request. +// UngrabPointer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { +func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(false, false) - c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) - return RotatePropertiesCookie{cookie} + c.NewRequest(ungrabPointerRequest(c, Time), cookie) + return UngrabPointerCookie{cookie} } -// RotatePropertiesChecked sends a checked request. -// If an error occurs, it can be retrieved using RotatePropertiesCookie.Check() -func RotatePropertiesChecked(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { +// UngrabPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabPointerCookie.Check() +func UngrabPointerChecked(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(true, false) - c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) - return RotatePropertiesCookie{cookie} + c.NewRequest(ungrabPointerRequest(c, Time), cookie) + return UngrabPointerCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook RotatePropertiesCookie) Check() error { +func (cook UngrabPointerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for RotateProperties -// rotatePropertiesRequest writes a RotateProperties request to a byte slice. -func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { - size := xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) +// Write request to wire for UngrabPointer +// ungrabPointerRequest writes a UngrabPointer request to a byte slice. +func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { + size := 8 b := 0 buf := make([]byte, size) - buf[b] = 114 // request opcode + buf[b] = 27 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// UngrabServerCookie is a cookie used only for UngrabServer requests. +type UngrabServerCookie struct { + *xgb.Cookie +} + +// UngrabServer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UngrabServer(c *xgb.Conn) UngrabServerCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabServerRequest(c), cookie) + return UngrabServerCookie{cookie} +} + +// UngrabServerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabServerCookie.Check() +func UngrabServerChecked(c *xgb.Conn) UngrabServerCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabServerRequest(c), cookie) + return UngrabServerCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UngrabServerCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabServer +// ungrabServerRequest writes a UngrabServer request to a byte slice. +func ungrabServerRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = 37 // request opcode + b += 1 + + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// UninstallColormapCookie is a cookie used only for UninstallColormap requests. +type UninstallColormapCookie struct { + *xgb.Cookie +} + +// UninstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) + return UninstallColormapCookie{cookie} +} + +// UninstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using UninstallColormapCookie.Check() +func UninstallColormapChecked(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) + return UninstallColormapCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UninstallColormapCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UninstallColormap +// uninstallColormapRequest writes a UninstallColormap request to a byte slice. +func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 82 // request opcode + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Cmap)) + b += 4 + + return buf +} + +// UnmapSubwindowsCookie is a cookie used only for UnmapSubwindows requests. +type UnmapSubwindowsCookie struct { + *xgb.Cookie +} + +// UnmapSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { + cookie := c.NewCookie(false, false) + c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) + return UnmapSubwindowsCookie{cookie} +} + +// UnmapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapSubwindowsCookie.Check() +func UnmapSubwindowsChecked(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { + cookie := c.NewCookie(true, false) + c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) + return UnmapSubwindowsCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UnmapSubwindowsCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UnmapSubwindows +// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice. +func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = 11 // request opcode b += 1 b += 1 // padding @@ -14436,435 +14749,122 @@ func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta xgb.Put32(buf[b:], uint32(Window)) b += 4 - xgb.Put16(buf[b:], AtomsLen) - b += 2 - - xgb.Put16(buf[b:], uint16(Delta)) - b += 2 - - for i := 0; i < int(AtomsLen); i++ { - xgb.Put32(buf[b:], uint32(Atoms[i])) - b += 4 - } - b = xgb.Pad(b) - return buf } -// ForceScreenSaverCookie is a cookie used only for ForceScreenSaver requests. -type ForceScreenSaverCookie struct { +// UnmapWindowCookie is a cookie used only for UnmapWindow requests. +type UnmapWindowCookie struct { *xgb.Cookie } -// ForceScreenSaver sends an unchecked request. +// UnmapWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { +func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(false, false) - c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) - return ForceScreenSaverCookie{cookie} + c.NewRequest(unmapWindowRequest(c, Window), cookie) + return UnmapWindowCookie{cookie} } -// ForceScreenSaverChecked sends a checked request. -// If an error occurs, it can be retrieved using ForceScreenSaverCookie.Check() -func ForceScreenSaverChecked(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { +// UnmapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapWindowCookie.Check() +func UnmapWindowChecked(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(true, false) - c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) - return ForceScreenSaverCookie{cookie} + c.NewRequest(unmapWindowRequest(c, Window), cookie) + return UnmapWindowCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ForceScreenSaverCookie) Check() error { +func (cook UnmapWindowCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for ForceScreenSaver -// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice. -func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { - size := 4 +// Write request to wire for UnmapWindow +// unmapWindowRequest writes a UnmapWindow request to a byte slice. +func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { + size := 8 b := 0 buf := make([]byte, size) - buf[b] = 115 // request opcode + buf[b] = 10 // request opcode b += 1 - buf[b] = Mode - b += 1 + b += 1 // padding xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - return buf -} - -// SetPointerMappingCookie is a cookie used only for SetPointerMapping requests. -type SetPointerMappingCookie struct { - *xgb.Cookie -} - -// SetPointerMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetPointerMappingCookie.Reply() -func SetPointerMapping(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) - return SetPointerMappingCookie{cookie} -} - -// SetPointerMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPointerMappingUnchecked(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) - return SetPointerMappingCookie{cookie} -} - -// SetPointerMappingReply represents the data returned from a SetPointerMapping request. -type SetPointerMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte -} - -// Reply blocks and returns the reply data for a SetPointerMapping request. -func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setPointerMappingReply(buf), nil -} - -// setPointerMappingReply reads a byte slice into a SetPointerMappingReply value. -func setPointerMappingReply(buf []byte) *SetPointerMappingReply { - v := new(SetPointerMappingReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + xgb.Put32(buf[b:], uint32(Window)) b += 4 - return v -} - -// Write request to wire for SetPointerMapping -// setPointerMappingRequest writes a SetPointerMapping request to a byte slice. -func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { - size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 116 // request opcode - b += 1 - - buf[b] = MapLen - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - copy(buf[b:], Map[:MapLen]) - b += xgb.Pad(int(MapLen)) - return buf } -// GetPointerMappingCookie is a cookie used only for GetPointerMapping requests. -type GetPointerMappingCookie struct { +// WarpPointerCookie is a cookie used only for WarpPointer requests. +type WarpPointerCookie struct { *xgb.Cookie } -// GetPointerMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPointerMappingCookie.Reply() -func GetPointerMapping(c *xgb.Conn) GetPointerMappingCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getPointerMappingRequest(c), cookie) - return GetPointerMappingCookie{cookie} -} - -// GetPointerMappingUnchecked sends an unchecked request. +// WarpPointer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPointerMappingUnchecked(c *xgb.Conn) GetPointerMappingCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getPointerMappingRequest(c), cookie) - return GetPointerMappingCookie{cookie} -} - -// GetPointerMappingReply represents the data returned from a GetPointerMapping request. -type GetPointerMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - MapLen byte - // padding: 24 bytes - Map []byte // size: xgb.Pad((int(MapLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetPointerMapping request. -func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPointerMappingReply(buf), nil -} - -// getPointerMappingReply reads a byte slice into a GetPointerMappingReply value. -func getPointerMappingReply(buf []byte) *GetPointerMappingReply { - v := new(GetPointerMappingReply) - b := 1 // skip reply determinant - - v.MapLen = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Map = make([]byte, v.MapLen) - copy(v.Map[:v.MapLen], buf[b:]) - b += xgb.Pad(int(v.MapLen)) - - return v -} - -// Write request to wire for GetPointerMapping -// getPointerMappingRequest writes a GetPointerMapping request to a byte slice. -func getPointerMappingRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 117 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// SetModifierMappingCookie is a cookie used only for SetModifierMapping requests. -type SetModifierMappingCookie struct { - *xgb.Cookie -} - -// SetModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetModifierMappingCookie.Reply() -func SetModifierMapping(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) - return SetModifierMappingCookie{cookie} -} - -// SetModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetModifierMappingUnchecked(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) - return SetModifierMappingCookie{cookie} -} - -// SetModifierMappingReply represents the data returned from a SetModifierMapping request. -type SetModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Status byte -} - -// Reply blocks and returns the reply data for a SetModifierMapping request. -func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setModifierMappingReply(buf), nil -} - -// setModifierMappingReply reads a byte slice into a SetModifierMappingReply value. -func setModifierMappingReply(buf []byte) *SetModifierMappingReply { - v := new(SetModifierMappingReply) - b := 1 // skip reply determinant - - v.Status = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - return v -} - -// Write request to wire for SetModifierMapping -// setModifierMappingRequest writes a SetModifierMapping request to a byte slice. -func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { - size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = 118 // request opcode - b += 1 - - buf[b] = KeycodesPerModifier - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - for i := 0; i < int((int(KeycodesPerModifier) * 8)); i++ { - buf[b] = byte(Keycodes[i]) - b += 1 - } - b = xgb.Pad(b) - - return buf -} - -// GetModifierMappingCookie is a cookie used only for GetModifierMapping requests. -type GetModifierMappingCookie struct { - *xgb.Cookie -} - -// GetModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetModifierMappingCookie.Reply() -func GetModifierMapping(c *xgb.Conn) GetModifierMappingCookie { - cookie := c.NewCookie(true, true) - c.NewRequest(getModifierMappingRequest(c), cookie) - return GetModifierMappingCookie{cookie} -} - -// GetModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetModifierMappingUnchecked(c *xgb.Conn) GetModifierMappingCookie { - cookie := c.NewCookie(false, true) - c.NewRequest(getModifierMappingRequest(c), cookie) - return GetModifierMappingCookie{cookie} -} - -// GetModifierMappingReply represents the data returned from a GetModifierMapping request. -type GetModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - KeycodesPerModifier byte - // padding: 24 bytes - Keycodes []Keycode // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) -} - -// Reply blocks and returns the reply data for a GetModifierMapping request. -func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getModifierMappingReply(buf), nil -} - -// getModifierMappingReply reads a byte slice into a GetModifierMappingReply value. -func getModifierMappingReply(buf []byte) *GetModifierMappingReply { - v := new(GetModifierMappingReply) - b := 1 // skip reply determinant - - v.KeycodesPerModifier = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.Keycodes = make([]Keycode, (int(v.KeycodesPerModifier) * 8)) - for i := 0; i < int((int(v.KeycodesPerModifier) * 8)); i++ { - v.Keycodes[i] = Keycode(buf[b]) - b += 1 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetModifierMapping -// getModifierMappingRequest writes a GetModifierMapping request to a byte slice. -func getModifierMappingRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = 119 // request opcode - b += 1 - - b += 1 // padding - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// NoOperationCookie is a cookie used only for NoOperation requests. -type NoOperationCookie struct { - *xgb.Cookie -} - -// NoOperation sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func NoOperation(c *xgb.Conn) NoOperationCookie { +func WarpPointer(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(false, false) - c.NewRequest(noOperationRequest(c), cookie) - return NoOperationCookie{cookie} + c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie{cookie} } -// NoOperationChecked sends a checked request. -// If an error occurs, it can be retrieved using NoOperationCookie.Check() -func NoOperationChecked(c *xgb.Conn) NoOperationCookie { +// WarpPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using WarpPointerCookie.Check() +func WarpPointerChecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(true, false) - c.NewRequest(noOperationRequest(c), cookie) - return NoOperationCookie{cookie} + c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) + return WarpPointerCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook NoOperationCookie) Check() error { +func (cook WarpPointerCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for NoOperation -// noOperationRequest writes a NoOperation request to a byte slice. -func noOperationRequest(c *xgb.Conn) []byte { - size := 4 +// Write request to wire for WarpPointer +// warpPointerRequest writes a WarpPointer request to a byte slice. +func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { + size := 24 b := 0 buf := make([]byte, size) - buf[b] = 127 // request opcode + buf[b] = 41 // request opcode b += 1 - b += 1 // padding + b += 1 // padding + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 + xgb.Put32(buf[b:], uint32(SrcWindow)) + b += 4 + + xgb.Put32(buf[b:], uint32(DstWindow)) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], SrcWidth) + b += 2 + + xgb.Put16(buf[b:], SrcHeight) + b += 2 + + xgb.Put16(buf[b:], uint16(DstX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DstY)) + b += 2 + return buf } diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 6024d65..c7183bf 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xselinux.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,30 +40,6 @@ func init() { xgb.NewExtErrorFuncs["SELinux"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - type ListItem struct { Name xproto.Atom ObjectContextLen uint32 @@ -156,188 +132,59 @@ func ListItemListSize(list []ListItem) int { return size } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Byte' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Int8' + +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// GetClientContextCookie is a cookie used only for GetClientContext requests. +type GetClientContextCookie struct { *xgb.Cookie } -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { +// GetClientContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() +func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(getClientContextRequest(c, Resource), cookie) + return GetClientContextCookie{cookie} } -// QueryVersionUnchecked sends an unchecked request. +// GetClientContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { +func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) - return QueryVersionCookie{cookie} + c.NewRequest(getClientContextRequest(c, Resource), cookie) + return GetClientContextCookie{cookie} } -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 -} - -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} - -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = xgb.Get16(buf[b:]) - b += 2 - - v.ServerMinor = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = ClientMajor - b += 1 - - buf[b] = ClientMinor - b += 1 - - return buf -} - -// SetDeviceCreateContextCookie is a cookie used only for SetDeviceCreateContext requests. -type SetDeviceCreateContextCookie struct { - *xgb.Cookie -} - -// SetDeviceCreateContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) - return SetDeviceCreateContextCookie{cookie} -} - -// SetDeviceCreateContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() -func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) - return SetDeviceCreateContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetDeviceCreateContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetDeviceCreateContext -// setDeviceCreateContextRequest writes a SetDeviceCreateContext request to a byte slice. -func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetDeviceCreateContextCookie is a cookie used only for GetDeviceCreateContext requests. -type GetDeviceCreateContextCookie struct { - *xgb.Cookie -} - -// GetDeviceCreateContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() -func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceCreateContextRequest(c), cookie) - return GetDeviceCreateContextCookie{cookie} -} - -// GetDeviceCreateContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceCreateContextRequest(c), cookie) - return GetDeviceCreateContextCookie{cookie} -} - -// GetDeviceCreateContextReply represents the data returned from a GetDeviceCreateContext request. -type GetDeviceCreateContextReply struct { +// GetClientContextReply represents the data returned from a GetClientContext request. +type GetClientContextReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes @@ -346,8 +193,8 @@ type GetDeviceCreateContextReply struct { Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Reply blocks and returns the reply data for a GetDeviceCreateContext request. -func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, error) { +// Reply blocks and returns the reply data for a GetClientContext request. +func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -355,12 +202,12 @@ func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, if buf == nil { return nil, nil } - return getDeviceCreateContextReply(buf), nil + return getClientContextReply(buf), nil } -// getDeviceCreateContextReply reads a byte slice into a GetDeviceCreateContextReply value. -func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { - v := new(GetDeviceCreateContextReply) +// getClientContextReply reads a byte slice into a GetClientContextReply value. +func getClientContextReply(buf []byte) *GetClientContextReply { + v := new(GetClientContextReply) b := 1 // skip reply determinant b += 1 // padding @@ -386,83 +233,25 @@ func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { return v } -// Write request to wire for GetDeviceCreateContext -// getDeviceCreateContextRequest writes a GetDeviceCreateContext request to a byte slice. -func getDeviceCreateContextRequest(c *xgb.Conn) []byte { - size := 4 +// Write request to wire for GetClientContext +// getClientContextRequest writes a GetClientContext request to a byte slice. +func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["SELINUX"] b += 1 - buf[b] = 2 // request opcode + buf[b] = 22 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - return buf -} - -// SetDeviceContextCookie is a cookie used only for SetDeviceContext requests. -type SetDeviceContextCookie struct { - *xgb.Cookie -} - -// SetDeviceContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) - return SetDeviceContextCookie{cookie} -} - -// SetDeviceContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() -func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) - return SetDeviceContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetDeviceContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetDeviceContext -// setDeviceContextRequest writes a SetDeviceContext request to a byte slice. -func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) []byte { - size := xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Device) + xgb.Put32(buf[b:], Resource) b += 4 - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - return buf } @@ -565,93 +354,35 @@ func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { return buf } -// SetWindowCreateContextCookie is a cookie used only for SetWindowCreateContext requests. -type SetWindowCreateContextCookie struct { +// GetDeviceCreateContextCookie is a cookie used only for GetDeviceCreateContext requests. +type GetDeviceCreateContextCookie struct { *xgb.Cookie } -// SetWindowCreateContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { +// GetDeviceCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() +func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) - return SetWindowCreateContextCookie{cookie} -} - -// SetWindowCreateContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() -func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) - return SetWindowCreateContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetWindowCreateContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetWindowCreateContext -// setWindowCreateContextRequest writes a SetWindowCreateContext request to a byte slice. -func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetWindowCreateContextCookie is a cookie used only for GetWindowCreateContext requests. -type GetWindowCreateContextCookie struct { - *xgb.Cookie -} - -// GetWindowCreateContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() -func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getWindowCreateContextRequest(c), cookie) - return GetWindowCreateContextCookie{cookie} + c.NewRequest(getDeviceCreateContextRequest(c), cookie) + return GetDeviceCreateContextCookie{cookie} } -// GetWindowCreateContextUnchecked sends an unchecked request. +// GetDeviceCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { +func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getWindowCreateContextRequest(c), cookie) - return GetWindowCreateContextCookie{cookie} + c.NewRequest(getDeviceCreateContextRequest(c), cookie) + return GetDeviceCreateContextCookie{cookie} } -// GetWindowCreateContextReply represents the data returned from a GetWindowCreateContext request. -type GetWindowCreateContextReply struct { +// GetDeviceCreateContextReply represents the data returned from a GetDeviceCreateContext request. +type GetDeviceCreateContextReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes @@ -660,8 +391,8 @@ type GetWindowCreateContextReply struct { Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Reply blocks and returns the reply data for a GetWindowCreateContext request. -func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, error) { +// Reply blocks and returns the reply data for a GetDeviceCreateContext request. +func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -669,12 +400,12 @@ func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, if buf == nil { return nil, nil } - return getWindowCreateContextReply(buf), nil + return getDeviceCreateContextReply(buf), nil } -// getWindowCreateContextReply reads a byte slice into a GetWindowCreateContextReply value. -func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { - v := new(GetWindowCreateContextReply) +// getDeviceCreateContextReply reads a byte slice into a GetDeviceCreateContextReply value. +func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { + v := new(GetDeviceCreateContextReply) b := 1 // skip reply determinant b += 1 // padding @@ -700,9 +431,9 @@ func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { return v } -// Write request to wire for GetWindowCreateContext -// getWindowCreateContextRequest writes a GetWindowCreateContext request to a byte slice. -func getWindowCreateContextRequest(c *xgb.Conn) []byte { +// Write request to wire for GetDeviceCreateContext +// getDeviceCreateContextRequest writes a GetDeviceCreateContext request to a byte slice. +func getDeviceCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -710,414 +441,7 @@ func getWindowCreateContextRequest(c *xgb.Conn) []byte { buf[b] = c.Extensions["SELINUX"] b += 1 - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// GetWindowContextCookie is a cookie used only for GetWindowContext requests. -type GetWindowContextCookie struct { - *xgb.Cookie -} - -// GetWindowContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() -func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getWindowContextRequest(c, Window), cookie) - return GetWindowContextCookie{cookie} -} - -// GetWindowContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getWindowContextRequest(c, Window), cookie) - return GetWindowContextCookie{cookie} -} - -// GetWindowContextReply represents the data returned from a GetWindowContext request. -type GetWindowContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: xgb.Pad((int(ContextLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetWindowContext request. -func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getWindowContextReply(buf), nil -} - -// getWindowContextReply reads a byte slice into a GetWindowContextReply value. -func getWindowContextReply(buf []byte) *GetWindowContextReply { - v := new(GetWindowContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) - } - - return v -} - -// Write request to wire for GetWindowContext -// getWindowContextRequest writes a GetWindowContext request to a byte slice. -func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// SetPropertyCreateContextCookie is a cookie used only for SetPropertyCreateContext requests. -type SetPropertyCreateContextCookie struct { - *xgb.Cookie -} - -// SetPropertyCreateContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) - return SetPropertyCreateContextCookie{cookie} -} - -// SetPropertyCreateContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() -func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) - return SetPropertyCreateContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPropertyCreateContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPropertyCreateContext -// setPropertyCreateContextRequest writes a SetPropertyCreateContext request to a byte slice. -func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetPropertyCreateContextCookie is a cookie used only for GetPropertyCreateContext requests. -type GetPropertyCreateContextCookie struct { - *xgb.Cookie -} - -// GetPropertyCreateContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() -func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getPropertyCreateContextRequest(c), cookie) - return GetPropertyCreateContextCookie{cookie} -} - -// GetPropertyCreateContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getPropertyCreateContextRequest(c), cookie) - return GetPropertyCreateContextCookie{cookie} -} - -// GetPropertyCreateContextReply represents the data returned from a GetPropertyCreateContext request. -type GetPropertyCreateContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: xgb.Pad((int(ContextLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetPropertyCreateContext request. -func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPropertyCreateContextReply(buf), nil -} - -// getPropertyCreateContextReply reads a byte slice into a GetPropertyCreateContextReply value. -func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { - v := new(GetPropertyCreateContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) - } - - return v -} - -// Write request to wire for GetPropertyCreateContext -// getPropertyCreateContextRequest writes a GetPropertyCreateContext request to a byte slice. -func getPropertyCreateContextRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// SetPropertyUseContextCookie is a cookie used only for SetPropertyUseContext requests. -type SetPropertyUseContextCookie struct { - *xgb.Cookie -} - -// SetPropertyUseContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) - return SetPropertyUseContextCookie{cookie} -} - -// SetPropertyUseContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() -func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) - return SetPropertyUseContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPropertyUseContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPropertyUseContext -// setPropertyUseContextRequest writes a SetPropertyUseContext request to a byte slice. -func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetPropertyUseContextCookie is a cookie used only for GetPropertyUseContext requests. -type GetPropertyUseContextCookie struct { - *xgb.Cookie -} - -// GetPropertyUseContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() -func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getPropertyUseContextRequest(c), cookie) - return GetPropertyUseContextCookie{cookie} -} - -// GetPropertyUseContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getPropertyUseContextRequest(c), cookie) - return GetPropertyUseContextCookie{cookie} -} - -// GetPropertyUseContextReply represents the data returned from a GetPropertyUseContext request. -type GetPropertyUseContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: xgb.Pad((int(ContextLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetPropertyUseContext request. -func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPropertyUseContextReply(buf), nil -} - -// getPropertyUseContextReply reads a byte slice into a GetPropertyUseContextReply value. -func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { - v := new(GetPropertyUseContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) - } - - return v -} - -// Write request to wire for GetPropertyUseContext -// getPropertyUseContextRequest writes a GetPropertyUseContext request to a byte slice. -func getPropertyUseContextRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 11 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1228,6 +552,102 @@ func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xprot return buf } +// GetPropertyCreateContextCookie is a cookie used only for GetPropertyCreateContext requests. +type GetPropertyCreateContextCookie struct { + *xgb.Cookie +} + +// GetPropertyCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() +func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getPropertyCreateContextRequest(c), cookie) + return GetPropertyCreateContextCookie{cookie} +} + +// GetPropertyCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getPropertyCreateContextRequest(c), cookie) + return GetPropertyCreateContextCookie{cookie} +} + +// GetPropertyCreateContextReply represents the data returned from a GetPropertyCreateContext request. +type GetPropertyCreateContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetPropertyCreateContext request. +func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getPropertyCreateContextReply(buf), nil +} + +// getPropertyCreateContextReply reads a byte slice into a GetPropertyCreateContextReply value. +func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { + v := new(GetPropertyCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetPropertyCreateContext +// getPropertyCreateContextRequest writes a GetPropertyCreateContext request to a byte slice. +func getPropertyCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + // GetPropertyDataContextCookie is a cookie used only for GetPropertyDataContext requests. type GetPropertyDataContextCookie struct { *xgb.Cookie @@ -1330,188 +750,35 @@ func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property x return buf } -// ListPropertiesCookie is a cookie used only for ListProperties requests. -type ListPropertiesCookie struct { +// GetPropertyUseContextCookie is a cookie used only for GetPropertyUseContext requests. +type GetPropertyUseContextCookie struct { *xgb.Cookie } -// ListProperties sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() -func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { +// GetPropertyUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() +func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(listPropertiesRequest(c, Window), cookie) - return ListPropertiesCookie{cookie} + c.NewRequest(getPropertyUseContextRequest(c), cookie) + return GetPropertyUseContextCookie{cookie} } -// ListPropertiesUnchecked sends an unchecked request. +// GetPropertyUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { +func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(listPropertiesRequest(c, Window), cookie) - return ListPropertiesCookie{cookie} + c.NewRequest(getPropertyUseContextRequest(c), cookie) + return GetPropertyUseContextCookie{cookie} } -// ListPropertiesReply represents the data returned from a ListProperties request. -type ListPropertiesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - PropertiesLen uint32 - // padding: 20 bytes - Properties []ListItem // size: ListItemListSize(Properties) -} - -// Reply blocks and returns the reply data for a ListProperties request. -func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listPropertiesReply(buf), nil -} - -// listPropertiesReply reads a byte slice into a ListPropertiesReply value. -func listPropertiesReply(buf []byte) *ListPropertiesReply { - v := new(ListPropertiesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.PropertiesLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Properties = make([]ListItem, v.PropertiesLen) - b += ListItemReadList(buf[b:], v.Properties) - - return v -} - -// Write request to wire for ListProperties -// listPropertiesRequest writes a ListProperties request to a byte slice. -func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// SetSelectionCreateContextCookie is a cookie used only for SetSelectionCreateContext requests. -type SetSelectionCreateContextCookie struct { - *xgb.Cookie -} - -// SetSelectionCreateContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) - return SetSelectionCreateContextCookie{cookie} -} - -// SetSelectionCreateContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() -func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) - return SetSelectionCreateContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetSelectionCreateContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetSelectionCreateContext -// setSelectionCreateContextRequest writes a SetSelectionCreateContext request to a byte slice. -func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetSelectionCreateContextCookie is a cookie used only for GetSelectionCreateContext requests. -type GetSelectionCreateContextCookie struct { - *xgb.Cookie -} - -// GetSelectionCreateContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() -func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getSelectionCreateContextRequest(c), cookie) - return GetSelectionCreateContextCookie{cookie} -} - -// GetSelectionCreateContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getSelectionCreateContextRequest(c), cookie) - return GetSelectionCreateContextCookie{cookie} -} - -// GetSelectionCreateContextReply represents the data returned from a GetSelectionCreateContext request. -type GetSelectionCreateContextReply struct { +// GetPropertyUseContextReply represents the data returned from a GetPropertyUseContext request. +type GetPropertyUseContextReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes @@ -1520,8 +787,8 @@ type GetSelectionCreateContextReply struct { Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Reply blocks and returns the reply data for a GetSelectionCreateContext request. -func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextReply, error) { +// Reply blocks and returns the reply data for a GetPropertyUseContext request. +func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1529,12 +796,12 @@ func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextR if buf == nil { return nil, nil } - return getSelectionCreateContextReply(buf), nil + return getPropertyUseContextReply(buf), nil } -// getSelectionCreateContextReply reads a byte slice into a GetSelectionCreateContextReply value. -func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply { - v := new(GetSelectionCreateContextReply) +// getPropertyUseContextReply reads a byte slice into a GetPropertyUseContextReply value. +func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { + v := new(GetPropertyUseContextReply) b := 1 // skip reply determinant b += 1 // padding @@ -1560,9 +827,9 @@ func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply return v } -// Write request to wire for GetSelectionCreateContext -// getSelectionCreateContextRequest writes a GetSelectionCreateContext request to a byte slice. -func getSelectionCreateContextRequest(c *xgb.Conn) []byte { +// Write request to wire for GetPropertyUseContext +// getPropertyUseContextRequest writes a GetPropertyUseContext request to a byte slice. +func getPropertyUseContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 buf := make([]byte, size) @@ -1570,161 +837,7 @@ func getSelectionCreateContextRequest(c *xgb.Conn) []byte { buf[b] = c.Extensions["SELINUX"] b += 1 - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// SetSelectionUseContextCookie is a cookie used only for SetSelectionUseContext requests. -type SetSelectionUseContextCookie struct { - *xgb.Cookie -} - -// SetSelectionUseContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) - return SetSelectionUseContextCookie{cookie} -} - -// SetSelectionUseContextChecked sends a checked request. -// If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() -func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) - return SetSelectionUseContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetSelectionUseContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetSelectionUseContext -// setSelectionUseContextRequest writes a SetSelectionUseContext request to a byte slice. -func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], ContextLen) - b += 4 - - copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) - - return buf -} - -// GetSelectionUseContextCookie is a cookie used only for GetSelectionUseContext requests. -type GetSelectionUseContextCookie struct { - *xgb.Cookie -} - -// GetSelectionUseContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() -func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getSelectionUseContextRequest(c), cookie) - return GetSelectionUseContextCookie{cookie} -} - -// GetSelectionUseContextUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getSelectionUseContextRequest(c), cookie) - return GetSelectionUseContextCookie{cookie} -} - -// GetSelectionUseContextReply represents the data returned from a GetSelectionUseContext request. -type GetSelectionUseContextReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: xgb.Pad((int(ContextLen) * 1)) -} - -// Reply blocks and returns the reply data for a GetSelectionUseContext request. -func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getSelectionUseContextReply(buf), nil -} - -// getSelectionUseContextReply reads a byte slice into a GetSelectionUseContextReply value. -func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { - v := new(GetSelectionUseContextReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ContextLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) - } - - return v -} - -// Write request to wire for GetSelectionUseContext -// getSelectionUseContextRequest writes a GetSelectionUseContext request to a byte slice. -func getSelectionUseContextRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SELINUX"] - b += 1 - - buf[b] = 18 // request opcode + buf[b] = 11 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1832,6 +945,102 @@ func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } +// GetSelectionCreateContextCookie is a cookie used only for GetSelectionCreateContext requests. +type GetSelectionCreateContextCookie struct { + *xgb.Cookie +} + +// GetSelectionCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() +func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionCreateContextRequest(c), cookie) + return GetSelectionCreateContextCookie{cookie} +} + +// GetSelectionCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionCreateContextRequest(c), cookie) + return GetSelectionCreateContextCookie{cookie} +} + +// GetSelectionCreateContextReply represents the data returned from a GetSelectionCreateContext request. +type GetSelectionCreateContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetSelectionCreateContext request. +func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionCreateContextReply(buf), nil +} + +// getSelectionCreateContextReply reads a byte slice into a GetSelectionCreateContextReply value. +func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply { + v := new(GetSelectionCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionCreateContext +// getSelectionCreateContextRequest writes a GetSelectionCreateContext request to a byte slice. +func getSelectionCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + // GetSelectionDataContextCookie is a cookie used only for GetSelectionDataContext requests. type GetSelectionDataContextCookie struct { *xgb.Cookie @@ -1931,6 +1140,392 @@ func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } +// GetSelectionUseContextCookie is a cookie used only for GetSelectionUseContext requests. +type GetSelectionUseContextCookie struct { + *xgb.Cookie +} + +// GetSelectionUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() +func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getSelectionUseContextRequest(c), cookie) + return GetSelectionUseContextCookie{cookie} +} + +// GetSelectionUseContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getSelectionUseContextRequest(c), cookie) + return GetSelectionUseContextCookie{cookie} +} + +// GetSelectionUseContextReply represents the data returned from a GetSelectionUseContext request. +type GetSelectionUseContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetSelectionUseContext request. +func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getSelectionUseContextReply(buf), nil +} + +// getSelectionUseContextReply reads a byte slice into a GetSelectionUseContextReply value. +func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { + v := new(GetSelectionUseContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetSelectionUseContext +// getSelectionUseContextRequest writes a GetSelectionUseContext request to a byte slice. +func getSelectionUseContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// GetWindowContextCookie is a cookie used only for GetWindowContext requests. +type GetWindowContextCookie struct { + *xgb.Cookie +} + +// GetWindowContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() +func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getWindowContextRequest(c, Window), cookie) + return GetWindowContextCookie{cookie} +} + +// GetWindowContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getWindowContextRequest(c, Window), cookie) + return GetWindowContextCookie{cookie} +} + +// GetWindowContextReply represents the data returned from a GetWindowContext request. +type GetWindowContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetWindowContext request. +func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getWindowContextReply(buf), nil +} + +// getWindowContextReply reads a byte slice into a GetWindowContextReply value. +func getWindowContextReply(buf []byte) *GetWindowContextReply { + v := new(GetWindowContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetWindowContext +// getWindowContextRequest writes a GetWindowContext request to a byte slice. +func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + +// GetWindowCreateContextCookie is a cookie used only for GetWindowCreateContext requests. +type GetWindowCreateContextCookie struct { + *xgb.Cookie +} + +// GetWindowCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() +func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getWindowCreateContextRequest(c), cookie) + return GetWindowCreateContextCookie{cookie} +} + +// GetWindowCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getWindowCreateContextRequest(c), cookie) + return GetWindowCreateContextCookie{cookie} +} + +// GetWindowCreateContextReply represents the data returned from a GetWindowCreateContext request. +type GetWindowCreateContextReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + ContextLen uint32 + // padding: 20 bytes + Context string // size: xgb.Pad((int(ContextLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetWindowCreateContext request. +func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getWindowCreateContextReply(buf), nil +} + +// getWindowCreateContextReply reads a byte slice into a GetWindowCreateContextReply value. +func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { + v := new(GetWindowCreateContextReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.ContextLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + { + byteString := make([]byte, v.ContextLen) + copy(byteString[:v.ContextLen], buf[b:]) + v.Context = string(byteString) + b += xgb.Pad(int(v.ContextLen)) + } + + return v +} + +// Write request to wire for GetWindowCreateContext +// getWindowCreateContextRequest writes a GetWindowCreateContext request to a byte slice. +func getWindowCreateContextRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} + +// ListPropertiesCookie is a cookie used only for ListProperties requests. +type ListPropertiesCookie struct { + *xgb.Cookie +} + +// ListProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() +func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} +} + +// ListPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(listPropertiesRequest(c, Window), cookie) + return ListPropertiesCookie{cookie} +} + +// ListPropertiesReply represents the data returned from a ListProperties request. +type ListPropertiesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + PropertiesLen uint32 + // padding: 20 bytes + Properties []ListItem // size: ListItemListSize(Properties) +} + +// Reply blocks and returns the reply data for a ListProperties request. +func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listPropertiesReply(buf), nil +} + +// listPropertiesReply reads a byte slice into a ListPropertiesReply value. +func listPropertiesReply(buf []byte) *ListPropertiesReply { + v := new(ListPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.PropertiesLen = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Properties = make([]ListItem, v.PropertiesLen) + b += ListItemReadList(buf[b:], v.Properties) + + return v +} + +// Write request to wire for ListProperties +// listPropertiesRequest writes a ListProperties request to a byte slice. +func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 14 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + // ListSelectionsCookie is a cookie used only for ListSelections requests. type ListSelectionsCookie struct { *xgb.Cookie @@ -2023,45 +1618,44 @@ func listSelectionsRequest(c *xgb.Conn) []byte { return buf } -// GetClientContextCookie is a cookie used only for GetClientContext requests. -type GetClientContextCookie struct { +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { *xgb.Cookie } -// GetClientContext sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() -func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getClientContextRequest(c, Resource), cookie) - return GetClientContextCookie{cookie} + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} } -// GetClientContextUnchecked sends an unchecked request. +// QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { +func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { if _, ok := c.Extensions["SELINUX"]; !ok { - panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getClientContextRequest(c, Resource), cookie) - return GetClientContextCookie{cookie} + c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) + return QueryVersionCookie{cookie} } -// GetClientContextReply represents the data returned from a GetClientContext request. -type GetClientContextReply struct { +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - ContextLen uint32 - // padding: 20 bytes - Context string // size: xgb.Pad((int(ContextLen) * 1)) + ServerMajor uint16 + ServerMinor uint16 } -// Reply blocks and returns the reply data for a GetClientContext request. -func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -2069,12 +1663,12 @@ func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { if buf == nil { return nil, nil } - return getClientContextReply(buf), nil + return queryVersionReply(buf), nil } -// getClientContextReply reads a byte slice into a GetClientContextReply value. -func getClientContextReply(buf []byte) *GetClientContextReply { - v := new(GetClientContextReply) +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) b := 1 // skip reply determinant b += 1 // padding @@ -2085,24 +1679,18 @@ func getClientContextReply(buf []byte) *GetClientContextReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.ContextLen = xgb.Get32(buf[b:]) - b += 4 + v.ServerMajor = xgb.Get16(buf[b:]) + b += 2 - b += 20 // padding - - { - byteString := make([]byte, v.ContextLen) - copy(byteString[:v.ContextLen], buf[b:]) - v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) - } + v.ServerMinor = xgb.Get16(buf[b:]) + b += 2 return v } -// Write request to wire for GetClientContext -// getClientContextRequest writes a GetClientContext request to a byte slice. -func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2110,14 +1698,426 @@ func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { buf[b] = c.Extensions["SELINUX"] b += 1 - buf[b] = 22 // request opcode + buf[b] = 0 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], Resource) - b += 4 + buf[b] = ClientMajor + b += 1 + + buf[b] = ClientMinor + b += 1 + + return buf +} + +// SetDeviceContextCookie is a cookie used only for SetDeviceContext requests. +type SetDeviceContextCookie struct { + *xgb.Cookie +} + +// SetDeviceContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) + return SetDeviceContextCookie{cookie} +} + +// SetDeviceContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() +func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) + return SetDeviceContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetDeviceContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceContext +// setDeviceContextRequest writes a SetDeviceContext request to a byte slice. +func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) []byte { + size := xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Device) + b += 4 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetDeviceCreateContextCookie is a cookie used only for SetDeviceCreateContext requests. +type SetDeviceCreateContextCookie struct { + *xgb.Cookie +} + +// SetDeviceCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) + return SetDeviceCreateContextCookie{cookie} +} + +// SetDeviceCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() +func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) + return SetDeviceCreateContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetDeviceCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetDeviceCreateContext +// setDeviceCreateContextRequest writes a SetDeviceCreateContext request to a byte slice. +func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetPropertyCreateContextCookie is a cookie used only for SetPropertyCreateContext requests. +type SetPropertyCreateContextCookie struct { + *xgb.Cookie +} + +// SetPropertyCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) + return SetPropertyCreateContextCookie{cookie} +} + +// SetPropertyCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() +func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) + return SetPropertyCreateContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetPropertyCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPropertyCreateContext +// setPropertyCreateContextRequest writes a SetPropertyCreateContext request to a byte slice. +func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 8 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetPropertyUseContextCookie is a cookie used only for SetPropertyUseContext requests. +type SetPropertyUseContextCookie struct { + *xgb.Cookie +} + +// SetPropertyUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) + return SetPropertyUseContextCookie{cookie} +} + +// SetPropertyUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() +func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) + return SetPropertyUseContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetPropertyUseContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPropertyUseContext +// setPropertyUseContextRequest writes a SetPropertyUseContext request to a byte slice. +func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetSelectionCreateContextCookie is a cookie used only for SetSelectionCreateContext requests. +type SetSelectionCreateContextCookie struct { + *xgb.Cookie +} + +// SetSelectionCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) + return SetSelectionCreateContextCookie{cookie} +} + +// SetSelectionCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() +func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) + return SetSelectionCreateContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetSelectionCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetSelectionCreateContext +// setSelectionCreateContextRequest writes a SetSelectionCreateContext request to a byte slice. +func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 15 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetSelectionUseContextCookie is a cookie used only for SetSelectionUseContext requests. +type SetSelectionUseContextCookie struct { + *xgb.Cookie +} + +// SetSelectionUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) + return SetSelectionUseContextCookie{cookie} +} + +// SetSelectionUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() +func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) + return SetSelectionUseContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetSelectionUseContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetSelectionUseContext +// setSelectionUseContextRequest writes a SetSelectionUseContext request to a byte slice. +func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 17 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) + + return buf +} + +// SetWindowCreateContextCookie is a cookie used only for SetWindowCreateContext requests. +type SetWindowCreateContextCookie struct { + *xgb.Cookie +} + +// SetWindowCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) + return SetWindowCreateContextCookie{cookie} +} + +// SetWindowCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() +func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + if _, ok := c.Extensions["SELINUX"]; !ok { + panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) + return SetWindowCreateContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetWindowCreateContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetWindowCreateContext +// setWindowCreateContextRequest writes a SetWindowCreateContext request to a byte slice. +func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { + size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["SELINUX"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], ContextLen) + b += 4 + + copy(buf[b:], Context[:ContextLen]) + b += xgb.Pad(int(ContextLen)) return buf } diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 30d96ec..505622a 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -2,7 +2,7 @@ package xtest /* - This file was generated by xtest.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xtest.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,128 +40,34 @@ func init() { xgb.NewExtErrorFuncs["XTEST"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - const ( CursorNone = 0 CursorCurrent = 1 ) -// GetVersionCookie is a cookie used only for GetVersion requests. -type GetVersionCookie struct { - *xgb.Cookie -} +// Skipping definition for base type 'Bool' -// GetVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() -func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { - if _, ok := c.Extensions["XTEST"]; !ok { - panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) - return GetVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// GetVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { - if _, ok := c.Extensions["XTEST"]; !ok { - panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) - return GetVersionCookie{cookie} -} +// Skipping definition for base type 'Card8' -// GetVersionReply represents the data returned from a GetVersion request. -type GetVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - MajorVersion byte - MinorVersion uint16 -} +// Skipping definition for base type 'Char' -// Reply blocks and returns the reply data for a GetVersion request. -func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getVersionReply(buf), nil -} +// Skipping definition for base type 'Void' -// getVersionReply reads a byte slice into a GetVersionReply value. -func getVersionReply(buf []byte) *GetVersionReply { - v := new(GetVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Double' - v.MajorVersion = buf[b] - b += 1 +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int32' - v.MinorVersion = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int8' - return v -} +// Skipping definition for base type 'Card16' -// Write request to wire for GetVersion -// getVersionRequest writes a GetVersion request to a byte slice. -func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XTEST"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = MajorVersion - b += 1 - - b += 1 // padding - - xgb.Put16(buf[b:], MinorVersion) - b += 2 - - return buf -} +// Skipping definition for base type 'Card32' // CompareCursorCookie is a cookie used only for CompareCursor requests. type CompareCursorCookie struct { @@ -334,6 +240,100 @@ func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xpr return buf } +// GetVersionCookie is a cookie used only for GetVersion requests. +type GetVersionCookie struct { + *xgb.Cookie +} + +// GetVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() +func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// GetVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XTEST"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie) + return GetVersionCookie{cookie} +} + +// GetVersionReply represents the data returned from a GetVersion request. +type GetVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + MajorVersion byte + MinorVersion uint16 +} + +// Reply blocks and returns the reply data for a GetVersion request. +func (cook GetVersionCookie) Reply() (*GetVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getVersionReply(buf), nil +} + +// getVersionReply reads a byte slice into a GetVersionReply value. +func getVersionReply(buf []byte) *GetVersionReply { + v := new(GetVersionReply) + b := 1 // skip reply determinant + + v.MajorVersion = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.MinorVersion = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// Write request to wire for GetVersion +// getVersionRequest writes a GetVersion request to a byte slice. +func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XTEST"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + buf[b] = MajorVersion + b += 1 + + b += 1 // padding + + xgb.Put16(buf[b:], MinorVersion) + b += 2 + + return buf +} + // GrabControlCookie is a cookie used only for GrabControl requests. type GrabControlCookie struct { *xgb.Cookie diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index ed10b3b..f5539b3 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -2,7 +2,7 @@ package xv /* - This file was generated by xv.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xv.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,208 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - -const ( - TypeInputMask = 1 - TypeOutputMask = 2 - TypeVideoMask = 4 - TypeStillMask = 8 - TypeImageMask = 16 -) - -const ( - ImageFormatInfoTypeRgb = 0 - ImageFormatInfoTypeYuv = 1 -) - -const ( - ImageFormatInfoFormatPacked = 0 - ImageFormatInfoFormatPlanar = 1 -) - -const ( - AttributeFlagGettable = 1 - AttributeFlagSettable = 2 -) - -const ( - VideoNotifyReasonStarted = 0 - VideoNotifyReasonStopped = 1 - VideoNotifyReasonBusy = 2 - VideoNotifyReasonPreempted = 3 - VideoNotifyReasonHardError = 4 -) - -const ( - ScanlineOrderTopToBottom = 0 - ScanlineOrderBottomToTop = 1 -) - -const ( - GrabPortStatusSuccess = 0 - GrabPortStatusBadExtension = 1 - GrabPortStatusAlreadyGrabbed = 2 - GrabPortStatusInvalidTime = 3 - GrabPortStatusBadReply = 4 - GrabPortStatusBadAlloc = 5 -) - -type Port uint32 - -func NewPortId(c *xgb.Conn) (Port, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Port(id), nil -} - -type Encoding uint32 - -func NewEncodingId(c *xgb.Conn) (Encoding, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Encoding(id), nil -} - -type Rational struct { - Numerator int32 - Denominator int32 -} - -// RationalRead reads a byte slice into a Rational value. -func RationalRead(buf []byte, v *Rational) int { - b := 0 - - v.Numerator = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Denominator = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// RationalReadList reads a byte slice into a list of Rational values. -func RationalReadList(buf []byte, dest []Rational) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Rational{} - b += RationalRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Rational value to a byte slice. -func (v Rational) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Numerator)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Denominator)) - b += 4 - - return buf -} - -// RationalListBytes writes a list of Rational values to a byte slice. -func RationalListBytes(buf []byte, list []Rational) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -type Format struct { - Visual xproto.Visualid - Depth byte - // padding: 3 bytes -} - -// FormatRead reads a byte slice into a Format value. -func FormatRead(buf []byte, v *Format) int { - b := 0 - - v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) - b += 4 - - v.Depth = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// FormatReadList reads a byte slice into a list of Format values. -func FormatReadList(buf []byte, dest []Format) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Format{} - b += FormatRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Format value to a byte slice. -func (v Format) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Visual)) - b += 4 - - buf[b] = v.Depth - b += 1 - - b += 3 // padding - - return buf -} - -// FormatListBytes writes a list of Format values to a byte slice. -func FormatListBytes(buf []byte, list []Format) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - type AdaptorInfo struct { BaseId Port NameSize uint16 @@ -349,6 +147,247 @@ func AdaptorInfoListSize(list []AdaptorInfo) int { return size } +const ( + AttributeFlagGettable = 1 + AttributeFlagSettable = 2 +) + +type AttributeInfo struct { + Flags uint32 + Min int32 + Max int32 + Size uint32 + Name string // size: xgb.Pad((int(Size) * 1)) +} + +// AttributeInfoRead reads a byte slice into a AttributeInfo value. +func AttributeInfoRead(buf []byte, v *AttributeInfo) int { + b := 0 + + v.Flags = xgb.Get32(buf[b:]) + b += 4 + + v.Min = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Max = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Size = xgb.Get32(buf[b:]) + b += 4 + + { + byteString := make([]byte, v.Size) + copy(byteString[:v.Size], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.Size)) + } + + return b +} + +// AttributeInfoReadList reads a byte slice into a list of AttributeInfo values. +func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = AttributeInfo{} + b += AttributeInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a AttributeInfo value to a byte slice. +func (v AttributeInfo) Bytes() []byte { + buf := make([]byte, (16 + xgb.Pad((int(v.Size) * 1)))) + b := 0 + + xgb.Put32(buf[b:], v.Flags) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Min)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Max)) + b += 4 + + xgb.Put32(buf[b:], v.Size) + b += 4 + + copy(buf[b:], v.Name[:v.Size]) + b += xgb.Pad(int(v.Size)) + + return buf +} + +// AttributeInfoListBytes writes a list of AttributeInfo values to a byte slice. +func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +// AttributeInfoListSize computes the size (bytes) of a list of AttributeInfo values. +func AttributeInfoListSize(list []AttributeInfo) int { + size := 0 + for _, item := range list { + size += (16 + xgb.Pad((int(item.Size) * 1))) + } + return size +} + +// BadBadControl is the error number for a BadBadControl. +const BadBadControl = 2 + +type BadControlError struct { + Sequence uint16 + NiceName string +} + +// BadControlErrorNew constructs a BadControlError value that implements xgb.Error from a byte slice. +func BadControlErrorNew(buf []byte) xgb.Error { + v := BadControlError{} + v.NiceName = "BadControl" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadControl error. +// This is mostly used internally. +func (err BadControlError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadControl error. If no bad value exists, 0 is returned. +func (err BadControlError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadControl error. + +func (err BadControlError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadControl {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][2] = BadControlErrorNew +} + +// BadBadEncoding is the error number for a BadBadEncoding. +const BadBadEncoding = 1 + +type BadEncodingError struct { + Sequence uint16 + NiceName string +} + +// BadEncodingErrorNew constructs a BadEncodingError value that implements xgb.Error from a byte slice. +func BadEncodingErrorNew(buf []byte) xgb.Error { + v := BadEncodingError{} + v.NiceName = "BadEncoding" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadEncoding error. +// This is mostly used internally. +func (err BadEncodingError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadEncoding error. If no bad value exists, 0 is returned. +func (err BadEncodingError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadEncoding error. + +func (err BadEncodingError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadEncoding {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][1] = BadEncodingErrorNew +} + +// BadBadPort is the error number for a BadBadPort. +const BadBadPort = 0 + +type BadPortError struct { + Sequence uint16 + NiceName string +} + +// BadPortErrorNew constructs a BadPortError value that implements xgb.Error from a byte slice. +func BadPortErrorNew(buf []byte) xgb.Error { + v := BadPortError{} + v.NiceName = "BadPort" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadPort error. +// This is mostly used internally. +func (err BadPortError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadPort error. If no bad value exists, 0 is returned. +func (err BadPortError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadPort error. + +func (err BadPortError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadPort {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["XVideo"][0] = BadPortErrorNew +} + +type Encoding uint32 + +func NewEncodingId(c *xgb.Conn) (Encoding, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Encoding(id), nil +} + type EncodingInfo struct { Encoding Encoding NameSize uint16 @@ -452,6 +491,74 @@ func EncodingInfoListSize(list []EncodingInfo) int { return size } +type Format struct { + Visual xproto.Visualid + Depth byte + // padding: 3 bytes +} + +// FormatRead reads a byte slice into a Format value. +func FormatRead(buf []byte, v *Format) int { + b := 0 + + v.Visual = xproto.Visualid(xgb.Get32(buf[b:])) + b += 4 + + v.Depth = buf[b] + b += 1 + + b += 3 // padding + + return b +} + +// FormatReadList reads a byte slice into a list of Format values. +func FormatReadList(buf []byte, dest []Format) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Format{} + b += FormatRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Format value to a byte slice. +func (v Format) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Visual)) + b += 4 + + buf[b] = v.Depth + b += 1 + + b += 3 // padding + + return buf +} + +// FormatListBytes writes a list of Format values to a byte slice. +func FormatListBytes(buf []byte, list []Format) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + GrabPortStatusSuccess = 0 + GrabPortStatusBadExtension = 1 + GrabPortStatusAlreadyGrabbed = 2 + GrabPortStatusInvalidTime = 3 + GrabPortStatusBadReply = 4 + GrabPortStatusBadAlloc = 5 +) + type Image struct { Id uint32 Width uint16 @@ -572,94 +679,6 @@ func ImageListSize(list []Image) int { return size } -type AttributeInfo struct { - Flags uint32 - Min int32 - Max int32 - Size uint32 - Name string // size: xgb.Pad((int(Size) * 1)) -} - -// AttributeInfoRead reads a byte slice into a AttributeInfo value. -func AttributeInfoRead(buf []byte, v *AttributeInfo) int { - b := 0 - - v.Flags = xgb.Get32(buf[b:]) - b += 4 - - v.Min = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Max = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Size = xgb.Get32(buf[b:]) - b += 4 - - { - byteString := make([]byte, v.Size) - copy(byteString[:v.Size], buf[b:]) - v.Name = string(byteString) - b += xgb.Pad(int(v.Size)) - } - - return b -} - -// AttributeInfoReadList reads a byte slice into a list of AttributeInfo values. -func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = AttributeInfo{} - b += AttributeInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a AttributeInfo value to a byte slice. -func (v AttributeInfo) Bytes() []byte { - buf := make([]byte, (16 + xgb.Pad((int(v.Size) * 1)))) - b := 0 - - xgb.Put32(buf[b:], v.Flags) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Min)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Max)) - b += 4 - - xgb.Put32(buf[b:], v.Size) - b += 4 - - copy(buf[b:], v.Name[:v.Size]) - b += xgb.Pad(int(v.Size)) - - return buf -} - -// AttributeInfoListBytes writes a list of AttributeInfo values to a byte slice. -func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - return b -} - -// AttributeInfoListSize computes the size (bytes) of a list of AttributeInfo values. -func AttributeInfoListSize(list []AttributeInfo) int { - size := 0 - for _, item := range list { - size += (16 + xgb.Pad((int(item.Size) * 1))) - } - return size -} - type ImageFormatInfo struct { Id uint32 Type byte @@ -890,86 +909,24 @@ func ImageFormatInfoListSize(list []ImageFormatInfo) int { return size } -// VideoNotify is the event number for a VideoNotifyEvent. -const VideoNotify = 0 +const ( + ImageFormatInfoFormatPacked = 0 + ImageFormatInfoFormatPlanar = 1 +) -type VideoNotifyEvent struct { - Sequence uint16 - Reason byte - Time xproto.Timestamp - Drawable xproto.Drawable - Port Port -} +const ( + ImageFormatInfoTypeRgb = 0 + ImageFormatInfoTypeYuv = 1 +) -// VideoNotifyEventNew constructs a VideoNotifyEvent value that implements xgb.Event from a byte slice. -func VideoNotifyEventNew(buf []byte) xgb.Event { - v := VideoNotifyEvent{} - b := 1 // don't read event number +type Port uint32 - v.Reason = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) - b += 4 - - v.Port = Port(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Bytes writes a VideoNotifyEvent value to a byte slice. -func (v VideoNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Reason - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Port)) - b += 4 - - return buf -} - -// SequenceId returns the sequence id attached to the VideoNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v VideoNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of VideoNotifyEvent. -func (v VideoNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Reason: %d", v.Reason)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) - fieldVals = append(fieldVals, xgb.Sprintf("Port: %d", v.Port)) - return "VideoNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XVideo"][0] = VideoNotifyEventNew +func NewPortId(c *xgb.Conn) (Port, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Port(id), nil } // PortNotify is the event number for a PortNotifyEvent. @@ -1059,182 +1016,224 @@ func init() { xgb.NewExtEventFuncs["XVideo"][1] = PortNotifyEventNew } -// BadBadPort is the error number for a BadBadPort. -const BadBadPort = 0 - -type BadPortError struct { - Sequence uint16 - NiceName string +type Rational struct { + Numerator int32 + Denominator int32 } -// BadPortErrorNew constructs a BadPortError value that implements xgb.Error from a byte slice. -func BadPortErrorNew(buf []byte) xgb.Error { - v := BadPortError{} - v.NiceName = "BadPort" +// RationalRead reads a byte slice into a Rational value. +func RationalRead(buf []byte, v *Rational) int { + b := 0 - b := 1 // skip error determinant - b += 1 // don't read error number + v.Numerator = int32(xgb.Get32(buf[b:])) + b += 4 + + v.Denominator = int32(xgb.Get32(buf[b:])) + b += 4 + + return b +} + +// RationalReadList reads a byte slice into a list of Rational values. +func RationalReadList(buf []byte, dest []Rational) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = Rational{} + b += RationalRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a Rational value to a byte slice. +func (v Rational) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Numerator)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Denominator)) + b += 4 + + return buf +} + +// RationalListBytes writes a list of Rational values to a byte slice. +func RationalListBytes(buf []byte, list []Rational) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + return b +} + +const ( + ScanlineOrderTopToBottom = 0 + ScanlineOrderBottomToTop = 1 +) + +const ( + TypeInputMask = 1 + TypeOutputMask = 2 + TypeVideoMask = 4 + TypeStillMask = 8 + TypeImageMask = 16 +) + +// VideoNotify is the event number for a VideoNotifyEvent. +const VideoNotify = 0 + +type VideoNotifyEvent struct { + Sequence uint16 + Reason byte + Time xproto.Timestamp + Drawable xproto.Drawable + Port Port +} + +// VideoNotifyEventNew constructs a VideoNotifyEvent value that implements xgb.Event from a byte slice. +func VideoNotifyEventNew(buf []byte) xgb.Event { + v := VideoNotifyEvent{} + b := 1 // don't read event number + + v.Reason = buf[b] + b += 1 v.Sequence = xgb.Get16(buf[b:]) b += 2 - return v -} + v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 -// SequenceId returns the sequence id attached to the BadBadPort error. -// This is mostly used internally. -func (err BadPortError) SequenceId() uint16 { - return err.Sequence -} + v.Drawable = xproto.Drawable(xgb.Get32(buf[b:])) + b += 4 -// BadId returns the 'BadValue' number if one exists for the BadBadPort error. If no bad value exists, 0 is returned. -func (err BadPortError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadPort error. - -func (err BadPortError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadPort {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XVideo"][0] = BadPortErrorNew -} - -// BadBadEncoding is the error number for a BadBadEncoding. -const BadBadEncoding = 1 - -type BadEncodingError struct { - Sequence uint16 - NiceName string -} - -// BadEncodingErrorNew constructs a BadEncodingError value that implements xgb.Error from a byte slice. -func BadEncodingErrorNew(buf []byte) xgb.Error { - v := BadEncodingError{} - v.NiceName = "BadEncoding" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 + v.Port = Port(xgb.Get32(buf[b:])) + b += 4 return v } -// SequenceId returns the sequence id attached to the BadBadEncoding error. +// Bytes writes a VideoNotifyEvent value to a byte slice. +func (v VideoNotifyEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 0 + b += 1 + + buf[b] = v.Reason + b += 1 + + b += 2 // skip sequence number + + xgb.Put32(buf[b:], uint32(v.Time)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Port)) + b += 4 + + return buf +} + +// SequenceId returns the sequence id attached to the VideoNotify event. +// Events without a sequence number (KeymapNotify) return 0. // This is mostly used internally. -func (err BadEncodingError) SequenceId() uint16 { - return err.Sequence +func (v VideoNotifyEvent) SequenceId() uint16 { + return v.Sequence } -// BadId returns the 'BadValue' number if one exists for the BadBadEncoding error. If no bad value exists, 0 is returned. -func (err BadEncodingError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadBadEncoding error. - -func (err BadEncodingError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadEncoding {" + xgb.StringsJoin(fieldVals, ", ") + "}" +// String is a rudimentary string representation of VideoNotifyEvent. +func (v VideoNotifyEvent) String() string { + fieldVals := make([]string, 0, 4) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("Reason: %d", v.Reason)) + fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("Port: %d", v.Port)) + return "VideoNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" } func init() { - xgb.NewExtErrorFuncs["XVideo"][1] = BadEncodingErrorNew + xgb.NewExtEventFuncs["XVideo"][0] = VideoNotifyEventNew } -// BadBadControl is the error number for a BadBadControl. -const BadBadControl = 2 +const ( + VideoNotifyReasonStarted = 0 + VideoNotifyReasonStopped = 1 + VideoNotifyReasonBusy = 2 + VideoNotifyReasonPreempted = 3 + VideoNotifyReasonHardError = 4 +) -type BadControlError struct { - Sequence uint16 - NiceName string -} +// Skipping definition for base type 'Bool' -// BadControlErrorNew constructs a BadControlError value that implements xgb.Error from a byte slice. -func BadControlErrorNew(buf []byte) xgb.Error { - v := BadControlError{} - v.NiceName = "BadControl" +// Skipping definition for base type 'Byte' - b := 1 // skip error determinant - b += 1 // don't read error number +// Skipping definition for base type 'Card8' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Char' - return v -} +// Skipping definition for base type 'Void' -// SequenceId returns the sequence id attached to the BadBadControl error. -// This is mostly used internally. -func (err BadControlError) SequenceId() uint16 { - return err.Sequence -} +// Skipping definition for base type 'Double' -// BadId returns the 'BadValue' number if one exists for the BadBadControl error. If no bad value exists, 0 is returned. -func (err BadControlError) BadId() uint32 { - return 0 -} +// Skipping definition for base type 'Float' -// Error returns a rudimentary string representation of the BadBadControl error. +// Skipping definition for base type 'Int16' -func (err BadControlError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadBadControl {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} +// Skipping definition for base type 'Int32' -func init() { - xgb.NewExtErrorFuncs["XVideo"][2] = BadControlErrorNew -} +// Skipping definition for base type 'Int8' -// QueryExtensionCookie is a cookie used only for QueryExtension requests. -type QueryExtensionCookie struct { +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Card32' + +// GetPortAttributeCookie is a cookie used only for GetPortAttribute requests. +type GetPortAttributeCookie struct { *xgb.Cookie } -// QueryExtension sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() -func QueryExtension(c *xgb.Conn) QueryExtensionCookie { +// GetPortAttribute sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() +func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(queryExtensionRequest(c), cookie) - return QueryExtensionCookie{cookie} + c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) + return GetPortAttributeCookie{cookie} } -// QueryExtensionUnchecked sends an unchecked request. +// GetPortAttributeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { +func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(queryExtensionRequest(c), cookie) - return QueryExtensionCookie{cookie} + c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) + return GetPortAttributeCookie{cookie} } -// QueryExtensionReply represents the data returned from a QueryExtension request. -type QueryExtensionReply struct { +// GetPortAttributeReply represents the data returned from a GetPortAttribute request. +type GetPortAttributeReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Major uint16 - Minor uint16 + Value int32 } -// Reply blocks and returns the reply data for a QueryExtension request. -func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { +// Reply blocks and returns the reply data for a GetPortAttribute request. +func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -1242,12 +1241,12 @@ func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { if buf == nil { return nil, nil } - return queryExtensionReply(buf), nil + return getPortAttributeReply(buf), nil } -// queryExtensionReply reads a byte slice into a QueryExtensionReply value. -func queryExtensionReply(buf []byte) *QueryExtensionReply { - v := new(QueryExtensionReply) +// getPortAttributeReply reads a byte slice into a GetPortAttributeReply value. +func getPortAttributeReply(buf []byte) *GetPortAttributeReply { + v := new(GetPortAttributeReply) b := 1 // skip reply determinant b += 1 // padding @@ -1258,290 +1257,15 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Major = xgb.Get16(buf[b:]) - b += 2 - - v.Minor = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// Write request to wire for QueryExtension -// queryExtensionRequest writes a QueryExtension request to a byte slice. -func queryExtensionRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// QueryAdaptorsCookie is a cookie used only for QueryAdaptors requests. -type QueryAdaptorsCookie struct { - *xgb.Cookie -} - -// QueryAdaptors sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() -func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryAdaptorsRequest(c, Window), cookie) - return QueryAdaptorsCookie{cookie} -} - -// QueryAdaptorsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryAdaptorsRequest(c, Window), cookie) - return QueryAdaptorsCookie{cookie} -} - -// QueryAdaptorsReply represents the data returned from a QueryAdaptors request. -type QueryAdaptorsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumAdaptors uint16 - // padding: 22 bytes - Info []AdaptorInfo // size: AdaptorInfoListSize(Info) -} - -// Reply blocks and returns the reply data for a QueryAdaptors request. -func (cook QueryAdaptorsCookie) Reply() (*QueryAdaptorsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryAdaptorsReply(buf), nil -} - -// queryAdaptorsReply reads a byte slice into a QueryAdaptorsReply value. -func queryAdaptorsReply(buf []byte) *QueryAdaptorsReply { - v := new(QueryAdaptorsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAdaptors = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Info = make([]AdaptorInfo, v.NumAdaptors) - b += AdaptorInfoReadList(buf[b:], v.Info) - - return v -} - -// Write request to wire for QueryAdaptors -// queryAdaptorsRequest writes a QueryAdaptors request to a byte slice. -func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// QueryEncodingsCookie is a cookie used only for QueryEncodings requests. -type QueryEncodingsCookie struct { - *xgb.Cookie -} - -// QueryEncodings sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() -func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryEncodingsRequest(c, Port), cookie) - return QueryEncodingsCookie{cookie} -} - -// QueryEncodingsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryEncodingsRequest(c, Port), cookie) - return QueryEncodingsCookie{cookie} -} - -// QueryEncodingsReply represents the data returned from a QueryEncodings request. -type QueryEncodingsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumEncodings uint16 - // padding: 22 bytes - Info []EncodingInfo // size: EncodingInfoListSize(Info) -} - -// Reply blocks and returns the reply data for a QueryEncodings request. -func (cook QueryEncodingsCookie) Reply() (*QueryEncodingsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryEncodingsReply(buf), nil -} - -// queryEncodingsReply reads a byte slice into a QueryEncodingsReply value. -func queryEncodingsReply(buf []byte) *QueryEncodingsReply { - v := new(QueryEncodingsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumEncodings = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Info = make([]EncodingInfo, v.NumEncodings) - b += EncodingInfoReadList(buf[b:], v.Info) - - return v -} - -// Write request to wire for QueryEncodings -// queryEncodingsRequest writes a QueryEncodings request to a byte slice. -func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - return buf -} - -// GrabPortCookie is a cookie used only for GrabPort requests. -type GrabPortCookie struct { - *xgb.Cookie -} - -// GrabPort sends a checked request. -// If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() -func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(grabPortRequest(c, Port, Time), cookie) - return GrabPortCookie{cookie} -} - -// GrabPortUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(grabPortRequest(c, Port, Time), cookie) - return GrabPortCookie{cookie} -} - -// GrabPortReply represents the data returned from a GrabPort request. -type GrabPortReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - Result byte -} - -// Reply blocks and returns the reply data for a GrabPort request. -func (cook GrabPortCookie) Reply() (*GrabPortReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return grabPortReply(buf), nil -} - -// grabPortReply reads a byte slice into a GrabPortReply value. -func grabPortReply(buf []byte) *GrabPortReply { - v := new(GrabPortReply) - b := 1 // skip reply determinant - - v.Result = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units + v.Value = int32(xgb.Get32(buf[b:])) b += 4 return v } -// Write request to wire for GrabPort -// grabPortRequest writes a GrabPort request to a byte slice. -func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { +// Write request to wire for GetPortAttribute +// getPortAttributeRequest writes a GetPortAttribute request to a byte slice. +func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []byte { size := 12 b := 0 buf := make([]byte, size) @@ -1549,7 +1273,7 @@ func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 3 // request opcode + buf[b] = 14 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1558,106 +1282,48 @@ func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { xgb.Put32(buf[b:], uint32(Port)) b += 4 - xgb.Put32(buf[b:], uint32(Time)) + xgb.Put32(buf[b:], uint32(Attribute)) b += 4 return buf } -// UngrabPortCookie is a cookie used only for UngrabPort requests. -type UngrabPortCookie struct { +// GetStillCookie is a cookie used only for GetStill requests. +type GetStillCookie struct { *xgb.Cookie } -// UngrabPort sends an unchecked request. +// GetStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { +func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) - return UngrabPortCookie{cookie} + c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetStillCookie{cookie} } -// UngrabPortChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabPortCookie.Check() -func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { +// GetStillChecked sends a checked request. +// If an error occurs, it can be retrieved using GetStillCookie.Check() +func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) - return UngrabPortCookie{cookie} + c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return GetStillCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabPortCookie) Check() error { +func (cook GetStillCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for UngrabPort -// ungrabPortRequest writes a UngrabPort request to a byte slice. -func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - return buf -} - -// PutVideoCookie is a cookie used only for PutVideo requests. -type PutVideoCookie struct { - *xgb.Cookie -} - -// PutVideo sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return PutVideoCookie{cookie} -} - -// PutVideoChecked sends a checked request. -// If an error occurs, it can be retrieved using PutVideoCookie.Check() -func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return PutVideoCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PutVideoCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PutVideo -// putVideoRequest writes a PutVideo request to a byte slice. -func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +// Write request to wire for GetStill +// getStillRequest writes a GetStill request to a byte slice. +func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1665,92 +1331,7 @@ func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Gc)) - b += 4 - - xgb.Put16(buf[b:], uint16(VidX)) - b += 2 - - xgb.Put16(buf[b:], uint16(VidY)) - b += 2 - - xgb.Put16(buf[b:], VidW) - b += 2 - - xgb.Put16(buf[b:], VidH) - b += 2 - - xgb.Put16(buf[b:], uint16(DrwX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DrwY)) - b += 2 - - xgb.Put16(buf[b:], DrwW) - b += 2 - - xgb.Put16(buf[b:], DrwH) - b += 2 - - return buf -} - -// PutStillCookie is a cookie used only for PutStill requests. -type PutStillCookie struct { - *xgb.Cookie -} - -// PutStill sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return PutStillCookie{cookie} -} - -// PutStillChecked sends a checked request. -// If an error occurs, it can be retrieved using PutStillCookie.Check() -func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return PutStillCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PutStillCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for PutStill -// putStillRequest writes a PutStill request to a byte slice. -func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { - size := 32 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 6 // request opcode + buf[b] = 8 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1877,42 +1458,322 @@ func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// GetStillCookie is a cookie used only for GetStill requests. -type GetStillCookie struct { +// GrabPortCookie is a cookie used only for GrabPort requests. +type GrabPortCookie struct { *xgb.Cookie } -// GetStill sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { +// GrabPort sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() +func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return GetStillCookie{cookie} + cookie := c.NewCookie(true, true) + c.NewRequest(grabPortRequest(c, Port, Time), cookie) + return GrabPortCookie{cookie} } -// GetStillChecked sends a checked request. -// If an error occurs, it can be retrieved using GetStillCookie.Check() -func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { +// GrabPortUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(grabPortRequest(c, Port, Time), cookie) + return GrabPortCookie{cookie} +} + +// GrabPortReply represents the data returned from a GrabPort request. +type GrabPortReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Result byte +} + +// Reply blocks and returns the reply data for a GrabPort request. +func (cook GrabPortCookie) Reply() (*GrabPortReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return grabPortReply(buf), nil +} + +// grabPortReply reads a byte slice into a GrabPortReply value. +func grabPortReply(buf []byte) *GrabPortReply { + v := new(GrabPortReply) + b := 1 // skip reply determinant + + v.Result = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + return v +} + +// Write request to wire for GrabPort +// grabPortRequest writes a GrabPort request to a byte slice. +func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} + +// ListImageFormatsCookie is a cookie used only for ListImageFormats requests. +type ListImageFormatsCookie struct { + *xgb.Cookie +} + +// ListImageFormats sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() +func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(listImageFormatsRequest(c, Port), cookie) + return ListImageFormatsCookie{cookie} +} + +// ListImageFormatsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(listImageFormatsRequest(c, Port), cookie) + return ListImageFormatsCookie{cookie} +} + +// ListImageFormatsReply represents the data returned from a ListImageFormats request. +type ListImageFormatsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumFormats uint32 + // padding: 20 bytes + Format []ImageFormatInfo // size: ImageFormatInfoListSize(Format) +} + +// Reply blocks and returns the reply data for a ListImageFormats request. +func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listImageFormatsReply(buf), nil +} + +// listImageFormatsReply reads a byte slice into a ListImageFormatsReply value. +func listImageFormatsReply(buf []byte) *ListImageFormatsReply { + v := new(ListImageFormatsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumFormats = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Format = make([]ImageFormatInfo, v.NumFormats) + b += ImageFormatInfoReadList(buf[b:], v.Format) + + return v +} + +// Write request to wire for ListImageFormats +// listImageFormatsRequest writes a ListImageFormats request to a byte slice. +func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 16 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + return buf +} + +// PutImageCookie is a cookie used only for PutImage requests. +type PutImageCookie struct { + *xgb.Cookie +} + +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return PutImageCookie{cookie} +} + +// PutImageChecked sends a checked request. +// If an error occurs, it can be retrieved using PutImageCookie.Check() +func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(getStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) - return GetStillCookie{cookie} + c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) + return PutImageCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GetStillCookie) Check() error { +func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for GetStill -// getStillRequest writes a GetStill request to a byte slice. -func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { +// Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. +func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { + size := xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 18 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put32(buf[b:], Id) + b += 4 + + xgb.Put16(buf[b:], uint16(SrcX)) + b += 2 + + xgb.Put16(buf[b:], uint16(SrcY)) + b += 2 + + xgb.Put16(buf[b:], SrcW) + b += 2 + + xgb.Put16(buf[b:], SrcH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + + xgb.Put16(buf[b:], Width) + b += 2 + + xgb.Put16(buf[b:], Height) + b += 2 + + copy(buf[b:], Data[:len(Data)]) + b += xgb.Pad(int(len(Data))) + + return buf +} + +// PutStillCookie is a cookie used only for PutStill requests. +type PutStillCookie struct { + *xgb.Cookie +} + +// PutStill sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutStillCookie{cookie} +} + +// PutStillChecked sends a checked request. +// If an error occurs, it can be retrieved using PutStillCookie.Check() +func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(putStillRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutStillCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook PutStillCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for PutStill +// putStillRequest writes a PutStill request to a byte slice. +func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { size := 32 b := 0 buf := make([]byte, size) @@ -1920,7 +1781,7 @@ func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 8 // request opcode + buf[b] = 6 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -1962,50 +1823,50 @@ func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto return buf } -// StopVideoCookie is a cookie used only for StopVideo requests. -type StopVideoCookie struct { +// PutVideoCookie is a cookie used only for PutVideo requests. +type PutVideoCookie struct { *xgb.Cookie } -// StopVideo sends an unchecked request. +// PutVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { +func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) - return StopVideoCookie{cookie} + c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutVideoCookie{cookie} } -// StopVideoChecked sends a checked request. -// If an error occurs, it can be retrieved using StopVideoCookie.Check() -func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { +// PutVideoChecked sends a checked request. +// If an error occurs, it can be retrieved using PutVideoCookie.Check() +func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) - return StopVideoCookie{cookie} + c.NewRequest(putVideoRequest(c, Port, Drawable, Gc, VidX, VidY, VidW, VidH, DrwX, DrwY, DrwW, DrwH), cookie) + return PutVideoCookie{cookie} } // Check returns an error if one occurred for checked requests that are not expecting a reply. // This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook StopVideoCookie) Check() error { +func (cook PutVideoCookie) Check() error { return cook.Cookie.Check() } -// Write request to wire for StopVideo -// stopVideoRequest writes a StopVideo request to a byte slice. -func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { - size := 12 +// Write request to wire for PutVideo +// putVideoRequest writes a PutVideo request to a byte slice. +func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) []byte { + size := 32 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 9 // request opcode + buf[b] = 5 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2017,134 +1878,128 @@ func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { xgb.Put32(buf[b:], uint32(Drawable)) b += 4 + xgb.Put32(buf[b:], uint32(Gc)) + b += 4 + + xgb.Put16(buf[b:], uint16(VidX)) + b += 2 + + xgb.Put16(buf[b:], uint16(VidY)) + b += 2 + + xgb.Put16(buf[b:], VidW) + b += 2 + + xgb.Put16(buf[b:], VidH) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwX)) + b += 2 + + xgb.Put16(buf[b:], uint16(DrwY)) + b += 2 + + xgb.Put16(buf[b:], DrwW) + b += 2 + + xgb.Put16(buf[b:], DrwH) + b += 2 + return buf } -// SelectVideoNotifyCookie is a cookie used only for SelectVideoNotify requests. -type SelectVideoNotifyCookie struct { +// QueryAdaptorsCookie is a cookie used only for QueryAdaptors requests. +type QueryAdaptorsCookie struct { *xgb.Cookie } -// SelectVideoNotify sends an unchecked request. +// QueryAdaptors sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() +func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryAdaptorsRequest(c, Window), cookie) + return QueryAdaptorsCookie{cookie} +} + +// QueryAdaptorsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { +func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) - return SelectVideoNotifyCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(queryAdaptorsRequest(c, Window), cookie) + return QueryAdaptorsCookie{cookie} } -// SelectVideoNotifyChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() -func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") +// QueryAdaptorsReply represents the data returned from a QueryAdaptors request. +type QueryAdaptorsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumAdaptors uint16 + // padding: 22 bytes + Info []AdaptorInfo // size: AdaptorInfoListSize(Info) +} + +// Reply blocks and returns the reply data for a QueryAdaptors request. +func (cook QueryAdaptorsCookie) Reply() (*QueryAdaptorsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) - return SelectVideoNotifyCookie{cookie} + if buf == nil { + return nil, nil + } + return queryAdaptorsReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectVideoNotifyCookie) Check() error { - return cook.Cookie.Check() +// queryAdaptorsReply reads a byte slice into a QueryAdaptorsReply value. +func queryAdaptorsReply(buf []byte) *QueryAdaptorsReply { + v := new(QueryAdaptorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAdaptors = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]AdaptorInfo, v.NumAdaptors) + b += AdaptorInfoReadList(buf[b:], v.Info) + + return v } -// Write request to wire for SelectVideoNotify -// selectVideoNotifyRequest writes a SelectVideoNotify request to a byte slice. -func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) []byte { - size := 12 +// Write request to wire for QueryAdaptors +// queryAdaptorsRequest writes a QueryAdaptors request to a byte slice. +func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 10 // request opcode + buf[b] = 1 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Drawable)) + xgb.Put32(buf[b:], uint32(Window)) b += 4 - if Onoff { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - - return buf -} - -// SelectPortNotifyCookie is a cookie used only for SelectPortNotify requests. -type SelectPortNotifyCookie struct { - *xgb.Cookie -} - -// SelectPortNotify sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) - return SelectPortNotifyCookie{cookie} -} - -// SelectPortNotifyChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() -func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) - return SelectPortNotifyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectPortNotifyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectPortNotify -// selectPortNotifyRequest writes a SelectPortNotify request to a byte slice. -func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - if Onoff { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 3 // padding - return buf } @@ -2261,104 +2116,45 @@ func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW return buf } -// SetPortAttributeCookie is a cookie used only for SetPortAttribute requests. -type SetPortAttributeCookie struct { +// QueryEncodingsCookie is a cookie used only for QueryEncodings requests. +type QueryEncodingsCookie struct { *xgb.Cookie } -// SetPortAttribute sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { +// QueryEncodings sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() +func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) - return SetPortAttributeCookie{cookie} -} - -// SetPortAttributeChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() -func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) - return SetPortAttributeCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPortAttributeCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPortAttribute -// setPortAttributeRequest writes a SetPortAttribute request to a byte slice. -func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - xgb.Put32(buf[b:], uint32(Attribute)) - b += 4 - - xgb.Put32(buf[b:], uint32(Value)) - b += 4 - - return buf -} - -// GetPortAttributeCookie is a cookie used only for GetPortAttribute requests. -type GetPortAttributeCookie struct { - *xgb.Cookie -} - -// GetPortAttribute sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() -func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) - return GetPortAttributeCookie{cookie} + c.NewRequest(queryEncodingsRequest(c, Port), cookie) + return QueryEncodingsCookie{cookie} } -// GetPortAttributeUnchecked sends an unchecked request. +// QueryEncodingsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { +func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(getPortAttributeRequest(c, Port, Attribute), cookie) - return GetPortAttributeCookie{cookie} + c.NewRequest(queryEncodingsRequest(c, Port), cookie) + return QueryEncodingsCookie{cookie} } -// GetPortAttributeReply represents the data returned from a GetPortAttribute request. -type GetPortAttributeReply struct { +// QueryEncodingsReply represents the data returned from a QueryEncodings request. +type QueryEncodingsReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Value int32 + NumEncodings uint16 + // padding: 22 bytes + Info []EncodingInfo // size: EncodingInfoListSize(Info) } -// Reply blocks and returns the reply data for a GetPortAttribute request. -func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { +// Reply blocks and returns the reply data for a QueryEncodings request. +func (cook QueryEncodingsCookie) Reply() (*QueryEncodingsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -2366,12 +2162,12 @@ func (cook GetPortAttributeCookie) Reply() (*GetPortAttributeReply, error) { if buf == nil { return nil, nil } - return getPortAttributeReply(buf), nil + return queryEncodingsReply(buf), nil } -// getPortAttributeReply reads a byte slice into a GetPortAttributeReply value. -func getPortAttributeReply(buf []byte) *GetPortAttributeReply { - v := new(GetPortAttributeReply) +// queryEncodingsReply reads a byte slice into a QueryEncodingsReply value. +func queryEncodingsReply(buf []byte) *QueryEncodingsReply { + v := new(QueryEncodingsReply) b := 1 // skip reply determinant b += 1 // padding @@ -2382,117 +2178,20 @@ func getPortAttributeReply(buf []byte) *GetPortAttributeReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Value = int32(xgb.Get32(buf[b:])) - b += 4 + v.NumEncodings = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Info = make([]EncodingInfo, v.NumEncodings) + b += EncodingInfoReadList(buf[b:], v.Info) return v } -// Write request to wire for GetPortAttribute -// getPortAttributeRequest writes a GetPortAttribute request to a byte slice. -func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - - xgb.Put32(buf[b:], uint32(Attribute)) - b += 4 - - return buf -} - -// QueryPortAttributesCookie is a cookie used only for QueryPortAttributes requests. -type QueryPortAttributesCookie struct { - *xgb.Cookie -} - -// QueryPortAttributes sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() -func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryPortAttributesRequest(c, Port), cookie) - return QueryPortAttributesCookie{cookie} -} - -// QueryPortAttributesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryPortAttributesRequest(c, Port), cookie) - return QueryPortAttributesCookie{cookie} -} - -// QueryPortAttributesReply represents the data returned from a QueryPortAttributes request. -type QueryPortAttributesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumAttributes uint32 - TextSize uint32 - // padding: 16 bytes - Attributes []AttributeInfo // size: AttributeInfoListSize(Attributes) -} - -// Reply blocks and returns the reply data for a QueryPortAttributes request. -func (cook QueryPortAttributesCookie) Reply() (*QueryPortAttributesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryPortAttributesReply(buf), nil -} - -// queryPortAttributesReply reads a byte slice into a QueryPortAttributesReply value. -func queryPortAttributesReply(buf []byte) *QueryPortAttributesReply { - v := new(QueryPortAttributesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumAttributes = xgb.Get32(buf[b:]) - b += 4 - - v.TextSize = xgb.Get32(buf[b:]) - b += 4 - - b += 16 // padding - - v.Attributes = make([]AttributeInfo, v.NumAttributes) - b += AttributeInfoReadList(buf[b:], v.Attributes) - - return v -} - -// Write request to wire for QueryPortAttributes -// queryPortAttributesRequest writes a QueryPortAttributes request to a byte slice. -func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { +// Write request to wire for QueryEncodings +// queryEncodingsRequest writes a QueryEncodings request to a byte slice. +func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -2500,7 +2199,7 @@ func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 15 // request opcode + buf[b] = 2 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2512,45 +2211,44 @@ func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { return buf } -// ListImageFormatsCookie is a cookie used only for ListImageFormats requests. -type ListImageFormatsCookie struct { +// QueryExtensionCookie is a cookie used only for QueryExtension requests. +type QueryExtensionCookie struct { *xgb.Cookie } -// ListImageFormats sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() -func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { +// QueryExtension sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() +func QueryExtension(c *xgb.Conn) QueryExtensionCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) - c.NewRequest(listImageFormatsRequest(c, Port), cookie) - return ListImageFormatsCookie{cookie} + c.NewRequest(queryExtensionRequest(c), cookie) + return QueryExtensionCookie{cookie} } -// ListImageFormatsUnchecked sends an unchecked request. +// QueryExtensionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { +func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) - c.NewRequest(listImageFormatsRequest(c, Port), cookie) - return ListImageFormatsCookie{cookie} + c.NewRequest(queryExtensionRequest(c), cookie) + return QueryExtensionCookie{cookie} } -// ListImageFormatsReply represents the data returned from a ListImageFormats request. -type ListImageFormatsReply struct { +// QueryExtensionReply represents the data returned from a QueryExtension request. +type QueryExtensionReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - NumFormats uint32 - // padding: 20 bytes - Format []ImageFormatInfo // size: ImageFormatInfoListSize(Format) + Major uint16 + Minor uint16 } -// Reply blocks and returns the reply data for a ListImageFormats request. -func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { +// Reply blocks and returns the reply data for a QueryExtension request. +func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { return nil, err @@ -2558,12 +2256,12 @@ func (cook ListImageFormatsCookie) Reply() (*ListImageFormatsReply, error) { if buf == nil { return nil, nil } - return listImageFormatsReply(buf), nil + return queryExtensionReply(buf), nil } -// listImageFormatsReply reads a byte slice into a ListImageFormatsReply value. -func listImageFormatsReply(buf []byte) *ListImageFormatsReply { - v := new(ListImageFormatsReply) +// queryExtensionReply reads a byte slice into a QueryExtensionReply value. +func queryExtensionReply(buf []byte) *QueryExtensionReply { + v := new(QueryExtensionReply) b := 1 // skip reply determinant b += 1 // padding @@ -2574,36 +2272,31 @@ func listImageFormatsReply(buf []byte) *ListImageFormatsReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.NumFormats = xgb.Get32(buf[b:]) - b += 4 + v.Major = xgb.Get16(buf[b:]) + b += 2 - b += 20 // padding - - v.Format = make([]ImageFormatInfo, v.NumFormats) - b += ImageFormatInfoReadList(buf[b:], v.Format) + v.Minor = xgb.Get16(buf[b:]) + b += 2 return v } -// Write request to wire for ListImageFormats -// listImageFormatsRequest writes a ListImageFormats request to a byte slice. -func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { - size := 8 +// Write request to wire for QueryExtension +// queryExtensionRequest writes a QueryExtension request to a byte slice. +func queryExtensionRequest(c *xgb.Conn) []byte { + size := 4 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 16 // request opcode + buf[b] = 0 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 - xgb.Put32(buf[b:], uint32(Port)) - b += 4 - return buf } @@ -2735,50 +2428,94 @@ func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16 return buf } -// PutImageCookie is a cookie used only for PutImage requests. -type PutImageCookie struct { +// QueryPortAttributesCookie is a cookie used only for QueryPortAttributes requests. +type QueryPortAttributesCookie struct { *xgb.Cookie } -// PutImage sends an unchecked request. +// QueryPortAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() +func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryPortAttributesRequest(c, Port), cookie) + return QueryPortAttributesCookie{cookie} +} + +// QueryPortAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { +func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } - cookie := c.NewCookie(false, false) - c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) - return PutImageCookie{cookie} + cookie := c.NewCookie(false, true) + c.NewRequest(queryPortAttributesRequest(c, Port), cookie) + return QueryPortAttributesCookie{cookie} } -// PutImageChecked sends a checked request. -// If an error occurs, it can be retrieved using PutImageCookie.Check() -func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { - panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") +// QueryPortAttributesReply represents the data returned from a QueryPortAttributes request. +type QueryPortAttributesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumAttributes uint32 + TextSize uint32 + // padding: 16 bytes + Attributes []AttributeInfo // size: AttributeInfoListSize(Attributes) +} + +// Reply blocks and returns the reply data for a QueryPortAttributes request. +func (cook QueryPortAttributesCookie) Reply() (*QueryPortAttributesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err } - cookie := c.NewCookie(true, false) - c.NewRequest(putImageRequest(c, Port, Drawable, Gc, Id, SrcX, SrcY, SrcW, SrcH, DrwX, DrwY, DrwW, DrwH, Width, Height, Data), cookie) - return PutImageCookie{cookie} + if buf == nil { + return nil, nil + } + return queryPortAttributesReply(buf), nil } -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook PutImageCookie) Check() error { - return cook.Cookie.Check() +// queryPortAttributesReply reads a byte slice into a QueryPortAttributesReply value. +func queryPortAttributesReply(buf []byte) *QueryPortAttributesReply { + v := new(QueryPortAttributesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAttributes = xgb.Get32(buf[b:]) + b += 4 + + v.TextSize = xgb.Get32(buf[b:]) + b += 4 + + b += 16 // padding + + v.Attributes = make([]AttributeInfo, v.NumAttributes) + b += AttributeInfoReadList(buf[b:], v.Attributes) + + return v } -// Write request to wire for PutImage -// putImageRequest writes a PutImage request to a byte slice. -func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) []byte { - size := xgb.Pad((40 + xgb.Pad((len(Data) * 1)))) +// Write request to wire for QueryPortAttributes +// queryPortAttributesRequest writes a QueryPortAttributes request to a byte slice. +func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { + size := 8 b := 0 buf := make([]byte, size) buf[b] = c.Extensions["XVIDEO"] b += 1 - buf[b] = 18 // request opcode + buf[b] = 15 // request opcode b += 1 xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units @@ -2787,47 +2524,194 @@ func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto xgb.Put32(buf[b:], uint32(Port)) b += 4 + return buf +} + +// SelectPortNotifyCookie is a cookie used only for SelectPortNotify requests. +type SelectPortNotifyCookie struct { + *xgb.Cookie +} + +// SelectPortNotify sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) + return SelectPortNotifyCookie{cookie} +} + +// SelectPortNotifyChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() +func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectPortNotifyRequest(c, Port, Onoff), cookie) + return SelectPortNotifyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectPortNotifyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectPortNotify +// selectPortNotifyRequest writes a SelectPortNotify request to a byte slice. +func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 11 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// SelectVideoNotifyCookie is a cookie used only for SelectVideoNotify requests. +type SelectVideoNotifyCookie struct { + *xgb.Cookie +} + +// SelectVideoNotify sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) + return SelectVideoNotifyCookie{cookie} +} + +// SelectVideoNotifyChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() +func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(selectVideoNotifyRequest(c, Drawable, Onoff), cookie) + return SelectVideoNotifyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SelectVideoNotifyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SelectVideoNotify +// selectVideoNotifyRequest writes a SelectVideoNotify request to a byte slice. +func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 10 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + xgb.Put32(buf[b:], uint32(Drawable)) b += 4 - xgb.Put32(buf[b:], uint32(Gc)) + if Onoff { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + +// SetPortAttributeCookie is a cookie used only for SetPortAttribute requests. +type SetPortAttributeCookie struct { + *xgb.Cookie +} + +// SetPortAttribute sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) + return SetPortAttributeCookie{cookie} +} + +// SetPortAttributeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() +func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setPortAttributeRequest(c, Port, Attribute, Value), cookie) + return SetPortAttributeCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetPortAttributeCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetPortAttribute +// setPortAttributeRequest writes a SetPortAttribute request to a byte slice. +func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 13 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) b += 4 - xgb.Put32(buf[b:], Id) + xgb.Put32(buf[b:], uint32(Attribute)) b += 4 - xgb.Put16(buf[b:], uint16(SrcX)) - b += 2 - - xgb.Put16(buf[b:], uint16(SrcY)) - b += 2 - - xgb.Put16(buf[b:], SrcW) - b += 2 - - xgb.Put16(buf[b:], SrcH) - b += 2 - - xgb.Put16(buf[b:], uint16(DrwX)) - b += 2 - - xgb.Put16(buf[b:], uint16(DrwY)) - b += 2 - - xgb.Put16(buf[b:], DrwW) - b += 2 - - xgb.Put16(buf[b:], DrwH) - b += 2 - - xgb.Put16(buf[b:], Width) - b += 2 - - xgb.Put16(buf[b:], Height) - b += 2 - - copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + xgb.Put32(buf[b:], uint32(Value)) + b += 4 return buf } @@ -2936,3 +2820,119 @@ func shmPutImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xpr return buf } + +// StopVideoCookie is a cookie used only for StopVideo requests. +type StopVideoCookie struct { + *xgb.Cookie +} + +// StopVideo sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) + return StopVideoCookie{cookie} +} + +// StopVideoChecked sends a checked request. +// If an error occurs, it can be retrieved using StopVideoCookie.Check() +func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(stopVideoRequest(c, Port, Drawable), cookie) + return StopVideoCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook StopVideoCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for StopVideo +// stopVideoRequest writes a StopVideo request to a byte slice. +func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 9 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Drawable)) + b += 4 + + return buf +} + +// UngrabPortCookie is a cookie used only for UngrabPort requests. +type UngrabPortCookie struct { + *xgb.Cookie +} + +// UngrabPort sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) + return UngrabPortCookie{cookie} +} + +// UngrabPortChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabPortCookie.Check() +func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + if _, ok := c.Extensions["XVIDEO"]; !ok { + panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(ungrabPortRequest(c, Port, Time), cookie) + return UngrabPortCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook UngrabPortCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for UngrabPort +// ungrabPortRequest writes a UngrabPort request to a byte slice. +func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Port)) + b += 4 + + xgb.Put32(buf[b:], uint32(Time)) + b += 4 + + return buf +} diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 0ddf369..9bcb60b 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -2,7 +2,7 @@ package xvmc /* - This file was generated by xvmc.xml on Jun 5 2012 12:12:00am EDT. + This file was generated by xvmc.xml on Aug 11 2013 8:39:44pm EDT. This file is automatically generated. Edit at your peril! */ @@ -41,30 +41,6 @@ func init() { xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { @@ -75,16 +51,6 @@ func NewContextId(c *xgb.Conn) (Context, error) { return Context(id), nil } -type Surface uint32 - -func NewSurfaceId(c *xgb.Conn) (Surface, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Surface(id), nil -} - type Subpicture uint32 func NewSubpictureId(c *xgb.Conn) (Subpicture, error) { @@ -95,6 +61,16 @@ func NewSubpictureId(c *xgb.Conn) (Subpicture, error) { return Subpicture(id), nil } +type Surface uint32 + +func NewSurfaceId(c *xgb.Conn) (Surface, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Surface(id), nil +} + type SurfaceInfo struct { Id Surface ChromaFormat uint16 @@ -198,189 +174,29 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { return b } -// QueryVersionCookie is a cookie used only for QueryVersion requests. -type QueryVersionCookie struct { - *xgb.Cookie -} +// Skipping definition for base type 'Bool' -// QueryVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() -func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Byte' -// QueryVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryVersionRequest(c), cookie) - return QueryVersionCookie{cookie} -} +// Skipping definition for base type 'Card8' -// QueryVersionReply represents the data returned from a QueryVersion request. -type QueryVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Major uint32 - Minor uint32 -} +// Skipping definition for base type 'Char' -// Reply blocks and returns the reply data for a QueryVersion request. -func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryVersionReply(buf), nil -} +// Skipping definition for base type 'Void' -// queryVersionReply reads a byte slice into a QueryVersionReply value. -func queryVersionReply(buf []byte) *QueryVersionReply { - v := new(QueryVersionReply) - b := 1 // skip reply determinant +// Skipping definition for base type 'Double' - b += 1 // padding +// Skipping definition for base type 'Float' - v.Sequence = xgb.Get16(buf[b:]) - b += 2 +// Skipping definition for base type 'Int16' - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 +// Skipping definition for base type 'Int32' - v.Major = xgb.Get32(buf[b:]) - b += 4 +// Skipping definition for base type 'Int8' - v.Minor = xgb.Get32(buf[b:]) - b += 4 +// Skipping definition for base type 'Card16' - return v -} - -// Write request to wire for QueryVersion -// queryVersionRequest writes a QueryVersion request to a byte slice. -func queryVersionRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests. -type ListSurfaceTypesCookie struct { - *xgb.Cookie -} - -// ListSurfaceTypes sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() -func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) - return ListSurfaceTypesCookie{cookie} -} - -// ListSurfaceTypesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) - return ListSurfaceTypesCookie{cookie} -} - -// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request. -type ListSurfaceTypesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Num uint32 - // padding: 20 bytes - Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24)) -} - -// Reply blocks and returns the reply data for a ListSurfaceTypes request. -func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listSurfaceTypesReply(buf), nil -} - -// listSurfaceTypesReply reads a byte slice into a ListSurfaceTypesReply value. -func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply { - v := new(ListSurfaceTypesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Num = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Surfaces = make([]SurfaceInfo, v.Num) - b += SurfaceInfoReadList(buf[b:], v.Surfaces) - - return v -} - -// Write request to wire for ListSurfaceTypes -// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice. -func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(PortId)) - b += 4 - - return buf -} +// Skipping definition for base type 'Card32' // CreateContextCookie is a cookie used only for CreateContext requests. type CreateContextCookie struct { @@ -504,214 +320,6 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac return buf } -// DestroyContextCookie is a cookie used only for DestroyContext requests. -type DestroyContextCookie struct { - *xgb.Cookie -} - -// DestroyContext sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyContextRequest(c, ContextId), cookie) - return DestroyContextCookie{cookie} -} - -// DestroyContextChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyContextCookie.Check() -func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyContextRequest(c, ContextId), cookie) - return DestroyContextCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyContextCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyContext -// destroyContextRequest writes a DestroyContext request to a byte slice. -func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(ContextId)) - b += 4 - - return buf -} - -// CreateSurfaceCookie is a cookie used only for CreateSurface requests. -type CreateSurfaceCookie struct { - *xgb.Cookie -} - -// CreateSurface sends a checked request. -// If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() -func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) - return CreateSurfaceCookie{cookie} -} - -// CreateSurfaceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) - return CreateSurfaceCookie{cookie} -} - -// CreateSurfaceReply represents the data returned from a CreateSurface request. -type CreateSurfaceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - // padding: 24 bytes - PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a CreateSurface request. -func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return createSurfaceReply(buf), nil -} - -// createSurfaceReply reads a byte slice into a CreateSurfaceReply value. -func createSurfaceReply(buf []byte) *CreateSurfaceReply { - v := new(CreateSurfaceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - b += 24 // padding - - v.PrivData = make([]uint32, v.Length) - for i := 0; i < int(v.Length); i++ { - v.PrivData[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for CreateSurface -// createSurfaceRequest writes a CreateSurface request to a byte slice. -func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - xgb.Put32(buf[b:], uint32(ContextId)) - b += 4 - - return buf -} - -// DestroySurfaceCookie is a cookie used only for DestroySurface requests. -type DestroySurfaceCookie struct { - *xgb.Cookie -} - -// DestroySurface sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) - return DestroySurfaceCookie{cookie} -} - -// DestroySurfaceChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() -func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { - panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) - return DestroySurfaceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroySurfaceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroySurface -// destroySurfaceRequest writes a DestroySurface request to a byte slice. -func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(SurfaceId)) - b += 4 - - return buf -} - // CreateSubpictureCookie is a cookie used only for CreateSubpicture requests. type CreateSubpictureCookie struct { *xgb.Cookie @@ -840,6 +448,159 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte return buf } +// CreateSurfaceCookie is a cookie used only for CreateSurface requests. +type CreateSurfaceCookie struct { + *xgb.Cookie +} + +// CreateSurface sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() +func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) + return CreateSurfaceCookie{cookie} +} + +// CreateSurfaceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie) + return CreateSurfaceCookie{cookie} +} + +// CreateSurfaceReply represents the data returned from a CreateSurface request. +type CreateSurfaceReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + // padding: 24 bytes + PrivData []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a CreateSurface request. +func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createSurfaceReply(buf), nil +} + +// createSurfaceReply reads a byte slice into a CreateSurfaceReply value. +func createSurfaceReply(buf []byte) *CreateSurfaceReply { + v := new(CreateSurfaceReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + v.PrivData = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.PrivData[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for CreateSurface +// createSurfaceRequest writes a CreateSurface request to a byte slice. +func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + xgb.Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + +// DestroyContextCookie is a cookie used only for DestroyContext requests. +type DestroyContextCookie struct { + *xgb.Cookie +} + +// DestroyContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroyContextRequest(c, ContextId), cookie) + return DestroyContextCookie{cookie} +} + +// DestroyContextChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyContextCookie.Check() +func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroyContextRequest(c, ContextId), cookie) + return DestroyContextCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroyContextCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroyContext +// destroyContextRequest writes a DestroyContext request to a byte slice. +func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 3 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextId)) + b += 4 + + return buf +} + // DestroySubpictureCookie is a cookie used only for DestroySubpicture requests. type DestroySubpictureCookie struct { *xgb.Cookie @@ -895,6 +656,61 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { return buf } +// DestroySurfaceCookie is a cookie used only for DestroySurface requests. +type DestroySurfaceCookie struct { + *xgb.Cookie +} + +// DestroySurface sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) + return DestroySurfaceCookie{cookie} +} + +// DestroySurfaceChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() +func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie) + return DestroySurfaceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DestroySurfaceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DestroySurface +// destroySurfaceRequest writes a DestroySurface request to a byte slice. +func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(SurfaceId)) + b += 4 + + return buf +} + // ListSubpictureTypesCookie is a cookie used only for ListSubpictureTypes requests. type ListSubpictureTypesCookie struct { *xgb.Cookie @@ -992,3 +808,187 @@ func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) return buf } + +// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests. +type ListSurfaceTypesCookie struct { + *xgb.Cookie +} + +// ListSurfaceTypes sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() +func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) + return ListSurfaceTypesCookie{cookie} +} + +// ListSurfaceTypesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie) + return ListSurfaceTypesCookie{cookie} +} + +// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request. +type ListSurfaceTypesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Num uint32 + // padding: 20 bytes + Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24)) +} + +// Reply blocks and returns the reply data for a ListSurfaceTypes request. +func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listSurfaceTypesReply(buf), nil +} + +// listSurfaceTypesReply reads a byte slice into a ListSurfaceTypesReply value. +func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply { + v := new(ListSurfaceTypesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Num = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Surfaces = make([]SurfaceInfo, v.Num) + b += SurfaceInfoReadList(buf[b:], v.Surfaces) + + return v +} + +// Write request to wire for ListSurfaceTypes +// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice. +func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 1 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(PortId)) + b += 4 + + return buf +} + +// QueryVersionCookie is a cookie used only for QueryVersion requests. +type QueryVersionCookie struct { + *xgb.Cookie +} + +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() +func QueryVersion(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryVersionRequest(c), cookie) + return QueryVersionCookie{cookie} +} + +// QueryVersionReply represents the data returned from a QueryVersion request. +type QueryVersionReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Major uint32 + Minor uint32 +} + +// Reply blocks and returns the reply data for a QueryVersion request. +func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryVersionReply(buf), nil +} + +// queryVersionReply reads a byte slice into a QueryVersionReply value. +func queryVersionReply(buf []byte) *QueryVersionReply { + v := new(QueryVersionReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Major = xgb.Get32(buf[b:]) + b += 4 + + v.Minor = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. +func queryVersionRequest(c *xgb.Conn) []byte { + size := 4 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + b += 1 + + buf[b] = 0 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + return buf +} From b06a8ca97625c1134449c3af65d9ac3fb251a613 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:45:36 -0400 Subject: [PATCH 65/90] Don't needlessly change source files every time. --- nexgb/bigreq/bigreq.go | 5 +---- nexgb/composite/composite.go | 5 +---- nexgb/damage/damage.go | 5 +---- nexgb/dpms/dpms.go | 5 +---- nexgb/dri2/dri2.go | 5 +---- nexgb/ge/ge.go | 5 +---- nexgb/glx/glx.go | 5 +---- nexgb/randr/randr.go | 5 +---- nexgb/record/record.go | 5 +---- nexgb/render/render.go | 5 +---- nexgb/res/res.go | 5 +---- nexgb/screensaver/screensaver.go | 5 +---- nexgb/shape/shape.go | 5 +---- nexgb/shm/shm.go | 5 +---- nexgb/sync/sync.go | 5 +---- nexgb/xcmisc/xcmisc.go | 5 +---- nexgb/xevie/xevie.go | 5 +---- nexgb/xf86dri/xf86dri.go | 5 +---- nexgb/xf86vidmode/xf86vidmode.go | 5 +---- nexgb/xfixes/xfixes.go | 5 +---- nexgb/xgbgen/context.go | 8 ++------ nexgb/xinerama/xinerama.go | 5 +---- nexgb/xinput/xinput.go | 5 +---- nexgb/xprint/xprint.go | 5 +---- nexgb/xproto/xproto.go | 5 +---- nexgb/xselinux/xselinux.go | 5 +---- nexgb/xtest/xtest.go | 5 +---- nexgb/xv/xv.go | 5 +---- nexgb/xvmc/xvmc.go | 5 +---- 29 files changed, 30 insertions(+), 118 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index 2ff767a..d2adcc7 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -1,10 +1,7 @@ // Package bigreq is the X client API for the BIG-REQUESTS extension. package bigreq -/* - This file was generated by bigreq.xml on Aug 11 2013 8:39:42pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from bigreq.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index de1b773..c951a69 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -1,10 +1,7 @@ // Package composite is the X client API for the Composite extension. package composite -/* - This file was generated by composite.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from composite.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 72e0f3d..0ab7668 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -1,10 +1,7 @@ // Package damage is the X client API for the DAMAGE extension. package damage -/* - This file was generated by damage.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from damage.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 96d82f0..75ec85d 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -1,10 +1,7 @@ // Package dpms is the X client API for the DPMS extension. package dpms -/* - This file was generated by dpms.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from dpms.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 3c63af5..1561832 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -1,10 +1,7 @@ // Package dri2 is the X client API for the DRI2 extension. package dri2 -/* - This file was generated by dri2.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from dri2.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 5e01d1e..1cfd918 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -1,10 +1,7 @@ // Package ge is the X client API for the Generic Event Extension extension. package ge -/* - This file was generated by ge.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from ge.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index facf12e..84d37b5 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -1,10 +1,7 @@ // Package glx is the X client API for the GLX extension. package glx -/* - This file was generated by glx.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from glx.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 81104eb..8891f98 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -1,10 +1,7 @@ // Package randr is the X client API for the RANDR extension. package randr -/* - This file was generated by randr.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from randr.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 2bbfe1c..8cb495e 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -1,10 +1,7 @@ // Package record is the X client API for the RECORD extension. package record -/* - This file was generated by record.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from record.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/render/render.go b/nexgb/render/render.go index c6f5095..7851e02 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -1,10 +1,7 @@ // Package render is the X client API for the RENDER extension. package render -/* - This file was generated by render.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from render.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 671f691..be0d6ce 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -1,10 +1,7 @@ // Package res is the X client API for the X-Resource extension. package res -/* - This file was generated by res.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from res.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index f693b52..e552c6d 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -1,10 +1,7 @@ // Package screensaver is the X client API for the MIT-SCREEN-SAVER extension. package screensaver -/* - This file was generated by screensaver.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from screensaver.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index d0d5b8c..93ff9d0 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -1,10 +1,7 @@ // Package shape is the X client API for the SHAPE extension. package shape -/* - This file was generated by shape.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from shape.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index bd5d638..3e086c4 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -1,10 +1,7 @@ // Package shm is the X client API for the MIT-SHM extension. package shm -/* - This file was generated by shm.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from shm.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index ff83384..93fb2b7 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -1,10 +1,7 @@ // Package sync is the X client API for the SYNC extension. package sync -/* - This file was generated by sync.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from sync.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index e32ae42..5cff5f1 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -1,10 +1,7 @@ // Package xcmisc is the X client API for the XC-MISC extension. package xcmisc -/* - This file was generated by xc_misc.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xc_misc.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 0dd5aca..a8303a2 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -1,10 +1,7 @@ // Package xevie is the X client API for the XEVIE extension. package xevie -/* - This file was generated by xevie.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xevie.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 1a6fddf..5180b76 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -1,10 +1,7 @@ // Package xf86dri is the X client API for the XFree86-DRI extension. package xf86dri -/* - This file was generated by xf86dri.xml on Aug 11 2013 8:39:43pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xf86dri.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 17c3f3c..55ca67b 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -1,10 +1,7 @@ // Package xf86vidmode is the X client API for the XFree86-VidModeExtension extension. package xf86vidmode -/* - This file was generated by xf86vidmode.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xf86vidmode.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 76ffddf..94e96e1 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -1,10 +1,7 @@ // Package xfixes is the X client API for the XFIXES extension. package xfixes -/* - This file was generated by xfixes.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xfixes.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index 697413e..af0f598 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -6,7 +6,6 @@ import ( "fmt" "log" "sort" - "time" ) // Context represents the protocol we're converting to Go, and a writer @@ -56,11 +55,8 @@ func (c *Context) Morph(xmlBytes []byte) { c.protocol.PkgName(), c.protocol.ExtXName) c.Putln("package %s", c.protocol.PkgName()) c.Putln("") - c.Putln("/*") - c.Putln("\tThis file was generated by %s.xml on %s.", - c.protocol.Name, time.Now().Format("Jan 2 2006 3:04:05pm MST")) - c.Putln("\tThis file is automatically generated. Edit at your peril!") - c.Putln("*/") + c.Putln("// This file is automatically generated from %s.xml. "+ + "Edit at your peril!", c.protocol.Name) c.Putln("") // Write imports. We always need to import at least xgb. diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index dd3732f..7426e8e 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -1,10 +1,7 @@ // Package xinerama is the X client API for the XINERAMA extension. package xinerama -/* - This file was generated by xinerama.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xinerama.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index c5a799d..931216e 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -1,10 +1,7 @@ // Package xinput is the X client API for the XInputExtension extension. package xinput -/* - This file was generated by xinput.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xinput.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 8dfc660..48557fe 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -1,10 +1,7 @@ // Package xprint is the X client API for the XpExtension extension. package xprint -/* - This file was generated by xprint.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xprint.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index f162b19..f775a81 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -1,10 +1,7 @@ // Package xproto is the X client API for the extension. package xproto -/* - This file was generated by xproto.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xproto.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index c7183bf..757a285 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -1,10 +1,7 @@ // Package xselinux is the X client API for the SELinux extension. package xselinux -/* - This file was generated by xselinux.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xselinux.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 505622a..982e9f9 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -1,10 +1,7 @@ // Package xtest is the X client API for the XTEST extension. package xtest -/* - This file was generated by xtest.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xtest.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index f5539b3..0a88632 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -1,10 +1,7 @@ // Package xv is the X client API for the XVideo extension. package xv -/* - This file was generated by xv.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xv.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 9bcb60b..f0988eb 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -1,10 +1,7 @@ // Package xvmc is the X client API for the XVideo-MotionCompensation extension. package xvmc -/* - This file was generated by xvmc.xml on Aug 11 2013 8:39:44pm EDT. - This file is automatically generated. Edit at your peril! -*/ +// This file is automatically generated from xvmc.xml. Edit at your peril! import ( "github.com/BurntSushi/xgb" From 38b293e74db6631873d5dfd74cf731eb7b76737d Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:54:15 -0400 Subject: [PATCH 66/90] Padding on a list is on the length of the list. There was a bug where padding was being computed on each element of the list. Close #5. --- nexgb/dri2/dri2.go | 8 +- nexgb/randr/randr.go | 36 ++++---- nexgb/record/record.go | 20 ++-- nexgb/render/render.go | 64 ++++++------- nexgb/res/res.go | 8 +- nexgb/sync/sync.go | 16 ++-- nexgb/xevie/xevie.go | 4 +- nexgb/xf86dri/xf86dri.go | 4 +- nexgb/xf86vidmode/xf86vidmode.go | 4 +- nexgb/xgbgen/go_struct.go | 4 +- nexgb/xinerama/xinerama.go | 4 +- nexgb/xinput/xinput.go | 152 +++++++++++++++---------------- nexgb/xprint/xprint.go | 4 +- nexgb/xproto/xproto.go | 80 ++++++++-------- nexgb/xselinux/xselinux.go | 4 +- nexgb/xv/xv.go | 28 +++--- nexgb/xvmc/xvmc.go | 4 +- 17 files changed, 222 insertions(+), 222 deletions(-) diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 1561832..df13661 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -86,9 +86,9 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -291,9 +291,9 @@ func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 8891f98..9eb8dc9 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -295,9 +295,9 @@ func CrtcChangeListBytes(buf []byte, list []CrtcChange) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Mode uint32 @@ -453,11 +453,17 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 +) + // Notify is the event number for a NotifyEvent. const Notify = 1 @@ -526,12 +532,6 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 -) - // NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). @@ -809,9 +809,9 @@ func OutputChangeListBytes(buf []byte, list []OutputChange) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type OutputProperty struct { @@ -889,9 +889,9 @@ func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type RefreshRates struct { @@ -950,9 +950,9 @@ func RefreshRatesListBytes(buf []byte, list []RefreshRates) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // RefreshRatesListSize computes the size (bytes) of a list of RefreshRates values. @@ -1174,9 +1174,9 @@ func ScreenSizeListBytes(buf []byte, list []ScreenSize) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 8cb495e..2644f13 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -143,9 +143,9 @@ func ClientInfoListBytes(buf []byte, list []ClientInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ClientInfoListSize computes the size (bytes) of a list of ClientInfo values. @@ -232,9 +232,9 @@ func ExtRangeListBytes(buf []byte, list []ExtRange) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -378,9 +378,9 @@ func RangeListBytes(buf []byte, list []Range) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Range16 struct { @@ -432,9 +432,9 @@ func Range16ListBytes(buf []byte, list []Range16) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Range8 struct { @@ -486,9 +486,9 @@ func Range8ListBytes(buf []byte, list []Range8) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 7851e02..7185d18 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -86,9 +86,9 @@ func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Color struct { @@ -154,9 +154,9 @@ func ColorListBytes(buf []byte, list []Color) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -266,9 +266,9 @@ func DirectformatListBytes(buf []byte, list []Directformat) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Fixed int32 @@ -444,9 +444,9 @@ func GlyphinfoListBytes(buf []byte, list []Glyphinfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Glyphset uint32 @@ -529,9 +529,9 @@ func IndexvalueListBytes(buf []byte, list []Indexvalue) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Linefix struct { @@ -589,9 +589,9 @@ func LinefixListBytes(buf []byte, list []Linefix) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // BadPictFormat is the error number for a BadPictFormat. @@ -812,9 +812,9 @@ func PictdepthListBytes(buf []byte, list []Pictdepth) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // PictdepthListSize computes the size (bytes) of a list of Pictdepth values. @@ -914,9 +914,9 @@ func PictforminfoListBytes(buf []byte, list []Pictforminfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Pictscreen struct { @@ -974,9 +974,9 @@ func PictscreenListBytes(buf []byte, list []Pictscreen) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // PictscreenListSize computes the size (bytes) of a list of Pictscreen values. @@ -1097,9 +1097,9 @@ func PictvisualListBytes(buf []byte, list []Pictvisual) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Pointfix struct { @@ -1151,9 +1151,9 @@ func PointfixListBytes(buf []byte, list []Pointfix) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -1229,9 +1229,9 @@ func SpanfixListBytes(buf []byte, list []Spanfix) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -1341,9 +1341,9 @@ func TransformListBytes(buf []byte, list []Transform) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Trap struct { @@ -1401,9 +1401,9 @@ func TrapListBytes(buf []byte, list []Trap) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Trapezoid struct { @@ -1475,9 +1475,9 @@ func TrapezoidListBytes(buf []byte, list []Trapezoid) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Triangle struct { @@ -1545,9 +1545,9 @@ func TriangleListBytes(buf []byte, list []Triangle) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/res/res.go b/nexgb/res/res.go index be0d6ce..20da54a 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -86,9 +86,9 @@ func ClientListBytes(buf []byte, list []Client) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Type struct { @@ -140,9 +140,9 @@ func TypeListBytes(buf []byte, list []Type) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 93fb2b7..3234d60 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -483,9 +483,9 @@ func Int64ListBytes(buf []byte, list []Int64) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Systemcounter struct { @@ -558,9 +558,9 @@ func SystemcounterListBytes(buf []byte, list []Systemcounter) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SystemcounterListSize computes the size (bytes) of a list of Systemcounter values. @@ -645,9 +645,9 @@ func TriggerListBytes(buf []byte, list []Trigger) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -710,9 +710,9 @@ func WaitconditionListBytes(buf []byte, list []Waitcondition) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index a8303a2..6da9158 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -82,9 +82,9 @@ func EventListBytes(buf []byte, list []Event) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 5180b76..46fabca 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -100,9 +100,9 @@ func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 55ca67b..5a3f63d 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -418,9 +418,9 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // BadModeUnsuitable is the error number for a BadModeUnsuitable. diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 984a336..0f18084 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -93,9 +93,9 @@ func (s *Struct) WriteList(c *Context) { c.Putln("for _, item := range list {") c.Putln("structBytes = item.Bytes()") c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += xgb.Pad(len(structBytes))") + c.Putln("b += len(structBytes)") c.Putln("}") - c.Putln("return b") + c.Putln("return xgb.Pad(b)") c.Putln("}") c.Putln("") } diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 7426e8e..28410c6 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -100,9 +100,9 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 931216e..30d5271 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -93,9 +93,9 @@ func AxisInfoListBytes(buf []byte, list []AxisInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type BellFeedbackCtl struct { @@ -180,9 +180,9 @@ func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type BellFeedbackState struct { @@ -267,9 +267,9 @@ func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type ButtonInfo struct { @@ -328,9 +328,9 @@ func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type ButtonState struct { @@ -402,9 +402,9 @@ func ButtonStateListBytes(buf []byte, list []ButtonState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ButtonStateListSize computes the size (bytes) of a list of ButtonState values. @@ -678,9 +678,9 @@ func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceAbsAreaState struct { @@ -774,9 +774,9 @@ func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceAbsCalibCtl struct { @@ -884,9 +884,9 @@ func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceAbsCalibState struct { @@ -994,9 +994,9 @@ func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // BadDeviceBusy is the error number for a BadDeviceBusy. @@ -1260,9 +1260,9 @@ func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceCoreState struct { @@ -1333,9 +1333,9 @@ func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceCtl struct { @@ -1387,9 +1387,9 @@ func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceEnableCtrl struct { @@ -1453,9 +1453,9 @@ func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceEnableState struct { @@ -1519,9 +1519,9 @@ func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type DeviceInfo struct { @@ -1592,9 +1592,9 @@ func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -2183,9 +2183,9 @@ func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. @@ -2295,9 +2295,9 @@ func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) in for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. @@ -2358,9 +2358,9 @@ func DeviceStateListBytes(buf []byte, list []DeviceState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // DeviceStateNotify is the event number for a DeviceStateNotifyEvent. @@ -2533,9 +2533,9 @@ func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -2755,9 +2755,9 @@ func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type FeedbackState struct { @@ -2816,9 +2816,9 @@ func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // FocusIn is the event number for a FocusInEvent. @@ -3012,9 +3012,9 @@ func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type InputInfo struct { @@ -3066,9 +3066,9 @@ func InputInfoListBytes(buf []byte, list []InputInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type InputState struct { @@ -3127,9 +3127,9 @@ func InputStateListBytes(buf []byte, list []InputState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type IntegerFeedbackCtl struct { @@ -3195,9 +3195,9 @@ func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type IntegerFeedbackState struct { @@ -3277,9 +3277,9 @@ func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type KbdFeedbackCtl struct { @@ -3394,9 +3394,9 @@ func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type KbdFeedbackState struct { @@ -3525,9 +3525,9 @@ func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. @@ -3616,9 +3616,9 @@ func KeyInfoListBytes(buf []byte, list []KeyInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type KeyState struct { @@ -3690,9 +3690,9 @@ func KeyStateListBytes(buf []byte, list []KeyState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // KeyStateListSize computes the size (bytes) of a list of KeyState values. @@ -3774,9 +3774,9 @@ func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type LedFeedbackState struct { @@ -3849,9 +3849,9 @@ func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // BadMode is the error number for a BadMode. @@ -4075,9 +4075,9 @@ func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type PtrFeedbackState struct { @@ -4162,9 +4162,9 @@ func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type StringFeedbackCtl struct { @@ -4249,9 +4249,9 @@ func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. @@ -4347,9 +4347,9 @@ func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. @@ -4437,9 +4437,9 @@ func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. @@ -4533,9 +4533,9 @@ func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 48557fe..be9f2e8 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -394,9 +394,9 @@ func PrinterListBytes(buf []byte, list []Printer) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // PrinterListSize computes the size (bytes) of a list of Printer values. diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index f775a81..1e5f4bb 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -189,9 +189,9 @@ func ArcListBytes(buf []byte, list []Arc) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -613,9 +613,9 @@ func Char2bListBytes(buf []byte, list []Char2b) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Charinfo struct { @@ -695,9 +695,9 @@ func CharinfoListBytes(buf []byte, list []Charinfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -1199,9 +1199,9 @@ func ColoritemListBytes(buf []byte, list []Coloritem) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Colormap uint32 @@ -1918,9 +1918,9 @@ func DepthInfoListBytes(buf []byte, list []DepthInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // DepthInfoListSize computes the size (bytes) of a list of DepthInfo values. @@ -2590,9 +2590,9 @@ func FontpropListBytes(buf []byte, list []Fontprop) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Format struct { @@ -2656,9 +2656,9 @@ func FormatListBytes(buf []byte, list []Format) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // BadGContext is the error number for a BadGContext. @@ -3063,9 +3063,9 @@ func HostListBytes(buf []byte, list []Host) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // HostListSize computes the size (bytes) of a list of Host values. @@ -4283,9 +4283,9 @@ func PointListBytes(buf []byte, list []Point) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -4466,9 +4466,9 @@ func RectangleListBytes(buf []byte, list []Rectangle) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ReparentNotify is the event number for a ReparentNotifyEvent. @@ -4791,9 +4791,9 @@ func RgbListBytes(buf []byte, list []Rgb) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type ScreenInfo struct { @@ -4957,9 +4957,9 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ScreenInfoListSize computes the size (bytes) of a list of ScreenInfo values. @@ -5039,9 +5039,9 @@ func SegmentListBytes(buf []byte, list []Segment) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SelectionClear is the event number for a SelectionClearEvent. @@ -5396,9 +5396,9 @@ func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SetupAuthenticateListSize computes the size (bytes) of a list of SetupAuthenticate values. @@ -5491,9 +5491,9 @@ func SetupFailedListBytes(buf []byte, list []SetupFailed) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SetupFailedListSize computes the size (bytes) of a list of SetupFailed values. @@ -5699,9 +5699,9 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SetupInfoListSize computes the size (bytes) of a list of SetupInfo values. @@ -5815,9 +5815,9 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SetupRequestListSize computes the size (bytes) of a list of SetupRequest values. @@ -5890,9 +5890,9 @@ func StrListBytes(buf []byte, list []Str) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // StrListSize computes the size (bytes) of a list of Str values. @@ -5969,9 +5969,9 @@ func TimecoordListBytes(buf []byte, list []Timecoord) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Timestamp uint32 @@ -6312,9 +6312,9 @@ func VisualInfoListBytes(buf []byte, list []VisualInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Visualid uint32 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 757a285..f24f5d7 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -115,9 +115,9 @@ func ListItemListBytes(buf []byte, list []ListItem) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ListItemListSize computes the size (bytes) of a list of ListItem values. diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 0a88632..5eefe77 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -130,9 +130,9 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // AdaptorInfoListSize computes the size (bytes) of a list of AdaptorInfo values. @@ -223,9 +223,9 @@ func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // AttributeInfoListSize computes the size (bytes) of a list of AttributeInfo values. @@ -474,9 +474,9 @@ func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // EncodingInfoListSize computes the size (bytes) of a list of EncodingInfo values. @@ -542,9 +542,9 @@ func FormatListBytes(buf []byte, list []Format) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -662,9 +662,9 @@ func ImageListBytes(buf []byte, list []Image) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ImageListSize computes the size (bytes) of a list of Image values. @@ -892,9 +892,9 @@ func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ImageFormatInfoListSize computes the size (bytes) of a list of ImageFormatInfo values. @@ -1062,9 +1062,9 @@ func RationalListBytes(buf []byte, list []Rational) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index f0988eb..5ab7108 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -166,9 +166,9 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' From 2104b8fcdff4e444cc441f128b7f3abdcf39bbd2 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Fri, 23 Aug 2013 01:16:12 +0200 Subject: [PATCH 67/90] Export the logger (again) Just enabling or disabling logging falls short of the power of interfaces of go. A user is forced to either accept the logging to stderr in the format defined by xgb or disable logging alltogether. By exporting the logger, we can actually let the user decide where to log in what format. --- nexgb/conn.go | 4 +-- nexgb/log.go | 85 --------------------------------------------------- nexgb/xgb.go | 28 +++++++++-------- 3 files changed, 18 insertions(+), 99 deletions(-) delete mode 100644 nexgb/log.go diff --git a/nexgb/conn.go b/nexgb/conn.go index 7f4cf08..41ba5a8 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -33,8 +33,8 @@ func (c *Conn) connect(display string) error { authName, authData, err := readAuthority(c.host, c.display) noauth := false if err != nil { - logger.Printf("Could not get authority info: %v", err) - logger.Println("Trying connection without authority info...") + Logger.Printf("Could not get authority info: %v", err) + Logger.Println("Trying connection without authority info...") authName = "" authData = []byte{} noauth = true diff --git a/nexgb/log.go b/nexgb/log.go deleted file mode 100644 index eaaa57e..0000000 --- a/nexgb/log.go +++ /dev/null @@ -1,85 +0,0 @@ -package xgb - -import ( - "log" - "os" -) - -// Log controls whether XGB emits errors to stderr. By default, it is enabled. -var PrintLog = true - -// log is a wrapper around a log.PrintLogger so we can control whether it should -// output anything. -type xgblog struct { - *log.Logger -} - -func newLogger() xgblog { - return xgblog{log.New(os.Stderr, "XGB: ", log.Lshortfile)} -} - -func (lg xgblog) Print(v ...interface{}) { - if PrintLog { - lg.Logger.Print(v...) - } -} - -func (lg xgblog) Printf(format string, v ...interface{}) { - if PrintLog { - lg.Logger.Printf(format, v...) - } -} - -func (lg xgblog) Println(v ...interface{}) { - if PrintLog { - lg.Logger.Println(v...) - } -} - -func (lg xgblog) Fatal(v ...interface{}) { - if PrintLog { - lg.Logger.Fatal(v...) - } else { - os.Exit(1) - } -} - -func (lg xgblog) Fatalf(format string, v ...interface{}) { - if PrintLog { - lg.Logger.Fatalf(format, v...) - } else { - os.Exit(1) - } -} - -func (lg xgblog) Fatalln(v ...interface{}) { - if PrintLog { - lg.Logger.Fatalln(v...) - } else { - os.Exit(1) - } -} - -func (lg xgblog) Panic(v ...interface{}) { - if PrintLog { - lg.Logger.Panic(v...) - } else { - panic("") - } -} - -func (lg xgblog) Panicf(format string, v ...interface{}) { - if PrintLog { - lg.Logger.Panicf(format, v...) - } else { - panic("") - } -} - -func (lg xgblog) Panicln(v ...interface{}) { - if PrintLog { - lg.Logger.Panicln(v...) - } else { - panic("") - } -} diff --git a/nexgb/xgb.go b/nexgb/xgb.go index c894be1..3c7964c 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -3,12 +3,16 @@ package xgb import ( "errors" "io" + "log" "net" + "os" "sync" ) var ( - logger = newLogger() + // Where to log error-messages. Defaults to stderr. + // To disable logging, just set this to log.New(ioutil.Discard, "", 0) + Logger = log.New(os.Stderr, "XGB: ", log.Lshortfile) // ExtLock is a lock used whenever new extensions are initialized. // It should not be used. It is exported for use in the extension @@ -328,8 +332,8 @@ func (c *Conn) noop() { // writeBuffer is a convenience function for writing a byte slice to the wire. func (c *Conn) writeBuffer(buf []byte) { if _, err := c.conn.Write(buf); err != nil { - logger.Printf("Write error: %s", err) - logger.Fatal("A write error is unrecoverable. Exiting...") + Logger.Printf("Write error: %s", err) + Logger.Fatal("A write error is unrecoverable. Exiting...") } } @@ -364,7 +368,7 @@ func (c *Conn) readResponses() { err, event, seq = nil, nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - logger.Println("A read error is unrecoverable.") + Logger.Println("A read error is unrecoverable.") panic(err) } @@ -374,7 +378,7 @@ func (c *Conn) readResponses() { // generated) by looking it up by the error number. newErrFun, ok := NewErrorFuncs[int(buf[1])] if !ok { - logger.Printf("BUG: Could not find error constructor function "+ + Logger.Printf("BUG: Could not find error constructor function "+ "for error with number %d.", buf[1]) continue } @@ -393,8 +397,8 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - logger.Printf("Read error: %s", err) - logger.Fatal("A read error is unrecoverable. Exiting...") + Logger.Printf("Read error: %s", err) + Logger.Fatal("A read error is unrecoverable. Exiting...") } replyBytes = biggerBuf } else { @@ -411,7 +415,7 @@ func (c *Conn) readResponses() { evNum := int(buf[0] & 127) newEventFun, ok := NewEventFuncs[evNum] if !ok { - logger.Printf("BUG: Could not find event construct function "+ + Logger.Printf("BUG: Could not find event construct function "+ "for event with number %d.", evNum) continue } @@ -461,7 +465,7 @@ func (c *Conn) readResponses() { } } else { // this is a reply if cookie.replyChan == nil { - logger.Printf("Reply with sequence id %d does not "+ + Logger.Printf("Reply with sequence id %d does not "+ "have a cookie with a valid reply channel.", seq) continue } else { @@ -474,12 +478,12 @@ func (c *Conn) readResponses() { switch { // Checked requests with replies case cookie.replyChan != nil && cookie.errorChan != nil: - logger.Printf("Found cookie with sequence id %d that is "+ + Logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply but will never get it. Currently "+ "on sequence number %d", cookie.Sequence, seq) // Unchecked requests with replies case cookie.replyChan != nil && cookie.pingChan != nil: - logger.Printf("Found cookie with sequence id %d that is "+ + Logger.Printf("Found cookie with sequence id %d that is "+ "expecting a reply (and not an error) but will never "+ "get it. Currently on sequence number %d", cookie.Sequence, seq) @@ -502,7 +506,7 @@ func processEventOrError(everr eventOrError) (Event, Error) { case Error: return nil, ee default: - logger.Printf("Invalid event/error type: %T", everr) + Logger.Printf("Invalid event/error type: %T", everr) return nil, nil } panic("unreachable") From 3b4adabee14855e6ce5345567ceeb566917625be Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:22:33 -0500 Subject: [PATCH 68/90] The `sync` and `xinput` extensions now use the `switch` field, which XGB does not currently support. Therefore, I'm removing the sync and xinput extensions. This affects issues #11 and #13. --- nexgb/Makefile | 12 +- nexgb/sync/sync.go | 2127 ------------ nexgb/xinput/xinput.go | 7483 ---------------------------------------- 3 files changed, 6 insertions(+), 9616 deletions(-) delete mode 100644 nexgb/sync/sync.go delete mode 100644 nexgb/xinput/xinput.go diff --git a/nexgb/Makefile b/nexgb/Makefile index 953b100..57e884a 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -18,9 +18,9 @@ XPROTO=/usr/share/xcb all: build-xgbgen \ bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \ ge.xml glx.xml randr.xml record.xml render.xml res.xml \ - screensaver.xml shape.xml shm.xml sync.xml xc_misc.xml \ + screensaver.xml shape.xml shm.xml xc_misc.xml \ xevie.xml xf86dri.xml xf86vidmode.xml xfixes.xml xinerama.xml \ - xinput.xml xprint.xml xproto.xml xselinux.xml xtest.xml \ + xprint.xml xproto.xml xselinux.xml xtest.xml \ xvmc.xml xv.xml build-xgbgen: @@ -28,8 +28,8 @@ build-xgbgen: # Builds each individual sub-package to make sure its valid Go code. build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ - record.b render.b res.b screensaver.b shape.b shm.b sync.b xcmisc.b \ - xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \ + record.b render.b res.b screensaver.b shape.b shm.b xcmisc.b \ + xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b \ xprint.b xproto.b xselinux.b xtest.b xv.b xvmc.b %.b: @@ -37,8 +37,8 @@ build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \ # Installs each individual sub-package. install: bigreq.i composite.i damage.i dpms.i dri2.i ge.i glx.i randr.i \ - record.i render.i res.i screensaver.i shape.i shm.i sync.i xcmisc.i \ - xevie.i xf86dri.i xf86vidmode.i xfixes.i xinerama.i xinput.i \ + record.i render.i res.i screensaver.i shape.i shm.i xcmisc.i \ + xevie.i xf86dri.i xf86vidmode.i xfixes.i xinerama.i \ xprint.i xproto.i xselinux.i xtest.i xv.i xvmc.i go install diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go deleted file mode 100644 index 3234d60..0000000 --- a/nexgb/sync/sync.go +++ /dev/null @@ -1,2127 +0,0 @@ -// Package sync is the X client API for the SYNC extension. -package sync - -// This file is automatically generated from sync.xml. Edit at your peril! - -import ( - "github.com/BurntSushi/xgb" - - "github.com/BurntSushi/xgb/xproto" -) - -// Init must be called before using the SYNC extension. -func Init(c *xgb.Conn) error { - reply, err := xproto.QueryExtension(c, 4, "SYNC").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return xgb.Errorf("No extension named SYNC could be found on on the server.") - } - - xgb.ExtLock.Lock() - c.Extensions["SYNC"] = reply.MajorOpcode - for evNum, fun := range xgb.NewExtEventFuncs["SYNC"] { - xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range xgb.NewExtErrorFuncs["SYNC"] { - xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun - } - xgb.ExtLock.Unlock() - - return nil -} - -func init() { - xgb.NewExtEventFuncs["SYNC"] = make(map[int]xgb.NewEventFun) - xgb.NewExtErrorFuncs["SYNC"] = make(map[int]xgb.NewErrorFun) -} - -type Alarm uint32 - -func NewAlarmId(c *xgb.Conn) (Alarm, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Alarm(id), nil -} - -// BadAlarm is the error number for a BadAlarm. -const BadAlarm = 1 - -type AlarmError struct { - Sequence uint16 - NiceName string - BadAlarm uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// AlarmErrorNew constructs a AlarmError value that implements xgb.Error from a byte slice. -func AlarmErrorNew(buf []byte) xgb.Error { - v := AlarmError{} - v.NiceName = "Alarm" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadAlarm = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -// SequenceId returns the sequence id attached to the BadAlarm error. -// This is mostly used internally. -func (err AlarmError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadAlarm error. If no bad value exists, 0 is returned. -func (err AlarmError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadAlarm error. - -func (err AlarmError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadAlarm: %d", err.BadAlarm)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadAlarm {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["SYNC"][1] = AlarmErrorNew -} - -// AlarmNotify is the event number for a AlarmNotifyEvent. -const AlarmNotify = 1 - -type AlarmNotifyEvent struct { - Sequence uint16 - Kind byte - Alarm Alarm - CounterValue Int64 - AlarmValue Int64 - Timestamp xproto.Timestamp - State byte - // padding: 3 bytes -} - -// AlarmNotifyEventNew constructs a AlarmNotifyEvent value that implements xgb.Event from a byte slice. -func AlarmNotifyEventNew(buf []byte) xgb.Event { - v := AlarmNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Alarm = Alarm(xgb.Get32(buf[b:])) - b += 4 - - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - v.AlarmValue = Int64{} - b += Int64Read(buf[b:], &v.AlarmValue) - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.State = buf[b] - b += 1 - - b += 3 // padding - - return v -} - -// Bytes writes a AlarmNotifyEvent value to a byte slice. -func (v AlarmNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Kind - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Alarm)) - b += 4 - - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.AlarmValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - buf[b] = v.State - b += 1 - - b += 3 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the AlarmNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v AlarmNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of AlarmNotifyEvent. -func (v AlarmNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, xgb.Sprintf("Alarm: %d", v.Alarm)) - fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - return "AlarmNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["SYNC"][1] = AlarmNotifyEventNew -} - -const ( - AlarmstateActive = 0 - AlarmstateInactive = 1 - AlarmstateDestroyed = 2 -) - -const ( - CaCounter = 1 - CaValueType = 2 - CaValue = 4 - CaTestType = 8 - CaDelta = 16 - CaEvents = 32 -) - -type Counter uint32 - -func NewCounterId(c *xgb.Conn) (Counter, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Counter(id), nil -} - -// BadCounter is the error number for a BadCounter. -const BadCounter = 0 - -type CounterError struct { - Sequence uint16 - NiceName string - BadCounter uint32 - MinorOpcode uint16 - MajorOpcode byte -} - -// CounterErrorNew constructs a CounterError value that implements xgb.Error from a byte slice. -func CounterErrorNew(buf []byte) xgb.Error { - v := CounterError{} - v.NiceName = "Counter" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.BadCounter = xgb.Get32(buf[b:]) - b += 4 - - v.MinorOpcode = xgb.Get16(buf[b:]) - b += 2 - - v.MajorOpcode = buf[b] - b += 1 - - return v -} - -// SequenceId returns the sequence id attached to the BadCounter error. -// This is mostly used internally. -func (err CounterError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadCounter error. If no bad value exists, 0 is returned. -func (err CounterError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadCounter error. - -func (err CounterError) Error() string { - fieldVals := make([]string, 0, 3) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("BadCounter: %d", err.BadCounter)) - fieldVals = append(fieldVals, xgb.Sprintf("MinorOpcode: %d", err.MinorOpcode)) - fieldVals = append(fieldVals, xgb.Sprintf("MajorOpcode: %d", err.MajorOpcode)) - return "BadCounter {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["SYNC"][0] = CounterErrorNew -} - -// CounterNotify is the event number for a CounterNotifyEvent. -const CounterNotify = 0 - -type CounterNotifyEvent struct { - Sequence uint16 - Kind byte - Counter Counter - WaitValue Int64 - CounterValue Int64 - Timestamp xproto.Timestamp - Count uint16 - Destroyed bool - // padding: 1 bytes -} - -// CounterNotifyEventNew constructs a CounterNotifyEvent value that implements xgb.Event from a byte slice. -func CounterNotifyEventNew(buf []byte) xgb.Event { - v := CounterNotifyEvent{} - b := 1 // don't read event number - - v.Kind = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Counter = Counter(xgb.Get32(buf[b:])) - b += 4 - - v.WaitValue = Int64{} - b += Int64Read(buf[b:], &v.WaitValue) - - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Count = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Destroyed = true - } else { - v.Destroyed = false - } - b += 1 - - b += 1 // padding - - return v -} - -// Bytes writes a CounterNotifyEvent value to a byte slice. -func (v CounterNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.Kind - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Counter)) - b += 4 - - { - structBytes := v.WaitValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.CounterValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], uint32(v.Timestamp)) - b += 4 - - xgb.Put16(buf[b:], v.Count) - b += 2 - - if v.Destroyed { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 1 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the CounterNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v CounterNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of CounterNotifyEvent. -func (v CounterNotifyEvent) String() string { - fieldVals := make([]string, 0, 8) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Kind: %d", v.Kind)) - fieldVals = append(fieldVals, xgb.Sprintf("Counter: %d", v.Counter)) - fieldVals = append(fieldVals, xgb.Sprintf("Timestamp: %d", v.Timestamp)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, xgb.Sprintf("Destroyed: %t", v.Destroyed)) - return "CounterNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["SYNC"][0] = CounterNotifyEventNew -} - -type Fence uint32 - -func NewFenceId(c *xgb.Conn) (Fence, error) { - id, err := c.NewId() - if err != nil { - return 0, err - } - return Fence(id), nil -} - -type Int64 struct { - Hi int32 - Lo uint32 -} - -// Int64Read reads a byte slice into a Int64 value. -func Int64Read(buf []byte, v *Int64) int { - b := 0 - - v.Hi = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Lo = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// Int64ReadList reads a byte slice into a list of Int64 values. -func Int64ReadList(buf []byte, dest []Int64) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Int64{} - b += Int64Read(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Int64 value to a byte slice. -func (v Int64) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Hi)) - b += 4 - - xgb.Put32(buf[b:], v.Lo) - b += 4 - - return buf -} - -// Int64ListBytes writes a list of Int64 values to a byte slice. -func Int64ListBytes(buf []byte, list []Int64) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type Systemcounter struct { - Counter Counter - Resolution Int64 - NameLen uint16 - Name string // size: xgb.Pad((int(NameLen) * 1)) -} - -// SystemcounterRead reads a byte slice into a Systemcounter value. -func SystemcounterRead(buf []byte, v *Systemcounter) int { - b := 0 - - v.Counter = Counter(xgb.Get32(buf[b:])) - b += 4 - - v.Resolution = Int64{} - b += Int64Read(buf[b:], &v.Resolution) - - v.NameLen = xgb.Get16(buf[b:]) - b += 2 - - { - byteString := make([]byte, v.NameLen) - copy(byteString[:v.NameLen], buf[b:]) - v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) - } - - return b -} - -// SystemcounterReadList reads a byte slice into a list of Systemcounter values. -func SystemcounterReadList(buf []byte, dest []Systemcounter) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Systemcounter{} - b += SystemcounterRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Systemcounter value to a byte slice. -func (v Systemcounter) Bytes() []byte { - buf := make([]byte, (14 + xgb.Pad((int(v.NameLen) * 1)))) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Counter)) - b += 4 - - { - structBytes := v.Resolution.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put16(buf[b:], v.NameLen) - b += 2 - - copy(buf[b:], v.Name[:v.NameLen]) - b += xgb.Pad(int(v.NameLen)) - - return buf -} - -// SystemcounterListBytes writes a list of Systemcounter values to a byte slice. -func SystemcounterListBytes(buf []byte, list []Systemcounter) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// SystemcounterListSize computes the size (bytes) of a list of Systemcounter values. -func SystemcounterListSize(list []Systemcounter) int { - size := 0 - for _, item := range list { - size += (14 + xgb.Pad((int(item.NameLen) * 1))) - } - return size -} - -const ( - TesttypePositiveTransition = 0 - TesttypeNegativeTransition = 1 - TesttypePositiveComparison = 2 - TesttypeNegativeComparison = 3 -) - -type Trigger struct { - Counter Counter - WaitType uint32 - WaitValue Int64 - TestType uint32 -} - -// TriggerRead reads a byte slice into a Trigger value. -func TriggerRead(buf []byte, v *Trigger) int { - b := 0 - - v.Counter = Counter(xgb.Get32(buf[b:])) - b += 4 - - v.WaitType = xgb.Get32(buf[b:]) - b += 4 - - v.WaitValue = Int64{} - b += Int64Read(buf[b:], &v.WaitValue) - - v.TestType = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// TriggerReadList reads a byte slice into a list of Trigger values. -func TriggerReadList(buf []byte, dest []Trigger) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Trigger{} - b += TriggerRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Trigger value to a byte slice. -func (v Trigger) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Counter)) - b += 4 - - xgb.Put32(buf[b:], v.WaitType) - b += 4 - - { - structBytes := v.WaitValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - xgb.Put32(buf[b:], v.TestType) - b += 4 - - return buf -} - -// TriggerListBytes writes a list of Trigger values to a byte slice. -func TriggerListBytes(buf []byte, list []Trigger) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -const ( - ValuetypeAbsolute = 0 - ValuetypeRelative = 1 -) - -type Waitcondition struct { - Trigger Trigger - EventThreshold Int64 -} - -// WaitconditionRead reads a byte slice into a Waitcondition value. -func WaitconditionRead(buf []byte, v *Waitcondition) int { - b := 0 - - v.Trigger = Trigger{} - b += TriggerRead(buf[b:], &v.Trigger) - - v.EventThreshold = Int64{} - b += Int64Read(buf[b:], &v.EventThreshold) - - return b -} - -// WaitconditionReadList reads a byte slice into a list of Waitcondition values. -func WaitconditionReadList(buf []byte, dest []Waitcondition) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = Waitcondition{} - b += WaitconditionRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a Waitcondition value to a byte slice. -func (v Waitcondition) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - { - structBytes := v.Trigger.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - { - structBytes := v.EventThreshold.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// WaitconditionListBytes writes a list of Waitcondition values to a byte slice. -func WaitconditionListBytes(buf []byte, list []Waitcondition) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Card32' - -// AwaitCookie is a cookie used only for Await requests. -type AwaitCookie struct { - *xgb.Cookie -} - -// Await sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func Await(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(awaitRequest(c, WaitList), cookie) - return AwaitCookie{cookie} -} - -// AwaitChecked sends a checked request. -// If an error occurs, it can be retrieved using AwaitCookie.Check() -func AwaitChecked(c *xgb.Conn, WaitList []Waitcondition) AwaitCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Await' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(awaitRequest(c, WaitList), cookie) - return AwaitCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AwaitCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for Await -// awaitRequest writes a Await request to a byte slice. -func awaitRequest(c *xgb.Conn, WaitList []Waitcondition) []byte { - size := xgb.Pad((4 + xgb.Pad((len(WaitList) * 28)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - b += WaitconditionListBytes(buf[b:], WaitList) - - return buf -} - -// AwaitFenceCookie is a cookie used only for AwaitFence requests. -type AwaitFenceCookie struct { - *xgb.Cookie -} - -// AwaitFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AwaitFence(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(awaitFenceRequest(c, FenceList), cookie) - return AwaitFenceCookie{cookie} -} - -// AwaitFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using AwaitFenceCookie.Check() -func AwaitFenceChecked(c *xgb.Conn, FenceList []Fence) AwaitFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'AwaitFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(awaitFenceRequest(c, FenceList), cookie) - return AwaitFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AwaitFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AwaitFence -// awaitFenceRequest writes a AwaitFence request to a byte slice. -func awaitFenceRequest(c *xgb.Conn, FenceList []Fence) []byte { - size := xgb.Pad((4 + xgb.Pad((len(FenceList) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - for i := 0; i < int(len(FenceList)); i++ { - xgb.Put32(buf[b:], uint32(FenceList[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeAlarmCookie is a cookie used only for ChangeAlarm requests. -type ChangeAlarmCookie struct { - *xgb.Cookie -} - -// ChangeAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return ChangeAlarmCookie{cookie} -} - -// ChangeAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeAlarmCookie.Check() -func ChangeAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) ChangeAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return ChangeAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeAlarm -// changeAlarmRequest writes a ChangeAlarm request to a byte slice. -func changeAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeCounterCookie is a cookie used only for ChangeCounter requests. -type ChangeCounterCookie struct { - *xgb.Cookie -} - -// ChangeCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeCounter(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) - return ChangeCounterCookie{cookie} -} - -// ChangeCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeCounterCookie.Check() -func ChangeCounterChecked(c *xgb.Conn, Counter Counter, Amount Int64) ChangeCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ChangeCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeCounterRequest(c, Counter, Amount), cookie) - return ChangeCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeCounter -// changeCounterRequest writes a ChangeCounter request to a byte slice. -func changeCounterRequest(c *xgb.Conn, Counter Counter, Amount Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Amount.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// CreateAlarmCookie is a cookie used only for CreateAlarm requests. -type CreateAlarmCookie struct { - *xgb.Cookie -} - -// CreateAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateAlarm(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return CreateAlarmCookie{cookie} -} - -// CreateAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateAlarmCookie.Check() -func CreateAlarmChecked(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) CreateAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createAlarmRequest(c, Id, ValueMask, ValueList), cookie) - return CreateAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateAlarm -// createAlarmRequest writes a CreateAlarm request to a byte slice. -func createAlarmRequest(c *xgb.Conn, Id Alarm, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - xgb.Put32(buf[b:], ValueMask) - b += 4 - for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { - xgb.Put32(buf[b:], ValueList[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// CreateCounterCookie is a cookie used only for CreateCounter requests. -type CreateCounterCookie struct { - *xgb.Cookie -} - -// CreateCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateCounter(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) - return CreateCounterCookie{cookie} -} - -// CreateCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateCounterCookie.Check() -func CreateCounterChecked(c *xgb.Conn, Id Counter, InitialValue Int64) CreateCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createCounterRequest(c, Id, InitialValue), cookie) - return CreateCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateCounter -// createCounterRequest writes a CreateCounter request to a byte slice. -func createCounterRequest(c *xgb.Conn, Id Counter, InitialValue Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Id)) - b += 4 - - { - structBytes := InitialValue.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// CreateFenceCookie is a cookie used only for CreateFence requests. -type CreateFenceCookie struct { - *xgb.Cookie -} - -// CreateFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CreateFence(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) - return CreateFenceCookie{cookie} -} - -// CreateFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using CreateFenceCookie.Check() -func CreateFenceChecked(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) CreateFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'CreateFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(createFenceRequest(c, Drawable, Fence, InitiallyTriggered), cookie) - return CreateFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CreateFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CreateFence -// createFenceRequest writes a CreateFence request to a byte slice. -func createFenceRequest(c *xgb.Conn, Drawable xproto.Drawable, Fence Fence, InitiallyTriggered bool) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Drawable)) - b += 4 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - if InitiallyTriggered { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - return buf -} - -// DestroyAlarmCookie is a cookie used only for DestroyAlarm requests. -type DestroyAlarmCookie struct { - *xgb.Cookie -} - -// DestroyAlarm sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyAlarm(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) - return DestroyAlarmCookie{cookie} -} - -// DestroyAlarmChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyAlarmCookie.Check() -func DestroyAlarmChecked(c *xgb.Conn, Alarm Alarm) DestroyAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyAlarmRequest(c, Alarm), cookie) - return DestroyAlarmCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyAlarmCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyAlarm -// destroyAlarmRequest writes a DestroyAlarm request to a byte slice. -func destroyAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Alarm)) - b += 4 - - return buf -} - -// DestroyCounterCookie is a cookie used only for DestroyCounter requests. -type DestroyCounterCookie struct { - *xgb.Cookie -} - -// DestroyCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyCounter(c *xgb.Conn, Counter Counter) DestroyCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyCounterRequest(c, Counter), cookie) - return DestroyCounterCookie{cookie} -} - -// DestroyCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyCounterCookie.Check() -func DestroyCounterChecked(c *xgb.Conn, Counter Counter) DestroyCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyCounterRequest(c, Counter), cookie) - return DestroyCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyCounter -// destroyCounterRequest writes a DestroyCounter request to a byte slice. -func destroyCounterRequest(c *xgb.Conn, Counter Counter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// DestroyFenceCookie is a cookie used only for DestroyFence requests. -type DestroyFenceCookie struct { - *xgb.Cookie -} - -// DestroyFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DestroyFence(c *xgb.Conn, Fence Fence) DestroyFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(destroyFenceRequest(c, Fence), cookie) - return DestroyFenceCookie{cookie} -} - -// DestroyFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using DestroyFenceCookie.Check() -func DestroyFenceChecked(c *xgb.Conn, Fence Fence) DestroyFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'DestroyFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(destroyFenceRequest(c, Fence), cookie) - return DestroyFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DestroyFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DestroyFence -// destroyFenceRequest writes a DestroyFence request to a byte slice. -func destroyFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// GetPriorityCookie is a cookie used only for GetPriority requests. -type GetPriorityCookie struct { - *xgb.Cookie -} - -// GetPriority sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetPriorityCookie.Reply() -func GetPriority(c *xgb.Conn, Id uint32) GetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getPriorityRequest(c, Id), cookie) - return GetPriorityCookie{cookie} -} - -// GetPriorityUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetPriorityUnchecked(c *xgb.Conn, Id uint32) GetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'GetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getPriorityRequest(c, Id), cookie) - return GetPriorityCookie{cookie} -} - -// GetPriorityReply represents the data returned from a GetPriority request. -type GetPriorityReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Priority int32 -} - -// Reply blocks and returns the reply data for a GetPriority request. -func (cook GetPriorityCookie) Reply() (*GetPriorityReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getPriorityReply(buf), nil -} - -// getPriorityReply reads a byte slice into a GetPriorityReply value. -func getPriorityReply(buf []byte) *GetPriorityReply { - v := new(GetPriorityReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Priority = int32(xgb.Get32(buf[b:])) - b += 4 - - return v -} - -// Write request to wire for GetPriority -// getPriorityRequest writes a GetPriority request to a byte slice. -func getPriorityRequest(c *xgb.Conn, Id uint32) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Id) - b += 4 - - return buf -} - -// InitializeCookie is a cookie used only for Initialize requests. -type InitializeCookie struct { - *xgb.Cookie -} - -// Initialize sends a checked request. -// If an error occurs, it will be returned with the reply by calling InitializeCookie.Reply() -func Initialize(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Initialize' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) - return InitializeCookie{cookie} -} - -// InitializeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func InitializeUnchecked(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) InitializeCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'Initialize' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(initializeRequest(c, DesiredMajorVersion, DesiredMinorVersion), cookie) - return InitializeCookie{cookie} -} - -// InitializeReply represents the data returned from a Initialize request. -type InitializeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MajorVersion byte - MinorVersion byte - // padding: 22 bytes -} - -// Reply blocks and returns the reply data for a Initialize request. -func (cook InitializeCookie) Reply() (*InitializeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return initializeReply(buf), nil -} - -// initializeReply reads a byte slice into a InitializeReply value. -func initializeReply(buf []byte) *InitializeReply { - v := new(InitializeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MajorVersion = buf[b] - b += 1 - - v.MinorVersion = buf[b] - b += 1 - - b += 22 // padding - - return v -} - -// Write request to wire for Initialize -// initializeRequest writes a Initialize request to a byte slice. -func initializeRequest(c *xgb.Conn, DesiredMajorVersion byte, DesiredMinorVersion byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 0 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DesiredMajorVersion - b += 1 - - buf[b] = DesiredMinorVersion - b += 1 - - return buf -} - -// ListSystemCountersCookie is a cookie used only for ListSystemCounters requests. -type ListSystemCountersCookie struct { - *xgb.Cookie -} - -// ListSystemCounters sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListSystemCountersCookie.Reply() -func ListSystemCounters(c *xgb.Conn) ListSystemCountersCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ListSystemCounters' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(listSystemCountersRequest(c), cookie) - return ListSystemCountersCookie{cookie} -} - -// ListSystemCountersUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListSystemCountersUnchecked(c *xgb.Conn) ListSystemCountersCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ListSystemCounters' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(listSystemCountersRequest(c), cookie) - return ListSystemCountersCookie{cookie} -} - -// ListSystemCountersReply represents the data returned from a ListSystemCounters request. -type ListSystemCountersReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - CountersLen uint32 - // padding: 20 bytes - Counters []Systemcounter // size: SystemcounterListSize(Counters) -} - -// Reply blocks and returns the reply data for a ListSystemCounters request. -func (cook ListSystemCountersCookie) Reply() (*ListSystemCountersReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listSystemCountersReply(buf), nil -} - -// listSystemCountersReply reads a byte slice into a ListSystemCountersReply value. -func listSystemCountersReply(buf []byte) *ListSystemCountersReply { - v := new(ListSystemCountersReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.CountersLen = xgb.Get32(buf[b:]) - b += 4 - - b += 20 // padding - - v.Counters = make([]Systemcounter, v.CountersLen) - b += SystemcounterReadList(buf[b:], v.Counters) - - return v -} - -// Write request to wire for ListSystemCounters -// listSystemCountersRequest writes a ListSystemCounters request to a byte slice. -func listSystemCountersRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// QueryAlarmCookie is a cookie used only for QueryAlarm requests. -type QueryAlarmCookie struct { - *xgb.Cookie -} - -// QueryAlarm sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryAlarmCookie.Reply() -func QueryAlarm(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryAlarmRequest(c, Alarm), cookie) - return QueryAlarmCookie{cookie} -} - -// QueryAlarmUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryAlarmUnchecked(c *xgb.Conn, Alarm Alarm) QueryAlarmCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryAlarm' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryAlarmRequest(c, Alarm), cookie) - return QueryAlarmCookie{cookie} -} - -// QueryAlarmReply represents the data returned from a QueryAlarm request. -type QueryAlarmReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Trigger Trigger - Delta Int64 - Events bool - State byte - // padding: 2 bytes -} - -// Reply blocks and returns the reply data for a QueryAlarm request. -func (cook QueryAlarmCookie) Reply() (*QueryAlarmReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryAlarmReply(buf), nil -} - -// queryAlarmReply reads a byte slice into a QueryAlarmReply value. -func queryAlarmReply(buf []byte) *QueryAlarmReply { - v := new(QueryAlarmReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Trigger = Trigger{} - b += TriggerRead(buf[b:], &v.Trigger) - - v.Delta = Int64{} - b += Int64Read(buf[b:], &v.Delta) - - if buf[b] == 1 { - v.Events = true - } else { - v.Events = false - } - b += 1 - - v.State = buf[b] - b += 1 - - b += 2 // padding - - return v -} - -// Write request to wire for QueryAlarm -// queryAlarmRequest writes a QueryAlarm request to a byte slice. -func queryAlarmRequest(c *xgb.Conn, Alarm Alarm) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Alarm)) - b += 4 - - return buf -} - -// QueryCounterCookie is a cookie used only for QueryCounter requests. -type QueryCounterCookie struct { - *xgb.Cookie -} - -// QueryCounter sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryCounterCookie.Reply() -func QueryCounter(c *xgb.Conn, Counter Counter) QueryCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryCounterRequest(c, Counter), cookie) - return QueryCounterCookie{cookie} -} - -// QueryCounterUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryCounterUnchecked(c *xgb.Conn, Counter Counter) QueryCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryCounterRequest(c, Counter), cookie) - return QueryCounterCookie{cookie} -} - -// QueryCounterReply represents the data returned from a QueryCounter request. -type QueryCounterReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - CounterValue Int64 -} - -// Reply blocks and returns the reply data for a QueryCounter request. -func (cook QueryCounterCookie) Reply() (*QueryCounterReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryCounterReply(buf), nil -} - -// queryCounterReply reads a byte slice into a QueryCounterReply value. -func queryCounterReply(buf []byte) *QueryCounterReply { - v := new(QueryCounterReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.CounterValue = Int64{} - b += Int64Read(buf[b:], &v.CounterValue) - - return v -} - -// Write request to wire for QueryCounter -// queryCounterRequest writes a QueryCounter request to a byte slice. -func queryCounterRequest(c *xgb.Conn, Counter Counter) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - return buf -} - -// QueryFenceCookie is a cookie used only for QueryFence requests. -type QueryFenceCookie struct { - *xgb.Cookie -} - -// QueryFence sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryFenceCookie.Reply() -func QueryFence(c *xgb.Conn, Fence Fence) QueryFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryFenceRequest(c, Fence), cookie) - return QueryFenceCookie{cookie} -} - -// QueryFenceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryFenceUnchecked(c *xgb.Conn, Fence Fence) QueryFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'QueryFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryFenceRequest(c, Fence), cookie) - return QueryFenceCookie{cookie} -} - -// QueryFenceReply represents the data returned from a QueryFence request. -type QueryFenceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Triggered bool - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a QueryFence request. -func (cook QueryFenceCookie) Reply() (*QueryFenceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryFenceReply(buf), nil -} - -// queryFenceReply reads a byte slice into a QueryFenceReply value. -func queryFenceReply(buf []byte) *QueryFenceReply { - v := new(QueryFenceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - if buf[b] == 1 { - v.Triggered = true - } else { - v.Triggered = false - } - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for QueryFence -// queryFenceRequest writes a QueryFence request to a byte slice. -func queryFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// ResetFenceCookie is a cookie used only for ResetFence requests. -type ResetFenceCookie struct { - *xgb.Cookie -} - -// ResetFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ResetFence(c *xgb.Conn, Fence Fence) ResetFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(resetFenceRequest(c, Fence), cookie) - return ResetFenceCookie{cookie} -} - -// ResetFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using ResetFenceCookie.Check() -func ResetFenceChecked(c *xgb.Conn, Fence Fence) ResetFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'ResetFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(resetFenceRequest(c, Fence), cookie) - return ResetFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ResetFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ResetFence -// resetFenceRequest writes a ResetFence request to a byte slice. -func resetFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} - -// SetCounterCookie is a cookie used only for SetCounter requests. -type SetCounterCookie struct { - *xgb.Cookie -} - -// SetCounter sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetCounter(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setCounterRequest(c, Counter, Value), cookie) - return SetCounterCookie{cookie} -} - -// SetCounterChecked sends a checked request. -// If an error occurs, it can be retrieved using SetCounterCookie.Check() -func SetCounterChecked(c *xgb.Conn, Counter Counter, Value Int64) SetCounterCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetCounter' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setCounterRequest(c, Counter, Value), cookie) - return SetCounterCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetCounterCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetCounter -// setCounterRequest writes a SetCounter request to a byte slice. -func setCounterRequest(c *xgb.Conn, Counter Counter, Value Int64) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Counter)) - b += 4 - - { - structBytes := Value.Bytes() - copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) - } - - return buf -} - -// SetPriorityCookie is a cookie used only for SetPriority requests. -type SetPriorityCookie struct { - *xgb.Cookie -} - -// SetPriority sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetPriority(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) - return SetPriorityCookie{cookie} -} - -// SetPriorityChecked sends a checked request. -// If an error occurs, it can be retrieved using SetPriorityCookie.Check() -func SetPriorityChecked(c *xgb.Conn, Id uint32, Priority int32) SetPriorityCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'SetPriority' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setPriorityRequest(c, Id, Priority), cookie) - return SetPriorityCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetPriorityCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetPriority -// setPriorityRequest writes a SetPriority request to a byte slice. -func setPriorityRequest(c *xgb.Conn, Id uint32, Priority int32) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], Id) - b += 4 - - xgb.Put32(buf[b:], uint32(Priority)) - b += 4 - - return buf -} - -// TriggerFenceCookie is a cookie used only for TriggerFence requests. -type TriggerFenceCookie struct { - *xgb.Cookie -} - -// TriggerFence sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func TriggerFence(c *xgb.Conn, Fence Fence) TriggerFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(triggerFenceRequest(c, Fence), cookie) - return TriggerFenceCookie{cookie} -} - -// TriggerFenceChecked sends a checked request. -// If an error occurs, it can be retrieved using TriggerFenceCookie.Check() -func TriggerFenceChecked(c *xgb.Conn, Fence Fence) TriggerFenceCookie { - if _, ok := c.Extensions["SYNC"]; !ok { - panic("Cannot issue request 'TriggerFence' using the uninitialized extension 'SYNC'. sync.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(triggerFenceRequest(c, Fence), cookie) - return TriggerFenceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook TriggerFenceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for TriggerFence -// triggerFenceRequest writes a TriggerFence request to a byte slice. -func triggerFenceRequest(c *xgb.Conn, Fence Fence) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["SYNC"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Fence)) - b += 4 - - return buf -} diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go deleted file mode 100644 index 30d5271..0000000 --- a/nexgb/xinput/xinput.go +++ /dev/null @@ -1,7483 +0,0 @@ -// Package xinput is the X client API for the XInputExtension extension. -package xinput - -// This file is automatically generated from xinput.xml. Edit at your peril! - -import ( - "github.com/BurntSushi/xgb" - - "github.com/BurntSushi/xgb/xproto" -) - -// Init must be called before using the XInputExtension extension. -func Init(c *xgb.Conn) error { - reply, err := xproto.QueryExtension(c, 15, "XInputExtension").Reply() - switch { - case err != nil: - return err - case !reply.Present: - return xgb.Errorf("No extension named XInputExtension could be found on on the server.") - } - - xgb.ExtLock.Lock() - c.Extensions["XInputExtension"] = reply.MajorOpcode - for evNum, fun := range xgb.NewExtEventFuncs["XInputExtension"] { - xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun - } - for errNum, fun := range xgb.NewExtErrorFuncs["XInputExtension"] { - xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun - } - xgb.ExtLock.Unlock() - - return nil -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"] = make(map[int]xgb.NewEventFun) - xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) -} - -type AxisInfo struct { - Resolution uint32 - Minimum int32 - Maximum int32 -} - -// AxisInfoRead reads a byte slice into a AxisInfo value. -func AxisInfoRead(buf []byte, v *AxisInfo) int { - b := 0 - - v.Resolution = xgb.Get32(buf[b:]) - b += 4 - - v.Minimum = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Maximum = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// AxisInfoReadList reads a byte slice into a list of AxisInfo values. -func AxisInfoReadList(buf []byte, dest []AxisInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = AxisInfo{} - b += AxisInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a AxisInfo value to a byte slice. -func (v AxisInfo) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - xgb.Put32(buf[b:], v.Resolution) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Minimum)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Maximum)) - b += 4 - - return buf -} - -// AxisInfoListBytes writes a list of AxisInfo values to a byte slice. -func AxisInfoListBytes(buf []byte, list []AxisInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type BellFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - Percent int8 - // padding: 3 bytes - Pitch int16 - Duration int16 -} - -// BellFeedbackCtlRead reads a byte slice into a BellFeedbackCtl value. -func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Percent = int8(buf[b]) - b += 1 - - b += 3 // padding - - v.Pitch = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Duration = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// BellFeedbackCtlReadList reads a byte slice into a list of BellFeedbackCtl values. -func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = BellFeedbackCtl{} - b += BellFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a BellFeedbackCtl value to a byte slice. -func (v BellFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = byte(v.Percent) - b += 1 - - b += 3 // padding - - xgb.Put16(buf[b:], uint16(v.Pitch)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Duration)) - b += 2 - - return buf -} - -// BellFeedbackCtlListBytes writes a list of BellFeedbackCtl values to a byte slice. -func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type BellFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Percent byte - // padding: 3 bytes - Pitch uint16 - Duration uint16 -} - -// BellFeedbackStateRead reads a byte slice into a BellFeedbackState value. -func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Percent = buf[b] - b += 1 - - b += 3 // padding - - v.Pitch = xgb.Get16(buf[b:]) - b += 2 - - v.Duration = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// BellFeedbackStateReadList reads a byte slice into a list of BellFeedbackState values. -func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = BellFeedbackState{} - b += BellFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a BellFeedbackState value to a byte slice. -func (v BellFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Percent - b += 1 - - b += 3 // padding - - xgb.Put16(buf[b:], v.Pitch) - b += 2 - - xgb.Put16(buf[b:], v.Duration) - b += 2 - - return buf -} - -// BellFeedbackStateListBytes writes a list of BellFeedbackState values to a byte slice. -func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type ButtonInfo struct { - ClassId byte - Len byte - NumButtons uint16 -} - -// ButtonInfoRead reads a byte slice into a ButtonInfo value. -func ButtonInfoRead(buf []byte, v *ButtonInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumButtons = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// ButtonInfoReadList reads a byte slice into a list of ButtonInfo values. -func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ButtonInfo{} - b += ButtonInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ButtonInfo value to a byte slice. -func (v ButtonInfo) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - xgb.Put16(buf[b:], v.NumButtons) - b += 2 - - return buf -} - -// ButtonInfoListBytes writes a list of ButtonInfo values to a byte slice. -func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type ButtonState struct { - ClassId byte - Len byte - NumButtons byte - // padding: 1 bytes - Buttons []byte // size: 32 -} - -// ButtonStateRead reads a byte slice into a ButtonState value. -func ButtonStateRead(buf []byte, v *ButtonState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumButtons = buf[b] - b += 1 - - b += 1 // padding - - v.Buttons = make([]byte, 32) - copy(v.Buttons[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return b -} - -// ButtonStateReadList reads a byte slice into a list of ButtonState values. -func ButtonStateReadList(buf []byte, dest []ButtonState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ButtonState{} - b += ButtonStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ButtonState value to a byte slice. -func (v ButtonState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumButtons - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Buttons[:32]) - b += xgb.Pad(int(32)) - - return buf -} - -// ButtonStateListBytes writes a list of ButtonState values to a byte slice. -func ButtonStateListBytes(buf []byte, list []ButtonState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// ButtonStateListSize computes the size (bytes) of a list of ButtonState values. -func ButtonStateListSize(list []ButtonState) int { - size := 0 - for _ = range list { - size += 36 - } - return size -} - -// ChangeDeviceNotify is the event number for a ChangeDeviceNotifyEvent. -const ChangeDeviceNotify = 12 - -type ChangeDeviceNotifyEvent struct { - Sequence uint16 - DeviceId byte - Time xproto.Timestamp - Request byte - // padding: 23 bytes -} - -// ChangeDeviceNotifyEventNew constructs a ChangeDeviceNotifyEvent value that implements xgb.Event from a byte slice. -func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { - v := ChangeDeviceNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Request = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Bytes writes a ChangeDeviceNotifyEvent value to a byte slice. -func (v ChangeDeviceNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 12 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.Request - b += 1 - - b += 23 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the ChangeDeviceNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of ChangeDeviceNotifyEvent. -func (v ChangeDeviceNotifyEvent) String() string { - fieldVals := make([]string, 0, 4) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) - return "ChangeDeviceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew -} - -// BadClass is the error number for a BadClass. -const BadClass = 4 - -type ClassError struct { - Sequence uint16 - NiceName string -} - -// ClassErrorNew constructs a ClassError value that implements xgb.Error from a byte slice. -func ClassErrorNew(buf []byte) xgb.Error { - v := ClassError{} - v.NiceName = "Class" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadClass error. -// This is mostly used internally. -func (err ClassError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadClass error. If no bad value exists, 0 is returned. -func (err ClassError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadClass error. - -func (err ClassError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadClass {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew -} - -// BadDevice is the error number for a BadDevice. -const BadDevice = 0 - -type DeviceError struct { - Sequence uint16 - NiceName string -} - -// DeviceErrorNew constructs a DeviceError value that implements xgb.Error from a byte slice. -func DeviceErrorNew(buf []byte) xgb.Error { - v := DeviceError{} - v.NiceName = "Device" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadDevice error. -// This is mostly used internally. -func (err DeviceError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadDevice error. If no bad value exists, 0 is returned. -func (err DeviceError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadDevice error. - -func (err DeviceError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadDevice {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew -} - -type DeviceAbsAreaCtrl struct { - ControlId uint16 - Len uint16 - OffsetX uint32 - OffsetY uint32 - Width int32 - Height int32 - Screen int32 - Following uint32 -} - -// DeviceAbsAreaCtrlRead reads a byte slice into a DeviceAbsAreaCtrl value. -func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.OffsetX = xgb.Get32(buf[b:]) - b += 4 - - v.OffsetY = xgb.Get32(buf[b:]) - b += 4 - - v.Width = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Height = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Screen = int32(xgb.Get32(buf[b:])) - b += 4 - - v.Following = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DeviceAbsAreaCtrlReadList reads a byte slice into a list of DeviceAbsAreaCtrl values. -func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsAreaCtrl{} - b += DeviceAbsAreaCtrlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceAbsAreaCtrl value to a byte slice. -func (v DeviceAbsAreaCtrl) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.OffsetX) - b += 4 - - xgb.Put32(buf[b:], v.OffsetY) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Width)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Height)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Screen)) - b += 4 - - xgb.Put32(buf[b:], v.Following) - b += 4 - - return buf -} - -// DeviceAbsAreaCtrlListBytes writes a list of DeviceAbsAreaCtrl values to a byte slice. -func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceAbsAreaState struct { - ControlId uint16 - Len uint16 - OffsetX uint32 - OffsetY uint32 - Width uint32 - Height uint32 - Screen uint32 - Following uint32 -} - -// DeviceAbsAreaStateRead reads a byte slice into a DeviceAbsAreaState value. -func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.OffsetX = xgb.Get32(buf[b:]) - b += 4 - - v.OffsetY = xgb.Get32(buf[b:]) - b += 4 - - v.Width = xgb.Get32(buf[b:]) - b += 4 - - v.Height = xgb.Get32(buf[b:]) - b += 4 - - v.Screen = xgb.Get32(buf[b:]) - b += 4 - - v.Following = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DeviceAbsAreaStateReadList reads a byte slice into a list of DeviceAbsAreaState values. -func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsAreaState{} - b += DeviceAbsAreaStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceAbsAreaState value to a byte slice. -func (v DeviceAbsAreaState) Bytes() []byte { - buf := make([]byte, 28) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.OffsetX) - b += 4 - - xgb.Put32(buf[b:], v.OffsetY) - b += 4 - - xgb.Put32(buf[b:], v.Width) - b += 4 - - xgb.Put32(buf[b:], v.Height) - b += 4 - - xgb.Put32(buf[b:], v.Screen) - b += 4 - - xgb.Put32(buf[b:], v.Following) - b += 4 - - return buf -} - -// DeviceAbsAreaStateListBytes writes a list of DeviceAbsAreaState values to a byte slice. -func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceAbsCalibCtl struct { - ControlId uint16 - Len uint16 - MinX int32 - MaxX int32 - MinY int32 - MaxY int32 - FlipX uint32 - FlipY uint32 - Rotation uint32 - ButtonThreshold uint32 -} - -// DeviceAbsCalibCtlRead reads a byte slice into a DeviceAbsCalibCtl value. -func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.MinX = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxX = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MinY = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxY = int32(xgb.Get32(buf[b:])) - b += 4 - - v.FlipX = xgb.Get32(buf[b:]) - b += 4 - - v.FlipY = xgb.Get32(buf[b:]) - b += 4 - - v.Rotation = xgb.Get32(buf[b:]) - b += 4 - - v.ButtonThreshold = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DeviceAbsCalibCtlReadList reads a byte slice into a list of DeviceAbsCalibCtl values. -func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsCalibCtl{} - b += DeviceAbsCalibCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceAbsCalibCtl value to a byte slice. -func (v DeviceAbsCalibCtl) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], uint32(v.MinX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MinY)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxY)) - b += 4 - - xgb.Put32(buf[b:], v.FlipX) - b += 4 - - xgb.Put32(buf[b:], v.FlipY) - b += 4 - - xgb.Put32(buf[b:], v.Rotation) - b += 4 - - xgb.Put32(buf[b:], v.ButtonThreshold) - b += 4 - - return buf -} - -// DeviceAbsCalibCtlListBytes writes a list of DeviceAbsCalibCtl values to a byte slice. -func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceAbsCalibState struct { - ControlId uint16 - Len uint16 - MinX int32 - MaxX int32 - MinY int32 - MaxY int32 - FlipX uint32 - FlipY uint32 - Rotation uint32 - ButtonThreshold uint32 -} - -// DeviceAbsCalibStateRead reads a byte slice into a DeviceAbsCalibState value. -func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.MinX = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxX = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MinY = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxY = int32(xgb.Get32(buf[b:])) - b += 4 - - v.FlipX = xgb.Get32(buf[b:]) - b += 4 - - v.FlipY = xgb.Get32(buf[b:]) - b += 4 - - v.Rotation = xgb.Get32(buf[b:]) - b += 4 - - v.ButtonThreshold = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// DeviceAbsCalibStateReadList reads a byte slice into a list of DeviceAbsCalibState values. -func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceAbsCalibState{} - b += DeviceAbsCalibStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceAbsCalibState value to a byte slice. -func (v DeviceAbsCalibState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], uint32(v.MinX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxX)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MinY)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxY)) - b += 4 - - xgb.Put32(buf[b:], v.FlipX) - b += 4 - - xgb.Put32(buf[b:], v.FlipY) - b += 4 - - xgb.Put32(buf[b:], v.Rotation) - b += 4 - - xgb.Put32(buf[b:], v.ButtonThreshold) - b += 4 - - return buf -} - -// DeviceAbsCalibStateListBytes writes a list of DeviceAbsCalibState values to a byte slice. -func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// BadDeviceBusy is the error number for a BadDeviceBusy. -const BadDeviceBusy = 3 - -type DeviceBusyError struct { - Sequence uint16 - NiceName string -} - -// DeviceBusyErrorNew constructs a DeviceBusyError value that implements xgb.Error from a byte slice. -func DeviceBusyErrorNew(buf []byte) xgb.Error { - v := DeviceBusyError{} - v.NiceName = "DeviceBusy" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadDeviceBusy error. -// This is mostly used internally. -func (err DeviceBusyError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadDeviceBusy error. If no bad value exists, 0 is returned. -func (err DeviceBusyError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadDeviceBusy error. - -func (err DeviceBusyError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadDeviceBusy {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew -} - -// DeviceButtonPress is the event number for a DeviceButtonPressEvent. -const DeviceButtonPress = 3 - -type DeviceButtonPressEvent DeviceKeyPressEvent - -// DeviceButtonPressEventNew constructs a DeviceButtonPressEvent value that implements xgb.Event from a byte slice. -func DeviceButtonPressEventNew(buf []byte) xgb.Event { - return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceButtonPressEvent value to a byte slice. -func (v DeviceButtonPressEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceButtonPress event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceButtonPressEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceButtonPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew -} - -// DeviceButtonRelease is the event number for a DeviceButtonReleaseEvent. -const DeviceButtonRelease = 4 - -type DeviceButtonReleaseEvent DeviceKeyPressEvent - -// DeviceButtonReleaseEventNew constructs a DeviceButtonReleaseEvent value that implements xgb.Event from a byte slice. -func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { - return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceButtonReleaseEvent value to a byte slice. -func (v DeviceButtonReleaseEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceButtonRelease event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceButtonReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceButtonReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew -} - -// DeviceButtonStateNotify is the event number for a DeviceButtonStateNotifyEvent. -const DeviceButtonStateNotify = 14 - -type DeviceButtonStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Buttons []byte // size: 28 -} - -// DeviceButtonStateNotifyEventNew constructs a DeviceButtonStateNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { - v := DeviceButtonStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Buttons = make([]byte, 28) - copy(v.Buttons[:28], buf[b:]) - b += xgb.Pad(int(28)) - - return v -} - -// Bytes writes a DeviceButtonStateNotifyEvent value to a byte slice. -func (v DeviceButtonStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 14 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Buttons[:28]) - b += xgb.Pad(int(28)) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceButtonStateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceButtonStateNotifyEvent. -func (v DeviceButtonStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceButtonStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew -} - -type DeviceCoreCtrl struct { - ControlId uint16 - Len uint16 - Status byte - // padding: 3 bytes -} - -// DeviceCoreCtrlRead reads a byte slice into a DeviceCoreCtrl value. -func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Status = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// DeviceCoreCtrlReadList reads a byte slice into a list of DeviceCoreCtrl values. -func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceCoreCtrl{} - b += DeviceCoreCtrlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceCoreCtrl value to a byte slice. -func (v DeviceCoreCtrl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Status - b += 1 - - b += 3 // padding - - return buf -} - -// DeviceCoreCtrlListBytes writes a list of DeviceCoreCtrl values to a byte slice. -func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceCoreState struct { - ControlId uint16 - Len uint16 - Status byte - Iscore byte - // padding: 2 bytes -} - -// DeviceCoreStateRead reads a byte slice into a DeviceCoreState value. -func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Status = buf[b] - b += 1 - - v.Iscore = buf[b] - b += 1 - - b += 2 // padding - - return b -} - -// DeviceCoreStateReadList reads a byte slice into a list of DeviceCoreState values. -func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceCoreState{} - b += DeviceCoreStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceCoreState value to a byte slice. -func (v DeviceCoreState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Status - b += 1 - - buf[b] = v.Iscore - b += 1 - - b += 2 // padding - - return buf -} - -// DeviceCoreStateListBytes writes a list of DeviceCoreState values to a byte slice. -func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceCtl struct { - ControlId uint16 - Len uint16 -} - -// DeviceCtlRead reads a byte slice into a DeviceCtl value. -func DeviceCtlRead(buf []byte, v *DeviceCtl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// DeviceCtlReadList reads a byte slice into a list of DeviceCtl values. -func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceCtl{} - b += DeviceCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceCtl value to a byte slice. -func (v DeviceCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// DeviceCtlListBytes writes a list of DeviceCtl values to a byte slice. -func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceEnableCtrl struct { - ControlId uint16 - Len uint16 - Enable byte - // padding: 3 bytes -} - -// DeviceEnableCtrlRead reads a byte slice into a DeviceEnableCtrl value. -func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Enable = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// DeviceEnableCtrlReadList reads a byte slice into a list of DeviceEnableCtrl values. -func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceEnableCtrl{} - b += DeviceEnableCtrlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceEnableCtrl value to a byte slice. -func (v DeviceEnableCtrl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Enable - b += 1 - - b += 3 // padding - - return buf -} - -// DeviceEnableCtrlListBytes writes a list of DeviceEnableCtrl values to a byte slice. -func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceEnableState struct { - ControlId uint16 - Len uint16 - Enable byte - // padding: 3 bytes -} - -// DeviceEnableStateRead reads a byte slice into a DeviceEnableState value. -func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Enable = buf[b] - b += 1 - - b += 3 // padding - - return b -} - -// DeviceEnableStateReadList reads a byte slice into a list of DeviceEnableState values. -func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceEnableState{} - b += DeviceEnableStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceEnableState value to a byte slice. -func (v DeviceEnableState) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.Enable - b += 1 - - b += 3 // padding - - return buf -} - -// DeviceEnableStateListBytes writes a list of DeviceEnableState values to a byte slice. -func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type DeviceInfo struct { - DeviceType xproto.Atom - DeviceId byte - NumClassInfo byte - DeviceUse byte - // padding: 1 bytes -} - -// DeviceInfoRead reads a byte slice into a DeviceInfo value. -func DeviceInfoRead(buf []byte, v *DeviceInfo) int { - b := 0 - - v.DeviceType = xproto.Atom(xgb.Get32(buf[b:])) - b += 4 - - v.DeviceId = buf[b] - b += 1 - - v.NumClassInfo = buf[b] - b += 1 - - v.DeviceUse = buf[b] - b += 1 - - b += 1 // padding - - return b -} - -// DeviceInfoReadList reads a byte slice into a list of DeviceInfo values. -func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceInfo{} - b += DeviceInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceInfo value to a byte slice. -func (v DeviceInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - xgb.Put32(buf[b:], uint32(v.DeviceType)) - b += 4 - - buf[b] = v.DeviceId - b += 1 - - buf[b] = v.NumClassInfo - b += 1 - - buf[b] = v.DeviceUse - b += 1 - - b += 1 // padding - - return buf -} - -// DeviceInfoListBytes writes a list of DeviceInfo values to a byte slice. -func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -const ( - DeviceInputModeAsyncThisDevice = 0 - DeviceInputModeSyncThisDevice = 1 - DeviceInputModeReplayThisDevice = 2 - DeviceInputModeAsyncOtherDevices = 3 - DeviceInputModeAsyncAll = 4 - DeviceInputModeSyncAll = 5 -) - -// DeviceKeyPress is the event number for a DeviceKeyPressEvent. -const DeviceKeyPress = 1 - -type DeviceKeyPressEvent struct { - Sequence uint16 - Detail byte - Time xproto.Timestamp - Root xproto.Window - Event xproto.Window - Child xproto.Window - RootX int16 - RootY int16 - EventX int16 - EventY int16 - State uint16 - SameScreen bool - DeviceId byte -} - -// DeviceKeyPressEventNew constructs a DeviceKeyPressEvent value that implements xgb.Event from a byte slice. -func DeviceKeyPressEventNew(buf []byte) xgb.Event { - v := DeviceKeyPressEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Root = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Event = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Child = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.RootX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.RootY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventX = int16(xgb.Get16(buf[b:])) - b += 2 - - v.EventY = int16(xgb.Get16(buf[b:])) - b += 2 - - v.State = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.SameScreen = true - } else { - v.SameScreen = false - } - b += 1 - - v.DeviceId = buf[b] - b += 1 - - return v -} - -// Bytes writes a DeviceKeyPressEvent value to a byte slice. -func (v DeviceKeyPressEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 1 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Root)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Event)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Child)) - b += 4 - - xgb.Put16(buf[b:], uint16(v.RootX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.RootY)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventX)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.EventY)) - b += 2 - - xgb.Put16(buf[b:], v.State) - b += 2 - - if v.SameScreen { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = v.DeviceId - b += 1 - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceKeyPress event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceKeyPressEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceKeyPressEvent. -func (v DeviceKeyPressEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceKeyPress {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][1] = DeviceKeyPressEventNew -} - -// DeviceKeyRelease is the event number for a DeviceKeyReleaseEvent. -const DeviceKeyRelease = 2 - -type DeviceKeyReleaseEvent DeviceKeyPressEvent - -// DeviceKeyReleaseEventNew constructs a DeviceKeyReleaseEvent value that implements xgb.Event from a byte slice. -func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { - return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceKeyReleaseEvent value to a byte slice. -func (v DeviceKeyReleaseEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceKeyRelease event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceKeyReleaseEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceKeyReleaseEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceKeyRelease {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew -} - -// DeviceKeyStateNotify is the event number for a DeviceKeyStateNotifyEvent. -const DeviceKeyStateNotify = 13 - -type DeviceKeyStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Keys []byte // size: 28 -} - -// DeviceKeyStateNotifyEventNew constructs a DeviceKeyStateNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { - v := DeviceKeyStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Keys = make([]byte, 28) - copy(v.Keys[:28], buf[b:]) - b += xgb.Pad(int(28)) - - return v -} - -// Bytes writes a DeviceKeyStateNotifyEvent value to a byte slice. -func (v DeviceKeyStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 13 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - copy(buf[b:], v.Keys[:28]) - b += xgb.Pad(int(28)) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceKeyStateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceKeyStateNotifyEvent. -func (v DeviceKeyStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 2) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceKeyStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew -} - -// DeviceMappingNotify is the event number for a DeviceMappingNotifyEvent. -const DeviceMappingNotify = 11 - -type DeviceMappingNotifyEvent struct { - Sequence uint16 - DeviceId byte - Request byte - FirstKeycode KeyCode - Count byte - // padding: 1 bytes - Time xproto.Timestamp - // padding: 20 bytes -} - -// DeviceMappingNotifyEventNew constructs a DeviceMappingNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { - v := DeviceMappingNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Request = buf[b] - b += 1 - - v.FirstKeycode = KeyCode(buf[b]) - b += 1 - - v.Count = buf[b] - b += 1 - - b += 1 // padding - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - b += 20 // padding - - return v -} - -// Bytes writes a DeviceMappingNotifyEvent value to a byte slice. -func (v DeviceMappingNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 11 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - buf[b] = v.Request - b += 1 - - buf[b] = byte(v.FirstKeycode) - b += 1 - - buf[b] = v.Count - b += 1 - - b += 1 // padding - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - b += 20 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceMappingNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceMappingNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceMappingNotifyEvent. -func (v DeviceMappingNotifyEvent) String() string { - fieldVals := make([]string, 0, 7) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Request: %d", v.Request)) - fieldVals = append(fieldVals, xgb.Sprintf("FirstKeycode: %d", v.FirstKeycode)) - fieldVals = append(fieldVals, xgb.Sprintf("Count: %d", v.Count)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - return "DeviceMappingNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew -} - -// DeviceMotionNotify is the event number for a DeviceMotionNotifyEvent. -const DeviceMotionNotify = 5 - -type DeviceMotionNotifyEvent DeviceKeyPressEvent - -// DeviceMotionNotifyEventNew constructs a DeviceMotionNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { - return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a DeviceMotionNotifyEvent value to a byte slice. -func (v DeviceMotionNotifyEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the DeviceMotionNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceMotionNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v DeviceMotionNotifyEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "DeviceMotionNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew -} - -// DevicePresenceNotify is the event number for a DevicePresenceNotifyEvent. -const DevicePresenceNotify = 15 - -type DevicePresenceNotifyEvent struct { - Sequence uint16 - // padding: 1 bytes - Time xproto.Timestamp - Devchange byte - DeviceId byte - Control uint16 - // padding: 20 bytes -} - -// DevicePresenceNotifyEventNew constructs a DevicePresenceNotifyEvent value that implements xgb.Event from a byte slice. -func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { - v := DevicePresenceNotifyEvent{} - b := 1 // don't read event number - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Devchange = buf[b] - b += 1 - - v.DeviceId = buf[b] - b += 1 - - v.Control = xgb.Get16(buf[b:]) - b += 2 - - b += 20 // padding - - return v -} - -// Bytes writes a DevicePresenceNotifyEvent value to a byte slice. -func (v DevicePresenceNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 15 - b += 1 - - b += 1 // padding - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.Devchange - b += 1 - - buf[b] = v.DeviceId - b += 1 - - xgb.Put16(buf[b:], v.Control) - b += 2 - - b += 20 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the DevicePresenceNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DevicePresenceNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DevicePresenceNotifyEvent. -func (v DevicePresenceNotifyEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Devchange: %d", v.Devchange)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Control: %d", v.Control)) - return "DevicePresenceNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew -} - -type DeviceResolutionCtl struct { - ControlId uint16 - Len uint16 - FirstValuator byte - NumValuators byte - ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) -} - -// DeviceResolutionCtlRead reads a byte slice into a DeviceResolutionCtl value. -func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.FirstValuator = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// DeviceResolutionCtlReadList reads a byte slice into a list of DeviceResolutionCtl values. -func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceResolutionCtl{} - b += DeviceResolutionCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceResolutionCtl value to a byte slice. -func (v DeviceResolutionCtl) Bytes() []byte { - buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = v.FirstValuator - b += 1 - - buf[b] = v.NumValuators - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DeviceResolutionCtlListBytes writes a list of DeviceResolutionCtl values to a byte slice. -func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. -func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { - size := 0 - for _, item := range list { - size += (6 + xgb.Pad((int(item.NumValuators) * 4))) - } - return size -} - -type DeviceResolutionState struct { - ControlId uint16 - Len uint16 - NumValuators uint32 - ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) - ResolutionMin []uint32 // size: xgb.Pad((int(NumValuators) * 4)) - ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) -} - -// DeviceResolutionStateRead reads a byte slice into a DeviceResolutionState value. -func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.NumValuators = xgb.Get32(buf[b:]) - b += 4 - - v.ResolutionValues = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionValues[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.ResolutionMin = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMin[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - v.ResolutionMax = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.ResolutionMax[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// DeviceResolutionStateReadList reads a byte slice into a list of DeviceResolutionState values. -func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceResolutionState{} - b += DeviceResolutionStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceResolutionState value to a byte slice. -func (v DeviceResolutionState) Bytes() []byte { - buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.NumValuators) - b += 4 - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionValues[i]) - b += 4 - } - b = xgb.Pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionMin[i]) - b += 4 - } - b = xgb.Pad(b) - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.ResolutionMax[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// DeviceResolutionStateListBytes writes a list of DeviceResolutionState values to a byte slice. -func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. -func DeviceResolutionStateListSize(list []DeviceResolutionState) int { - size := 0 - for _, item := range list { - size += (((8 + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) + xgb.Pad((int(item.NumValuators) * 4))) - } - return size -} - -type DeviceState struct { - ControlId uint16 - Len uint16 -} - -// DeviceStateRead reads a byte slice into a DeviceState value. -func DeviceStateRead(buf []byte, v *DeviceState) int { - b := 0 - - v.ControlId = xgb.Get16(buf[b:]) - b += 2 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// DeviceStateReadList reads a byte slice into a list of DeviceState values. -func DeviceStateReadList(buf []byte, dest []DeviceState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceState{} - b += DeviceStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceState value to a byte slice. -func (v DeviceState) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put16(buf[b:], v.ControlId) - b += 2 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// DeviceStateListBytes writes a list of DeviceState values to a byte slice. -func DeviceStateListBytes(buf []byte, list []DeviceState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// DeviceStateNotify is the event number for a DeviceStateNotifyEvent. -const DeviceStateNotify = 10 - -type DeviceStateNotifyEvent struct { - Sequence uint16 - DeviceId byte - Time xproto.Timestamp - NumKeys byte - NumButtons byte - NumValuators byte - ClassesReported byte - Buttons []byte // size: 4 - Keys []byte // size: 4 - Valuators []uint32 // size: 12 -} - -// DeviceStateNotifyEventNew constructs a DeviceStateNotifyEvent value that implements xgb.Event from a byte slice. -func DeviceStateNotifyEventNew(buf []byte) xgb.Event { - v := DeviceStateNotifyEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.NumKeys = buf[b] - b += 1 - - v.NumButtons = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.ClassesReported = buf[b] - b += 1 - - v.Buttons = make([]byte, 4) - copy(v.Buttons[:4], buf[b:]) - b += xgb.Pad(int(4)) - - v.Keys = make([]byte, 4) - copy(v.Keys[:4], buf[b:]) - b += xgb.Pad(int(4)) - - v.Valuators = make([]uint32, 3) - for i := 0; i < int(3); i++ { - v.Valuators[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Bytes writes a DeviceStateNotifyEvent value to a byte slice. -func (v DeviceStateNotifyEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 10 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - buf[b] = v.NumKeys - b += 1 - - buf[b] = v.NumButtons - b += 1 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.ClassesReported - b += 1 - - copy(buf[b:], v.Buttons[:4]) - b += xgb.Pad(int(4)) - - copy(buf[b:], v.Keys[:4]) - b += xgb.Pad(int(4)) - - for i := 0; i < int(3); i++ { - xgb.Put32(buf[b:], v.Valuators[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceStateNotify event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceStateNotifyEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceStateNotifyEvent. -func (v DeviceStateNotifyEvent) String() string { - fieldVals := make([]string, 0, 9) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("NumKeys: %d", v.NumKeys)) - fieldVals = append(fieldVals, xgb.Sprintf("NumButtons: %d", v.NumButtons)) - fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) - fieldVals = append(fieldVals, xgb.Sprintf("ClassesReported: %d", v.ClassesReported)) - return "DeviceStateNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][10] = DeviceStateNotifyEventNew -} - -type DeviceTimeCoord struct { - Time xproto.Timestamp -} - -// DeviceTimeCoordRead reads a byte slice into a DeviceTimeCoord value. -func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { - b := 0 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// DeviceTimeCoordReadList reads a byte slice into a list of DeviceTimeCoord values. -func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = DeviceTimeCoord{} - b += DeviceTimeCoordRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a DeviceTimeCoord value to a byte slice. -func (v DeviceTimeCoord) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - return buf -} - -// DeviceTimeCoordListBytes writes a list of DeviceTimeCoord values to a byte slice. -func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -const ( - DeviceUseIsXPointer = 0 - DeviceUseIsXKeyboard = 1 - DeviceUseIsXExtensionDevice = 2 - DeviceUseIsXExtensionKeyboard = 3 - DeviceUseIsXExtensionPointer = 4 -) - -// DeviceValuator is the event number for a DeviceValuatorEvent. -const DeviceValuator = 0 - -type DeviceValuatorEvent struct { - Sequence uint16 - DeviceId byte - DeviceState uint16 - NumValuators byte - FirstValuator byte - Valuators []int32 // size: 24 -} - -// DeviceValuatorEventNew constructs a DeviceValuatorEvent value that implements xgb.Event from a byte slice. -func DeviceValuatorEventNew(buf []byte) xgb.Event { - v := DeviceValuatorEvent{} - b := 1 // don't read event number - - v.DeviceId = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.DeviceState = xgb.Get16(buf[b:]) - b += 2 - - v.NumValuators = buf[b] - b += 1 - - v.FirstValuator = buf[b] - b += 1 - - v.Valuators = make([]int32, 6) - for i := 0; i < int(6); i++ { - v.Valuators[i] = int32(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Bytes writes a DeviceValuatorEvent value to a byte slice. -func (v DeviceValuatorEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 0 - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 2 // skip sequence number - - xgb.Put16(buf[b:], v.DeviceState) - b += 2 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.FirstValuator - b += 1 - - for i := 0; i < int(6); i++ { - xgb.Put32(buf[b:], uint32(v.Valuators[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// SequenceId returns the sequence id attached to the DeviceValuator event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v DeviceValuatorEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of DeviceValuatorEvent. -func (v DeviceValuatorEvent) String() string { - fieldVals := make([]string, 0, 5) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceState: %d", v.DeviceState)) - fieldVals = append(fieldVals, xgb.Sprintf("NumValuators: %d", v.NumValuators)) - fieldVals = append(fieldVals, xgb.Sprintf("FirstValuator: %d", v.FirstValuator)) - return "DeviceValuator {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew -} - -// BadEvent is the error number for a BadEvent. -const BadEvent = 1 - -type EventError struct { - Sequence uint16 - NiceName string -} - -// EventErrorNew constructs a EventError value that implements xgb.Error from a byte slice. -func EventErrorNew(buf []byte) xgb.Error { - v := EventError{} - v.NiceName = "Event" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadEvent error. -// This is mostly used internally. -func (err EventError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadEvent error. If no bad value exists, 0 is returned. -func (err EventError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadEvent error. - -func (err EventError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadEvent {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew -} - -type EventClass uint32 - -const ( - FeedbackClassKeyboard = 0 - FeedbackClassPointer = 1 - FeedbackClassString = 2 - FeedbackClassInteger = 3 - FeedbackClassLed = 4 - FeedbackClassBell = 5 -) - -type FeedbackCtl struct { - ClassId byte - Id byte - Len uint16 -} - -// FeedbackCtlRead reads a byte slice into a FeedbackCtl value. -func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// FeedbackCtlReadList reads a byte slice into a list of FeedbackCtl values. -func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = FeedbackCtl{} - b += FeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a FeedbackCtl value to a byte slice. -func (v FeedbackCtl) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// FeedbackCtlListBytes writes a list of FeedbackCtl values to a byte slice. -func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type FeedbackState struct { - ClassId byte - Id byte - Len uint16 -} - -// FeedbackStateRead reads a byte slice into a FeedbackState value. -func FeedbackStateRead(buf []byte, v *FeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// FeedbackStateReadList reads a byte slice into a list of FeedbackState values. -func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = FeedbackState{} - b += FeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a FeedbackState value to a byte slice. -func (v FeedbackState) Bytes() []byte { - buf := make([]byte, 4) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - return buf -} - -// FeedbackStateListBytes writes a list of FeedbackState values to a byte slice. -func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// FocusIn is the event number for a FocusInEvent. -const FocusIn = 6 - -type FocusInEvent struct { - Sequence uint16 - Detail byte - Time xproto.Timestamp - Window xproto.Window - Mode byte - DeviceId byte - // padding: 18 bytes -} - -// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. -func FocusInEventNew(buf []byte) xgb.Event { - v := FocusInEvent{} - b := 1 // don't read event number - - v.Detail = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.Window = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Mode = buf[b] - b += 1 - - v.DeviceId = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -// Bytes writes a FocusInEvent value to a byte slice. -func (v FocusInEvent) Bytes() []byte { - buf := make([]byte, 32) - b := 0 - - // write event number - buf[b] = 6 - b += 1 - - buf[b] = v.Detail - b += 1 - - b += 2 // skip sequence number - - xgb.Put32(buf[b:], uint32(v.Time)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.Window)) - b += 4 - - buf[b] = v.Mode - b += 1 - - buf[b] = v.DeviceId - b += 1 - - b += 18 // padding - - return buf -} - -// SequenceId returns the sequence id attached to the FocusIn event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v FocusInEvent) SequenceId() uint16 { - return v.Sequence -} - -// String is a rudimentary string representation of FocusInEvent. -func (v FocusInEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "FocusIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew -} - -// FocusOut is the event number for a FocusOutEvent. -const FocusOut = 7 - -type FocusOutEvent FocusInEvent - -// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. -func FocusOutEventNew(buf []byte) xgb.Event { - return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) -} - -// Bytes writes a FocusOutEvent value to a byte slice. -func (v FocusOutEvent) Bytes() []byte { - return FocusInEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the FocusOut event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v FocusOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v FocusOutEvent) String() string { - fieldVals := make([]string, 0, 6) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) - fieldVals = append(fieldVals, xgb.Sprintf("Mode: %d", v.Mode)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "FocusOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew -} - -const ( - InputClassKey = 0 - InputClassButton = 1 - InputClassValuator = 2 - InputClassFeedback = 3 - InputClassProximity = 4 - InputClassFocus = 5 - InputClassOther = 6 -) - -type InputClassInfo struct { - ClassId byte - EventTypeBase byte -} - -// InputClassInfoRead reads a byte slice into a InputClassInfo value. -func InputClassInfoRead(buf []byte, v *InputClassInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.EventTypeBase = buf[b] - b += 1 - - return b -} - -// InputClassInfoReadList reads a byte slice into a list of InputClassInfo values. -func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = InputClassInfo{} - b += InputClassInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a InputClassInfo value to a byte slice. -func (v InputClassInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.EventTypeBase - b += 1 - - return buf -} - -// InputClassInfoListBytes writes a list of InputClassInfo values to a byte slice. -func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type InputInfo struct { - ClassId byte - Len byte -} - -// InputInfoRead reads a byte slice into a InputInfo value. -func InputInfoRead(buf []byte, v *InputInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - return b -} - -// InputInfoReadList reads a byte slice into a list of InputInfo values. -func InputInfoReadList(buf []byte, dest []InputInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = InputInfo{} - b += InputInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a InputInfo value to a byte slice. -func (v InputInfo) Bytes() []byte { - buf := make([]byte, 2) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - return buf -} - -// InputInfoListBytes writes a list of InputInfo values to a byte slice. -func InputInfoListBytes(buf []byte, list []InputInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type InputState struct { - ClassId byte - Len byte - NumItems byte -} - -// InputStateRead reads a byte slice into a InputState value. -func InputStateRead(buf []byte, v *InputState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumItems = buf[b] - b += 1 - - return b -} - -// InputStateReadList reads a byte slice into a list of InputState values. -func InputStateReadList(buf []byte, dest []InputState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = InputState{} - b += InputStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a InputState value to a byte slice. -func (v InputState) Bytes() []byte { - buf := make([]byte, 3) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumItems - b += 1 - - return buf -} - -// InputStateListBytes writes a list of InputState values to a byte slice. -func InputStateListBytes(buf []byte, list []InputState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type IntegerFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - IntToDisplay int32 -} - -// IntegerFeedbackCtlRead reads a byte slice into a IntegerFeedbackCtl value. -func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.IntToDisplay = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// IntegerFeedbackCtlReadList reads a byte slice into a list of IntegerFeedbackCtl values. -func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = IntegerFeedbackCtl{} - b += IntegerFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a IntegerFeedbackCtl value to a byte slice. -func (v IntegerFeedbackCtl) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], uint32(v.IntToDisplay)) - b += 4 - - return buf -} - -// IntegerFeedbackCtlListBytes writes a list of IntegerFeedbackCtl values to a byte slice. -func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type IntegerFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Resolution uint32 - MinValue int32 - MaxValue int32 -} - -// IntegerFeedbackStateRead reads a byte slice into a IntegerFeedbackState value. -func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Resolution = xgb.Get32(buf[b:]) - b += 4 - - v.MinValue = int32(xgb.Get32(buf[b:])) - b += 4 - - v.MaxValue = int32(xgb.Get32(buf[b:])) - b += 4 - - return b -} - -// IntegerFeedbackStateReadList reads a byte slice into a list of IntegerFeedbackState values. -func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = IntegerFeedbackState{} - b += IntegerFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a IntegerFeedbackState value to a byte slice. -func (v IntegerFeedbackState) Bytes() []byte { - buf := make([]byte, 16) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.Resolution) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MinValue)) - b += 4 - - xgb.Put32(buf[b:], uint32(v.MaxValue)) - b += 4 - - return buf -} - -// IntegerFeedbackStateListBytes writes a list of IntegerFeedbackState values to a byte slice. -func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type KbdFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - Key KeyCode - AutoRepeatMode byte - KeyClickPercent int8 - BellPercent int8 - BellPitch int16 - BellDuration int16 - LedMask uint32 - LedValues uint32 -} - -// KbdFeedbackCtlRead reads a byte slice into a KbdFeedbackCtl value. -func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Key = KeyCode(buf[b]) - b += 1 - - v.AutoRepeatMode = buf[b] - b += 1 - - v.KeyClickPercent = int8(buf[b]) - b += 1 - - v.BellPercent = int8(buf[b]) - b += 1 - - v.BellPitch = int16(xgb.Get16(buf[b:])) - b += 2 - - v.BellDuration = int16(xgb.Get16(buf[b:])) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// KbdFeedbackCtlReadList reads a byte slice into a list of KbdFeedbackCtl values. -func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KbdFeedbackCtl{} - b += KbdFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KbdFeedbackCtl value to a byte slice. -func (v KbdFeedbackCtl) Bytes() []byte { - buf := make([]byte, 20) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - buf[b] = byte(v.Key) - b += 1 - - buf[b] = v.AutoRepeatMode - b += 1 - - buf[b] = byte(v.KeyClickPercent) - b += 1 - - buf[b] = byte(v.BellPercent) - b += 1 - - xgb.Put16(buf[b:], uint16(v.BellPitch)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.BellDuration)) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// KbdFeedbackCtlListBytes writes a list of KbdFeedbackCtl values to a byte slice. -func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type KbdFeedbackState struct { - ClassId byte - Id byte - Len uint16 - Pitch uint16 - Duration uint16 - LedMask uint32 - LedValues uint32 - GlobalAutoRepeat bool - Click byte - Percent byte - // padding: 1 bytes - AutoRepeats []byte // size: 32 -} - -// KbdFeedbackStateRead reads a byte slice into a KbdFeedbackState value. -func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.Pitch = xgb.Get16(buf[b:]) - b += 2 - - v.Duration = xgb.Get16(buf[b:]) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - if buf[b] == 1 { - v.GlobalAutoRepeat = true - } else { - v.GlobalAutoRepeat = false - } - b += 1 - - v.Click = buf[b] - b += 1 - - v.Percent = buf[b] - b += 1 - - b += 1 // padding - - v.AutoRepeats = make([]byte, 32) - copy(v.AutoRepeats[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return b -} - -// KbdFeedbackStateReadList reads a byte slice into a list of KbdFeedbackState values. -func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KbdFeedbackState{} - b += KbdFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KbdFeedbackState value to a byte slice. -func (v KbdFeedbackState) Bytes() []byte { - buf := make([]byte, 52) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put16(buf[b:], v.Pitch) - b += 2 - - xgb.Put16(buf[b:], v.Duration) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - if v.GlobalAutoRepeat { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = v.Click - b += 1 - - buf[b] = v.Percent - b += 1 - - b += 1 // padding - - copy(buf[b:], v.AutoRepeats[:32]) - b += xgb.Pad(int(32)) - - return buf -} - -// KbdFeedbackStateListBytes writes a list of KbdFeedbackState values to a byte slice. -func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. -func KbdFeedbackStateListSize(list []KbdFeedbackState) int { - size := 0 - for _ = range list { - size += 52 - } - return size -} - -type KeyCode byte - -type KeyInfo struct { - ClassId byte - Len byte - MinKeycode KeyCode - MaxKeycode KeyCode - NumKeys uint16 - // padding: 2 bytes -} - -// KeyInfoRead reads a byte slice into a KeyInfo value. -func KeyInfoRead(buf []byte, v *KeyInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.MinKeycode = KeyCode(buf[b]) - b += 1 - - v.MaxKeycode = KeyCode(buf[b]) - b += 1 - - v.NumKeys = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - return b -} - -// KeyInfoReadList reads a byte slice into a list of KeyInfo values. -func KeyInfoReadList(buf []byte, dest []KeyInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KeyInfo{} - b += KeyInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KeyInfo value to a byte slice. -func (v KeyInfo) Bytes() []byte { - buf := make([]byte, 8) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = byte(v.MinKeycode) - b += 1 - - buf[b] = byte(v.MaxKeycode) - b += 1 - - xgb.Put16(buf[b:], v.NumKeys) - b += 2 - - b += 2 // padding - - return buf -} - -// KeyInfoListBytes writes a list of KeyInfo values to a byte slice. -func KeyInfoListBytes(buf []byte, list []KeyInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type KeyState struct { - ClassId byte - Len byte - NumKeys byte - // padding: 1 bytes - Keys []byte // size: 32 -} - -// KeyStateRead reads a byte slice into a KeyState value. -func KeyStateRead(buf []byte, v *KeyState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumKeys = buf[b] - b += 1 - - b += 1 // padding - - v.Keys = make([]byte, 32) - copy(v.Keys[:32], buf[b:]) - b += xgb.Pad(int(32)) - - return b -} - -// KeyStateReadList reads a byte slice into a list of KeyState values. -func KeyStateReadList(buf []byte, dest []KeyState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = KeyState{} - b += KeyStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a KeyState value to a byte slice. -func (v KeyState) Bytes() []byte { - buf := make([]byte, 36) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumKeys - b += 1 - - b += 1 // padding - - copy(buf[b:], v.Keys[:32]) - b += xgb.Pad(int(32)) - - return buf -} - -// KeyStateListBytes writes a list of KeyState values to a byte slice. -func KeyStateListBytes(buf []byte, list []KeyState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// KeyStateListSize computes the size (bytes) of a list of KeyState values. -func KeyStateListSize(list []KeyState) int { - size := 0 - for _ = range list { - size += 36 - } - return size -} - -type LedFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 -} - -// LedFeedbackCtlRead reads a byte slice into a LedFeedbackCtl value. -func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// LedFeedbackCtlReadList reads a byte slice into a list of LedFeedbackCtl values. -func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = LedFeedbackCtl{} - b += LedFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a LedFeedbackCtl value to a byte slice. -func (v LedFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// LedFeedbackCtlListBytes writes a list of LedFeedbackCtl values to a byte slice. -func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type LedFeedbackState struct { - ClassId byte - Id byte - Len uint16 - LedMask uint32 - LedValues uint32 -} - -// LedFeedbackStateRead reads a byte slice into a LedFeedbackState value. -func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.LedMask = xgb.Get32(buf[b:]) - b += 4 - - v.LedValues = xgb.Get32(buf[b:]) - b += 4 - - return b -} - -// LedFeedbackStateReadList reads a byte slice into a list of LedFeedbackState values. -func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = LedFeedbackState{} - b += LedFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a LedFeedbackState value to a byte slice. -func (v LedFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put32(buf[b:], v.LedMask) - b += 4 - - xgb.Put32(buf[b:], v.LedValues) - b += 4 - - return buf -} - -// LedFeedbackStateListBytes writes a list of LedFeedbackState values to a byte slice. -func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// BadMode is the error number for a BadMode. -const BadMode = 2 - -type ModeError struct { - Sequence uint16 - NiceName string -} - -// ModeErrorNew constructs a ModeError value that implements xgb.Error from a byte slice. -func ModeErrorNew(buf []byte) xgb.Error { - v := ModeError{} - v.NiceName = "Mode" - - b := 1 // skip error determinant - b += 1 // don't read error number - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - return v -} - -// SequenceId returns the sequence id attached to the BadMode error. -// This is mostly used internally. -func (err ModeError) SequenceId() uint16 { - return err.Sequence -} - -// BadId returns the 'BadValue' number if one exists for the BadMode error. If no bad value exists, 0 is returned. -func (err ModeError) BadId() uint32 { - return 0 -} - -// Error returns a rudimentary string representation of the BadMode error. - -func (err ModeError) Error() string { - fieldVals := make([]string, 0, 0) - fieldVals = append(fieldVals, "NiceName: "+err.NiceName) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) - return "BadMode {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew -} - -const ( - PropagateModeAddToList = 0 - PropagateModeDeleteFromList = 1 -) - -// ProximityIn is the event number for a ProximityInEvent. -const ProximityIn = 8 - -type ProximityInEvent DeviceKeyPressEvent - -// ProximityInEventNew constructs a ProximityInEvent value that implements xgb.Event from a byte slice. -func ProximityInEventNew(buf []byte) xgb.Event { - return ProximityInEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a ProximityInEvent value to a byte slice. -func (v ProximityInEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the ProximityIn event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ProximityInEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ProximityInEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "ProximityIn {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][8] = ProximityInEventNew -} - -// ProximityOut is the event number for a ProximityOutEvent. -const ProximityOut = 9 - -type ProximityOutEvent DeviceKeyPressEvent - -// ProximityOutEventNew constructs a ProximityOutEvent value that implements xgb.Event from a byte slice. -func ProximityOutEventNew(buf []byte) xgb.Event { - return ProximityOutEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) -} - -// Bytes writes a ProximityOutEvent value to a byte slice. -func (v ProximityOutEvent) Bytes() []byte { - return DeviceKeyPressEvent(v).Bytes() -} - -// SequenceId returns the sequence id attached to the ProximityOut event. -// Events without a sequence number (KeymapNotify) return 0. -// This is mostly used internally. -func (v ProximityOutEvent) SequenceId() uint16 { - return v.Sequence -} - -func (v ProximityOutEvent) String() string { - fieldVals := make([]string, 0, 12) - fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Detail: %d", v.Detail)) - fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) - fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) - fieldVals = append(fieldVals, xgb.Sprintf("Event: %d", v.Event)) - fieldVals = append(fieldVals, xgb.Sprintf("Child: %d", v.Child)) - fieldVals = append(fieldVals, xgb.Sprintf("RootX: %d", v.RootX)) - fieldVals = append(fieldVals, xgb.Sprintf("RootY: %d", v.RootY)) - fieldVals = append(fieldVals, xgb.Sprintf("EventX: %d", v.EventX)) - fieldVals = append(fieldVals, xgb.Sprintf("EventY: %d", v.EventY)) - fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SameScreen: %t", v.SameScreen)) - fieldVals = append(fieldVals, xgb.Sprintf("DeviceId: %d", v.DeviceId)) - return "ProximityOut {" + xgb.StringsJoin(fieldVals, ", ") + "}" -} - -func init() { - xgb.NewExtEventFuncs["XInputExtension"][9] = ProximityOutEventNew -} - -type PtrFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - Num int16 - Denom int16 - Threshold int16 -} - -// PtrFeedbackCtlRead reads a byte slice into a PtrFeedbackCtl value. -func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.Num = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Denom = int16(xgb.Get16(buf[b:])) - b += 2 - - v.Threshold = int16(xgb.Get16(buf[b:])) - b += 2 - - return b -} - -// PtrFeedbackCtlReadList reads a byte slice into a list of PtrFeedbackCtl values. -func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = PtrFeedbackCtl{} - b += PtrFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a PtrFeedbackCtl value to a byte slice. -func (v PtrFeedbackCtl) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], uint16(v.Num)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Denom)) - b += 2 - - xgb.Put16(buf[b:], uint16(v.Threshold)) - b += 2 - - return buf -} - -// PtrFeedbackCtlListBytes writes a list of PtrFeedbackCtl values to a byte slice. -func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type PtrFeedbackState struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - AccelNum uint16 - AccelDenom uint16 - Threshold uint16 -} - -// PtrFeedbackStateRead reads a byte slice into a PtrFeedbackState value. -func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.AccelNum = xgb.Get16(buf[b:]) - b += 2 - - v.AccelDenom = xgb.Get16(buf[b:]) - b += 2 - - v.Threshold = xgb.Get16(buf[b:]) - b += 2 - - return b -} - -// PtrFeedbackStateReadList reads a byte slice into a list of PtrFeedbackState values. -func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = PtrFeedbackState{} - b += PtrFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a PtrFeedbackState value to a byte slice. -func (v PtrFeedbackState) Bytes() []byte { - buf := make([]byte, 12) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], v.AccelNum) - b += 2 - - xgb.Put16(buf[b:], v.AccelDenom) - b += 2 - - xgb.Put16(buf[b:], v.Threshold) - b += 2 - - return buf -} - -// PtrFeedbackStateListBytes writes a list of PtrFeedbackState values to a byte slice. -func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -type StringFeedbackCtl struct { - ClassId byte - Id byte - Len uint16 - // padding: 2 bytes - NumKeysyms uint16 - Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) -} - -// StringFeedbackCtlRead reads a byte slice into a StringFeedbackCtl value. -func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - b += 2 // padding - - v.NumKeysyms = xgb.Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// StringFeedbackCtlReadList reads a byte slice into a list of StringFeedbackCtl values. -func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = StringFeedbackCtl{} - b += StringFeedbackCtlRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a StringFeedbackCtl value to a byte slice. -func (v StringFeedbackCtl) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - b += 2 // padding - - xgb.Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - xgb.Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// StringFeedbackCtlListBytes writes a list of StringFeedbackCtl values to a byte slice. -func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. -func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) - } - return size -} - -type StringFeedbackState struct { - ClassId byte - Id byte - Len uint16 - MaxSymbols uint16 - NumKeysyms uint16 - Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) -} - -// StringFeedbackStateRead reads a byte slice into a StringFeedbackState value. -func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Id = buf[b] - b += 1 - - v.Len = xgb.Get16(buf[b:]) - b += 2 - - v.MaxSymbols = xgb.Get16(buf[b:]) - b += 2 - - v.NumKeysyms = xgb.Get16(buf[b:]) - b += 2 - - v.Keysyms = make([]xproto.Keysym, v.NumKeysyms) - for i := 0; i < int(v.NumKeysyms); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// StringFeedbackStateReadList reads a byte slice into a list of StringFeedbackState values. -func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = StringFeedbackState{} - b += StringFeedbackStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a StringFeedbackState value to a byte slice. -func (v StringFeedbackState) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Id - b += 1 - - xgb.Put16(buf[b:], v.Len) - b += 2 - - xgb.Put16(buf[b:], v.MaxSymbols) - b += 2 - - xgb.Put16(buf[b:], v.NumKeysyms) - b += 2 - - for i := 0; i < int(v.NumKeysyms); i++ { - xgb.Put32(buf[b:], uint32(v.Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// StringFeedbackStateListBytes writes a list of StringFeedbackState values to a byte slice. -func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. -func StringFeedbackStateListSize(list []StringFeedbackState) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.NumKeysyms) * 4))) - } - return size -} - -type ValuatorInfo struct { - ClassId byte - Len byte - AxesLen byte - Mode byte - MotionSize uint32 - Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) -} - -// ValuatorInfoRead reads a byte slice into a ValuatorInfo value. -func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.AxesLen = buf[b] - b += 1 - - v.Mode = buf[b] - b += 1 - - v.MotionSize = xgb.Get32(buf[b:]) - b += 4 - - v.Axes = make([]AxisInfo, v.AxesLen) - b += AxisInfoReadList(buf[b:], v.Axes) - - return b -} - -// ValuatorInfoReadList reads a byte slice into a list of ValuatorInfo values. -func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ValuatorInfo{} - b += ValuatorInfoRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ValuatorInfo value to a byte slice. -func (v ValuatorInfo) Bytes() []byte { - buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.AxesLen - b += 1 - - buf[b] = v.Mode - b += 1 - - xgb.Put32(buf[b:], v.MotionSize) - b += 4 - - b += AxisInfoListBytes(buf[b:], v.Axes) - - return buf -} - -// ValuatorInfoListBytes writes a list of ValuatorInfo values to a byte slice. -func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. -func ValuatorInfoListSize(list []ValuatorInfo) int { - size := 0 - for _, item := range list { - size += (8 + xgb.Pad((int(item.AxesLen) * 12))) - } - return size -} - -const ( - ValuatorModeRelative = 0 - ValuatorModeAbsolute = 1 -) - -type ValuatorState struct { - ClassId byte - Len byte - NumValuators byte - Mode byte - Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) -} - -// ValuatorStateRead reads a byte slice into a ValuatorState value. -func ValuatorStateRead(buf []byte, v *ValuatorState) int { - b := 0 - - v.ClassId = buf[b] - b += 1 - - v.Len = buf[b] - b += 1 - - v.NumValuators = buf[b] - b += 1 - - v.Mode = buf[b] - b += 1 - - v.Valuators = make([]uint32, v.NumValuators) - for i := 0; i < int(v.NumValuators); i++ { - v.Valuators[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - - return b -} - -// ValuatorStateReadList reads a byte slice into a list of ValuatorState values. -func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { - b := 0 - for i := 0; i < len(dest); i++ { - dest[i] = ValuatorState{} - b += ValuatorStateRead(buf[b:], &dest[i]) - } - return xgb.Pad(b) -} - -// Bytes writes a ValuatorState value to a byte slice. -func (v ValuatorState) Bytes() []byte { - buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) - b := 0 - - buf[b] = v.ClassId - b += 1 - - buf[b] = v.Len - b += 1 - - buf[b] = v.NumValuators - b += 1 - - buf[b] = v.Mode - b += 1 - - for i := 0; i < int(v.NumValuators); i++ { - xgb.Put32(buf[b:], v.Valuators[i]) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ValuatorStateListBytes writes a list of ValuatorState values to a byte slice. -func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { - b := 0 - var structBytes []byte - for _, item := range list { - structBytes = item.Bytes() - copy(buf[b:], structBytes) - b += len(structBytes) - } - return xgb.Pad(b) -} - -// ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. -func ValuatorStateListSize(list []ValuatorState) int { - size := 0 - for _, item := range list { - size += (4 + xgb.Pad((int(item.NumValuators) * 4))) - } - return size -} - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Byte' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Int8' - -// Skipping definition for base type 'Card16' - -// Skipping definition for base type 'Card32' - -// AllowDeviceEventsCookie is a cookie used only for AllowDeviceEvents requests. -type AllowDeviceEventsCookie struct { - *xgb.Cookie -} - -// AllowDeviceEvents sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) - return AllowDeviceEventsCookie{cookie} -} - -// AllowDeviceEventsChecked sends a checked request. -// If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() -func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) - return AllowDeviceEventsCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook AllowDeviceEventsCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for AllowDeviceEvents -// allowDeviceEventsRequest writes a AllowDeviceEvents request to a byte slice. -func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 19 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = Mode - b += 1 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// ChangeDeviceDontPropagateListCookie is a cookie used only for ChangeDeviceDontPropagateList requests. -type ChangeDeviceDontPropagateListCookie struct { - *xgb.Cookie -} - -// ChangeDeviceDontPropagateList sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) - return ChangeDeviceDontPropagateListCookie{cookie} -} - -// ChangeDeviceDontPropagateListChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeDeviceDontPropagateListCookie.Check() -func ChangeDeviceDontPropagateListChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) - return ChangeDeviceDontPropagateListCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeDeviceDontPropagateListCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeDeviceDontPropagateList -// changeDeviceDontPropagateListRequest writes a ChangeDeviceDontPropagateList request to a byte slice. -func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) []byte { - size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 8 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = Mode - b += 1 - - b += 1 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeDeviceKeyMappingCookie is a cookie used only for ChangeDeviceKeyMapping requests. -type ChangeDeviceKeyMappingCookie struct { - *xgb.Cookie -} - -// ChangeDeviceKeyMapping sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return ChangeDeviceKeyMappingCookie{cookie} -} - -// ChangeDeviceKeyMappingChecked sends a checked request. -// If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() -func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) - return ChangeDeviceKeyMappingCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook ChangeDeviceKeyMappingCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for ChangeDeviceKeyMapping -// changeDeviceKeyMappingRequest writes a ChangeDeviceKeyMapping request to a byte slice. -func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { - size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 25 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = KeysymsPerKeycode - b += 1 - - buf[b] = KeycodeCount - b += 1 - - for i := 0; i < int((int(KeycodeCount) * int(KeysymsPerKeycode))); i++ { - xgb.Put32(buf[b:], uint32(Keysyms[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ChangeKeyboardDeviceCookie is a cookie used only for ChangeKeyboardDevice requests. -type ChangeKeyboardDeviceCookie struct { - *xgb.Cookie -} - -// ChangeKeyboardDevice sends a checked request. -// If an error occurs, it will be returned with the reply by calling ChangeKeyboardDeviceCookie.Reply() -func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) - return ChangeKeyboardDeviceCookie{cookie} -} - -// ChangeKeyboardDeviceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangeKeyboardDeviceUnchecked(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) - return ChangeKeyboardDeviceCookie{cookie} -} - -// ChangeKeyboardDeviceReply represents the data returned from a ChangeKeyboardDevice request. -type ChangeKeyboardDeviceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a ChangeKeyboardDevice request. -func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return changeKeyboardDeviceReply(buf), nil -} - -// changeKeyboardDeviceReply reads a byte slice into a ChangeKeyboardDeviceReply value. -func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { - v := new(ChangeKeyboardDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for ChangeKeyboardDevice -// changeKeyboardDeviceRequest writes a ChangeKeyboardDevice request to a byte slice. -func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 11 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// ChangePointerDeviceCookie is a cookie used only for ChangePointerDevice requests. -type ChangePointerDeviceCookie struct { - *xgb.Cookie -} - -// ChangePointerDevice sends a checked request. -// If an error occurs, it will be returned with the reply by calling ChangePointerDeviceCookie.Reply() -func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) - return ChangePointerDeviceCookie{cookie} -} - -// ChangePointerDeviceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ChangePointerDeviceUnchecked(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) - return ChangePointerDeviceCookie{cookie} -} - -// ChangePointerDeviceReply represents the data returned from a ChangePointerDevice request. -type ChangePointerDeviceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a ChangePointerDevice request. -func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return changePointerDeviceReply(buf), nil -} - -// changePointerDeviceReply reads a byte slice into a ChangePointerDeviceReply value. -func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { - v := new(ChangePointerDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for ChangePointerDevice -// changePointerDeviceRequest writes a ChangePointerDevice request to a byte slice. -func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 12 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = XAxis - b += 1 - - buf[b] = YAxis - b += 1 - - buf[b] = DeviceId - b += 1 - - b += 1 // padding - - return buf -} - -// CloseDeviceCookie is a cookie used only for CloseDevice requests. -type CloseDeviceCookie struct { - *xgb.Cookie -} - -// CloseDevice sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) - return CloseDeviceCookie{cookie} -} - -// CloseDeviceChecked sends a checked request. -// If an error occurs, it can be retrieved using CloseDeviceCookie.Check() -func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) - return CloseDeviceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook CloseDeviceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for CloseDevice -// closeDeviceRequest writes a CloseDevice request to a byte slice. -func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 4 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// DeviceBellCookie is a cookie used only for DeviceBell requests. -type DeviceBellCookie struct { - *xgb.Cookie -} - -// DeviceBell sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return DeviceBellCookie{cookie} -} - -// DeviceBellChecked sends a checked request. -// If an error occurs, it can be retrieved using DeviceBellCookie.Check() -func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) - return DeviceBellCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook DeviceBellCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for DeviceBell -// deviceBellRequest writes a DeviceBell request to a byte slice. -func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 32 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = FeedbackId - b += 1 - - buf[b] = FeedbackClass - b += 1 - - buf[b] = byte(Percent) - b += 1 - - return buf -} - -// GetDeviceButtonMappingCookie is a cookie used only for GetDeviceButtonMapping requests. -type GetDeviceButtonMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceButtonMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() -func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) - return GetDeviceButtonMappingCookie{cookie} -} - -// GetDeviceButtonMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) - return GetDeviceButtonMappingCookie{cookie} -} - -// GetDeviceButtonMappingReply represents the data returned from a GetDeviceButtonMapping request. -type GetDeviceButtonMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - MapSize byte - // padding: 23 bytes - Map []byte // size: xgb.Pad((int(MapSize) * 1)) -} - -// Reply blocks and returns the reply data for a GetDeviceButtonMapping request. -func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceButtonMappingReply(buf), nil -} - -// getDeviceButtonMappingReply reads a byte slice into a GetDeviceButtonMappingReply value. -func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { - v := new(GetDeviceButtonMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.MapSize = buf[b] - b += 1 - - b += 23 // padding - - v.Map = make([]byte, v.MapSize) - copy(v.Map[:v.MapSize], buf[b:]) - b += xgb.Pad(int(v.MapSize)) - - return v -} - -// Write request to wire for GetDeviceButtonMapping -// getDeviceButtonMappingRequest writes a GetDeviceButtonMapping request to a byte slice. -func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 28 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// GetDeviceControlCookie is a cookie used only for GetDeviceControl requests. -type GetDeviceControlCookie struct { - *xgb.Cookie -} - -// GetDeviceControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() -func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) - return GetDeviceControlCookie{cookie} -} - -// GetDeviceControlUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) - return GetDeviceControlCookie{cookie} -} - -// GetDeviceControlReply represents the data returned from a GetDeviceControl request. -type GetDeviceControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceControl request. -func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceControlReply(buf), nil -} - -// getDeviceControlReply reads a byte slice into a GetDeviceControlReply value. -func getDeviceControlReply(buf []byte) *GetDeviceControlReply { - v := new(GetDeviceControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for GetDeviceControl -// getDeviceControlRequest writes a GetDeviceControl request to a byte slice. -func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 34 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], ControlId) - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 1 // padding - - return buf -} - -// GetDeviceDontPropagateListCookie is a cookie used only for GetDeviceDontPropagateList requests. -type GetDeviceDontPropagateListCookie struct { - *xgb.Cookie -} - -// GetDeviceDontPropagateList sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() -func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) - return GetDeviceDontPropagateListCookie{cookie} -} - -// GetDeviceDontPropagateListUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) - return GetDeviceDontPropagateListCookie{cookie} -} - -// GetDeviceDontPropagateListReply represents the data returned from a GetDeviceDontPropagateList request. -type GetDeviceDontPropagateListReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClasses uint16 - // padding: 22 bytes - Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) -} - -// Reply blocks and returns the reply data for a GetDeviceDontPropagateList request. -func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceDontPropagateListReply(buf), nil -} - -// getDeviceDontPropagateListReply reads a byte slice into a GetDeviceDontPropagateListReply value. -func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { - v := new(GetDeviceDontPropagateListReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - v.Classes = make([]EventClass, v.NumClasses) - for i := 0; i < int(v.NumClasses); i++ { - v.Classes[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetDeviceDontPropagateList -// getDeviceDontPropagateListRequest writes a GetDeviceDontPropagateList request to a byte slice. -func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 9 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// GetDeviceFocusCookie is a cookie used only for GetDeviceFocus requests. -type GetDeviceFocusCookie struct { - *xgb.Cookie -} - -// GetDeviceFocus sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() -func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) - return GetDeviceFocusCookie{cookie} -} - -// GetDeviceFocusUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) - return GetDeviceFocusCookie{cookie} -} - -// GetDeviceFocusReply represents the data returned from a GetDeviceFocus request. -type GetDeviceFocusReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Focus xproto.Window - Time xproto.Timestamp - RevertTo byte - // padding: 15 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceFocus request. -func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceFocusReply(buf), nil -} - -// getDeviceFocusReply reads a byte slice into a GetDeviceFocusReply value. -func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { - v := new(GetDeviceFocusReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Focus = xproto.Window(xgb.Get32(buf[b:])) - b += 4 - - v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) - b += 4 - - v.RevertTo = buf[b] - b += 1 - - b += 15 // padding - - return v -} - -// Write request to wire for GetDeviceFocus -// getDeviceFocusRequest writes a GetDeviceFocus request to a byte slice. -func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 20 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// GetDeviceKeyMappingCookie is a cookie used only for GetDeviceKeyMapping requests. -type GetDeviceKeyMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceKeyMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() -func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) - return GetDeviceKeyMappingCookie{cookie} -} - -// GetDeviceKeyMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) - return GetDeviceKeyMappingCookie{cookie} -} - -// GetDeviceKeyMappingReply represents the data returned from a GetDeviceKeyMapping request. -type GetDeviceKeyMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - KeysymsPerKeycode byte - // padding: 23 bytes - Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) -} - -// Reply blocks and returns the reply data for a GetDeviceKeyMapping request. -func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceKeyMappingReply(buf), nil -} - -// getDeviceKeyMappingReply reads a byte slice into a GetDeviceKeyMappingReply value. -func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { - v := new(GetDeviceKeyMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeysymsPerKeycode = buf[b] - b += 1 - - b += 23 // padding - - v.Keysyms = make([]xproto.Keysym, v.Length) - for i := 0; i < int(v.Length); i++ { - v.Keysyms[i] = xproto.Keysym(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetDeviceKeyMapping -// getDeviceKeyMappingRequest writes a GetDeviceKeyMapping request to a byte slice. -func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 24 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = byte(FirstKeycode) - b += 1 - - buf[b] = Count - b += 1 - - return buf -} - -// GetDeviceModifierMappingCookie is a cookie used only for GetDeviceModifierMapping requests. -type GetDeviceModifierMappingCookie struct { - *xgb.Cookie -} - -// GetDeviceModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() -func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) - return GetDeviceModifierMappingCookie{cookie} -} - -// GetDeviceModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) - return GetDeviceModifierMappingCookie{cookie} -} - -// GetDeviceModifierMappingReply represents the data returned from a GetDeviceModifierMapping request. -type GetDeviceModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - KeycodesPerModifier byte - // padding: 23 bytes - Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) -} - -// Reply blocks and returns the reply data for a GetDeviceModifierMapping request. -func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceModifierMappingReply(buf), nil -} - -// getDeviceModifierMappingReply reads a byte slice into a GetDeviceModifierMappingReply value. -func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { - v := new(GetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.KeycodesPerModifier = buf[b] - b += 1 - - b += 23 // padding - - v.Keymaps = make([]byte, (int(v.KeycodesPerModifier) * 8)) - copy(v.Keymaps[:(int(v.KeycodesPerModifier)*8)], buf[b:]) - b += xgb.Pad(int((int(v.KeycodesPerModifier) * 8))) - - return v -} - -// Write request to wire for GetDeviceModifierMapping -// getDeviceModifierMappingRequest writes a GetDeviceModifierMapping request to a byte slice. -func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 26 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// GetDeviceMotionEventsCookie is a cookie used only for GetDeviceMotionEvents requests. -type GetDeviceMotionEventsCookie struct { - *xgb.Cookie -} - -// GetDeviceMotionEvents sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() -func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) - return GetDeviceMotionEventsCookie{cookie} -} - -// GetDeviceMotionEventsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) - return GetDeviceMotionEventsCookie{cookie} -} - -// GetDeviceMotionEventsReply represents the data returned from a GetDeviceMotionEvents request. -type GetDeviceMotionEventsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumCoords uint32 - NumAxes byte - DeviceMode byte - // padding: 18 bytes -} - -// Reply blocks and returns the reply data for a GetDeviceMotionEvents request. -func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getDeviceMotionEventsReply(buf), nil -} - -// getDeviceMotionEventsReply reads a byte slice into a GetDeviceMotionEventsReply value. -func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { - v := new(GetDeviceMotionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumCoords = xgb.Get32(buf[b:]) - b += 4 - - v.NumAxes = buf[b] - b += 1 - - v.DeviceMode = buf[b] - b += 1 - - b += 18 // padding - - return v -} - -// Write request to wire for GetDeviceMotionEvents -// getDeviceMotionEventsRequest writes a GetDeviceMotionEvents request to a byte slice. -func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 10 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Start)) - b += 4 - - xgb.Put32(buf[b:], uint32(Stop)) - b += 4 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// GetExtensionVersionCookie is a cookie used only for GetExtensionVersion requests. -type GetExtensionVersionCookie struct { - *xgb.Cookie -} - -// GetExtensionVersion sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() -func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) - return GetExtensionVersionCookie{cookie} -} - -// GetExtensionVersionUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) - return GetExtensionVersionCookie{cookie} -} - -// GetExtensionVersionReply represents the data returned from a GetExtensionVersion request. -type GetExtensionVersionReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - ServerMajor uint16 - ServerMinor uint16 - Present bool - // padding: 19 bytes -} - -// Reply blocks and returns the reply data for a GetExtensionVersion request. -func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getExtensionVersionReply(buf), nil -} - -// getExtensionVersionReply reads a byte slice into a GetExtensionVersionReply value. -func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { - v := new(GetExtensionVersionReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.ServerMajor = xgb.Get16(buf[b:]) - b += 2 - - v.ServerMinor = xgb.Get16(buf[b:]) - b += 2 - - if buf[b] == 1 { - v.Present = true - } else { - v.Present = false - } - b += 1 - - b += 19 // padding - - return v -} - -// Write request to wire for GetExtensionVersion -// getExtensionVersionRequest writes a GetExtensionVersion request to a byte slice. -func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { - size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 1 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put16(buf[b:], NameLen) - b += 2 - - b += 2 // padding - - copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) - - return buf -} - -// GetFeedbackControlCookie is a cookie used only for GetFeedbackControl requests. -type GetFeedbackControlCookie struct { - *xgb.Cookie -} - -// GetFeedbackControl sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() -func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) - return GetFeedbackControlCookie{cookie} -} - -// GetFeedbackControlUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) - return GetFeedbackControlCookie{cookie} -} - -// GetFeedbackControlReply represents the data returned from a GetFeedbackControl request. -type GetFeedbackControlReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumFeedback uint16 - // padding: 22 bytes -} - -// Reply blocks and returns the reply data for a GetFeedbackControl request. -func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getFeedbackControlReply(buf), nil -} - -// getFeedbackControlReply reads a byte slice into a GetFeedbackControlReply value. -func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { - v := new(GetFeedbackControlReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumFeedback = xgb.Get16(buf[b:]) - b += 2 - - b += 22 // padding - - return v -} - -// Write request to wire for GetFeedbackControl -// getFeedbackControlRequest writes a GetFeedbackControl request to a byte slice. -func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 22 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// GetSelectedExtensionEventsCookie is a cookie used only for GetSelectedExtensionEvents requests. -type GetSelectedExtensionEventsCookie struct { - *xgb.Cookie -} - -// GetSelectedExtensionEvents sends a checked request. -// If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() -func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) - return GetSelectedExtensionEventsCookie{cookie} -} - -// GetSelectedExtensionEventsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) - return GetSelectedExtensionEventsCookie{cookie} -} - -// GetSelectedExtensionEventsReply represents the data returned from a GetSelectedExtensionEvents request. -type GetSelectedExtensionEventsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumThisClasses uint16 - NumAllClasses uint16 - // padding: 20 bytes - ThisClasses []EventClass // size: xgb.Pad((int(NumThisClasses) * 4)) - AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) -} - -// Reply blocks and returns the reply data for a GetSelectedExtensionEvents request. -func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return getSelectedExtensionEventsReply(buf), nil -} - -// getSelectedExtensionEventsReply reads a byte slice into a GetSelectedExtensionEventsReply value. -func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { - v := new(GetSelectedExtensionEventsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumThisClasses = xgb.Get16(buf[b:]) - b += 2 - - v.NumAllClasses = xgb.Get16(buf[b:]) - b += 2 - - b += 20 // padding - - v.ThisClasses = make([]EventClass, v.NumThisClasses) - for i := 0; i < int(v.NumThisClasses); i++ { - v.ThisClasses[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - v.AllClasses = make([]EventClass, v.NumAllClasses) - for i := 0; i < int(v.NumAllClasses); i++ { - v.AllClasses[i] = EventClass(xgb.Get32(buf[b:])) - b += 4 - } - b = xgb.Pad(b) - - return v -} - -// Write request to wire for GetSelectedExtensionEvents -// getSelectedExtensionEventsRequest writes a GetSelectedExtensionEvents request to a byte slice. -func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 7 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - return buf -} - -// GrabDeviceCookie is a cookie used only for GrabDevice requests. -type GrabDeviceCookie struct { - *xgb.Cookie -} - -// GrabDevice sends a checked request. -// If an error occurs, it will be returned with the reply by calling GrabDeviceCookie.Reply() -func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) - return GrabDeviceCookie{cookie} -} - -// GrabDeviceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabDeviceUnchecked(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) - return GrabDeviceCookie{cookie} -} - -// GrabDeviceReply represents the data returned from a GrabDevice request. -type GrabDeviceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a GrabDevice request. -func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return grabDeviceReply(buf), nil -} - -// grabDeviceReply reads a byte slice into a GrabDeviceReply value. -func grabDeviceReply(buf []byte) *GrabDeviceReply { - v := new(GrabDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for GrabDevice -// grabDeviceRequest writes a GrabDevice request to a byte slice. -func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) []byte { - size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 13 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - buf[b] = DeviceId - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GrabDeviceButtonCookie is a cookie used only for GrabDeviceButton requests. -type GrabDeviceButtonCookie struct { - *xgb.Cookie -} - -// GrabDeviceButton sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return GrabDeviceButtonCookie{cookie} -} - -// GrabDeviceButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() -func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) - return GrabDeviceButtonCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GrabDeviceButtonCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for GrabDeviceButton -// grabDeviceButtonRequest writes a GrabDeviceButton request to a byte slice. -func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { - size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 17 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - buf[b] = GrabbedDevice - b += 1 - - buf[b] = ModifierDevice - b += 1 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = OwnerEvents - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// GrabDeviceKeyCookie is a cookie used only for GrabDeviceKey requests. -type GrabDeviceKeyCookie struct { - *xgb.Cookie -} - -// GrabDeviceKey sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) - return GrabDeviceKeyCookie{cookie} -} - -// GrabDeviceKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using GrabDeviceKeyCookie.Check() -func GrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) - return GrabDeviceKeyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook GrabDeviceKeyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for GrabDeviceKey -// grabDeviceKeyRequest writes a GrabDeviceKey request to a byte slice. -func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) []byte { - size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 15 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - buf[b] = Key - b += 1 - - buf[b] = ThisDeviceMode - b += 1 - - buf[b] = OtherDeviceMode - b += 1 - - if OwnerEvents { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// ListInputDevicesCookie is a cookie used only for ListInputDevices requests. -type ListInputDevicesCookie struct { - *xgb.Cookie -} - -// ListInputDevices sends a checked request. -// If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() -func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(listInputDevicesRequest(c), cookie) - return ListInputDevicesCookie{cookie} -} - -// ListInputDevicesUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(listInputDevicesRequest(c), cookie) - return ListInputDevicesCookie{cookie} -} - -// ListInputDevicesReply represents the data returned from a ListInputDevices request. -type ListInputDevicesReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - DevicesLen byte - // padding: 23 bytes - Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) -} - -// Reply blocks and returns the reply data for a ListInputDevices request. -func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return listInputDevicesReply(buf), nil -} - -// listInputDevicesReply reads a byte slice into a ListInputDevicesReply value. -func listInputDevicesReply(buf []byte) *ListInputDevicesReply { - v := new(ListInputDevicesReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.DevicesLen = buf[b] - b += 1 - - b += 23 // padding - - v.Devices = make([]DeviceInfo, v.DevicesLen) - b += DeviceInfoReadList(buf[b:], v.Devices) - - return v -} - -// Write request to wire for ListInputDevices -// listInputDevicesRequest writes a ListInputDevices request to a byte slice. -func listInputDevicesRequest(c *xgb.Conn) []byte { - size := 4 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 2 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - return buf -} - -// OpenDeviceCookie is a cookie used only for OpenDevice requests. -type OpenDeviceCookie struct { - *xgb.Cookie -} - -// OpenDevice sends a checked request. -// If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() -func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(openDeviceRequest(c, DeviceId), cookie) - return OpenDeviceCookie{cookie} -} - -// OpenDeviceUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(openDeviceRequest(c, DeviceId), cookie) - return OpenDeviceCookie{cookie} -} - -// OpenDeviceReply represents the data returned from a OpenDevice request. -type OpenDeviceReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClasses byte - // padding: 23 bytes - ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) -} - -// Reply blocks and returns the reply data for a OpenDevice request. -func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return openDeviceReply(buf), nil -} - -// openDeviceReply reads a byte slice into a OpenDeviceReply value. -func openDeviceReply(buf []byte) *OpenDeviceReply { - v := new(OpenDeviceReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = buf[b] - b += 1 - - b += 23 // padding - - v.ClassInfo = make([]InputClassInfo, v.NumClasses) - b += InputClassInfoReadList(buf[b:], v.ClassInfo) - - return v -} - -// Write request to wire for OpenDevice -// openDeviceRequest writes a OpenDevice request to a byte slice. -func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 3 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// QueryDeviceStateCookie is a cookie used only for QueryDeviceState requests. -type QueryDeviceStateCookie struct { - *xgb.Cookie -} - -// QueryDeviceState sends a checked request. -// If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() -func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) - return QueryDeviceStateCookie{cookie} -} - -// QueryDeviceStateUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) - return QueryDeviceStateCookie{cookie} -} - -// QueryDeviceStateReply represents the data returned from a QueryDeviceState request. -type QueryDeviceStateReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - NumClasses byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a QueryDeviceState request. -func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return queryDeviceStateReply(buf), nil -} - -// queryDeviceStateReply reads a byte slice into a QueryDeviceStateReply value. -func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { - v := new(QueryDeviceStateReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.NumClasses = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for QueryDeviceState -// queryDeviceStateRequest writes a QueryDeviceState request to a byte slice. -func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 30 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - b += 3 // padding - - return buf -} - -// SelectExtensionEventCookie is a cookie used only for SelectExtensionEvent requests. -type SelectExtensionEventCookie struct { - *xgb.Cookie -} - -// SelectExtensionEvent sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) - return SelectExtensionEventCookie{cookie} -} - -// SelectExtensionEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() -func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) - return SelectExtensionEventCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SelectExtensionEventCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SelectExtensionEvent -// selectExtensionEventRequest writes a SelectExtensionEvent request to a byte slice. -func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { - size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 6 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Window)) - b += 4 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - b += 2 // padding - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// SendExtensionEventCookie is a cookie used only for SendExtensionEvent requests. -type SendExtensionEventCookie struct { - *xgb.Cookie -} - -// SendExtensionEvent sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return SendExtensionEventCookie{cookie} -} - -// SendExtensionEventChecked sends a checked request. -// If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() -func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) - return SendExtensionEventCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SendExtensionEventCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SendExtensionEvent -// sendExtensionEventRequest writes a SendExtensionEvent request to a byte slice. -func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { - size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 31 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Destination)) - b += 4 - - buf[b] = DeviceId - b += 1 - - if Propagate { - buf[b] = 1 - } else { - buf[b] = 0 - } - b += 1 - - xgb.Put16(buf[b:], NumClasses) - b += 2 - - buf[b] = NumEvents - b += 1 - - b += 3 // padding - - copy(buf[b:], Events[:(int(NumEvents)*32)]) - b += xgb.Pad(int((int(NumEvents) * 32))) - - for i := 0; i < int(NumClasses); i++ { - xgb.Put32(buf[b:], uint32(Classes[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// SetDeviceButtonMappingCookie is a cookie used only for SetDeviceButtonMapping requests. -type SetDeviceButtonMappingCookie struct { - *xgb.Cookie -} - -// SetDeviceButtonMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceButtonMappingCookie.Reply() -func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) - return SetDeviceButtonMappingCookie{cookie} -} - -// SetDeviceButtonMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) - return SetDeviceButtonMappingCookie{cookie} -} - -// SetDeviceButtonMappingReply represents the data returned from a SetDeviceButtonMapping request. -type SetDeviceButtonMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceButtonMapping request. -func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceButtonMappingReply(buf), nil -} - -// setDeviceButtonMappingReply reads a byte slice into a SetDeviceButtonMappingReply value. -func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { - v := new(SetDeviceButtonMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceButtonMapping -// setDeviceButtonMappingRequest writes a SetDeviceButtonMapping request to a byte slice. -func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) []byte { - size := xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 29 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = MapSize - b += 1 - - b += 2 // padding - - copy(buf[b:], Map[:MapSize]) - b += xgb.Pad(int(MapSize)) - - return buf -} - -// SetDeviceFocusCookie is a cookie used only for SetDeviceFocus requests. -type SetDeviceFocusCookie struct { - *xgb.Cookie -} - -// SetDeviceFocus sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) - return SetDeviceFocusCookie{cookie} -} - -// SetDeviceFocusChecked sends a checked request. -// If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() -func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) - return SetDeviceFocusCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook SetDeviceFocusCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for SetDeviceFocus -// setDeviceFocusRequest writes a SetDeviceFocus request to a byte slice. -func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 21 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Focus)) - b += 4 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = RevertTo - b += 1 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// SetDeviceModeCookie is a cookie used only for SetDeviceMode requests. -type SetDeviceModeCookie struct { - *xgb.Cookie -} - -// SetDeviceMode sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() -func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) - return SetDeviceModeCookie{cookie} -} - -// SetDeviceModeUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) - return SetDeviceModeCookie{cookie} -} - -// SetDeviceModeReply represents the data returned from a SetDeviceMode request. -type SetDeviceModeReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceMode request. -func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceModeReply(buf), nil -} - -// setDeviceModeReply reads a byte slice into a SetDeviceModeReply value. -func setDeviceModeReply(buf []byte) *SetDeviceModeReply { - v := new(SetDeviceModeReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceMode -// setDeviceModeRequest writes a SetDeviceMode request to a byte slice. -func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { - size := 8 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 5 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = Mode - b += 1 - - b += 2 // padding - - return buf -} - -// SetDeviceModifierMappingCookie is a cookie used only for SetDeviceModifierMapping requests. -type SetDeviceModifierMappingCookie struct { - *xgb.Cookie -} - -// SetDeviceModifierMapping sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() -func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) - return SetDeviceModifierMappingCookie{cookie} -} - -// SetDeviceModifierMappingUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) - return SetDeviceModifierMappingCookie{cookie} -} - -// SetDeviceModifierMappingReply represents the data returned from a SetDeviceModifierMapping request. -type SetDeviceModifierMappingReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceModifierMapping request. -func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceModifierMappingReply(buf), nil -} - -// setDeviceModifierMappingReply reads a byte slice into a SetDeviceModifierMappingReply value. -func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { - v := new(SetDeviceModifierMappingReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceModifierMapping -// setDeviceModifierMappingRequest writes a SetDeviceModifierMapping request to a byte slice. -func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { - size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 27 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = KeycodesPerModifier - b += 1 - - b += 1 // padding - - copy(buf[b:], Keymaps[:(int(KeycodesPerModifier)*8)]) - b += xgb.Pad(int((int(KeycodesPerModifier) * 8))) - - return buf -} - -// SetDeviceValuatorsCookie is a cookie used only for SetDeviceValuators requests. -type SetDeviceValuatorsCookie struct { - *xgb.Cookie -} - -// SetDeviceValuators sends a checked request. -// If an error occurs, it will be returned with the reply by calling SetDeviceValuatorsCookie.Reply() -func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, true) - c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) - return SetDeviceValuatorsCookie{cookie} -} - -// SetDeviceValuatorsUnchecked sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func SetDeviceValuatorsUnchecked(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, true) - c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) - return SetDeviceValuatorsCookie{cookie} -} - -// SetDeviceValuatorsReply represents the data returned from a SetDeviceValuators request. -type SetDeviceValuatorsReply struct { - Sequence uint16 // sequence number of the request for this reply - Length uint32 // number of bytes in this reply - // padding: 1 bytes - Status byte - // padding: 23 bytes -} - -// Reply blocks and returns the reply data for a SetDeviceValuators request. -func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { - buf, err := cook.Cookie.Reply() - if err != nil { - return nil, err - } - if buf == nil { - return nil, nil - } - return setDeviceValuatorsReply(buf), nil -} - -// setDeviceValuatorsReply reads a byte slice into a SetDeviceValuatorsReply value. -func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { - v := new(SetDeviceValuatorsReply) - b := 1 // skip reply determinant - - b += 1 // padding - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - - v.Length = xgb.Get32(buf[b:]) // 4-byte units - b += 4 - - v.Status = buf[b] - b += 1 - - b += 23 // padding - - return v -} - -// Write request to wire for SetDeviceValuators -// setDeviceValuatorsRequest writes a SetDeviceValuators request to a byte slice. -func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { - size := xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 33 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - buf[b] = DeviceId - b += 1 - - buf[b] = FirstValuator - b += 1 - - buf[b] = NumValuators - b += 1 - - b += 1 // padding - - for i := 0; i < int(NumValuators); i++ { - xgb.Put32(buf[b:], uint32(Valuators[i])) - b += 4 - } - b = xgb.Pad(b) - - return buf -} - -// UngrabDeviceCookie is a cookie used only for UngrabDevice requests. -type UngrabDeviceCookie struct { - *xgb.Cookie -} - -// UngrabDevice sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) - return UngrabDeviceCookie{cookie} -} - -// UngrabDeviceChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() -func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) - return UngrabDeviceCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabDevice -// ungrabDeviceRequest writes a UngrabDevice request to a byte slice. -func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { - size := 12 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 14 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(Time)) - b += 4 - - buf[b] = DeviceId - b += 1 - - return buf -} - -// UngrabDeviceButtonCookie is a cookie used only for UngrabDeviceButton requests. -type UngrabDeviceButtonCookie struct { - *xgb.Cookie -} - -// UngrabDeviceButton sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return UngrabDeviceButtonCookie{cookie} -} - -// UngrabDeviceButtonChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() -func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) - return UngrabDeviceButtonCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceButtonCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabDeviceButton -// ungrabDeviceButtonRequest writes a UngrabDeviceButton request to a byte slice. -func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 18 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Button - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - return buf -} - -// UngrabDeviceKeyCookie is a cookie used only for UngrabDeviceKey requests. -type UngrabDeviceKeyCookie struct { - *xgb.Cookie -} - -// UngrabDeviceKey sends an unchecked request. -// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(false, false) - c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return UngrabDeviceKeyCookie{cookie} -} - -// UngrabDeviceKeyChecked sends a checked request. -// If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() -func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { - if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { - panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") - } - cookie := c.NewCookie(true, false) - c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) - return UngrabDeviceKeyCookie{cookie} -} - -// Check returns an error if one occurred for checked requests that are not expecting a reply. -// This cannot be called for requests expecting a reply, nor for unchecked requests. -func (cook UngrabDeviceKeyCookie) Check() error { - return cook.Cookie.Check() -} - -// Write request to wire for UngrabDeviceKey -// ungrabDeviceKeyRequest writes a UngrabDeviceKey request to a byte slice. -func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { - size := 16 - b := 0 - buf := make([]byte, size) - - buf[b] = c.Extensions["XINPUTEXTENSION"] - b += 1 - - buf[b] = 16 // request opcode - b += 1 - - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units - b += 2 - - xgb.Put32(buf[b:], uint32(GrabWindow)) - b += 4 - - xgb.Put16(buf[b:], Modifiers) - b += 2 - - buf[b] = ModifierDevice - b += 1 - - buf[b] = Key - b += 1 - - buf[b] = GrabbedDevice - b += 1 - - return buf -} From efe87cb9081ff3806182cf911f4fd8fbc4928244 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:23:15 -0500 Subject: [PATCH 69/90] Ignore the "fd" field for the time being (for the shm extension only). --- nexgb/xgbgen/translation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index 778304f..b7e67e2 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -207,7 +207,7 @@ func (x *XMLRequest) Translate() *Request { Reply: x.Reply.Translate(), } for _, field := range x.Fields { - if field.XMLName.Local == "doc" { + if field.XMLName.Local == "doc" || field.XMLName.Local == "fd" { continue } r.Fields = append(r.Fields, field.Translate(r)) @@ -238,7 +238,7 @@ func (x *XMLReply) Translate() *Reply { Fields: make([]Field, 0, len(x.Fields)), } for _, field := range x.Fields { - if field.XMLName.Local == "doc" { + if field.XMLName.Local == "doc" || field.XMLName.Local == "fd" { continue } r.Fields = append(r.Fields, field.Translate(r)) From 5a07ac7108ef2b4074c058fbbd104c49d3cfdc9b Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:25:03 -0500 Subject: [PATCH 70/90] Fix fmt'd output for union list writing. --- nexgb/xgbgen/go_union.go | 2 +- nexgb/xproto/xproto.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go index 1a8684c..74816d3 100644 --- a/nexgb/xgbgen/go_union.go +++ b/nexgb/xgbgen/go_union.go @@ -117,7 +117,7 @@ func (u *Union) Write(c *Context) { func (u *Union) WriteList(c *Context) { c.Putln("// %sListBytes writes a list of %s values to a byte slice.", - u.SrcName()) + u.SrcName(), u.SrcName()) c.Putln("func %sListBytes(buf []byte, list []%s) int {", u.SrcName(), u.SrcName()) c.Putln("b := 0") diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 1e5f4bb..0de64fd 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -1093,7 +1093,7 @@ func (v ClientMessageDataUnion) Bytes() []byte { return buf } -// ClientMessageDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. +// ClientMessageDataUnionListBytes writes a list of ClientMessageDataUnion values to a byte slice. func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) int { b := 0 var unionBytes []byte From f0385db3a71c33f19d27dafb2a5d158a8a875200 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:25:18 -0500 Subject: [PATCH 71/90] Regenerate xgb with latest XML descriptions. --- nexgb/glx/glx.go | 116 +++ nexgb/randr/randr.go | 1427 +++++++++++++++++++++++++++++- nexgb/res/res.go | 533 +++++++++++ nexgb/screensaver/screensaver.go | 37 +- nexgb/shm/shm.go | 164 ++++ nexgb/xfixes/xfixes.go | 164 +++- nexgb/xproto/xproto.go | 58 +- 7 files changed, 2454 insertions(+), 45 deletions(-) diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 84d37b5..2db5798 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -495,6 +495,122 @@ func init() { type Bool32 uint32 +// BufferSwapComplete is the event number for a BufferSwapCompleteEvent. +const BufferSwapComplete = 1 + +type BufferSwapCompleteEvent struct { + Sequence uint16 + // padding: 1 bytes + EventType uint16 + // padding: 2 bytes + Drawable Drawable + UstHi uint32 + UstLo uint32 + MscHi uint32 + MscLo uint32 + Sbc uint32 +} + +// BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice. +func BufferSwapCompleteEventNew(buf []byte) xgb.Event { + v := BufferSwapCompleteEvent{} + b := 1 // don't read event number + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.EventType = xgb.Get16(buf[b:]) + b += 2 + + b += 2 // padding + + v.Drawable = Drawable(xgb.Get32(buf[b:])) + b += 4 + + v.UstHi = xgb.Get32(buf[b:]) + b += 4 + + v.UstLo = xgb.Get32(buf[b:]) + b += 4 + + v.MscHi = xgb.Get32(buf[b:]) + b += 4 + + v.MscLo = xgb.Get32(buf[b:]) + b += 4 + + v.Sbc = xgb.Get32(buf[b:]) + b += 4 + + return v +} + +// Bytes writes a BufferSwapCompleteEvent value to a byte slice. +func (v BufferSwapCompleteEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 1 + b += 1 + + b += 1 // padding + + b += 2 // skip sequence number + + xgb.Put16(buf[b:], v.EventType) + b += 2 + + b += 2 // padding + + xgb.Put32(buf[b:], uint32(v.Drawable)) + b += 4 + + xgb.Put32(buf[b:], v.UstHi) + b += 4 + + xgb.Put32(buf[b:], v.UstLo) + b += 4 + + xgb.Put32(buf[b:], v.MscHi) + b += 4 + + xgb.Put32(buf[b:], v.MscLo) + b += 4 + + xgb.Put32(buf[b:], v.Sbc) + b += 4 + + return buf +} + +// SequenceId returns the sequence id attached to the BufferSwapComplete event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v BufferSwapCompleteEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of BufferSwapCompleteEvent. +func (v BufferSwapCompleteEvent) String() string { + fieldVals := make([]string, 0, 9) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + fieldVals = append(fieldVals, xgb.Sprintf("EventType: %d", v.EventType)) + fieldVals = append(fieldVals, xgb.Sprintf("Drawable: %d", v.Drawable)) + fieldVals = append(fieldVals, xgb.Sprintf("UstHi: %d", v.UstHi)) + fieldVals = append(fieldVals, xgb.Sprintf("UstLo: %d", v.UstLo)) + fieldVals = append(fieldVals, xgb.Sprintf("MscHi: %d", v.MscHi)) + fieldVals = append(fieldVals, xgb.Sprintf("MscLo: %d", v.MscLo)) + fieldVals = append(fieldVals, xgb.Sprintf("Sbc: %d", v.Sbc)) + return "BufferSwapComplete {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtEventFuncs["GLX"][1] = BufferSwapCompleteEventNew +} + type Context uint32 func NewContextId(c *xgb.Conn) (Context, error) { diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 9eb8dc9..11e1230 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -176,6 +176,52 @@ func init() { xgb.NewExtErrorFuncs["RANDR"][0] = BadOutputErrorNew } +// BadBadProvider is the error number for a BadBadProvider. +const BadBadProvider = 3 + +type BadProviderError struct { + Sequence uint16 + NiceName string +} + +// BadProviderErrorNew constructs a BadProviderError value that implements xgb.Error from a byte slice. +func BadProviderErrorNew(buf []byte) xgb.Error { + v := BadProviderError{} + v.NiceName = "BadProvider" + + b := 1 // skip error determinant + b += 1 // don't read error number + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + return v +} + +// SequenceId returns the sequence id attached to the BadBadProvider error. +// This is mostly used internally. +func (err BadProviderError) SequenceId() uint16 { + return err.Sequence +} + +// BadId returns the 'BadValue' number if one exists for the BadBadProvider error. If no bad value exists, 0 is returned. +func (err BadProviderError) BadId() uint32 { + return 0 +} + +// Error returns a rudimentary string representation of the BadBadProvider error. + +func (err BadProviderError) Error() string { + fieldVals := make([]string, 0, 0) + fieldVals = append(fieldVals, "NiceName: "+err.NiceName) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence)) + return "BadBadProvider {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewExtErrorFuncs["RANDR"][3] = BadProviderErrorNew +} + const ( ConnectionConnected = 0 ConnectionDisconnected = 1 @@ -459,9 +505,12 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { } const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 + NotifyProviderChange = 3 + NotifyProviderProperty = 4 + NotifyResourceChange = 5 ) // Notify is the event number for a NotifyEvent. @@ -539,10 +588,16 @@ func init() { // NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion // NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion // NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion +// NotifyDataUnionPcNew(Pc ProviderChange) NotifyDataUnion +// NotifyDataUnionPpNew(Pp ProviderProperty) NotifyDataUnion +// NotifyDataUnionRcNew(Rc ResourceChange) NotifyDataUnion type NotifyDataUnion struct { Cc CrtcChange Oc OutputChange Op OutputProperty + Pc ProviderChange + Pp ProviderProperty + Rc ResourceChange } // NotifyDataUnionCcNew constructs a new NotifyDataUnion union type with the Cc field. @@ -573,6 +628,18 @@ func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { v.Op = OutputProperty{} b += OutputPropertyRead(buf[b:], &v.Op) + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + return v } @@ -604,6 +671,18 @@ func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { v.Op = OutputProperty{} b += OutputPropertyRead(buf[b:], &v.Op) + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + return v } @@ -635,6 +714,147 @@ func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { v.Op = OutputProperty{} b += OutputPropertyRead(buf[b:], &v.Op) + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + + return v +} + +// NotifyDataUnionPcNew constructs a new NotifyDataUnion union type with the Pc field. +func NotifyDataUnionPcNew(Pc ProviderChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Pc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + + return v +} + +// NotifyDataUnionPpNew constructs a new NotifyDataUnion union type with the Pp field. +func NotifyDataUnionPpNew(Pp ProviderProperty) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Pp.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + + return v +} + +// NotifyDataUnionRcNew constructs a new NotifyDataUnion union type with the Rc field. +func NotifyDataUnionRcNew(Rc ResourceChange) NotifyDataUnion { + var b int + buf := make([]byte, 28) + + { + structBytes := Rc.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + // Create the Union type + v := NotifyDataUnion{} + + // Now copy buf into all fields + + b = 0 // always read the same bytes + v.Cc = CrtcChange{} + b += CrtcChangeRead(buf[b:], &v.Cc) + + b = 0 // always read the same bytes + v.Oc = OutputChange{} + b += OutputChangeRead(buf[b:], &v.Oc) + + b = 0 // always read the same bytes + v.Op = OutputProperty{} + b += OutputPropertyRead(buf[b:], &v.Op) + + b = 0 // always read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // always read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // always read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + return v } @@ -654,6 +874,18 @@ func NotifyDataUnionRead(buf []byte, v *NotifyDataUnion) int { v.Op = OutputProperty{} b += OutputPropertyRead(buf[b:], &v.Op) + b = 0 // re-read the same bytes + v.Pc = ProviderChange{} + b += ProviderChangeRead(buf[b:], &v.Pc) + + b = 0 // re-read the same bytes + v.Pp = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &v.Pp) + + b = 0 // re-read the same bytes + v.Rc = ResourceChange{} + b += ResourceChangeRead(buf[b:], &v.Rc) + return 28 } @@ -682,7 +914,7 @@ func (v NotifyDataUnion) Bytes() []byte { return buf } -// NotifyDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. +// NotifyDataUnionListBytes writes a list of NotifyDataUnion values to a byte slice. func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { b := 0 var unionBytes []byte @@ -695,10 +927,13 @@ func NotifyDataUnionListBytes(buf []byte, list []NotifyDataUnion) int { } const ( - NotifyMaskScreenChange = 1 - NotifyMaskCrtcChange = 2 - NotifyMaskOutputChange = 4 - NotifyMaskOutputProperty = 8 + NotifyMaskScreenChange = 1 + NotifyMaskCrtcChange = 2 + NotifyMaskOutputChange = 4 + NotifyMaskOutputProperty = 8 + NotifyMaskProviderChange = 16 + NotifyMaskProviderProperty = 32 + NotifyMaskResourceChange = 64 ) type Output uint32 @@ -894,6 +1129,169 @@ func OutputPropertyListBytes(buf []byte, list []OutputProperty) int { return xgb.Pad(b) } +type Provider uint32 + +func NewProviderId(c *xgb.Conn) (Provider, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Provider(id), nil +} + +const ( + ProviderCapabilitySourceOutput = 1 + ProviderCapabilitySinkOutput = 2 + ProviderCapabilitySourceOffload = 4 + ProviderCapabilitySinkOffload = 8 +) + +type ProviderChange struct { + Timestamp xproto.Timestamp + Window xproto.Window + Provider Provider + // padding: 16 bytes +} + +// ProviderChangeRead reads a byte slice into a ProviderChange value. +func ProviderChangeRead(buf []byte, v *ProviderChange) int { + b := 0 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Provider = Provider(xgb.Get32(buf[b:])) + b += 4 + + b += 16 // padding + + return b +} + +// ProviderChangeReadList reads a byte slice into a list of ProviderChange values. +func ProviderChangeReadList(buf []byte, dest []ProviderChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ProviderChange{} + b += ProviderChangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ProviderChange value to a byte slice. +func (v ProviderChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Provider)) + b += 4 + + b += 16 // padding + + return buf +} + +// ProviderChangeListBytes writes a list of ProviderChange values to a byte slice. +func ProviderChangeListBytes(buf []byte, list []ProviderChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +type ProviderProperty struct { + Window xproto.Window + Provider Provider + Atom xproto.Atom + Timestamp xproto.Timestamp + State byte + // padding: 11 bytes +} + +// ProviderPropertyRead reads a byte slice into a ProviderProperty value. +func ProviderPropertyRead(buf []byte, v *ProviderProperty) int { + b := 0 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + v.Provider = Provider(xgb.Get32(buf[b:])) + b += 4 + + v.Atom = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.State = buf[b] + b += 1 + + b += 11 // padding + + return b +} + +// ProviderPropertyReadList reads a byte slice into a list of ProviderProperty values. +func ProviderPropertyReadList(buf []byte, dest []ProviderProperty) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ProviderProperty{} + b += ProviderPropertyRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ProviderProperty value to a byte slice. +func (v ProviderProperty) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Atom)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + buf[b] = v.State + b += 1 + + b += 11 // padding + + return buf +} + +// ProviderPropertyListBytes writes a list of ProviderProperty values to a byte slice. +func ProviderPropertyListBytes(buf []byte, list []ProviderProperty) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + type RefreshRates struct { NRates uint16 Rates []uint16 // size: xgb.Pad((int(NRates) * 2)) @@ -964,6 +1362,65 @@ func RefreshRatesListSize(list []RefreshRates) int { return size } +type ResourceChange struct { + Timestamp xproto.Timestamp + Window xproto.Window + // padding: 20 bytes +} + +// ResourceChangeRead reads a byte slice into a ResourceChange value. +func ResourceChangeRead(buf []byte, v *ResourceChange) int { + b := 0 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Window = xproto.Window(xgb.Get32(buf[b:])) + b += 4 + + b += 20 // padding + + return b +} + +// ResourceChangeReadList reads a byte slice into a list of ResourceChange values. +func ResourceChangeReadList(buf []byte, dest []ResourceChange) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResourceChange{} + b += ResourceChangeRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ResourceChange value to a byte slice. +func (v ResourceChange) Bytes() []byte { + buf := make([]byte, 28) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Timestamp)) + b += 4 + + xgb.Put32(buf[b:], uint32(v.Window)) + b += 4 + + b += 20 // padding + + return buf +} + +// ResourceChangeListBytes writes a list of ResourceChange values to a byte slice. +func ResourceChangeListBytes(buf []byte, list []ResourceChange) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + const ( RotationRotate0 = 1 RotationRotate90 = 2 @@ -1186,6 +1643,13 @@ const ( SetConfigFailed = 3 ) +const ( + TransformUnit = 1 + TransformScaleUp = 2 + TransformScaleDown = 4 + TransformProjective = 8 +) + // Skipping definition for base type 'Bool' // Skipping definition for base type 'Byte' @@ -1343,6 +1807,81 @@ func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato return buf } +// ChangeProviderPropertyCookie is a cookie used only for ChangeProviderProperty requests. +type ChangeProviderPropertyCookie struct { + *xgb.Cookie +} + +// ChangeProviderProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ChangeProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumItems uint32, Data []byte) ChangeProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(changeProviderPropertyRequest(c, Provider, Property, Type, Format, Mode, NumItems, Data), cookie) + return ChangeProviderPropertyCookie{cookie} +} + +// ChangeProviderPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeProviderPropertyCookie.Check() +func ChangeProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumItems uint32, Data []byte) ChangeProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ChangeProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(changeProviderPropertyRequest(c, Provider, Property, Type, Format, Mode, NumItems, Data), cookie) + return ChangeProviderPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ChangeProviderPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ChangeProviderProperty +// changeProviderPropertyRequest writes a ChangeProviderProperty request to a byte slice. +func changeProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumItems uint32, Data []byte) []byte { + size := xgb.Pad((24 + xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 39 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + buf[b] = Format + b += 1 + + buf[b] = Mode + b += 1 + + b += 2 // padding + + xgb.Put32(buf[b:], NumItems) + b += 4 + + copy(buf[b:], Data[:(int(NumItems)*(int(Format)/8))]) + b += xgb.Pad(int((int(NumItems) * (int(Format) / 8)))) + + return buf +} + // ConfigureOutputPropertyCookie is a cookie used only for ConfigureOutputProperty requests. type ConfigureOutputPropertyCookie struct { *xgb.Cookie @@ -1423,6 +1962,86 @@ func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto. return buf } +// ConfigureProviderPropertyCookie is a cookie used only for ConfigureProviderProperty requests. +type ConfigureProviderPropertyCookie struct { + *xgb.Cookie +} + +// ConfigureProviderProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ConfigureProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(configureProviderPropertyRequest(c, Provider, Property, Pending, Range, Values), cookie) + return ConfigureProviderPropertyCookie{cookie} +} + +// ConfigureProviderPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureProviderPropertyCookie.Check() +func ConfigureProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ConfigureProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(configureProviderPropertyRequest(c, Provider, Property, Pending, Range, Values), cookie) + return ConfigureProviderPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook ConfigureProviderPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for ConfigureProviderProperty +// configureProviderPropertyRequest writes a ConfigureProviderProperty request to a byte slice. +func configureProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto.Atom, Pending bool, Range bool, Values []int32) []byte { + size := xgb.Pad((16 + xgb.Pad((len(Values) * 4)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 38 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Range { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + for i := 0; i < int(len(Values)); i++ { + xgb.Put32(buf[b:], uint32(Values[i])) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + // CreateModeCookie is a cookie used only for CreateMode requests. type CreateModeCookie struct { *xgb.Cookie @@ -1639,6 +2258,64 @@ func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato return buf } +// DeleteProviderPropertyCookie is a cookie used only for DeleteProviderProperty requests. +type DeleteProviderPropertyCookie struct { + *xgb.Cookie +} + +// DeleteProviderProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom) DeleteProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteProviderPropertyRequest(c, Provider, Property), cookie) + return DeleteProviderPropertyCookie{cookie} +} + +// DeleteProviderPropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteProviderPropertyCookie.Check() +func DeleteProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom) DeleteProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteProviderPropertyRequest(c, Provider, Property), cookie) + return DeleteProviderPropertyCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteProviderPropertyCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteProviderProperty +// deleteProviderPropertyRequest writes a DeleteProviderProperty request to a byte slice. +func deleteProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 40 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + // DestroyModeCookie is a cookie used only for DestroyMode requests. type DestroyModeCookie struct { *xgb.Cookie @@ -2717,6 +3394,397 @@ func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } +// GetProviderInfoCookie is a cookie used only for GetProviderInfo requests. +type GetProviderInfoCookie struct { + *xgb.Cookie +} + +// GetProviderInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetProviderInfoCookie.Reply() +func GetProviderInfo(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Timestamp) GetProviderInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviderInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getProviderInfoRequest(c, Provider, ConfigTimestamp), cookie) + return GetProviderInfoCookie{cookie} +} + +// GetProviderInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetProviderInfoUnchecked(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Timestamp) GetProviderInfoCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviderInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getProviderInfoRequest(c, Provider, ConfigTimestamp), cookie) + return GetProviderInfoCookie{cookie} +} + +// GetProviderInfoReply represents the data returned from a GetProviderInfo request. +type GetProviderInfoReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Status byte + Timestamp xproto.Timestamp + Capabilities uint32 + NumCrtcs uint16 + NumOutputs uint16 + NumAssociatedProviders uint16 + NameLen uint16 + // padding: 8 bytes + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + AssociatedProviders []Provider // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + AssociatedCapability []uint32 // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + Name string // size: xgb.Pad((int(NameLen) * 1)) +} + +// Reply blocks and returns the reply data for a GetProviderInfo request. +func (cook GetProviderInfoCookie) Reply() (*GetProviderInfoReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getProviderInfoReply(buf), nil +} + +// getProviderInfoReply reads a byte slice into a GetProviderInfoReply value. +func getProviderInfoReply(buf []byte) *GetProviderInfoReply { + v := new(GetProviderInfoReply) + b := 1 // skip reply determinant + + v.Status = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.Capabilities = xgb.Get32(buf[b:]) + b += 4 + + v.NumCrtcs = xgb.Get16(buf[b:]) + b += 2 + + v.NumOutputs = xgb.Get16(buf[b:]) + b += 2 + + v.NumAssociatedProviders = xgb.Get16(buf[b:]) + b += 2 + + v.NameLen = xgb.Get16(buf[b:]) + b += 2 + + b += 8 // padding + + v.Crtcs = make([]Crtc, v.NumCrtcs) + for i := 0; i < int(v.NumCrtcs); i++ { + v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.Outputs = make([]Output, v.NumOutputs) + for i := 0; i < int(v.NumOutputs); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.AssociatedProviders = make([]Provider, v.NumAssociatedProviders) + for i := 0; i < int(v.NumAssociatedProviders); i++ { + v.AssociatedProviders[i] = Provider(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + v.AssociatedCapability = make([]uint32, v.NumAssociatedProviders) + for i := 0; i < int(v.NumAssociatedProviders); i++ { + v.AssociatedCapability[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + { + byteString := make([]byte, v.NameLen) + copy(byteString[:v.NameLen], buf[b:]) + v.Name = string(byteString) + b += xgb.Pad(int(v.NameLen)) + } + + return v +} + +// Write request to wire for GetProviderInfo +// getProviderInfoRequest writes a GetProviderInfo request to a byte slice. +func getProviderInfoRequest(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Timestamp) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 33 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// GetProviderPropertyCookie is a cookie used only for GetProviderProperty requests. +type GetProviderPropertyCookie struct { + *xgb.Cookie +} + +// GetProviderProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetProviderPropertyCookie.Reply() +func GetProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getProviderPropertyRequest(c, Provider, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetProviderPropertyCookie{cookie} +} + +// GetProviderPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetProviderPropertyUnchecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getProviderPropertyRequest(c, Provider, Property, Type, LongOffset, LongLength, Delete, Pending), cookie) + return GetProviderPropertyCookie{cookie} +} + +// GetProviderPropertyReply represents the data returned from a GetProviderProperty request. +type GetProviderPropertyReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Format byte + Type xproto.Atom + BytesAfter uint32 + NumItems uint32 + // padding: 12 bytes + Data []byte // size: xgb.Pad(((int(NumItems) * (int(Format) / 8)) * 1)) +} + +// Reply blocks and returns the reply data for a GetProviderProperty request. +func (cook GetProviderPropertyCookie) Reply() (*GetProviderPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getProviderPropertyReply(buf), nil +} + +// getProviderPropertyReply reads a byte slice into a GetProviderPropertyReply value. +func getProviderPropertyReply(buf []byte) *GetProviderPropertyReply { + v := new(GetProviderPropertyReply) + b := 1 // skip reply determinant + + v.Format = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Type = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + v.BytesAfter = xgb.Get32(buf[b:]) + b += 4 + + v.NumItems = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) + copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) + b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + + return v +} + +// Write request to wire for GetProviderProperty +// getProviderPropertyRequest writes a GetProviderProperty request to a byte slice. +func getProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) []byte { + size := 28 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 41 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + xgb.Put32(buf[b:], uint32(Type)) + b += 4 + + xgb.Put32(buf[b:], LongOffset) + b += 4 + + xgb.Put32(buf[b:], LongLength) + b += 4 + + if Delete { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if Pending { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 2 // padding + + return buf +} + +// GetProvidersCookie is a cookie used only for GetProviders requests. +type GetProvidersCookie struct { + *xgb.Cookie +} + +// GetProviders sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetProvidersCookie.Reply() +func GetProviders(c *xgb.Conn, Window xproto.Window) GetProvidersCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviders' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getProvidersRequest(c, Window), cookie) + return GetProvidersCookie{cookie} +} + +// GetProvidersUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetProvidersUnchecked(c *xgb.Conn, Window xproto.Window) GetProvidersCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetProviders' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getProvidersRequest(c, Window), cookie) + return GetProvidersCookie{cookie} +} + +// GetProvidersReply represents the data returned from a GetProviders request. +type GetProvidersReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Timestamp xproto.Timestamp + NumProviders uint16 + // padding: 18 bytes + Providers []Provider // size: xgb.Pad((int(NumProviders) * 4)) +} + +// Reply blocks and returns the reply data for a GetProviders request. +func (cook GetProvidersCookie) Reply() (*GetProvidersReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getProvidersReply(buf), nil +} + +// getProvidersReply reads a byte slice into a GetProvidersReply value. +func getProvidersReply(buf []byte) *GetProvidersReply { + v := new(GetProvidersReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NumProviders = xgb.Get16(buf[b:]) + b += 2 + + b += 18 // padding + + v.Providers = make([]Provider, v.NumProviders) + for i := 0; i < int(v.NumProviders); i++ { + v.Providers[i] = Provider(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for GetProviders +// getProvidersRequest writes a GetProviders request to a byte slice. +func getProvidersRequest(c *xgb.Conn, Window xproto.Window) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + return buf +} + // GetScreenInfoCookie is a cookie used only for GetScreenInfo requests. type GetScreenInfoCookie struct { *xgb.Cookie @@ -3319,6 +4387,105 @@ func listOutputPropertiesRequest(c *xgb.Conn, Output Output) []byte { return buf } +// ListProviderPropertiesCookie is a cookie used only for ListProviderProperties requests. +type ListProviderPropertiesCookie struct { + *xgb.Cookie +} + +// ListProviderProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListProviderPropertiesCookie.Reply() +func ListProviderProperties(c *xgb.Conn, Provider Provider) ListProviderPropertiesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ListProviderProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(listProviderPropertiesRequest(c, Provider), cookie) + return ListProviderPropertiesCookie{cookie} +} + +// ListProviderPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func ListProviderPropertiesUnchecked(c *xgb.Conn, Provider Provider) ListProviderPropertiesCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'ListProviderProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(listProviderPropertiesRequest(c, Provider), cookie) + return ListProviderPropertiesCookie{cookie} +} + +// ListProviderPropertiesReply represents the data returned from a ListProviderProperties request. +type ListProviderPropertiesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumAtoms uint16 + // padding: 22 bytes + Atoms []xproto.Atom // size: xgb.Pad((int(NumAtoms) * 4)) +} + +// Reply blocks and returns the reply data for a ListProviderProperties request. +func (cook ListProviderPropertiesCookie) Reply() (*ListProviderPropertiesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return listProviderPropertiesReply(buf), nil +} + +// listProviderPropertiesReply reads a byte slice into a ListProviderPropertiesReply value. +func listProviderPropertiesReply(buf []byte) *ListProviderPropertiesReply { + v := new(ListProviderPropertiesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumAtoms = xgb.Get16(buf[b:]) + b += 2 + + b += 22 // padding + + v.Atoms = make([]xproto.Atom, v.NumAtoms) + for i := 0; i < int(v.NumAtoms); i++ { + v.Atoms[i] = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for ListProviderProperties +// listProviderPropertiesRequest writes a ListProviderProperties request to a byte slice. +func listProviderPropertiesRequest(c *xgb.Conn, Provider Provider) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 36 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + return buf +} + // QueryOutputPropertyCookie is a cookie used only for QueryOutputProperty requests. type QueryOutputPropertyCookie struct { *xgb.Cookie @@ -3441,6 +4608,128 @@ func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom return buf } +// QueryProviderPropertyCookie is a cookie used only for QueryProviderProperty requests. +type QueryProviderPropertyCookie struct { + *xgb.Cookie +} + +// QueryProviderProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryProviderPropertyCookie.Reply() +func QueryProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom) QueryProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryProviderPropertyRequest(c, Provider, Property), cookie) + return QueryProviderPropertyCookie{cookie} +} + +// QueryProviderPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryProviderPropertyUnchecked(c *xgb.Conn, Provider Provider, Property xproto.Atom) QueryProviderPropertyCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'QueryProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryProviderPropertyRequest(c, Provider, Property), cookie) + return QueryProviderPropertyCookie{cookie} +} + +// QueryProviderPropertyReply represents the data returned from a QueryProviderProperty request. +type QueryProviderPropertyReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Pending bool + Range bool + Immutable bool + // padding: 21 bytes + ValidValues []int32 // size: xgb.Pad((int(Length) * 4)) +} + +// Reply blocks and returns the reply data for a QueryProviderProperty request. +func (cook QueryProviderPropertyCookie) Reply() (*QueryProviderPropertyReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryProviderPropertyReply(buf), nil +} + +// queryProviderPropertyReply reads a byte slice into a QueryProviderPropertyReply value. +func queryProviderPropertyReply(buf []byte) *QueryProviderPropertyReply { + v := new(QueryProviderPropertyReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + if buf[b] == 1 { + v.Pending = true + } else { + v.Pending = false + } + b += 1 + + if buf[b] == 1 { + v.Range = true + } else { + v.Range = false + } + b += 1 + + if buf[b] == 1 { + v.Immutable = true + } else { + v.Immutable = false + } + b += 1 + + b += 21 // padding + + v.ValidValues = make([]int32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.ValidValues[i] = int32(xgb.Get32(buf[b:])) + b += 4 + } + b = xgb.Pad(b) + + return v +} + +// Write request to wire for QueryProviderProperty +// queryProviderPropertyRequest writes a QueryProviderProperty request to a byte slice. +func queryProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 37 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(Property)) + b += 4 + + return buf +} + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie @@ -4056,6 +5345,128 @@ func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left return buf } +// SetProviderOffloadSinkCookie is a cookie used only for SetProviderOffloadSink requests. +type SetProviderOffloadSinkCookie struct { + *xgb.Cookie +} + +// SetProviderOffloadSink sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetProviderOffloadSink(c *xgb.Conn, Provider Provider, SinkProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOffloadSinkCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetProviderOffloadSink' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setProviderOffloadSinkRequest(c, Provider, SinkProvider, ConfigTimestamp), cookie) + return SetProviderOffloadSinkCookie{cookie} +} + +// SetProviderOffloadSinkChecked sends a checked request. +// If an error occurs, it can be retrieved using SetProviderOffloadSinkCookie.Check() +func SetProviderOffloadSinkChecked(c *xgb.Conn, Provider Provider, SinkProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOffloadSinkCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetProviderOffloadSink' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setProviderOffloadSinkRequest(c, Provider, SinkProvider, ConfigTimestamp), cookie) + return SetProviderOffloadSinkCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetProviderOffloadSinkCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetProviderOffloadSink +// setProviderOffloadSinkRequest writes a SetProviderOffloadSink request to a byte slice. +func setProviderOffloadSinkRequest(c *xgb.Conn, Provider Provider, SinkProvider Provider, ConfigTimestamp xproto.Timestamp) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 34 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(SinkProvider)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + +// SetProviderOutputSourceCookie is a cookie used only for SetProviderOutputSource requests. +type SetProviderOutputSourceCookie struct { + *xgb.Cookie +} + +// SetProviderOutputSource sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetProviderOutputSource(c *xgb.Conn, Provider Provider, SourceProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOutputSourceCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetProviderOutputSource' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setProviderOutputSourceRequest(c, Provider, SourceProvider, ConfigTimestamp), cookie) + return SetProviderOutputSourceCookie{cookie} +} + +// SetProviderOutputSourceChecked sends a checked request. +// If an error occurs, it can be retrieved using SetProviderOutputSourceCookie.Check() +func SetProviderOutputSourceChecked(c *xgb.Conn, Provider Provider, SourceProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOutputSourceCookie { + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetProviderOutputSource' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setProviderOutputSourceRequest(c, Provider, SourceProvider, ConfigTimestamp), cookie) + return SetProviderOutputSourceCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetProviderOutputSourceCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetProviderOutputSource +// setProviderOutputSourceRequest writes a SetProviderOutputSource request to a byte slice. +func setProviderOutputSourceRequest(c *xgb.Conn, Provider Provider, SourceProvider Provider, ConfigTimestamp xproto.Timestamp) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["RANDR"] + b += 1 + + buf[b] = 35 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Provider)) + b += 4 + + xgb.Put32(buf[b:], uint32(SourceProvider)) + b += 4 + + xgb.Put32(buf[b:], uint32(ConfigTimestamp)) + b += 4 + + return buf +} + // SetScreenConfigCookie is a cookie used only for SetScreenConfig requests. type SetScreenConfigCookie struct { *xgb.Cookie diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 20da54a..43480ec 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -91,6 +91,342 @@ func ClientListBytes(buf []byte, list []Client) int { return xgb.Pad(b) } +const ( + ClientIdMaskClientXID = 1 + ClientIdMaskLocalClientPID = 2 +) + +type ClientIdSpec struct { + Client uint32 + Mask uint32 +} + +// ClientIdSpecRead reads a byte slice into a ClientIdSpec value. +func ClientIdSpecRead(buf []byte, v *ClientIdSpec) int { + b := 0 + + v.Client = xgb.Get32(buf[b:]) + b += 4 + + v.Mask = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// ClientIdSpecReadList reads a byte slice into a list of ClientIdSpec values. +func ClientIdSpecReadList(buf []byte, dest []ClientIdSpec) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ClientIdSpec{} + b += ClientIdSpecRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ClientIdSpec value to a byte slice. +func (v ClientIdSpec) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], v.Client) + b += 4 + + xgb.Put32(buf[b:], v.Mask) + b += 4 + + return buf +} + +// ClientIdSpecListBytes writes a list of ClientIdSpec values to a byte slice. +func ClientIdSpecListBytes(buf []byte, list []ClientIdSpec) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +type ClientIdValue struct { + Spec ClientIdSpec + Length uint32 + Value []uint32 // size: xgb.Pad((int(Length) * 4)) +} + +// ClientIdValueRead reads a byte slice into a ClientIdValue value. +func ClientIdValueRead(buf []byte, v *ClientIdValue) int { + b := 0 + + v.Spec = ClientIdSpec{} + b += ClientIdSpecRead(buf[b:], &v.Spec) + + v.Length = xgb.Get32(buf[b:]) + b += 4 + + v.Value = make([]uint32, v.Length) + for i := 0; i < int(v.Length); i++ { + v.Value[i] = xgb.Get32(buf[b:]) + b += 4 + } + b = xgb.Pad(b) + + return b +} + +// ClientIdValueReadList reads a byte slice into a list of ClientIdValue values. +func ClientIdValueReadList(buf []byte, dest []ClientIdValue) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ClientIdValue{} + b += ClientIdValueRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ClientIdValue value to a byte slice. +func (v ClientIdValue) Bytes() []byte { + buf := make([]byte, (12 + xgb.Pad((int(v.Length) * 4)))) + b := 0 + + { + structBytes := v.Spec.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], v.Length) + b += 4 + + for i := 0; i < int(v.Length); i++ { + xgb.Put32(buf[b:], v.Value[i]) + b += 4 + } + b = xgb.Pad(b) + + return buf +} + +// ClientIdValueListBytes writes a list of ClientIdValue values to a byte slice. +func ClientIdValueListBytes(buf []byte, list []ClientIdValue) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +// ClientIdValueListSize computes the size (bytes) of a list of ClientIdValue values. +func ClientIdValueListSize(list []ClientIdValue) int { + size := 0 + for _, item := range list { + size += (12 + xgb.Pad((int(item.Length) * 4))) + } + return size +} + +type ResourceIdSpec struct { + Resource uint32 + Type uint32 +} + +// ResourceIdSpecRead reads a byte slice into a ResourceIdSpec value. +func ResourceIdSpecRead(buf []byte, v *ResourceIdSpec) int { + b := 0 + + v.Resource = xgb.Get32(buf[b:]) + b += 4 + + v.Type = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// ResourceIdSpecReadList reads a byte slice into a list of ResourceIdSpec values. +func ResourceIdSpecReadList(buf []byte, dest []ResourceIdSpec) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResourceIdSpec{} + b += ResourceIdSpecRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ResourceIdSpec value to a byte slice. +func (v ResourceIdSpec) Bytes() []byte { + buf := make([]byte, 8) + b := 0 + + xgb.Put32(buf[b:], v.Resource) + b += 4 + + xgb.Put32(buf[b:], v.Type) + b += 4 + + return buf +} + +// ResourceIdSpecListBytes writes a list of ResourceIdSpec values to a byte slice. +func ResourceIdSpecListBytes(buf []byte, list []ResourceIdSpec) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +type ResourceSizeSpec struct { + Spec ResourceIdSpec + Bytes uint32 + RefCount uint32 + UseCount uint32 +} + +// ResourceSizeSpecRead reads a byte slice into a ResourceSizeSpec value. +func ResourceSizeSpecRead(buf []byte, v *ResourceSizeSpec) int { + b := 0 + + v.Spec = ResourceIdSpec{} + b += ResourceIdSpecRead(buf[b:], &v.Spec) + + v.Bytes = xgb.Get32(buf[b:]) + b += 4 + + v.RefCount = xgb.Get32(buf[b:]) + b += 4 + + v.UseCount = xgb.Get32(buf[b:]) + b += 4 + + return b +} + +// ResourceSizeSpecReadList reads a byte slice into a list of ResourceSizeSpec values. +func ResourceSizeSpecReadList(buf []byte, dest []ResourceSizeSpec) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResourceSizeSpec{} + b += ResourceSizeSpecRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ResourceSizeSpec value to a byte slice. +func (v ResourceSizeSpec) Bytes() []byte { + buf := make([]byte, 20) + b := 0 + + { + structBytes := v.Spec.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], v.Bytes) + b += 4 + + xgb.Put32(buf[b:], v.RefCount) + b += 4 + + xgb.Put32(buf[b:], v.UseCount) + b += 4 + + return buf +} + +// ResourceSizeSpecListBytes writes a list of ResourceSizeSpec values to a byte slice. +func ResourceSizeSpecListBytes(buf []byte, list []ResourceSizeSpec) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +type ResourceSizeValue struct { + Size ResourceSizeSpec + NumCrossReferences uint32 + CrossReferences []ResourceSizeSpec // size: xgb.Pad((int(NumCrossReferences) * 20)) +} + +// ResourceSizeValueRead reads a byte slice into a ResourceSizeValue value. +func ResourceSizeValueRead(buf []byte, v *ResourceSizeValue) int { + b := 0 + + v.Size = ResourceSizeSpec{} + b += ResourceSizeSpecRead(buf[b:], &v.Size) + + v.NumCrossReferences = xgb.Get32(buf[b:]) + b += 4 + + v.CrossReferences = make([]ResourceSizeSpec, v.NumCrossReferences) + b += ResourceSizeSpecReadList(buf[b:], v.CrossReferences) + + return b +} + +// ResourceSizeValueReadList reads a byte slice into a list of ResourceSizeValue values. +func ResourceSizeValueReadList(buf []byte, dest []ResourceSizeValue) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = ResourceSizeValue{} + b += ResourceSizeValueRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a ResourceSizeValue value to a byte slice. +func (v ResourceSizeValue) Bytes() []byte { + buf := make([]byte, (24 + xgb.Pad((int(v.NumCrossReferences) * 20)))) + b := 0 + + { + structBytes := v.Size.Bytes() + copy(buf[b:], structBytes) + b += xgb.Pad(len(structBytes)) + } + + xgb.Put32(buf[b:], v.NumCrossReferences) + b += 4 + + b += ResourceSizeSpecListBytes(buf[b:], v.CrossReferences) + + return buf +} + +// ResourceSizeValueListBytes writes a list of ResourceSizeValue values to a byte slice. +func ResourceSizeValueListBytes(buf []byte, list []ResourceSizeValue) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +// ResourceSizeValueListSize computes the size (bytes) of a list of ResourceSizeValue values. +func ResourceSizeValueListSize(list []ResourceSizeValue) int { + size := 0 + for _, item := range list { + size += (24 + xgb.Pad((int(item.NumCrossReferences) * 20))) + } + return size +} + type Type struct { ResourceType xproto.Atom Count uint32 @@ -169,6 +505,103 @@ func TypeListBytes(buf []byte, list []Type) int { // Skipping definition for base type 'Card32' +// QueryClientIdsCookie is a cookie used only for QueryClientIds requests. +type QueryClientIdsCookie struct { + *xgb.Cookie +} + +// QueryClientIds sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryClientIdsCookie.Reply() +func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryClientIdsRequest(c, NumSpecs, Specs), cookie) + return QueryClientIdsCookie{cookie} +} + +// QueryClientIdsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryClientIdsUnchecked(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryClientIdsRequest(c, NumSpecs, Specs), cookie) + return QueryClientIdsCookie{cookie} +} + +// QueryClientIdsReply represents the data returned from a QueryClientIds request. +type QueryClientIdsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumIds uint32 + // padding: 20 bytes + Ids []ClientIdValue // size: ClientIdValueListSize(Ids) +} + +// Reply blocks and returns the reply data for a QueryClientIds request. +func (cook QueryClientIdsCookie) Reply() (*QueryClientIdsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryClientIdsReply(buf), nil +} + +// queryClientIdsReply reads a byte slice into a QueryClientIdsReply value. +func queryClientIdsReply(buf []byte) *QueryClientIdsReply { + v := new(QueryClientIdsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumIds = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Ids = make([]ClientIdValue, v.NumIds) + b += ClientIdValueReadList(buf[b:], v.Ids) + + return v +} + +// Write request to wire for QueryClientIds +// queryClientIdsRequest writes a QueryClientIds request to a byte slice. +func queryClientIdsRequest(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) []byte { + size := xgb.Pad((8 + xgb.Pad((int(NumSpecs) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 4 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], NumSpecs) + b += 4 + + b += ClientIdSpecListBytes(buf[b:], Specs) + + return buf +} + // QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests. type QueryClientPixmapBytesCookie struct { *xgb.Cookie @@ -448,6 +881,106 @@ func queryClientsRequest(c *xgb.Conn) []byte { return buf } +// QueryResourceBytesCookie is a cookie used only for QueryResourceBytes requests. +type QueryResourceBytesCookie struct { + *xgb.Cookie +} + +// QueryResourceBytes sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryResourceBytesCookie.Reply() +func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(queryResourceBytesRequest(c, Client, NumSpecs, Specs), cookie) + return QueryResourceBytesCookie{cookie} +} + +// QueryResourceBytesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func QueryResourceBytesUnchecked(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { + if _, ok := c.Extensions["X-RESOURCE"]; !ok { + panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(queryResourceBytesRequest(c, Client, NumSpecs, Specs), cookie) + return QueryResourceBytesCookie{cookie} +} + +// QueryResourceBytesReply represents the data returned from a QueryResourceBytes request. +type QueryResourceBytesReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + NumSizes uint32 + // padding: 20 bytes + Sizes []ResourceSizeValue // size: ResourceSizeValueListSize(Sizes) +} + +// Reply blocks and returns the reply data for a QueryResourceBytes request. +func (cook QueryResourceBytesCookie) Reply() (*QueryResourceBytesReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return queryResourceBytesReply(buf), nil +} + +// queryResourceBytesReply reads a byte slice into a QueryResourceBytesReply value. +func queryResourceBytesReply(buf []byte) *QueryResourceBytesReply { + v := new(QueryResourceBytesReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.NumSizes = xgb.Get32(buf[b:]) + b += 4 + + b += 20 // padding + + v.Sizes = make([]ResourceSizeValue, v.NumSizes) + b += ResourceSizeValueReadList(buf[b:], v.Sizes) + + return v +} + +// Write request to wire for QueryResourceBytes +// queryResourceBytesRequest writes a QueryResourceBytes request to a byte slice. +func queryResourceBytesRequest(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) []byte { + size := xgb.Pad((12 + xgb.Pad((int(NumSpecs) * 8)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["X-RESOURCE"] + b += 1 + + buf[b] = 5 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], Client) + b += 4 + + xgb.Put32(buf[b:], NumSpecs) + b += 4 + + b += ResourceIdSpecListBytes(buf[b:], Specs) + + return buf +} + // QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index e552c6d..ea60367 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -53,15 +53,12 @@ const Notify = 0 type NotifyEvent struct { Sequence uint16 - Code byte State byte - // padding: 1 bytes - SequenceNumber uint16 - Time xproto.Timestamp - Root xproto.Window - Window xproto.Window - Kind byte - Forced bool + Time xproto.Timestamp + Root xproto.Window + Window xproto.Window + Kind byte + Forced bool // padding: 14 bytes } @@ -70,18 +67,10 @@ func NotifyEventNew(buf []byte) xgb.Event { v := NotifyEvent{} b := 1 // don't read event number - v.Code = buf[b] - b += 1 - - v.Sequence = xgb.Get16(buf[b:]) - b += 2 - v.State = buf[b] b += 1 - b += 1 // padding - - v.SequenceNumber = xgb.Get16(buf[b:]) + v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Time = xproto.Timestamp(xgb.Get32(buf[b:])) @@ -117,18 +106,10 @@ func (v NotifyEvent) Bytes() []byte { buf[b] = 0 b += 1 - buf[b] = v.Code - b += 1 - - b += 2 // skip sequence number - buf[b] = v.State b += 1 - b += 1 // padding - - xgb.Put16(buf[b:], v.SequenceNumber) - b += 2 + b += 2 // skip sequence number xgb.Put32(buf[b:], uint32(v.Time)) b += 4 @@ -163,11 +144,9 @@ func (v NotifyEvent) SequenceId() uint16 { // String is a rudimentary string representation of NotifyEvent. func (v NotifyEvent) String() string { - fieldVals := make([]string, 0, 10) + fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) - fieldVals = append(fieldVals, xgb.Sprintf("Code: %d", v.Code)) fieldVals = append(fieldVals, xgb.Sprintf("State: %d", v.State)) - fieldVals = append(fieldVals, xgb.Sprintf("SequenceNumber: %d", v.SequenceNumber)) fieldVals = append(fieldVals, xgb.Sprintf("Time: %d", v.Time)) fieldVals = append(fieldVals, xgb.Sprintf("Root: %d", v.Root)) fieldVals = append(fieldVals, xgb.Sprintf("Window: %d", v.Window)) diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index 3e086c4..e5841ca 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -276,6 +276,70 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte return buf } +// AttachFdCookie is a cookie used only for AttachFd requests. +type AttachFdCookie struct { + *xgb.Cookie +} + +// AttachFd sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'AttachFd' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(attachFdRequest(c, Shmseg, ReadOnly), cookie) + return AttachFdCookie{cookie} +} + +// AttachFdChecked sends a checked request. +// If an error occurs, it can be retrieved using AttachFdCookie.Check() +func AttachFdChecked(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'AttachFd' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(attachFdRequest(c, Shmseg, ReadOnly), cookie) + return AttachFdCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook AttachFdCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for AttachFd +// attachFdRequest writes a AttachFd request to a byte slice. +func attachFdRequest(c *xgb.Conn, Shmseg Seg, ReadOnly bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 6 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + if ReadOnly { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + // CreatePixmapCookie is a cookie used only for CreatePixmap requests. type CreatePixmapCookie struct { *xgb.Cookie @@ -351,6 +415,106 @@ func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawabl return buf } +// CreateSegmentCookie is a cookie used only for CreateSegment requests. +type CreateSegmentCookie struct { + *xgb.Cookie +} + +// CreateSegment sends a checked request. +// If an error occurs, it will be returned with the reply by calling CreateSegmentCookie.Reply() +func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreateSegment' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(createSegmentRequest(c, Shmseg, Size, ReadOnly), cookie) + return CreateSegmentCookie{cookie} +} + +// CreateSegmentUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreateSegmentUnchecked(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie { + if _, ok := c.Extensions["MIT-SHM"]; !ok { + panic("Cannot issue request 'CreateSegment' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(createSegmentRequest(c, Shmseg, Size, ReadOnly), cookie) + return CreateSegmentCookie{cookie} +} + +// CreateSegmentReply represents the data returned from a CreateSegment request. +type CreateSegmentReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + Nfd byte + // padding: 24 bytes +} + +// Reply blocks and returns the reply data for a CreateSegment request. +func (cook CreateSegmentCookie) Reply() (*CreateSegmentReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return createSegmentReply(buf), nil +} + +// createSegmentReply reads a byte slice into a CreateSegmentReply value. +func createSegmentReply(buf []byte) *CreateSegmentReply { + v := new(CreateSegmentReply) + b := 1 // skip reply determinant + + v.Nfd = buf[b] + b += 1 + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + b += 24 // padding + + return v +} + +// Write request to wire for CreateSegment +// createSegmentRequest writes a CreateSegment request to a byte slice. +func createSegmentRequest(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) []byte { + size := 16 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["MIT-SHM"] + b += 1 + + buf[b] = 7 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Shmseg)) + b += 4 + + xgb.Put32(buf[b:], Size) + b += 4 + + if ReadOnly { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + b += 3 // padding + + return buf +} + // DetachCookie is a cookie used only for Detach requests. type DetachCookie struct { *xgb.Cookie diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 94e96e1..0424585 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -85,6 +85,27 @@ func init() { xgb.NewExtErrorFuncs["XFIXES"][0] = BadRegionErrorNew } +type Barrier uint32 + +func NewBarrierId(c *xgb.Conn) (Barrier, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return Barrier(id), nil +} + +const ( + BarrierDirectionsPositiveX = 1 + BarrierDirectionsPositiveY = 2 + BarrierDirectionsNegativeX = 4 + BarrierDirectionsNegativeY = 8 +) + +const ( + CursorNotifyDisplayCursor = 0 +) + // CursorNotify is the event number for a CursorNotifyEvent. const CursorNotify = 1 @@ -180,10 +201,6 @@ func init() { xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew } -const ( - CursorNotifyDisplayCursor = 0 -) - const ( CursorNotifyMaskDisplayCursor = 1 ) @@ -601,6 +618,90 @@ func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { return buf } +// CreatePointerBarrierCookie is a cookie used only for CreatePointerBarrier requests. +type CreatePointerBarrierCookie struct { + *xgb.Cookie +} + +// CreatePointerBarrier sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func CreatePointerBarrier(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 uint16, Y1 uint16, X2 uint16, Y2 uint16, Directions uint32, NumDevices uint16, Devices []uint16) CreatePointerBarrierCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreatePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(createPointerBarrierRequest(c, Barrier, Window, X1, Y1, X2, Y2, Directions, NumDevices, Devices), cookie) + return CreatePointerBarrierCookie{cookie} +} + +// CreatePointerBarrierChecked sends a checked request. +// If an error occurs, it can be retrieved using CreatePointerBarrierCookie.Check() +func CreatePointerBarrierChecked(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 uint16, Y1 uint16, X2 uint16, Y2 uint16, Directions uint32, NumDevices uint16, Devices []uint16) CreatePointerBarrierCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'CreatePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(createPointerBarrierRequest(c, Barrier, Window, X1, Y1, X2, Y2, Directions, NumDevices, Devices), cookie) + return CreatePointerBarrierCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook CreatePointerBarrierCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for CreatePointerBarrier +// createPointerBarrierRequest writes a CreatePointerBarrier request to a byte slice. +func createPointerBarrierRequest(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 uint16, Y1 uint16, X2 uint16, Y2 uint16, Directions uint32, NumDevices uint16, Devices []uint16) []byte { + size := xgb.Pad((28 + xgb.Pad((int(NumDevices) * 2)))) + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 31 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Barrier)) + b += 4 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put16(buf[b:], X1) + b += 2 + + xgb.Put16(buf[b:], Y1) + b += 2 + + xgb.Put16(buf[b:], X2) + b += 2 + + xgb.Put16(buf[b:], Y2) + b += 2 + + xgb.Put32(buf[b:], Directions) + b += 4 + + b += 2 // padding + + xgb.Put16(buf[b:], NumDevices) + b += 2 + + for i := 0; i < int(NumDevices); i++ { + xgb.Put16(buf[b:], Devices[i]) + b += 2 + } + b = xgb.Pad(b) + + return buf +} + // CreateRegionCookie is a cookie used only for CreateRegion requests. type CreateRegionCookie struct { *xgb.Cookie @@ -895,6 +996,61 @@ func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Win return buf } +// DeletePointerBarrierCookie is a cookie used only for DeletePointerBarrier requests. +type DeletePointerBarrierCookie struct { + *xgb.Cookie +} + +// DeletePointerBarrier sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeletePointerBarrier(c *xgb.Conn, Barrier Barrier) DeletePointerBarrierCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DeletePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deletePointerBarrierRequest(c, Barrier), cookie) + return DeletePointerBarrierCookie{cookie} +} + +// DeletePointerBarrierChecked sends a checked request. +// If an error occurs, it can be retrieved using DeletePointerBarrierCookie.Check() +func DeletePointerBarrierChecked(c *xgb.Conn, Barrier Barrier) DeletePointerBarrierCookie { + if _, ok := c.Extensions["XFIXES"]; !ok { + panic("Cannot issue request 'DeletePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deletePointerBarrierRequest(c, Barrier), cookie) + return DeletePointerBarrierCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeletePointerBarrierCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeletePointerBarrier +// deletePointerBarrierRequest writes a DeletePointerBarrier request to a byte slice. +func deletePointerBarrierRequest(c *xgb.Conn, Barrier Barrier) []byte { + size := 8 + b := 0 + buf := make([]byte, size) + + buf[b] = c.Extensions["XFIXES"] + b += 1 + + buf[b] = 32 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Barrier)) + b += 4 + + return buf +} + // DestroyRegionCookie is a cookie used only for DestroyRegion requests. type DestroyRegionCookie struct { *xgb.Cookie diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 0de64fd..9b33030 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2484,10 +2484,6 @@ func NewFontId(c *xgb.Conn) (Font, error) { return Font(id), nil } -const ( - FontNone = 0 -) - // BadFont is the error number for a BadFont. const BadFont = 7 @@ -2526,6 +2522,10 @@ func init() { xgb.NewErrorFuncs[7] = FontErrorNew } +const ( + FontNone = 0 +) + const ( FontDrawLeftToRight = 0 FontDrawRightToLeft = 1 @@ -2735,6 +2735,56 @@ func NewGcontextId(c *xgb.Conn) (Gcontext, error) { return Gcontext(id), nil } +// GeGeneric is the event number for a GeGenericEvent. +const GeGeneric = 35 + +type GeGenericEvent struct { + Sequence uint16 + // padding: 22 bytes +} + +// GeGenericEventNew constructs a GeGenericEvent value that implements xgb.Event from a byte slice. +func GeGenericEventNew(buf []byte) xgb.Event { + v := GeGenericEvent{} + b := 1 // don't read event number + + b += 22 // padding + + return v +} + +// Bytes writes a GeGenericEvent value to a byte slice. +func (v GeGenericEvent) Bytes() []byte { + buf := make([]byte, 32) + b := 0 + + // write event number + buf[b] = 35 + b += 1 + + b += 22 // padding + + return buf +} + +// SequenceId returns the sequence id attached to the GeGeneric event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. +func (v GeGenericEvent) SequenceId() uint16 { + return v.Sequence +} + +// String is a rudimentary string representation of GeGenericEvent. +func (v GeGenericEvent) String() string { + fieldVals := make([]string, 0, 1) + fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) + return "GeGeneric {" + xgb.StringsJoin(fieldVals, ", ") + "}" +} + +func init() { + xgb.NewEventFuncs[35] = GeGenericEventNew +} + const ( GetPropertyTypeAny = 0 ) From 2dc9914b5e6b74c353771e56e90dfd2dd33e0202 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:33:09 -0500 Subject: [PATCH 72/90] When writing, don't pad the length of bytes produced from inner structs/unions. Each type should take care of its own padding. Close #14. --- nexgb/damage/damage.go | 4 ++-- nexgb/randr/randr.go | 38 ++++++++++++++++----------------- nexgb/record/record.go | 18 ++++++++-------- nexgb/render/render.go | 36 +++++++++++++++---------------- nexgb/res/res.go | 6 +++--- nexgb/xevie/xevie.go | 2 +- nexgb/xfixes/xfixes.go | 2 +- nexgb/xgbgen/go_single_field.go | 4 ++-- nexgb/xproto/xproto.go | 2 +- nexgb/xv/xv.go | 2 +- 10 files changed, 57 insertions(+), 57 deletions(-) diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index 0ab7668..e94936d 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -162,13 +162,13 @@ func (v NotifyEvent) Bytes() []byte { { structBytes := v.Area.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.Geometry.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 11e1230..c7df090 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -504,15 +504,6 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return xgb.Pad(b) } -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 - NotifyProviderChange = 3 - NotifyProviderProperty = 4 - NotifyResourceChange = 5 -) - // Notify is the event number for a NotifyEvent. const Notify = 1 @@ -556,7 +547,7 @@ func (v NotifyEvent) Bytes() []byte { { unionBytes := v.U.Bytes() copy(buf[b:], unionBytes) - b += xgb.Pad(len(unionBytes)) + b += len(unionBytes) } return buf @@ -581,6 +572,15 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 + NotifyProviderChange = 3 + NotifyProviderProperty = 4 + NotifyResourceChange = 5 +) + // NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). @@ -608,7 +608,7 @@ func NotifyDataUnionCcNew(Cc CrtcChange) NotifyDataUnion { { structBytes := Cc.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -651,7 +651,7 @@ func NotifyDataUnionOcNew(Oc OutputChange) NotifyDataUnion { { structBytes := Oc.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -694,7 +694,7 @@ func NotifyDataUnionOpNew(Op OutputProperty) NotifyDataUnion { { structBytes := Op.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -737,7 +737,7 @@ func NotifyDataUnionPcNew(Pc ProviderChange) NotifyDataUnion { { structBytes := Pc.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -780,7 +780,7 @@ func NotifyDataUnionPpNew(Pp ProviderProperty) NotifyDataUnion { { structBytes := Pp.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -823,7 +823,7 @@ func NotifyDataUnionRcNew(Rc ResourceChange) NotifyDataUnion { { structBytes := Rc.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } // Create the Union type @@ -909,7 +909,7 @@ func (v NotifyDataUnion) Bytes() []byte { { structBytes := v.Cc.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf } @@ -2133,7 +2133,7 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam { structBytes := ModeInfo.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } copy(buf[b:], Name[:len(Name)]) @@ -5139,7 +5139,7 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, { structBytes := Transform.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put16(buf[b:], FilterLen) diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 2644f13..3777422 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -213,13 +213,13 @@ func (v ExtRange) Bytes() []byte { { structBytes := v.Major.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.Minor.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -315,43 +315,43 @@ func (v Range) Bytes() []byte { { structBytes := v.CoreRequests.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.CoreReplies.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.ExtRequests.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.ExtReplies.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.DeliveredEvents.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.DeviceEvents.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.Errors.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } if v.ClientStarted { diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 7185d18..80f4be7 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -570,13 +570,13 @@ func (v Linefix) Bytes() []byte { { structBytes := v.P1.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.P2.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -898,7 +898,7 @@ func (v Pictforminfo) Bytes() []byte { { structBytes := v.Direct.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], uint32(v.Colormap)) @@ -1382,13 +1382,13 @@ func (v Trap) Bytes() []byte { { structBytes := v.Top.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.Bot.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -1456,13 +1456,13 @@ func (v Trapezoid) Bytes() []byte { { structBytes := v.Left.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.Right.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -1520,19 +1520,19 @@ func (v Triangle) Bytes() []byte { { structBytes := v.P1.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.P2.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := v.P3.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -2205,7 +2205,7 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, { structBytes := Center.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], uint32(Angle)) @@ -2402,13 +2402,13 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P { structBytes := P1.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := P2.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], NumStops) @@ -2549,13 +2549,13 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O { structBytes := Inner.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } { structBytes := Outer.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], uint32(InnerRadius)) @@ -2633,7 +2633,7 @@ func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { { structBytes := Color.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf @@ -2699,7 +2699,7 @@ func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects { structBytes := Color.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } b += xproto.RectangleListBytes(buf[b:], Rects) @@ -3543,7 +3543,7 @@ func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transfor { structBytes := Transform.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } return buf diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 43480ec..59a416a 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -194,7 +194,7 @@ func (v ClientIdValue) Bytes() []byte { { structBytes := v.Spec.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.Length) @@ -328,7 +328,7 @@ func (v ResourceSizeSpec) Bytes() []byte { { structBytes := v.Spec.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.Bytes) @@ -395,7 +395,7 @@ func (v ResourceSizeValue) Bytes() []byte { { structBytes := v.Size.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.NumCrossReferences) diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 6da9158..f77d405 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -467,7 +467,7 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { { structBytes := Event.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], DataType) diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 0424585..a34df54 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -1801,7 +1801,7 @@ func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, De { structBytes := Bounds.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], uint32(Destination)) diff --git a/nexgb/xgbgen/go_single_field.go b/nexgb/xgbgen/go_single_field.go index 3e3fa53..6c7218e 100644 --- a/nexgb/xgbgen/go_single_field.go +++ b/nexgb/xgbgen/go_single_field.go @@ -152,13 +152,13 @@ func (f *SingleField) Write(c *Context, prefix string) { c.Putln("{") c.Putln("unionBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], unionBytes)") - c.Putln("b += xgb.Pad(len(unionBytes))") + c.Putln("b += len(unionBytes)") c.Putln("}") case *Struct: c.Putln("{") c.Putln("structBytes := %s%s.Bytes()", prefix, f.SrcName()) c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += xgb.Pad(len(structBytes))") + c.Putln("b += len(structBytes)") c.Putln("}") default: log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type) diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 9b33030..5579ba9 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -886,7 +886,7 @@ func (v ClientMessageEvent) Bytes() []byte { { unionBytes := v.Data.Bytes() copy(buf[b:], unionBytes) - b += xgb.Pad(len(unionBytes)) + b += len(unionBytes) } return buf diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 5eefe77..d79a594 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -458,7 +458,7 @@ func (v EncodingInfo) Bytes() []byte { { structBytes := v.Rate.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } copy(buf[b:], v.Name[:v.NameSize]) From ad9c35a02f190ea5da59c9c4a3aeddcf7e8a5c1f Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:33:40 -0500 Subject: [PATCH 73/90] shortcuts for the lazy --- nexgb/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nexgb/Makefile b/nexgb/Makefile index 57e884a..7a3dae2 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -72,3 +72,7 @@ gofmt: gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go colcheck *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go +push: + git push origin master + git push github master + From 33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 10:02:18 -0500 Subject: [PATCH 74/90] It appears that the "Str" type (which is built into the core X protocol) doesn't specify any padding. So it has to be treated as a special case. Close #12. --- nexgb/dri2/dri2.go | 4 ++-- nexgb/glx/glx.go | 4 ++-- nexgb/randr/randr.go | 24 ++++++++++++------------ nexgb/xf86dri/xf86dri.go | 4 ++-- nexgb/xf86vidmode/xf86vidmode.go | 4 ++-- nexgb/xfixes/xfixes.go | 4 ++-- nexgb/xgbgen/go_list.go | 5 ++++- nexgb/xproto/xproto.go | 16 ++++++++-------- nexgb/xselinux/xselinux.go | 30 +++++++++++++++--------------- nexgb/xv/xv.go | 6 +++--- 10 files changed, 52 insertions(+), 49 deletions(-) diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index df13661..6cec3d0 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -562,7 +562,7 @@ func connectReply(buf []byte) *ConnectReply { byteString := make([]byte, v.DriverNameLength) copy(byteString[:v.DriverNameLength], buf[b:]) v.DriverName = string(byteString) - b += xgb.Pad(int(v.DriverNameLength)) + b += int(v.DriverNameLength) } v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) @@ -573,7 +573,7 @@ func connectReply(buf []byte) *ConnectReply { byteString := make([]byte, v.DeviceNameLength) copy(byteString[:v.DeviceNameLength], buf[b:]) v.DeviceName = string(byteString) - b += xgb.Pad(int(v.DeviceNameLength)) + b += int(v.DeviceNameLength) } return v diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 2db5798..979d577 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -6885,7 +6885,7 @@ func getStringReply(buf []byte) *GetStringReply { byteString := make([]byte, v.N) copy(byteString[:v.N], buf[b:]) v.String = string(byteString) - b += xgb.Pad(int(v.N)) + b += int(v.N) } return v @@ -9174,7 +9174,7 @@ func queryServerStringReply(buf []byte) *QueryServerStringReply { byteString := make([]byte, v.StrLen) copy(byteString[:v.StrLen], buf[b:]) v.String = string(byteString) - b += xgb.Pad(int(v.StrLen)) + b += int(v.StrLen) } return v diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index c7df090..c7893e3 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -504,6 +504,15 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return xgb.Pad(b) } +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 + NotifyProviderChange = 3 + NotifyProviderProperty = 4 + NotifyResourceChange = 5 +) + // Notify is the event number for a NotifyEvent. const Notify = 1 @@ -572,15 +581,6 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 - NotifyProviderChange = 3 - NotifyProviderProperty = 4 - NotifyResourceChange = 5 -) - // NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). @@ -2826,7 +2826,7 @@ func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { byteString := make([]byte, v.PendingLen) copy(byteString[:v.PendingLen], buf[b:]) v.PendingFilterName = string(byteString) - b += xgb.Pad(int(v.PendingLen)) + b += int(v.PendingLen) } v.PendingParams = make([]render.Fixed, v.PendingNparams) @@ -2840,7 +2840,7 @@ func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { byteString := make([]byte, v.CurrentLen) copy(byteString[:v.CurrentLen], buf[b:]) v.CurrentFilterName = string(byteString) - b += xgb.Pad(int(v.CurrentLen)) + b += int(v.CurrentLen) } v.CurrentParams = make([]render.Fixed, v.CurrentNparams) @@ -3518,7 +3518,7 @@ func getProviderInfoReply(buf []byte) *GetProviderInfoReply { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) } return v diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 46fabca..65fcfa0 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -659,7 +659,7 @@ func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply { byteString := make([]byte, v.ClientDriverNameLen) copy(byteString[:v.ClientDriverNameLen], buf[b:]) v.ClientDriverName = string(byteString) - b += xgb.Pad(int(v.ClientDriverNameLen)) + b += int(v.ClientDriverNameLen) } return v @@ -1017,7 +1017,7 @@ func openConnectionReply(buf []byte) *OpenConnectionReply { byteString := make([]byte, v.BusIdLen) copy(byteString[:v.BusIdLen], buf[b:]) v.BusId = string(byteString) - b += xgb.Pad(int(v.BusIdLen)) + b += int(v.BusIdLen) } return v diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 5a3f63d..44228c4 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -1543,7 +1543,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply { byteString := make([]byte, v.VendorLength) copy(byteString[:v.VendorLength], buf[b:]) v.Vendor = string(byteString) - b += xgb.Pad(int(v.VendorLength)) + b += int(v.VendorLength) } v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) @@ -1554,7 +1554,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply { byteString := make([]byte, v.ModelLength) copy(byteString[:v.ModelLength], buf[b:]) v.Model = string(byteString) - b += xgb.Pad(int(v.ModelLength)) + b += int(v.ModelLength) } return v diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index a34df54..9a08c93 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -1495,7 +1495,7 @@ func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { byteString := make([]byte, v.Nbytes) copy(byteString[:v.Nbytes], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.Nbytes)) + b += int(v.Nbytes) } v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) @@ -1602,7 +1602,7 @@ func getCursorNameReply(buf []byte) *GetCursorNameReply { byteString := make([]byte, v.Nbytes) copy(byteString[:v.Nbytes], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.Nbytes)) + b += int(v.Nbytes) } return v diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index 4cf962a..fa8df69 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -29,7 +29,10 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("byteString := make([]%s, %s)", t.SrcName(), length) c.Putln("copy(byteString[:%s], buf[b:])", length) c.Putln("%s%s = string(byteString)", prefix, f.SrcName()) - c.Putln("b += xgb.Pad(int(%s))", length) + // This is apparently a special case. The "Str" type itself + // doesn't specify any padding. I suppose it's up to the + // request/reply spec that uses it to get the padding right? + c.Putln("b += int(%s)", length) c.Putln("}") } else if t.SrcName() == "byte" { c.Putln("%s%s = make([]%s, %s)", diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 5579ba9..36ab545 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -5404,7 +5404,7 @@ func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { byteString := make([]byte, (int(v.Length) * 4)) copy(byteString[:(int(v.Length)*4)], buf[b:]) v.Reason = string(byteString) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) } return b @@ -5492,7 +5492,7 @@ func SetupFailedRead(buf []byte, v *SetupFailed) int { byteString := make([]byte, v.ReasonLen) copy(byteString[:v.ReasonLen], buf[b:]) v.Reason = string(byteString) - b += xgb.Pad(int(v.ReasonLen)) + b += int(v.ReasonLen) } return b @@ -5647,7 +5647,7 @@ func SetupInfoRead(buf []byte, v *SetupInfo) int { byteString := make([]byte, v.VendorLen) copy(byteString[:v.VendorLen], buf[b:]) v.Vendor = string(byteString) - b += xgb.Pad(int(v.VendorLen)) + b += int(v.VendorLen) } v.PixmapFormats = make([]Format, v.PixmapFormatsLen) @@ -5802,14 +5802,14 @@ func SetupRequestRead(buf []byte, v *SetupRequest) int { byteString := make([]byte, v.AuthorizationProtocolNameLen) copy(byteString[:v.AuthorizationProtocolNameLen], buf[b:]) v.AuthorizationProtocolName = string(byteString) - b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) + b += int(v.AuthorizationProtocolNameLen) } { byteString := make([]byte, v.AuthorizationProtocolDataLen) copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) v.AuthorizationProtocolData = string(byteString) - b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) + b += int(v.AuthorizationProtocolDataLen) } return b @@ -5903,7 +5903,7 @@ func StrRead(buf []byte, v *Str) int { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) } return b @@ -9036,7 +9036,7 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) } return v @@ -11406,7 +11406,7 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { byteString := make([]byte, v.NameLen) copy(byteString[:v.NameLen], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) } return v diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index f24f5d7..454fdf2 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -62,14 +62,14 @@ func ListItemRead(buf []byte, v *ListItem) int { byteString := make([]byte, v.ObjectContextLen) copy(byteString[:v.ObjectContextLen], buf[b:]) v.ObjectContext = string(byteString) - b += xgb.Pad(int(v.ObjectContextLen)) + b += int(v.ObjectContextLen) } { byteString := make([]byte, v.DataContextLen) copy(byteString[:v.DataContextLen], buf[b:]) v.DataContext = string(byteString) - b += xgb.Pad(int(v.DataContextLen)) + b += int(v.DataContextLen) } return b @@ -224,7 +224,7 @@ func getClientContextReply(buf []byte) *GetClientContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -323,7 +323,7 @@ func getDeviceContextReply(buf []byte) *GetDeviceContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -422,7 +422,7 @@ func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -518,7 +518,7 @@ func getPropertyContextReply(buf []byte) *GetPropertyContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -620,7 +620,7 @@ func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -716,7 +716,7 @@ func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -818,7 +818,7 @@ func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -914,7 +914,7 @@ func getSelectionContextReply(buf []byte) *GetSelectionContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -1013,7 +1013,7 @@ func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -1109,7 +1109,7 @@ func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -1208,7 +1208,7 @@ func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -1304,7 +1304,7 @@ func getWindowContextReply(buf []byte) *GetWindowContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v @@ -1403,7 +1403,7 @@ func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { byteString := make([]byte, v.ContextLen) copy(byteString[:v.ContextLen], buf[b:]) v.Context = string(byteString) - b += xgb.Pad(int(v.ContextLen)) + b += int(v.ContextLen) } return v diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index d79a594..32bdd9e 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -74,7 +74,7 @@ func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { byteString := make([]byte, v.NameSize) copy(byteString[:v.NameSize], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameSize)) + b += int(v.NameSize) } v.Formats = make([]Format, v.NumFormats) @@ -177,7 +177,7 @@ func AttributeInfoRead(buf []byte, v *AttributeInfo) int { byteString := make([]byte, v.Size) copy(byteString[:v.Size], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.Size)) + b += int(v.Size) } return b @@ -420,7 +420,7 @@ func EncodingInfoRead(buf []byte, v *EncodingInfo) int { byteString := make([]byte, v.NameSize) copy(byteString[:v.NameSize], buf[b:]) v.Name = string(byteString) - b += xgb.Pad(int(v.NameSize)) + b += int(v.NameSize) } return b From 76f9adb5991081e27ebc6eec82db6bdba36c910f Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 10:13:20 -0500 Subject: [PATCH 75/90] Use consistent extension names. Close #6. --- nexgb/composite/composite.go | 54 +++++------ nexgb/ge/ge.go | 6 +- nexgb/randr/randr.go | 18 ++-- nexgb/res/res.go | 36 ++++---- nexgb/xf86dri/xf86dri.go | 72 +++++++-------- nexgb/xf86vidmode/xf86vidmode.go | 126 +++++++++++++------------- nexgb/xgbgen/go_request_reply.go | 6 +- nexgb/xprint/xprint.go | 150 +++++++++++++++---------------- nexgb/xselinux/xselinux.go | 138 ++++++++++++++-------------- nexgb/xv/xv.go | 120 ++++++++++++------------- nexgb/xvmc/xvmc.go | 54 +++++------ 11 files changed, 389 insertions(+), 391 deletions(-) diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index c951a69..b7ce2ad 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -75,7 +75,7 @@ type CreateRegionFromBorderClipCookie struct { // CreateRegionFromBorderClip sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -86,7 +86,7 @@ func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto // CreateRegionFromBorderClipChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -107,7 +107,7 @@ func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 5 // request opcode @@ -133,7 +133,7 @@ type GetOverlayWindowCookie struct { // GetOverlayWindow sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -144,7 +144,7 @@ func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie // GetOverlayWindowUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -201,7 +201,7 @@ func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 7 // request opcode @@ -224,7 +224,7 @@ type NameWindowPixmapCookie struct { // NameWindowPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -235,7 +235,7 @@ func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) N // NameWindowPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -256,7 +256,7 @@ func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pi b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 6 // request opcode @@ -282,7 +282,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -293,7 +293,7 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -354,7 +354,7 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 0 // request opcode @@ -380,7 +380,7 @@ type RedirectSubwindowsCookie struct { // RedirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -391,7 +391,7 @@ func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Redirect // RedirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -412,7 +412,7 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [ b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 2 // request opcode @@ -440,7 +440,7 @@ type RedirectWindowCookie struct { // RedirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -451,7 +451,7 @@ func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWind // RedirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectWindowCookie.Check() func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -472,7 +472,7 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 1 // request opcode @@ -500,7 +500,7 @@ type ReleaseOverlayWindowCookie struct { // ReleaseOverlayWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -511,7 +511,7 @@ func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindo // ReleaseOverlayWindowChecked sends a checked request. // If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -532,7 +532,7 @@ func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 8 // request opcode @@ -555,7 +555,7 @@ type UnredirectSubwindowsCookie struct { // UnredirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -566,7 +566,7 @@ func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Unredi // UnredirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -587,7 +587,7 @@ func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 4 // request opcode @@ -615,7 +615,7 @@ type UnredirectWindowCookie struct { // UnredirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -626,7 +626,7 @@ func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) Unredirect // UnredirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectWindowCookie.Check() func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { - if _, ok := c.Extensions["COMPOSITE"]; !ok { + if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -647,7 +647,7 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["COMPOSITE"] + buf[b] = c.Extensions["Composite"] b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 1cfd918..68213bc 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -69,7 +69,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { - if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok { + if _, ok := c.Extensions["Generic Event Extension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -80,7 +80,7 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { - if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok { + if _, ok := c.Extensions["Generic Event Extension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -141,7 +141,7 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["GENERIC EVENT EXTENSION"] + buf[b] = c.Extensions["Generic Event Extension"] b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index c7893e3..db45a23 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -504,15 +504,6 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return xgb.Pad(b) } -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 - NotifyProviderChange = 3 - NotifyProviderProperty = 4 - NotifyResourceChange = 5 -) - // Notify is the event number for a NotifyEvent. const Notify = 1 @@ -581,6 +572,15 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 + NotifyProviderChange = 3 + NotifyProviderProperty = 4 + NotifyResourceChange = 5 +) + // NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 59a416a..8311f95 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -513,7 +513,7 @@ type QueryClientIdsCookie struct { // QueryClientIds sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientIdsCookie.Reply() func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -524,7 +524,7 @@ func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryCli // QueryClientIdsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientIdsUnchecked(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -585,7 +585,7 @@ func queryClientIdsRequest(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) [ b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 4 // request opcode @@ -610,7 +610,7 @@ type QueryClientPixmapBytesCookie struct { // QueryClientPixmapBytes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -621,7 +621,7 @@ func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCooki // QueryClientPixmapBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -679,7 +679,7 @@ func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 3 // request opcode @@ -702,7 +702,7 @@ type QueryClientResourcesCookie struct { // QueryClientResources sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientResourcesCookie.Reply() func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -713,7 +713,7 @@ func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { // QueryClientResourcesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -774,7 +774,7 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 2 // request opcode @@ -797,7 +797,7 @@ type QueryClientsCookie struct { // QueryClients sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() func QueryClients(c *xgb.Conn) QueryClientsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -808,7 +808,7 @@ func QueryClients(c *xgb.Conn) QueryClientsCookie { // QueryClientsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -869,7 +869,7 @@ func queryClientsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 1 // request opcode @@ -889,7 +889,7 @@ type QueryResourceBytesCookie struct { // QueryResourceBytes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryResourceBytesCookie.Reply() func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -900,7 +900,7 @@ func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []Res // QueryResourceBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryResourceBytesUnchecked(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -961,7 +961,7 @@ func queryResourceBytesRequest(c *xgb.Conn, Client uint32, NumSpecs uint32, Spec b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 5 // request opcode @@ -989,7 +989,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1000,7 +1000,7 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { - if _, ok := c.Extensions["X-RESOURCE"]; !ok { + if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1058,7 +1058,7 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["X-RESOURCE"] + buf[b] = c.Extensions["X-Resource"] b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 65fcfa0..d88cc5d 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -137,7 +137,7 @@ type AuthConnectionCookie struct { // AuthConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -148,7 +148,7 @@ func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCook // AuthConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -202,7 +202,7 @@ func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 11 // request opcode @@ -228,7 +228,7 @@ type CloseConnectionCookie struct { // CloseConnection sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -239,7 +239,7 @@ func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { // CloseConnectionChecked sends a checked request. // If an error occurs, it can be retrieved using CloseConnectionCookie.Check() func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -260,7 +260,7 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 3 // request opcode @@ -283,7 +283,7 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -294,7 +294,7 @@ func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) Cr // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -348,7 +348,7 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 5 // request opcode @@ -377,7 +377,7 @@ type CreateDrawableCookie struct { // CreateDrawable sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -388,7 +388,7 @@ func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableC // CreateDrawableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -442,7 +442,7 @@ func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 7 // request opcode @@ -468,7 +468,7 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -479,7 +479,7 @@ func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCo // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -500,7 +500,7 @@ func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 6 // request opcode @@ -526,7 +526,7 @@ type DestroyDrawableCookie struct { // DestroyDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -537,7 +537,7 @@ func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawabl // DestroyDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -558,7 +558,7 @@ func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 8 // request opcode @@ -584,7 +584,7 @@ type GetClientDriverNameCookie struct { // GetClientDriverName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientDriverNameCookie.Reply() func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -595,7 +595,7 @@ func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { // GetClientDriverNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -672,7 +672,7 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 4 // request opcode @@ -695,7 +695,7 @@ type GetDeviceInfoCookie struct { // GetDeviceInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -706,7 +706,7 @@ func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { // GetDeviceInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -788,7 +788,7 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 10 // request opcode @@ -811,7 +811,7 @@ type GetDrawableInfoCookie struct { // GetDrawableInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDrawableInfoCookie.Reply() func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -822,7 +822,7 @@ func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInf // GetDrawableInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -920,7 +920,7 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 9 // request opcode @@ -946,7 +946,7 @@ type OpenConnectionCookie struct { // OpenConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -957,7 +957,7 @@ func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { // OpenConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1030,7 +1030,7 @@ func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 2 // request opcode @@ -1053,7 +1053,7 @@ type QueryDirectRenderingCapableCookie struct { // QueryDirectRenderingCapable sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1064,7 +1064,7 @@ func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderin // QueryDirectRenderingCapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1122,7 +1122,7 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 1 // request opcode @@ -1145,7 +1145,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1156,7 +1156,7 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-DRI"]; !ok { + if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1218,7 +1218,7 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-DRI"] + buf[b] = c.Extensions["XFree86-DRI"] b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 44228c4..8abb44e 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -554,7 +554,7 @@ type AddModeLineCookie struct { // AddModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -565,7 +565,7 @@ func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, // AddModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using AddModeLineCookie.Check() func AddModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -586,7 +586,7 @@ func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 7 // request opcode @@ -689,7 +689,7 @@ type DeleteModeLineCookie struct { // DeleteModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -700,7 +700,7 @@ func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint // DeleteModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteModeLineCookie.Check() func DeleteModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -721,7 +721,7 @@ func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdispl b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 8 // request opcode @@ -787,7 +787,7 @@ type GetAllModeLinesCookie struct { // GetAllModeLines sends a checked request. // If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -798,7 +798,7 @@ func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { // GetAllModeLinesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -859,7 +859,7 @@ func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 6 // request opcode @@ -884,7 +884,7 @@ type GetDotClocksCookie struct { // GetDotClocks sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDotClocksCookie.Reply() func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -895,7 +895,7 @@ func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { // GetDotClocksUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDotClocksUnchecked(c *xgb.Conn, Screen uint16) GetDotClocksCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -968,7 +968,7 @@ func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 13 // request opcode @@ -993,7 +993,7 @@ type GetGammaCookie struct { // GetGamma sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaCookie.Reply() func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1004,7 +1004,7 @@ func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { // GetGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaUnchecked(c *xgb.Conn, Screen uint16) GetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1069,7 +1069,7 @@ func getGammaRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 16 // request opcode @@ -1094,7 +1094,7 @@ type GetGammaRampCookie struct { // GetGammaRamp sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampCookie.Reply() func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1105,7 +1105,7 @@ func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { // GetGammaRampUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampUnchecked(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1186,7 +1186,7 @@ func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 17 // request opcode @@ -1212,7 +1212,7 @@ type GetGammaRampSizeCookie struct { // GetGammaRampSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampSizeCookie.Reply() func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1223,7 +1223,7 @@ func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { // GetGammaRampSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampSizeUnchecked(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1280,7 +1280,7 @@ func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 19 // request opcode @@ -1305,7 +1305,7 @@ type GetModeLineCookie struct { // GetModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1316,7 +1316,7 @@ func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { // GetModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1425,7 +1425,7 @@ func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 1 // request opcode @@ -1450,7 +1450,7 @@ type GetMonitorCookie struct { // GetMonitor sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1461,7 +1461,7 @@ func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { // GetMonitorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1567,7 +1567,7 @@ func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 4 // request opcode @@ -1592,7 +1592,7 @@ type GetPermissionsCookie struct { // GetPermissions sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPermissionsCookie.Reply() func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1603,7 +1603,7 @@ func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { // GetPermissionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPermissionsUnchecked(c *xgb.Conn, Screen uint16) GetPermissionsCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1660,7 +1660,7 @@ func getPermissionsRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 20 // request opcode @@ -1685,7 +1685,7 @@ type GetViewPortCookie struct { // GetViewPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1696,7 +1696,7 @@ func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { // GetViewPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1757,7 +1757,7 @@ func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 11 // request opcode @@ -1782,7 +1782,7 @@ type LockModeSwitchCookie struct { // LockModeSwitch sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1793,7 +1793,7 @@ func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCooki // LockModeSwitchChecked sends a checked request. // If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1814,7 +1814,7 @@ func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 5 // request opcode @@ -1840,7 +1840,7 @@ type ModModeLineCookie struct { // ModModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1851,7 +1851,7 @@ func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, // ModModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using ModModeLineCookie.Check() func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1872,7 +1872,7 @@ func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 2 // request opcode @@ -1935,7 +1935,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1946,7 +1946,7 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2004,7 +2004,7 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 0 // request opcode @@ -2024,7 +2024,7 @@ type SetClientVersionCookie struct { // SetClientVersion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2035,7 +2035,7 @@ func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionC // SetClientVersionChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientVersionCookie.Check() func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2056,7 +2056,7 @@ func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 14 // request opcode @@ -2082,7 +2082,7 @@ type SetGammaCookie struct { // SetGamma sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2093,7 +2093,7 @@ func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) // SetGammaChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaCookie.Check() func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2114,7 +2114,7 @@ func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 15 // request opcode @@ -2150,7 +2150,7 @@ type SetGammaRampCookie struct { // SetGammaRamp sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2161,7 +2161,7 @@ func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green [ // SetGammaRampChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaRampCookie.Check() func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2182,7 +2182,7 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 18 // request opcode @@ -2226,7 +2226,7 @@ type SetViewPortCookie struct { // SetViewPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2237,7 +2237,7 @@ func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCook // SetViewPortChecked sends a checked request. // If an error occurs, it can be retrieved using SetViewPortCookie.Check() func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2258,7 +2258,7 @@ func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 12 // request opcode @@ -2289,7 +2289,7 @@ type SwitchModeCookie struct { // SwitchMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2300,7 +2300,7 @@ func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { // SwitchModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchModeCookie.Check() func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2321,7 +2321,7 @@ func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 3 // request opcode @@ -2347,7 +2347,7 @@ type SwitchToModeCookie struct { // SwitchToMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2358,7 +2358,7 @@ func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16 // SwitchToModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchToModeCookie.Check() func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2379,7 +2379,7 @@ func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 10 // request opcode @@ -2445,7 +2445,7 @@ type ValidateModeLineCookie struct { // ValidateModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2456,7 +2456,7 @@ func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay ui // ValidateModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { - if _, ok := c.Extensions["XFREE86-VIDMODEEXTENSION"]; !ok { + if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2513,7 +2513,7 @@ func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdis b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XFREE86-VIDMODEEXTENSION"] + buf[b] = c.Extensions["XFree86-VidModeExtension"] b += 1 buf[b] = 9 // request opcode diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index ee5c974..a2c6d9c 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -79,8 +79,7 @@ func (r *Request) CheckExt(c *Context) { if !c.protocol.isExt() { return } - c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", - strings.ToUpper(c.protocol.ExtXName)) + c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", c.protocol.ExtXName) c.Putln("panic(\"Cannot issue request '%s' using the uninitialized "+ "extension '%s'. %s.Init(connObj) must be called first.\")", r.SrcName(), c.protocol.ExtXName, c.protocol.PkgName()) @@ -155,8 +154,7 @@ func (r *Request) WriteRequest(c *Context) { c.Putln("buf := make([]byte, size)") c.Putln("") if c.protocol.isExt() { - c.Putln("buf[b] = c.Extensions[\"%s\"]", - strings.ToUpper(c.protocol.ExtXName)) + c.Putln("buf[b] = c.Extensions[\"%s\"]", c.protocol.ExtXName) c.Putln("b += 1") c.Putln("") } diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index be9f2e8..7a7279f 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -442,7 +442,7 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -453,7 +453,7 @@ func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleL // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -474,7 +474,7 @@ func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 2 // request opcode @@ -515,7 +515,7 @@ type PrintDestroyContextCookie struct { // PrintDestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -526,7 +526,7 @@ func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie // PrintDestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -547,7 +547,7 @@ func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 5 // request opcode @@ -570,7 +570,7 @@ type PrintEndDocCookie struct { // PrintEndDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -581,7 +581,7 @@ func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { // PrintEndDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndDocCookie.Check() func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -602,7 +602,7 @@ func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 10 // request opcode @@ -629,7 +629,7 @@ type PrintEndJobCookie struct { // PrintEndJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -640,7 +640,7 @@ func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { // PrintEndJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndJobCookie.Check() func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -661,7 +661,7 @@ func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 8 // request opcode @@ -688,7 +688,7 @@ type PrintEndPageCookie struct { // PrintEndPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -699,7 +699,7 @@ func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { // PrintEndPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndPageCookie.Check() func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -720,7 +720,7 @@ func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 14 // request opcode @@ -749,7 +749,7 @@ type PrintGetAttributesCookie struct { // PrintGetAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -760,7 +760,7 @@ func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttrib // PrintGetAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -821,7 +821,7 @@ func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 17 // request opcode @@ -849,7 +849,7 @@ type PrintGetContextCookie struct { // PrintGetContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetContextCookie.Reply() func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -860,7 +860,7 @@ func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { // PrintGetContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetContextUnchecked(c *xgb.Conn) PrintGetContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -914,7 +914,7 @@ func printGetContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 4 // request opcode @@ -934,7 +934,7 @@ type PrintGetDocumentDataCookie struct { // PrintGetDocumentData sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetDocumentDataCookie.Reply() func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -945,7 +945,7 @@ func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintG // PrintGetDocumentDataUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetDocumentDataUnchecked(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1015,7 +1015,7 @@ func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 12 // request opcode @@ -1041,7 +1041,7 @@ type PrintGetImageResolutionCookie struct { // PrintGetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1052,7 +1052,7 @@ func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolut // PrintGetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1106,7 +1106,7 @@ func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 24 // request opcode @@ -1129,7 +1129,7 @@ type PrintGetOneAttributesCookie struct { // PrintGetOneAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetOneAttributesCookie.Reply() func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1140,7 +1140,7 @@ func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool b // PrintGetOneAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetOneAttributesUnchecked(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1205,7 +1205,7 @@ func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 19 // request opcode @@ -1242,7 +1242,7 @@ type PrintGetPageDimensionsCookie struct { // PrintGetPageDimensions sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPageDimensionsCookie.Reply() func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1253,7 +1253,7 @@ func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimension // PrintGetPageDimensionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPageDimensionsUnchecked(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1327,7 +1327,7 @@ func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 21 // request opcode @@ -1350,7 +1350,7 @@ type PrintGetPrinterListCookie struct { // PrintGetPrinterList sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1361,7 +1361,7 @@ func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, P // PrintGetPrinterListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1422,7 +1422,7 @@ func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen ui b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 1 // request opcode @@ -1460,7 +1460,7 @@ type PrintGetScreenOfContextCookie struct { // PrintGetScreenOfContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1471,7 +1471,7 @@ func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { // PrintGetScreenOfContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1525,7 +1525,7 @@ func printGetScreenOfContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 6 // request opcode @@ -1545,7 +1545,7 @@ type PrintInputSelectedCookie struct { // PrintInputSelected sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1556,7 +1556,7 @@ func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie // PrintInputSelectedUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1630,7 +1630,7 @@ func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 16 // request opcode @@ -1653,7 +1653,7 @@ type PrintPutDocumentDataCookie struct { // PrintPutDocumentData sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1664,7 +1664,7 @@ func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, // PrintPutDocumentDataChecked sends a checked request. // If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1685,7 +1685,7 @@ func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 11 // request opcode @@ -1732,7 +1732,7 @@ type PrintQueryScreensCookie struct { // PrintQueryScreens sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryScreensCookie.Reply() func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1743,7 +1743,7 @@ func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { // PrintQueryScreensUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryScreensUnchecked(c *xgb.Conn) PrintQueryScreensCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1808,7 +1808,7 @@ func printQueryScreensRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 22 // request opcode @@ -1828,7 +1828,7 @@ type PrintQueryVersionCookie struct { // PrintQueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1839,7 +1839,7 @@ func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { // PrintQueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1897,7 +1897,7 @@ func printQueryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 0 // request opcode @@ -1917,7 +1917,7 @@ type PrintRehashPrinterListCookie struct { // PrintRehashPrinterList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1928,7 +1928,7 @@ func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { // PrintRehashPrinterListChecked sends a checked request. // If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1949,7 +1949,7 @@ func printRehashPrinterListRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 20 // request opcode @@ -1969,7 +1969,7 @@ type PrintSelectInputCookie struct { // PrintSelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1980,7 +1980,7 @@ func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList // PrintSelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2001,7 +2001,7 @@ func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, Ev b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 15 // request opcode @@ -2032,7 +2032,7 @@ type PrintSetAttributesCookie struct { // PrintSetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2043,7 +2043,7 @@ func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool by // PrintSetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2064,7 +2064,7 @@ func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 18 // request opcode @@ -2104,7 +2104,7 @@ type PrintSetContextCookie struct { // PrintSetContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2115,7 +2115,7 @@ func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { // PrintSetContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetContextCookie.Check() func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2136,7 +2136,7 @@ func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 3 // request opcode @@ -2159,7 +2159,7 @@ type PrintSetImageResolutionCookie struct { // PrintSetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintSetImageResolutionCookie.Reply() func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2170,7 +2170,7 @@ func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint // PrintSetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2229,7 +2229,7 @@ func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResoluti b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 23 // request opcode @@ -2255,7 +2255,7 @@ type PrintStartDocCookie struct { // PrintStartDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2266,7 +2266,7 @@ func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { // PrintStartDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartDocCookie.Check() func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2287,7 +2287,7 @@ func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 9 // request opcode @@ -2310,7 +2310,7 @@ type PrintStartJobCookie struct { // PrintStartJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2321,7 +2321,7 @@ func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { // PrintStartJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartJobCookie.Check() func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2342,7 +2342,7 @@ func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 7 // request opcode @@ -2365,7 +2365,7 @@ type PrintStartPageCookie struct { // PrintStartPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2376,7 +2376,7 @@ func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { // PrintStartPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartPageCookie.Check() func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { - if _, ok := c.Extensions["XPEXTENSION"]; !ok { + if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2397,7 +2397,7 @@ func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XPEXTENSION"] + buf[b] = c.Extensions["XpExtension"] b += 1 buf[b] = 13 // request opcode diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 454fdf2..a4cd35e 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -161,7 +161,7 @@ type GetClientContextCookie struct { // GetClientContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -172,7 +172,7 @@ func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { // GetClientContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -237,7 +237,7 @@ func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 22 // request opcode @@ -260,7 +260,7 @@ type GetDeviceContextCookie struct { // GetDeviceContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceContextCookie.Reply() func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -271,7 +271,7 @@ func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { // GetDeviceContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -336,7 +336,7 @@ func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 4 // request opcode @@ -359,7 +359,7 @@ type GetDeviceCreateContextCookie struct { // GetDeviceCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -370,7 +370,7 @@ func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { // GetDeviceCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -435,7 +435,7 @@ func getDeviceCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 2 // request opcode @@ -455,7 +455,7 @@ type GetPropertyContextCookie struct { // GetPropertyContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyContextCookie.Reply() func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -466,7 +466,7 @@ func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) // GetPropertyContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -531,7 +531,7 @@ func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xprot b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 12 // request opcode @@ -557,7 +557,7 @@ type GetPropertyCreateContextCookie struct { // GetPropertyCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -568,7 +568,7 @@ func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { // GetPropertyCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -633,7 +633,7 @@ func getPropertyCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 9 // request opcode @@ -653,7 +653,7 @@ type GetPropertyDataContextCookie struct { // GetPropertyDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyDataContextCookie.Reply() func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -664,7 +664,7 @@ func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.A // GetPropertyDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -729,7 +729,7 @@ func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property x b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 13 // request opcode @@ -755,7 +755,7 @@ type GetPropertyUseContextCookie struct { // GetPropertyUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -766,7 +766,7 @@ func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { // GetPropertyUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -831,7 +831,7 @@ func getPropertyUseContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 11 // request opcode @@ -851,7 +851,7 @@ type GetSelectionContextCookie struct { // GetSelectionContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionContextCookie.Reply() func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -862,7 +862,7 @@ func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContext // GetSelectionContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -927,7 +927,7 @@ func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 19 // request opcode @@ -950,7 +950,7 @@ type GetSelectionCreateContextCookie struct { // GetSelectionCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -961,7 +961,7 @@ func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { // GetSelectionCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1026,7 +1026,7 @@ func getSelectionCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 16 // request opcode @@ -1046,7 +1046,7 @@ type GetSelectionDataContextCookie struct { // GetSelectionDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionDataContextCookie.Reply() func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1057,7 +1057,7 @@ func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDat // GetSelectionDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1122,7 +1122,7 @@ func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 20 // request opcode @@ -1145,7 +1145,7 @@ type GetSelectionUseContextCookie struct { // GetSelectionUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1156,7 +1156,7 @@ func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { // GetSelectionUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1221,7 +1221,7 @@ func getSelectionUseContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 18 // request opcode @@ -1241,7 +1241,7 @@ type GetWindowContextCookie struct { // GetWindowContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1252,7 +1252,7 @@ func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie // GetWindowContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1317,7 +1317,7 @@ func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 7 // request opcode @@ -1340,7 +1340,7 @@ type GetWindowCreateContextCookie struct { // GetWindowCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1351,7 +1351,7 @@ func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { // GetWindowCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1416,7 +1416,7 @@ func getWindowCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 6 // request opcode @@ -1436,7 +1436,7 @@ type ListPropertiesCookie struct { // ListProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1447,7 +1447,7 @@ func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { // ListPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1508,7 +1508,7 @@ func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 14 // request opcode @@ -1531,7 +1531,7 @@ type ListSelectionsCookie struct { // ListSelections sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSelectionsCookie.Reply() func ListSelections(c *xgb.Conn) ListSelectionsCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1542,7 +1542,7 @@ func ListSelections(c *xgb.Conn) ListSelectionsCookie { // ListSelectionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1603,7 +1603,7 @@ func listSelectionsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 21 // request opcode @@ -1623,7 +1623,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1634,7 +1634,7 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1692,7 +1692,7 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 0 // request opcode @@ -1718,7 +1718,7 @@ type SetDeviceContextCookie struct { // SetDeviceContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1729,7 +1729,7 @@ func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context str // SetDeviceContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1750,7 +1750,7 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 3 // request opcode @@ -1779,7 +1779,7 @@ type SetDeviceCreateContextCookie struct { // SetDeviceCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1790,7 +1790,7 @@ func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetD // SetDeviceCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1811,7 +1811,7 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 1 // request opcode @@ -1837,7 +1837,7 @@ type SetPropertyCreateContextCookie struct { // SetPropertyCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1848,7 +1848,7 @@ func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) Se // SetPropertyCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1869,7 +1869,7 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 8 // request opcode @@ -1895,7 +1895,7 @@ type SetPropertyUseContextCookie struct { // SetPropertyUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1906,7 +1906,7 @@ func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPr // SetPropertyUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1927,7 +1927,7 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 10 // request opcode @@ -1953,7 +1953,7 @@ type SetSelectionCreateContextCookie struct { // SetSelectionCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1964,7 +1964,7 @@ func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) S // SetSelectionCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1985,7 +1985,7 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 15 // request opcode @@ -2011,7 +2011,7 @@ type SetSelectionUseContextCookie struct { // SetSelectionUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2022,7 +2022,7 @@ func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetS // SetSelectionUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2043,7 +2043,7 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 17 // request opcode @@ -2069,7 +2069,7 @@ type SetWindowCreateContextCookie struct { // SetWindowCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2080,7 +2080,7 @@ func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetW // SetWindowCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { - if _, ok := c.Extensions["SELINUX"]; !ok { + if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2101,7 +2101,7 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["SELINUX"] + buf[b] = c.Extensions["SELinux"] b += 1 buf[b] = 5 // request opcode diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 32bdd9e..ec87d02 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -1202,7 +1202,7 @@ type GetPortAttributeCookie struct { // GetPortAttribute sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1213,7 +1213,7 @@ func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttr // GetPortAttributeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1267,7 +1267,7 @@ func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []by b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 14 // request opcode @@ -1293,7 +1293,7 @@ type GetStillCookie struct { // GetStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1304,7 +1304,7 @@ func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetStillChecked sends a checked request. // If an error occurs, it can be retrieved using GetStillCookie.Check() func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1325,7 +1325,7 @@ func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 8 // request opcode @@ -1378,7 +1378,7 @@ type GetVideoCookie struct { // GetVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1389,7 +1389,7 @@ func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetVideoChecked sends a checked request. // If an error occurs, it can be retrieved using GetVideoCookie.Check() func GetVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1410,7 +1410,7 @@ func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 7 // request opcode @@ -1463,7 +1463,7 @@ type GrabPortCookie struct { // GrabPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1474,7 +1474,7 @@ func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { // GrabPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1525,7 +1525,7 @@ func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 3 // request opcode @@ -1551,7 +1551,7 @@ type ListImageFormatsCookie struct { // ListImageFormats sends a checked request. // If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1562,7 +1562,7 @@ func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { // ListImageFormatsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1623,7 +1623,7 @@ func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 16 // request opcode @@ -1646,7 +1646,7 @@ type PutImageCookie struct { // PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1657,7 +1657,7 @@ func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutImageChecked sends a checked request. // If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1678,7 +1678,7 @@ func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 18 // request opcode @@ -1743,7 +1743,7 @@ type PutStillCookie struct { // PutStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1754,7 +1754,7 @@ func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutStillChecked sends a checked request. // If an error occurs, it can be retrieved using PutStillCookie.Check() func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1775,7 +1775,7 @@ func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 6 // request opcode @@ -1828,7 +1828,7 @@ type PutVideoCookie struct { // PutVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -1839,7 +1839,7 @@ func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutVideoChecked sends a checked request. // If an error occurs, it can be retrieved using PutVideoCookie.Check() func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -1860,7 +1860,7 @@ func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 5 // request opcode @@ -1913,7 +1913,7 @@ type QueryAdaptorsCookie struct { // QueryAdaptors sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -1924,7 +1924,7 @@ func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { // QueryAdaptorsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -1985,7 +1985,7 @@ func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 1 // request opcode @@ -2008,7 +2008,7 @@ type QueryBestSizeCookie struct { // QueryBestSize sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2019,7 +2019,7 @@ func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16 // QueryBestSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2077,7 +2077,7 @@ func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 12 // request opcode @@ -2121,7 +2121,7 @@ type QueryEncodingsCookie struct { // QueryEncodings sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2132,7 +2132,7 @@ func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { // QueryEncodingsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2193,7 +2193,7 @@ func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 2 // request opcode @@ -2216,7 +2216,7 @@ type QueryExtensionCookie struct { // QueryExtension sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn) QueryExtensionCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2227,7 +2227,7 @@ func QueryExtension(c *xgb.Conn) QueryExtensionCookie { // QueryExtensionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2285,7 +2285,7 @@ func queryExtensionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 0 // request opcode @@ -2305,7 +2305,7 @@ type QueryImageAttributesCookie struct { // QueryImageAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryImageAttributesCookie.Reply() func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2316,7 +2316,7 @@ func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Heigh // QueryImageAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryImageAttributesUnchecked(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2401,7 +2401,7 @@ func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16 b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 17 // request opcode @@ -2433,7 +2433,7 @@ type QueryPortAttributesCookie struct { // QueryPortAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -2444,7 +2444,7 @@ func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { // QueryPortAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -2509,7 +2509,7 @@ func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 15 // request opcode @@ -2532,7 +2532,7 @@ type SelectPortNotifyCookie struct { // SelectPortNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2543,7 +2543,7 @@ func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie // SelectPortNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2564,7 +2564,7 @@ func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 11 // request opcode @@ -2596,7 +2596,7 @@ type SelectVideoNotifyCookie struct { // SelectVideoNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2607,7 +2607,7 @@ func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) Select // SelectVideoNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2628,7 +2628,7 @@ func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 10 // request opcode @@ -2660,7 +2660,7 @@ type SetPortAttributeCookie struct { // SetPortAttribute sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2671,7 +2671,7 @@ func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32 // SetPortAttributeChecked sends a checked request. // If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2692,7 +2692,7 @@ func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Valu b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 13 // request opcode @@ -2721,7 +2721,7 @@ type ShmPutImageCookie struct { // ShmPutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2732,7 +2732,7 @@ func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gco // ShmPutImageChecked sends a checked request. // If an error occurs, it can be retrieved using ShmPutImageCookie.Check() func ShmPutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2753,7 +2753,7 @@ func shmPutImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xpr b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 19 // request opcode @@ -2826,7 +2826,7 @@ type StopVideoCookie struct { // StopVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2837,7 +2837,7 @@ func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie // StopVideoChecked sends a checked request. // If an error occurs, it can be retrieved using StopVideoCookie.Check() func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2858,7 +2858,7 @@ func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 9 // request opcode @@ -2884,7 +2884,7 @@ type UngrabPortCookie struct { // UngrabPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -2895,7 +2895,7 @@ func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie // UngrabPortChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabPortCookie.Check() func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { - if _, ok := c.Extensions["XVIDEO"]; !ok { + if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -2916,7 +2916,7 @@ func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO"] + buf[b] = c.Extensions["XVideo"] b += 1 buf[b] = 4 // request opcode diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index 5ab7108..cd82b33 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -203,7 +203,7 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -214,7 +214,7 @@ func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Sur // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -287,7 +287,7 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 2 // request opcode @@ -325,7 +325,7 @@ type CreateSubpictureCookie struct { // CreateSubpicture sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply() func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -336,7 +336,7 @@ func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, Xvi // CreateSubpictureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -418,7 +418,7 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 6 // request opcode @@ -453,7 +453,7 @@ type CreateSurfaceCookie struct { // CreateSurface sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -464,7 +464,7 @@ func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurf // CreateSurfaceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -525,7 +525,7 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 4 // request opcode @@ -551,7 +551,7 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -562,7 +562,7 @@ func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -583,7 +583,7 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 3 // request opcode @@ -606,7 +606,7 @@ type DestroySubpictureCookie struct { // DestroySubpicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -617,7 +617,7 @@ func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCo // DestroySubpictureChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySubpictureCookie.Check() func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -638,7 +638,7 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 7 // request opcode @@ -661,7 +661,7 @@ type DestroySurfaceCookie struct { // DestroySurface sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) @@ -672,7 +672,7 @@ func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { // DestroySurfaceChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) @@ -693,7 +693,7 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 5 // request opcode @@ -716,7 +716,7 @@ type ListSubpictureTypesCookie struct { // ListSubpictureTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply() func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -727,7 +727,7 @@ func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSub // ListSubpictureTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -788,7 +788,7 @@ func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 8 // request opcode @@ -814,7 +814,7 @@ type ListSurfaceTypesCookie struct { // ListSurfaceTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -825,7 +825,7 @@ func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { // ListSurfaceTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -886,7 +886,7 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 1 // request opcode @@ -909,7 +909,7 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(true, true) @@ -920,7 +920,7 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { - if _, ok := c.Extensions["XVIDEO-MOTIONCOMPENSATION"]; !ok { + if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } cookie := c.NewCookie(false, true) @@ -978,7 +978,7 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) - buf[b] = c.Extensions["XVIDEO-MOTIONCOMPENSATION"] + buf[b] = c.Extensions["XVideo-MotionCompensation"] b += 1 buf[b] = 0 // request opcode From 64c6e6170d86dd4b18d04c49888a6b8ac472c4d6 Mon Sep 17 00:00:00 2001 From: snyh Date: Mon, 30 Dec 2013 16:58:14 +0800 Subject: [PATCH 76/90] example/randr: check the GetOutputInfo's mode length (virtual head can have zero mode) --- nexgb/examples/randr/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index ad575ee..427aed6 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -45,10 +45,12 @@ func main() { log.Fatal(err) } - bestMode := info.Modes[0] - for _, mode := range resources.Modes { - if mode.Id == uint32(bestMode) { - fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) + if len(info.Modes) > 0 { + bestMode := info.Modes[0] + for _, mode := range resources.Modes { + if mode.Id == uint32(bestMode) { + fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) + } } } } From 1f8bd79abee5d96a41a934d1eb8c74e90ccbcc8f Mon Sep 17 00:00:00 2001 From: snyh Date: Tue, 31 Dec 2013 09:20:13 +0800 Subject: [PATCH 77/90] examples:randr use info.Connection to detect whether there has any Randr.Modes --- nexgb/examples/randr/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index 427aed6..414ef8d 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -45,7 +45,7 @@ func main() { log.Fatal(err) } - if len(info.Modes) > 0 { + if info.Connection == randr.ConnectionConnected { bestMode := info.Modes[0] for _, mode := range resources.Modes { if mode.Id == uint32(bestMode) { From a548d9d0f7b889627c43b18811357fad88760b2d Mon Sep 17 00:00:00 2001 From: aarzilli Date: Fri, 2 May 2014 15:09:23 +0200 Subject: [PATCH 78/90] Fix Issue #21: automatic calculation of alignment padding after lists --- nexgb/dri2/dri2.go | 7 +- nexgb/examples/randr/main.go | 2 +- nexgb/glx/glx.go | 93 ++++----------- nexgb/randr/randr.go | 199 +++++++++++++++++-------------- nexgb/record/record.go | 35 +++--- nexgb/render/render.go | 112 +++++++++-------- nexgb/res/res.go | 16 ++- nexgb/xcmisc/xcmisc.go | 1 - nexgb/xevie/xevie.go | 2 +- nexgb/xf86dri/xf86dri.go | 8 +- nexgb/xf86vidmode/xf86vidmode.go | 52 ++++---- nexgb/xfixes/xfixes.go | 12 +- nexgb/xgbgen/aligngap.go | 130 ++++++++++++++++++++ nexgb/xgbgen/context.go | 2 + nexgb/xgbgen/field.go | 32 +++-- nexgb/xgbgen/go.go | 18 ++- nexgb/xgbgen/go_list.go | 10 +- nexgb/xgbgen/go_request_reply.go | 30 +++-- nexgb/xgbgen/go_struct.go | 2 +- nexgb/xgbgen/request_reply.go | 12 +- nexgb/xgbgen/size.go | 13 +- nexgb/xgbgen/translation.go | 2 +- nexgb/xgbgen/type.go | 12 +- nexgb/xinerama/xinerama.go | 2 +- nexgb/xprint/xprint.go | 20 +--- nexgb/xproto/xproto.go | 169 +++++++++++++------------- nexgb/xproto/xproto_test.go | 17 +++ nexgb/xselinux/xselinux.go | 20 ++-- nexgb/xv/xv.go | 67 ++++++----- nexgb/xvmc/xvmc.go | 7 +- 30 files changed, 630 insertions(+), 474 deletions(-) create mode 100644 nexgb/xgbgen/aligngap.go diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 6cec3d0..5ad0306 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -76,7 +76,7 @@ func (v AttachFormat) Bytes() []byte { xgb.Put32(buf[b:], v.Format) b += 4 - return buf + return buf[:b] } // AttachFormatListBytes writes a list of AttachFormat values to a byte slice. @@ -281,7 +281,7 @@ func (v DRI2Buffer) Bytes() []byte { xgb.Put32(buf[b:], v.Flags) b += 4 - return buf + return buf[:b] } // DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice. @@ -567,7 +567,7 @@ func connectReply(buf []byte) *ConnectReply { v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:]) - b += xgb.Pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))) + b += int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) { byteString := make([]byte, v.DeviceNameLength) @@ -914,7 +914,6 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta xgb.Put32(buf[b:], Attachments[i]) b += 4 } - b = xgb.Pad(b) return buf } diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index 414ef8d..ac6fb7a 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -63,7 +63,7 @@ func main() { if err != nil { log.Fatal(err) } - fmt.Printf("X: %d, Y: %d, Width: %d, Height: %d\n", + fmt.Printf("%v, X: %d, Y: %d, Width: %d, Height: %d\n", info.X, info.Y, info.Width, info.Height) } diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 979d577..0951765 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -1097,7 +1097,6 @@ func areTexturesResidentReply(buf []byte) *AreTexturesResidentReply { } b += 1 } - b = xgb.Pad(b) return v } @@ -1128,7 +1127,6 @@ func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Tex xgb.Put32(buf[b:], Textures[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1192,7 +1190,6 @@ func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs xgb.Put32(buf[b:], Attribs[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1256,7 +1253,7 @@ func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, St b += 4 copy(buf[b:], String[:StrLen]) - b += xgb.Pad(int(StrLen)) + b += int(StrLen) return buf } @@ -1475,7 +1472,6 @@ func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbcon xgb.Put32(buf[b:], Attribs[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1685,7 +1681,6 @@ func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer xgb.Put32(buf[b:], Attribs[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1758,7 +1753,6 @@ func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap x xgb.Put32(buf[b:], Attribs[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1831,7 +1825,6 @@ func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window x xgb.Put32(buf[b:], Attribs[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -1956,7 +1949,6 @@ func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids [] xgb.Put32(buf[b:], Ids[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -2020,7 +2012,6 @@ func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures xgb.Put32(buf[b:], Textures[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -2714,7 +2705,6 @@ func genQueriesARBReply(buf []byte) *GenQueriesARBReply { v.Data[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -2812,7 +2802,6 @@ func genTexturesReply(buf []byte) *GenTexturesReply { v.Data[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -2929,7 +2918,6 @@ func getBooleanvReply(buf []byte) *GetBooleanvReply { } b += 1 } - b = xgb.Pad(b) return v } @@ -3027,7 +3015,6 @@ func getClipPlaneReply(buf []byte) *GetClipPlaneReply { v.Data[i] = Float64(xgb.Get64(buf[b:])) b += 8 } - b = xgb.Pad(b) return v } @@ -3129,7 +3116,7 @@ func getColorTableReply(buf []byte) *GetColorTableReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -3251,7 +3238,6 @@ func getColorTableParameterfvReply(buf []byte) *GetColorTableParameterfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -3363,7 +3349,6 @@ func getColorTableParameterivReply(buf []byte) *GetColorTableParameterivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -3468,7 +3453,7 @@ func getCompressedTexImageARBReply(buf []byte) *GetCompressedTexImageARBReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -3577,7 +3562,7 @@ func getConvolutionFilterReply(buf []byte) *GetConvolutionFilterReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -3699,7 +3684,6 @@ func getConvolutionParameterfvReply(buf []byte) *GetConvolutionParameterfvReply v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -3811,7 +3795,6 @@ func getConvolutionParameterivReply(buf []byte) *GetConvolutionParameterivReply v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -3923,7 +3906,6 @@ func getDoublevReply(buf []byte) *GetDoublevReply { v.Data[i] = Float64(xgb.Get64(buf[b:])) b += 8 } - b = xgb.Pad(b) return v } @@ -4025,7 +4007,6 @@ func getDrawableAttributesReply(buf []byte) *GetDrawableAttributesReply { v.Attribs[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -4216,7 +4197,6 @@ func getFBConfigsReply(buf []byte) *GetFBConfigsReply { v.PropertyList[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -4322,7 +4302,6 @@ func getFloatvReply(buf []byte) *GetFloatvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4424,7 +4403,7 @@ func getHistogramReply(buf []byte) *GetHistogramReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -4553,7 +4532,6 @@ func getHistogramParameterfvReply(buf []byte) *GetHistogramParameterfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4665,7 +4643,6 @@ func getHistogramParameterivReply(buf []byte) *GetHistogramParameterivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4777,7 +4754,6 @@ func getIntegervReply(buf []byte) *GetIntegervReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4886,7 +4862,6 @@ func getLightfvReply(buf []byte) *GetLightfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4998,7 +4973,6 @@ func getLightivReply(buf []byte) *GetLightivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5110,7 +5084,6 @@ func getMapdvReply(buf []byte) *GetMapdvReply { v.Data[i] = Float64(xgb.Get64(buf[b:])) b += 8 } - b = xgb.Pad(b) return v } @@ -5222,7 +5195,6 @@ func getMapfvReply(buf []byte) *GetMapfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5334,7 +5306,6 @@ func getMapivReply(buf []byte) *GetMapivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5446,7 +5417,6 @@ func getMaterialfvReply(buf []byte) *GetMaterialfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5558,7 +5528,6 @@ func getMaterialivReply(buf []byte) *GetMaterialivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5656,7 +5625,7 @@ func getMinmaxReply(buf []byte) *GetMinmaxReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -5785,7 +5754,6 @@ func getMinmaxParameterfvReply(buf []byte) *GetMinmaxParameterfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5897,7 +5865,6 @@ func getMinmaxParameterivReply(buf []byte) *GetMinmaxParameterivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -6009,7 +5976,6 @@ func getPixelMapfvReply(buf []byte) *GetPixelMapfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -6118,7 +6084,6 @@ func getPixelMapuivReply(buf []byte) *GetPixelMapuivReply { v.Data[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -6227,7 +6192,6 @@ func getPixelMapusvReply(buf []byte) *GetPixelMapusvReply { v.Data[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) return v } @@ -6322,7 +6286,7 @@ func getPolygonStippleReply(buf []byte) *GetPolygonStippleReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -6435,7 +6399,6 @@ func getQueryObjectivARBReply(buf []byte) *GetQueryObjectivARBReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -6547,7 +6510,6 @@ func getQueryObjectuivARBReply(buf []byte) *GetQueryObjectuivARBReply { v.Data[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -6659,7 +6621,6 @@ func getQueryivARBReply(buf []byte) *GetQueryivARBReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -6768,7 +6729,7 @@ func getSeparableFilterReply(buf []byte) *GetSeparableFilterReply { v.RowsAndCols = make([]byte, (int(v.Length) * 4)) copy(v.RowsAndCols[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -6995,7 +6956,6 @@ func getTexEnvfvReply(buf []byte) *GetTexEnvfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7107,7 +7067,6 @@ func getTexEnvivReply(buf []byte) *GetTexEnvivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7219,7 +7178,6 @@ func getTexGendvReply(buf []byte) *GetTexGendvReply { v.Data[i] = Float64(xgb.Get64(buf[b:])) b += 8 } - b = xgb.Pad(b) return v } @@ -7331,7 +7289,6 @@ func getTexGenfvReply(buf []byte) *GetTexGenfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7443,7 +7400,6 @@ func getTexGenivReply(buf []byte) *GetTexGenivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7556,7 +7512,7 @@ func getTexImageReply(buf []byte) *GetTexImageReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -7681,7 +7637,6 @@ func getTexLevelParameterfvReply(buf []byte) *GetTexLevelParameterfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7796,7 +7751,6 @@ func getTexLevelParameterivReply(buf []byte) *GetTexLevelParameterivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -7911,7 +7865,6 @@ func getTexParameterfvReply(buf []byte) *GetTexParameterfvReply { v.Data[i] = Float32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -8023,7 +7976,6 @@ func getTexParameterivReply(buf []byte) *GetTexParameterivReply { v.Data[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -8132,7 +8084,6 @@ func getVisualConfigsReply(buf []byte) *GetVisualConfigsReply { v.PropertyList[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -8979,7 +8930,6 @@ func queryContextReply(buf []byte) *QueryContextReply { v.Attribs[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -9368,7 +9318,7 @@ func readPixelsReply(buf []byte) *ReadPixelsReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -9480,7 +9430,7 @@ func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { b += 4 copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) return buf } @@ -9547,7 +9497,7 @@ func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, R b += 4 copy(buf[b:], Data[:DataLen]) - b += xgb.Pad(int(DataLen)) + b += int(DataLen) return buf } @@ -9632,7 +9582,6 @@ func renderModeReply(buf []byte) *RenderModeReply { v.Data[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -9788,13 +9737,12 @@ func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uin xgb.Put32(buf[b:], GlVersions[i]) b += 4 } - b = xgb.Pad(b) copy(buf[b:], GlExtensionString[:GlStrLen]) - b += xgb.Pad(int(GlStrLen)) + b += int(GlStrLen) copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += xgb.Pad(int(GlxStrLen)) + b += int(GlxStrLen) return buf } @@ -9867,13 +9815,12 @@ func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint xgb.Put32(buf[b:], GlVersions[i]) b += 4 } - b = xgb.Pad(b) copy(buf[b:], GlExtensionString[:GlStrLen]) - b += xgb.Pad(int(GlStrLen)) + b += int(GlStrLen) copy(buf[b:], GlxExtensionString[:GlxStrLen]) - b += xgb.Pad(int(GlxStrLen)) + b += int(GlxStrLen) return buf } @@ -10059,7 +10006,7 @@ func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, b += 4 copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) return buf } @@ -10131,11 +10078,11 @@ func vendorPrivateWithReplyReply(buf []byte) *VendorPrivateWithReplyReply { v.Data1 = make([]byte, 24) copy(v.Data1[:24], buf[b:]) - b += xgb.Pad(int(24)) + b += int(24) v.Data2 = make([]byte, (int(v.Length) * 4)) copy(v.Data2[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -10163,7 +10110,7 @@ func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag Co b += 4 copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) return buf } diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index db45a23..20dc62a 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -331,7 +331,7 @@ func (v CrtcChange) Bytes() []byte { xgb.Put16(buf[b:], v.Height) b += 2 - return buf + return buf[:b] } // CrtcChangeListBytes writes a list of CrtcChange values to a byte slice. @@ -489,7 +489,7 @@ func (v ModeInfo) Bytes() []byte { xgb.Put32(buf[b:], v.ModeFlags) b += 4 - return buf + return buf[:b] } // ModeInfoListBytes writes a list of ModeInfo values to a byte slice. @@ -504,6 +504,15 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return xgb.Pad(b) } +const ( + NotifyCrtcChange = 0 + NotifyOutputChange = 1 + NotifyOutputProperty = 2 + NotifyProviderChange = 3 + NotifyProviderProperty = 4 + NotifyResourceChange = 5 +) + // Notify is the event number for a NotifyEvent. const Notify = 1 @@ -572,15 +581,6 @@ func init() { xgb.NewExtEventFuncs["RANDR"][1] = NotifyEventNew } -const ( - NotifyCrtcChange = 0 - NotifyOutputChange = 1 - NotifyOutputProperty = 2 - NotifyProviderChange = 3 - NotifyProviderProperty = 4 - NotifyResourceChange = 5 -) - // NotifyDataUnion is a represention of the NotifyDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). @@ -1034,7 +1034,7 @@ func (v OutputChange) Bytes() []byte { buf[b] = v.SubpixelOrder b += 1 - return buf + return buf[:b] } // OutputChangeListBytes writes a list of OutputChange values to a byte slice. @@ -1114,7 +1114,7 @@ func (v OutputProperty) Bytes() []byte { b += 11 // padding - return buf + return buf[:b] } // OutputPropertyListBytes writes a list of OutputProperty values to a byte slice. @@ -1197,7 +1197,7 @@ func (v ProviderChange) Bytes() []byte { b += 16 // padding - return buf + return buf[:b] } // ProviderChangeListBytes writes a list of ProviderChange values to a byte slice. @@ -1277,7 +1277,7 @@ func (v ProviderProperty) Bytes() []byte { b += 11 // padding - return buf + return buf[:b] } // ProviderPropertyListBytes writes a list of ProviderProperty values to a byte slice. @@ -1309,7 +1309,6 @@ func RefreshRatesRead(buf []byte, v *RefreshRates) int { v.Rates[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) return b } @@ -1336,9 +1335,8 @@ func (v RefreshRates) Bytes() []byte { xgb.Put16(buf[b:], v.Rates[i]) b += 2 } - b = xgb.Pad(b) - return buf + return buf[:b] } // RefreshRatesListBytes writes a list of RefreshRates values to a byte slice. @@ -1406,7 +1404,7 @@ func (v ResourceChange) Bytes() []byte { b += 20 // padding - return buf + return buf[:b] } // ResourceChangeListBytes writes a list of ResourceChange values to a byte slice. @@ -1621,7 +1619,7 @@ func (v ScreenSize) Bytes() []byte { xgb.Put16(buf[b:], v.Mheight) b += 2 - return buf + return buf[:b] } // ScreenSizeListBytes writes a list of ScreenSize values to a byte slice. @@ -1802,7 +1800,7 @@ func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato b += 4 copy(buf[b:], Data[:((int(NumUnits)*int(Format))/8)]) - b += xgb.Pad(int(((int(NumUnits) * int(Format)) / 8))) + b += int(((int(NumUnits) * int(Format)) / 8)) return buf } @@ -1877,7 +1875,7 @@ func changeProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xpro b += 4 copy(buf[b:], Data[:(int(NumItems)*(int(Format)/8))]) - b += xgb.Pad(int((int(NumItems) * (int(Format) / 8)))) + b += int((int(NumItems) * (int(Format) / 8))) return buf } @@ -1957,7 +1955,6 @@ func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto. xgb.Put32(buf[b:], uint32(Values[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -2037,7 +2034,6 @@ func configureProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property x xgb.Put32(buf[b:], uint32(Values[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -2137,7 +2133,7 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam } copy(buf[b:], Name[:len(Name)]) - b += xgb.Pad(int(len(Name))) + b += int(len(Name)) return buf } @@ -2405,9 +2401,11 @@ type GetCrtcGammaReply struct { // padding: 1 bytes Size uint16 // padding: 22 bytes - Red []uint16 // size: xgb.Pad((int(Size) * 2)) + Red []uint16 // size: xgb.Pad((int(Size) * 2)) + // alignment gap to multiple of 2 Green []uint16 // size: xgb.Pad((int(Size) * 2)) - Blue []uint16 // size: xgb.Pad((int(Size) * 2)) + // alignment gap to multiple of 2 + Blue []uint16 // size: xgb.Pad((int(Size) * 2)) } // Reply blocks and returns the reply data for a GetCrtcGamma request. @@ -2445,21 +2443,22 @@ func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { v.Red[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap v.Green = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Green[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap v.Blue = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Blue[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) return v } @@ -2620,7 +2619,8 @@ type GetCrtcInfoReply struct { NumOutputs uint16 NumPossibleOutputs uint16 Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) + // alignment gap to multiple of 4 + Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) } // Reply blocks and returns the reply data for a GetCrtcInfo request. @@ -2684,14 +2684,14 @@ func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Possible = make([]Output, v.NumPossibleOutputs) for i := 0; i < int(v.NumPossibleOutputs); i++ { v.Possible[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -2762,10 +2762,12 @@ type GetCrtcTransformReply struct { PendingNparams uint16 CurrentLen uint16 CurrentNparams uint16 - PendingFilterName string // size: xgb.Pad((int(PendingLen) * 1)) + PendingFilterName string // size: xgb.Pad((int(PendingLen) * 1)) + // alignment gap to multiple of 4 PendingParams []render.Fixed // size: xgb.Pad((int(PendingNparams) * 4)) CurrentFilterName string // size: xgb.Pad((int(CurrentLen) * 1)) - CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) + // alignment gap to multiple of 4 + CurrentParams []render.Fixed // size: xgb.Pad((int(CurrentNparams) * 4)) } // Reply blocks and returns the reply data for a GetCrtcTransform request. @@ -2829,12 +2831,13 @@ func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { b += int(v.PendingLen) } + b = (b + 3) & ^3 // alignment gap + v.PendingParams = make([]render.Fixed, v.PendingNparams) for i := 0; i < int(v.PendingNparams); i++ { v.PendingParams[i] = render.Fixed(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) { byteString := make([]byte, v.CurrentLen) @@ -2843,12 +2846,13 @@ func getCrtcTransformReply(buf []byte) *GetCrtcTransformReply { b += int(v.CurrentLen) } + b = (b + 3) & ^3 // alignment gap + v.CurrentParams = make([]render.Fixed, v.CurrentNparams) for i := 0; i < int(v.CurrentNparams); i++ { v.CurrentParams[i] = render.Fixed(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -2918,10 +2922,12 @@ type GetOutputInfoReply struct { NumPreferred uint16 NumClones uint16 NameLen uint16 - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Modes []Mode // size: xgb.Pad((int(NumModes) * 4)) - Clones []Output // size: xgb.Pad((int(NumClones) * 4)) - Name []byte // size: xgb.Pad((int(NameLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + // alignment gap to multiple of 4 + Modes []Mode // size: xgb.Pad((int(NumModes) * 4)) + // alignment gap to multiple of 4 + Clones []Output // size: xgb.Pad((int(NumClones) * 4)) + Name []byte // size: xgb.Pad((int(NameLen) * 1)) } // Reply blocks and returns the reply data for a GetOutputInfo request. @@ -2988,25 +2994,26 @@ func getOutputInfoReply(buf []byte) *GetOutputInfoReply { v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Modes = make([]Mode, v.NumModes) for i := 0; i < int(v.NumModes); i++ { v.Modes[i] = Mode(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Clones = make([]Output, v.NumClones) for i := 0; i < int(v.NumClones); i++ { v.Clones[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) v.Name = make([]byte, v.NameLen) copy(v.Name[:v.NameLen], buf[b:]) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) return v } @@ -3202,7 +3209,7 @@ func getOutputPropertyReply(buf []byte) *GetOutputPropertyReply { v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) - b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + b += int((int(v.NumItems) * (int(v.Format) / 8))) return v } @@ -3433,11 +3440,14 @@ type GetProviderInfoReply struct { NumAssociatedProviders uint16 NameLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - AssociatedProviders []Provider // size: xgb.Pad((int(NumAssociatedProviders) * 4)) - AssociatedCapability []uint32 // size: xgb.Pad((int(NumAssociatedProviders) * 4)) - Name string // size: xgb.Pad((int(NameLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + // alignment gap to multiple of 4 + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + // alignment gap to multiple of 4 + AssociatedProviders []Provider // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + // alignment gap to multiple of 4 + AssociatedCapability []uint32 // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Reply blocks and returns the reply data for a GetProviderInfo request. @@ -3491,28 +3501,30 @@ func getProviderInfoReply(buf []byte) *GetProviderInfoReply { v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.AssociatedProviders = make([]Provider, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedProviders[i] = Provider(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.AssociatedCapability = make([]uint32, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedCapability[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) { byteString := make([]byte, v.NameLen) @@ -3627,7 +3639,7 @@ func getProviderPropertyReply(buf []byte) *GetProviderPropertyReply { v.Data = make([]byte, (int(v.NumItems) * (int(v.Format) / 8))) copy(v.Data[:(int(v.NumItems)*(int(v.Format)/8))], buf[b:]) - b += xgb.Pad(int((int(v.NumItems) * (int(v.Format) / 8)))) + b += int((int(v.NumItems) * (int(v.Format) / 8))) return v } @@ -3758,7 +3770,6 @@ func getProvidersReply(buf []byte) *GetProvidersReply { v.Providers[i] = Provider(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -3826,7 +3837,8 @@ type GetScreenInfoReply struct { Rate uint16 NInfo uint16 // padding: 2 bytes - Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) + Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) + // alignment gap to multiple of 2 Rates []RefreshRates // size: RefreshRatesListSize(Rates) } @@ -3885,6 +3897,8 @@ func getScreenInfoReply(buf []byte) *GetScreenInfoReply { v.Sizes = make([]ScreenSize, v.NSizes) b += ScreenSizeReadList(buf[b:], v.Sizes) + b = (b + 1) & ^1 // alignment gap + v.Rates = make([]RefreshRates, (int(v.NInfo) - int(v.NSizes))) b += RefreshRatesReadList(buf[b:], v.Rates) @@ -3952,10 +3966,12 @@ type GetScreenResourcesReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + // alignment gap to multiple of 4 + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + // alignment gap to multiple of 4 + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } // Reply blocks and returns the reply data for a GetScreenResources request. @@ -4008,21 +4024,23 @@ func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Modes = make([]ModeInfo, v.NumModes) b += ModeInfoReadList(buf[b:], v.Modes) v.Names = make([]byte, v.NamesLen) copy(v.Names[:v.NamesLen], buf[b:]) - b += xgb.Pad(int(v.NamesLen)) + b += int(v.NamesLen) return v } @@ -4088,10 +4106,12 @@ type GetScreenResourcesCurrentReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + // alignment gap to multiple of 4 + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + // alignment gap to multiple of 4 + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } // Reply blocks and returns the reply data for a GetScreenResourcesCurrent request. @@ -4144,21 +4164,23 @@ func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply v.Crtcs[i] = Crtc(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Modes = make([]ModeInfo, v.NumModes) b += ModeInfoReadList(buf[b:], v.Modes) v.Names = make([]byte, v.NamesLen) copy(v.Names[:v.NamesLen], buf[b:]) - b += xgb.Pad(int(v.NamesLen)) + b += int(v.NamesLen) return v } @@ -4360,7 +4382,6 @@ func listOutputPropertiesReply(buf []byte) *ListOutputPropertiesReply { v.Atoms[i] = xproto.Atom(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4459,7 +4480,6 @@ func listProviderPropertiesReply(buf []byte) *ListProviderPropertiesReply { v.Atoms[i] = xproto.Atom(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4578,7 +4598,6 @@ func queryOutputPropertyReply(buf []byte) *QueryOutputPropertyReply { v.ValidValues[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -4700,7 +4719,6 @@ func queryProviderPropertyReply(buf []byte) *QueryProviderPropertyReply { v.ValidValues[i] = int32(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -5001,7 +5019,6 @@ func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Co xgb.Put32(buf[b:], uint32(Outputs[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -5042,7 +5059,7 @@ func (cook SetCrtcGammaCookie) Check() error { // Write request to wire for SetCrtcGamma // setCrtcGammaRequest writes a SetCrtcGamma request to a byte slice. func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) + size := xgb.Pad((((((12 + xgb.Pad((int(Size) * 2))) + 2) + xgb.Pad((int(Size) * 2))) + 2) + xgb.Pad((int(Size) * 2)))) b := 0 buf := make([]byte, size) @@ -5052,7 +5069,7 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree buf[b] = 24 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Crtc)) @@ -5067,21 +5084,24 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree xgb.Put16(buf[b:], Red[i]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap for i := 0; i < int(Size); i++ { xgb.Put16(buf[b:], Green[i]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap for i := 0; i < int(Size); i++ { xgb.Put16(buf[b:], Blue[i]) b += 2 } - b = xgb.Pad(b) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // SetCrtcTransformCookie is a cookie used only for SetCrtcTransform requests. @@ -5120,7 +5140,7 @@ func (cook SetCrtcTransformCookie) Check() error { // Write request to wire for SetCrtcTransform // setCrtcTransformRequest writes a SetCrtcTransform request to a byte slice. func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) []byte { - size := xgb.Pad(((48 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(FilterParams) * 4)))) + size := xgb.Pad((((48 + xgb.Pad((int(FilterLen) * 1))) + 4) + xgb.Pad((len(FilterParams) * 4)))) b := 0 buf := make([]byte, size) @@ -5130,7 +5150,7 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, buf[b] = 26 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Crtc)) @@ -5148,15 +5168,18 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, b += 2 // padding copy(buf[b:], FilterName[:FilterLen]) - b += xgb.Pad(int(FilterLen)) + b += int(FilterLen) + + b = (b + 3) & ^3 // alignment gap for i := 0; i < int(len(FilterParams)); i++ { xgb.Put32(buf[b:], uint32(FilterParams[i])) b += 4 } - b = xgb.Pad(b) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // SetOutputPrimaryCookie is a cookie used only for SetOutputPrimary requests. diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 3777422..30be090 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -133,7 +133,7 @@ func (v ClientInfo) Bytes() []byte { b += RangeListBytes(buf[b:], v.Ranges) - return buf + return buf[:b] } // ClientInfoListBytes writes a list of ClientInfo values to a byte slice. @@ -222,7 +222,7 @@ func (v ExtRange) Bytes() []byte { b += len(structBytes) } - return buf + return buf[:b] } // ExtRangeListBytes writes a list of ExtRange values to a byte slice. @@ -368,7 +368,7 @@ func (v Range) Bytes() []byte { } b += 1 - return buf + return buf[:b] } // RangeListBytes writes a list of Range values to a byte slice. @@ -422,7 +422,7 @@ func (v Range16) Bytes() []byte { xgb.Put16(buf[b:], v.Last) b += 2 - return buf + return buf[:b] } // Range16ListBytes writes a list of Range16 values to a byte slice. @@ -476,7 +476,7 @@ func (v Range8) Bytes() []byte { buf[b] = v.Last b += 1 - return buf + return buf[:b] } // Range8ListBytes writes a list of Range8 values to a byte slice. @@ -551,7 +551,7 @@ func (cook CreateContextCookie) Check() error { // Write request to wire for CreateContext // createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { - size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) + size := xgb.Pad((((20 + xgb.Pad((int(NumClientSpecs) * 4))) + 4) + xgb.Pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -561,7 +561,7 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea buf[b] = 1 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Context)) @@ -582,11 +582,14 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea xgb.Put32(buf[b:], uint32(ClientSpecs[i])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += RangeListBytes(buf[b:], Ranges) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // DisableContextCookie is a cookie used only for DisableContext requests. @@ -737,7 +740,7 @@ func enableContextReply(buf []byte) *EnableContextReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -1057,7 +1060,7 @@ func (cook RegisterClientsCookie) Check() error { // Write request to wire for RegisterClients // registerClientsRequest writes a RegisterClients request to a byte slice. func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { - size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) + size := xgb.Pad((((20 + xgb.Pad((int(NumClientSpecs) * 4))) + 4) + xgb.Pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -1067,7 +1070,7 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH buf[b] = 2 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Context)) @@ -1088,11 +1091,14 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH xgb.Put32(buf[b:], uint32(ClientSpecs[i])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += RangeListBytes(buf[b:], Ranges) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // UnregisterClientsCookie is a cookie used only for UnregisterClients requests. @@ -1154,7 +1160,6 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3 xgb.Put32(buf[b:], uint32(ClientSpecs[i])) b += 4 } - b = xgb.Pad(b) return buf } diff --git a/nexgb/render/render.go b/nexgb/render/render.go index 80f4be7..f90065b 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -76,7 +76,7 @@ func (v Animcursorelt) Bytes() []byte { xgb.Put32(buf[b:], v.Delay) b += 4 - return buf + return buf[:b] } // AnimcursoreltListBytes writes a list of Animcursorelt values to a byte slice. @@ -144,7 +144,7 @@ func (v Color) Bytes() []byte { xgb.Put16(buf[b:], v.Alpha) b += 2 - return buf + return buf[:b] } // ColorListBytes writes a list of Color values to a byte slice. @@ -256,7 +256,7 @@ func (v Directformat) Bytes() []byte { xgb.Put16(buf[b:], v.AlphaMask) b += 2 - return buf + return buf[:b] } // DirectformatListBytes writes a list of Directformat values to a byte slice. @@ -434,7 +434,7 @@ func (v Glyphinfo) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.YOff)) b += 2 - return buf + return buf[:b] } // GlyphinfoListBytes writes a list of Glyphinfo values to a byte slice. @@ -519,7 +519,7 @@ func (v Indexvalue) Bytes() []byte { xgb.Put16(buf[b:], v.Alpha) b += 2 - return buf + return buf[:b] } // IndexvalueListBytes writes a list of Indexvalue values to a byte slice. @@ -579,7 +579,7 @@ func (v Linefix) Bytes() []byte { b += len(structBytes) } - return buf + return buf[:b] } // LinefixListBytes writes a list of Linefix values to a byte slice. @@ -802,7 +802,7 @@ func (v Pictdepth) Bytes() []byte { b += PictvisualListBytes(buf[b:], v.Visuals) - return buf + return buf[:b] } // PictdepthListBytes writes a list of Pictdepth values to a byte slice. @@ -904,7 +904,7 @@ func (v Pictforminfo) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Colormap)) b += 4 - return buf + return buf[:b] } // PictforminfoListBytes writes a list of Pictforminfo values to a byte slice. @@ -964,7 +964,7 @@ func (v Pictscreen) Bytes() []byte { b += PictdepthListBytes(buf[b:], v.Depths) - return buf + return buf[:b] } // PictscreenListBytes writes a list of Pictscreen values to a byte slice. @@ -1087,7 +1087,7 @@ func (v Pictvisual) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Format)) b += 4 - return buf + return buf[:b] } // PictvisualListBytes writes a list of Pictvisual values to a byte slice. @@ -1141,7 +1141,7 @@ func (v Pointfix) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Y)) b += 4 - return buf + return buf[:b] } // PointfixListBytes writes a list of Pointfix values to a byte slice. @@ -1219,7 +1219,7 @@ func (v Spanfix) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Y)) b += 4 - return buf + return buf[:b] } // SpanfixListBytes writes a list of Spanfix values to a byte slice. @@ -1331,7 +1331,7 @@ func (v Transform) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Matrix33)) b += 4 - return buf + return buf[:b] } // TransformListBytes writes a list of Transform values to a byte slice. @@ -1391,7 +1391,7 @@ func (v Trap) Bytes() []byte { b += len(structBytes) } - return buf + return buf[:b] } // TrapListBytes writes a list of Trap values to a byte slice. @@ -1465,7 +1465,7 @@ func (v Trapezoid) Bytes() []byte { b += len(structBytes) } - return buf + return buf[:b] } // TrapezoidListBytes writes a list of Trapezoid values to a byte slice. @@ -1535,7 +1535,7 @@ func (v Triangle) Bytes() []byte { b += len(structBytes) } - return buf + return buf[:b] } // TriangleListBytes writes a list of Triangle values to a byte slice. @@ -1610,7 +1610,7 @@ func (cook AddGlyphsCookie) Check() error { // Write request to wire for AddGlyphs // addGlyphsRequest writes a AddGlyphs request to a byte slice. func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { - size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) + size := xgb.Pad(((((12 + xgb.Pad((int(GlyphsLen) * 4))) + 4) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -1620,7 +1620,7 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids buf[b] = 20 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Glyphset)) @@ -1633,14 +1633,17 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids xgb.Put32(buf[b:], Glyphids[i]) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += GlyphinfoListBytes(buf[b:], Glyphs) copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // AddTrapsCookie is a cookie used only for AddTraps requests. @@ -1932,7 +1935,7 @@ func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma b += 2 copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) + b += int(len(Glyphcmds)) return buf } @@ -2010,7 +2013,7 @@ func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma b += 2 copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) + b += int(len(Glyphcmds)) return buf } @@ -2088,7 +2091,7 @@ func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Mas b += 2 copy(buf[b:], Glyphcmds[:len(Glyphcmds)]) - b += xgb.Pad(int(len(Glyphcmds))) + b += int(len(Glyphcmds)) return buf } @@ -2186,7 +2189,7 @@ func (cook CreateConicalGradientCookie) Check() error { // Write request to wire for CreateConicalGradient // createConicalGradientRequest writes a CreateConicalGradient request to a byte slice. func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad((((24 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2196,7 +2199,7 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, buf[b] = 36 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2218,11 +2221,14 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, xgb.Put32(buf[b:], uint32(Stops[i])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += ColorListBytes(buf[b:], Colors) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // CreateCursorCookie is a cookie used only for CreateCursor requests. @@ -2383,7 +2389,7 @@ func (cook CreateLinearGradientCookie) Check() error { // Write request to wire for CreateLinearGradient // createLinearGradientRequest writes a CreateLinearGradient request to a byte slice. func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad((((28 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2393,7 +2399,7 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P buf[b] = 34 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2418,11 +2424,14 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P xgb.Put32(buf[b:], uint32(Stops[i])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += ColorListBytes(buf[b:], Colors) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // CreatePictureCookie is a cookie used only for CreatePicture requests. @@ -2530,7 +2539,7 @@ func (cook CreateRadialGradientCookie) Check() error { // Write request to wire for CreateRadialGradient // createRadialGradientRequest writes a CreateRadialGradient request to a byte slice. func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad((((36 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2540,7 +2549,7 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O buf[b] = 35 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2571,11 +2580,14 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O xgb.Put32(buf[b:], uint32(Stops[i])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap b += ColorListBytes(buf[b:], Colors) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // CreateSolidFillCookie is a cookie used only for CreateSolidFill requests. @@ -2818,7 +2830,6 @@ func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { xgb.Put32(buf[b:], uint32(Glyphs[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -2955,7 +2966,6 @@ func queryFiltersReply(buf []byte) *QueryFiltersReply { v.Aliases[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) v.Filters = make([]xproto.Str, v.NumFilters) b += xproto.StrReadList(buf[b:], v.Filters) @@ -3023,9 +3033,11 @@ type QueryPictFormatsReply struct { NumVisuals uint32 NumSubpixel uint32 // padding: 4 bytes - Formats []Pictforminfo // size: xgb.Pad((int(NumFormats) * 28)) - Screens []Pictscreen // size: PictscreenListSize(Screens) - Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) + Formats []Pictforminfo // size: xgb.Pad((int(NumFormats) * 28)) + // alignment gap to multiple of 4 + Screens []Pictscreen // size: PictscreenListSize(Screens) + // alignment gap to multiple of 4 + Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) } // Reply blocks and returns the reply data for a QueryPictFormats request. @@ -3073,15 +3085,18 @@ func queryPictFormatsReply(buf []byte) *QueryPictFormatsReply { v.Formats = make([]Pictforminfo, v.NumFormats) b += PictforminfoReadList(buf[b:], v.Formats) + b = (b + 3) & ^3 // alignment gap + v.Screens = make([]Pictscreen, v.NumScreens) b += PictscreenReadList(buf[b:], v.Screens) + b = (b + 3) & ^3 // alignment gap + v.Subpixels = make([]uint32, v.NumSubpixel) for i := 0; i < int(v.NumSubpixel); i++ { v.Subpixels[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -3455,7 +3470,7 @@ func (cook SetPictureFilterCookie) Check() error { // Write request to wire for SetPictureFilter // setPictureFilterRequest writes a SetPictureFilter request to a byte slice. func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) []byte { - size := xgb.Pad(((12 + xgb.Pad((int(FilterLen) * 1))) + xgb.Pad((len(Values) * 4)))) + size := xgb.Pad((((12 + xgb.Pad((int(FilterLen) * 1))) + 4) + xgb.Pad((len(Values) * 4)))) b := 0 buf := make([]byte, size) @@ -3465,7 +3480,7 @@ func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Fil buf[b] = 30 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -3477,15 +3492,18 @@ func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Fil b += 2 // padding copy(buf[b:], Filter[:FilterLen]) - b += xgb.Pad(int(FilterLen)) + b += int(FilterLen) + + b = (b + 3) & ^3 // alignment gap for i := 0; i < int(len(Values)); i++ { xgb.Put32(buf[b:], uint32(Values[i])) b += 4 } - b = xgb.Pad(b) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // SetPictureTransformCookie is a cookie used only for SetPictureTransform requests. diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 8311f95..dd53857 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -76,7 +76,7 @@ func (v Client) Bytes() []byte { xgb.Put32(buf[b:], v.ResourceMask) b += 4 - return buf + return buf[:b] } // ClientListBytes writes a list of Client values to a byte slice. @@ -135,7 +135,7 @@ func (v ClientIdSpec) Bytes() []byte { xgb.Put32(buf[b:], v.Mask) b += 4 - return buf + return buf[:b] } // ClientIdSpecListBytes writes a list of ClientIdSpec values to a byte slice. @@ -171,7 +171,6 @@ func ClientIdValueRead(buf []byte, v *ClientIdValue) int { v.Value[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return b } @@ -204,9 +203,8 @@ func (v ClientIdValue) Bytes() []byte { xgb.Put32(buf[b:], v.Value[i]) b += 4 } - b = xgb.Pad(b) - return buf + return buf[:b] } // ClientIdValueListBytes writes a list of ClientIdValue values to a byte slice. @@ -269,7 +267,7 @@ func (v ResourceIdSpec) Bytes() []byte { xgb.Put32(buf[b:], v.Type) b += 4 - return buf + return buf[:b] } // ResourceIdSpecListBytes writes a list of ResourceIdSpec values to a byte slice. @@ -340,7 +338,7 @@ func (v ResourceSizeSpec) Bytes() []byte { xgb.Put32(buf[b:], v.UseCount) b += 4 - return buf + return buf[:b] } // ResourceSizeSpecListBytes writes a list of ResourceSizeSpec values to a byte slice. @@ -403,7 +401,7 @@ func (v ResourceSizeValue) Bytes() []byte { b += ResourceSizeSpecListBytes(buf[b:], v.CrossReferences) - return buf + return buf[:b] } // ResourceSizeValueListBytes writes a list of ResourceSizeValue values to a byte slice. @@ -466,7 +464,7 @@ func (v Type) Bytes() []byte { xgb.Put32(buf[b:], v.Count) b += 4 - return buf + return buf[:b] } // TypeListBytes writes a list of Type values to a byte slice. diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 5cff5f1..2240ee1 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -228,7 +228,6 @@ func getXIDListReply(buf []byte) *GetXIDListReply { v.Ids[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index f77d405..7e18f8d 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -72,7 +72,7 @@ func (v Event) Bytes() []byte { b += 32 // padding - return buf + return buf[:b] } // EventListBytes writes a list of Event values to a byte slice. diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index d88cc5d..6a07e41 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -90,7 +90,7 @@ func (v DrmClipRect) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.X3)) b += 2 - return buf + return buf[:b] } // DrmClipRectListBytes writes a list of DrmClipRect values to a byte slice. @@ -776,7 +776,6 @@ func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply { v.DevicePrivate[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -846,7 +845,8 @@ type GetDrawableInfoReply struct { BackY int16 NumBackClipRects uint32 ClipRects []DrmClipRect // size: xgb.Pad((int(NumClipRects) * 8)) - BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) + // alignment gap to multiple of 4 + BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) } // Reply blocks and returns the reply data for a GetDrawableInfo request. @@ -907,6 +907,8 @@ func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply { v.ClipRects = make([]DrmClipRect, v.NumClipRects) b += DrmClipRectReadList(buf[b:], v.ClipRects) + b = (b + 3) & ^3 // alignment gap + v.BackClipRects = make([]DrmClipRect, v.NumBackClipRects) b += DrmClipRectReadList(buf[b:], v.BackClipRects) diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 8abb44e..5b0f1f8 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -408,7 +408,7 @@ func (v ModeInfo) Bytes() []byte { xgb.Put32(buf[b:], v.Privsize) b += 4 - return buf + return buf[:b] } // ModeInfoListBytes writes a list of ModeInfo values to a byte slice. @@ -676,7 +676,7 @@ func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b += 12 // padding copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) + b += int(Privsize) return buf } @@ -774,7 +774,7 @@ func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdispl b += 4 copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) + b += int(Privsize) return buf } @@ -956,7 +956,6 @@ func getDotClocksReply(buf []byte) *GetDotClocksReply { v.Clock[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -1120,9 +1119,11 @@ type GetGammaRampReply struct { // padding: 1 bytes Size uint16 // padding: 22 bytes - Red []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + Red []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + // alignment gap to multiple of 2 Green []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) - Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + // alignment gap to multiple of 2 + Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) } // Reply blocks and returns the reply data for a GetGammaRamp request. @@ -1160,21 +1161,22 @@ func getGammaRampReply(buf []byte) *GetGammaRampReply { v.Red[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap v.Green = make([]uint16, ((int(v.Size) + 1) & -2)) for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { v.Green[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap v.Blue = make([]uint16, ((int(v.Size) + 1) & -2)) for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { v.Blue[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) return v } @@ -1413,7 +1415,7 @@ func getModeLineReply(buf []byte) *GetModeLineReply { v.Private = make([]byte, v.Privsize) copy(v.Private[:v.Privsize], buf[b:]) - b += xgb.Pad(int(v.Privsize)) + b += int(v.Privsize) return v } @@ -1479,7 +1481,8 @@ type GetMonitorReply struct { NumHsync byte NumVsync byte // padding: 20 bytes - Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) + Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) + // alignment gap to multiple of 4 Vsync []Syncrange // size: xgb.Pad((int(NumVsync) * 4)) Vendor string // size: xgb.Pad((int(VendorLength) * 1)) AlignmentPad []byte // size: xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) @@ -1530,14 +1533,14 @@ func getMonitorReply(buf []byte) *GetMonitorReply { v.Hsync[i] = Syncrange(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Vsync = make([]Syncrange, v.NumVsync) for i := 0; i < int(v.NumVsync); i++ { v.Vsync[i] = Syncrange(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) { byteString := make([]byte, v.VendorLength) @@ -1548,7 +1551,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply { v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) copy(v.AlignmentPad[:(((int(v.VendorLength)+3)&-4)-int(v.VendorLength))], buf[b:]) - b += xgb.Pad(int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))) + b += int((((int(v.VendorLength) + 3) & -4) - int(v.VendorLength))) { byteString := make([]byte, v.ModelLength) @@ -1922,7 +1925,7 @@ func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart b += 4 copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) + b += int(Privsize) return buf } @@ -2178,7 +2181,7 @@ func (cook SetGammaRampCookie) Check() error { // Write request to wire for SetGammaRamp // setGammaRampRequest writes a SetGammaRamp request to a byte slice. func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) + size := xgb.Pad((((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + 2) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + 2) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) b := 0 buf := make([]byte, size) @@ -2188,7 +2191,7 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, buf[b] = 18 // request opcode b += 1 - xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + blen := b b += 2 xgb.Put16(buf[b:], Screen) @@ -2201,21 +2204,24 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, xgb.Put16(buf[b:], Red[i]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap for i := 0; i < int(((int(Size) + 1) & -2)); i++ { xgb.Put16(buf[b:], Green[i]) b += 2 } - b = xgb.Pad(b) + + b = (b + 1) & ^1 // alignment gap for i := 0; i < int(((int(Size) + 1) & -2)); i++ { xgb.Put16(buf[b:], Blue[i]) b += 2 } - b = xgb.Pad(b) - return buf + b = xgb.Pad(b) + xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units + return buf[:b] } // SetViewPortCookie is a cookie used only for SetViewPort requests. @@ -2432,7 +2438,7 @@ func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b += 4 copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) + b += int(Privsize) return buf } @@ -2566,7 +2572,7 @@ func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdis b += 4 copy(buf[b:], Private[:Privsize]) - b += xgb.Pad(int(Privsize)) + b += int(Privsize) return buf } diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 9a08c93..ef08c9a 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -489,7 +489,7 @@ func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Na b += 2 // padding copy(buf[b:], Name[:Nbytes]) - b += xgb.Pad(int(Nbytes)) + b += int(Nbytes) return buf } @@ -697,7 +697,6 @@ func createPointerBarrierRequest(c *xgb.Conn, Barrier Barrier, Window xproto.Win xgb.Put16(buf[b:], Devices[i]) b += 2 } - b = xgb.Pad(b) return buf } @@ -1367,7 +1366,6 @@ func getCursorImageReply(buf []byte) *GetCursorImageReply { v.CursorImage[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -1433,7 +1431,8 @@ type GetCursorImageAndNameReply struct { CursorAtom xproto.Atom Nbytes uint16 // padding: 2 bytes - Name string // size: xgb.Pad((int(Nbytes) * 1)) + Name string // size: xgb.Pad((int(Nbytes) * 1)) + // alignment gap to multiple of 4 CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) } @@ -1498,12 +1497,13 @@ func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { b += int(v.Nbytes) } + b = (b + 3) & ^3 // alignment gap + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { v.CursorImage[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -2143,7 +2143,7 @@ func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name b += 2 // padding copy(buf[b:], Name[:Nbytes]) - b += xgb.Pad(int(Nbytes)) + b += int(Nbytes) return buf } diff --git a/nexgb/xgbgen/aligngap.go b/nexgb/xgbgen/aligngap.go new file mode 100644 index 0000000..1e07e18 --- /dev/null +++ b/nexgb/xgbgen/aligngap.go @@ -0,0 +1,130 @@ +package main + +import ( + "fmt" + "os" +) + +func (p *Protocol) AddAlignGaps() { + for i := range p.Imports { + p.Imports[i].AddAlignGaps() + } + for i := range p.Types { + switch t := p.Types[i].(type) { + case *Struct: + t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) + case *Event: + t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) + case *Error: + t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) + } + } + for i := range p.Requests { + p.Requests[i].Fields = addAlignGapsToFields(p.Requests[i].xmlName, p.Requests[i].Fields) + if p.Requests[i].Reply != nil { + p.Requests[i].Reply.Fields = addAlignGapsToFields(p.Requests[i].xmlName, p.Requests[i].Reply.Fields) + } + } +} + +func addAlignGapsToFields(name string, fields []Field) []Field { + var i int + for i = 0; i < len(fields); i++ { + if _, ok := fields[i].(*ListField); ok { + break + } + } + if i >= len(fields) { + return fields + } + + r := make([]Field, 0, len(fields)+2) + r = append(r, fields[:i]...) + + r = append(r, fields[i]) + for i = i + 1; i < len(fields); i++ { + switch f := fields[i].(type) { + case *ListField: + // ok, add padding + sz := xcbSizeOfType(f.Type) + switch { + case sz == 1: + // nothing + case sz == 2: + r = append(r, &PadField{0, 2}) + case sz == 3: + panic(fmt.Errorf("Alignment is not a power of 2")) + case sz >= 4: + r = append(r, &PadField{0, 4}) + } + + case *LocalField: + // nothing + + default: + fmt.Fprintf(os.Stderr, "Can't add alignment gaps, mix of list and non-list fields: %s\n", name) + return fields + } + r = append(r, fields[i]) + } + + return r +} + +func xcbSizeOfField(fld Field) int { + switch f := fld.(type) { + case *PadField: + return int(f.Bytes) + + case *SingleField: + return xcbSizeOfType(f.Type) + + case *ListField: + return 0 + + case *ExprField: + return xcbSizeOfType(f.Type) + + case *ValueField: + return xcbSizeOfType(f.MaskType) + + case *SwitchField: + return 0 + + default: + return 0 + } +} + +func xcbSizeOfType(typ Type) int { + switch t := typ.(type) { + case *Resource: + return 4 + + case *TypeDef: + return t.Size().Eval() + + case *Base: + return t.Size().Eval() + + case *Struct: + sz := 0 + for i := range t.Fields { + sz += xcbSizeOfField(t.Fields[i]) + } + return sz + + case *Union: + sz := 0 + for i := range t.Fields { + csz := xcbSizeOfField(t.Fields[i]) + if csz > sz { + sz = csz + } + } + return sz + + default: + return 0 + } +} diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index af0f598..f64f339 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -50,6 +50,8 @@ func (c *Context) Morph(xmlBytes []byte) { // Translate XML types to nice types c.protocol = parsedXml.Translate(nil) + c.protocol.AddAlignGaps() + // Start with Go header. c.Putln("// Package %s is the X client API for the %s extension.", c.protocol.PkgName(), c.protocol.ExtXName) diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 16760d4..bf3b3be 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -50,6 +50,7 @@ func (pad *PadField) Initialize(p *Protocol) {} // It is also used in size calculation. type PadField struct { Bytes uint + Align uint16 } func (p *PadField) SrcName() string { @@ -65,7 +66,11 @@ func (f *PadField) SrcType() string { } func (p *PadField) Size() Size { - return newFixedSize(p.Bytes) + if p.Align > 0 { + return newFixedSize(uint(p.Align), false) + } else { + return newFixedSize(p.Bytes, true) + } } // SingleField represents most of the fields in an XML protocol description. @@ -130,9 +135,9 @@ func (f *ListField) Length() Size { Expr: &FieldRef{ Name: f.SrcName(), }, - }) + }, true) } - return newExpressionSize(f.LengthExpr) + return newExpressionSize(f.LengthExpr, true) } // Size computes the *size* of a list (in bytes). @@ -142,8 +147,9 @@ func (f *ListField) Length() Size { // special function written in go_struct.go to compute the size (since the // size in this case can only be computed recursively). func (f *ListField) Size() Size { + elsz := f.Type.Size() simpleLen := &Padding{ - Expr: newBinaryOp("*", f.Length().Expression, f.Type.Size().Expression), + Expr: newBinaryOp("*", f.Length().Expression, elsz.Expression), } switch field := f.Type.(type) { @@ -153,18 +159,18 @@ func (f *ListField) Size() Size { Name: fmt.Sprintf("%sListSize", f.Type.SrcName()), Expr: &FieldRef{Name: f.SrcName()}, } - return newExpressionSize(sizeFun) + return newExpressionSize(sizeFun, elsz.exact) } else { - return newExpressionSize(simpleLen) + return newExpressionSize(simpleLen, elsz.exact) } case *Union: - return newExpressionSize(simpleLen) + return newExpressionSize(simpleLen, elsz.exact) case *Base: - return newExpressionSize(simpleLen) + return newExpressionSize(simpleLen, elsz.exact) case *Resource: - return newExpressionSize(simpleLen) + return newExpressionSize(simpleLen, elsz.exact) case *TypeDef: - return newExpressionSize(simpleLen) + return newExpressionSize(simpleLen, elsz.exact) default: log.Panicf("Cannot compute list size with type '%T'.", f.Type) } @@ -258,7 +264,7 @@ func (f *ValueField) Size() Size { }, }, }, - }) + }, true) return maskSize.Add(listSize) } @@ -270,7 +276,7 @@ func (f *ValueField) ListLength() Size { Name: f.MaskName, }, }, - }) + }, true) } func (f *ValueField) Initialize(p *Protocol) { @@ -303,7 +309,7 @@ func (f *SwitchField) SrcType() string { // expression that finds *which* bitcase fields are included, and sums the // sizes of those fields. func (f *SwitchField) Size() Size { - return newFixedSize(0) + return newFixedSize(0, true) } func (f *SwitchField) Initialize(p *Protocol) { diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index 6c680e8..ace4e00 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -103,15 +103,27 @@ func (td *TypeDef) Define(c *Context) { // Pad fields func (f *PadField) Define(c *Context) { - c.Putln("// padding: %d bytes", f.Bytes) + if f.Align > 0 { + c.Putln("// alignment gap to multiple of %d", f.Align) + } else { + c.Putln("// padding: %d bytes", f.Bytes) + } } func (f *PadField) Read(c *Context, prefix string) { - c.Putln("b += %s // padding", f.Size()) + if f.Align > 0 { + c.Putln("b = (b + %d) & ^%d // alignment gap", f.Align-1, f.Align-1) + } else { + c.Putln("b += %s // padding", f.Size()) + } } func (f *PadField) Write(c *Context, prefix string) { - c.Putln("b += %s // padding", f.Size()) + if f.Align > 0 { + c.Putln("b = (b + %d) & ^%d // alignment gap", f.Align-1, f.Align-1) + } else { + c.Putln("b += %s // padding", f.Size()) + } } // Local fields diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index fa8df69..1e85d9f 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -21,7 +21,6 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("for i := 0; i < int(%s); i++ {", length) ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") case *Base: length := f.LengthExpr.Reduce(prefix) if strings.ToLower(t.XmlName()) == "char" { @@ -38,7 +37,7 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), length) c.Putln("copy(%s%s[:%s], buf[b:])", prefix, f.SrcName(), length) - c.Putln("b += xgb.Pad(int(%s))", length) + c.Putln("b += int(%s)", length) } else { c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), length) @@ -46,7 +45,6 @@ func (f *ListField) Read(c *Context, prefix string) { ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") } case *TypeDef: length := f.LengthExpr.Reduce(prefix) @@ -55,7 +53,6 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("for i := 0; i < int(%s); i++ {", length) ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") case *Union: c.Putln("%s%s = make([]%s, %s)", prefix, f.SrcName(), t.SrcName(), f.LengthExpr.Reduce(prefix)) @@ -80,18 +77,16 @@ func (f *ListField) Write(c *Context, prefix string) { WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") case *Base: length := f.Length().Reduce(prefix) if t.SrcName() == "byte" { c.Putln("copy(buf[b:], %s%s[:%s])", prefix, f.SrcName(), length) - c.Putln("b += xgb.Pad(int(%s))", length) + c.Putln("b += int(%s)", length) } else { c.Putln("for i := 0; i < int(%s); i++ {", length) WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") } case *TypeDef: length := f.Length().Reduce(prefix) @@ -99,7 +94,6 @@ func (f *ListField) Write(c *Context, prefix string) { WriteSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t) c.Putln("}") - c.Putln("b = xgb.Pad(b)") case *Union: c.Putln("b += %sListBytes(buf[b:], %s%s)", t.SrcName(), prefix, f.SrcName()) diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index a2c6d9c..d82e157 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -138,18 +138,32 @@ func (r *Request) ReadReply(c *Context) { } func (r *Request) WriteRequest(c *Context) { - writeSize := func() { - c.Putln("xgb.Put16(buf[b:], uint16(size / 4)) " + - "// write request size in 4-byte units") + sz := r.Size(c) + writeSize1 := func() { + if sz.exact { + c.Putln("xgb.Put16(buf[b:], uint16(size / 4)) " + + "// write request size in 4-byte units") + } else { + c.Putln("blen := b") + } c.Putln("b += 2") c.Putln("") } + writeSize2 := func() { + if sz.exact { + c.Putln("return buf") + return + } + c.Putln("b = xgb.Pad(b)") + c.Putln("xgb.Put16(buf[blen:], uint16(b / 4)) // write request size in 4-byte units") + c.Putln("return buf[:b]") + } c.Putln("// Write request to wire for %s", r.SrcName()) c.Putln("// %s writes a %s request to a byte slice.", r.ReqName(), r.SrcName()) c.Putln("func %s(c *xgb.Conn, %s) []byte {", r.ReqName(), r.ParamNameTypes()) - c.Putln("size := %s", r.Size(c)) + c.Putln("size := %s", sz) c.Putln("b := 0") c.Putln("buf := make([]byte, size)") c.Putln("") @@ -165,18 +179,18 @@ func (r *Request) WriteRequest(c *Context) { if !c.protocol.isExt() { c.Putln("b += 1 // padding") } - writeSize() + writeSize1() } else if c.protocol.isExt() { - writeSize() + writeSize1() } for i, field := range r.Fields { field.Write(c, "") c.Putln("") if i == 0 && !c.protocol.isExt() { - writeSize() + writeSize1() } } - c.Putln("return buf") + writeSize2() c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 0f18084..ee74d90 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -78,7 +78,7 @@ func (s *Struct) Write(c *Context) { field.Write(c, "v.") c.Putln("") } - c.Putln("return buf") + c.Putln("return buf[:b]") c.Putln("}") c.Putln("") } diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index 11a4e44..ae4eccb 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -91,7 +91,7 @@ func (r *Request) CookieName() string { // If it's a core protocol request, then we only account for *three* // bytes of the header (remove the extension opcode). func (r *Request) Size(c *Context) Size { - size := newFixedSize(0) + size := newFixedSize(0, true) // If this is a core protocol request, we squeeze in an extra byte of // data (from the fields below) between the opcode and the size of the @@ -99,9 +99,9 @@ func (r *Request) Size(c *Context) Size { // by the opcode of the request (while the first byte is always occupied // by the opcode of the extension). if !c.protocol.isExt() { - size = size.Add(newFixedSize(3)) + size = size.Add(newFixedSize(3, true)) } else { - size = size.Add(newFixedSize(4)) + size = size.Add(newFixedSize(4, true)) } for _, field := range r.Fields { @@ -122,7 +122,7 @@ func (r *Request) Size(c *Context) Size { } return newExpressionSize(&Padding{ Expr: size.Expression, - }) + }, size.exact) } // Reply encapsulates the fields associated with a 'reply' element. @@ -136,10 +136,10 @@ type Reply struct { // 2 bytes: A sequence number // 4 bytes: Number of additional bytes in 4-byte units past initial 32 bytes. func (r *Reply) Size() Size { - size := newFixedSize(0) + size := newFixedSize(0, true) // Account for reply discriminant, sequence number and reply length - size = size.Add(newFixedSize(7)) + size = size.Add(newFixedSize(7, true)) for _, field := range r.Fields { size = size.Add(field.Size()) diff --git a/nexgb/xgbgen/size.go b/nexgb/xgbgen/size.go index 8836892..6e49371 100644 --- a/nexgb/xgbgen/size.go +++ b/nexgb/xgbgen/size.go @@ -7,24 +7,25 @@ package main // for adding and multiplying sizes. type Size struct { Expression + exact bool } // newFixedSize creates a new Size with some fixed and known value. -func newFixedSize(fixed uint) Size { - return Size{&Value{v: int(fixed)}} +func newFixedSize(fixed uint, exact bool) Size { + return Size{&Value{v: int(fixed)}, exact} } // newExpressionSize creates a new Size with some expression. -func newExpressionSize(variable Expression) Size { - return Size{variable} +func newExpressionSize(variable Expression, exact bool) Size { + return Size{variable, exact} } // Add adds s1 and s2 and returns a new Size. func (s1 Size) Add(s2 Size) Size { - return Size{newBinaryOp("+", s1, s2)} + return Size{newBinaryOp("+", s1, s2), s1.exact && s2.exact} } // Multiply mupltiplies s1 and s2 and returns a new Size. func (s1 Size) Multiply(s2 Size) Size { - return Size{newBinaryOp("*", s1, s2)} + return Size{newBinaryOp("*", s1, s2), s1.exact && s2.exact} } diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index b7e67e2..f595e5f 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -43,7 +43,7 @@ func (xml *XML) Translate(parent *Protocol) *Protocol { newBaseType := &Base{ srcName: srcName, xmlName: xmlName, - size: newFixedSize(BaseTypeSizes[xmlName]), + size: newFixedSize(BaseTypeSizes[xmlName], true), } protocol.Types = append(protocol.Types, newBaseType) } diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index ded5be2..59f1a2d 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -154,7 +154,7 @@ func (r *Resource) XmlName() string { } func (r *Resource) Size() Size { - return newFixedSize(BaseTypeSizes["Id"]) + return newFixedSize(BaseTypeSizes["Id"], true) } func (r *Resource) Initialize(p *Protocol) { @@ -201,7 +201,7 @@ func (e *Event) XmlName() string { } func (e *Event) Size() Size { - return newExpressionSize(&Value{v: 32}) + return newExpressionSize(&Value{v: 32}, true) } func (e *Event) Initialize(p *Protocol) { @@ -231,7 +231,7 @@ func (e *EventCopy) XmlName() string { } func (e *EventCopy) Size() Size { - return newExpressionSize(&Value{v: 32}) + return newExpressionSize(&Value{v: 32}, true) } func (e *EventCopy) Initialize(p *Protocol) { @@ -262,7 +262,7 @@ func (e *Error) XmlName() string { } func (e *Error) Size() Size { - return newExpressionSize(&Value{v: 32}) + return newExpressionSize(&Value{v: 32}, true) } func (e *Error) Initialize(p *Protocol) { @@ -296,7 +296,7 @@ func (e *ErrorCopy) XmlName() string { } func (e *ErrorCopy) Size() Size { - return newExpressionSize(&Value{v: 32}) + return newExpressionSize(&Value{v: 32}, true) } func (e *ErrorCopy) Initialize(p *Protocol) { @@ -330,7 +330,7 @@ func (s *Struct) XmlName() string { } func (s *Struct) Size() Size { - size := newFixedSize(0) + size := newFixedSize(0, true) for _, field := range s.Fields { size = size.Add(field.Size()) } diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 28410c6..75c773c 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -90,7 +90,7 @@ func (v ScreenInfo) Bytes() []byte { xgb.Put16(buf[b:], v.Height) b += 2 - return buf + return buf[:b] } // ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 7a7279f..5ed49a0 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -336,7 +336,6 @@ func PrinterRead(buf []byte, v *Printer) int { v.Name[i] = String8(buf[b]) b += 1 } - b = xgb.Pad(b) v.DescLen = xgb.Get32(buf[b:]) b += 4 @@ -346,7 +345,6 @@ func PrinterRead(buf []byte, v *Printer) int { v.Description[i] = String8(buf[b]) b += 1 } - b = xgb.Pad(b) return b } @@ -373,7 +371,6 @@ func (v Printer) Bytes() []byte { buf[b] = byte(v.Name[i]) b += 1 } - b = xgb.Pad(b) xgb.Put32(buf[b:], v.DescLen) b += 4 @@ -382,9 +379,8 @@ func (v Printer) Bytes() []byte { buf[b] = byte(v.Description[i]) b += 1 } - b = xgb.Pad(b) - return buf + return buf[:b] } // PrinterListBytes writes a list of Printer values to a byte slice. @@ -496,13 +492,11 @@ func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, buf[b] = byte(PrinterName[i]) b += 1 } - b = xgb.Pad(b) for i := 0; i < int(LocaleLen); i++ { buf[b] = byte(Locale[i]) b += 1 } - b = xgb.Pad(b) return buf } @@ -1003,7 +997,7 @@ func printGetDocumentDataReply(buf []byte) *PrintGetDocumentDataReply { v.Data = make([]byte, v.DataLen) copy(v.Data[:v.DataLen], buf[b:]) - b += xgb.Pad(int(v.DataLen)) + b += int(v.DataLen) return v } @@ -1193,7 +1187,6 @@ func printGetOneAttributesReply(buf []byte) *PrintGetOneAttributesReply { v.Value[i] = String8(buf[b]) b += 1 } - b = xgb.Pad(b) return v } @@ -1229,7 +1222,6 @@ func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, buf[b] = byte(Name[i]) b += 1 } - b = xgb.Pad(b) return buf } @@ -1441,13 +1433,11 @@ func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen ui buf[b] = byte(PrinterName[i]) b += 1 } - b = xgb.Pad(b) for i := 0; i < int(LocaleLen); i++ { buf[b] = byte(Locale[i]) b += 1 } - b = xgb.Pad(b) return buf } @@ -1707,19 +1697,17 @@ func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData b += 2 copy(buf[b:], Data[:LenData]) - b += xgb.Pad(int(LenData)) + b += int(LenData) for i := 0; i < int(len(DocFormat)); i++ { buf[b] = byte(DocFormat[i]) b += 1 } - b = xgb.Pad(b) for i := 0; i < int(len(Options)); i++ { buf[b] = byte(Options[i]) b += 1 } - b = xgb.Pad(b) return buf } @@ -1796,7 +1784,6 @@ func printQueryScreensReply(buf []byte) *PrintQueryScreensReply { v.Roots[i] = xproto.Window(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -2091,7 +2078,6 @@ func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, buf[b] = byte(Attributes[i]) b += 1 } - b = xgb.Pad(b) return buf } diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 36ab545..728f85f 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -179,7 +179,7 @@ func (v Arc) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.Angle2)) b += 2 - return buf + return buf[:b] } // ArcListBytes writes a list of Arc values to a byte slice. @@ -603,7 +603,7 @@ func (v Char2b) Bytes() []byte { buf[b] = v.Byte2 b += 1 - return buf + return buf[:b] } // Char2bListBytes writes a list of Char2b values to a byte slice. @@ -685,7 +685,7 @@ func (v Charinfo) Bytes() []byte { xgb.Put16(buf[b:], v.Attributes) b += 2 - return buf + return buf[:b] } // CharinfoListBytes writes a list of Charinfo values to a byte slice. @@ -932,7 +932,7 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { buf := make([]byte, 20) copy(buf[b:], Data8[:20]) - b += xgb.Pad(int(20)) + b += int(20) // Create the Union type v := ClientMessageDataUnion{} @@ -942,7 +942,7 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += xgb.Pad(int(20)) + b += int(20) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) @@ -950,7 +950,6 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) @@ -958,7 +957,6 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -972,7 +970,6 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { xgb.Put16(buf[b:], Data16[i]) b += 2 } - b = xgb.Pad(b) // Create the Union type v := ClientMessageDataUnion{} @@ -982,7 +979,7 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += xgb.Pad(int(20)) + b += int(20) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) @@ -990,7 +987,6 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) @@ -998,7 +994,6 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -1012,7 +1007,6 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { xgb.Put32(buf[b:], Data32[i]) b += 4 } - b = xgb.Pad(b) // Create the Union type v := ClientMessageDataUnion{} @@ -1022,7 +1016,7 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { b = 0 // always read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += xgb.Pad(int(20)) + b += int(20) b = 0 // always read the same bytes v.Data16 = make([]uint16, 10) @@ -1030,7 +1024,6 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) b = 0 // always read the same bytes v.Data32 = make([]uint32, 5) @@ -1038,7 +1031,6 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -1050,7 +1042,7 @@ func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { b = 0 // re-read the same bytes v.Data8 = make([]byte, 20) copy(v.Data8[:20], buf[b:]) - b += xgb.Pad(int(20)) + b += int(20) b = 0 // re-read the same bytes v.Data16 = make([]uint16, 10) @@ -1058,7 +1050,6 @@ func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { v.Data16[i] = xgb.Get16(buf[b:]) b += 2 } - b = xgb.Pad(b) b = 0 // re-read the same bytes v.Data32 = make([]uint32, 5) @@ -1066,7 +1057,6 @@ func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { v.Data32[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return 20 } @@ -1089,7 +1079,7 @@ func (v ClientMessageDataUnion) Bytes() []byte { b := 0 copy(buf[b:], v.Data8[:20]) - b += xgb.Pad(int(20)) + b += int(20) return buf } @@ -1189,7 +1179,7 @@ func (v Coloritem) Bytes() []byte { b += 1 // padding - return buf + return buf[:b] } // ColoritemListBytes writes a list of Coloritem values to a byte slice. @@ -1908,7 +1898,7 @@ func (v DepthInfo) Bytes() []byte { b += VisualInfoListBytes(buf[b:], v.Visuals) - return buf + return buf[:b] } // DepthInfoListBytes writes a list of DepthInfo values to a byte slice. @@ -2580,7 +2570,7 @@ func (v Fontprop) Bytes() []byte { xgb.Put32(buf[b:], v.Value) b += 4 - return buf + return buf[:b] } // FontpropListBytes writes a list of Fontprop values to a byte slice. @@ -2646,7 +2636,7 @@ func (v Format) Bytes() []byte { b += 5 // padding - return buf + return buf[:b] } // FormatListBytes writes a list of Format values to a byte slice. @@ -3072,7 +3062,7 @@ func HostRead(buf []byte, v *Host) int { v.Address = make([]byte, v.AddressLen) copy(v.Address[:v.AddressLen], buf[b:]) - b += xgb.Pad(int(v.AddressLen)) + b += int(v.AddressLen) return b } @@ -3101,9 +3091,9 @@ func (v Host) Bytes() []byte { b += 2 copy(buf[b:], v.Address[:v.AddressLen]) - b += xgb.Pad(int(v.AddressLen)) + b += int(v.AddressLen) - return buf + return buf[:b] } // HostListBytes writes a list of Host values to a byte slice. @@ -3469,7 +3459,7 @@ func KeymapNotifyEventNew(buf []byte) xgb.Event { v.Keys = make([]byte, 31) copy(v.Keys[:31], buf[b:]) - b += xgb.Pad(int(31)) + b += int(31) return v } @@ -3484,7 +3474,7 @@ func (v KeymapNotifyEvent) Bytes() []byte { b += 1 copy(buf[b:], v.Keys[:31]) - b += xgb.Pad(int(31)) + b += int(31) return buf } @@ -4323,7 +4313,7 @@ func (v Point) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - return buf + return buf[:b] } // PointListBytes writes a list of Point values to a byte slice. @@ -4506,7 +4496,7 @@ func (v Rectangle) Bytes() []byte { xgb.Put16(buf[b:], v.Height) b += 2 - return buf + return buf[:b] } // RectangleListBytes writes a list of Rectangle values to a byte slice. @@ -4831,7 +4821,7 @@ func (v Rgb) Bytes() []byte { b += 2 // padding - return buf + return buf[:b] } // RgbListBytes writes a list of Rgb values to a byte slice. @@ -4997,7 +4987,7 @@ func (v ScreenInfo) Bytes() []byte { b += DepthInfoListBytes(buf[b:], v.AllowedDepths) - return buf + return buf[:b] } // ScreenInfoListBytes writes a list of ScreenInfo values to a byte slice. @@ -5079,7 +5069,7 @@ func (v Segment) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.Y2)) b += 2 - return buf + return buf[:b] } // SegmentListBytes writes a list of Segment values to a byte slice. @@ -5434,9 +5424,9 @@ func (v SetupAuthenticate) Bytes() []byte { b += 2 copy(buf[b:], v.Reason[:(int(v.Length)*4)]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) - return buf + return buf[:b] } // SetupAuthenticateListBytes writes a list of SetupAuthenticate values to a byte slice. @@ -5529,9 +5519,9 @@ func (v SetupFailed) Bytes() []byte { b += 2 copy(buf[b:], v.Reason[:v.ReasonLen]) - b += xgb.Pad(int(v.ReasonLen)) + b += int(v.ReasonLen) - return buf + return buf[:b] } // SetupFailedListBytes writes a list of SetupFailed values to a byte slice. @@ -5576,9 +5566,11 @@ type SetupInfo struct { MinKeycode Keycode MaxKeycode Keycode // padding: 4 bytes - Vendor string // size: xgb.Pad((int(VendorLen) * 1)) - PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) - Roots []ScreenInfo // size: ScreenInfoListSize(Roots) + Vendor string // size: xgb.Pad((int(VendorLen) * 1)) + // alignment gap to multiple of 4 + PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) + // alignment gap to multiple of 4 + Roots []ScreenInfo // size: ScreenInfoListSize(Roots) } // SetupInfoRead reads a byte slice into a SetupInfo value. @@ -5650,9 +5642,13 @@ func SetupInfoRead(buf []byte, v *SetupInfo) int { b += int(v.VendorLen) } + b = (b + 3) & ^3 // alignment gap + v.PixmapFormats = make([]Format, v.PixmapFormatsLen) b += FormatReadList(buf[b:], v.PixmapFormats) + b = (b + 3) & ^3 // alignment gap + v.Roots = make([]ScreenInfo, v.RootsLen) b += ScreenInfoReadList(buf[b:], v.Roots) @@ -5671,7 +5667,7 @@ func SetupInfoReadList(buf []byte, dest []SetupInfo) int { // Bytes writes a SetupInfo value to a byte slice. func (v SetupInfo) Bytes() []byte { - buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) + buf := make([]byte, (((((40 + xgb.Pad((int(v.VendorLen) * 1))) + 4) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + 4) + ScreenInfoListSize(v.Roots))) b := 0 buf[b] = v.Status @@ -5733,13 +5729,17 @@ func (v SetupInfo) Bytes() []byte { b += 4 // padding copy(buf[b:], v.Vendor[:v.VendorLen]) - b += xgb.Pad(int(v.VendorLen)) + b += int(v.VendorLen) + + b = (b + 3) & ^3 // alignment gap b += FormatListBytes(buf[b:], v.PixmapFormats) + b = (b + 3) & ^3 // alignment gap + b += ScreenInfoListBytes(buf[b:], v.Roots) - return buf + return buf[:b] } // SetupInfoListBytes writes a list of SetupInfo values to a byte slice. @@ -5758,7 +5758,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { func SetupInfoListSize(list []SetupInfo) int { size := 0 for _, item := range list { - size += (((40 + xgb.Pad((int(item.VendorLen) * 1))) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) + size += (((((40 + xgb.Pad((int(item.VendorLen) * 1))) + 4) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + 4) + ScreenInfoListSize(item.Roots)) } return size } @@ -5850,12 +5850,12 @@ func (v SetupRequest) Bytes() []byte { b += 2 // padding copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) - b += xgb.Pad(int(v.AuthorizationProtocolNameLen)) + b += int(v.AuthorizationProtocolNameLen) copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) - b += xgb.Pad(int(v.AuthorizationProtocolDataLen)) + b += int(v.AuthorizationProtocolDataLen) - return buf + return buf[:b] } // SetupRequestListBytes writes a list of SetupRequest values to a byte slice. @@ -5928,9 +5928,9 @@ func (v Str) Bytes() []byte { b += 1 copy(buf[b:], v.Name[:v.NameLen]) - b += xgb.Pad(int(v.NameLen)) + b += int(v.NameLen) - return buf + return buf[:b] } // StrListBytes writes a list of Str values to a byte slice. @@ -6009,7 +6009,7 @@ func (v Timecoord) Bytes() []byte { xgb.Put16(buf[b:], uint16(v.Y)) b += 2 - return buf + return buf[:b] } // TimecoordListBytes writes a list of Timecoord values to a byte slice. @@ -6352,7 +6352,7 @@ func (v VisualInfo) Bytes() []byte { b += 4 // padding - return buf + return buf[:b] } // VisualInfoListBytes writes a list of VisualInfo values to a byte slice. @@ -6588,7 +6588,8 @@ type AllocColorCellsReply struct { MasksLen uint16 // padding: 20 bytes Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) - Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) + // alignment gap to multiple of 4 + Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) } // Reply blocks and returns the reply data for a AllocColorCells request. @@ -6629,14 +6630,14 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { v.Pixels[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Masks = make([]uint32, v.MasksLen) for i := 0; i < int(v.MasksLen); i++ { v.Masks[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -6754,7 +6755,6 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { v.Pixels[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -6905,7 +6905,7 @@ func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name str b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } @@ -7169,7 +7169,7 @@ func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, b += 2 copy(buf[b:], Address[:AddressLen]) - b += xgb.Pad(int(AddressLen)) + b += int(AddressLen) return buf } @@ -7282,7 +7282,6 @@ func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode K xgb.Put32(buf[b:], uint32(Keysyms[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -7416,7 +7415,7 @@ func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, b += 4 copy(buf[b:], Data[:((int(DataLen)*int(Format))/8)]) - b += xgb.Pad(int(((int(DataLen) * int(Format)) / 8))) + b += int(((int(DataLen) * int(Format)) / 8)) return buf } @@ -8822,7 +8821,6 @@ func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []ui xgb.Put32(buf[b:], Pixels[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -9316,7 +9314,7 @@ func getImageReply(buf []byte) *GetImageReply { v.Data = make([]byte, (int(v.Length) * 4)) copy(v.Data[:(int(v.Length)*4)], buf[b:]) - b += xgb.Pad(int((int(v.Length) * 4))) + b += int((int(v.Length) * 4)) return v } @@ -9516,7 +9514,7 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v.AutoRepeats = make([]byte, 32) copy(v.AutoRepeats[:32], buf[b:]) - b += xgb.Pad(int(32)) + b += int(32) return v } @@ -9601,7 +9599,6 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { v.Keysyms[i] = Keysym(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -9693,7 +9690,6 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v.Keycodes[i] = Keycode(buf[b]) b += 1 } - b = xgb.Pad(b) return v } @@ -9957,7 +9953,7 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { v.Map = make([]byte, v.MapLen) copy(v.Map[:v.MapLen], buf[b:]) - b += xgb.Pad(int(v.MapLen)) + b += int(v.MapLen) return v } @@ -10051,7 +10047,7 @@ func getPropertyReply(buf []byte) *GetPropertyReply { v.Value = make([]byte, (int(v.ValueLen) * (int(v.Format) / 8))) copy(v.Value[:(int(v.ValueLen)*(int(v.Format)/8))], buf[b:]) - b += xgb.Pad(int((int(v.ValueLen) * (int(v.Format) / 8)))) + b += int((int(v.ValueLen) * (int(v.Format) / 8))) return v } @@ -10914,7 +10910,7 @@ func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gconte b += 2 copy(buf[b:], String[:StringLen]) - b += xgb.Pad(int(StringLen)) + b += int(StringLen) return buf } @@ -11053,7 +11049,7 @@ func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name stri b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } @@ -11276,7 +11272,7 @@ func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern s b += 2 copy(buf[b:], Pattern[:PatternLen]) - b += xgb.Pad(int(PatternLen)) + b += int(PatternLen) return buf } @@ -11434,7 +11430,7 @@ func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, P b += 2 copy(buf[b:], Pattern[:PatternLen]) - b += xgb.Pad(int(PatternLen)) + b += int(PatternLen) return buf } @@ -11590,7 +11586,6 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { v.Cmaps[i] = Colormap(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -11682,7 +11677,6 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { v.Atoms[i] = Atom(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -11812,7 +11806,7 @@ func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } @@ -12008,7 +12002,7 @@ func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } @@ -12441,7 +12435,7 @@ func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y i b += 2 copy(buf[b:], Items[:len(Items)]) - b += xgb.Pad(int(len(Items))) + b += int(len(Items)) return buf } @@ -12501,7 +12495,7 @@ func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y in b += 2 copy(buf[b:], Items[:len(Items)]) - b += xgb.Pad(int(len(Items))) + b += int(len(Items)) return buf } @@ -12576,7 +12570,7 @@ func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, W b += 2 // padding copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) return buf } @@ -12762,7 +12756,6 @@ func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { xgb.Put32(buf[b:], Pixels[i]) b += 4 } - b = xgb.Pad(b) return buf } @@ -12864,7 +12857,7 @@ func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } @@ -12911,7 +12904,8 @@ type QueryFontReply struct { FontDescent int16 CharInfosLen uint32 Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) - CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) + // alignment gap to multiple of 4 + CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) } // Reply blocks and returns the reply data for a QueryFont request. @@ -12989,6 +12983,8 @@ func queryFontReply(buf []byte) *QueryFontReply { v.Properties = make([]Fontprop, v.PropertiesLen) b += FontpropReadList(buf[b:], v.Properties) + b = (b + 3) & ^3 // alignment gap + v.CharInfos = make([]Charinfo, v.CharInfosLen) b += CharinfoReadList(buf[b:], v.CharInfos) @@ -13072,7 +13068,7 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { v.Keys = make([]byte, 32) copy(v.Keys[:32], buf[b:]) - b += xgb.Pad(int(32)) + b += int(32) return v } @@ -13392,7 +13388,6 @@ func queryTreeReply(buf []byte) *QueryTreeReply { v.Children[i] = Window(xgb.Get32(buf[b:])) b += 4 } - b = xgb.Pad(b) return v } @@ -13596,7 +13591,6 @@ func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta xgb.Put32(buf[b:], uint32(Atoms[i])) b += 4 } - b = xgb.Pad(b) return buf } @@ -13655,7 +13649,7 @@ func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask b += 4 copy(buf[b:], Event[:32]) - b += xgb.Pad(int(32)) + b += int(32) return buf } @@ -13861,7 +13855,7 @@ func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uin b += 2 copy(buf[b:], Dashes[:DashesLen]) - b += xgb.Pad(int(DashesLen)) + b += int(DashesLen) return buf } @@ -14047,7 +14041,6 @@ func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes [ buf[b] = byte(Keycodes[i]) b += 1 } - b = xgb.Pad(b) return buf } @@ -14126,7 +14119,7 @@ func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { b += 2 copy(buf[b:], Map[:MapLen]) - b += xgb.Pad(int(MapLen)) + b += int(MapLen) return buf } @@ -14347,7 +14340,7 @@ func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32 b += 2 // padding copy(buf[b:], Name[:NameLen]) - b += xgb.Pad(int(NameLen)) + b += int(NameLen) return buf } diff --git a/nexgb/xproto/xproto_test.go b/nexgb/xproto/xproto_test.go index 44d3285..a5bec71 100644 --- a/nexgb/xproto/xproto_test.go +++ b/nexgb/xproto/xproto_test.go @@ -204,6 +204,23 @@ func TestWindowEvents(t *testing.T) { } } +// Calls GetFontPath function, Issue #12 +func TestGetFontPath(t *testing.T) { + fontPathReply, err := GetFontPath(X).Reply() + if err != nil { + t.Fatalf("GetFontPath: %v", err) + } + _ = fontPathReply +} + +func TestListFonts(t *testing.T) { + listFontsReply, err := ListFonts(X, 10, 1, "*").Reply() + if err != nil { + t.Fatalf("ListFonts: %v", err) + } + _ = listFontsReply +} + /******************************************************************************/ // Benchmarks /******************************************************************************/ diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index a4cd35e..87d8f98 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -100,12 +100,12 @@ func (v ListItem) Bytes() []byte { b += 4 copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) - b += xgb.Pad(int(v.ObjectContextLen)) + b += int(v.ObjectContextLen) copy(buf[b:], v.DataContext[:v.DataContextLen]) - b += xgb.Pad(int(v.DataContextLen)) + b += int(v.DataContextLen) - return buf + return buf[:b] } // ListItemListBytes writes a list of ListItem values to a byte slice. @@ -1766,7 +1766,7 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1824,7 +1824,7 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1882,7 +1882,7 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1940,7 +1940,7 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1998,7 +1998,7 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -2056,7 +2056,7 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -2114,7 +2114,7 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index ec87d02..1c406b0 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -45,7 +45,8 @@ type AdaptorInfo struct { NumFormats uint16 Type byte // padding: 1 bytes - Name string // size: xgb.Pad((int(NameSize) * 1)) + Name string // size: xgb.Pad((int(NameSize) * 1)) + // alignment gap to multiple of 4 Formats []Format // size: xgb.Pad((int(NumFormats) * 8)) } @@ -77,6 +78,8 @@ func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { b += int(v.NameSize) } + b = (b + 3) & ^3 // alignment gap + v.Formats = make([]Format, v.NumFormats) b += FormatReadList(buf[b:], v.Formats) @@ -95,7 +98,7 @@ func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { // Bytes writes a AdaptorInfo value to a byte slice. func (v AdaptorInfo) Bytes() []byte { - buf := make([]byte, ((12 + xgb.Pad((int(v.NameSize) * 1))) + xgb.Pad((int(v.NumFormats) * 8)))) + buf := make([]byte, (((12 + xgb.Pad((int(v.NameSize) * 1))) + 4) + xgb.Pad((int(v.NumFormats) * 8)))) b := 0 xgb.Put32(buf[b:], uint32(v.BaseId)) @@ -116,11 +119,13 @@ func (v AdaptorInfo) Bytes() []byte { b += 1 // padding copy(buf[b:], v.Name[:v.NameSize]) - b += xgb.Pad(int(v.NameSize)) + b += int(v.NameSize) + + b = (b + 3) & ^3 // alignment gap b += FormatListBytes(buf[b:], v.Formats) - return buf + return buf[:b] } // AdaptorInfoListBytes writes a list of AdaptorInfo values to a byte slice. @@ -139,7 +144,7 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { func AdaptorInfoListSize(list []AdaptorInfo) int { size := 0 for _, item := range list { - size += ((12 + xgb.Pad((int(item.NameSize) * 1))) + xgb.Pad((int(item.NumFormats) * 8))) + size += (((12 + xgb.Pad((int(item.NameSize) * 1))) + 4) + xgb.Pad((int(item.NumFormats) * 8))) } return size } @@ -211,9 +216,9 @@ func (v AttributeInfo) Bytes() []byte { b += 4 copy(buf[b:], v.Name[:v.Size]) - b += xgb.Pad(int(v.Size)) + b += int(v.Size) - return buf + return buf[:b] } // AttributeInfoListBytes writes a list of AttributeInfo values to a byte slice. @@ -462,9 +467,9 @@ func (v EncodingInfo) Bytes() []byte { } copy(buf[b:], v.Name[:v.NameSize]) - b += xgb.Pad(int(v.NameSize)) + b += int(v.NameSize) - return buf + return buf[:b] } // EncodingInfoListBytes writes a list of EncodingInfo values to a byte slice. @@ -532,7 +537,7 @@ func (v Format) Bytes() []byte { b += 3 // padding - return buf + return buf[:b] } // FormatListBytes writes a list of Format values to a byte slice. @@ -563,8 +568,9 @@ type Image struct { DataSize uint32 NumPlanes uint32 Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) - Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) - Data []byte // size: xgb.Pad((int(DataSize) * 1)) + // alignment gap to multiple of 4 + Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + Data []byte // size: xgb.Pad((int(DataSize) * 1)) } // ImageRead reads a byte slice into a Image value. @@ -591,18 +597,18 @@ func ImageRead(buf []byte, v *Image) int { v.Pitches[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Offsets = make([]uint32, v.NumPlanes) for i := 0; i < int(v.NumPlanes); i++ { v.Offsets[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) v.Data = make([]byte, v.DataSize) copy(v.Data[:v.DataSize], buf[b:]) - b += xgb.Pad(int(v.DataSize)) + b += int(v.DataSize) return b } @@ -619,7 +625,7 @@ func ImageReadList(buf []byte, dest []Image) int { // Bytes writes a Image value to a byte slice. func (v Image) Bytes() []byte { - buf := make([]byte, (((16 + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) + buf := make([]byte, ((((16 + xgb.Pad((int(v.NumPlanes) * 4))) + 4) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) b := 0 xgb.Put32(buf[b:], v.Id) @@ -641,18 +647,18 @@ func (v Image) Bytes() []byte { xgb.Put32(buf[b:], v.Pitches[i]) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap for i := 0; i < int(v.NumPlanes); i++ { xgb.Put32(buf[b:], v.Offsets[i]) b += 4 } - b = xgb.Pad(b) copy(buf[b:], v.Data[:v.DataSize]) - b += xgb.Pad(int(v.DataSize)) + b += int(v.DataSize) - return buf + return buf[:b] } // ImageListBytes writes a list of Image values to a byte slice. @@ -671,7 +677,7 @@ func ImageListBytes(buf []byte, list []Image) int { func ImageListSize(list []Image) int { size := 0 for _, item := range list { - size += (((16 + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.DataSize) * 1))) + size += ((((16 + xgb.Pad((int(item.NumPlanes) * 4))) + 4) + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.DataSize) * 1))) } return size } @@ -723,7 +729,7 @@ func ImageFormatInfoRead(buf []byte, v *ImageFormatInfo) int { v.Guid = make([]byte, 16) copy(v.Guid[:16], buf[b:]) - b += xgb.Pad(int(16)) + b += int(16) v.Bpp = buf[b] b += 1 @@ -781,7 +787,7 @@ func ImageFormatInfoRead(buf []byte, v *ImageFormatInfo) int { v.VcompOrder = make([]byte, 32) copy(v.VcompOrder[:32], buf[b:]) - b += xgb.Pad(int(32)) + b += int(32) v.VscanlineOrder = buf[b] b += 1 @@ -818,7 +824,7 @@ func (v ImageFormatInfo) Bytes() []byte { b += 2 // padding copy(buf[b:], v.Guid[:16]) - b += xgb.Pad(int(16)) + b += int(16) buf[b] = v.Bpp b += 1 @@ -875,14 +881,14 @@ func (v ImageFormatInfo) Bytes() []byte { b += 4 copy(buf[b:], v.VcompOrder[:32]) - b += xgb.Pad(int(32)) + b += int(32) buf[b] = v.VscanlineOrder b += 1 b += 11 // padding - return buf + return buf[:b] } // ImageFormatInfoListBytes writes a list of ImageFormatInfo values to a byte slice. @@ -1052,7 +1058,7 @@ func (v Rational) Bytes() []byte { xgb.Put32(buf[b:], uint32(v.Denominator)) b += 4 - return buf + return buf[:b] } // RationalListBytes writes a list of Rational values to a byte slice. @@ -1730,7 +1736,7 @@ func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b += 2 copy(buf[b:], Data[:len(Data)]) - b += xgb.Pad(int(len(Data))) + b += int(len(Data)) return buf } @@ -2335,6 +2341,7 @@ type QueryImageAttributesReply struct { Height uint16 // padding: 12 bytes Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + // alignment gap to multiple of 4 Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) } @@ -2382,14 +2389,14 @@ func queryImageAttributesReply(buf []byte) *QueryImageAttributesReply { v.Pitches[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) + + b = (b + 3) & ^3 // alignment gap v.Offsets = make([]uint32, v.NumPlanes) for i := 0; i < int(v.NumPlanes); i++ { v.Offsets[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index cd82b33..a574a21 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -156,7 +156,7 @@ func (v SurfaceInfo) Bytes() []byte { xgb.Put32(buf[b:], v.Flags) b += 4 - return buf + return buf[:b] } // SurfaceInfoListBytes writes a list of SurfaceInfo values to a byte slice. @@ -275,7 +275,6 @@ func createContextReply(buf []byte) *CreateContextReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -397,7 +396,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply { v.ComponentOrder = make([]byte, 4) copy(v.ComponentOrder[:4], buf[b:]) - b += xgb.Pad(int(4)) + b += int(4) b += 12 // padding @@ -406,7 +405,6 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -513,7 +511,6 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } From ef8155bf17787473a58f00d54cfc8a7e16ee8708 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 10 May 2014 11:41:51 -0400 Subject: [PATCH 79/90] Formatting and 80 cols. --- nexgb/examples/randr/main.go | 3 ++- nexgb/xgbgen/aligngap.go | 24 +++++++----------------- nexgb/xgbgen/go_request_reply.go | 3 ++- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index ac6fb7a..01ad594 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -49,7 +49,8 @@ func main() { bestMode := info.Modes[0] for _, mode := range resources.Modes { if mode.Id == uint32(bestMode) { - fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height) + fmt.Printf("Width: %d, Height: %d\n", + mode.Width, mode.Height) } } } diff --git a/nexgb/xgbgen/aligngap.go b/nexgb/xgbgen/aligngap.go index 1e07e18..0cd7ac4 100644 --- a/nexgb/xgbgen/aligngap.go +++ b/nexgb/xgbgen/aligngap.go @@ -20,9 +20,11 @@ func (p *Protocol) AddAlignGaps() { } } for i := range p.Requests { - p.Requests[i].Fields = addAlignGapsToFields(p.Requests[i].xmlName, p.Requests[i].Fields) + p.Requests[i].Fields = addAlignGapsToFields( + p.Requests[i].xmlName, p.Requests[i].Fields) if p.Requests[i].Reply != nil { - p.Requests[i].Reply.Fields = addAlignGapsToFields(p.Requests[i].xmlName, p.Requests[i].Reply.Fields) + p.Requests[i].Reply.Fields = addAlignGapsToFields( + p.Requests[i].xmlName, p.Requests[i].Reply.Fields) } } } @@ -57,17 +59,16 @@ func addAlignGapsToFields(name string, fields []Field) []Field { case sz >= 4: r = append(r, &PadField{0, 4}) } - case *LocalField: // nothing - default: - fmt.Fprintf(os.Stderr, "Can't add alignment gaps, mix of list and non-list fields: %s\n", name) + fmt.Fprintf(os.Stderr, + "Can't add alignment gaps, mix of list and non-list "+ + "fields: %s\n", name) return fields } r = append(r, fields[i]) } - return r } @@ -75,22 +76,16 @@ func xcbSizeOfField(fld Field) int { switch f := fld.(type) { case *PadField: return int(f.Bytes) - case *SingleField: return xcbSizeOfType(f.Type) - case *ListField: return 0 - case *ExprField: return xcbSizeOfType(f.Type) - case *ValueField: return xcbSizeOfType(f.MaskType) - case *SwitchField: return 0 - default: return 0 } @@ -100,20 +95,16 @@ func xcbSizeOfType(typ Type) int { switch t := typ.(type) { case *Resource: return 4 - case *TypeDef: return t.Size().Eval() - case *Base: return t.Size().Eval() - case *Struct: sz := 0 for i := range t.Fields { sz += xcbSizeOfField(t.Fields[i]) } return sz - case *Union: sz := 0 for i := range t.Fields { @@ -123,7 +114,6 @@ func xcbSizeOfType(typ Type) int { } } return sz - default: return 0 } diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index d82e157..c1b9ee9 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -155,7 +155,8 @@ func (r *Request) WriteRequest(c *Context) { return } c.Putln("b = xgb.Pad(b)") - c.Putln("xgb.Put16(buf[blen:], uint16(b / 4)) // write request size in 4-byte units") + c.Putln("xgb.Put16(buf[blen:], uint16(b / 4)) " + + "// write request size in 4-byte units") c.Putln("return buf[:b]") } c.Putln("// Write request to wire for %s", r.SrcName()) From a1d1151017ada36a0431969e3e05f35f1dd6204f Mon Sep 17 00:00:00 2001 From: fangyuanziti Date: Sun, 22 Feb 2015 20:22:38 +0800 Subject: [PATCH 80/90] add a new api: NewConnNet --- nexgb/conn.go | 11 +++++++++++ nexgb/xgb.go | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/nexgb/conn.go b/nexgb/conn.go index 41ba5a8..1b7d838 100644 --- a/nexgb/conn.go +++ b/nexgb/conn.go @@ -29,6 +29,17 @@ func (c *Conn) connect(display string) error { return err } + return c.postConnect() +} + +// connect init from to the net.Conn, +func (c *Conn) connectNet(netConn net.Conn) error { + c.conn = netConn + return c.postConnect() +} + +// do the postConnect action after Conn get it's underly net.Conn +func (c *Conn) postConnect() error { // Get authentication data authName, authData, err := readAuthority(c.host, c.display) noauth := false diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 3c7964c..4403ea0 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -98,6 +98,26 @@ func NewConnDisplay(display string) (*Conn, error) { return nil, err } + return postNewConn(conn) +} + +// NewConnDisplay is just like NewConn, but allows a specific net.Conn +// to be used. +func NewConnNet(netConn net.Conn) (*Conn, error) { + conn := &Conn{} + + // First connect. This reads authority, checks DISPLAY environment + // variable, and loads the initial Setup info. + err := conn.connectNet(netConn) + + if err != nil { + return nil, err + } + + return postNewConn(conn) +} + +func postNewConn(conn *Conn) (*Conn, error) { conn.Extensions = make(map[string]byte) conn.cookieChan = make(chan *Cookie, cookieBuffer) From dd00568d44383890cff03d566c014252e096fbfc Mon Sep 17 00:00:00 2001 From: Bryan Matsuo Date: Thu, 4 Dec 2014 18:09:24 -0800 Subject: [PATCH 81/90] assign a sequence id to the cookie before returning from Conn.NewRequest --- nexgb/xgb.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 4403ea0..e7f2411 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -290,6 +290,9 @@ func (c *Conn) generateSeqIds() { type request struct { buf []byte cookie *Cookie + + // seq is closed when the request (cookie) has been sequenced by the Conn. + seq chan struct{} } // NewRequest takes the bytes and a cookie of a particular request, constructs @@ -311,7 +314,9 @@ type request struct { // In all likelihood, you should be able to copy and paste with some minor // edits the generated code for the request you want to issue. func (c *Conn) NewRequest(buf []byte, cookie *Cookie) { - c.reqChan <- &request{buf: buf, cookie: cookie} + seq := make(chan struct{}) + c.reqChan <- &request{buf: buf, cookie: cookie, seq: seq} + <-seq } // sendRequests is run as a single goroutine that takes requests and writes @@ -329,6 +334,7 @@ func (c *Conn) sendRequests() { c.noop() } req.cookie.Sequence = c.newSequenceId() + close(req.seq) c.cookieChan <- req.cookie c.writeBuffer(req.buf) } From 5451e59f884298fdf97ef4420a7bc1001093c3b7 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 26 Apr 2015 19:04:54 -0400 Subject: [PATCH 82/90] Remove panics/fatal errors. Fixes #9. This makes shutdown a little more graceful, but there's more work to be done here. Namely, all outstanding cookies need to be given the error, otherwise they will block forever. --- nexgb/cookie.go | 3 --- nexgb/xgb.go | 65 +++++++++++++++++++++---------------------------- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/nexgb/cookie.go b/nexgb/cookie.go index 6b1e4fb..d5cdb29 100644 --- a/nexgb/cookie.go +++ b/nexgb/cookie.go @@ -99,7 +99,6 @@ func (c Cookie) replyChecked() ([]byte, error) { case err := <-c.errorChan: return nil, err } - panic("unreachable") } // replyUnchecked waits for a response on either the replyChan or pingChan @@ -123,7 +122,6 @@ func (c Cookie) replyUnchecked() ([]byte, error) { case <-c.pingChan: return nil, nil } - panic("unreachable") } // Check is used for checked requests that have no replies. It is a mechanism @@ -164,5 +162,4 @@ func (c Cookie) Check() error { case <-c.pingChan: return nil } - panic("unreachable") } diff --git a/nexgb/xgb.go b/nexgb/xgb.go index e7f2411..487ae16 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -331,7 +331,10 @@ func (c *Conn) sendRequests() { // Note that we circumvent the request channel, because we're *in* // the request channel. if len(c.cookieChan) == cookieBuffer-1 { - c.noop() + if err := c.noop(); err != nil { + // Shut everything down. + break + } } req.cookie.Sequence = c.newSequenceId() close(req.seq) @@ -340,26 +343,31 @@ func (c *Conn) sendRequests() { } response := make(chan struct{}) c.closing <- response - c.noop() // Flush the response reading goroutine. + c.noop() // Flush the response reading goroutine, ignore error. <-response c.conn.Close() } // noop circumvents the usual request sending goroutines and forces a round // trip request manually. -func (c *Conn) noop() { +func (c *Conn) noop() error { cookie := c.NewCookie(true, true) cookie.Sequence = c.newSequenceId() c.cookieChan <- cookie - c.writeBuffer(c.getInputFocusRequest()) + if err := c.writeBuffer(c.getInputFocusRequest()); err != nil { + return err + } cookie.Reply() // wait for the buffer to clear + return nil } // writeBuffer is a convenience function for writing a byte slice to the wire. -func (c *Conn) writeBuffer(buf []byte) { +func (c *Conn) writeBuffer(buf []byte) error { if _, err := c.conn.Write(buf); err != nil { - Logger.Printf("Write error: %s", err) - Logger.Fatal("A write error is unrecoverable. Exiting...") + Logger.Printf("A write error is unrecoverable: %s", err) + return err + } else { + return nil } } @@ -377,7 +385,6 @@ func (c *Conn) readResponses() { var ( err Error - event Event seq uint16 replyBytes []byte ) @@ -391,13 +398,13 @@ func (c *Conn) readResponses() { } buf := make([]byte, 32) - err, event, seq = nil, nil, 0 - + err, seq = nil, 0 if _, err := io.ReadFull(c.conn, buf); err != nil { - Logger.Println("A read error is unrecoverable.") - panic(err) + Logger.Printf("A read error is unrecoverable: %s", err) + c.eventChan <- err + c.Close() + continue } - switch buf[0] { case 0: // This is an error // Use the constructor function for this error (that is auto @@ -423,8 +430,10 @@ func (c *Conn) readResponses() { biggerBuf := make([]byte, byteCount) copy(biggerBuf[:32], buf) if _, err := io.ReadFull(c.conn, biggerBuf[32:]); err != nil { - Logger.Printf("Read error: %s", err) - Logger.Fatal("A read error is unrecoverable. Exiting...") + Logger.Printf("A read error is unrecoverable: %s", err) + c.eventChan <- err + c.Close() + continue } replyBytes = biggerBuf } else { @@ -445,25 +454,7 @@ func (c *Conn) readResponses() { "for event with number %d.", evNum) continue } - - event = newEventFun(buf) - - // Put the event into the queue. - // FIXME: I'm not sure if using a goroutine here to guarantee - // a non-blocking send is the right way to go. I should implement - // a proper dynamic queue. - // I am pretty sure this also loses a guarantee of events being - // processed in order of being received. - select { - case c.eventChan <- event: - default: - go func() { - println("overflowing...") - c.eventChan <- event - }() - } - - // No more processing for events. + c.eventChan <- newEventFun(buf) continue } @@ -535,15 +526,16 @@ func processEventOrError(everr eventOrError) (Event, Error) { Logger.Printf("Invalid event/error type: %T", everr) return nil, nil } - panic("unreachable") } // WaitForEvent returns the next event from the server. // It will block until an event is available. -// WaitForEvent returns either an Event or an Error. (Returning neither or both +// WaitForEvent returns either an Event or an Error. (Returning both // is a bug.) Note than an Error here is an X error and not an XGB error. That // is, X errors are sometimes completely expected (and you may want to ignore // them in some cases). +// +// If both the event and error are nil, then the connection has been closed. func (c *Conn) WaitForEvent() (Event, Error) { return processEventOrError(<-c.eventChan) } @@ -559,5 +551,4 @@ func (c *Conn) PollForEvent() (Event, Error) { default: return nil, nil } - panic("unreachable") } From baff8c19067489ea26bbb804ef693e966202b511 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Sun, 8 Nov 2015 10:56:15 +0100 Subject: [PATCH 83/90] sendRequest reads req.buf after closing req.seq NewRequest says you can avoid reallocating a new buffer for each request by calling it directly. This is not true if req.seq is closed before req.buf is read. --- nexgb/xgb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 487ae16..44634fe 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -337,9 +337,9 @@ func (c *Conn) sendRequests() { } } req.cookie.Sequence = c.newSequenceId() - close(req.seq) c.cookieChan <- req.cookie c.writeBuffer(req.buf) + close(req.seq) } response := make(chan struct{}) c.closing <- response From becaf43dcb3e9832c3eb951ff9908ed697868152 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Tue, 1 Mar 2016 15:41:38 +0100 Subject: [PATCH 84/90] Read/Write mutex for Extensions map --- nexgb/bigreq/bigreq.go | 11 +- nexgb/composite/composite.go | 59 ++- nexgb/damage/damage.go | 35 +- nexgb/dpms/dpms.go | 53 ++- nexgb/dri2/dri2.go | 89 ++++- nexgb/ge/ge.go | 11 +- nexgb/glx/glx.go | 605 ++++++++++++++++++++++++++++++- nexgb/randr/randr.go | 245 ++++++++++++- nexgb/record/record.go | 53 ++- nexgb/render/render.go | 191 +++++++++- nexgb/res/res.go | 41 ++- nexgb/screensaver/screensaver.go | 41 ++- nexgb/shape/shape.go | 59 ++- nexgb/shm/shm.go | 53 ++- nexgb/xcmisc/xcmisc.go | 23 +- nexgb/xevie/xevie.go | 35 +- nexgb/xf86dri/xf86dri.go | 77 +++- nexgb/xf86vidmode/xf86vidmode.go | 131 ++++++- nexgb/xfixes/xfixes.go | 211 ++++++++++- nexgb/xgb.go | 10 +- nexgb/xgbgen/context.go | 5 +- nexgb/xgbgen/go_request_reply.go | 4 + nexgb/xinerama/xinerama.go | 41 ++- nexgb/xprint/xprint.go | 164 ++++++++- nexgb/xproto/xproto.go | 16 +- nexgb/xselinux/xselinux.go | 143 +++++++- nexgb/xtest/xtest.go | 29 +- nexgb/xv/xv.go | 135 ++++++- nexgb/xvmc/xvmc.go | 59 ++- 29 files changed, 2526 insertions(+), 103 deletions(-) diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go index d2adcc7..6590376 100644 --- a/nexgb/bigreq/bigreq.go +++ b/nexgb/bigreq/bigreq.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named BIG-REQUESTS could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["BIG-REQUESTS"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["BIG-REQUESTS"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["BIG-REQUESTS"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -69,6 +68,8 @@ type EnableCookie struct { // Enable sends a checked request. // If an error occurs, it will be returned with the reply by calling EnableCookie.Reply() func Enable(c *xgb.Conn) EnableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["BIG-REQUESTS"]; !ok { panic("Cannot issue request 'Enable' using the uninitialized extension 'BIG-REQUESTS'. bigreq.Init(connObj) must be called first.") } @@ -80,6 +81,8 @@ func Enable(c *xgb.Conn) EnableCookie { // EnableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableUnchecked(c *xgb.Conn) EnableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["BIG-REQUESTS"]; !ok { panic("Cannot issue request 'Enable' using the uninitialized extension 'BIG-REQUESTS'. bigreq.Init(connObj) must be called first.") } @@ -134,7 +137,9 @@ func enableRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["BIG-REQUESTS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/composite/composite.go b/nexgb/composite/composite.go index b7ce2ad..1373f8b 100644 --- a/nexgb/composite/composite.go +++ b/nexgb/composite/composite.go @@ -20,16 +20,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named Composite could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["Composite"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["Composite"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["Composite"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -75,6 +74,8 @@ type CreateRegionFromBorderClipCookie struct { // CreateRegionFromBorderClip sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -86,6 +87,8 @@ func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto // CreateRegionFromBorderClipChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check() func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -107,7 +110,9 @@ func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -133,6 +138,8 @@ type GetOverlayWindowCookie struct { // GetOverlayWindow sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply() func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -144,6 +151,8 @@ func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie // GetOverlayWindowUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'GetOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -201,7 +210,9 @@ func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -224,6 +235,8 @@ type NameWindowPixmapCookie struct { // NameWindowPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -235,6 +248,8 @@ func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) N // NameWindowPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check() func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -256,7 +271,9 @@ func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pi b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -282,6 +299,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -293,6 +312,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -354,7 +375,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -380,6 +403,8 @@ type RedirectSubwindowsCookie struct { // RedirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -391,6 +416,8 @@ func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Redirect // RedirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check() func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -412,7 +439,9 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -440,6 +469,8 @@ type RedirectWindowCookie struct { // RedirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -451,6 +482,8 @@ func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWind // RedirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using RedirectWindowCookie.Check() func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'RedirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -472,7 +505,9 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -500,6 +535,8 @@ type ReleaseOverlayWindowCookie struct { // ReleaseOverlayWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -511,6 +548,8 @@ func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindo // ReleaseOverlayWindowChecked sends a checked request. // If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check() func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -532,7 +571,9 @@ func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -555,6 +596,8 @@ type UnredirectSubwindowsCookie struct { // UnredirectSubwindows sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -566,6 +609,8 @@ func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) Unredi // UnredirectSubwindowsChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check() func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -587,7 +632,9 @@ func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -615,6 +662,8 @@ type UnredirectWindowCookie struct { // UnredirectWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -626,6 +675,8 @@ func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) Unredirect // UnredirectWindowChecked sends a checked request. // If an error occurs, it can be retrieved using UnredirectWindowCookie.Check() func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Composite"]; !ok { panic("Cannot issue request 'UnredirectWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.") } @@ -647,7 +698,9 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Composite"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/damage/damage.go b/nexgb/damage/damage.go index e94936d..26eca04 100644 --- a/nexgb/damage/damage.go +++ b/nexgb/damage/damage.go @@ -20,16 +20,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named DAMAGE could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["DAMAGE"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["DAMAGE"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["DAMAGE"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -235,6 +234,8 @@ type AddCookie struct { // Add sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -246,6 +247,8 @@ func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie // AddChecked sends a checked request. // If an error occurs, it can be retrieved using AddCookie.Check() func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Add' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -267,7 +270,9 @@ func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []b b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DAMAGE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -293,6 +298,8 @@ type CreateCookie struct { // Create sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Create' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -304,6 +311,8 @@ func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) Cr // CreateChecked sends a checked request. // If an error occurs, it can be retrieved using CreateCookie.Check() func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Create' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -325,7 +334,9 @@ func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level b b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DAMAGE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -356,6 +367,8 @@ type DestroyCookie struct { // Destroy sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Destroy' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -367,6 +380,8 @@ func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie { // DestroyChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyCookie.Check() func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Destroy' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -388,7 +403,9 @@ func destroyRequest(c *xgb.Conn, Damage Damage) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DAMAGE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -411,6 +428,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -422,6 +441,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -483,7 +504,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DAMAGE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -509,6 +532,8 @@ type SubtractCookie struct { // Subtract sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Subtract' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -520,6 +545,8 @@ func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Reg // SubtractChecked sends a checked request. // If an error occurs, it can be retrieved using SubtractCookie.Check() func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DAMAGE"]; !ok { panic("Cannot issue request 'Subtract' using the uninitialized extension 'DAMAGE'. damage.Init(connObj) must be called first.") } @@ -541,7 +568,9 @@ func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfi b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DAMAGE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/dpms/dpms.go b/nexgb/dpms/dpms.go index 75ec85d..4bf5883 100644 --- a/nexgb/dpms/dpms.go +++ b/nexgb/dpms/dpms.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named DPMS could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["DPMS"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["DPMS"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["DPMS"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -76,6 +75,8 @@ type CapableCookie struct { // Capable sends a checked request. // If an error occurs, it will be returned with the reply by calling CapableCookie.Reply() func Capable(c *xgb.Conn) CapableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Capable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -87,6 +88,8 @@ func Capable(c *xgb.Conn) CapableCookie { // CapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CapableUnchecked(c *xgb.Conn) CapableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Capable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -148,7 +151,9 @@ func capableRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -168,6 +173,8 @@ type DisableCookie struct { // Disable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Disable(c *xgb.Conn) DisableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -179,6 +186,8 @@ func Disable(c *xgb.Conn) DisableCookie { // DisableChecked sends a checked request. // If an error occurs, it can be retrieved using DisableCookie.Check() func DisableChecked(c *xgb.Conn) DisableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Disable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -200,7 +209,9 @@ func disableRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -220,6 +231,8 @@ type EnableCookie struct { // Enable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Enable(c *xgb.Conn) EnableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -231,6 +244,8 @@ func Enable(c *xgb.Conn) EnableCookie { // EnableChecked sends a checked request. // If an error occurs, it can be retrieved using EnableCookie.Check() func EnableChecked(c *xgb.Conn) EnableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Enable' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -252,7 +267,9 @@ func enableRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -272,6 +289,8 @@ type ForceLevelCookie struct { // ForceLevel sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -283,6 +302,8 @@ func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { // ForceLevelChecked sends a checked request. // If an error occurs, it can be retrieved using ForceLevelCookie.Check() func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'ForceLevel' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -304,7 +325,9 @@ func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -327,6 +350,8 @@ type GetTimeoutsCookie struct { // GetTimeouts sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTimeoutsCookie.Reply() func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'GetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -338,6 +363,8 @@ func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie { // GetTimeoutsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'GetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -403,7 +430,9 @@ func getTimeoutsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -423,6 +452,8 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -434,6 +465,8 @@ func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint1 // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -492,7 +525,9 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -518,6 +553,8 @@ type InfoCookie struct { // Info sends a checked request. // If an error occurs, it will be returned with the reply by calling InfoCookie.Reply() func Info(c *xgb.Conn) InfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Info' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -529,6 +566,8 @@ func Info(c *xgb.Conn) InfoCookie { // InfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InfoUnchecked(c *xgb.Conn) InfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'Info' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -594,7 +633,9 @@ func infoRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -614,6 +655,8 @@ type SetTimeoutsCookie struct { // SetTimeouts sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -625,6 +668,8 @@ func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffT // SetTimeoutsChecked sends a checked request. // If an error occurs, it can be retrieved using SetTimeoutsCookie.Check() func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DPMS"]; !ok { panic("Cannot issue request 'SetTimeouts' using the uninitialized extension 'DPMS'. dpms.Init(connObj) must be called first.") } @@ -646,7 +691,9 @@ func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint1 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DPMS"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 5ad0306..820cf2b 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named DRI2 could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["DRI2"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["DRI2"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["DRI2"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -402,6 +401,8 @@ type AuthenticateCookie struct { // Authenticate sends a checked request. // If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply() func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -413,6 +414,8 @@ func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateC // AuthenticateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -467,7 +470,9 @@ func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -493,6 +498,8 @@ type ConnectCookie struct { // Connect sends a checked request. // If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply() func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'Connect' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -504,6 +511,8 @@ func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie // ConnectUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'Connect' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -586,7 +595,9 @@ func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -612,6 +623,8 @@ type CopyRegionCookie struct { // CopyRegion sends a checked request. // If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply() func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -623,6 +636,8 @@ func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint3 // CopyRegionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -673,7 +688,9 @@ func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Des b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -705,6 +722,8 @@ type CreateDrawableCookie struct { // CreateDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -716,6 +735,8 @@ func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie // CreateDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using CreateDrawableCookie.Check() func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -737,7 +758,9 @@ func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -760,6 +783,8 @@ type DestroyDrawableCookie struct { // DestroyDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -771,6 +796,8 @@ func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCooki // DestroyDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -792,7 +819,9 @@ func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -815,6 +844,8 @@ type GetBuffersCookie struct { // GetBuffers sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply() func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -826,6 +857,8 @@ func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments // GetBuffersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -895,7 +928,9 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -926,6 +961,8 @@ type GetBuffersWithFormatCookie struct { // GetBuffersWithFormat sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply() func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetBuffersWithFormat' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -937,6 +974,8 @@ func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, A // GetBuffersWithFormatUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetBuffersWithFormat' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1006,7 +1045,9 @@ func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -1034,6 +1075,8 @@ type GetMSCCookie struct { // GetMSC sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply() func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1045,6 +1088,8 @@ func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { // GetMSCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1119,7 +1164,9 @@ func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -1142,6 +1189,8 @@ type GetParamCookie struct { // GetParam sends a checked request. // If an error occurs, it will be returned with the reply by calling GetParamCookie.Reply() func GetParam(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetParam' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1153,6 +1202,8 @@ func GetParam(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCooki // GetParamUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetParamUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'GetParam' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1216,7 +1267,9 @@ func getParamRequest(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -1242,6 +1295,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1253,6 +1308,8 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1311,7 +1368,9 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -1337,6 +1396,8 @@ type SwapBuffersCookie struct { // SwapBuffers sends a checked request. // If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply() func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1348,6 +1409,8 @@ func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, Targ // SwapBuffersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1406,7 +1469,9 @@ func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint3 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -1447,6 +1512,8 @@ type SwapIntervalCookie struct { // SwapInterval sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1458,6 +1525,8 @@ func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIn // SwapIntervalChecked sends a checked request. // If an error occurs, it can be retrieved using SwapIntervalCookie.Check() func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'SwapInterval' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1479,7 +1548,9 @@ func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -1505,6 +1576,8 @@ type WaitMSCCookie struct { // WaitMSC sends a checked request. // If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply() func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'WaitMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1516,6 +1589,8 @@ func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMs // WaitMSCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'WaitMSC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1590,7 +1665,9 @@ func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, T b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -1631,6 +1708,8 @@ type WaitSBCCookie struct { // WaitSBC sends a checked request. // If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply() func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'WaitSBC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1642,6 +1721,8 @@ func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSb // WaitSBCUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["DRI2"]; !ok { panic("Cannot issue request 'WaitSBC' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.") } @@ -1716,7 +1797,9 @@ func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, T b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["DRI2"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go index 68213bc..f7e1ce4 100644 --- a/nexgb/ge/ge.go +++ b/nexgb/ge/ge.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named Generic Event Extension could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["Generic Event Extension"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["Generic Event Extension"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["Generic Event Extension"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -69,6 +68,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Generic Event Extension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") } @@ -80,6 +81,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["Generic Event Extension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.") } @@ -141,7 +144,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["Generic Event Extension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index 0951765..cf72d9a 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named GLX could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["GLX"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["GLX"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["GLX"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -1029,6 +1028,8 @@ type AreTexturesResidentCookie struct { // AreTexturesResident sends a checked request. // If an error occurs, it will be returned with the reply by calling AreTexturesResidentCookie.Reply() func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1040,6 +1041,8 @@ func AreTexturesResident(c *xgb.Conn, ContextTag ContextTag, N int32, Textures [ // AreTexturesResidentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AreTexturesResidentUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) AreTexturesResidentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'AreTexturesResident' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1108,7 +1111,9 @@ func areTexturesResidentRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Tex b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 143 // request opcode @@ -1139,6 +1144,8 @@ type ChangeDrawableAttributesCookie struct { // ChangeDrawableAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1150,6 +1157,8 @@ func ChangeDrawableAttributes(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, // ChangeDrawableAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeDrawableAttributesCookie.Check() func ChangeDrawableAttributesChecked(c *xgb.Conn, Drawable Drawable, NumAttribs uint32, Attribs []uint32) ChangeDrawableAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ChangeDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1171,7 +1180,9 @@ func changeDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable, NumAttribs b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 30 // request opcode @@ -1202,6 +1213,8 @@ type ClientInfoCookie struct { // ClientInfo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1213,6 +1226,8 @@ func ClientInfo(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen ui // ClientInfoChecked sends a checked request. // If an error occurs, it can be retrieved using ClientInfoCookie.Check() func ClientInfoChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, StrLen uint32, String string) ClientInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ClientInfo' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1234,7 +1249,9 @@ func clientInfoRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, St b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -1266,6 +1283,8 @@ type CopyContextCookie struct { // CopyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1277,6 +1296,8 @@ func CopyContext(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContext // CopyContextChecked sends a checked request. // If an error occurs, it can be retrieved using CopyContextCookie.Check() func CopyContextChecked(c *xgb.Conn, Src Context, Dest Context, Mask uint32, SrcContextTag ContextTag) CopyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CopyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1298,7 +1319,9 @@ func copyContextRequest(c *xgb.Conn, Src Context, Dest Context, Mask uint32, Src b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -1330,6 +1353,8 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1341,6 +1366,8 @@ func CreateContext(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, Visual xproto.Visualid, Screen uint32, ShareList Context, IsDirect bool) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1362,7 +1389,9 @@ func createContextRequest(c *xgb.Conn, Context Context, Visual xproto.Visualid, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -1403,6 +1432,8 @@ type CreateContextAttribsARBCookie struct { // CreateContextAttribsARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1414,6 +1445,8 @@ func CreateContextAttribsARB(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Sc // CreateContextAttribsARBChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextAttribsARBCookie.Check() func CreateContextAttribsARBChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, ShareList Context, IsDirect bool, NumAttribs uint32, Attribs []uint32) CreateContextAttribsARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateContextAttribsARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1435,7 +1468,9 @@ func createContextAttribsARBRequest(c *xgb.Conn, Context Context, Fbconfig Fbcon b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 34 // request opcode @@ -1484,6 +1519,8 @@ type CreateGLXPixmapCookie struct { // CreateGLXPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1495,6 +1532,8 @@ func CreateGLXPixmap(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap // CreateGLXPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreateGLXPixmapCookie.Check() func CreateGLXPixmapChecked(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, Pixmap xproto.Pixmap, GlxPixmap Pixmap) CreateGLXPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1516,7 +1555,9 @@ func createGLXPixmapRequest(c *xgb.Conn, Screen uint32, Visual xproto.Visualid, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -1548,6 +1589,8 @@ type CreateNewContextCookie struct { // CreateNewContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateNewContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1559,6 +1602,8 @@ func CreateNewContext(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen ui // CreateNewContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateNewContextCookie.Check() func CreateNewContextChecked(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Screen uint32, RenderType uint32, ShareList Context, IsDirect bool) CreateNewContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateNewContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1580,7 +1625,9 @@ func createNewContextRequest(c *xgb.Conn, Context Context, Fbconfig Fbconfig, Sc b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 24 // request opcode @@ -1624,6 +1671,8 @@ type CreatePbufferCookie struct { // CreatePbuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreatePbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1635,6 +1684,8 @@ func CreatePbuffer(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffe // CreatePbufferChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePbufferCookie.Check() func CreatePbufferChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer Pbuffer, NumAttribs uint32, Attribs []uint32) CreatePbufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreatePbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1656,7 +1707,9 @@ func createPbufferRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pbuffer b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 27 // request opcode @@ -1693,6 +1746,8 @@ type CreatePixmapCookie struct { // CreatePixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1704,6 +1759,8 @@ func CreatePixmap(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.P // CreatePixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap xproto.Pixmap, GlxPixmap Pixmap, NumAttribs uint32, Attribs []uint32) CreatePixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1725,7 +1782,9 @@ func createPixmapRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Pixmap x b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -1765,6 +1824,8 @@ type CreateWindowCookie struct { // CreateWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1776,6 +1837,8 @@ func CreateWindow(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.W // CreateWindowChecked sends a checked request. // If an error occurs, it can be retrieved using CreateWindowCookie.Check() func CreateWindowChecked(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window xproto.Window, GlxWindow Window, NumAttribs uint32, Attribs []uint32) CreateWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'CreateWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1797,7 +1860,9 @@ func createWindowRequest(c *xgb.Conn, Screen uint32, Fbconfig Fbconfig, Window x b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 31 // request opcode @@ -1837,6 +1902,8 @@ type DeleteListsCookie struct { // DeleteLists sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1848,6 +1915,8 @@ func DeleteLists(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) D // DeleteListsChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteListsCookie.Check() func DeleteListsChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Range int32) DeleteListsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1869,7 +1938,9 @@ func deleteListsRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Range i b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 103 // request opcode @@ -1898,6 +1969,8 @@ type DeleteQueriesARBCookie struct { // DeleteQueriesARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1909,6 +1982,8 @@ func DeleteQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) // DeleteQueriesARBChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteQueriesARBCookie.Check() func DeleteQueriesARBChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Ids []uint32) DeleteQueriesARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1930,7 +2005,9 @@ func deleteQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Ids [] b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 161 // request opcode @@ -1961,6 +2038,8 @@ type DeleteTexturesCookie struct { // DeleteTextures sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1972,6 +2051,8 @@ func DeleteTextures(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint // DeleteTexturesChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteTexturesCookie.Check() func DeleteTexturesChecked(c *xgb.Conn, ContextTag ContextTag, N int32, Textures []uint32) DeleteTexturesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -1993,7 +2074,9 @@ func deleteTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32, Textures b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 144 // request opcode @@ -2024,6 +2107,8 @@ type DeleteWindowCookie struct { // DeleteWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2035,6 +2120,8 @@ func DeleteWindow(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { // DeleteWindowChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteWindowCookie.Check() func DeleteWindowChecked(c *xgb.Conn, Glxwindow Window) DeleteWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DeleteWindow' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2056,7 +2143,9 @@ func deleteWindowRequest(c *xgb.Conn, Glxwindow Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 32 // request opcode @@ -2079,6 +2168,8 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2090,6 +2181,8 @@ func DestroyContext(c *xgb.Conn, Context Context) DestroyContextCookie { // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Context Context) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2111,7 +2204,9 @@ func destroyContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -2134,6 +2229,8 @@ type DestroyGLXPixmapCookie struct { // DestroyGLXPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2145,6 +2242,8 @@ func DestroyGLXPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { // DestroyGLXPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyGLXPixmapCookie.Check() func DestroyGLXPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyGLXPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyGLXPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2166,7 +2265,9 @@ func destroyGLXPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2189,6 +2290,8 @@ type DestroyPbufferCookie struct { // DestroyPbuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2200,6 +2303,8 @@ func DestroyPbuffer(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { // DestroyPbufferChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyPbufferCookie.Check() func DestroyPbufferChecked(c *xgb.Conn, Pbuffer Pbuffer) DestroyPbufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyPbuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2221,7 +2326,9 @@ func destroyPbufferRequest(c *xgb.Conn, Pbuffer Pbuffer) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 28 // request opcode @@ -2244,6 +2351,8 @@ type DestroyPixmapCookie struct { // DestroyPixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2255,6 +2364,8 @@ func DestroyPixmap(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { // DestroyPixmapChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyPixmapCookie.Check() func DestroyPixmapChecked(c *xgb.Conn, GlxPixmap Pixmap) DestroyPixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'DestroyPixmap' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2276,7 +2387,9 @@ func destroyPixmapRequest(c *xgb.Conn, GlxPixmap Pixmap) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 23 // request opcode @@ -2299,6 +2412,8 @@ type EndListCookie struct { // EndList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'EndList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2310,6 +2425,8 @@ func EndList(c *xgb.Conn, ContextTag ContextTag) EndListCookie { // EndListChecked sends a checked request. // If an error occurs, it can be retrieved using EndListCookie.Check() func EndListChecked(c *xgb.Conn, ContextTag ContextTag) EndListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'EndList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2331,7 +2448,9 @@ func endListRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 102 // request opcode @@ -2354,6 +2473,8 @@ type FeedbackBufferCookie struct { // FeedbackBuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2365,6 +2486,8 @@ func FeedbackBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) // FeedbackBufferChecked sends a checked request. // If an error occurs, it can be retrieved using FeedbackBufferCookie.Check() func FeedbackBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32, Type int32) FeedbackBufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'FeedbackBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2386,7 +2509,9 @@ func feedbackBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32, Type b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 105 // request opcode @@ -2415,6 +2540,8 @@ type FinishCookie struct { // Finish sends a checked request. // If an error occurs, it will be returned with the reply by calling FinishCookie.Reply() func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2426,6 +2553,8 @@ func Finish(c *xgb.Conn, ContextTag ContextTag) FinishCookie { // FinishUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FinishUnchecked(c *xgb.Conn, ContextTag ContextTag) FinishCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Finish' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2476,7 +2605,9 @@ func finishRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 108 // request opcode @@ -2499,6 +2630,8 @@ type FlushCookie struct { // Flush sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2510,6 +2643,8 @@ func Flush(c *xgb.Conn, ContextTag ContextTag) FlushCookie { // FlushChecked sends a checked request. // If an error occurs, it can be retrieved using FlushCookie.Check() func FlushChecked(c *xgb.Conn, ContextTag ContextTag) FlushCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Flush' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2531,7 +2666,9 @@ func flushRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 142 // request opcode @@ -2554,6 +2691,8 @@ type GenListsCookie struct { // GenLists sends a checked request. // If an error occurs, it will be returned with the reply by calling GenListsCookie.Reply() func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2565,6 +2704,8 @@ func GenLists(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { // GenListsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenListsUnchecked(c *xgb.Conn, ContextTag ContextTag, Range int32) GenListsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenLists' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2619,7 +2760,9 @@ func genListsRequest(c *xgb.Conn, ContextTag ContextTag, Range int32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 104 // request opcode @@ -2645,6 +2788,8 @@ type GenQueriesARBCookie struct { // GenQueriesARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GenQueriesARBCookie.Reply() func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2656,6 +2801,8 @@ func GenQueriesARB(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCoo // GenQueriesARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenQueriesARBUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenQueriesARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenQueriesARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2716,7 +2863,9 @@ func genQueriesARBRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 162 // request opcode @@ -2742,6 +2891,8 @@ type GenTexturesCookie struct { // GenTextures sends a checked request. // If an error occurs, it will be returned with the reply by calling GenTexturesCookie.Reply() func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2753,6 +2904,8 @@ func GenTextures(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie // GenTexturesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GenTexturesUnchecked(c *xgb.Conn, ContextTag ContextTag, N int32) GenTexturesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GenTextures' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2813,7 +2966,9 @@ func genTexturesRequest(c *xgb.Conn, ContextTag ContextTag, N int32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 145 // request opcode @@ -2839,6 +2994,8 @@ type GetBooleanvCookie struct { // GetBooleanv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetBooleanvCookie.Reply() func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetBooleanv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2850,6 +3007,8 @@ func GetBooleanv(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCoo // GetBooleanvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetBooleanvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname int32) GetBooleanvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetBooleanv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2929,7 +3088,9 @@ func getBooleanvRequest(c *xgb.Conn, ContextTag ContextTag, Pname int32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 112 // request opcode @@ -2955,6 +3116,8 @@ type GetClipPlaneCookie struct { // GetClipPlane sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClipPlaneCookie.Reply() func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetClipPlane' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -2966,6 +3129,8 @@ func GetClipPlane(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneC // GetClipPlaneUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClipPlaneUnchecked(c *xgb.Conn, ContextTag ContextTag, Plane int32) GetClipPlaneCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetClipPlane' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3026,7 +3191,9 @@ func getClipPlaneRequest(c *xgb.Conn, ContextTag ContextTag, Plane int32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 113 // request opcode @@ -3052,6 +3219,8 @@ type GetColorTableCookie struct { // GetColorTable sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableCookie.Reply() func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3063,6 +3232,8 @@ func GetColorTable(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uin // GetColorTableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetColorTableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTable' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3128,7 +3299,9 @@ func getColorTableRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, For b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 147 // request opcode @@ -3167,6 +3340,8 @@ type GetColorTableParameterfvCookie struct { // GetColorTableParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableParameterfvCookie.Reply() func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3178,6 +3353,8 @@ func GetColorTableParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetColorTableParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTableParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3249,7 +3426,9 @@ func getColorTableParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 148 // request opcode @@ -3278,6 +3457,8 @@ type GetColorTableParameterivCookie struct { // GetColorTableParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetColorTableParameterivCookie.Reply() func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3289,6 +3470,8 @@ func GetColorTableParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetColorTableParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetColorTableParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetColorTableParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetColorTableParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3360,7 +3543,9 @@ func getColorTableParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 149 // request opcode @@ -3389,6 +3574,8 @@ type GetCompressedTexImageARBCookie struct { // GetCompressedTexImageARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCompressedTexImageARBCookie.Reply() func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3400,6 +3587,8 @@ func GetCompressedTexImageARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetCompressedTexImageARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCompressedTexImageARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32) GetCompressedTexImageARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetCompressedTexImageARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3465,7 +3654,9 @@ func getCompressedTexImageARBRequest(c *xgb.Conn, ContextTag ContextTag, Target b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 160 // request opcode @@ -3494,6 +3685,8 @@ type GetConvolutionFilterCookie struct { // GetConvolutionFilter sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionFilterCookie.Reply() func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3505,6 +3698,8 @@ func GetConvolutionFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, For // GetConvolutionFilterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetConvolutionFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3574,7 +3769,9 @@ func getConvolutionFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 150 // request opcode @@ -3613,6 +3810,8 @@ type GetConvolutionParameterfvCookie struct { // GetConvolutionParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionParameterfvCookie.Reply() func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3624,6 +3823,8 @@ func GetConvolutionParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32 // GetConvolutionParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3695,7 +3896,9 @@ func getConvolutionParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 151 // request opcode @@ -3724,6 +3927,8 @@ type GetConvolutionParameterivCookie struct { // GetConvolutionParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetConvolutionParameterivCookie.Reply() func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3735,6 +3940,8 @@ func GetConvolutionParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32 // GetConvolutionParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetConvolutionParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetConvolutionParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetConvolutionParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3806,7 +4013,9 @@ func getConvolutionParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 152 // request opcode @@ -3835,6 +4044,8 @@ type GetDoublevCookie struct { // GetDoublev sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDoublevCookie.Reply() func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetDoublev' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3846,6 +4057,8 @@ func GetDoublev(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCook // GetDoublevUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDoublevUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetDoublevCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetDoublev' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3917,7 +4130,9 @@ func getDoublevRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 114 // request opcode @@ -3943,6 +4158,8 @@ type GetDrawableAttributesCookie struct { // GetDrawableAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDrawableAttributesCookie.Reply() func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -3954,6 +4171,8 @@ func GetDrawableAttributes(c *xgb.Conn, Drawable Drawable) GetDrawableAttributes // GetDrawableAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableAttributesUnchecked(c *xgb.Conn, Drawable Drawable) GetDrawableAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetDrawableAttributes' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4018,7 +4237,9 @@ func getDrawableAttributesRequest(c *xgb.Conn, Drawable Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 29 // request opcode @@ -4041,6 +4262,8 @@ type GetErrorCookie struct { // GetError sends a checked request. // If an error occurs, it will be returned with the reply by calling GetErrorCookie.Reply() func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetError' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4052,6 +4275,8 @@ func GetError(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { // GetErrorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetErrorUnchecked(c *xgb.Conn, ContextTag ContextTag) GetErrorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetError' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4106,7 +4331,9 @@ func getErrorRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 115 // request opcode @@ -4129,6 +4356,8 @@ type GetFBConfigsCookie struct { // GetFBConfigs sends a checked request. // If an error occurs, it will be returned with the reply by calling GetFBConfigsCookie.Reply() func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4140,6 +4369,8 @@ func GetFBConfigs(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { // GetFBConfigsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFBConfigsUnchecked(c *xgb.Conn, Screen uint32) GetFBConfigsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetFBConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4208,7 +4439,9 @@ func getFBConfigsRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 21 // request opcode @@ -4231,6 +4464,8 @@ type GetFloatvCookie struct { // GetFloatv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetFloatvCookie.Reply() func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetFloatv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4242,6 +4477,8 @@ func GetFloatv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie // GetFloatvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFloatvUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetFloatvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetFloatv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4313,7 +4550,9 @@ func getFloatvRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 116 // request opcode @@ -4339,6 +4578,8 @@ type GetHistogramCookie struct { // GetHistogram sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramCookie.Reply() func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4350,6 +4591,8 @@ func GetHistogram(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint // GetHistogramUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetHistogramCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogram' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4415,7 +4658,9 @@ func getHistogramRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Form b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 154 // request opcode @@ -4461,6 +4706,8 @@ type GetHistogramParameterfvCookie struct { // GetHistogramParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramParameterfvCookie.Reply() func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4472,6 +4719,8 @@ func GetHistogramParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetHistogramParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogramParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4543,7 +4792,9 @@ func getHistogramParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target u b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 155 // request opcode @@ -4572,6 +4823,8 @@ type GetHistogramParameterivCookie struct { // GetHistogramParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetHistogramParameterivCookie.Reply() func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4583,6 +4836,8 @@ func GetHistogramParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, // GetHistogramParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetHistogramParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetHistogramParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetHistogramParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4654,7 +4909,9 @@ func getHistogramParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target u b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 156 // request opcode @@ -4683,6 +4940,8 @@ type GetIntegervCookie struct { // GetIntegerv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetIntegervCookie.Reply() func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetIntegerv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4694,6 +4953,8 @@ func GetIntegerv(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCo // GetIntegervUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetIntegervUnchecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32) GetIntegervCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetIntegerv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4765,7 +5026,9 @@ func getIntegervRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 117 // request opcode @@ -4791,6 +5054,8 @@ type GetLightfvCookie struct { // GetLightfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetLightfvCookie.Reply() func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetLightfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4802,6 +5067,8 @@ func GetLightfv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) // GetLightfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetLightfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4873,7 +5140,9 @@ func getLightfvRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname u b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 118 // request opcode @@ -4902,6 +5171,8 @@ type GetLightivCookie struct { // GetLightiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetLightivCookie.Reply() func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetLightiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4913,6 +5184,8 @@ func GetLightiv(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) // GetLightivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetLightivUnchecked(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname uint32) GetLightivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetLightiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -4984,7 +5257,9 @@ func getLightivRequest(c *xgb.Conn, ContextTag ContextTag, Light uint32, Pname u b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 119 // request opcode @@ -5013,6 +5288,8 @@ type GetMapdvCookie struct { // GetMapdv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapdvCookie.Reply() func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapdv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5024,6 +5301,8 @@ func GetMapdv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapdvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapdvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapdvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapdv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5095,7 +5374,9 @@ func getMapdvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 120 // request opcode @@ -5124,6 +5405,8 @@ type GetMapfvCookie struct { // GetMapfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapfvCookie.Reply() func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5135,6 +5418,8 @@ func GetMapfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5206,7 +5491,9 @@ func getMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 121 // request opcode @@ -5235,6 +5522,8 @@ type GetMapivCookie struct { // GetMapiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMapivCookie.Reply() func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5246,6 +5535,8 @@ func GetMapiv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) G // GetMapivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMapivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query uint32) GetMapivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMapiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5317,7 +5608,9 @@ func getMapivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Query ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 122 // request opcode @@ -5346,6 +5639,8 @@ type GetMaterialfvCookie struct { // GetMaterialfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMaterialfvCookie.Reply() func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMaterialfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5357,6 +5652,8 @@ func GetMaterialfv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32 // GetMaterialfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMaterialfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5428,7 +5725,9 @@ func getMaterialfvRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 123 // request opcode @@ -5457,6 +5756,8 @@ type GetMaterialivCookie struct { // GetMaterialiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMaterialivCookie.Reply() func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMaterialiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5468,6 +5769,8 @@ func GetMaterialiv(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32 // GetMaterialivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMaterialivUnchecked(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname uint32) GetMaterialivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMaterialiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5539,7 +5842,9 @@ func getMaterialivRequest(c *xgb.Conn, ContextTag ContextTag, Face uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 124 // request opcode @@ -5568,6 +5873,8 @@ type GetMinmaxCookie struct { // GetMinmax sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxCookie.Reply() func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5579,6 +5886,8 @@ func GetMinmax(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, // GetMinmaxUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool, Reset bool) GetMinmaxCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmax' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5637,7 +5946,9 @@ func getMinmaxRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 157 // request opcode @@ -5683,6 +5994,8 @@ type GetMinmaxParameterfvCookie struct { // GetMinmaxParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxParameterfvCookie.Reply() func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5694,6 +6007,8 @@ func GetMinmaxParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna // GetMinmaxParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmaxParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5765,7 +6080,9 @@ func getMinmaxParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 158 // request opcode @@ -5794,6 +6111,8 @@ type GetMinmaxParameterivCookie struct { // GetMinmaxParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMinmaxParameterivCookie.Reply() func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5805,6 +6124,8 @@ func GetMinmaxParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna // GetMinmaxParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMinmaxParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetMinmaxParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetMinmaxParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5876,7 +6197,9 @@ func getMinmaxParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 159 // request opcode @@ -5905,6 +6228,8 @@ type GetPixelMapfvCookie struct { // GetPixelMapfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapfvCookie.Reply() func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5916,6 +6241,8 @@ func GetPixelMapfv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfv // GetPixelMapfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -5987,7 +6314,9 @@ func getPixelMapfvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 125 // request opcode @@ -6013,6 +6342,8 @@ type GetPixelMapuivCookie struct { // GetPixelMapuiv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapuivCookie.Reply() func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapuiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6024,6 +6355,8 @@ func GetPixelMapuiv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapu // GetPixelMapuivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapuivUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapuivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapuiv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6095,7 +6428,9 @@ func getPixelMapuivRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byt b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 126 // request opcode @@ -6121,6 +6456,8 @@ type GetPixelMapusvCookie struct { // GetPixelMapusv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPixelMapusvCookie.Reply() func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapusv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6132,6 +6469,8 @@ func GetPixelMapusv(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapu // GetPixelMapusvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPixelMapusvUnchecked(c *xgb.Conn, ContextTag ContextTag, Map uint32) GetPixelMapusvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPixelMapusv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6203,7 +6542,9 @@ func getPixelMapusvRequest(c *xgb.Conn, ContextTag ContextTag, Map uint32) []byt b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 127 // request opcode @@ -6229,6 +6570,8 @@ type GetPolygonStippleCookie struct { // GetPolygonStipple sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPolygonStippleCookie.Reply() func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPolygonStipple' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6240,6 +6583,8 @@ func GetPolygonStipple(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPol // GetPolygonStippleUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPolygonStippleUnchecked(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) GetPolygonStippleCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetPolygonStipple' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6298,7 +6643,9 @@ func getPolygonStippleRequest(c *xgb.Conn, ContextTag ContextTag, LsbFirst bool) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 128 // request opcode @@ -6328,6 +6675,8 @@ type GetQueryObjectivARBCookie struct { // GetQueryObjectivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryObjectivARBCookie.Reply() func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6339,6 +6688,8 @@ func GetQueryObjectivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname ui // GetQueryObjectivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryObjectivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6410,7 +6761,9 @@ func getQueryObjectivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, P b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 165 // request opcode @@ -6439,6 +6792,8 @@ type GetQueryObjectuivARBCookie struct { // GetQueryObjectuivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryObjectuivARBCookie.Reply() func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6450,6 +6805,8 @@ func GetQueryObjectuivARB(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname u // GetQueryObjectuivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryObjectuivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32, Pname uint32) GetQueryObjectuivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryObjectuivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6521,7 +6878,9 @@ func getQueryObjectuivARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 166 // request opcode @@ -6550,6 +6909,8 @@ type GetQueryivARBCookie struct { // GetQueryivARB sends a checked request. // If an error occurs, it will be returned with the reply by calling GetQueryivARBCookie.Reply() func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6561,6 +6922,8 @@ func GetQueryivARB(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint // GetQueryivARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetQueryivARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetQueryivARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetQueryivARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6632,7 +6995,9 @@ func getQueryivARBRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pna b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 164 // request opcode @@ -6661,6 +7026,8 @@ type GetSeparableFilterCookie struct { // GetSeparableFilter sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSeparableFilterCookie.Reply() func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6672,6 +7039,8 @@ func GetSeparableFilter(c *xgb.Conn, ContextTag ContextTag, Target uint32, Forma // GetSeparableFilterUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSeparableFilterUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Format uint32, Type uint32, SwapBytes bool) GetSeparableFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetSeparableFilter' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6741,7 +7110,9 @@ func getSeparableFilterRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 153 // request opcode @@ -6780,6 +7151,8 @@ type GetStringCookie struct { // GetString sends a checked request. // If an error occurs, it will be returned with the reply by calling GetStringCookie.Reply() func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6791,6 +7164,8 @@ func GetString(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie // GetStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStringUnchecked(c *xgb.Conn, ContextTag ContextTag, Name uint32) GetStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6859,7 +7234,9 @@ func getStringRequest(c *xgb.Conn, ContextTag ContextTag, Name uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 129 // request opcode @@ -6885,6 +7262,8 @@ type GetTexEnvfvCookie struct { // GetTexEnvfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexEnvfvCookie.Reply() func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexEnvfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6896,6 +7275,8 @@ func GetTexEnvfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32 // GetTexEnvfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexEnvfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -6967,7 +7348,9 @@ func getTexEnvfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 130 // request opcode @@ -6996,6 +7379,8 @@ type GetTexEnvivCookie struct { // GetTexEnviv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexEnvivCookie.Reply() func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexEnviv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7007,6 +7392,8 @@ func GetTexEnviv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32 // GetTexEnvivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexEnvivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexEnvivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexEnviv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7078,7 +7465,9 @@ func getTexEnvivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 131 // request opcode @@ -7107,6 +7496,8 @@ type GetTexGendvCookie struct { // GetTexGendv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGendvCookie.Reply() func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGendv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7118,6 +7509,8 @@ func GetTexGendv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGendvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGendvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGendvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGendv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7189,7 +7582,9 @@ func getTexGendvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 132 // request opcode @@ -7218,6 +7613,8 @@ type GetTexGenfvCookie struct { // GetTexGenfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGenfvCookie.Reply() func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGenfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7229,6 +7626,8 @@ func GetTexGenfv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGenfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGenfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7300,7 +7699,9 @@ func getTexGenfvRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 133 // request opcode @@ -7329,6 +7730,8 @@ type GetTexGenivCookie struct { // GetTexGeniv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexGenivCookie.Reply() func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGeniv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7340,6 +7743,8 @@ func GetTexGeniv(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) // GetTexGenivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexGenivUnchecked(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname uint32) GetTexGenivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexGeniv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7411,7 +7816,9 @@ func getTexGenivRequest(c *xgb.Conn, ContextTag ContextTag, Coord uint32, Pname b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 134 // request opcode @@ -7440,6 +7847,8 @@ type GetTexImageCookie struct { // GetTexImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexImageCookie.Reply() func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexImage' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7451,6 +7860,8 @@ func GetTexImage(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, // GetTexImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexImageUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Format uint32, Type uint32, SwapBytes bool) GetTexImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexImage' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7524,7 +7935,9 @@ func getTexImageRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 135 // request opcode @@ -7566,6 +7979,8 @@ type GetTexLevelParameterfvCookie struct { // GetTexLevelParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexLevelParameterfvCookie.Reply() func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexLevelParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7577,6 +7992,8 @@ func GetTexLevelParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, L // GetTexLevelParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexLevelParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7648,7 +8065,9 @@ func getTexLevelParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 138 // request opcode @@ -7680,6 +8099,8 @@ type GetTexLevelParameterivCookie struct { // GetTexLevelParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexLevelParameterivCookie.Reply() func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexLevelParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7691,6 +8112,8 @@ func GetTexLevelParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, L // GetTexLevelParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexLevelParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Level int32, Pname uint32) GetTexLevelParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexLevelParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7762,7 +8185,9 @@ func getTexLevelParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 139 // request opcode @@ -7794,6 +8219,8 @@ type GetTexParameterfvCookie struct { // GetTexParameterfv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexParameterfvCookie.Reply() func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7805,6 +8232,8 @@ func GetTexParameterfv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname // GetTexParameterfvUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterfvUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterfvCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexParameterfv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7876,7 +8305,9 @@ func getTexParameterfvRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 136 // request opcode @@ -7905,6 +8336,8 @@ type GetTexParameterivCookie struct { // GetTexParameteriv sends a checked request. // If an error occurs, it will be returned with the reply by calling GetTexParameterivCookie.Reply() func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7916,6 +8349,8 @@ func GetTexParameteriv(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname // GetTexParameterivUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetTexParameterivUnchecked(c *xgb.Conn, ContextTag ContextTag, Target uint32, Pname uint32) GetTexParameterivCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetTexParameteriv' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -7987,7 +8422,9 @@ func getTexParameterivRequest(c *xgb.Conn, ContextTag ContextTag, Target uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 137 // request opcode @@ -8016,6 +8453,8 @@ type GetVisualConfigsCookie struct { // GetVisualConfigs sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVisualConfigsCookie.Reply() func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8027,6 +8466,8 @@ func GetVisualConfigs(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { // GetVisualConfigsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVisualConfigsUnchecked(c *xgb.Conn, Screen uint32) GetVisualConfigsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'GetVisualConfigs' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8095,7 +8536,9 @@ func getVisualConfigsRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -8118,6 +8561,8 @@ type IsDirectCookie struct { // IsDirect sends a checked request. // If an error occurs, it will be returned with the reply by calling IsDirectCookie.Reply() func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8129,6 +8574,8 @@ func IsDirect(c *xgb.Conn, Context Context) IsDirectCookie { // IsDirectUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsDirectUnchecked(c *xgb.Conn, Context Context) IsDirectCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsDirect' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8190,7 +8637,9 @@ func isDirectRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -8213,6 +8662,8 @@ type IsListCookie struct { // IsList sends a checked request. // If an error occurs, it will be returned with the reply by calling IsListCookie.Reply() func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8224,6 +8675,8 @@ func IsList(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { // IsListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsListUnchecked(c *xgb.Conn, ContextTag ContextTag, List uint32) IsListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8278,7 +8731,9 @@ func isListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 141 // request opcode @@ -8304,6 +8759,8 @@ type IsQueryARBCookie struct { // IsQueryARB sends a checked request. // If an error occurs, it will be returned with the reply by calling IsQueryARBCookie.Reply() func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsQueryARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8315,6 +8772,8 @@ func IsQueryARB(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie // IsQueryARBUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsQueryARBUnchecked(c *xgb.Conn, ContextTag ContextTag, Id uint32) IsQueryARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsQueryARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8369,7 +8828,9 @@ func isQueryARBRequest(c *xgb.Conn, ContextTag ContextTag, Id uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 163 // request opcode @@ -8395,6 +8856,8 @@ type IsTextureCookie struct { // IsTexture sends a checked request. // If an error occurs, it will be returned with the reply by calling IsTextureCookie.Reply() func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8406,6 +8869,8 @@ func IsTexture(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCook // IsTextureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsTextureUnchecked(c *xgb.Conn, ContextTag ContextTag, Texture uint32) IsTextureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'IsTexture' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8460,7 +8925,9 @@ func isTextureRequest(c *xgb.Conn, ContextTag ContextTag, Texture uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 146 // request opcode @@ -8486,6 +8953,8 @@ type MakeContextCurrentCookie struct { // MakeContextCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling MakeContextCurrentCookie.Reply() func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8497,6 +8966,8 @@ func MakeContextCurrent(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable // MakeContextCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeContextCurrentUnchecked(c *xgb.Conn, OldContextTag ContextTag, Drawable Drawable, ReadDrawable Drawable, Context Context) MakeContextCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'MakeContextCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8554,7 +9025,9 @@ func makeContextCurrentRequest(c *xgb.Conn, OldContextTag ContextTag, Drawable D b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 26 // request opcode @@ -8586,6 +9059,8 @@ type MakeCurrentCookie struct { // MakeCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling MakeCurrentCookie.Reply() func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8597,6 +9072,8 @@ func MakeCurrent(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag // MakeCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MakeCurrentUnchecked(c *xgb.Conn, Drawable Drawable, Context Context, OldContextTag ContextTag) MakeCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'MakeCurrent' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8654,7 +9131,9 @@ func makeCurrentRequest(c *xgb.Conn, Drawable Drawable, Context Context, OldCont b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -8683,6 +9162,8 @@ type NewListCookie struct { // NewList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8694,6 +9175,8 @@ func NewList(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewLi // NewListChecked sends a checked request. // If an error occurs, it can be retrieved using NewListCookie.Check() func NewListChecked(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32) NewListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'NewList' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8715,7 +9198,9 @@ func newListRequest(c *xgb.Conn, ContextTag ContextTag, List uint32, Mode uint32 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 101 // request opcode @@ -8744,6 +9229,8 @@ type PixelStorefCookie struct { // PixelStoref sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8755,6 +9242,8 @@ func PixelStoref(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32 // PixelStorefChecked sends a checked request. // If an error occurs, it can be retrieved using PixelStorefCookie.Check() func PixelStorefChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum Float32) PixelStorefCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'PixelStoref' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8776,7 +9265,9 @@ func pixelStorefRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 109 // request opcode @@ -8805,6 +9296,8 @@ type PixelStoreiCookie struct { // PixelStorei sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8816,6 +9309,8 @@ func PixelStorei(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) // PixelStoreiChecked sends a checked request. // If an error occurs, it can be retrieved using PixelStoreiCookie.Check() func PixelStoreiChecked(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum int32) PixelStoreiCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'PixelStorei' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8837,7 +9332,9 @@ func pixelStoreiRequest(c *xgb.Conn, ContextTag ContextTag, Pname uint32, Datum b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 110 // request opcode @@ -8866,6 +9363,8 @@ type QueryContextCookie struct { // QueryContext sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryContextCookie.Reply() func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8877,6 +9376,8 @@ func QueryContext(c *xgb.Conn, Context Context) QueryContextCookie { // QueryContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryContextUnchecked(c *xgb.Conn, Context Context) QueryContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryContext' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8941,7 +9442,9 @@ func queryContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 25 // request opcode @@ -8964,6 +9467,8 @@ type QueryExtensionsStringCookie struct { // QueryExtensionsString sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtensionsStringCookie.Reply() func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -8975,6 +9480,8 @@ func QueryExtensionsString(c *xgb.Conn, Screen uint32) QueryExtensionsStringCook // QueryExtensionsStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionsStringUnchecked(c *xgb.Conn, Screen uint32) QueryExtensionsStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryExtensionsString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9035,7 +9542,9 @@ func queryExtensionsStringRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -9058,6 +9567,8 @@ type QueryServerStringCookie struct { // QueryServerString sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryServerStringCookie.Reply() func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9069,6 +9580,8 @@ func QueryServerString(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStrin // QueryServerStringUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryServerStringUnchecked(c *xgb.Conn, Screen uint32, Name uint32) QueryServerStringCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryServerString' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9137,7 +9650,9 @@ func queryServerStringRequest(c *xgb.Conn, Screen uint32, Name uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -9163,6 +9678,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9174,6 +9691,8 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9235,7 +9754,9 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -9261,6 +9782,8 @@ type ReadPixelsCookie struct { // ReadPixels sends a checked request. // If an error occurs, it will be returned with the reply by calling ReadPixelsCookie.Reply() func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9272,6 +9795,8 @@ func ReadPixels(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int3 // ReadPixelsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReadPixelsUnchecked(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Width int32, Height int32, Format uint32, Type uint32, SwapBytes bool, LsbFirst bool) ReadPixelsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'ReadPixels' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9330,7 +9855,9 @@ func readPixelsRequest(c *xgb.Conn, ContextTag ContextTag, X int32, Y int32, Wid b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 111 // request opcode @@ -9385,6 +9912,8 @@ type RenderCookie struct { // Render sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9396,6 +9925,8 @@ func Render(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { // RenderChecked sends a checked request. // If an error occurs, it can be retrieved using RenderCookie.Check() func RenderChecked(c *xgb.Conn, ContextTag ContextTag, Data []byte) RenderCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'Render' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9417,7 +9948,9 @@ func renderRequest(c *xgb.Conn, ContextTag ContextTag, Data []byte) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -9443,6 +9976,8 @@ type RenderLargeCookie struct { // RenderLarge sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9454,6 +9989,8 @@ func RenderLarge(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestT // RenderLargeChecked sends a checked request. // If an error occurs, it can be retrieved using RenderLargeCookie.Check() func RenderLargeChecked(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, RequestTotal uint16, DataLen uint32, Data []byte) RenderLargeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'RenderLarge' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9475,7 +10012,9 @@ func renderLargeRequest(c *xgb.Conn, ContextTag ContextTag, RequestNum uint16, R b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -9510,6 +10049,8 @@ type RenderModeCookie struct { // RenderMode sends a checked request. // If an error occurs, it will be returned with the reply by calling RenderModeCookie.Reply() func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9521,6 +10062,8 @@ func RenderMode(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCooki // RenderModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RenderModeUnchecked(c *xgb.Conn, ContextTag ContextTag, Mode uint32) RenderModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'RenderMode' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9593,7 +10136,9 @@ func renderModeRequest(c *xgb.Conn, ContextTag ContextTag, Mode uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 107 // request opcode @@ -9619,6 +10164,8 @@ type SelectBufferCookie struct { // SelectBuffer sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9630,6 +10177,8 @@ func SelectBuffer(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCo // SelectBufferChecked sends a checked request. // If an error occurs, it can be retrieved using SelectBufferCookie.Check() func SelectBufferChecked(c *xgb.Conn, ContextTag ContextTag, Size int32) SelectBufferCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SelectBuffer' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9651,7 +10200,9 @@ func selectBufferRequest(c *xgb.Conn, ContextTag ContextTag, Size int32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 106 // request opcode @@ -9677,6 +10228,8 @@ type SetClientInfo2ARBCookie struct { // SetClientInfo2ARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9688,6 +10241,8 @@ func SetClientInfo2ARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, Nu // SetClientInfo2ARBChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientInfo2ARBCookie.Check() func SetClientInfo2ARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfo2ARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SetClientInfo2ARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9709,7 +10264,9 @@ func setClientInfo2ARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 35 // request opcode @@ -9755,6 +10312,8 @@ type SetClientInfoARBCookie struct { // SetClientInfoARB sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9766,6 +10325,8 @@ func SetClientInfoARB(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, Num // SetClientInfoARBChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientInfoARBCookie.Check() func SetClientInfoARBChecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32, NumVersions uint32, GlStrLen uint32, GlxStrLen uint32, GlVersions []uint32, GlExtensionString string, GlxExtensionString string) SetClientInfoARBCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SetClientInfoARB' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9787,7 +10348,9 @@ func setClientInfoARBRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 33 // request opcode @@ -9833,6 +10396,8 @@ type SwapBuffersCookie struct { // SwapBuffers sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9844,6 +10409,8 @@ func SwapBuffers(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuff // SwapBuffersChecked sends a checked request. // If an error occurs, it can be retrieved using SwapBuffersCookie.Check() func SwapBuffersChecked(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) SwapBuffersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'SwapBuffers' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9865,7 +10432,9 @@ func swapBuffersRequest(c *xgb.Conn, ContextTag ContextTag, Drawable Drawable) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -9891,6 +10460,8 @@ type UseXFontCookie struct { // UseXFont sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9902,6 +10473,8 @@ func UseXFont(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32 // UseXFontChecked sends a checked request. // If an error occurs, it can be retrieved using UseXFontCookie.Check() func UseXFontChecked(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First uint32, Count uint32, ListBase uint32) UseXFontCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'UseXFont' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9923,7 +10496,9 @@ func useXFontRequest(c *xgb.Conn, ContextTag ContextTag, Font xproto.Font, First b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -9958,6 +10533,8 @@ type VendorPrivateCookie struct { // VendorPrivate sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9969,6 +10546,8 @@ func VendorPrivate(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data [ // VendorPrivateChecked sends a checked request. // If an error occurs, it can be retrieved using VendorPrivateCookie.Check() func VendorPrivateChecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'VendorPrivate' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -9990,7 +10569,9 @@ func vendorPrivateRequest(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -10019,6 +10600,8 @@ type VendorPrivateWithReplyCookie struct { // VendorPrivateWithReply sends a checked request. // If an error occurs, it will be returned with the reply by calling VendorPrivateWithReplyCookie.Reply() func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10030,6 +10613,8 @@ func VendorPrivateWithReply(c *xgb.Conn, VendorCode uint32, ContextTag ContextTa // VendorPrivateWithReplyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func VendorPrivateWithReplyUnchecked(c *xgb.Conn, VendorCode uint32, ContextTag ContextTag, Data []byte) VendorPrivateWithReplyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'VendorPrivateWithReply' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10094,7 +10679,9 @@ func vendorPrivateWithReplyRequest(c *xgb.Conn, VendorCode uint32, ContextTag Co b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -10123,6 +10710,8 @@ type WaitGLCookie struct { // WaitGL sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10134,6 +10723,8 @@ func WaitGL(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { // WaitGLChecked sends a checked request. // If an error occurs, it can be retrieved using WaitGLCookie.Check() func WaitGLChecked(c *xgb.Conn, ContextTag ContextTag) WaitGLCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'WaitGL' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10155,7 +10746,9 @@ func waitGLRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -10178,6 +10771,8 @@ type WaitXCookie struct { // WaitX sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10189,6 +10784,8 @@ func WaitX(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { // WaitXChecked sends a checked request. // If an error occurs, it can be retrieved using WaitXCookie.Check() func WaitXChecked(c *xgb.Conn, ContextTag ContextTag) WaitXCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["GLX"]; !ok { panic("Cannot issue request 'WaitX' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") } @@ -10210,7 +10807,9 @@ func waitXRequest(c *xgb.Conn, ContextTag ContextTag) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 20dc62a..021c011 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -20,16 +20,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named RANDR could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["RANDR"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["RANDR"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["RANDR"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -1680,6 +1679,8 @@ type AddOutputModeCookie struct { // AddOutputMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1691,6 +1692,8 @@ func AddOutputMode(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { // AddOutputModeChecked sends a checked request. // If an error occurs, it can be retrieved using AddOutputModeCookie.Check() func AddOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) AddOutputModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'AddOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1712,7 +1715,9 @@ func addOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -1738,6 +1743,8 @@ type ChangeOutputPropertyCookie struct { // ChangeOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1749,6 +1756,8 @@ func ChangeOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type // ChangeOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeOutputPropertyCookie.Check() func ChangeOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumUnits uint32, Data []byte) ChangeOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ChangeOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1770,7 +1779,9 @@ func changeOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -1813,6 +1824,8 @@ type ChangeProviderPropertyCookie struct { // ChangeProviderProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumItems uint32, Data []byte) ChangeProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ChangeProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1824,6 +1837,8 @@ func ChangeProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom // ChangeProviderPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeProviderPropertyCookie.Check() func ChangeProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, Format byte, Mode byte, NumItems uint32, Data []byte) ChangeProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ChangeProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1845,7 +1860,9 @@ func changeProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xpro b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 39 // request opcode @@ -1888,6 +1905,8 @@ type ConfigureOutputPropertyCookie struct { // ConfigureOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1899,6 +1918,8 @@ func ConfigureOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, P // ConfigureOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ConfigureOutputPropertyCookie.Check() func ConfigureOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ConfigureOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1920,7 +1941,9 @@ func configureOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto. b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -1967,6 +1990,8 @@ type ConfigureProviderPropertyCookie struct { // ConfigureProviderProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ConfigureProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1978,6 +2003,8 @@ func ConfigureProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.A // ConfigureProviderPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using ConfigureProviderPropertyCookie.Check() func ConfigureProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Pending bool, Range bool, Values []int32) ConfigureProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ConfigureProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -1999,7 +2026,9 @@ func configureProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property x b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 38 // request opcode @@ -2046,6 +2075,8 @@ type CreateModeCookie struct { // CreateMode sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateModeCookie.Reply() func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2057,6 +2088,8 @@ func CreateMode(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name strin // CreateModeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateModeUnchecked(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Name string) CreateModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'CreateMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2114,7 +2147,9 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -2146,6 +2181,8 @@ type DeleteOutputModeCookie struct { // DeleteOutputMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2157,6 +2194,8 @@ func DeleteOutputMode(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCoo // DeleteOutputModeChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteOutputModeCookie.Check() func DeleteOutputModeChecked(c *xgb.Conn, Output Output, Mode Mode) DeleteOutputModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteOutputMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2178,7 +2217,9 @@ func deleteOutputModeRequest(c *xgb.Conn, Output Output, Mode Mode) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -2204,6 +2245,8 @@ type DeleteOutputPropertyCookie struct { // DeleteOutputProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2215,6 +2258,8 @@ func DeleteOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) Dele // DeleteOutputPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteOutputPropertyCookie.Check() func DeleteOutputPropertyChecked(c *xgb.Conn, Output Output, Property xproto.Atom) DeleteOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2236,7 +2281,9 @@ func deleteOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Ato b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -2262,6 +2309,8 @@ type DeleteProviderPropertyCookie struct { // DeleteProviderProperty sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom) DeleteProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2273,6 +2322,8 @@ func DeleteProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom // DeleteProviderPropertyChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteProviderPropertyCookie.Check() func DeleteProviderPropertyChecked(c *xgb.Conn, Provider Provider, Property xproto.Atom) DeleteProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DeleteProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2294,7 +2345,9 @@ func deleteProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xpro b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 40 // request opcode @@ -2320,6 +2373,8 @@ type DestroyModeCookie struct { // DestroyMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2331,6 +2386,8 @@ func DestroyMode(c *xgb.Conn, Mode Mode) DestroyModeCookie { // DestroyModeChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyModeCookie.Check() func DestroyModeChecked(c *xgb.Conn, Mode Mode) DestroyModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'DestroyMode' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2352,7 +2409,9 @@ func destroyModeRequest(c *xgb.Conn, Mode Mode) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -2375,6 +2434,8 @@ type GetCrtcGammaCookie struct { // GetCrtcGamma sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcGammaCookie.Reply() func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2386,6 +2447,8 @@ func GetCrtcGamma(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { // GetCrtcGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2470,7 +2533,9 @@ func getCrtcGammaRequest(c *xgb.Conn, Crtc Crtc) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 23 // request opcode @@ -2493,6 +2558,8 @@ type GetCrtcGammaSizeCookie struct { // GetCrtcGammaSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcGammaSizeCookie.Reply() func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2504,6 +2571,8 @@ func GetCrtcGammaSize(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { // GetCrtcGammaSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcGammaSizeUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcGammaSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcGammaSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2561,7 +2630,9 @@ func getCrtcGammaSizeRequest(c *xgb.Conn, Crtc Crtc) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -2584,6 +2655,8 @@ type GetCrtcInfoCookie struct { // GetCrtcInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcInfoCookie.Reply() func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2595,6 +2668,8 @@ func GetCrtcInfo(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCr // GetCrtcInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcInfoUnchecked(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp) GetCrtcInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2703,7 +2778,9 @@ func getCrtcInfoRequest(c *xgb.Conn, Crtc Crtc, ConfigTimestamp xproto.Timestamp b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -2729,6 +2806,8 @@ type GetCrtcTransformCookie struct { // GetCrtcTransform sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCrtcTransformCookie.Reply() func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2740,6 +2819,8 @@ func GetCrtcTransform(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { // GetCrtcTransformUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCrtcTransformUnchecked(c *xgb.Conn, Crtc Crtc) GetCrtcTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2864,7 +2945,9 @@ func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 27 // request opcode @@ -2887,6 +2970,8 @@ type GetOutputInfoCookie struct { // GetOutputInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputInfoCookie.Reply() func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -2898,6 +2983,8 @@ func GetOutputInfo(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) // GetOutputInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputInfoUnchecked(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Timestamp) GetOutputInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3025,7 +3112,9 @@ func getOutputInfoRequest(c *xgb.Conn, Output Output, ConfigTimestamp xproto.Tim b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -3051,6 +3140,8 @@ type GetOutputPrimaryCookie struct { // GetOutputPrimary sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputPrimaryCookie.Reply() func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3062,6 +3153,8 @@ func GetOutputPrimary(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie // GetOutputPrimaryUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPrimaryUnchecked(c *xgb.Conn, Window xproto.Window) GetOutputPrimaryCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3116,7 +3209,9 @@ func getOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 31 // request opcode @@ -3139,6 +3234,8 @@ type GetOutputPropertyCookie struct { // GetOutputProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling GetOutputPropertyCookie.Reply() func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3150,6 +3247,8 @@ func GetOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom, Type xp // GetOutputPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3221,7 +3320,9 @@ func getOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -3272,6 +3373,8 @@ type GetPanningCookie struct { // GetPanning sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPanningCookie.Reply() func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3283,6 +3386,8 @@ func GetPanning(c *xgb.Conn, Crtc Crtc) GetPanningCookie { // GetPanningUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPanningUnchecked(c *xgb.Conn, Crtc Crtc) GetPanningCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3386,7 +3491,9 @@ func getPanningRequest(c *xgb.Conn, Crtc Crtc) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 28 // request opcode @@ -3409,6 +3516,8 @@ type GetProviderInfoCookie struct { // GetProviderInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetProviderInfoCookie.Reply() func GetProviderInfo(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Timestamp) GetProviderInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviderInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3420,6 +3529,8 @@ func GetProviderInfo(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Time // GetProviderInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetProviderInfoUnchecked(c *xgb.Conn, Provider Provider, ConfigTimestamp xproto.Timestamp) GetProviderInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviderInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3543,7 +3654,9 @@ func getProviderInfoRequest(c *xgb.Conn, Provider Provider, ConfigTimestamp xpro b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 33 // request opcode @@ -3569,6 +3682,8 @@ type GetProviderPropertyCookie struct { // GetProviderProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling GetProviderPropertyCookie.Reply() func GetProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3580,6 +3695,8 @@ func GetProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom, T // GetProviderPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetProviderPropertyUnchecked(c *xgb.Conn, Provider Provider, Property xproto.Atom, Type xproto.Atom, LongOffset uint32, LongLength uint32, Delete bool, Pending bool) GetProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3651,7 +3768,9 @@ func getProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xproto. b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 41 // request opcode @@ -3702,6 +3821,8 @@ type GetProvidersCookie struct { // GetProviders sends a checked request. // If an error occurs, it will be returned with the reply by calling GetProvidersCookie.Reply() func GetProviders(c *xgb.Conn, Window xproto.Window) GetProvidersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviders' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3713,6 +3834,8 @@ func GetProviders(c *xgb.Conn, Window xproto.Window) GetProvidersCookie { // GetProvidersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetProvidersUnchecked(c *xgb.Conn, Window xproto.Window) GetProvidersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetProviders' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3781,7 +3904,9 @@ func getProvidersRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 32 // request opcode @@ -3804,6 +3929,8 @@ type GetScreenInfoCookie struct { // GetScreenInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenInfoCookie.Reply() func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3815,6 +3942,8 @@ func GetScreenInfo(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { // GetScreenInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenInfoUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenInfo' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3912,7 +4041,9 @@ func getScreenInfoRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -3935,6 +4066,8 @@ type GetScreenResourcesCookie struct { // GetScreenResources sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenResourcesCookie.Reply() func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -3946,6 +4079,8 @@ func GetScreenResources(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCoo // GetScreenResourcesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenResources' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4052,7 +4187,9 @@ func getScreenResourcesRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -4075,6 +4212,8 @@ type GetScreenResourcesCurrentCookie struct { // GetScreenResourcesCurrent sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenResourcesCurrentCookie.Reply() func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4086,6 +4225,8 @@ func GetScreenResourcesCurrent(c *xgb.Conn, Window xproto.Window) GetScreenResou // GetScreenResourcesCurrentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenResourcesCurrentUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenResourcesCurrentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenResourcesCurrent' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4192,7 +4333,9 @@ func getScreenResourcesCurrentRequest(c *xgb.Conn, Window xproto.Window) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 25 // request opcode @@ -4215,6 +4358,8 @@ type GetScreenSizeRangeCookie struct { // GetScreenSizeRange sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenSizeRangeCookie.Reply() func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4226,6 +4371,8 @@ func GetScreenSizeRange(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCoo // GetScreenSizeRangeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeRangeUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenSizeRangeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'GetScreenSizeRange' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4295,7 +4442,9 @@ func getScreenSizeRangeRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -4318,6 +4467,8 @@ type ListOutputPropertiesCookie struct { // ListOutputProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListOutputPropertiesCookie.Reply() func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ListOutputProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4329,6 +4480,8 @@ func ListOutputProperties(c *xgb.Conn, Output Output) ListOutputPropertiesCookie // ListOutputPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListOutputPropertiesUnchecked(c *xgb.Conn, Output Output) ListOutputPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ListOutputProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4393,7 +4546,9 @@ func listOutputPropertiesRequest(c *xgb.Conn, Output Output) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -4416,6 +4571,8 @@ type ListProviderPropertiesCookie struct { // ListProviderProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListProviderPropertiesCookie.Reply() func ListProviderProperties(c *xgb.Conn, Provider Provider) ListProviderPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ListProviderProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4427,6 +4584,8 @@ func ListProviderProperties(c *xgb.Conn, Provider Provider) ListProviderProperti // ListProviderPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListProviderPropertiesUnchecked(c *xgb.Conn, Provider Provider) ListProviderPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'ListProviderProperties' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4491,7 +4650,9 @@ func listProviderPropertiesRequest(c *xgb.Conn, Provider Provider) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 36 // request opcode @@ -4514,6 +4675,8 @@ type QueryOutputPropertyCookie struct { // QueryOutputProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryOutputPropertyCookie.Reply() func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4525,6 +4688,8 @@ func QueryOutputProperty(c *xgb.Conn, Output Output, Property xproto.Atom) Query // QueryOutputPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryOutputPropertyUnchecked(c *xgb.Conn, Output Output, Property xproto.Atom) QueryOutputPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryOutputProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4609,7 +4774,9 @@ func queryOutputPropertyRequest(c *xgb.Conn, Output Output, Property xproto.Atom b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -4635,6 +4802,8 @@ type QueryProviderPropertyCookie struct { // QueryProviderProperty sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryProviderPropertyCookie.Reply() func QueryProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom) QueryProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4646,6 +4815,8 @@ func QueryProviderProperty(c *xgb.Conn, Provider Provider, Property xproto.Atom) // QueryProviderPropertyUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryProviderPropertyUnchecked(c *xgb.Conn, Provider Provider, Property xproto.Atom) QueryProviderPropertyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryProviderProperty' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4730,7 +4901,9 @@ func queryProviderPropertyRequest(c *xgb.Conn, Provider Provider, Property xprot b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 37 // request opcode @@ -4756,6 +4929,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4767,6 +4942,8 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4828,7 +5005,9 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -4854,6 +5033,8 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4865,6 +5046,8 @@ func SelectInput(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCo // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Window xproto.Window, Enable uint16) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4886,7 +5069,9 @@ func selectInputRequest(c *xgb.Conn, Window xproto.Window, Enable uint16) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -4914,6 +5099,8 @@ type SetCrtcConfigCookie struct { // SetCrtcConfig sends a checked request. // If an error occurs, it will be returned with the reply by calling SetCrtcConfigCookie.Reply() func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4925,6 +5112,8 @@ func SetCrtcConfig(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTim // SetCrtcConfigUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcConfigUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, X int16, Y int16, Mode Mode, Rotation uint16, Outputs []Output) SetCrtcConfigCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -4983,7 +5172,9 @@ func setCrtcConfigRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Co b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 21 // request opcode @@ -5031,6 +5222,8 @@ type SetCrtcGammaCookie struct { // SetCrtcGamma sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5042,6 +5235,8 @@ func SetCrtcGamma(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uin // SetCrtcGammaChecked sends a checked request. // If an error occurs, it can be retrieved using SetCrtcGammaCookie.Check() func SetCrtcGammaChecked(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetCrtcGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcGamma' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5063,7 +5258,9 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 24 // request opcode @@ -5112,6 +5309,8 @@ type SetCrtcTransformCookie struct { // SetCrtcTransform sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5123,6 +5322,8 @@ func SetCrtcTransform(c *xgb.Conn, Crtc Crtc, Transform render.Transform, Filter // SetCrtcTransformChecked sends a checked request. // If an error occurs, it can be retrieved using SetCrtcTransformCookie.Check() func SetCrtcTransformChecked(c *xgb.Conn, Crtc Crtc, Transform render.Transform, FilterLen uint16, FilterName string, FilterParams []render.Fixed) SetCrtcTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetCrtcTransform' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5144,7 +5345,9 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 26 // request opcode @@ -5190,6 +5393,8 @@ type SetOutputPrimaryCookie struct { // SetOutputPrimary sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5201,6 +5406,8 @@ func SetOutputPrimary(c *xgb.Conn, Window xproto.Window, Output Output) SetOutpu // SetOutputPrimaryChecked sends a checked request. // If an error occurs, it can be retrieved using SetOutputPrimaryCookie.Check() func SetOutputPrimaryChecked(c *xgb.Conn, Window xproto.Window, Output Output) SetOutputPrimaryCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetOutputPrimary' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5222,7 +5429,9 @@ func setOutputPrimaryRequest(c *xgb.Conn, Window xproto.Window, Output Output) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 30 // request opcode @@ -5248,6 +5457,8 @@ type SetPanningCookie struct { // SetPanning sends a checked request. // If an error occurs, it will be returned with the reply by calling SetPanningCookie.Reply() func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5259,6 +5470,8 @@ func SetPanning(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, // SetPanningUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPanningUnchecked(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left uint16, Top uint16, Width uint16, Height uint16, TrackLeft uint16, TrackTop uint16, TrackWidth uint16, TrackHeight uint16, BorderLeft int16, BorderTop int16, BorderRight int16, BorderBottom int16) SetPanningCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetPanning' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5314,7 +5527,9 @@ func setPanningRequest(c *xgb.Conn, Crtc Crtc, Timestamp xproto.Timestamp, Left b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 29 // request opcode @@ -5376,6 +5591,8 @@ type SetProviderOffloadSinkCookie struct { // SetProviderOffloadSink sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetProviderOffloadSink(c *xgb.Conn, Provider Provider, SinkProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOffloadSinkCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetProviderOffloadSink' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5387,6 +5604,8 @@ func SetProviderOffloadSink(c *xgb.Conn, Provider Provider, SinkProvider Provide // SetProviderOffloadSinkChecked sends a checked request. // If an error occurs, it can be retrieved using SetProviderOffloadSinkCookie.Check() func SetProviderOffloadSinkChecked(c *xgb.Conn, Provider Provider, SinkProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOffloadSinkCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetProviderOffloadSink' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5408,7 +5627,9 @@ func setProviderOffloadSinkRequest(c *xgb.Conn, Provider Provider, SinkProvider b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 34 // request opcode @@ -5437,6 +5658,8 @@ type SetProviderOutputSourceCookie struct { // SetProviderOutputSource sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetProviderOutputSource(c *xgb.Conn, Provider Provider, SourceProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOutputSourceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetProviderOutputSource' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5448,6 +5671,8 @@ func SetProviderOutputSource(c *xgb.Conn, Provider Provider, SourceProvider Prov // SetProviderOutputSourceChecked sends a checked request. // If an error occurs, it can be retrieved using SetProviderOutputSourceCookie.Check() func SetProviderOutputSourceChecked(c *xgb.Conn, Provider Provider, SourceProvider Provider, ConfigTimestamp xproto.Timestamp) SetProviderOutputSourceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetProviderOutputSource' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5469,7 +5694,9 @@ func setProviderOutputSourceRequest(c *xgb.Conn, Provider Provider, SourceProvid b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 35 // request opcode @@ -5498,6 +5725,8 @@ type SetScreenConfigCookie struct { // SetScreenConfig sends a checked request. // If an error occurs, it will be returned with the reply by calling SetScreenConfigCookie.Reply() func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5509,6 +5738,8 @@ func SetScreenConfig(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timesta // SetScreenConfigUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenConfigUnchecked(c *xgb.Conn, Window xproto.Window, Timestamp xproto.Timestamp, ConfigTimestamp xproto.Timestamp, SizeID uint16, Rotation uint16, Rate uint16) SetScreenConfigCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetScreenConfig' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5579,7 +5810,9 @@ func setScreenConfigRequest(c *xgb.Conn, Window xproto.Window, Timestamp xproto. b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -5619,6 +5852,8 @@ type SetScreenSizeCookie struct { // SetScreenSize sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5630,6 +5865,8 @@ func SetScreenSize(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint1 // SetScreenSizeChecked sends a checked request. // If an error occurs, it can be retrieved using SetScreenSizeCookie.Check() func SetScreenSizeChecked(c *xgb.Conn, Window xproto.Window, Width uint16, Height uint16, MmWidth uint32, MmHeight uint32) SetScreenSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RANDR"]; !ok { panic("Cannot issue request 'SetScreenSize' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") } @@ -5651,7 +5888,9 @@ func setScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Width uint16, Heigh b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 30be090..5469170 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named RECORD could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["RECORD"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["RECORD"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["RECORD"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -523,6 +522,8 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -534,6 +535,8 @@ func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, Nu // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -555,7 +558,9 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -600,6 +605,8 @@ type DisableContextCookie struct { // DisableContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -611,6 +618,8 @@ func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie { // DisableContextChecked sends a checked request. // If an error occurs, it can be retrieved using DisableContextCookie.Check() func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'DisableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -632,7 +641,9 @@ func disableContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -655,6 +666,8 @@ type EnableContextCookie struct { // EnableContext sends a checked request. // If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply() func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -666,6 +679,8 @@ func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie { // EnableContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -752,7 +767,9 @@ func enableContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -775,6 +792,8 @@ type FreeContextCookie struct { // FreeContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -786,6 +805,8 @@ func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie { // FreeContextChecked sends a checked request. // If an error occurs, it can be retrieved using FreeContextCookie.Check() func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'FreeContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -807,7 +828,9 @@ func freeContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -830,6 +853,8 @@ type GetContextCookie struct { // GetContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply() func GetContext(c *xgb.Conn, Context Context) GetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -841,6 +866,8 @@ func GetContext(c *xgb.Conn, Context Context) GetContextCookie { // GetContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'GetContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -914,7 +941,9 @@ func getContextRequest(c *xgb.Conn, Context Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -937,6 +966,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -948,6 +979,8 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVe // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -1006,7 +1039,9 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -1032,6 +1067,8 @@ type RegisterClientsCookie struct { // RegisterClients sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'RegisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -1043,6 +1080,8 @@ func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, // RegisterClientsChecked sends a checked request. // If an error occurs, it can be retrieved using RegisterClientsCookie.Check() func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'RegisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -1064,7 +1103,9 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -1109,6 +1150,8 @@ type UnregisterClientsCookie struct { // UnregisterClients sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'UnregisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -1120,6 +1163,8 @@ func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, Clie // UnregisterClientsChecked sends a checked request. // If an error occurs, it can be retrieved using UnregisterClientsCookie.Check() func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RECORD"]; !ok { panic("Cannot issue request 'UnregisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.") } @@ -1141,7 +1186,9 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RECORD"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/render/render.go b/nexgb/render/render.go index f90065b..e15bd67 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named RENDER could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["RENDER"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["RENDER"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["RENDER"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -1582,6 +1581,8 @@ type AddGlyphsCookie struct { // AddGlyphs sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1593,6 +1594,8 @@ func AddGlyphs(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint // AddGlyphsChecked sends a checked request. // If an error occurs, it can be retrieved using AddGlyphsCookie.Check() func AddGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) AddGlyphsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'AddGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1614,7 +1617,9 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -1654,6 +1659,8 @@ type AddTrapsCookie struct { // AddTraps sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1665,6 +1672,8 @@ func AddTraps(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap // AddTrapsChecked sends a checked request. // If an error occurs, it can be retrieved using AddTrapsCookie.Check() func AddTrapsChecked(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps []Trap) AddTrapsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'AddTraps' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1686,7 +1695,9 @@ func addTrapsRequest(c *xgb.Conn, Picture Picture, XOff int16, YOff int16, Traps b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 32 // request opcode @@ -1717,6 +1728,8 @@ type ChangePictureCookie struct { // ChangePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1728,6 +1741,8 @@ func ChangePicture(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []u // ChangePictureChecked sends a checked request. // If an error occurs, it can be retrieved using ChangePictureCookie.Check() func ChangePictureChecked(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) ChangePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'ChangePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1749,7 +1764,9 @@ func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueL b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -1780,6 +1797,8 @@ type CompositeCookie struct { // Composite sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1791,6 +1810,8 @@ func Composite(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, Src // CompositeChecked sends a checked request. // If an error occurs, it can be retrieved using CompositeCookie.Check() func CompositeChecked(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Picture, SrcX int16, SrcY int16, MaskX int16, MaskY int16, DstX int16, DstY int16, Width uint16, Height uint16) CompositeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Composite' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1812,7 +1833,9 @@ func compositeRequest(c *xgb.Conn, Op byte, Src Picture, Mask Picture, Dst Pictu b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -1870,6 +1893,8 @@ type CompositeGlyphs16Cookie struct { // CompositeGlyphs16 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1881,6 +1906,8 @@ func CompositeGlyphs16(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma // CompositeGlyphs16Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs16Cookie.Check() func CompositeGlyphs16Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs16Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs16' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1902,7 +1929,9 @@ func compositeGlyphs16Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 24 // request opcode @@ -1948,6 +1977,8 @@ type CompositeGlyphs32Cookie struct { // CompositeGlyphs32 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1959,6 +1990,8 @@ func CompositeGlyphs32(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma // CompositeGlyphs32Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs32Cookie.Check() func CompositeGlyphs32Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs32Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs32' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -1980,7 +2013,9 @@ func compositeGlyphs32Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Ma b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 25 // request opcode @@ -2026,6 +2061,8 @@ type CompositeGlyphs8Cookie struct { // CompositeGlyphs8 sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2037,6 +2074,8 @@ func CompositeGlyphs8(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat // CompositeGlyphs8Checked sends a checked request. // If an error occurs, it can be retrieved using CompositeGlyphs8Cookie.Check() func CompositeGlyphs8Checked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, Glyphset Glyphset, SrcX int16, SrcY int16, Glyphcmds []byte) CompositeGlyphs8Cookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CompositeGlyphs8' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2058,7 +2097,9 @@ func compositeGlyphs8Request(c *xgb.Conn, Op byte, Src Picture, Dst Picture, Mas b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 23 // request opcode @@ -2104,6 +2145,8 @@ type CreateAnimCursorCookie struct { // CreateAnimCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2115,6 +2158,8 @@ func CreateAnimCursor(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) C // CreateAnimCursorChecked sends a checked request. // If an error occurs, it can be retrieved using CreateAnimCursorCookie.Check() func CreateAnimCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcursorelt) CreateAnimCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateAnimCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2136,7 +2181,9 @@ func createAnimCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Cursors []Animcurso b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 31 // request opcode @@ -2161,6 +2208,8 @@ type CreateConicalGradientCookie struct { // CreateConicalGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2172,6 +2221,8 @@ func CreateConicalGradient(c *xgb.Conn, Picture Picture, Center Pointfix, Angle // CreateConicalGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateConicalGradientCookie.Check() func CreateConicalGradientChecked(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateConicalGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateConicalGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2193,7 +2244,9 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 36 // request opcode @@ -2239,6 +2292,8 @@ type CreateCursorCookie struct { // CreateCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2250,6 +2305,8 @@ func CreateCursor(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y ui // CreateCursorChecked sends a checked request. // If an error occurs, it can be retrieved using CreateCursorCookie.Check() func CreateCursorChecked(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint16, Y uint16) CreateCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateCursor' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2271,7 +2328,9 @@ func createCursorRequest(c *xgb.Conn, Cid xproto.Cursor, Source Picture, X uint1 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 27 // request opcode @@ -2303,6 +2362,8 @@ type CreateGlyphSetCookie struct { // CreateGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2314,6 +2375,8 @@ func CreateGlyphSet(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSe // CreateGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using CreateGlyphSetCookie.Check() func CreateGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Format Pictformat) CreateGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2335,7 +2398,9 @@ func createGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Format Pictformat) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -2361,6 +2426,8 @@ type CreateLinearGradientCookie struct { // CreateLinearGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2372,6 +2439,8 @@ func CreateLinearGradient(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix // CreateLinearGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateLinearGradientCookie.Check() func CreateLinearGradientChecked(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) CreateLinearGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateLinearGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2393,7 +2462,9 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 34 // request opcode @@ -2442,6 +2513,8 @@ type CreatePictureCookie struct { // CreatePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2453,6 +2526,8 @@ func CreatePicture(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pi // CreatePictureChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePictureCookie.Check() func CreatePictureChecked(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) CreatePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreatePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2474,7 +2549,9 @@ func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Fo b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -2511,6 +2588,8 @@ type CreateRadialGradientCookie struct { // CreateRadialGradient sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2522,6 +2601,8 @@ func CreateRadialGradient(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Po // CreateRadialGradientChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRadialGradientCookie.Check() func CreateRadialGradientChecked(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) CreateRadialGradientCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateRadialGradient' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2543,7 +2624,9 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 35 // request opcode @@ -2598,6 +2681,8 @@ type CreateSolidFillCookie struct { // CreateSolidFill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2609,6 +2694,8 @@ func CreateSolidFill(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillC // CreateSolidFillChecked sends a checked request. // If an error occurs, it can be retrieved using CreateSolidFillCookie.Check() func CreateSolidFillChecked(c *xgb.Conn, Picture Picture, Color Color) CreateSolidFillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'CreateSolidFill' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2630,7 +2717,9 @@ func createSolidFillRequest(c *xgb.Conn, Picture Picture, Color Color) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 33 // request opcode @@ -2659,6 +2748,8 @@ type FillRectanglesCookie struct { // FillRectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2670,6 +2761,8 @@ func FillRectangles(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xpro // FillRectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using FillRectanglesCookie.Check() func FillRectanglesChecked(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects []xproto.Rectangle) FillRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FillRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2691,7 +2784,9 @@ func fillRectanglesRequest(c *xgb.Conn, Op byte, Dst Picture, Color Color, Rects b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 26 // request opcode @@ -2727,6 +2822,8 @@ type FreeGlyphSetCookie struct { // FreeGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2738,6 +2835,8 @@ func FreeGlyphSet(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { // FreeGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using FreeGlyphSetCookie.Check() func FreeGlyphSetChecked(c *xgb.Conn, Glyphset Glyphset) FreeGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreeGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2759,7 +2858,9 @@ func freeGlyphSetRequest(c *xgb.Conn, Glyphset Glyphset) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -2782,6 +2883,8 @@ type FreeGlyphsCookie struct { // FreeGlyphs sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2793,6 +2896,8 @@ func FreeGlyphs(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie // FreeGlyphsChecked sends a checked request. // If an error occurs, it can be retrieved using FreeGlyphsCookie.Check() func FreeGlyphsChecked(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) FreeGlyphsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreeGlyphs' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2814,7 +2919,9 @@ func freeGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, Glyphs []Glyph) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -2842,6 +2949,8 @@ type FreePictureCookie struct { // FreePicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2853,6 +2962,8 @@ func FreePicture(c *xgb.Conn, Picture Picture) FreePictureCookie { // FreePictureChecked sends a checked request. // If an error occurs, it can be retrieved using FreePictureCookie.Check() func FreePictureChecked(c *xgb.Conn, Picture Picture) FreePictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'FreePicture' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2874,7 +2985,9 @@ func freePictureRequest(c *xgb.Conn, Picture Picture) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -2897,6 +3010,8 @@ type QueryFiltersCookie struct { // QueryFilters sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryFiltersCookie.Reply() func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2908,6 +3023,8 @@ func QueryFilters(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { // QueryFiltersUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFiltersUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryFiltersCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryFilters' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -2980,7 +3097,9 @@ func queryFiltersRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 29 // request opcode @@ -3003,6 +3122,8 @@ type QueryPictFormatsCookie struct { // QueryPictFormats sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPictFormatsCookie.Reply() func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryPictFormats' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3014,6 +3135,8 @@ func QueryPictFormats(c *xgb.Conn) QueryPictFormatsCookie { // QueryPictFormatsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictFormatsUnchecked(c *xgb.Conn) QueryPictFormatsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryPictFormats' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3108,7 +3231,9 @@ func queryPictFormatsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -3128,6 +3253,8 @@ type QueryPictIndexValuesCookie struct { // QueryPictIndexValues sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPictIndexValuesCookie.Reply() func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryPictIndexValues' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3139,6 +3266,8 @@ func QueryPictIndexValues(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCo // QueryPictIndexValuesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPictIndexValuesUnchecked(c *xgb.Conn, Format Pictformat) QueryPictIndexValuesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryPictIndexValues' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3200,7 +3329,9 @@ func queryPictIndexValuesRequest(c *xgb.Conn, Format Pictformat) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -3223,6 +3354,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3234,6 +3367,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3295,7 +3430,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -3321,6 +3458,8 @@ type ReferenceGlyphSetCookie struct { // ReferenceGlyphSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3332,6 +3471,8 @@ func ReferenceGlyphSet(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceG // ReferenceGlyphSetChecked sends a checked request. // If an error occurs, it can be retrieved using ReferenceGlyphSetCookie.Check() func ReferenceGlyphSetChecked(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) ReferenceGlyphSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'ReferenceGlyphSet' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3353,7 +3494,9 @@ func referenceGlyphSetRequest(c *xgb.Conn, Gsid Glyphset, Existing Glyphset) []b b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -3379,6 +3522,8 @@ type SetPictureClipRectanglesCookie struct { // SetPictureClipRectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureClipRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3390,6 +3535,8 @@ func SetPictureClipRectangles(c *xgb.Conn, Picture Picture, ClipXOrigin int16, C // SetPictureClipRectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureClipRectanglesCookie.Check() func SetPictureClipRectanglesChecked(c *xgb.Conn, Picture Picture, ClipXOrigin int16, ClipYOrigin int16, Rectangles []xproto.Rectangle) SetPictureClipRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureClipRectangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3411,7 +3558,9 @@ func setPictureClipRectanglesRequest(c *xgb.Conn, Picture Picture, ClipXOrigin i b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -3442,6 +3591,8 @@ type SetPictureFilterCookie struct { // SetPictureFilter sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3453,6 +3604,8 @@ func SetPictureFilter(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter str // SetPictureFilterChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureFilterCookie.Check() func SetPictureFilterChecked(c *xgb.Conn, Picture Picture, FilterLen uint16, Filter string, Values []Fixed) SetPictureFilterCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureFilter' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3474,7 +3627,9 @@ func setPictureFilterRequest(c *xgb.Conn, Picture Picture, FilterLen uint16, Fil b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 30 // request opcode @@ -3514,6 +3669,8 @@ type SetPictureTransformCookie struct { // SetPictureTransform sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3525,6 +3682,8 @@ func SetPictureTransform(c *xgb.Conn, Picture Picture, Transform Transform) SetP // SetPictureTransformChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureTransformCookie.Check() func SetPictureTransformChecked(c *xgb.Conn, Picture Picture, Transform Transform) SetPictureTransformCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'SetPictureTransform' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3546,7 +3705,9 @@ func setPictureTransformRequest(c *xgb.Conn, Picture Picture, Transform Transfor b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 28 // request opcode @@ -3575,6 +3736,8 @@ type TrapezoidsCookie struct { // Trapezoids sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Trapezoids' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3586,6 +3749,8 @@ func Trapezoids(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictf // TrapezoidsChecked sends a checked request. // If an error occurs, it can be retrieved using TrapezoidsCookie.Check() func TrapezoidsChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Traps []Trapezoid) TrapezoidsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Trapezoids' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3607,7 +3772,9 @@ func trapezoidsRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskForma b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -3649,6 +3816,8 @@ type TriFanCookie struct { // TriFan sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3660,6 +3829,8 @@ func TriFan(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictforma // TriFanChecked sends a checked request. // If an error occurs, it can be retrieved using TriFanCookie.Check() func TriFanChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriFanCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'TriFan' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3681,7 +3852,9 @@ func triFanRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pi b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -3723,6 +3896,8 @@ type TriStripCookie struct { // TriStrip sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'TriStrip' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3734,6 +3909,8 @@ func TriStrip(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictfor // TriStripChecked sends a checked request. // If an error occurs, it can be retrieved using TriStripCookie.Check() func TriStripChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Points []Pointfix) TriStripCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'TriStrip' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3755,7 +3932,9 @@ func triStripRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -3797,6 +3976,8 @@ type TrianglesCookie struct { // Triangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3808,6 +3989,8 @@ func Triangles(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictfo // TrianglesChecked sends a checked request. // If an error occurs, it can be retrieved using TrianglesCookie.Check() func TrianglesChecked(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat Pictformat, SrcX int16, SrcY int16, Triangles []Triangle) TrianglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["RENDER"]; !ok { panic("Cannot issue request 'Triangles' using the uninitialized extension 'RENDER'. render.Init(connObj) must be called first.") } @@ -3829,7 +4012,9 @@ func trianglesRequest(c *xgb.Conn, Op byte, Src Picture, Dst Picture, MaskFormat b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["RENDER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode diff --git a/nexgb/res/res.go b/nexgb/res/res.go index dd53857..e3d7b02 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named X-Resource could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["X-Resource"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["X-Resource"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["X-Resource"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -511,6 +510,8 @@ type QueryClientIdsCookie struct { // QueryClientIds sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientIdsCookie.Reply() func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -522,6 +523,8 @@ func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryCli // QueryClientIdsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientIdsUnchecked(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientIds' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -583,7 +586,9 @@ func queryClientIdsRequest(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -608,6 +613,8 @@ type QueryClientPixmapBytesCookie struct { // QueryClientPixmapBytes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply() func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -619,6 +626,8 @@ func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCooki // QueryClientPixmapBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientPixmapBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -677,7 +686,9 @@ func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -700,6 +711,8 @@ type QueryClientResourcesCookie struct { // QueryClientResources sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientResourcesCookie.Reply() func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -711,6 +724,8 @@ func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { // QueryClientResourcesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClientResources' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -772,7 +787,9 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -795,6 +812,8 @@ type QueryClientsCookie struct { // QueryClients sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply() func QueryClients(c *xgb.Conn) QueryClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -806,6 +825,8 @@ func QueryClients(c *xgb.Conn) QueryClientsCookie { // QueryClientsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryClients' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -867,7 +888,9 @@ func queryClientsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -887,6 +910,8 @@ type QueryResourceBytesCookie struct { // QueryResourceBytes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryResourceBytesCookie.Reply() func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -898,6 +923,8 @@ func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []Res // QueryResourceBytesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryResourceBytesUnchecked(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryResourceBytes' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -959,7 +986,9 @@ func queryResourceBytesRequest(c *xgb.Conn, Client uint32, NumSpecs uint32, Spec b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -987,6 +1016,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -998,6 +1029,8 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["X-Resource"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'X-Resource'. res.Init(connObj) must be called first.") } @@ -1056,7 +1089,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["X-Resource"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index ea60367..418576c 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named MIT-SCREEN-SAVER could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -198,6 +197,8 @@ type QueryInfoCookie struct { // QueryInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryInfoCookie.Reply() func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'QueryInfo' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -209,6 +210,8 @@ func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { // QueryInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'QueryInfo' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -283,7 +286,9 @@ func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -306,6 +311,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -317,6 +324,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -378,7 +387,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersio b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -406,6 +417,8 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -417,6 +430,8 @@ func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) Select // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -438,7 +453,9 @@ func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -464,6 +481,8 @@ type SetAttributesCookie struct { // SetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'SetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -475,6 +494,8 @@ func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Widt // SetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using SetAttributesCookie.Check() func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'SetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -496,7 +517,9 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -551,6 +574,8 @@ type SuspendCookie struct { // Suspend sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'Suspend' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -562,6 +587,8 @@ func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie { // SuspendChecked sends a checked request. // If an error occurs, it can be retrieved using SuspendCookie.Check() func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'Suspend' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -583,7 +610,9 @@ func suspendRequest(c *xgb.Conn, Suspend bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -612,6 +641,8 @@ type UnsetAttributesCookie struct { // UnsetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -623,6 +654,8 @@ func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCooki // UnsetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using UnsetAttributesCookie.Check() func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SCREEN-SAVER"]; !ok { panic("Cannot issue request 'UnsetAttributes' using the uninitialized extension 'MIT-SCREEN-SAVER'. screensaver.Init(connObj) must be called first.") } @@ -644,7 +677,9 @@ func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SCREEN-SAVER"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode diff --git a/nexgb/shape/shape.go b/nexgb/shape/shape.go index 93ff9d0..7069f7e 100644 --- a/nexgb/shape/shape.go +++ b/nexgb/shape/shape.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named SHAPE could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["SHAPE"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["SHAPE"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["SHAPE"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -214,6 +213,8 @@ type CombineCookie struct { // Combine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Combine' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -225,6 +226,8 @@ func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, D // CombineChecked sends a checked request. // If an error occurs, it can be retrieved using CombineCookie.Check() func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Combine' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -246,7 +249,9 @@ func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -289,6 +294,8 @@ type GetRectanglesCookie struct { // GetRectangles sends a checked request. // If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply() func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -300,6 +307,8 @@ func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectan // GetRectanglesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -362,7 +371,9 @@ func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) [] b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -390,6 +401,8 @@ type InputSelectedCookie struct { // InputSelected sends a checked request. // If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply() func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -401,6 +414,8 @@ func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCo // InputSelectedUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -456,7 +471,9 @@ func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -479,6 +496,8 @@ type MaskCookie struct { // Mask sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -490,6 +509,8 @@ func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xpr // MaskChecked sends a checked request. // If an error occurs, it can be retrieved using MaskCookie.Check() func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -511,7 +532,9 @@ func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -551,6 +574,8 @@ type OffsetCookie struct { // Offset sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Offset' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -562,6 +587,8 @@ func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, // OffsetChecked sends a checked request. // If an error occurs, it can be retrieved using OffsetCookie.Check() func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Offset' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -583,7 +610,9 @@ func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.W b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -617,6 +646,8 @@ type QueryExtentsCookie struct { // QueryExtents sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtentsCookie.Reply() func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'QueryExtents' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -628,6 +659,8 @@ func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCook // QueryExtentsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'QueryExtents' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -729,7 +762,9 @@ func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -752,6 +787,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -763,6 +800,8 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -821,7 +860,9 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -841,6 +882,8 @@ type RectanglesCookie struct { // Rectangles sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -852,6 +895,8 @@ func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, // RectanglesChecked sends a checked request. // If an error occurs, it can be retrieved using RectanglesCookie.Check() func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -873,7 +918,9 @@ func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -915,6 +962,8 @@ type SelectInputCookie struct { // SelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -926,6 +975,8 @@ func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) Sele // SelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectInputCookie.Check() func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SHAPE"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.") } @@ -947,7 +998,9 @@ func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable boo b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SHAPE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go index e5841ca..b310c34 100644 --- a/nexgb/shm/shm.go +++ b/nexgb/shm/shm.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named MIT-SHM could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["MIT-SHM"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["MIT-SHM"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["MIT-SHM"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -217,6 +216,8 @@ type AttachCookie struct { // Attach sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'Attach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -228,6 +229,8 @@ func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { // AttachChecked sends a checked request. // If an error occurs, it can be retrieved using AttachCookie.Check() func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'Attach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -249,7 +252,9 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -284,6 +289,8 @@ type AttachFdCookie struct { // AttachFd sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'AttachFd' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -295,6 +302,8 @@ func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie { // AttachFdChecked sends a checked request. // If an error occurs, it can be retrieved using AttachFdCookie.Check() func AttachFdChecked(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'AttachFd' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -316,7 +325,9 @@ func attachFdRequest(c *xgb.Conn, Shmseg Seg, ReadOnly bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -348,6 +359,8 @@ type CreatePixmapCookie struct { // CreatePixmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -359,6 +372,8 @@ func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Widt // CreatePixmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePixmapCookie.Check() func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -380,7 +395,9 @@ func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawabl b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -423,6 +440,8 @@ type CreateSegmentCookie struct { // CreateSegment sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSegmentCookie.Reply() func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'CreateSegment' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -434,6 +453,8 @@ func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSe // CreateSegmentUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSegmentUnchecked(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'CreateSegment' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -488,7 +509,9 @@ func createSegmentRequest(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -523,6 +546,8 @@ type DetachCookie struct { // Detach sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'Detach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -534,6 +559,8 @@ func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie { // DetachChecked sends a checked request. // If an error occurs, it can be retrieved using DetachCookie.Check() func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'Detach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -555,7 +582,9 @@ func detachRequest(c *xgb.Conn, Shmseg Seg) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -578,6 +607,8 @@ type GetImageCookie struct { // GetImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'GetImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -589,6 +620,8 @@ func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uin // GetImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'GetImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -648,7 +681,9 @@ func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Wi b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -697,6 +732,8 @@ type PutImageCookie struct { // PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -708,6 +745,8 @@ func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWi // PutImageChecked sends a checked request. // If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -729,7 +768,9 @@ func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -796,6 +837,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -807,6 +850,8 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["MIT-SHM"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.") } @@ -885,7 +930,9 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["MIT-SHM"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 2240ee1..1778057 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XC-MISC could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XC-MISC"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XC-MISC"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XC-MISC"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -69,6 +68,8 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -80,6 +81,8 @@ func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint1 // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -138,7 +141,9 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XC-MISC"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -164,6 +169,8 @@ type GetXIDListCookie struct { // GetXIDList sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDListCookie.Reply() func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -175,6 +182,8 @@ func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { // GetXIDListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -239,7 +248,9 @@ func getXIDListRequest(c *xgb.Conn, Count uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XC-MISC"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -262,6 +273,8 @@ type GetXIDRangeCookie struct { // GetXIDRange sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -273,6 +286,8 @@ func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { // GetXIDRangeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XC-MISC"]; !ok { panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") } @@ -331,7 +346,9 @@ func getXIDRangeRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XC-MISC"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode diff --git a/nexgb/xevie/xevie.go b/nexgb/xevie/xevie.go index 7e18f8d..180312b 100644 --- a/nexgb/xevie/xevie.go +++ b/nexgb/xevie/xevie.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XEVIE could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XEVIE"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XEVIE"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XEVIE"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -119,6 +118,8 @@ type EndCookie struct { // End sends a checked request. // If an error occurs, it will be returned with the reply by calling EndCookie.Reply() func End(c *xgb.Conn, Cmap uint32) EndCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -130,6 +131,8 @@ func End(c *xgb.Conn, Cmap uint32) EndCookie { // EndUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'End' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -183,7 +186,9 @@ func endRequest(c *xgb.Conn, Cmap uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XEVIE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -206,6 +211,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -217,6 +224,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -278,7 +287,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XEVIE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -304,6 +315,8 @@ type SelectInputCookie struct { // SelectInput sends a checked request. // If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply() func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -315,6 +328,8 @@ func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie { // SelectInputUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'SelectInput' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -368,7 +383,9 @@ func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XEVIE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -391,6 +408,8 @@ type SendCookie struct { // Send sends a checked request. // If an error occurs, it will be returned with the reply by calling SendCookie.Reply() func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'Send' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -402,6 +421,8 @@ func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie { // SendUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'Send' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -455,7 +476,9 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XEVIE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -486,6 +509,8 @@ type StartCookie struct { // Start sends a checked request. // If an error occurs, it will be returned with the reply by calling StartCookie.Reply() func Start(c *xgb.Conn, Screen uint32) StartCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -497,6 +522,8 @@ func Start(c *xgb.Conn, Screen uint32) StartCookie { // StartUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XEVIE"]; !ok { panic("Cannot issue request 'Start' using the uninitialized extension 'XEVIE'. xevie.Init(connObj) must be called first.") } @@ -550,7 +577,9 @@ func startRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XEVIE"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 6a07e41..51c9322 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XFree86-DRI could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XFree86-DRI"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XFree86-DRI"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XFree86-DRI"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -137,6 +136,8 @@ type AuthConnectionCookie struct { // AuthConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply() func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -148,6 +149,8 @@ func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCook // AuthConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'AuthConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -202,7 +205,9 @@ func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -228,6 +233,8 @@ type CloseConnectionCookie struct { // CloseConnection sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -239,6 +246,8 @@ func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie { // CloseConnectionChecked sends a checked request. // If an error occurs, it can be retrieved using CloseConnectionCookie.Check() func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CloseConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -260,7 +269,9 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -283,6 +294,8 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -294,6 +307,8 @@ func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) Cr // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -348,7 +363,9 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -377,6 +394,8 @@ type CreateDrawableCookie struct { // CreateDrawable sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply() func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -388,6 +407,8 @@ func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableC // CreateDrawableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'CreateDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -442,7 +463,9 @@ func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -468,6 +491,8 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -479,6 +504,8 @@ func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCo // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -500,7 +527,9 @@ func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -526,6 +555,8 @@ type DestroyDrawableCookie struct { // DestroyDrawable sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -537,6 +568,8 @@ func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawabl // DestroyDrawableChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyDrawableCookie.Check() func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -558,7 +591,9 @@ func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -584,6 +619,8 @@ type GetClientDriverNameCookie struct { // GetClientDriverName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientDriverNameCookie.Reply() func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -595,6 +632,8 @@ func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { // GetClientDriverNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetClientDriverName' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -672,7 +711,9 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -695,6 +736,8 @@ type GetDeviceInfoCookie struct { // GetDeviceInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply() func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -706,6 +749,8 @@ func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { // GetDeviceInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDeviceInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -787,7 +832,9 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -810,6 +857,8 @@ type GetDrawableInfoCookie struct { // GetDrawableInfo sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDrawableInfoCookie.Reply() func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -821,6 +870,8 @@ func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInf // GetDrawableInfoUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'GetDrawableInfo' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -922,7 +973,9 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -948,6 +1001,8 @@ type OpenConnectionCookie struct { // OpenConnection sends a checked request. // If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply() func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -959,6 +1014,8 @@ func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie { // OpenConnectionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'OpenConnection' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -1032,7 +1089,9 @@ func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -1055,6 +1114,8 @@ type QueryDirectRenderingCapableCookie struct { // QueryDirectRenderingCapable sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply() func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -1066,6 +1127,8 @@ func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderin // QueryDirectRenderingCapableUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryDirectRenderingCapable' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -1124,7 +1187,9 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -1147,6 +1212,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -1158,6 +1225,8 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-DRI"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-DRI'. xf86dri.Init(connObj) must be called first.") } @@ -1220,7 +1289,9 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-DRI"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 5b0f1f8..2829fd6 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XFree86-VidModeExtension could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XFree86-VidModeExtension"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XFree86-VidModeExtension"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XFree86-VidModeExtension"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -554,6 +553,8 @@ type AddModeLineCookie struct { // AddModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -565,6 +566,8 @@ func AddModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, // AddModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using AddModeLineCookie.Check() func AddModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, AfterDotclock Dotclock, AfterHdisplay uint16, AfterHsyncstart uint16, AfterHsyncend uint16, AfterHtotal uint16, AfterHskew uint16, AfterVdisplay uint16, AfterVsyncstart uint16, AfterVsyncend uint16, AfterVtotal uint16, AfterFlags uint32, Private []byte) AddModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'AddModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -586,7 +589,9 @@ func addModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -689,6 +694,8 @@ type DeleteModeLineCookie struct { // DeleteModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -700,6 +707,8 @@ func DeleteModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint // DeleteModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using DeleteModeLineCookie.Check() func DeleteModeLineChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) DeleteModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'DeleteModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -721,7 +730,9 @@ func deleteModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdispl b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -787,6 +798,8 @@ type GetAllModeLinesCookie struct { // GetAllModeLines sends a checked request. // If an error occurs, it will be returned with the reply by calling GetAllModeLinesCookie.Reply() func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -798,6 +811,8 @@ func GetAllModeLines(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { // GetAllModeLinesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAllModeLinesUnchecked(c *xgb.Conn, Screen uint16) GetAllModeLinesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetAllModeLines' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -859,7 +874,9 @@ func getAllModeLinesRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -884,6 +901,8 @@ type GetDotClocksCookie struct { // GetDotClocks sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDotClocksCookie.Reply() func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -895,6 +914,8 @@ func GetDotClocks(c *xgb.Conn, Screen uint16) GetDotClocksCookie { // GetDotClocksUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDotClocksUnchecked(c *xgb.Conn, Screen uint16) GetDotClocksCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetDotClocks' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -967,7 +988,9 @@ func getDotClocksRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -992,6 +1015,8 @@ type GetGammaCookie struct { // GetGamma sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaCookie.Reply() func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1003,6 +1028,8 @@ func GetGamma(c *xgb.Conn, Screen uint16) GetGammaCookie { // GetGammaUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaUnchecked(c *xgb.Conn, Screen uint16) GetGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1068,7 +1095,9 @@ func getGammaRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -1093,6 +1122,8 @@ type GetGammaRampCookie struct { // GetGammaRamp sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampCookie.Reply() func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1104,6 +1135,8 @@ func GetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { // GetGammaRampUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampUnchecked(c *xgb.Conn, Screen uint16, Size uint16) GetGammaRampCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1188,7 +1221,9 @@ func getGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -1214,6 +1249,8 @@ type GetGammaRampSizeCookie struct { // GetGammaRampSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetGammaRampSizeCookie.Reply() func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1225,6 +1262,8 @@ func GetGammaRampSize(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { // GetGammaRampSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGammaRampSizeUnchecked(c *xgb.Conn, Screen uint16) GetGammaRampSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetGammaRampSize' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1282,7 +1321,9 @@ func getGammaRampSizeRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -1307,6 +1348,8 @@ type GetModeLineCookie struct { // GetModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling GetModeLineCookie.Reply() func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1318,6 +1361,8 @@ func GetModeLine(c *xgb.Conn, Screen uint16) GetModeLineCookie { // GetModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModeLineUnchecked(c *xgb.Conn, Screen uint16) GetModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1427,7 +1472,9 @@ func getModeLineRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -1452,6 +1499,8 @@ type GetMonitorCookie struct { // GetMonitor sends a checked request. // If an error occurs, it will be returned with the reply by calling GetMonitorCookie.Reply() func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1463,6 +1512,8 @@ func GetMonitor(c *xgb.Conn, Screen uint16) GetMonitorCookie { // GetMonitorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMonitorUnchecked(c *xgb.Conn, Screen uint16) GetMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetMonitor' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1570,7 +1621,9 @@ func getMonitorRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -1595,6 +1648,8 @@ type GetPermissionsCookie struct { // GetPermissions sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPermissionsCookie.Reply() func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1606,6 +1661,8 @@ func GetPermissions(c *xgb.Conn, Screen uint16) GetPermissionsCookie { // GetPermissionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPermissionsUnchecked(c *xgb.Conn, Screen uint16) GetPermissionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetPermissions' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1663,7 +1720,9 @@ func getPermissionsRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -1688,6 +1747,8 @@ type GetViewPortCookie struct { // GetViewPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GetViewPortCookie.Reply() func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1699,6 +1760,8 @@ func GetViewPort(c *xgb.Conn, Screen uint16) GetViewPortCookie { // GetViewPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetViewPortUnchecked(c *xgb.Conn, Screen uint16) GetViewPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'GetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1760,7 +1823,9 @@ func getViewPortRequest(c *xgb.Conn, Screen uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -1785,6 +1850,8 @@ type LockModeSwitchCookie struct { // LockModeSwitch sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1796,6 +1863,8 @@ func LockModeSwitch(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCooki // LockModeSwitchChecked sends a checked request. // If an error occurs, it can be retrieved using LockModeSwitchCookie.Check() func LockModeSwitchChecked(c *xgb.Conn, Screen uint16, Lock uint16) LockModeSwitchCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'LockModeSwitch' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1817,7 +1886,9 @@ func lockModeSwitchRequest(c *xgb.Conn, Screen uint16, Lock uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -1843,6 +1914,8 @@ type ModModeLineCookie struct { // ModModeLine sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1854,6 +1927,8 @@ func ModModeLine(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, // ModModeLineChecked sends a checked request. // If an error occurs, it can be retrieved using ModModeLineCookie.Check() func ModModeLineChecked(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ModModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ModModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1875,7 +1950,9 @@ func modModeLineRequest(c *xgb.Conn, Screen uint32, Hdisplay uint16, Hsyncstart b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -1938,6 +2015,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -1949,6 +2028,8 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2007,7 +2088,9 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -2027,6 +2110,8 @@ type SetClientVersionCookie struct { // SetClientVersion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2038,6 +2123,8 @@ func SetClientVersion(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionC // SetClientVersionChecked sends a checked request. // If an error occurs, it can be retrieved using SetClientVersionCookie.Check() func SetClientVersionChecked(c *xgb.Conn, Major uint16, Minor uint16) SetClientVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetClientVersion' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2059,7 +2146,9 @@ func setClientVersionRequest(c *xgb.Conn, Major uint16, Minor uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -2085,6 +2174,8 @@ type SetGammaCookie struct { // SetGamma sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2096,6 +2187,8 @@ func SetGamma(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) // SetGammaChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaCookie.Check() func SetGammaChecked(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue uint32) SetGammaCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGamma' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2117,7 +2210,9 @@ func setGammaRequest(c *xgb.Conn, Screen uint16, Red uint32, Green uint32, Blue b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2153,6 +2248,8 @@ type SetGammaRampCookie struct { // SetGammaRamp sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2164,6 +2261,8 @@ func SetGammaRamp(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green [ // SetGammaRampChecked sends a checked request. // If an error occurs, it can be retrieved using SetGammaRampCookie.Check() func SetGammaRampChecked(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) SetGammaRampCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetGammaRamp' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2185,7 +2284,9 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -2232,6 +2333,8 @@ type SetViewPortCookie struct { // SetViewPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2243,6 +2346,8 @@ func SetViewPort(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCook // SetViewPortChecked sends a checked request. // If an error occurs, it can be retrieved using SetViewPortCookie.Check() func SetViewPortChecked(c *xgb.Conn, Screen uint16, X uint32, Y uint32) SetViewPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SetViewPort' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2264,7 +2369,9 @@ func setViewPortRequest(c *xgb.Conn, Screen uint16, X uint32, Y uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -2295,6 +2402,8 @@ type SwitchModeCookie struct { // SwitchMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2306,6 +2415,8 @@ func SwitchMode(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { // SwitchModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchModeCookie.Check() func SwitchModeChecked(c *xgb.Conn, Screen uint16, Zoom uint16) SwitchModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2327,7 +2438,9 @@ func switchModeRequest(c *xgb.Conn, Screen uint16, Zoom uint16) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -2353,6 +2466,8 @@ type SwitchToModeCookie struct { // SwitchToMode sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2364,6 +2479,8 @@ func SwitchToMode(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16 // SwitchToModeChecked sends a checked request. // If an error occurs, it can be retrieved using SwitchToModeCookie.Check() func SwitchToModeChecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) SwitchToModeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'SwitchToMode' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2385,7 +2502,9 @@ func switchToModeRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -2451,6 +2570,8 @@ type ValidateModeLineCookie struct { // ValidateModeLine sends a checked request. // If an error occurs, it will be returned with the reply by calling ValidateModeLineCookie.Reply() func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2462,6 +2583,8 @@ func ValidateModeLine(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay ui // ValidateModeLineUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ValidateModeLineUnchecked(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdisplay uint16, Hsyncstart uint16, Hsyncend uint16, Htotal uint16, Hskew uint16, Vdisplay uint16, Vsyncstart uint16, Vsyncend uint16, Vtotal uint16, Flags uint32, Privsize uint32, Private []byte) ValidateModeLineCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFree86-VidModeExtension"]; !ok { panic("Cannot issue request 'ValidateModeLine' using the uninitialized extension 'XFree86-VidModeExtension'. xf86vidmode.Init(connObj) must be called first.") } @@ -2519,7 +2642,9 @@ func validateModeLineRequest(c *xgb.Conn, Screen uint32, Dotclock Dotclock, Hdis b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFree86-VidModeExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index ef08c9a..0f9e4b0 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -21,16 +21,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XFIXES could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XFIXES"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XFIXES"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XFIXES"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -102,10 +101,6 @@ const ( BarrierDirectionsNegativeY = 8 ) -const ( - CursorNotifyDisplayCursor = 0 -) - // CursorNotify is the event number for a CursorNotifyEvent. const CursorNotify = 1 @@ -201,6 +196,10 @@ func init() { xgb.NewExtEventFuncs["XFIXES"][1] = CursorNotifyEventNew } +const ( + CursorNotifyDisplayCursor = 0 +) + const ( CursorNotifyMaskDisplayCursor = 1 ) @@ -381,6 +380,8 @@ type ChangeCursorCookie struct { // ChangeCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -392,6 +393,8 @@ func ChangeCursor(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) // ChangeCursorChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeCursorCookie.Check() func ChangeCursorChecked(c *xgb.Conn, Source xproto.Cursor, Destination xproto.Cursor) ChangeCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -413,7 +416,9 @@ func changeCursorRequest(c *xgb.Conn, Source xproto.Cursor, Destination xproto.C b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 26 // request opcode @@ -439,6 +444,8 @@ type ChangeCursorByNameCookie struct { // ChangeCursorByName sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -450,6 +457,8 @@ func ChangeCursorByName(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name stri // ChangeCursorByNameChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeCursorByNameCookie.Check() func ChangeCursorByNameChecked(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Name string) ChangeCursorByNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeCursorByName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -471,7 +480,9 @@ func changeCursorByNameRequest(c *xgb.Conn, Src xproto.Cursor, Nbytes uint16, Na b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 27 // request opcode @@ -502,6 +513,8 @@ type ChangeSaveSetCookie struct { // ChangeSaveSet sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeSaveSet' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -513,6 +526,8 @@ func ChangeSaveSet(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto. // ChangeSaveSetChecked sends a checked request. // If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Target byte, Map byte, Window xproto.Window) ChangeSaveSetCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ChangeSaveSet' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -534,7 +549,9 @@ func changeSaveSetRequest(c *xgb.Conn, Mode byte, Target byte, Map byte, Window b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -568,6 +585,8 @@ type CopyRegionCookie struct { // CopyRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -579,6 +598,8 @@ func CopyRegion(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie // CopyRegionChecked sends a checked request. // If an error occurs, it can be retrieved using CopyRegionCookie.Check() func CopyRegionChecked(c *xgb.Conn, Source Region, Destination Region) CopyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -600,7 +621,9 @@ func copyRegionRequest(c *xgb.Conn, Source Region, Destination Region) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -626,6 +649,8 @@ type CreatePointerBarrierCookie struct { // CreatePointerBarrier sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePointerBarrier(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 uint16, Y1 uint16, X2 uint16, Y2 uint16, Directions uint32, NumDevices uint16, Devices []uint16) CreatePointerBarrierCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreatePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -637,6 +662,8 @@ func CreatePointerBarrier(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 // CreatePointerBarrierChecked sends a checked request. // If an error occurs, it can be retrieved using CreatePointerBarrierCookie.Check() func CreatePointerBarrierChecked(c *xgb.Conn, Barrier Barrier, Window xproto.Window, X1 uint16, Y1 uint16, X2 uint16, Y2 uint16, Directions uint32, NumDevices uint16, Devices []uint16) CreatePointerBarrierCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreatePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -658,7 +685,9 @@ func createPointerBarrierRequest(c *xgb.Conn, Barrier Barrier, Window xproto.Win b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 31 // request opcode @@ -709,6 +738,8 @@ type CreateRegionCookie struct { // CreateRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -720,6 +751,8 @@ func CreateRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) Cre // CreateRegionChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionCookie.Check() func CreateRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) CreateRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -741,7 +774,9 @@ func createRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectang b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -766,6 +801,8 @@ type CreateRegionFromBitmapCookie struct { // CreateRegionFromBitmap sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -777,6 +814,8 @@ func CreateRegionFromBitmap(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) Cr // CreateRegionFromBitmapChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromBitmapCookie.Check() func CreateRegionFromBitmapChecked(c *xgb.Conn, Region Region, Bitmap xproto.Pixmap) CreateRegionFromBitmapCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromBitmap' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -798,7 +837,9 @@ func createRegionFromBitmapRequest(c *xgb.Conn, Region Region, Bitmap xproto.Pix b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -824,6 +865,8 @@ type CreateRegionFromGCCookie struct { // CreateRegionFromGC sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -835,6 +878,8 @@ func CreateRegionFromGC(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRe // CreateRegionFromGCChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromGCCookie.Check() func CreateRegionFromGCChecked(c *xgb.Conn, Region Region, Gc xproto.Gcontext) CreateRegionFromGCCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromGC' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -856,7 +901,9 @@ func createRegionFromGCRequest(c *xgb.Conn, Region Region, Gc xproto.Gcontext) [ b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -882,6 +929,8 @@ type CreateRegionFromPictureCookie struct { // CreateRegionFromPicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -893,6 +942,8 @@ func CreateRegionFromPicture(c *xgb.Conn, Region Region, Picture render.Picture) // CreateRegionFromPictureChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromPictureCookie.Check() func CreateRegionFromPictureChecked(c *xgb.Conn, Region Region, Picture render.Picture) CreateRegionFromPictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromPicture' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -914,7 +965,9 @@ func createRegionFromPictureRequest(c *xgb.Conn, Region Region, Picture render.P b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -940,6 +993,8 @@ type CreateRegionFromWindowCookie struct { // CreateRegionFromWindow sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -951,6 +1006,8 @@ func CreateRegionFromWindow(c *xgb.Conn, Region Region, Window xproto.Window, Ki // CreateRegionFromWindowChecked sends a checked request. // If an error occurs, it can be retrieved using CreateRegionFromWindowCookie.Check() func CreateRegionFromWindowChecked(c *xgb.Conn, Region Region, Window xproto.Window, Kind shape.Kind) CreateRegionFromWindowCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'CreateRegionFromWindow' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -972,7 +1029,9 @@ func createRegionFromWindowRequest(c *xgb.Conn, Region Region, Window xproto.Win b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -1003,6 +1062,8 @@ type DeletePointerBarrierCookie struct { // DeletePointerBarrier sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeletePointerBarrier(c *xgb.Conn, Barrier Barrier) DeletePointerBarrierCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'DeletePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1014,6 +1075,8 @@ func DeletePointerBarrier(c *xgb.Conn, Barrier Barrier) DeletePointerBarrierCook // DeletePointerBarrierChecked sends a checked request. // If an error occurs, it can be retrieved using DeletePointerBarrierCookie.Check() func DeletePointerBarrierChecked(c *xgb.Conn, Barrier Barrier) DeletePointerBarrierCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'DeletePointerBarrier' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1035,7 +1098,9 @@ func deletePointerBarrierRequest(c *xgb.Conn, Barrier Barrier) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 32 // request opcode @@ -1058,6 +1123,8 @@ type DestroyRegionCookie struct { // DestroyRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1069,6 +1136,8 @@ func DestroyRegion(c *xgb.Conn, Region Region) DestroyRegionCookie { // DestroyRegionChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyRegionCookie.Check() func DestroyRegionChecked(c *xgb.Conn, Region Region) DestroyRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'DestroyRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1090,7 +1159,9 @@ func destroyRegionRequest(c *xgb.Conn, Region Region) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -1113,6 +1184,8 @@ type ExpandRegionCookie struct { // ExpandRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1124,6 +1197,8 @@ func ExpandRegion(c *xgb.Conn, Source Region, Destination Region, Left uint16, R // ExpandRegionChecked sends a checked request. // If an error occurs, it can be retrieved using ExpandRegionCookie.Check() func ExpandRegionChecked(c *xgb.Conn, Source Region, Destination Region, Left uint16, Right uint16, Top uint16, Bottom uint16) ExpandRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ExpandRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1145,7 +1220,9 @@ func expandRegionRequest(c *xgb.Conn, Source Region, Destination Region, Left ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 28 // request opcode @@ -1183,6 +1260,8 @@ type FetchRegionCookie struct { // FetchRegion sends a checked request. // If an error occurs, it will be returned with the reply by calling FetchRegionCookie.Reply() func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1194,6 +1273,8 @@ func FetchRegion(c *xgb.Conn, Region Region) FetchRegionCookie { // FetchRegionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FetchRegionUnchecked(c *xgb.Conn, Region Region) FetchRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'FetchRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1255,7 +1336,9 @@ func fetchRegionRequest(c *xgb.Conn, Region Region) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -1278,6 +1361,8 @@ type GetCursorImageCookie struct { // GetCursorImage sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorImageCookie.Reply() func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorImage' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1289,6 +1374,8 @@ func GetCursorImage(c *xgb.Conn) GetCursorImageCookie { // GetCursorImageUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageUnchecked(c *xgb.Conn) GetCursorImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorImage' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1377,7 +1464,9 @@ func getCursorImageRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -1397,6 +1486,8 @@ type GetCursorImageAndNameCookie struct { // GetCursorImageAndName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorImageAndNameCookie.Reply() func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorImageAndName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1408,6 +1499,8 @@ func GetCursorImageAndName(c *xgb.Conn) GetCursorImageAndNameCookie { // GetCursorImageAndNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorImageAndNameUnchecked(c *xgb.Conn) GetCursorImageAndNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorImageAndName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1515,7 +1608,9 @@ func getCursorImageAndNameRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 25 // request opcode @@ -1535,6 +1630,8 @@ type GetCursorNameCookie struct { // GetCursorName sends a checked request. // If an error occurs, it will be returned with the reply by calling GetCursorNameCookie.Reply() func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1546,6 +1643,8 @@ func GetCursorName(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { // GetCursorNameUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetCursorNameUnchecked(c *xgb.Conn, Cursor xproto.Cursor) GetCursorNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'GetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1615,7 +1714,9 @@ func getCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 24 // request opcode @@ -1638,6 +1739,8 @@ type HideCursorCookie struct { // HideCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'HideCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1649,6 +1752,8 @@ func HideCursor(c *xgb.Conn, Window xproto.Window) HideCursorCookie { // HideCursorChecked sends a checked request. // If an error occurs, it can be retrieved using HideCursorCookie.Check() func HideCursorChecked(c *xgb.Conn, Window xproto.Window) HideCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'HideCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1670,7 +1775,9 @@ func hideCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 29 // request opcode @@ -1693,6 +1800,8 @@ type IntersectRegionCookie struct { // IntersectRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1704,6 +1813,8 @@ func IntersectRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Re // IntersectRegionChecked sends a checked request. // If an error occurs, it can be retrieved using IntersectRegionCookie.Check() func IntersectRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) IntersectRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'IntersectRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1725,7 +1836,9 @@ func intersectRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destina b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -1754,6 +1867,8 @@ type InvertRegionCookie struct { // InvertRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1765,6 +1880,8 @@ func InvertRegion(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destinati // InvertRegionChecked sends a checked request. // If an error occurs, it can be retrieved using InvertRegionCookie.Check() func InvertRegionChecked(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, Destination Region) InvertRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'InvertRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1786,7 +1903,9 @@ func invertRegionRequest(c *xgb.Conn, Source Region, Bounds xproto.Rectangle, De b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -1818,6 +1937,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1829,6 +1950,8 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uin // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1890,7 +2013,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -1916,6 +2041,8 @@ type RegionExtentsCookie struct { // RegionExtents sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1927,6 +2054,8 @@ func RegionExtents(c *xgb.Conn, Source Region, Destination Region) RegionExtents // RegionExtentsChecked sends a checked request. // If an error occurs, it can be retrieved using RegionExtentsCookie.Check() func RegionExtentsChecked(c *xgb.Conn, Source Region, Destination Region) RegionExtentsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'RegionExtents' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1948,7 +2077,9 @@ func regionExtentsRequest(c *xgb.Conn, Source Region, Destination Region) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -1974,6 +2105,8 @@ type SelectCursorInputCookie struct { // SelectCursorInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -1985,6 +2118,8 @@ func SelectCursorInput(c *xgb.Conn, Window xproto.Window, EventMask uint32) Sele // SelectCursorInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectCursorInputCookie.Check() func SelectCursorInputChecked(c *xgb.Conn, Window xproto.Window, EventMask uint32) SelectCursorInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SelectCursorInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2006,7 +2141,9 @@ func selectCursorInputRequest(c *xgb.Conn, Window xproto.Window, EventMask uint3 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -2032,6 +2169,8 @@ type SelectSelectionInputCookie struct { // SelectSelectionInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2043,6 +2182,8 @@ func SelectSelectionInput(c *xgb.Conn, Window xproto.Window, Selection xproto.At // SelectSelectionInputChecked sends a checked request. // If an error occurs, it can be retrieved using SelectSelectionInputCookie.Check() func SelectSelectionInputChecked(c *xgb.Conn, Window xproto.Window, Selection xproto.Atom, EventMask uint32) SelectSelectionInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SelectSelectionInput' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2064,7 +2205,9 @@ func selectSelectionInputRequest(c *xgb.Conn, Window xproto.Window, Selection xp b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -2093,6 +2236,8 @@ type SetCursorNameCookie struct { // SetCursorName sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2104,6 +2249,8 @@ func SetCursorName(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string // SetCursorNameChecked sends a checked request. // If an error occurs, it can be retrieved using SetCursorNameCookie.Check() func SetCursorNameChecked(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name string) SetCursorNameCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetCursorName' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2125,7 +2272,9 @@ func setCursorNameRequest(c *xgb.Conn, Cursor xproto.Cursor, Nbytes uint16, Name b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 23 // request opcode @@ -2156,6 +2305,8 @@ type SetGCClipRegionCookie struct { // SetGCClipRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2167,6 +2318,8 @@ func SetGCClipRegion(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int // SetGCClipRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetGCClipRegionCookie.Check() func SetGCClipRegionChecked(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOrigin int16, YOrigin int16) SetGCClipRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetGCClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2188,7 +2341,9 @@ func setGCClipRegionRequest(c *xgb.Conn, Gc xproto.Gcontext, Region Region, XOri b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -2220,6 +2375,8 @@ type SetPictureClipRegionCookie struct { // SetPictureClipRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2231,6 +2388,8 @@ func SetPictureClipRegion(c *xgb.Conn, Picture render.Picture, Region Region, XO // SetPictureClipRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetPictureClipRegionCookie.Check() func SetPictureClipRegionChecked(c *xgb.Conn, Picture render.Picture, Region Region, XOrigin int16, YOrigin int16) SetPictureClipRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetPictureClipRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2252,7 +2411,9 @@ func setPictureClipRegionRequest(c *xgb.Conn, Picture render.Picture, Region Reg b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -2284,6 +2445,8 @@ type SetRegionCookie struct { // SetRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2295,6 +2458,8 @@ func SetRegion(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetReg // SetRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetRegionCookie.Check() func SetRegionChecked(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) SetRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2316,7 +2481,9 @@ func setRegionRequest(c *xgb.Conn, Region Region, Rectangles []xproto.Rectangle) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -2341,6 +2508,8 @@ type SetWindowShapeRegionCookie struct { // SetWindowShapeRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2352,6 +2521,8 @@ func SetWindowShapeRegion(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, // SetWindowShapeRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SetWindowShapeRegionCookie.Check() func SetWindowShapeRegionChecked(c *xgb.Conn, Dest xproto.Window, DestKind shape.Kind, XOffset int16, YOffset int16, Region Region) SetWindowShapeRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SetWindowShapeRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2373,7 +2544,9 @@ func setWindowShapeRegionRequest(c *xgb.Conn, Dest xproto.Window, DestKind shape b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 21 // request opcode @@ -2410,6 +2583,8 @@ type ShowCursorCookie struct { // ShowCursor sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ShowCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2421,6 +2596,8 @@ func ShowCursor(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { // ShowCursorChecked sends a checked request. // If an error occurs, it can be retrieved using ShowCursorCookie.Check() func ShowCursorChecked(c *xgb.Conn, Window xproto.Window) ShowCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'ShowCursor' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2442,7 +2619,9 @@ func showCursorRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 30 // request opcode @@ -2465,6 +2644,8 @@ type SubtractRegionCookie struct { // SubtractRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2476,6 +2657,8 @@ func SubtractRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Reg // SubtractRegionChecked sends a checked request. // If an error occurs, it can be retrieved using SubtractRegionCookie.Check() func SubtractRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) SubtractRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'SubtractRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2497,7 +2680,9 @@ func subtractRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destinat b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2526,6 +2711,8 @@ type TranslateRegionCookie struct { // TranslateRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2537,6 +2724,8 @@ func TranslateRegion(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRe // TranslateRegionChecked sends a checked request. // If an error occurs, it can be retrieved using TranslateRegionCookie.Check() func TranslateRegionChecked(c *xgb.Conn, Region Region, Dx int16, Dy int16) TranslateRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'TranslateRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2558,7 +2747,9 @@ func translateRegionRequest(c *xgb.Conn, Region Region, Dx int16, Dy int16) []by b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -2587,6 +2778,8 @@ type UnionRegionCookie struct { // UnionRegion sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2598,6 +2791,8 @@ func UnionRegion(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region // UnionRegionChecked sends a checked request. // If an error occurs, it can be retrieved using UnionRegionCookie.Check() func UnionRegionChecked(c *xgb.Conn, Source1 Region, Source2 Region, Destination Region) UnionRegionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XFIXES"]; !ok { panic("Cannot issue request 'UnionRegion' using the uninitialized extension 'XFIXES'. xfixes.Init(connObj) must be called first.") } @@ -2619,7 +2814,9 @@ func unionRegionRequest(c *xgb.Conn, Source1 Region, Source2 Region, Destination b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XFIXES"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode diff --git a/nexgb/xgb.go b/nexgb/xgb.go index 44634fe..f49d19b 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -13,11 +13,6 @@ var ( // Where to log error-messages. Defaults to stderr. // To disable logging, just set this to log.New(ioutil.Discard, "", 0) Logger = log.New(os.Stderr, "XGB: ", log.Lshortfile) - - // ExtLock is a lock used whenever new extensions are initialized. - // It should not be used. It is exported for use in the extension - // sub-packages. - ExtLock sync.Mutex ) const ( @@ -66,6 +61,11 @@ type Conn struct { seqChan chan uint16 reqChan chan *request closing chan chan struct{} + + // ExtLock is a lock used whenever new extensions are initialized. + // It should not be used. It is exported for use in the extension + // sub-packages. + ExtLock sync.RWMutex // Extensions is a map from extension name to major opcode. It should // not be used. It is exported for use in the extension sub-packages. diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index f64f339..f18fd67 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -99,8 +99,9 @@ func (c *Context) Morph(xmlBytes []byte) { "on the server.\")", xname) c.Putln("}") c.Putln("") - c.Putln("xgb.ExtLock.Lock()") + c.Putln("c.ExtLock.Lock()") c.Putln("c.Extensions[\"%s\"] = reply.MajorOpcode", xname) + c.Putln("c.ExtLock.Unlock()") c.Putln("for evNum, fun := range xgb.NewExtEventFuncs[\"%s\"] {", xname) c.Putln("xgb.NewEventFuncs[int(reply.FirstEvent) + evNum] = fun") @@ -109,8 +110,6 @@ func (c *Context) Morph(xmlBytes []byte) { xname) c.Putln("xgb.NewErrorFuncs[int(reply.FirstError) + errNum] = fun") c.Putln("}") - c.Putln("xgb.ExtLock.Unlock()") - c.Putln("") c.Putln("return nil") c.Putln("}") c.Putln("") diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index c1b9ee9..396305e 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -79,6 +79,8 @@ func (r *Request) CheckExt(c *Context) { if !c.protocol.isExt() { return } + c.Putln("c.ExtLock.RLock()") + c.Putln("defer c.ExtLock.RUnlock()") c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", c.protocol.ExtXName) c.Putln("panic(\"Cannot issue request '%s' using the uninitialized "+ "extension '%s'. %s.Init(connObj) must be called first.\")", @@ -169,7 +171,9 @@ func (r *Request) WriteRequest(c *Context) { c.Putln("buf := make([]byte, size)") c.Putln("") if c.protocol.isExt() { + c.Putln("c.ExtLock.RLock()") c.Putln("buf[b] = c.Extensions[\"%s\"]", c.protocol.ExtXName) + c.Putln("c.ExtLock.RUnlock()") c.Putln("b += 1") c.Putln("") } diff --git a/nexgb/xinerama/xinerama.go b/nexgb/xinerama/xinerama.go index 75c773c..ec97406 100644 --- a/nexgb/xinerama/xinerama.go +++ b/nexgb/xinerama/xinerama.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XINERAMA could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XINERAMA"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XINERAMA"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XINERAMA"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -137,6 +136,8 @@ type GetScreenCountCookie struct { // GetScreenCount sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenCountCookie.Reply() func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetScreenCount' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -148,6 +149,8 @@ func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { // GetScreenCountUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetScreenCount' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -203,7 +206,9 @@ func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -226,6 +231,8 @@ type GetScreenSizeCookie struct { // GetScreenSize sends a checked request. // If an error occurs, it will be returned with the reply by calling GetScreenSizeCookie.Reply() func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetScreenSize' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -237,6 +244,8 @@ func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSi // GetScreenSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetScreenSize' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -303,7 +312,9 @@ func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []by b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -329,6 +340,8 @@ type GetStateCookie struct { // GetState sends a checked request. // If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply() func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -340,6 +353,8 @@ func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie { // GetStateUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'GetState' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -395,7 +410,9 @@ func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -418,6 +435,8 @@ type IsActiveCookie struct { // IsActive sends a checked request. // If an error occurs, it will be returned with the reply by calling IsActiveCookie.Reply() func IsActive(c *xgb.Conn) IsActiveCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'IsActive' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -429,6 +448,8 @@ func IsActive(c *xgb.Conn) IsActiveCookie { // IsActiveUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'IsActive' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -483,7 +504,9 @@ func isActiveRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -503,6 +526,8 @@ type QueryScreensCookie struct { // QueryScreens sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryScreensCookie.Reply() func QueryScreens(c *xgb.Conn) QueryScreensCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'QueryScreens' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -514,6 +539,8 @@ func QueryScreens(c *xgb.Conn) QueryScreensCookie { // QueryScreensUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'QueryScreens' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -575,7 +602,9 @@ func queryScreensRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -595,6 +624,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -606,6 +637,8 @@ func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XINERAMA"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XINERAMA'. xinerama.Init(connObj) must be called first.") } @@ -664,7 +697,9 @@ func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XINERAMA"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index 5ed49a0..d692aed 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XpExtension could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XpExtension"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XpExtension"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XpExtension"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -438,6 +437,8 @@ type CreateContextCookie struct { // CreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -449,6 +450,8 @@ func CreateContext(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleL // CreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using CreateContextCookie.Check() func CreateContextChecked(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -470,7 +473,9 @@ func createContextRequest(c *xgb.Conn, ContextId uint32, PrinterNameLen uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -509,6 +514,8 @@ type PrintDestroyContextCookie struct { // PrintDestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -520,6 +527,8 @@ func PrintDestroyContext(c *xgb.Conn, Context uint32) PrintDestroyContextCookie // PrintDestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintDestroyContextCookie.Check() func PrintDestroyContextChecked(c *xgb.Conn, Context uint32) PrintDestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintDestroyContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -541,7 +550,9 @@ func printDestroyContextRequest(c *xgb.Conn, Context uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -564,6 +575,8 @@ type PrintEndDocCookie struct { // PrintEndDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -575,6 +588,8 @@ func PrintEndDoc(c *xgb.Conn, Cancel bool) PrintEndDocCookie { // PrintEndDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndDocCookie.Check() func PrintEndDocChecked(c *xgb.Conn, Cancel bool) PrintEndDocCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -596,7 +611,9 @@ func printEndDocRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -623,6 +640,8 @@ type PrintEndJobCookie struct { // PrintEndJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -634,6 +653,8 @@ func PrintEndJob(c *xgb.Conn, Cancel bool) PrintEndJobCookie { // PrintEndJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndJobCookie.Check() func PrintEndJobChecked(c *xgb.Conn, Cancel bool) PrintEndJobCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -655,7 +676,9 @@ func printEndJobRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -682,6 +705,8 @@ type PrintEndPageCookie struct { // PrintEndPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -693,6 +718,8 @@ func PrintEndPage(c *xgb.Conn, Cancel bool) PrintEndPageCookie { // PrintEndPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintEndPageCookie.Check() func PrintEndPageChecked(c *xgb.Conn, Cancel bool) PrintEndPageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintEndPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -714,7 +741,9 @@ func printEndPageRequest(c *xgb.Conn, Cancel bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -743,6 +772,8 @@ type PrintGetAttributesCookie struct { // PrintGetAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetAttributesCookie.Reply() func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -754,6 +785,8 @@ func PrintGetAttributes(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttrib // PrintGetAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetAttributesUnchecked(c *xgb.Conn, Context Pcontext, Pool byte) PrintGetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -769,7 +802,7 @@ type PrintGetAttributesReply struct { // padding: 1 bytes StringLen uint32 // padding: 20 bytes - Attributes String8 + Attributes []String8 // size: xgb.Pad((int(StringLen) * 1)) } // Reply blocks and returns the reply data for a PrintGetAttributes request. @@ -802,8 +835,11 @@ func printGetAttributesReply(buf []byte) *PrintGetAttributesReply { b += 20 // padding - v.Attributes = String8(buf[b]) - b += 1 + v.Attributes = make([]String8, v.StringLen) + for i := 0; i < int(v.StringLen); i++ { + v.Attributes[i] = String8(buf[b]) + b += 1 + } return v } @@ -815,7 +851,9 @@ func printGetAttributesRequest(c *xgb.Conn, Context Pcontext, Pool byte) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -843,6 +881,8 @@ type PrintGetContextCookie struct { // PrintGetContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetContextCookie.Reply() func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -854,6 +894,8 @@ func PrintGetContext(c *xgb.Conn) PrintGetContextCookie { // PrintGetContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetContextUnchecked(c *xgb.Conn) PrintGetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -908,7 +950,9 @@ func printGetContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -928,6 +972,8 @@ type PrintGetDocumentDataCookie struct { // PrintGetDocumentData sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetDocumentDataCookie.Reply() func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -939,6 +985,8 @@ func PrintGetDocumentData(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintG // PrintGetDocumentDataUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetDocumentDataUnchecked(c *xgb.Conn, Context Pcontext, MaxBytes uint32) PrintGetDocumentDataCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1009,7 +1057,9 @@ func printGetDocumentDataRequest(c *xgb.Conn, Context Pcontext, MaxBytes uint32) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -1035,6 +1085,8 @@ type PrintGetImageResolutionCookie struct { // PrintGetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetImageResolutionCookie.Reply() func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1046,6 +1098,8 @@ func PrintGetImageResolution(c *xgb.Conn, Context Pcontext) PrintGetImageResolut // PrintGetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext) PrintGetImageResolutionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1100,7 +1154,9 @@ func printGetImageResolutionRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 24 // request opcode @@ -1123,6 +1179,8 @@ type PrintGetOneAttributesCookie struct { // PrintGetOneAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetOneAttributesCookie.Reply() func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1134,6 +1192,8 @@ func PrintGetOneAttributes(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool b // PrintGetOneAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetOneAttributesUnchecked(c *xgb.Conn, Context Pcontext, NameLen uint32, Pool byte, Name []String8) PrintGetOneAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetOneAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1198,7 +1258,9 @@ func printGetOneAttributesRequest(c *xgb.Conn, Context Pcontext, NameLen uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -1234,6 +1296,8 @@ type PrintGetPageDimensionsCookie struct { // PrintGetPageDimensions sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPageDimensionsCookie.Reply() func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1245,6 +1309,8 @@ func PrintGetPageDimensions(c *xgb.Conn, Context Pcontext) PrintGetPageDimension // PrintGetPageDimensionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPageDimensionsUnchecked(c *xgb.Conn, Context Pcontext) PrintGetPageDimensionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPageDimensions' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1319,7 +1385,9 @@ func printGetPageDimensionsRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 21 // request opcode @@ -1342,6 +1410,8 @@ type PrintGetPrinterListCookie struct { // PrintGetPrinterList sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetPrinterListCookie.Reply() func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1353,6 +1423,8 @@ func PrintGetPrinterList(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, P // PrintGetPrinterListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetPrinterListUnchecked(c *xgb.Conn, PrinterNameLen uint32, LocaleLen uint32, PrinterName []String8, Locale []String8) PrintGetPrinterListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1414,7 +1486,9 @@ func printGetPrinterListRequest(c *xgb.Conn, PrinterNameLen uint32, LocaleLen ui b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -1450,6 +1524,8 @@ type PrintGetScreenOfContextCookie struct { // PrintGetScreenOfContext sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintGetScreenOfContextCookie.Reply() func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1461,6 +1537,8 @@ func PrintGetScreenOfContext(c *xgb.Conn) PrintGetScreenOfContextCookie { // PrintGetScreenOfContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintGetScreenOfContextUnchecked(c *xgb.Conn) PrintGetScreenOfContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintGetScreenOfContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1515,7 +1593,9 @@ func printGetScreenOfContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -1535,6 +1615,8 @@ type PrintInputSelectedCookie struct { // PrintInputSelected sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintInputSelectedCookie.Reply() func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1546,6 +1628,8 @@ func PrintInputSelected(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie // PrintInputSelectedUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintInputSelectedUnchecked(c *xgb.Conn, Context Pcontext) PrintInputSelectedCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintInputSelected' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1620,7 +1704,9 @@ func printInputSelectedRequest(c *xgb.Conn, Context Pcontext) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -1643,6 +1729,8 @@ type PrintPutDocumentDataCookie struct { // PrintPutDocumentData sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1654,6 +1742,8 @@ func PrintPutDocumentData(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, // PrintPutDocumentDataChecked sends a checked request. // If an error occurs, it can be retrieved using PrintPutDocumentDataCookie.Check() func PrintPutDocumentDataChecked(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) PrintPutDocumentDataCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintPutDocumentData' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1675,7 +1765,9 @@ func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -1720,6 +1812,8 @@ type PrintQueryScreensCookie struct { // PrintQueryScreens sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryScreensCookie.Reply() func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1731,6 +1825,8 @@ func PrintQueryScreens(c *xgb.Conn) PrintQueryScreensCookie { // PrintQueryScreensUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryScreensUnchecked(c *xgb.Conn) PrintQueryScreensCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryScreens' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1795,7 +1891,9 @@ func printQueryScreensRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -1815,6 +1913,8 @@ type PrintQueryVersionCookie struct { // PrintQueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintQueryVersionCookie.Reply() func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1826,6 +1926,8 @@ func PrintQueryVersion(c *xgb.Conn) PrintQueryVersionCookie { // PrintQueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintQueryVersionUnchecked(c *xgb.Conn) PrintQueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintQueryVersion' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1884,7 +1986,9 @@ func printQueryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -1904,6 +2008,8 @@ type PrintRehashPrinterListCookie struct { // PrintRehashPrinterList sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1915,6 +2021,8 @@ func PrintRehashPrinterList(c *xgb.Conn) PrintRehashPrinterListCookie { // PrintRehashPrinterListChecked sends a checked request. // If an error occurs, it can be retrieved using PrintRehashPrinterListCookie.Check() func PrintRehashPrinterListChecked(c *xgb.Conn) PrintRehashPrinterListCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintRehashPrinterList' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1936,7 +2044,9 @@ func printRehashPrinterListRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -1956,6 +2066,8 @@ type PrintSelectInputCookie struct { // PrintSelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1967,6 +2079,8 @@ func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList // PrintSelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -1988,7 +2102,9 @@ func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, Ev b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2019,6 +2135,8 @@ type PrintSetAttributesCookie struct { // PrintSetAttributes sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2030,6 +2148,8 @@ func PrintSetAttributes(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool by // PrintSetAttributesChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetAttributesCookie.Check() func PrintSetAttributesChecked(c *xgb.Conn, Context Pcontext, StringLen uint32, Pool byte, Rule byte, Attributes []String8) PrintSetAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetAttributes' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2051,7 +2171,9 @@ func printSetAttributesRequest(c *xgb.Conn, Context Pcontext, StringLen uint32, b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -2090,6 +2212,8 @@ type PrintSetContextCookie struct { // PrintSetContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2101,6 +2225,8 @@ func PrintSetContext(c *xgb.Conn, Context uint32) PrintSetContextCookie { // PrintSetContextChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSetContextCookie.Check() func PrintSetContextChecked(c *xgb.Conn, Context uint32) PrintSetContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetContext' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2122,7 +2248,9 @@ func printSetContextRequest(c *xgb.Conn, Context uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -2145,6 +2273,8 @@ type PrintSetImageResolutionCookie struct { // PrintSetImageResolution sends a checked request. // If an error occurs, it will be returned with the reply by calling PrintSetImageResolutionCookie.Reply() func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2156,6 +2286,8 @@ func PrintSetImageResolution(c *xgb.Conn, Context Pcontext, ImageResolution uint // PrintSetImageResolutionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintSetImageResolutionUnchecked(c *xgb.Conn, Context Pcontext, ImageResolution uint16) PrintSetImageResolutionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSetImageResolution' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2215,7 +2347,9 @@ func printSetImageResolutionRequest(c *xgb.Conn, Context Pcontext, ImageResoluti b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 23 // request opcode @@ -2241,6 +2375,8 @@ type PrintStartDocCookie struct { // PrintStartDoc sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2252,6 +2388,8 @@ func PrintStartDoc(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { // PrintStartDocChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartDocCookie.Check() func PrintStartDocChecked(c *xgb.Conn, DriverMode byte) PrintStartDocCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartDoc' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2273,7 +2411,9 @@ func printStartDocRequest(c *xgb.Conn, DriverMode byte) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -2296,6 +2436,8 @@ type PrintStartJobCookie struct { // PrintStartJob sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2307,6 +2449,8 @@ func PrintStartJob(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { // PrintStartJobChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartJobCookie.Check() func PrintStartJobChecked(c *xgb.Conn, OutputMode byte) PrintStartJobCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartJob' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2328,7 +2472,9 @@ func printStartJobRequest(c *xgb.Conn, OutputMode byte) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -2351,6 +2497,8 @@ type PrintStartPageCookie struct { // PrintStartPage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2362,6 +2510,8 @@ func PrintStartPage(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { // PrintStartPageChecked sends a checked request. // If an error occurs, it can be retrieved using PrintStartPageCookie.Check() func PrintStartPageChecked(c *xgb.Conn, Window xproto.Window) PrintStartPageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintStartPage' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } @@ -2383,7 +2533,9 @@ func printStartPageRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XpExtension"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 728f85f..716c49b 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -4227,6 +4227,10 @@ func NewPixmapId(c *xgb.Conn) (Pixmap, error) { return Pixmap(id), nil } +const ( + PixmapNone = 0 +) + // BadPixmap is the error number for a BadPixmap. const BadPixmap = 4 @@ -4265,10 +4269,6 @@ func init() { xgb.NewErrorFuncs[4] = PixmapErrorNew } -const ( - PixmapNone = 0 -) - const ( PlaceOnTop = 0 PlaceOnBottom = 1 @@ -6379,10 +6379,6 @@ func NewWindowId(c *xgb.Conn) (Window, error) { return Window(id), nil } -const ( - WindowNone = 0 -) - // BadWindow is the error number for a BadWindow. const BadWindow = 3 @@ -6421,6 +6417,10 @@ func init() { xgb.NewErrorFuncs[3] = WindowErrorNew } +const ( + WindowNone = 0 +) + const ( WindowClassCopyFromParent = 0 WindowClassInputOutput = 1 diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 87d8f98..1afcc10 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named SELinux could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["SELinux"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["SELinux"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["SELinux"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -161,6 +160,8 @@ type GetClientContextCookie struct { // GetClientContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -172,6 +173,8 @@ func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { // GetClientContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetClientContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -237,7 +240,9 @@ func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 22 // request opcode @@ -260,6 +265,8 @@ type GetDeviceContextCookie struct { // GetDeviceContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceContextCookie.Reply() func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -271,6 +278,8 @@ func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { // GetDeviceContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -336,7 +345,9 @@ func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -359,6 +370,8 @@ type GetDeviceCreateContextCookie struct { // GetDeviceCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -370,6 +383,8 @@ func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { // GetDeviceCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -435,7 +450,9 @@ func getDeviceCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -455,6 +472,8 @@ type GetPropertyContextCookie struct { // GetPropertyContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyContextCookie.Reply() func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -466,6 +485,8 @@ func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) // GetPropertyContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -531,7 +552,9 @@ func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xprot b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -557,6 +580,8 @@ type GetPropertyCreateContextCookie struct { // GetPropertyCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -568,6 +593,8 @@ func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { // GetPropertyCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -633,7 +660,9 @@ func getPropertyCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -653,6 +682,8 @@ type GetPropertyDataContextCookie struct { // GetPropertyDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyDataContextCookie.Reply() func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -664,6 +695,8 @@ func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.A // GetPropertyDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -729,7 +762,9 @@ func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property x b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -755,6 +790,8 @@ type GetPropertyUseContextCookie struct { // GetPropertyUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -766,6 +803,8 @@ func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { // GetPropertyUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -831,7 +870,9 @@ func getPropertyUseContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -851,6 +892,8 @@ type GetSelectionContextCookie struct { // GetSelectionContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionContextCookie.Reply() func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -862,6 +905,8 @@ func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContext // GetSelectionContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -927,7 +972,9 @@ func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -950,6 +997,8 @@ type GetSelectionCreateContextCookie struct { // GetSelectionCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -961,6 +1010,8 @@ func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { // GetSelectionCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1026,7 +1077,9 @@ func getSelectionCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -1046,6 +1099,8 @@ type GetSelectionDataContextCookie struct { // GetSelectionDataContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionDataContextCookie.Reply() func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1057,6 +1112,8 @@ func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDat // GetSelectionDataContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionDataContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1122,7 +1179,9 @@ func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 20 // request opcode @@ -1145,6 +1204,8 @@ type GetSelectionUseContextCookie struct { // GetSelectionUseContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1156,6 +1217,8 @@ func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { // GetSelectionUseContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1221,7 +1284,9 @@ func getSelectionUseContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -1241,6 +1306,8 @@ type GetWindowContextCookie struct { // GetWindowContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1252,6 +1319,8 @@ func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie // GetWindowContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1317,7 +1386,9 @@ func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -1340,6 +1411,8 @@ type GetWindowCreateContextCookie struct { // GetWindowCreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1351,6 +1424,8 @@ func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { // GetWindowCreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'GetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1416,7 +1491,9 @@ func getWindowCreateContextRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -1436,6 +1513,8 @@ type ListPropertiesCookie struct { // ListProperties sends a checked request. // If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1447,6 +1526,8 @@ func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { // ListPropertiesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListProperties' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1508,7 +1589,9 @@ func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -1531,6 +1614,8 @@ type ListSelectionsCookie struct { // ListSelections sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSelectionsCookie.Reply() func ListSelections(c *xgb.Conn) ListSelectionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1542,6 +1627,8 @@ func ListSelections(c *xgb.Conn) ListSelectionsCookie { // ListSelectionsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'ListSelections' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1603,7 +1690,9 @@ func listSelectionsRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 21 // request opcode @@ -1623,6 +1712,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1634,6 +1725,8 @@ func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionC // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1692,7 +1785,9 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -1718,6 +1813,8 @@ type SetDeviceContextCookie struct { // SetDeviceContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1729,6 +1826,8 @@ func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context str // SetDeviceContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1750,7 +1849,9 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -1779,6 +1880,8 @@ type SetDeviceCreateContextCookie struct { // SetDeviceCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1790,6 +1893,8 @@ func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetD // SetDeviceCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetDeviceCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1811,7 +1916,9 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -1837,6 +1944,8 @@ type SetPropertyCreateContextCookie struct { // SetPropertyCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1848,6 +1957,8 @@ func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) Se // SetPropertyCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1869,7 +1980,9 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -1895,6 +2008,8 @@ type SetPropertyUseContextCookie struct { // SetPropertyUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1906,6 +2021,8 @@ func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPr // SetPropertyUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetPropertyUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1927,7 +2044,9 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -1953,6 +2072,8 @@ type SetSelectionCreateContextCookie struct { // SetSelectionCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1964,6 +2085,8 @@ func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) S // SetSelectionCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -1985,7 +2108,9 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2011,6 +2136,8 @@ type SetSelectionUseContextCookie struct { // SetSelectionUseContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -2022,6 +2149,8 @@ func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetS // SetSelectionUseContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetSelectionUseContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -2043,7 +2172,9 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -2069,6 +2200,8 @@ type SetWindowCreateContextCookie struct { // SetWindowCreateContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -2080,6 +2213,8 @@ func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetW // SetWindowCreateContextChecked sends a checked request. // If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["SELinux"]; !ok { panic("Cannot issue request 'SetWindowCreateContext' using the uninitialized extension 'SELinux'. xselinux.Init(connObj) must be called first.") } @@ -2101,7 +2236,9 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["SELinux"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode diff --git a/nexgb/xtest/xtest.go b/nexgb/xtest/xtest.go index 982e9f9..182760e 100644 --- a/nexgb/xtest/xtest.go +++ b/nexgb/xtest/xtest.go @@ -19,16 +19,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XTEST could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XTEST"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XTEST"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XTEST"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -74,6 +73,8 @@ type CompareCursorCookie struct { // CompareCursor sends a checked request. // If an error occurs, it will be returned with the reply by calling CompareCursorCookie.Reply() func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'CompareCursor' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -85,6 +86,8 @@ func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) Comp // CompareCursorUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'CompareCursor' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -140,7 +143,9 @@ func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Curso b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XTEST"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -166,6 +171,8 @@ type FakeInputCookie struct { // FakeInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'FakeInput' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -177,6 +184,8 @@ func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Win // FakeInputChecked sends a checked request. // If an error occurs, it can be retrieved using FakeInputCookie.Check() func FakeInputChecked(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'FakeInput' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -198,7 +207,9 @@ func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xpr b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XTEST"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -245,6 +256,8 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -256,6 +269,8 @@ func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionC // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -311,7 +326,9 @@ func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []by b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XTEST"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -339,6 +356,8 @@ type GrabControlCookie struct { // GrabControl sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'GrabControl' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -350,6 +369,8 @@ func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie { // GrabControlChecked sends a checked request. // If an error occurs, it can be retrieved using GrabControlCookie.Check() func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XTEST"]; !ok { panic("Cannot issue request 'GrabControl' using the uninitialized extension 'XTEST'. xtest.Init(connObj) must be called first.") } @@ -371,7 +392,9 @@ func grabControlRequest(c *xgb.Conn, Impervious bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XTEST"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index 1c406b0..f0d3f3a 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -20,16 +20,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XVideo could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XVideo"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XVideo"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XVideo"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -46,7 +45,7 @@ type AdaptorInfo struct { Type byte // padding: 1 bytes Name string // size: xgb.Pad((int(NameSize) * 1)) - // alignment gap to multiple of 4 + // padding: 0 bytes Formats []Format // size: xgb.Pad((int(NumFormats) * 8)) } @@ -78,7 +77,7 @@ func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { b += int(v.NameSize) } - b = (b + 3) & ^3 // alignment gap + b += 0 // padding v.Formats = make([]Format, v.NumFormats) b += FormatReadList(buf[b:], v.Formats) @@ -98,7 +97,7 @@ func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { // Bytes writes a AdaptorInfo value to a byte slice. func (v AdaptorInfo) Bytes() []byte { - buf := make([]byte, (((12 + xgb.Pad((int(v.NameSize) * 1))) + 4) + xgb.Pad((int(v.NumFormats) * 8)))) + buf := make([]byte, (((12 + xgb.Pad((int(v.NameSize) * 1))) + 0) + xgb.Pad((int(v.NumFormats) * 8)))) b := 0 xgb.Put32(buf[b:], uint32(v.BaseId)) @@ -121,7 +120,7 @@ func (v AdaptorInfo) Bytes() []byte { copy(buf[b:], v.Name[:v.NameSize]) b += int(v.NameSize) - b = (b + 3) & ^3 // alignment gap + b += 0 // padding b += FormatListBytes(buf[b:], v.Formats) @@ -144,7 +143,7 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { func AdaptorInfoListSize(list []AdaptorInfo) int { size := 0 for _, item := range list { - size += (((12 + xgb.Pad((int(item.NameSize) * 1))) + 4) + xgb.Pad((int(item.NumFormats) * 8))) + size += (((12 + xgb.Pad((int(item.NameSize) * 1))) + 0) + xgb.Pad((int(item.NumFormats) * 8))) } return size } @@ -1208,6 +1207,8 @@ type GetPortAttributeCookie struct { // GetPortAttribute sends a checked request. // If an error occurs, it will be returned with the reply by calling GetPortAttributeCookie.Reply() func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1219,6 +1220,8 @@ func GetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttr // GetPortAttributeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPortAttributeUnchecked(c *xgb.Conn, Port Port, Attribute xproto.Atom) GetPortAttributeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1273,7 +1276,9 @@ func getPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom) []by b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 14 // request opcode @@ -1299,6 +1304,8 @@ type GetStillCookie struct { // GetStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1310,6 +1317,8 @@ func GetStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetStillChecked sends a checked request. // If an error occurs, it can be retrieved using GetStillCookie.Check() func GetStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetStillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1331,7 +1340,9 @@ func getStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -1384,6 +1395,8 @@ type GetVideoCookie struct { // GetVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1395,6 +1408,8 @@ func GetVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // GetVideoChecked sends a checked request. // If an error occurs, it can be retrieved using GetVideoCookie.Check() func GetVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) GetVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GetVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1416,7 +1431,9 @@ func getVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -1469,6 +1486,8 @@ type GrabPortCookie struct { // GrabPort sends a checked request. // If an error occurs, it will be returned with the reply by calling GrabPortCookie.Reply() func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1480,6 +1499,8 @@ func GrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { // GrabPortUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPortUnchecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) GrabPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'GrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1531,7 +1552,9 @@ func grabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -1557,6 +1580,8 @@ type ListImageFormatsCookie struct { // ListImageFormats sends a checked request. // If an error occurs, it will be returned with the reply by calling ListImageFormatsCookie.Reply() func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1568,6 +1593,8 @@ func ListImageFormats(c *xgb.Conn, Port Port) ListImageFormatsCookie { // ListImageFormatsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListImageFormatsUnchecked(c *xgb.Conn, Port Port) ListImageFormatsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ListImageFormats' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1629,7 +1656,9 @@ func listImageFormatsRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 16 // request opcode @@ -1652,6 +1681,8 @@ type PutImageCookie struct { // PutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1663,6 +1694,8 @@ func PutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutImageChecked sends a checked request. // If an error occurs, it can be retrieved using PutImageCookie.Check() func PutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Id uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, Data []byte) PutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1684,7 +1717,9 @@ func putImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 18 // request opcode @@ -1749,6 +1784,8 @@ type PutStillCookie struct { // PutStill sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1760,6 +1797,8 @@ func PutStill(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutStillChecked sends a checked request. // If an error occurs, it can be retrieved using PutStillCookie.Check() func PutStillChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutStillCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutStill' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1781,7 +1820,9 @@ func putStillRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -1834,6 +1875,8 @@ type PutVideoCookie struct { // PutVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1845,6 +1888,8 @@ func PutVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gconte // PutVideoChecked sends a checked request. // If an error occurs, it can be retrieved using PutVideoCookie.Check() func PutVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, VidX int16, VidY int16, VidW uint16, VidH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16) PutVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'PutVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1866,7 +1911,9 @@ func putVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -1919,6 +1966,8 @@ type QueryAdaptorsCookie struct { // QueryAdaptors sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryAdaptorsCookie.Reply() func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1930,6 +1979,8 @@ func QueryAdaptors(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { // QueryAdaptorsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryAdaptorsUnchecked(c *xgb.Conn, Window xproto.Window) QueryAdaptorsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryAdaptors' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -1991,7 +2042,9 @@ func queryAdaptorsRequest(c *xgb.Conn, Window xproto.Window) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -2014,6 +2067,8 @@ type QueryBestSizeCookie struct { // QueryBestSize sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2025,6 +2080,8 @@ func QueryBestSize(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16 // QueryBestSizeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW uint16, DrwH uint16, Motion bool) QueryBestSizeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryBestSize' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2083,7 +2140,9 @@ func queryBestSizeRequest(c *xgb.Conn, Port Port, VidW uint16, VidH uint16, DrwW b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 12 // request opcode @@ -2127,6 +2186,8 @@ type QueryEncodingsCookie struct { // QueryEncodings sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryEncodingsCookie.Reply() func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2138,6 +2199,8 @@ func QueryEncodings(c *xgb.Conn, Port Port) QueryEncodingsCookie { // QueryEncodingsUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryEncodingsUnchecked(c *xgb.Conn, Port Port) QueryEncodingsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryEncodings' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2199,7 +2262,9 @@ func queryEncodingsRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -2222,6 +2287,8 @@ type QueryExtensionCookie struct { // QueryExtension sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn) QueryExtensionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2233,6 +2300,8 @@ func QueryExtension(c *xgb.Conn) QueryExtensionCookie { // QueryExtensionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn) QueryExtensionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryExtension' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2291,7 +2360,9 @@ func queryExtensionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode @@ -2311,6 +2382,8 @@ type QueryImageAttributesCookie struct { // QueryImageAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryImageAttributesCookie.Reply() func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2322,6 +2395,8 @@ func QueryImageAttributes(c *xgb.Conn, Port Port, Id uint32, Width uint16, Heigh // QueryImageAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryImageAttributesUnchecked(c *xgb.Conn, Port Port, Id uint32, Width uint16, Height uint16) QueryImageAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryImageAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2408,7 +2483,9 @@ func queryImageAttributesRequest(c *xgb.Conn, Port Port, Id uint32, Width uint16 b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 17 // request opcode @@ -2440,6 +2517,8 @@ type QueryPortAttributesCookie struct { // QueryPortAttributes sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryPortAttributesCookie.Reply() func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2451,6 +2530,8 @@ func QueryPortAttributes(c *xgb.Conn, Port Port) QueryPortAttributesCookie { // QueryPortAttributesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPortAttributesUnchecked(c *xgb.Conn, Port Port) QueryPortAttributesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'QueryPortAttributes' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2516,7 +2597,9 @@ func queryPortAttributesRequest(c *xgb.Conn, Port Port) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 15 // request opcode @@ -2539,6 +2622,8 @@ type SelectPortNotifyCookie struct { // SelectPortNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2550,6 +2635,8 @@ func SelectPortNotify(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie // SelectPortNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectPortNotifyCookie.Check() func SelectPortNotifyChecked(c *xgb.Conn, Port Port, Onoff bool) SelectPortNotifyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectPortNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2571,7 +2658,9 @@ func selectPortNotifyRequest(c *xgb.Conn, Port Port, Onoff bool) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 11 // request opcode @@ -2603,6 +2692,8 @@ type SelectVideoNotifyCookie struct { // SelectVideoNotify sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2614,6 +2705,8 @@ func SelectVideoNotify(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) Select // SelectVideoNotifyChecked sends a checked request. // If an error occurs, it can be retrieved using SelectVideoNotifyCookie.Check() func SelectVideoNotifyChecked(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) SelectVideoNotifyCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SelectVideoNotify' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2635,7 +2728,9 @@ func selectVideoNotifyRequest(c *xgb.Conn, Drawable xproto.Drawable, Onoff bool) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 10 // request opcode @@ -2667,6 +2762,8 @@ type SetPortAttributeCookie struct { // SetPortAttribute sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2678,6 +2775,8 @@ func SetPortAttribute(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32 // SetPortAttributeChecked sends a checked request. // If an error occurs, it can be retrieved using SetPortAttributeCookie.Check() func SetPortAttributeChecked(c *xgb.Conn, Port Port, Attribute xproto.Atom, Value int32) SetPortAttributeCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'SetPortAttribute' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2699,7 +2798,9 @@ func setPortAttributeRequest(c *xgb.Conn, Port Port, Attribute xproto.Atom, Valu b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 13 // request opcode @@ -2728,6 +2829,8 @@ type ShmPutImageCookie struct { // ShmPutImage sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2739,6 +2842,8 @@ func ShmPutImage(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gco // ShmPutImageChecked sends a checked request. // If an error occurs, it can be retrieved using ShmPutImageCookie.Check() func ShmPutImageChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xproto.Gcontext, Shmseg shm.Seg, Id uint32, Offset uint32, SrcX int16, SrcY int16, SrcW uint16, SrcH uint16, DrwX int16, DrwY int16, DrwW uint16, DrwH uint16, Width uint16, Height uint16, SendEvent byte) ShmPutImageCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'ShmPutImage' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2760,7 +2865,9 @@ func shmPutImageRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable, Gc xpr b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 19 // request opcode @@ -2833,6 +2940,8 @@ type StopVideoCookie struct { // StopVideo sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2844,6 +2953,8 @@ func StopVideo(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie // StopVideoChecked sends a checked request. // If an error occurs, it can be retrieved using StopVideoCookie.Check() func StopVideoChecked(c *xgb.Conn, Port Port, Drawable xproto.Drawable) StopVideoCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'StopVideo' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2865,7 +2976,9 @@ func stopVideoRequest(c *xgb.Conn, Port Port, Drawable xproto.Drawable) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 9 // request opcode @@ -2891,6 +3004,8 @@ type UngrabPortCookie struct { // UngrabPort sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2902,6 +3017,8 @@ func UngrabPort(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie // UngrabPortChecked sends a checked request. // If an error occurs, it can be retrieved using UngrabPortCookie.Check() func UngrabPortChecked(c *xgb.Conn, Port Port, Time xproto.Timestamp) UngrabPortCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo"]; !ok { panic("Cannot issue request 'UngrabPort' using the uninitialized extension 'XVideo'. xv.Init(connObj) must be called first.") } @@ -2923,7 +3040,9 @@ func ungrabPortRequest(c *xgb.Conn, Port Port, Time xproto.Timestamp) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index a574a21..b943fa0 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -20,16 +20,15 @@ func Init(c *xgb.Conn) error { return xgb.Errorf("No extension named XVideo-MotionCompensation could be found on on the server.") } - xgb.ExtLock.Lock() + c.ExtLock.Lock() c.Extensions["XVideo-MotionCompensation"] = reply.MajorOpcode + c.ExtLock.Unlock() for evNum, fun := range xgb.NewExtEventFuncs["XVideo-MotionCompensation"] { xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun } for errNum, fun := range xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] { xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun } - xgb.ExtLock.Unlock() - return nil } @@ -203,6 +202,8 @@ type CreateContextCookie struct { // CreateContext sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply() func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -214,6 +215,8 @@ func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Sur // CreateContextUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -286,7 +289,9 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 2 // request opcode @@ -324,6 +329,8 @@ type CreateSubpictureCookie struct { // CreateSubpicture sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply() func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -335,6 +342,8 @@ func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, Xvi // CreateSubpictureUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -416,7 +425,9 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 6 // request opcode @@ -451,6 +462,8 @@ type CreateSurfaceCookie struct { // CreateSurface sends a checked request. // If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply() func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -462,6 +475,8 @@ func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurf // CreateSurfaceUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'CreateSurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -522,7 +537,9 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 4 // request opcode @@ -548,6 +565,8 @@ type DestroyContextCookie struct { // DestroyContext sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -559,6 +578,8 @@ func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie { // DestroyContextChecked sends a checked request. // If an error occurs, it can be retrieved using DestroyContextCookie.Check() func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroyContext' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -580,7 +601,9 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 3 // request opcode @@ -603,6 +626,8 @@ type DestroySubpictureCookie struct { // DestroySubpicture sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -614,6 +639,8 @@ func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCo // DestroySubpictureChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySubpictureCookie.Check() func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySubpicture' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -635,7 +662,9 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 7 // request opcode @@ -658,6 +687,8 @@ type DestroySurfaceCookie struct { // DestroySurface sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -669,6 +700,8 @@ func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { // DestroySurfaceChecked sends a checked request. // If an error occurs, it can be retrieved using DestroySurfaceCookie.Check() func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'DestroySurface' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -690,7 +723,9 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 5 // request opcode @@ -713,6 +748,8 @@ type ListSubpictureTypesCookie struct { // ListSubpictureTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply() func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -724,6 +761,8 @@ func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSub // ListSubpictureTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSubpictureTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -785,7 +824,9 @@ func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 8 // request opcode @@ -811,6 +852,8 @@ type ListSurfaceTypesCookie struct { // ListSurfaceTypes sends a checked request. // If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply() func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -822,6 +865,8 @@ func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { // ListSurfaceTypesUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'ListSurfaceTypes' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -883,7 +928,9 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 1 // request opcode @@ -906,6 +953,8 @@ type QueryVersionCookie struct { // QueryVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -917,6 +966,8 @@ func QueryVersion(c *xgb.Conn) QueryVersionCookie { // QueryVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XVideo-MotionCompensation"]; !ok { panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'XVideo-MotionCompensation'. xvmc.Init(connObj) must be called first.") } @@ -975,7 +1026,9 @@ func queryVersionRequest(c *xgb.Conn) []byte { b := 0 buf := make([]byte, size) + c.ExtLock.RLock() buf[b] = c.Extensions["XVideo-MotionCompensation"] + c.ExtLock.RUnlock() b += 1 buf[b] = 0 // request opcode From 8d343cfd3a12d910d6a663f2d5f2cd4a41d88ce2 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Mon, 21 Mar 2016 18:50:49 +0100 Subject: [PATCH 85/90] Handle wildcard values in Xauthority file Some field values in the Xauthority file have special meanings: - a value of 65535 in the 'family' field means that the entry will match a connection of any family on any address - an empty string in the 'display number' field means that the entry will match a connection on any display number This behaviour is documented at: https://cgit.freedesktop.org/xorg/lib/libXau/tree/AuGetBest.c#n109 --- nexgb/auth.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nexgb/auth.go b/nexgb/auth.go index a6fad90..62a9b35 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -25,6 +25,7 @@ func readAuthority(hostname, display string) ( // As per /usr/include/X11/Xauth.h. const familyLocal = 256 + const familyWild = 65535 if len(hostname) == 0 || hostname == "localhost" { hostname, err = os.Hostname() @@ -75,7 +76,10 @@ func readAuthority(hostname, display string) ( return "", nil, err } - if family == familyLocal && addr == hostname && disp == display { + addrmatch := (family == familyWild) || (family == familyLocal && addr == hostname) + dispmatch := (disp == "") || (disp == display) + + if addrmatch && dispmatch { return name0, data0, nil } } From 1614b58c420f7875f92a5469c77fd7aeccc7a106 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Tue, 29 Mar 2016 16:23:18 -0400 Subject: [PATCH 86/90] fix structs with field name of 'Bytes' (it conflict with a method of the same name that is generated for all such structs) --- nexgb/auth.go | 3 ++- nexgb/res/res.go | 10 +++++----- nexgb/xgb.go | 2 +- nexgb/xgbgen/field.go | 3 +++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/nexgb/auth.go b/nexgb/auth.go index 62a9b35..ec51d10 100644 --- a/nexgb/auth.go +++ b/nexgb/auth.go @@ -76,7 +76,8 @@ func readAuthority(hostname, display string) ( return "", nil, err } - addrmatch := (family == familyWild) || (family == familyLocal && addr == hostname) + addrmatch := (family == familyWild) || + (family == familyLocal && addr == hostname) dispmatch := (disp == "") || (disp == display) if addrmatch && dispmatch { diff --git a/nexgb/res/res.go b/nexgb/res/res.go index e3d7b02..0ad0389 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -283,7 +283,7 @@ func ResourceIdSpecListBytes(buf []byte, list []ResourceIdSpec) int { type ResourceSizeSpec struct { Spec ResourceIdSpec - Bytes uint32 + Bytes_ uint32 RefCount uint32 UseCount uint32 } @@ -295,7 +295,7 @@ func ResourceSizeSpecRead(buf []byte, v *ResourceSizeSpec) int { v.Spec = ResourceIdSpec{} b += ResourceIdSpecRead(buf[b:], &v.Spec) - v.Bytes = xgb.Get32(buf[b:]) + v.Bytes_ = xgb.Get32(buf[b:]) b += 4 v.RefCount = xgb.Get32(buf[b:]) @@ -328,7 +328,7 @@ func (v ResourceSizeSpec) Bytes() []byte { b += len(structBytes) } - xgb.Put32(buf[b:], v.Bytes) + xgb.Put32(buf[b:], v.Bytes_) b += 4 xgb.Put32(buf[b:], v.RefCount) @@ -641,7 +641,7 @@ type QueryClientPixmapBytesReply struct { Sequence uint16 // sequence number of the request for this reply Length uint32 // number of bytes in this reply // padding: 1 bytes - Bytes uint32 + Bytes_ uint32 BytesOverflow uint32 } @@ -670,7 +670,7 @@ func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply { v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 - v.Bytes = xgb.Get32(buf[b:]) + v.Bytes_ = xgb.Get32(buf[b:]) b += 4 v.BytesOverflow = xgb.Get32(buf[b:]) diff --git a/nexgb/xgb.go b/nexgb/xgb.go index f49d19b..3d2c61f 100644 --- a/nexgb/xgb.go +++ b/nexgb/xgb.go @@ -61,7 +61,7 @@ type Conn struct { seqChan chan uint16 reqChan chan *request closing chan chan struct{} - + // ExtLock is a lock used whenever new extensions are initialized. // It should not be used. It is exported for use in the extension // sub-packages. diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index bf3b3be..2522a06 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -87,6 +87,9 @@ func (f *SingleField) Initialize(p *Protocol) { } func (f *SingleField) SrcName() string { + if f.srcName == "Bytes" { + return "Bytes_" + } return f.srcName } From 1f83ea75a2972ad9749edf188211f31517170854 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Sun, 22 May 2016 14:13:31 +0200 Subject: [PATCH 87/90] Remove stray format char in randr example --- nexgb/examples/randr/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexgb/examples/randr/main.go b/nexgb/examples/randr/main.go index 01ad594..e349144 100644 --- a/nexgb/examples/randr/main.go +++ b/nexgb/examples/randr/main.go @@ -64,7 +64,7 @@ func main() { if err != nil { log.Fatal(err) } - fmt.Printf("%v, X: %d, Y: %d, Width: %d, Height: %d\n", + fmt.Printf("X: %d, Y: %d, Width: %d, Height: %d\n", info.X, info.Y, info.Width, info.Height) } From a102c4056f6b01035772cf79060012ff800c9669 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Wed, 18 Jan 2017 09:50:29 +0100 Subject: [PATCH 88/90] Makefile: do not redefine $XPROTO if it's already defined. --- nexgb/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nexgb/Makefile b/nexgb/Makefile index 7a3dae2..c0ee531 100644 --- a/nexgb/Makefile +++ b/nexgb/Makefile @@ -10,7 +10,9 @@ # Go package. # My path to the X protocol XML descriptions. +ifndef XPROTO XPROTO=/usr/share/xcb +endif # All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_- # This is intended to build xgbgen and generate Go code for each supported From 1c01d79ba14a802c603ca2e5bbd35156e3363b85 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Wed, 18 Jan 2017 09:53:26 +0100 Subject: [PATCH 89/90] 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/aligngap.go | 120 ------------------------------- nexgb/xgbgen/context.go | 19 ++++- nexgb/xgbgen/expression.go | 54 ++++++++++++++ nexgb/xgbgen/field.go | 79 +++++++++++++++++--- nexgb/xgbgen/go.go | 27 ++++--- nexgb/xgbgen/go_request_reply.go | 14 ++-- nexgb/xgbgen/request_reply.go | 12 ++-- nexgb/xgbgen/translation.go | 6 +- nexgb/xgbgen/xml_fields.go | 1 + 9 files changed, 174 insertions(+), 158 deletions(-) delete mode 100644 nexgb/xgbgen/aligngap.go diff --git a/nexgb/xgbgen/aligngap.go b/nexgb/xgbgen/aligngap.go deleted file mode 100644 index 0cd7ac4..0000000 --- a/nexgb/xgbgen/aligngap.go +++ /dev/null @@ -1,120 +0,0 @@ -package main - -import ( - "fmt" - "os" -) - -func (p *Protocol) AddAlignGaps() { - for i := range p.Imports { - p.Imports[i].AddAlignGaps() - } - for i := range p.Types { - switch t := p.Types[i].(type) { - case *Struct: - t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) - case *Event: - t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) - case *Error: - t.Fields = addAlignGapsToFields(t.xmlName, t.Fields) - } - } - for i := range p.Requests { - p.Requests[i].Fields = addAlignGapsToFields( - p.Requests[i].xmlName, p.Requests[i].Fields) - if p.Requests[i].Reply != nil { - p.Requests[i].Reply.Fields = addAlignGapsToFields( - p.Requests[i].xmlName, p.Requests[i].Reply.Fields) - } - } -} - -func addAlignGapsToFields(name string, fields []Field) []Field { - var i int - for i = 0; i < len(fields); i++ { - if _, ok := fields[i].(*ListField); ok { - break - } - } - if i >= len(fields) { - return fields - } - - r := make([]Field, 0, len(fields)+2) - r = append(r, fields[:i]...) - - r = append(r, fields[i]) - for i = i + 1; i < len(fields); i++ { - switch f := fields[i].(type) { - case *ListField: - // ok, add padding - sz := xcbSizeOfType(f.Type) - switch { - case sz == 1: - // nothing - case sz == 2: - r = append(r, &PadField{0, 2}) - case sz == 3: - panic(fmt.Errorf("Alignment is not a power of 2")) - case sz >= 4: - r = append(r, &PadField{0, 4}) - } - case *LocalField: - // nothing - default: - fmt.Fprintf(os.Stderr, - "Can't add alignment gaps, mix of list and non-list "+ - "fields: %s\n", name) - return fields - } - r = append(r, fields[i]) - } - return r -} - -func xcbSizeOfField(fld Field) int { - switch f := fld.(type) { - case *PadField: - return int(f.Bytes) - case *SingleField: - return xcbSizeOfType(f.Type) - case *ListField: - return 0 - case *ExprField: - return xcbSizeOfType(f.Type) - case *ValueField: - return xcbSizeOfType(f.MaskType) - case *SwitchField: - return 0 - default: - return 0 - } -} - -func xcbSizeOfType(typ Type) int { - switch t := typ.(type) { - case *Resource: - return 4 - case *TypeDef: - return t.Size().Eval() - case *Base: - return t.Size().Eval() - case *Struct: - sz := 0 - for i := range t.Fields { - sz += xcbSizeOfField(t.Fields[i]) - } - return sz - case *Union: - sz := 0 - for i := range t.Fields { - csz := xcbSizeOfField(t.Fields[i]) - if csz > sz { - sz = csz - } - } - return sz - default: - return 0 - } -} 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.", diff --git a/nexgb/xgbgen/expression.go b/nexgb/xgbgen/expression.go index f88232c..3e2235d 100644 --- a/nexgb/xgbgen/expression.go +++ b/nexgb/xgbgen/expression.go @@ -32,6 +32,9 @@ type Expression interface { // Initialize makes sure all names in this expression and any subexpressions // have been translated to Go source names. Initialize(p *Protocol) + + // Makes all field references relative to path + Specialize(path string) Expression } // Function is a custom expression not found in the XML. It's simply used @@ -62,6 +65,12 @@ func (e *Function) Initialize(p *Protocol) { e.Expr.Initialize(p) } +func (e *Function) Specialize(path string) Expression { + r := *e + r.Expr = r.Expr.Specialize(path) + return &r +} + // BinaryOp is an expression that performs some operation (defined in the XML // file) with Expr1 and Expr2 as operands. type BinaryOp struct { @@ -150,6 +159,13 @@ func (e *BinaryOp) Initialize(p *Protocol) { e.Expr2.Initialize(p) } +func (e *BinaryOp) Specialize(path string) Expression { + r := *e + r.Expr1 = r.Expr1.Specialize(path) + r.Expr2 = r.Expr2.Specialize(path) + return &r +} + // UnaryOp is the same as BinaryOp, except it's a unary operator with only // one sub-expression. type UnaryOp struct { @@ -186,6 +202,12 @@ func (e *UnaryOp) Initialize(p *Protocol) { e.Expr.Initialize(p) } +func (e *UnaryOp) Specialize(path string) Expression { + r := *e + r.Expr = r.Expr.Specialize(path) + return &r +} + // Padding represents the application of the 'pad' function to some // sub-expression. type Padding struct { @@ -215,6 +237,12 @@ func (e *Padding) Initialize(p *Protocol) { e.Expr.Initialize(p) } +func (e *Padding) Specialize(path string) Expression { + r := *e + r.Expr = r.Expr.Specialize(path) + return &r +} + // PopCount represents the application of the 'PopCount' function to // some sub-expression. type PopCount struct { @@ -244,6 +272,12 @@ func (e *PopCount) Initialize(p *Protocol) { e.Expr.Initialize(p) } +func (e *PopCount) Specialize(path string) Expression { + r := *e + r.Expr = r.Expr.Specialize(path) + return &r +} + // Value represents some constant integer. type Value struct { v int @@ -267,6 +301,10 @@ func (e *Value) String() string { func (e *Value) Initialize(p *Protocol) {} +func (e *Value) Specialize(path string) Expression { + return e +} + // Bit represents some bit whose value is computed by '1 << bit'. type Bit struct { b int @@ -290,6 +328,10 @@ func (e *Bit) String() string { func (e *Bit) Initialize(p *Protocol) {} +func (e *Bit) Specialize(path string) Expression { + return e +} + // FieldRef represents a reference to some variable in the generated code // with name Name. type FieldRef struct { @@ -321,6 +363,10 @@ func (e *FieldRef) Initialize(p *Protocol) { e.Name = SrcName(p, e.Name) } +func (e *FieldRef) Specialize(path string) Expression { + return &FieldRef{Name: path + "." + e.Name} +} + // EnumRef represents a reference to some enumeration field. // EnumKind is the "group" an EnumItem is the name of the specific enumeration // value inside that group. @@ -351,6 +397,10 @@ func (e *EnumRef) Initialize(p *Protocol) { e.EnumItem = SrcName(p, e.EnumItem) } +func (e *EnumRef) Specialize(path string) Expression { + return e +} + // SumOf represents a summation of the variable in the generated code named by // Name. It is not currently used. (It's XKB voodoo.) type SumOf struct { @@ -380,3 +430,7 @@ func (e *SumOf) String() string { func (e *SumOf) Initialize(p *Protocol) { e.Name = SrcName(p, e.Name) } + +func (e *SumOf) Specialize(path string) Expression { + return e +} diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 2522a06..58f54c8 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -73,6 +73,32 @@ func (p *PadField) Size() Size { } } +type RequiredStartAlign struct { +} + +func (f *RequiredStartAlign) Initialize(p *Protocol) { } + +func (f *RequiredStartAlign) SrcName() string { + panic("illegal to take source name of a required_start_align field") +} + +func (f *RequiredStartAlign) XmlName() string { + panic("illegal to take XML name of a required_start_align field") +} + +func (f *RequiredStartAlign) SrcType() string { + panic("it is illegal to call SrcType on a required_start_align field") +} + +func (f *RequiredStartAlign) Size() Size { + return newFixedSize(0, true) +} + +func (f *RequiredStartAlign) Define(c *Context) { } + +func (f *RequiredStartAlign) Read(c *Context, prefix string) { } +func (f *RequiredStartAlign) Write(c *Context, prefix string) { } + // SingleField represents most of the fields in an XML protocol description. // It corresponds to any single value. type SingleField struct { @@ -289,35 +315,72 @@ func (f *ValueField) Initialize(p *Protocol) { } // SwitchField represents a 'switch' element in the XML protocol description -// file. It is not currently used. (i.e., it is XKB voodoo.) +// file. +// Currently we translate this to a slice of uint32 and let the user sort +// through it. type SwitchField struct { + xmlName string Name string + MaskName string Expr Expression Bitcases []*Bitcase } func (f *SwitchField) SrcName() string { - panic("it is illegal to call SrcName on a SwitchField field") + return f.Name } func (f *SwitchField) XmlName() string { - panic("it is illegal to call XmlName on a SwitchField field") + return f.xmlName } func (f *SwitchField) SrcType() string { - panic("it is illegal to call SrcType on a SwitchField field") + return "[]uint32" } -// XXX: This is a bit tricky. The size has to be represented as a non-concrete -// expression that finds *which* bitcase fields are included, and sums the -// sizes of those fields. func (f *SwitchField) Size() Size { - return newFixedSize(0, true) + // TODO: size expression used here is not correct unless every element of + // the switch is 32 bit long. This assumption holds for xproto but may not + // hold for other protocols (xkb?) + listSize := newExpressionSize(&Function{ + Name: "xgb.Pad", + Expr: &BinaryOp{ + Op: "*", + Expr1: &Value{v: 4}, + Expr2: &PopCount{ + Expr: &Function{ + Name: "int", + Expr: &FieldRef{ + Name: f.MaskName, + }, + }, + }, + }, + }, true) + + return listSize +} + +func (f *SwitchField) ListLength() Size { + return newExpressionSize(&PopCount{ + Expr: &Function{ + Name: "int", + Expr: &FieldRef{ + Name: f.MaskName, + }, + }, + }, true) } func (f *SwitchField) Initialize(p *Protocol) { + f.xmlName = f.Name f.Name = SrcName(p, f.Name) f.Expr.Initialize(p) + fieldref, ok := f.Expr.(*FieldRef) + if !ok { + panic("switch field's expression not a fieldref") + } + f.MaskName = SrcName(p, fieldref.Name) for _, bitcase := range f.Bitcases { bitcase.Expr.Initialize(p) for _, field := range bitcase.Fields { diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go index ace4e00..87b5028 100644 --- a/nexgb/xgbgen/go.go +++ b/nexgb/xgbgen/go.go @@ -186,11 +186,8 @@ func (f *ValueField) Read(c *Context, prefix string) { } func (f *ValueField) Write(c *Context, prefix string) { - // big time mofos - if rq, ok := f.Parent.(*Request); !ok || rq.SrcName() != "ConfigureWindow" { - WriteSimpleSingleField(c, - fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType) - } + WriteSimpleSingleField(c, + fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType) c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) c.Putln("xgb.Put32(buf[b:], %s%s[i])", prefix, f.ListName) c.Putln("b += 4") @@ -200,16 +197,24 @@ func (f *ValueField) Write(c *Context, prefix string) { // Switch field func (f *SwitchField) Define(c *Context) { - c.Putln("// switch field: %s (%s)", f.Name, f.Expr) - panic("todo") + c.Putln("%s []uint32", f.Name) } func (f *SwitchField) Read(c *Context, prefix string) { - c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) - panic("todo") + c.Putln("") + c.Putln("%s%s = make([]uint32, %s)", + prefix, f.Name, f.ListLength().Reduce(prefix)) + c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) + c.Putln("%s%s[i] = xgb.Get32(buf[b:])", prefix, f.Name) + c.Putln("b += 4") + c.Putln("}") + c.Putln("b = xgb.Pad(b)") } func (f *SwitchField) Write(c *Context, prefix string) { - c.Putln("// writing switch field: %s (%s)", f.Name, f.Expr) - panic("todo") + c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix)) + c.Putln("xgb.Put32(buf[b:], %s%s[i])", prefix, f.Name) + c.Putln("b += 4") + c.Putln("}") + c.Putln("b = xgb.Pad(b)") } diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index 396305e..9cadc33 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/xgbgen/go_request_reply.go @@ -205,10 +205,7 @@ func (r *Request) ParamNames() string { for _, field := range r.Fields { switch f := field.(type) { case *ValueField: - // mofos... - if r.SrcName() != "ConfigureWindow" { - names = append(names, f.MaskName) - } + names = append(names, f.MaskName) names = append(names, f.ListName) case *PadField: continue @@ -226,17 +223,16 @@ func (r *Request) ParamNameTypes() string { for _, field := range r.Fields { switch f := field.(type) { case *ValueField: - // mofos... - if r.SrcName() != "ConfigureWindow" { - nameTypes = append(nameTypes, - fmt.Sprintf("%s %s", f.MaskName, f.MaskType.SrcName())) - } + nameTypes = append(nameTypes, + fmt.Sprintf("%s %s", f.MaskName, f.MaskType.SrcName())) nameTypes = append(nameTypes, fmt.Sprintf("%s []uint32", f.ListName)) case *PadField: continue case *ExprField: continue + case *RequiredStartAlign: + continue default: nameTypes = append(nameTypes, fmt.Sprintf("%s %s", field.SrcName(), field.SrcType())) 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()) } diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index f595e5f..d35fa88 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/xgbgen/translation.go @@ -325,12 +325,14 @@ func (x *XMLField) Translate(parent interface{}) Field { case "pad": return &PadField{ Bytes: x.Bytes, + Align: x.Align, } case "field": - return &SingleField{ + s := &SingleField{ xmlName: x.Name, Type: newTranslation(x.Type), } + return s case "list": return &ListField{ xmlName: x.Name, @@ -365,6 +367,8 @@ func (x *XMLField) Translate(parent interface{}) Field { swtch.Bitcases[i] = bitcase.Translate() } return swtch + case "required_start_align": + return &RequiredStartAlign{} } log.Panicf("Unrecognized field element: %s", x.XMLName.Local) diff --git a/nexgb/xgbgen/xml_fields.go b/nexgb/xgbgen/xml_fields.go index fe6c5d5..8b7b5c7 100644 --- a/nexgb/xgbgen/xml_fields.go +++ b/nexgb/xgbgen/xml_fields.go @@ -10,6 +10,7 @@ type XMLField struct { // For 'pad' element Bytes uint `xml:"bytes,attr"` + Align uint16 `xml:"align,attr"` // For 'field', 'list', 'localfield', 'exprfield' and 'switch' elements. Name string `xml:"name,attr"` From 3906399e7c2a40fbaf355de572cf50a314083f64 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Wed, 18 Jan 2017 10:52:16 +0100 Subject: [PATCH 90/90] Regenerated from xcb-proto 1.12 --- nexgb/glx/glx.go | 113 ++++++- nexgb/randr/randr.go | 487 ++++++++++++++++++++++++++----- nexgb/record/record.go | 20 +- nexgb/render/render.go | 58 ++-- nexgb/screensaver/screensaver.go | 3 +- nexgb/xf86dri/xf86dri.go | 5 +- nexgb/xf86vidmode/xf86vidmode.go | 27 +- nexgb/xfixes/xfixes.go | 17 +- nexgb/xgbgen/field.go | 15 +- nexgb/xprint/xprint.go | 57 ++-- nexgb/xproto/xproto.go | 69 ++--- nexgb/xselinux/xselinux.go | 16 +- nexgb/xv/xv.go | 44 +-- 13 files changed, 667 insertions(+), 264 deletions(-) diff --git a/nexgb/glx/glx.go b/nexgb/glx/glx.go index cf72d9a..0ecc3b5 100644 --- a/nexgb/glx/glx.go +++ b/nexgb/glx/glx.go @@ -3165,14 +3165,14 @@ func getClipPlaneReply(buf []byte) *GetClipPlaneReply { v := new(GetClipPlaneReply) b := 1 // skip reply determinant - b += 1 // padding - v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + b += 1 // padding + b += 24 // padding v.Data = make([]Float64, (int(v.Length) / 2)) @@ -4096,14 +4096,14 @@ func getDoublevReply(buf []byte) *GetDoublevReply { v := new(GetDoublevReply) b := 1 // skip reply determinant - b += 1 // padding - v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + b += 1 // padding + b += 4 // padding v.N = xgb.Get32(buf[b:]) @@ -5340,14 +5340,14 @@ func getMapdvReply(buf []byte) *GetMapdvReply { v := new(GetMapdvReply) b := 1 // skip reply determinant - b += 1 // padding - v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + b += 1 // padding + b += 4 // padding v.N = xgb.Get32(buf[b:]) @@ -7548,14 +7548,14 @@ func getTexGendvReply(buf []byte) *GetTexGendvReply { v := new(GetTexGendvReply) b := 1 // skip reply determinant - b += 1 // padding - v.Sequence = xgb.Get16(buf[b:]) b += 2 v.Length = xgb.Get32(buf[b:]) // 4-byte units b += 4 + b += 1 // padding + b += 4 // padding v.N = xgb.Get32(buf[b:]) @@ -8654,6 +8654,103 @@ func isDirectRequest(c *xgb.Conn, Context Context) []byte { return buf } +// IsEnabledCookie is a cookie used only for IsEnabled requests. +type IsEnabledCookie struct { + *xgb.Cookie +} + +// IsEnabled sends a checked request. +// If an error occurs, it will be returned with the reply by calling IsEnabledCookie.Reply() +func IsEnabled(c *xgb.Conn, ContextTag ContextTag, Capability uint32) IsEnabledCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsEnabled' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(isEnabledRequest(c, ContextTag, Capability), cookie) + return IsEnabledCookie{cookie} +} + +// IsEnabledUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func IsEnabledUnchecked(c *xgb.Conn, ContextTag ContextTag, Capability uint32) IsEnabledCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["GLX"]; !ok { + panic("Cannot issue request 'IsEnabled' using the uninitialized extension 'GLX'. glx.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(isEnabledRequest(c, ContextTag, Capability), cookie) + return IsEnabledCookie{cookie} +} + +// IsEnabledReply represents the data returned from a IsEnabled request. +type IsEnabledReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + RetVal Bool32 +} + +// Reply blocks and returns the reply data for a IsEnabled request. +func (cook IsEnabledCookie) Reply() (*IsEnabledReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return isEnabledReply(buf), nil +} + +// isEnabledReply reads a byte slice into a IsEnabledReply value. +func isEnabledReply(buf []byte) *IsEnabledReply { + v := new(IsEnabledReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.RetVal = Bool32(xgb.Get32(buf[b:])) + b += 4 + + return v +} + +// Write request to wire for IsEnabled +// isEnabledRequest writes a IsEnabled request to a byte slice. +func isEnabledRequest(c *xgb.Conn, ContextTag ContextTag, Capability uint32) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + c.ExtLock.RLock() + buf[b] = c.Extensions["GLX"] + c.ExtLock.RUnlock() + b += 1 + + buf[b] = 140 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(ContextTag)) + b += 4 + + xgb.Put32(buf[b:], Capability) + b += 4 + + return buf +} + // IsListCookie is a cookie used only for IsList requests. type IsListCookie struct { *xgb.Cookie diff --git a/nexgb/randr/randr.go b/nexgb/randr/randr.go index 021c011..d280e95 100644 --- a/nexgb/randr/randr.go +++ b/nexgb/randr/randr.go @@ -503,6 +503,153 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) int { return xgb.Pad(b) } +type MonitorInfo struct { + Name xproto.Atom + Primary bool + Automatic bool + NOutput uint16 + X int16 + Y int16 + Width uint16 + Height uint16 + WidthInMillimeters uint32 + HeightInMillimeters uint32 + Outputs []Output // size: xgb.Pad((int(NOutput) * 4)) +} + +// MonitorInfoRead reads a byte slice into a MonitorInfo value. +func MonitorInfoRead(buf []byte, v *MonitorInfo) int { + b := 0 + + v.Name = xproto.Atom(xgb.Get32(buf[b:])) + b += 4 + + if buf[b] == 1 { + v.Primary = true + } else { + v.Primary = false + } + b += 1 + + if buf[b] == 1 { + v.Automatic = true + } else { + v.Automatic = false + } + b += 1 + + v.NOutput = xgb.Get16(buf[b:]) + b += 2 + + v.X = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Y = int16(xgb.Get16(buf[b:])) + b += 2 + + v.Width = xgb.Get16(buf[b:]) + b += 2 + + v.Height = xgb.Get16(buf[b:]) + b += 2 + + v.WidthInMillimeters = xgb.Get32(buf[b:]) + b += 4 + + v.HeightInMillimeters = xgb.Get32(buf[b:]) + b += 4 + + v.Outputs = make([]Output, v.NOutput) + for i := 0; i < int(v.NOutput); i++ { + v.Outputs[i] = Output(xgb.Get32(buf[b:])) + b += 4 + } + + return b +} + +// MonitorInfoReadList reads a byte slice into a list of MonitorInfo values. +func MonitorInfoReadList(buf []byte, dest []MonitorInfo) int { + b := 0 + for i := 0; i < len(dest); i++ { + dest[i] = MonitorInfo{} + b += MonitorInfoRead(buf[b:], &dest[i]) + } + return xgb.Pad(b) +} + +// Bytes writes a MonitorInfo value to a byte slice. +func (v MonitorInfo) Bytes() []byte { + buf := make([]byte, (24 + xgb.Pad((int(v.NOutput) * 4)))) + b := 0 + + xgb.Put32(buf[b:], uint32(v.Name)) + b += 4 + + if v.Primary { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + if v.Automatic { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + xgb.Put16(buf[b:], v.NOutput) + b += 2 + + xgb.Put16(buf[b:], uint16(v.X)) + b += 2 + + xgb.Put16(buf[b:], uint16(v.Y)) + b += 2 + + xgb.Put16(buf[b:], v.Width) + b += 2 + + xgb.Put16(buf[b:], v.Height) + b += 2 + + xgb.Put32(buf[b:], v.WidthInMillimeters) + b += 4 + + xgb.Put32(buf[b:], v.HeightInMillimeters) + b += 4 + + for i := 0; i < int(v.NOutput); i++ { + xgb.Put32(buf[b:], uint32(v.Outputs[i])) + b += 4 + } + + return buf[:b] +} + +// MonitorInfoListBytes writes a list of MonitorInfo values to a byte slice. +func MonitorInfoListBytes(buf []byte, list []MonitorInfo) int { + b := 0 + var structBytes []byte + for _, item := range list { + structBytes = item.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + return xgb.Pad(b) +} + +// MonitorInfoListSize computes the size (bytes) of a list of MonitorInfo values. +func MonitorInfoListSize(list []MonitorInfo) int { + size := 0 + for _, item := range list { + size += (24 + xgb.Pad((int(item.NOutput) * 4))) + } + return size +} + const ( NotifyCrtcChange = 0 NotifyOutputChange = 1 @@ -2173,6 +2320,70 @@ func createModeRequest(c *xgb.Conn, Window xproto.Window, ModeInfo ModeInfo, Nam return buf } +// DeleteMonitorCookie is a cookie used only for DeleteMonitor requests. +type DeleteMonitorCookie struct { + *xgb.Cookie +} + +// DeleteMonitor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func DeleteMonitor(c *xgb.Conn, Window xproto.Window, Name xproto.Atom) DeleteMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteMonitor' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(deleteMonitorRequest(c, Window, Name), cookie) + return DeleteMonitorCookie{cookie} +} + +// DeleteMonitorChecked sends a checked request. +// If an error occurs, it can be retrieved using DeleteMonitorCookie.Check() +func DeleteMonitorChecked(c *xgb.Conn, Window xproto.Window, Name xproto.Atom) DeleteMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'DeleteMonitor' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(deleteMonitorRequest(c, Window, Name), cookie) + return DeleteMonitorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook DeleteMonitorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for DeleteMonitor +// deleteMonitorRequest writes a DeleteMonitor request to a byte slice. +func deleteMonitorRequest(c *xgb.Conn, Window xproto.Window, Name xproto.Atom) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + c.ExtLock.RLock() + buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() + b += 1 + + buf[b] = 44 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + xgb.Put32(buf[b:], uint32(Name)) + b += 4 + + return buf +} + // DeleteOutputModeCookie is a cookie used only for DeleteOutputMode requests. type DeleteOutputModeCookie struct { *xgb.Cookie @@ -2464,11 +2675,9 @@ type GetCrtcGammaReply struct { // padding: 1 bytes Size uint16 // padding: 22 bytes - Red []uint16 // size: xgb.Pad((int(Size) * 2)) - // alignment gap to multiple of 2 + Red []uint16 // size: xgb.Pad((int(Size) * 2)) Green []uint16 // size: xgb.Pad((int(Size) * 2)) - // alignment gap to multiple of 2 - Blue []uint16 // size: xgb.Pad((int(Size) * 2)) + Blue []uint16 // size: xgb.Pad((int(Size) * 2)) } // Reply blocks and returns the reply data for a GetCrtcGamma request. @@ -2507,16 +2716,12 @@ func getCrtcGammaReply(buf []byte) *GetCrtcGammaReply { b += 2 } - b = (b + 1) & ^1 // alignment gap - v.Green = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Green[i] = xgb.Get16(buf[b:]) b += 2 } - b = (b + 1) & ^1 // alignment gap - v.Blue = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Blue[i] = xgb.Get16(buf[b:]) @@ -2694,8 +2899,7 @@ type GetCrtcInfoReply struct { NumOutputs uint16 NumPossibleOutputs uint16 Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - // alignment gap to multiple of 4 - Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) + Possible []Output // size: xgb.Pad((int(NumPossibleOutputs) * 4)) } // Reply blocks and returns the reply data for a GetCrtcInfo request. @@ -2760,8 +2964,6 @@ func getCrtcInfoReply(buf []byte) *GetCrtcInfoReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Possible = make([]Output, v.NumPossibleOutputs) for i := 0; i < int(v.NumPossibleOutputs); i++ { v.Possible[i] = Output(xgb.Get32(buf[b:])) @@ -2962,6 +3164,122 @@ func getCrtcTransformRequest(c *xgb.Conn, Crtc Crtc) []byte { return buf } +// GetMonitorsCookie is a cookie used only for GetMonitors requests. +type GetMonitorsCookie struct { + *xgb.Cookie +} + +// GetMonitors sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMonitorsCookie.Reply() +func GetMonitors(c *xgb.Conn, Window xproto.Window, GetActive bool) GetMonitorsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetMonitors' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, true) + c.NewRequest(getMonitorsRequest(c, Window, GetActive), cookie) + return GetMonitorsCookie{cookie} +} + +// GetMonitorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func GetMonitorsUnchecked(c *xgb.Conn, Window xproto.Window, GetActive bool) GetMonitorsCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'GetMonitors' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, true) + c.NewRequest(getMonitorsRequest(c, Window, GetActive), cookie) + return GetMonitorsCookie{cookie} +} + +// GetMonitorsReply represents the data returned from a GetMonitors request. +type GetMonitorsReply struct { + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply + // padding: 1 bytes + Timestamp xproto.Timestamp + NMonitors uint32 + NOutputs uint32 + // padding: 12 bytes + Monitors []MonitorInfo // size: MonitorInfoListSize(Monitors) +} + +// Reply blocks and returns the reply data for a GetMonitors request. +func (cook GetMonitorsCookie) Reply() (*GetMonitorsReply, error) { + buf, err := cook.Cookie.Reply() + if err != nil { + return nil, err + } + if buf == nil { + return nil, nil + } + return getMonitorsReply(buf), nil +} + +// getMonitorsReply reads a byte slice into a GetMonitorsReply value. +func getMonitorsReply(buf []byte) *GetMonitorsReply { + v := new(GetMonitorsReply) + b := 1 // skip reply determinant + + b += 1 // padding + + v.Sequence = xgb.Get16(buf[b:]) + b += 2 + + v.Length = xgb.Get32(buf[b:]) // 4-byte units + b += 4 + + v.Timestamp = xproto.Timestamp(xgb.Get32(buf[b:])) + b += 4 + + v.NMonitors = xgb.Get32(buf[b:]) + b += 4 + + v.NOutputs = xgb.Get32(buf[b:]) + b += 4 + + b += 12 // padding + + v.Monitors = make([]MonitorInfo, v.NMonitors) + b += MonitorInfoReadList(buf[b:], v.Monitors) + + return v +} + +// Write request to wire for GetMonitors +// getMonitorsRequest writes a GetMonitors request to a byte slice. +func getMonitorsRequest(c *xgb.Conn, Window xproto.Window, GetActive bool) []byte { + size := 12 + b := 0 + buf := make([]byte, size) + + c.ExtLock.RLock() + buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() + b += 1 + + buf[b] = 42 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + if GetActive { + buf[b] = 1 + } else { + buf[b] = 0 + } + b += 1 + + return buf +} + // GetOutputInfoCookie is a cookie used only for GetOutputInfo requests. type GetOutputInfoCookie struct { *xgb.Cookie @@ -3009,12 +3327,10 @@ type GetOutputInfoReply struct { NumPreferred uint16 NumClones uint16 NameLen uint16 - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - // alignment gap to multiple of 4 - Modes []Mode // size: xgb.Pad((int(NumModes) * 4)) - // alignment gap to multiple of 4 - Clones []Output // size: xgb.Pad((int(NumClones) * 4)) - Name []byte // size: xgb.Pad((int(NameLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Modes []Mode // size: xgb.Pad((int(NumModes) * 4)) + Clones []Output // size: xgb.Pad((int(NumClones) * 4)) + Name []byte // size: xgb.Pad((int(NameLen) * 1)) } // Reply blocks and returns the reply data for a GetOutputInfo request. @@ -3082,16 +3398,12 @@ func getOutputInfoReply(buf []byte) *GetOutputInfoReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Modes = make([]Mode, v.NumModes) for i := 0; i < int(v.NumModes); i++ { v.Modes[i] = Mode(xgb.Get32(buf[b:])) b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Clones = make([]Output, v.NumClones) for i := 0; i < int(v.NumClones); i++ { v.Clones[i] = Output(xgb.Get32(buf[b:])) @@ -3551,14 +3863,11 @@ type GetProviderInfoReply struct { NumAssociatedProviders uint16 NameLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - // alignment gap to multiple of 4 - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - // alignment gap to multiple of 4 - AssociatedProviders []Provider // size: xgb.Pad((int(NumAssociatedProviders) * 4)) - // alignment gap to multiple of 4 - AssociatedCapability []uint32 // size: xgb.Pad((int(NumAssociatedProviders) * 4)) - Name string // size: xgb.Pad((int(NameLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + AssociatedProviders []Provider // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + AssociatedCapability []uint32 // size: xgb.Pad((int(NumAssociatedProviders) * 4)) + Name string // size: xgb.Pad((int(NameLen) * 1)) } // Reply blocks and returns the reply data for a GetProviderInfo request. @@ -3613,24 +3922,18 @@ func getProviderInfoReply(buf []byte) *GetProviderInfoReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = (b + 3) & ^3 // alignment gap - v.AssociatedProviders = make([]Provider, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedProviders[i] = Provider(xgb.Get32(buf[b:])) b += 4 } - b = (b + 3) & ^3 // alignment gap - v.AssociatedCapability = make([]uint32, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedCapability[i] = xgb.Get32(buf[b:]) @@ -3966,8 +4269,7 @@ type GetScreenInfoReply struct { Rate uint16 NInfo uint16 // padding: 2 bytes - Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) - // alignment gap to multiple of 2 + Sizes []ScreenSize // size: xgb.Pad((int(NSizes) * 8)) Rates []RefreshRates // size: RefreshRatesListSize(Rates) } @@ -4026,8 +4328,6 @@ func getScreenInfoReply(buf []byte) *GetScreenInfoReply { v.Sizes = make([]ScreenSize, v.NSizes) b += ScreenSizeReadList(buf[b:], v.Sizes) - b = (b + 1) & ^1 // alignment gap - v.Rates = make([]RefreshRates, (int(v.NInfo) - int(v.NSizes))) b += RefreshRatesReadList(buf[b:], v.Rates) @@ -4101,12 +4401,10 @@ type GetScreenResourcesReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - // alignment gap to multiple of 4 - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - // alignment gap to multiple of 4 - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } // Reply blocks and returns the reply data for a GetScreenResources request. @@ -4160,16 +4458,12 @@ func getScreenResourcesReply(buf []byte) *GetScreenResourcesReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Modes = make([]ModeInfo, v.NumModes) b += ModeInfoReadList(buf[b:], v.Modes) @@ -4247,12 +4541,10 @@ type GetScreenResourcesCurrentReply struct { NumModes uint16 NamesLen uint16 // padding: 8 bytes - Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) - // alignment gap to multiple of 4 - Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) - // alignment gap to multiple of 4 - Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) - Names []byte // size: xgb.Pad((int(NamesLen) * 1)) + Crtcs []Crtc // size: xgb.Pad((int(NumCrtcs) * 4)) + Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) + Modes []ModeInfo // size: xgb.Pad((int(NumModes) * 32)) + Names []byte // size: xgb.Pad((int(NamesLen) * 1)) } // Reply blocks and returns the reply data for a GetScreenResourcesCurrent request. @@ -4306,16 +4598,12 @@ func getScreenResourcesCurrentReply(buf []byte) *GetScreenResourcesCurrentReply b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(xgb.Get32(buf[b:])) b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Modes = make([]ModeInfo, v.NumModes) b += ModeInfoReadList(buf[b:], v.Modes) @@ -5254,7 +5542,7 @@ func (cook SetCrtcGammaCookie) Check() error { // Write request to wire for SetCrtcGamma // setCrtcGammaRequest writes a SetCrtcGamma request to a byte slice. func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := xgb.Pad((((((12 + xgb.Pad((int(Size) * 2))) + 2) + xgb.Pad((int(Size) * 2))) + 2) + xgb.Pad((int(Size) * 2)))) + size := xgb.Pad((((12 + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2))) + xgb.Pad((int(Size) * 2)))) b := 0 buf := make([]byte, size) @@ -5266,7 +5554,7 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree buf[b] = 24 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Crtc)) @@ -5282,23 +5570,17 @@ func setCrtcGammaRequest(c *xgb.Conn, Crtc Crtc, Size uint16, Red []uint16, Gree b += 2 } - b = (b + 1) & ^1 // alignment gap - for i := 0; i < int(Size); i++ { xgb.Put16(buf[b:], Green[i]) b += 2 } - b = (b + 1) & ^1 // alignment gap - for i := 0; i < int(Size); i++ { xgb.Put16(buf[b:], Blue[i]) b += 2 } - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // SetCrtcTransformCookie is a cookie used only for SetCrtcTransform requests. @@ -5385,6 +5667,73 @@ func setCrtcTransformRequest(c *xgb.Conn, Crtc Crtc, Transform render.Transform, return buf[:b] } +// SetMonitorCookie is a cookie used only for SetMonitor requests. +type SetMonitorCookie struct { + *xgb.Cookie +} + +// SetMonitor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. +func SetMonitor(c *xgb.Conn, Window xproto.Window, Monitorinfo MonitorInfo) SetMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetMonitor' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(false, false) + c.NewRequest(setMonitorRequest(c, Window, Monitorinfo), cookie) + return SetMonitorCookie{cookie} +} + +// SetMonitorChecked sends a checked request. +// If an error occurs, it can be retrieved using SetMonitorCookie.Check() +func SetMonitorChecked(c *xgb.Conn, Window xproto.Window, Monitorinfo MonitorInfo) SetMonitorCookie { + c.ExtLock.RLock() + defer c.ExtLock.RUnlock() + if _, ok := c.Extensions["RANDR"]; !ok { + panic("Cannot issue request 'SetMonitor' using the uninitialized extension 'RANDR'. randr.Init(connObj) must be called first.") + } + cookie := c.NewCookie(true, false) + c.NewRequest(setMonitorRequest(c, Window, Monitorinfo), cookie) + return SetMonitorCookie{cookie} +} + +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. +func (cook SetMonitorCookie) Check() error { + return cook.Cookie.Check() +} + +// Write request to wire for SetMonitor +// setMonitorRequest writes a SetMonitor request to a byte slice. +func setMonitorRequest(c *xgb.Conn, Window xproto.Window, Monitorinfo MonitorInfo) []byte { + size := xgb.Pad((8 + (24 + xgb.Pad((int(Monitorinfo.NOutput) * 4))))) + b := 0 + buf := make([]byte, size) + + c.ExtLock.RLock() + buf[b] = c.Extensions["RANDR"] + c.ExtLock.RUnlock() + b += 1 + + buf[b] = 43 // request opcode + b += 1 + + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units + b += 2 + + xgb.Put32(buf[b:], uint32(Window)) + b += 4 + + { + structBytes := Monitorinfo.Bytes() + copy(buf[b:], structBytes) + b += len(structBytes) + } + + return buf +} + // SetOutputPrimaryCookie is a cookie used only for SetOutputPrimary requests. type SetOutputPrimaryCookie struct { *xgb.Cookie diff --git a/nexgb/record/record.go b/nexgb/record/record.go index 5469170..1cb022b 100644 --- a/nexgb/record/record.go +++ b/nexgb/record/record.go @@ -554,7 +554,7 @@ func (cook CreateContextCookie) Check() error { // Write request to wire for CreateContext // createContextRequest writes a CreateContext request to a byte slice. func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { - size := xgb.Pad((((20 + xgb.Pad((int(NumClientSpecs) * 4))) + 4) + xgb.Pad((int(NumRanges) * 24)))) + size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -566,7 +566,7 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea buf[b] = 1 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Context)) @@ -588,13 +588,9 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea b += 4 } - b = (b + 3) & ^3 // alignment gap - b += RangeListBytes(buf[b:], Ranges) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // DisableContextCookie is a cookie used only for DisableContext requests. @@ -1099,7 +1095,7 @@ func (cook RegisterClientsCookie) Check() error { // Write request to wire for RegisterClients // registerClientsRequest writes a RegisterClients request to a byte slice. func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte { - size := xgb.Pad((((20 + xgb.Pad((int(NumClientSpecs) * 4))) + 4) + xgb.Pad((int(NumRanges) * 24)))) + size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24)))) b := 0 buf := make([]byte, size) @@ -1111,7 +1107,7 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH buf[b] = 2 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Context)) @@ -1133,13 +1129,9 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH b += 4 } - b = (b + 3) & ^3 // alignment gap - b += RangeListBytes(buf[b:], Ranges) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // UnregisterClientsCookie is a cookie used only for UnregisterClients requests. diff --git a/nexgb/render/render.go b/nexgb/render/render.go index e15bd67..01ea481 100644 --- a/nexgb/render/render.go +++ b/nexgb/render/render.go @@ -1613,7 +1613,7 @@ func (cook AddGlyphsCookie) Check() error { // Write request to wire for AddGlyphs // addGlyphsRequest writes a AddGlyphs request to a byte slice. func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids []uint32, Glyphs []Glyphinfo, Data []byte) []byte { - size := xgb.Pad(((((12 + xgb.Pad((int(GlyphsLen) * 4))) + 4) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) + size := xgb.Pad((((12 + xgb.Pad((int(GlyphsLen) * 4))) + xgb.Pad((int(GlyphsLen) * 12))) + xgb.Pad((len(Data) * 1)))) b := 0 buf := make([]byte, size) @@ -1625,7 +1625,7 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids buf[b] = 20 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Glyphset)) @@ -1639,16 +1639,12 @@ func addGlyphsRequest(c *xgb.Conn, Glyphset Glyphset, GlyphsLen uint32, Glyphids b += 4 } - b = (b + 3) & ^3 // alignment gap - b += GlyphinfoListBytes(buf[b:], Glyphs) copy(buf[b:], Data[:len(Data)]) b += int(len(Data)) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // AddTrapsCookie is a cookie used only for AddTraps requests. @@ -1760,7 +1756,7 @@ func (cook ChangePictureCookie) Check() error { // Write request to wire for ChangePicture // changePictureRequest writes a ChangePicture request to a byte slice. func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -1780,6 +1776,7 @@ func changePictureRequest(c *xgb.Conn, Picture Picture, ValueMask uint32, ValueL xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -2240,7 +2237,7 @@ func (cook CreateConicalGradientCookie) Check() error { // Write request to wire for CreateConicalGradient // createConicalGradientRequest writes a CreateConicalGradient request to a byte slice. func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, Angle Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad((((24 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad(((24 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2252,7 +2249,7 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, buf[b] = 36 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2275,13 +2272,9 @@ func createConicalGradientRequest(c *xgb.Conn, Picture Picture, Center Pointfix, b += 4 } - b = (b + 3) & ^3 // alignment gap - b += ColorListBytes(buf[b:], Colors) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // CreateCursorCookie is a cookie used only for CreateCursor requests. @@ -2458,7 +2451,7 @@ func (cook CreateLinearGradientCookie) Check() error { // Write request to wire for CreateLinearGradient // createLinearGradientRequest writes a CreateLinearGradient request to a byte slice. func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 Pointfix, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad((((28 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad(((28 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2470,7 +2463,7 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P buf[b] = 34 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2496,13 +2489,9 @@ func createLinearGradientRequest(c *xgb.Conn, Picture Picture, P1 Pointfix, P2 P b += 4 } - b = (b + 3) & ^3 // alignment gap - b += ColorListBytes(buf[b:], Colors) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // CreatePictureCookie is a cookie used only for CreatePicture requests. @@ -2545,7 +2534,7 @@ func (cook CreatePictureCookie) Check() error { // Write request to wire for CreatePicture // createPictureRequest writes a CreatePicture request to a byte slice. func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Format Pictformat, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((16 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((20 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -2571,6 +2560,7 @@ func createPictureRequest(c *xgb.Conn, Pid Picture, Drawable xproto.Drawable, Fo xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -2620,7 +2610,7 @@ func (cook CreateRadialGradientCookie) Check() error { // Write request to wire for CreateRadialGradient // createRadialGradientRequest writes a CreateRadialGradient request to a byte slice. func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, Outer Pointfix, InnerRadius Fixed, OuterRadius Fixed, NumStops uint32, Stops []Fixed, Colors []Color) []byte { - size := xgb.Pad((((36 + xgb.Pad((int(NumStops) * 4))) + 4) + xgb.Pad((int(NumStops) * 8)))) + size := xgb.Pad(((36 + xgb.Pad((int(NumStops) * 4))) + xgb.Pad((int(NumStops) * 8)))) b := 0 buf := make([]byte, size) @@ -2632,7 +2622,7 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O buf[b] = 35 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put32(buf[b:], uint32(Picture)) @@ -2664,13 +2654,9 @@ func createRadialGradientRequest(c *xgb.Conn, Picture Picture, Inner Pointfix, O b += 4 } - b = (b + 3) & ^3 // alignment gap - b += ColorListBytes(buf[b:], Colors) - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // CreateSolidFillCookie is a cookie used only for CreateSolidFill requests. @@ -3156,11 +3142,9 @@ type QueryPictFormatsReply struct { NumVisuals uint32 NumSubpixel uint32 // padding: 4 bytes - Formats []Pictforminfo // size: xgb.Pad((int(NumFormats) * 28)) - // alignment gap to multiple of 4 - Screens []Pictscreen // size: PictscreenListSize(Screens) - // alignment gap to multiple of 4 - Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) + Formats []Pictforminfo // size: xgb.Pad((int(NumFormats) * 28)) + Screens []Pictscreen // size: PictscreenListSize(Screens) + Subpixels []uint32 // size: xgb.Pad((int(NumSubpixel) * 4)) } // Reply blocks and returns the reply data for a QueryPictFormats request. @@ -3208,13 +3192,9 @@ func queryPictFormatsReply(buf []byte) *QueryPictFormatsReply { v.Formats = make([]Pictforminfo, v.NumFormats) b += PictforminfoReadList(buf[b:], v.Formats) - b = (b + 3) & ^3 // alignment gap - v.Screens = make([]Pictscreen, v.NumScreens) b += PictscreenReadList(buf[b:], v.Screens) - b = (b + 3) & ^3 // alignment gap - v.Subpixels = make([]uint32, v.NumSubpixel) for i := 0; i < int(v.NumSubpixel); i++ { v.Subpixels[i] = xgb.Get32(buf[b:]) diff --git a/nexgb/screensaver/screensaver.go b/nexgb/screensaver/screensaver.go index 418576c..0e9511f 100644 --- a/nexgb/screensaver/screensaver.go +++ b/nexgb/screensaver/screensaver.go @@ -513,7 +513,7 @@ func (cook SetAttributesCookie) Check() error { // Write request to wire for SetAttributes // setAttributesRequest writes a SetAttributes request to a byte slice. func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((28 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -557,6 +557,7 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1 xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 diff --git a/nexgb/xf86dri/xf86dri.go b/nexgb/xf86dri/xf86dri.go index 51c9322..06f49a0 100644 --- a/nexgb/xf86dri/xf86dri.go +++ b/nexgb/xf86dri/xf86dri.go @@ -896,8 +896,7 @@ type GetDrawableInfoReply struct { BackY int16 NumBackClipRects uint32 ClipRects []DrmClipRect // size: xgb.Pad((int(NumClipRects) * 8)) - // alignment gap to multiple of 4 - BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) + BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8)) } // Reply blocks and returns the reply data for a GetDrawableInfo request. @@ -958,8 +957,6 @@ func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply { v.ClipRects = make([]DrmClipRect, v.NumClipRects) b += DrmClipRectReadList(buf[b:], v.ClipRects) - b = (b + 3) & ^3 // alignment gap - v.BackClipRects = make([]DrmClipRect, v.NumBackClipRects) b += DrmClipRectReadList(buf[b:], v.BackClipRects) diff --git a/nexgb/xf86vidmode/xf86vidmode.go b/nexgb/xf86vidmode/xf86vidmode.go index 2829fd6..22e236f 100644 --- a/nexgb/xf86vidmode/xf86vidmode.go +++ b/nexgb/xf86vidmode/xf86vidmode.go @@ -1152,11 +1152,9 @@ type GetGammaRampReply struct { // padding: 1 bytes Size uint16 // padding: 22 bytes - Red []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) - // alignment gap to multiple of 2 + Red []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) Green []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) - // alignment gap to multiple of 2 - Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) + Blue []uint16 // size: xgb.Pad((((int(Size) + 1) & -2) * 2)) } // Reply blocks and returns the reply data for a GetGammaRamp request. @@ -1195,16 +1193,12 @@ func getGammaRampReply(buf []byte) *GetGammaRampReply { b += 2 } - b = (b + 1) & ^1 // alignment gap - v.Green = make([]uint16, ((int(v.Size) + 1) & -2)) for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { v.Green[i] = xgb.Get16(buf[b:]) b += 2 } - b = (b + 1) & ^1 // alignment gap - v.Blue = make([]uint16, ((int(v.Size) + 1) & -2)) for i := 0; i < int(((int(v.Size) + 1) & -2)); i++ { v.Blue[i] = xgb.Get16(buf[b:]) @@ -1532,8 +1526,7 @@ type GetMonitorReply struct { NumHsync byte NumVsync byte // padding: 20 bytes - Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) - // alignment gap to multiple of 4 + Hsync []Syncrange // size: xgb.Pad((int(NumHsync) * 4)) Vsync []Syncrange // size: xgb.Pad((int(NumVsync) * 4)) Vendor string // size: xgb.Pad((int(VendorLength) * 1)) AlignmentPad []byte // size: xgb.Pad(((((int(VendorLength) + 3) & -4) - int(VendorLength)) * 1)) @@ -1585,8 +1578,6 @@ func getMonitorReply(buf []byte) *GetMonitorReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Vsync = make([]Syncrange, v.NumVsync) for i := 0; i < int(v.NumVsync); i++ { v.Vsync[i] = Syncrange(xgb.Get32(buf[b:])) @@ -2280,7 +2271,7 @@ func (cook SetGammaRampCookie) Check() error { // Write request to wire for SetGammaRamp // setGammaRampRequest writes a SetGammaRamp request to a byte slice. func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, Green []uint16, Blue []uint16) []byte { - size := xgb.Pad((((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + 2) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + 2) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) + size := xgb.Pad((((8 + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2))) + xgb.Pad((((int(Size) + 1) & -2) * 2)))) b := 0 buf := make([]byte, size) @@ -2292,7 +2283,7 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, buf[b] = 18 // request opcode b += 1 - blen := b + xgb.Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units b += 2 xgb.Put16(buf[b:], Screen) @@ -2306,23 +2297,17 @@ func setGammaRampRequest(c *xgb.Conn, Screen uint16, Size uint16, Red []uint16, b += 2 } - b = (b + 1) & ^1 // alignment gap - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { xgb.Put16(buf[b:], Green[i]) b += 2 } - b = (b + 1) & ^1 // alignment gap - for i := 0; i < int(((int(Size) + 1) & -2)); i++ { xgb.Put16(buf[b:], Blue[i]) b += 2 } - b = xgb.Pad(b) - xgb.Put16(buf[blen:], uint16(b/4)) // write request size in 4-byte units - return buf[:b] + return buf } // SetViewPortCookie is a cookie used only for SetViewPort requests. diff --git a/nexgb/xfixes/xfixes.go b/nexgb/xfixes/xfixes.go index 0f9e4b0..440c3fd 100644 --- a/nexgb/xfixes/xfixes.go +++ b/nexgb/xfixes/xfixes.go @@ -1524,9 +1524,8 @@ type GetCursorImageAndNameReply struct { CursorAtom xproto.Atom Nbytes uint16 // padding: 2 bytes - Name string // size: xgb.Pad((int(Nbytes) * 1)) - // alignment gap to multiple of 4 CursorImage []uint32 // size: xgb.Pad(((int(Width) * int(Height)) * 4)) + Name string // size: xgb.Pad((int(Nbytes) * 1)) } // Reply blocks and returns the reply data for a GetCursorImageAndName request. @@ -1583,6 +1582,12 @@ func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { b += 2 // padding + v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) + for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { + v.CursorImage[i] = xgb.Get32(buf[b:]) + b += 4 + } + { byteString := make([]byte, v.Nbytes) copy(byteString[:v.Nbytes], buf[b:]) @@ -1590,14 +1595,6 @@ func getCursorImageAndNameReply(buf []byte) *GetCursorImageAndNameReply { b += int(v.Nbytes) } - b = (b + 3) & ^3 // alignment gap - - v.CursorImage = make([]uint32, (int(v.Width) * int(v.Height))) - for i := 0; i < int((int(v.Width) * int(v.Height))); i++ { - v.CursorImage[i] = xgb.Get32(buf[b:]) - b += 4 - } - return v } diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go index 58f54c8..d6957b7 100644 --- a/nexgb/xgbgen/field.go +++ b/nexgb/xgbgen/field.go @@ -76,7 +76,7 @@ func (p *PadField) Size() Size { type RequiredStartAlign struct { } -func (f *RequiredStartAlign) Initialize(p *Protocol) { } +func (f *RequiredStartAlign) Initialize(p *Protocol) {} func (f *RequiredStartAlign) SrcName() string { panic("illegal to take source name of a required_start_align field") @@ -94,10 +94,10 @@ func (f *RequiredStartAlign) Size() Size { return newFixedSize(0, true) } -func (f *RequiredStartAlign) Define(c *Context) { } +func (f *RequiredStartAlign) Define(c *Context) {} -func (f *RequiredStartAlign) Read(c *Context, prefix string) { } -func (f *RequiredStartAlign) Write(c *Context, prefix string) { } +func (f *RequiredStartAlign) Read(c *Context, prefix string) {} +func (f *RequiredStartAlign) Write(c *Context, prefix string) {} // SingleField represents most of the fields in an XML protocol description. // It corresponds to any single value. @@ -317,9 +317,9 @@ func (f *ValueField) Initialize(p *Protocol) { // SwitchField represents a 'switch' element in the XML protocol description // file. // Currently we translate this to a slice of uint32 and let the user sort -// through it. +// through it. type SwitchField struct { - xmlName string + xmlName string Name string MaskName string Expr Expression @@ -342,6 +342,7 @@ func (f *SwitchField) Size() Size { // TODO: size expression used here is not correct unless every element of // the switch is 32 bit long. This assumption holds for xproto but may not // hold for other protocols (xkb?) + listSize := newExpressionSize(&Function{ Name: "xgb.Pad", Expr: &BinaryOp{ @@ -357,7 +358,7 @@ func (f *SwitchField) Size() Size { }, }, }, true) - + return listSize } diff --git a/nexgb/xprint/xprint.go b/nexgb/xprint/xprint.go index d692aed..330003d 100644 --- a/nexgb/xprint/xprint.go +++ b/nexgb/xprint/xprint.go @@ -317,10 +317,12 @@ func NewPcontextId(c *xgb.Conn) (Pcontext, error) { } type Printer struct { - NameLen uint32 - Name []String8 // size: xgb.Pad((int(NameLen) * 1)) + NameLen uint32 + Name []String8 // size: xgb.Pad((int(NameLen) * 1)) + // alignment gap to multiple of 4 DescLen uint32 Description []String8 // size: xgb.Pad((int(DescLen) * 1)) + // alignment gap to multiple of 4 } // PrinterRead reads a byte slice into a Printer value. @@ -336,6 +338,8 @@ func PrinterRead(buf []byte, v *Printer) int { b += 1 } + b = (b + 3) & ^3 // alignment gap + v.DescLen = xgb.Get32(buf[b:]) b += 4 @@ -345,6 +349,8 @@ func PrinterRead(buf []byte, v *Printer) int { b += 1 } + b = (b + 3) & ^3 // alignment gap + return b } @@ -360,7 +366,7 @@ func PrinterReadList(buf []byte, dest []Printer) int { // Bytes writes a Printer value to a byte slice. func (v Printer) Bytes() []byte { - buf := make([]byte, (((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + xgb.Pad((int(v.DescLen) * 1)))) + buf := make([]byte, (((((4 + xgb.Pad((int(v.NameLen) * 1))) + 4) + 4) + xgb.Pad((int(v.DescLen) * 1))) + 4)) b := 0 xgb.Put32(buf[b:], v.NameLen) @@ -371,6 +377,8 @@ func (v Printer) Bytes() []byte { b += 1 } + b = (b + 3) & ^3 // alignment gap + xgb.Put32(buf[b:], v.DescLen) b += 4 @@ -379,6 +387,8 @@ func (v Printer) Bytes() []byte { b += 1 } + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -398,7 +408,7 @@ func PrinterListBytes(buf []byte, list []Printer) int { func PrinterListSize(list []Printer) int { size := 0 for _, item := range list { - size += (((4 + xgb.Pad((int(item.NameLen) * 1))) + 4) + xgb.Pad((int(item.DescLen) * 1))) + size += (((((4 + xgb.Pad((int(item.NameLen) * 1))) + 4) + 4) + xgb.Pad((int(item.DescLen) * 1))) + 4) } return size } @@ -1644,9 +1654,7 @@ type PrintInputSelectedReply struct { Length uint32 // number of bytes in this reply // padding: 1 bytes EventMask uint32 - EventList []uint32 AllEventsMask uint32 - AllEventsList []uint32 } // Reply blocks and returns the reply data for a PrintInputSelected request. @@ -1677,23 +1685,9 @@ func printInputSelectedReply(buf []byte) *PrintInputSelectedReply { v.EventMask = xgb.Get32(buf[b:]) b += 4 - v.EventList = make([]uint32, xgb.PopCount(int(v.EventMask))) - for i := 0; i < xgb.PopCount(int(v.EventMask)); i++ { - v.EventList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - v.AllEventsMask = xgb.Get32(buf[b:]) b += 4 - v.AllEventsList = make([]uint32, xgb.PopCount(int(v.AllEventsMask))) - for i := 0; i < xgb.PopCount(int(v.AllEventsMask)); i++ { - v.AllEventsList[i] = xgb.Get32(buf[b:]) - b += 4 - } - b = xgb.Pad(b) - return v } @@ -1761,7 +1755,7 @@ func (cook PrintPutDocumentDataCookie) Check() error { // Write request to wire for PrintPutDocumentData // printPutDocumentDataRequest writes a PrintPutDocumentData request to a byte slice. func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData uint32, LenFmt uint16, LenOptions uint16, Data []byte, DocFormat []String8, Options []String8) []byte { - size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((len(DocFormat) * 1))) + xgb.Pad((len(Options) * 1)))) + size := xgb.Pad((((16 + xgb.Pad((int(LenData) * 1))) + xgb.Pad((int(LenFmt) * 1))) + xgb.Pad((int(LenOptions) * 1)))) b := 0 buf := make([]byte, size) @@ -1791,12 +1785,12 @@ func printPutDocumentDataRequest(c *xgb.Conn, Drawable xproto.Drawable, LenData copy(buf[b:], Data[:LenData]) b += int(LenData) - for i := 0; i < int(len(DocFormat)); i++ { + for i := 0; i < int(LenFmt); i++ { buf[b] = byte(DocFormat[i]) b += 1 } - for i := 0; i < int(len(Options)); i++ { + for i := 0; i < int(LenOptions); i++ { buf[b] = byte(Options[i]) b += 1 } @@ -2065,27 +2059,27 @@ type PrintSelectInputCookie struct { // PrintSelectInput sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. -func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { +func PrintSelectInput(c *xgb.Conn, Context Pcontext, EventMask uint32) PrintSelectInputCookie { c.ExtLock.RLock() defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(false, false) - c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + c.NewRequest(printSelectInputRequest(c, Context, EventMask), cookie) return PrintSelectInputCookie{cookie} } // PrintSelectInputChecked sends a checked request. // If an error occurs, it can be retrieved using PrintSelectInputCookie.Check() -func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) PrintSelectInputCookie { +func PrintSelectInputChecked(c *xgb.Conn, Context Pcontext, EventMask uint32) PrintSelectInputCookie { c.ExtLock.RLock() defer c.ExtLock.RUnlock() if _, ok := c.Extensions["XpExtension"]; !ok { panic("Cannot issue request 'PrintSelectInput' using the uninitialized extension 'XpExtension'. xprint.Init(connObj) must be called first.") } cookie := c.NewCookie(true, false) - c.NewRequest(printSelectInputRequest(c, Context, EventMask, EventList), cookie) + c.NewRequest(printSelectInputRequest(c, Context, EventMask), cookie) return PrintSelectInputCookie{cookie} } @@ -2097,8 +2091,8 @@ func (cook PrintSelectInputCookie) Check() error { // Write request to wire for PrintSelectInput // printSelectInputRequest writes a PrintSelectInput request to a byte slice. -func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, EventList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(EventMask))))))) +func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32) []byte { + size := 12 b := 0 buf := make([]byte, size) @@ -2118,11 +2112,6 @@ func printSelectInputRequest(c *xgb.Conn, Context Pcontext, EventMask uint32, Ev xgb.Put32(buf[b:], EventMask) b += 4 - for i := 0; i < xgb.PopCount(int(EventMask)); i++ { - xgb.Put32(buf[b:], EventList[i]) - b += 4 - } - b = xgb.Pad(b) return buf } diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 716c49b..237f3cb 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -343,6 +343,8 @@ const ( BlankingDefault = 2 ) +type Bool32 uint32 + type Button byte const ( @@ -1204,6 +1206,10 @@ func NewColormapId(c *xgb.Conn) (Colormap, error) { return Colormap(id), nil } +const ( + ColormapNone = 0 +) + // BadColormap is the error number for a BadColormap. const BadColormap = 12 @@ -1242,10 +1248,6 @@ func init() { xgb.NewErrorFuncs[12] = ColormapErrorNew } -const ( - ColormapNone = 0 -) - const ( ColormapAllocNone = 0 ColormapAllocAll = 1 @@ -2474,6 +2476,10 @@ func NewFontId(c *xgb.Conn) (Font, error) { return Font(id), nil } +const ( + FontNone = 0 +) + // BadFont is the error number for a BadFont. const BadFont = 7 @@ -2512,10 +2518,6 @@ func init() { xgb.NewErrorFuncs[7] = FontErrorNew } -const ( - FontNone = 0 -) - const ( FontDrawLeftToRight = 0 FontDrawRightToLeft = 1 @@ -3046,6 +3048,7 @@ type Host struct { // padding: 1 bytes AddressLen uint16 Address []byte // size: xgb.Pad((int(AddressLen) * 1)) + // alignment gap to multiple of 4 } // HostRead reads a byte slice into a Host value. @@ -3064,6 +3067,8 @@ func HostRead(buf []byte, v *Host) int { copy(v.Address[:v.AddressLen], buf[b:]) b += int(v.AddressLen) + b = (b + 3) & ^3 // alignment gap + return b } @@ -3079,7 +3084,7 @@ func HostReadList(buf []byte, dest []Host) int { // Bytes writes a Host value to a byte slice. func (v Host) Bytes() []byte { - buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) + buf := make([]byte, ((4 + xgb.Pad((int(v.AddressLen) * 1))) + 4)) b := 0 buf[b] = v.Family @@ -3093,6 +3098,8 @@ func (v Host) Bytes() []byte { copy(buf[b:], v.Address[:v.AddressLen]) b += int(v.AddressLen) + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -3112,7 +3119,7 @@ func HostListBytes(buf []byte, list []Host) int { func HostListSize(list []Host) int { size := 0 for _, item := range list { - size += (4 + xgb.Pad((int(item.AddressLen) * 1))) + size += ((4 + xgb.Pad((int(item.AddressLen) * 1))) + 4) } return size } @@ -3445,6 +3452,8 @@ func init() { type Keycode byte +type Keycode32 uint32 + // KeymapNotify is the event number for a KeymapNotifyEvent. const KeymapNotify = 11 @@ -5568,9 +5577,8 @@ type SetupInfo struct { // padding: 4 bytes Vendor string // size: xgb.Pad((int(VendorLen) * 1)) // alignment gap to multiple of 4 - PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) - // alignment gap to multiple of 4 - Roots []ScreenInfo // size: ScreenInfoListSize(Roots) + PixmapFormats []Format // size: xgb.Pad((int(PixmapFormatsLen) * 8)) + Roots []ScreenInfo // size: ScreenInfoListSize(Roots) } // SetupInfoRead reads a byte slice into a SetupInfo value. @@ -5647,8 +5655,6 @@ func SetupInfoRead(buf []byte, v *SetupInfo) int { v.PixmapFormats = make([]Format, v.PixmapFormatsLen) b += FormatReadList(buf[b:], v.PixmapFormats) - b = (b + 3) & ^3 // alignment gap - v.Roots = make([]ScreenInfo, v.RootsLen) b += ScreenInfoReadList(buf[b:], v.Roots) @@ -5667,7 +5673,7 @@ func SetupInfoReadList(buf []byte, dest []SetupInfo) int { // Bytes writes a SetupInfo value to a byte slice. func (v SetupInfo) Bytes() []byte { - buf := make([]byte, (((((40 + xgb.Pad((int(v.VendorLen) * 1))) + 4) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + 4) + ScreenInfoListSize(v.Roots))) + buf := make([]byte, ((((40 + xgb.Pad((int(v.VendorLen) * 1))) + 4) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) b := 0 buf[b] = v.Status @@ -5735,8 +5741,6 @@ func (v SetupInfo) Bytes() []byte { b += FormatListBytes(buf[b:], v.PixmapFormats) - b = (b + 3) & ^3 // alignment gap - b += ScreenInfoListBytes(buf[b:], v.Roots) return buf[:b] @@ -5758,7 +5762,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { func SetupInfoListSize(list []SetupInfo) int { size := 0 for _, item := range list { - size += (((((40 + xgb.Pad((int(item.VendorLen) * 1))) + 4) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + 4) + ScreenInfoListSize(item.Roots)) + size += ((((40 + xgb.Pad((int(item.VendorLen) * 1))) + 4) + xgb.Pad((int(item.PixmapFormatsLen) * 8))) + ScreenInfoListSize(item.Roots)) } return size } @@ -6588,8 +6592,7 @@ type AllocColorCellsReply struct { MasksLen uint16 // padding: 20 bytes Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) - // alignment gap to multiple of 4 - Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) + Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) } // Reply blocks and returns the reply data for a AllocColorCells request. @@ -6631,8 +6634,6 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Masks = make([]uint32, v.MasksLen) for i := 0; i < int(v.MasksLen); i++ { v.Masks[i] = xgb.Get32(buf[b:]) @@ -7091,7 +7092,7 @@ func (cook ChangeGCCookie) Check() error { // Write request to wire for ChangeGC // changeGCRequest writes a ChangeGC request to a byte slice. func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -7108,6 +7109,7 @@ func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uin xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -7204,7 +7206,7 @@ func (cook ChangeKeyboardControlCookie) Check() error { // Write request to wire for ChangeKeyboardControl // changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((8 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -7218,6 +7220,7 @@ func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uin xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -7499,7 +7502,7 @@ func (cook ChangeWindowAttributesCookie) Check() error { // Write request to wire for ChangeWindowAttributes // changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -7516,6 +7519,7 @@ func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -7717,7 +7721,7 @@ func (cook ConfigureWindowCookie) Check() error { // Write request to wire for ConfigureWindow // configureWindowRequest writes a ConfigureWindow request to a byte slice. func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { - size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((12 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -8221,7 +8225,7 @@ func (cook CreateGCCookie) Check() error { // Write request to wire for CreateGC // createGCRequest writes a CreateGC request to a byte slice. func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((16 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -8241,6 +8245,7 @@ func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uin xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -8416,7 +8421,7 @@ func (cook CreateWindowCookie) Check() error { // Write request to wire for CreateWindow // createWindowRequest writes a CreateWindow request to a byte slice. func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { - size := xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) + size := xgb.Pad((32 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))) b := 0 buf := make([]byte, size) @@ -8458,6 +8463,7 @@ func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X i xgb.Put32(buf[b:], ValueMask) b += 4 + for i := 0; i < xgb.PopCount(int(ValueMask)); i++ { xgb.Put32(buf[b:], ValueList[i]) b += 4 @@ -12904,8 +12910,7 @@ type QueryFontReply struct { FontDescent int16 CharInfosLen uint32 Properties []Fontprop // size: xgb.Pad((int(PropertiesLen) * 8)) - // alignment gap to multiple of 4 - CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) + CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) } // Reply blocks and returns the reply data for a QueryFont request. @@ -12983,8 +12988,6 @@ func queryFontReply(buf []byte) *QueryFontReply { v.Properties = make([]Fontprop, v.PropertiesLen) b += FontpropReadList(buf[b:], v.Properties) - b = (b + 3) & ^3 // alignment gap - v.CharInfos = make([]Charinfo, v.CharInfosLen) b += CharinfoReadList(buf[b:], v.CharInfos) diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 1afcc10..c237857 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -41,7 +41,9 @@ type ListItem struct { ObjectContextLen uint32 DataContextLen uint32 ObjectContext string // size: xgb.Pad((int(ObjectContextLen) * 1)) - DataContext string // size: xgb.Pad((int(DataContextLen) * 1)) + // alignment gap to multiple of 4 + DataContext string // size: xgb.Pad((int(DataContextLen) * 1)) + // alignment gap to multiple of 4 } // ListItemRead reads a byte slice into a ListItem value. @@ -64,6 +66,8 @@ func ListItemRead(buf []byte, v *ListItem) int { b += int(v.ObjectContextLen) } + b = (b + 3) & ^3 // alignment gap + { byteString := make([]byte, v.DataContextLen) copy(byteString[:v.DataContextLen], buf[b:]) @@ -71,6 +75,8 @@ func ListItemRead(buf []byte, v *ListItem) int { b += int(v.DataContextLen) } + b = (b + 3) & ^3 // alignment gap + return b } @@ -86,7 +92,7 @@ func ListItemReadList(buf []byte, dest []ListItem) int { // Bytes writes a ListItem value to a byte slice. func (v ListItem) Bytes() []byte { - buf := make([]byte, ((12 + xgb.Pad((int(v.ObjectContextLen) * 1))) + xgb.Pad((int(v.DataContextLen) * 1)))) + buf := make([]byte, ((((12 + xgb.Pad((int(v.ObjectContextLen) * 1))) + 4) + xgb.Pad((int(v.DataContextLen) * 1))) + 4)) b := 0 xgb.Put32(buf[b:], uint32(v.Name)) @@ -101,9 +107,13 @@ func (v ListItem) Bytes() []byte { copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) b += int(v.ObjectContextLen) + b = (b + 3) & ^3 // alignment gap + copy(buf[b:], v.DataContext[:v.DataContextLen]) b += int(v.DataContextLen) + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -123,7 +133,7 @@ func ListItemListBytes(buf []byte, list []ListItem) int { func ListItemListSize(list []ListItem) int { size := 0 for _, item := range list { - size += ((12 + xgb.Pad((int(item.ObjectContextLen) * 1))) + xgb.Pad((int(item.DataContextLen) * 1))) + size += ((((12 + xgb.Pad((int(item.ObjectContextLen) * 1))) + 4) + xgb.Pad((int(item.DataContextLen) * 1))) + 4) } return size } diff --git a/nexgb/xv/xv.go b/nexgb/xv/xv.go index f0d3f3a..69a0549 100644 --- a/nexgb/xv/xv.go +++ b/nexgb/xv/xv.go @@ -45,7 +45,7 @@ type AdaptorInfo struct { Type byte // padding: 1 bytes Name string // size: xgb.Pad((int(NameSize) * 1)) - // padding: 0 bytes + // alignment gap to multiple of 4 Formats []Format // size: xgb.Pad((int(NumFormats) * 8)) } @@ -77,7 +77,7 @@ func AdaptorInfoRead(buf []byte, v *AdaptorInfo) int { b += int(v.NameSize) } - b += 0 // padding + b = (b + 3) & ^3 // alignment gap v.Formats = make([]Format, v.NumFormats) b += FormatReadList(buf[b:], v.Formats) @@ -97,7 +97,7 @@ func AdaptorInfoReadList(buf []byte, dest []AdaptorInfo) int { // Bytes writes a AdaptorInfo value to a byte slice. func (v AdaptorInfo) Bytes() []byte { - buf := make([]byte, (((12 + xgb.Pad((int(v.NameSize) * 1))) + 0) + xgb.Pad((int(v.NumFormats) * 8)))) + buf := make([]byte, (((12 + xgb.Pad((int(v.NameSize) * 1))) + 4) + xgb.Pad((int(v.NumFormats) * 8)))) b := 0 xgb.Put32(buf[b:], uint32(v.BaseId)) @@ -120,7 +120,7 @@ func (v AdaptorInfo) Bytes() []byte { copy(buf[b:], v.Name[:v.NameSize]) b += int(v.NameSize) - b += 0 // padding + b = (b + 3) & ^3 // alignment gap b += FormatListBytes(buf[b:], v.Formats) @@ -143,7 +143,7 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { func AdaptorInfoListSize(list []AdaptorInfo) int { size := 0 for _, item := range list { - size += (((12 + xgb.Pad((int(item.NameSize) * 1))) + 0) + xgb.Pad((int(item.NumFormats) * 8))) + size += (((12 + xgb.Pad((int(item.NameSize) * 1))) + 4) + xgb.Pad((int(item.NumFormats) * 8))) } return size } @@ -159,6 +159,7 @@ type AttributeInfo struct { Max int32 Size uint32 Name string // size: xgb.Pad((int(Size) * 1)) + // alignment gap to multiple of 4 } // AttributeInfoRead reads a byte slice into a AttributeInfo value. @@ -184,6 +185,8 @@ func AttributeInfoRead(buf []byte, v *AttributeInfo) int { b += int(v.Size) } + b = (b + 3) & ^3 // alignment gap + return b } @@ -199,7 +202,7 @@ func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int { // Bytes writes a AttributeInfo value to a byte slice. func (v AttributeInfo) Bytes() []byte { - buf := make([]byte, (16 + xgb.Pad((int(v.Size) * 1)))) + buf := make([]byte, ((16 + xgb.Pad((int(v.Size) * 1))) + 4)) b := 0 xgb.Put32(buf[b:], v.Flags) @@ -217,6 +220,8 @@ func (v AttributeInfo) Bytes() []byte { copy(buf[b:], v.Name[:v.Size]) b += int(v.Size) + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -236,7 +241,7 @@ func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { func AttributeInfoListSize(list []AttributeInfo) int { size := 0 for _, item := range list { - size += (16 + xgb.Pad((int(item.Size) * 1))) + size += ((16 + xgb.Pad((int(item.Size) * 1))) + 4) } return size } @@ -397,6 +402,7 @@ type EncodingInfo struct { // padding: 2 bytes Rate Rational Name string // size: xgb.Pad((int(NameSize) * 1)) + // alignment gap to multiple of 4 } // EncodingInfoRead reads a byte slice into a EncodingInfo value. @@ -427,6 +433,8 @@ func EncodingInfoRead(buf []byte, v *EncodingInfo) int { b += int(v.NameSize) } + b = (b + 3) & ^3 // alignment gap + return b } @@ -442,7 +450,7 @@ func EncodingInfoReadList(buf []byte, dest []EncodingInfo) int { // Bytes writes a EncodingInfo value to a byte slice. func (v EncodingInfo) Bytes() []byte { - buf := make([]byte, (20 + xgb.Pad((int(v.NameSize) * 1)))) + buf := make([]byte, ((20 + xgb.Pad((int(v.NameSize) * 1))) + 4)) b := 0 xgb.Put32(buf[b:], uint32(v.Encoding)) @@ -468,6 +476,8 @@ func (v EncodingInfo) Bytes() []byte { copy(buf[b:], v.Name[:v.NameSize]) b += int(v.NameSize) + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -487,7 +497,7 @@ func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { func EncodingInfoListSize(list []EncodingInfo) int { size := 0 for _, item := range list { - size += (20 + xgb.Pad((int(item.NameSize) * 1))) + size += ((20 + xgb.Pad((int(item.NameSize) * 1))) + 4) } return size } @@ -567,9 +577,8 @@ type Image struct { DataSize uint32 NumPlanes uint32 Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) - // alignment gap to multiple of 4 - Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) - Data []byte // size: xgb.Pad((int(DataSize) * 1)) + Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) + Data []byte // size: xgb.Pad((int(DataSize) * 1)) } // ImageRead reads a byte slice into a Image value. @@ -597,8 +606,6 @@ func ImageRead(buf []byte, v *Image) int { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Offsets = make([]uint32, v.NumPlanes) for i := 0; i < int(v.NumPlanes); i++ { v.Offsets[i] = xgb.Get32(buf[b:]) @@ -624,7 +631,7 @@ func ImageReadList(buf []byte, dest []Image) int { // Bytes writes a Image value to a byte slice. func (v Image) Bytes() []byte { - buf := make([]byte, ((((16 + xgb.Pad((int(v.NumPlanes) * 4))) + 4) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) + buf := make([]byte, (((16 + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.NumPlanes) * 4))) + xgb.Pad((int(v.DataSize) * 1)))) b := 0 xgb.Put32(buf[b:], v.Id) @@ -647,8 +654,6 @@ func (v Image) Bytes() []byte { b += 4 } - b = (b + 3) & ^3 // alignment gap - for i := 0; i < int(v.NumPlanes); i++ { xgb.Put32(buf[b:], v.Offsets[i]) b += 4 @@ -676,7 +681,7 @@ func ImageListBytes(buf []byte, list []Image) int { func ImageListSize(list []Image) int { size := 0 for _, item := range list { - size += ((((16 + xgb.Pad((int(item.NumPlanes) * 4))) + 4) + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.DataSize) * 1))) + size += (((16 + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.NumPlanes) * 4))) + xgb.Pad((int(item.DataSize) * 1))) } return size } @@ -2416,7 +2421,6 @@ type QueryImageAttributesReply struct { Height uint16 // padding: 12 bytes Pitches []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) - // alignment gap to multiple of 4 Offsets []uint32 // size: xgb.Pad((int(NumPlanes) * 4)) } @@ -2465,8 +2469,6 @@ func queryImageAttributesReply(buf []byte) *QueryImageAttributesReply { b += 4 } - b = (b + 3) & ^3 // alignment gap - v.Offsets = make([]uint32, v.NumPlanes) for i := 0; i < int(v.NumPlanes); i++ { v.Offsets[i] = xgb.Get32(buf[b:])